compute-gen.go 6.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243124244124245124246124247124248124249124250124251124252124253124254124255124256124257124258124259124260124261124262124263124264124265124266124267124268124269124270124271124272124273124274124275124276124277124278124279124280124281124282124283124284124285124286124287124288124289124290124291124292124293124294124295124296124297124298124299124300124301124302124303124304124305124306124307124308124309124310124311124312124313124314124315124316124317124318124319124320124321124322124323124324124325124326124327124328124329124330124331124332124333124334124335124336124337124338124339124340124341124342124343124344124345124346124347124348124349124350124351124352124353124354124355124356124357124358124359124360124361124362124363124364124365124366124367124368124369124370124371124372124373124374124375124376124377124378124379124380124381124382124383124384124385124386124387124388124389124390124391124392124393124394124395124396124397124398124399124400124401124402124403124404124405124406124407124408124409124410124411124412124413124414124415124416124417124418124419124420124421124422124423124424124425124426124427124428124429124430124431124432124433124434124435124436124437124438124439124440124441124442124443124444124445124446124447124448124449124450124451124452124453124454124455124456124457124458124459124460124461124462124463124464124465124466124467124468124469124470124471124472124473124474124475124476124477124478124479124480124481124482124483124484124485124486124487124488124489124490124491124492124493124494124495124496124497124498124499124500124501124502124503124504124505124506124507124508124509124510124511124512124513124514124515124516124517124518124519124520124521124522124523124524124525124526124527124528124529124530124531124532124533124534124535124536124537124538124539124540124541124542124543124544124545124546124547124548124549124550124551124552124553124554124555124556124557124558124559124560124561124562124563124564124565124566124567124568124569124570124571124572124573124574124575124576124577124578124579124580124581124582124583124584124585124586124587124588124589124590124591124592124593124594124595124596124597124598124599124600124601124602124603124604124605124606124607124608124609124610124611124612124613124614124615124616124617124618124619124620124621124622124623124624124625124626124627124628124629124630124631124632124633124634124635124636124637124638124639124640124641124642124643124644124645124646124647124648124649124650124651124652124653124654124655124656124657124658124659124660124661124662124663124664124665124666124667124668124669124670124671124672124673124674124675124676124677124678124679124680124681124682124683124684124685124686124687124688124689124690124691124692124693124694124695124696124697124698124699124700124701124702124703124704124705124706124707124708124709124710124711124712124713124714124715124716124717124718124719124720124721124722124723124724124725124726124727124728124729124730124731124732124733124734124735124736124737124738124739124740124741124742124743124744124745124746124747124748124749124750124751124752124753124754124755124756124757124758124759124760124761124762124763124764124765124766124767124768124769124770124771124772124773124774124775124776124777124778124779124780124781124782124783124784124785124786124787124788124789124790124791124792124793124794124795124796124797124798124799124800124801124802124803124804124805124806124807124808124809124810124811124812124813124814124815124816124817124818124819124820124821124822124823124824124825124826124827124828124829124830124831124832124833124834124835124836124837124838124839124840124841124842124843124844124845124846124847124848124849124850124851124852124853124854124855124856124857124858124859124860124861124862124863124864124865124866124867124868124869124870124871124872124873124874124875124876124877124878124879124880124881124882124883124884124885124886124887124888124889124890124891124892124893124894124895124896124897124898124899124900124901124902124903124904124905124906124907124908124909124910124911124912124913124914124915124916124917124918124919124920124921124922124923124924124925124926124927124928124929124930124931124932124933124934124935124936124937124938124939124940124941124942124943124944124945124946124947124948124949124950124951124952124953124954124955124956124957124958124959124960124961124962124963124964124965124966124967124968124969124970124971124972124973124974124975124976124977124978124979124980124981124982124983124984124985124986124987124988124989124990124991124992124993124994124995124996124997124998124999125000125001125002125003125004125005125006125007125008125009125010125011125012125013125014125015125016125017125018125019125020125021125022125023125024125025125026125027125028125029125030125031125032125033125034125035125036125037125038125039125040125041125042125043125044125045125046125047125048125049125050125051125052125053125054125055125056125057125058125059125060125061125062125063125064125065125066125067125068125069125070125071125072125073125074125075125076125077125078125079125080125081125082125083125084125085125086125087125088125089125090125091125092125093125094125095125096125097125098125099125100125101125102125103125104125105125106125107125108125109125110125111125112125113125114125115125116125117125118125119125120125121125122125123125124125125125126125127125128125129125130125131125132125133125134125135125136125137125138125139125140125141125142125143125144125145125146125147125148125149125150125151125152125153125154125155125156125157125158125159125160125161125162125163125164125165125166125167125168125169125170125171125172125173125174125175125176125177125178125179125180125181125182125183125184125185125186125187125188125189125190125191125192125193125194125195125196125197125198125199125200125201125202125203125204125205125206125207125208125209125210125211125212125213125214125215125216125217125218125219125220125221125222125223125224125225125226125227125228125229125230125231125232125233125234125235125236125237125238125239125240125241125242125243125244125245125246125247125248125249125250125251125252125253125254125255125256125257125258125259125260125261125262125263125264125265125266125267125268125269125270125271125272125273125274125275125276125277125278125279125280125281125282125283125284125285125286125287125288125289125290125291125292125293125294125295125296125297125298125299125300125301125302125303125304125305125306125307125308125309125310125311125312125313125314125315125316125317125318125319125320125321125322125323125324125325125326125327125328125329125330125331125332125333125334125335125336125337125338125339125340125341125342125343125344125345125346125347125348125349125350125351125352125353125354125355125356125357125358125359125360125361125362125363125364125365125366125367125368125369125370125371125372125373125374125375125376125377125378125379125380125381125382125383125384125385125386125387125388125389125390125391125392125393125394125395125396125397125398125399125400125401125402125403125404125405125406125407125408125409125410125411125412125413125414125415125416125417125418125419125420125421125422125423125424125425125426125427125428125429125430125431125432125433125434125435125436125437125438125439125440125441125442125443125444125445125446125447125448125449125450125451125452125453125454125455125456125457125458125459125460125461125462125463125464125465125466125467125468125469125470125471125472125473125474125475125476125477125478125479125480125481125482125483125484125485125486125487125488125489125490125491125492125493125494125495125496125497125498125499125500125501125502125503125504125505125506125507125508125509125510125511125512125513125514125515125516125517125518125519125520125521125522125523125524125525125526125527125528125529125530125531125532125533125534125535125536125537125538125539125540125541125542125543125544125545125546125547125548125549125550125551125552125553125554125555125556125557125558125559125560125561125562125563125564125565125566125567125568125569125570125571125572125573125574125575125576125577125578125579125580125581125582125583125584125585125586125587125588125589125590125591125592125593125594125595125596125597125598125599125600125601125602125603125604125605125606125607125608125609125610125611125612125613125614125615125616125617125618125619125620125621125622125623125624125625125626125627125628125629125630125631125632125633125634125635125636125637125638125639125640125641125642125643125644125645125646125647125648125649125650125651125652125653125654125655125656125657125658125659125660125661125662125663125664125665125666125667125668125669125670125671125672125673125674125675125676125677125678125679125680125681125682125683125684125685125686125687125688125689125690125691125692125693125694125695125696125697125698125699125700125701125702125703125704125705125706125707125708125709125710125711125712125713125714125715125716125717125718125719125720125721125722125723125724125725125726125727125728125729125730125731125732125733125734125735125736125737125738125739125740125741125742125743125744125745125746125747125748125749125750125751125752125753125754125755125756125757125758125759125760125761125762125763125764125765125766125767125768125769125770125771125772125773125774125775125776125777125778125779125780125781125782125783125784125785125786125787125788125789125790125791125792125793125794125795125796125797125798125799125800125801125802125803125804125805125806125807125808125809125810125811125812125813125814125815125816125817125818125819125820125821125822125823125824125825125826125827125828125829125830125831125832125833125834125835125836125837125838125839125840125841125842125843125844125845125846125847125848125849125850125851125852125853125854125855125856125857125858125859125860125861125862125863125864125865125866125867125868125869125870125871125872125873125874125875125876125877125878125879125880125881125882125883125884125885125886125887125888125889125890125891125892125893125894125895125896125897125898125899125900125901125902125903125904125905125906125907125908125909125910125911125912125913125914125915125916125917125918125919125920125921125922125923125924125925125926125927125928125929125930125931125932125933125934125935125936125937125938125939125940125941125942125943125944125945125946125947125948125949125950125951125952125953125954125955125956125957125958125959125960125961125962125963125964125965125966125967125968125969125970125971125972125973125974125975125976125977125978125979125980125981125982125983125984125985125986125987125988125989125990125991125992125993125994125995125996125997125998125999126000126001126002126003126004126005126006126007126008126009126010126011126012126013126014126015126016126017126018126019126020126021126022126023126024126025126026126027126028126029126030126031126032126033126034126035126036126037126038126039126040126041126042126043126044126045126046126047126048126049126050126051126052126053126054126055126056126057126058126059126060126061126062126063126064126065126066126067126068126069126070126071126072126073126074126075126076126077126078126079126080126081126082126083126084126085126086126087126088126089126090126091126092126093126094126095126096126097126098126099126100126101126102126103126104126105126106126107126108126109126110126111126112126113126114126115126116126117126118126119126120126121126122126123126124126125126126126127126128126129126130126131126132126133126134126135126136126137126138126139126140126141126142126143126144126145126146126147126148126149126150126151126152126153126154126155126156126157126158126159126160126161126162126163126164126165126166126167126168126169126170126171126172126173126174126175126176126177126178126179126180126181126182126183126184126185126186126187126188126189126190126191126192126193126194126195126196126197126198126199126200126201126202126203126204126205126206126207126208126209126210126211126212126213126214126215126216126217126218126219126220126221126222126223126224126225126226126227126228126229126230126231126232126233126234126235126236126237126238126239126240126241126242126243126244126245126246126247126248126249126250126251126252126253126254126255126256126257126258126259126260126261126262126263126264126265126266126267126268126269126270126271126272126273126274126275126276126277126278126279126280126281126282126283126284126285126286126287126288126289126290126291126292126293126294126295126296126297126298126299126300126301126302126303126304126305126306126307126308126309126310126311126312126313126314126315126316126317126318126319126320126321126322126323126324126325126326126327126328126329126330126331126332126333126334126335126336126337126338126339126340126341126342126343126344126345126346126347126348126349126350126351126352126353126354126355126356126357126358126359126360126361126362126363126364126365126366126367126368126369126370126371126372126373126374126375126376126377126378126379126380126381126382126383126384126385126386126387126388126389126390126391126392126393126394126395126396126397126398126399126400126401126402126403126404126405126406126407126408126409126410126411126412126413126414126415126416126417126418126419126420126421126422126423126424126425126426126427126428126429126430126431126432126433126434126435126436126437126438126439126440126441126442126443126444126445126446126447126448126449126450126451126452126453126454126455126456126457126458126459126460126461126462126463126464126465126466126467126468126469126470126471126472126473126474126475126476126477126478126479126480126481126482126483126484126485126486126487126488126489126490126491126492126493126494126495126496126497126498126499126500126501126502126503126504126505126506126507126508126509126510126511126512126513126514126515126516126517126518126519126520126521126522126523126524126525126526126527126528126529126530126531126532126533126534126535126536126537126538126539126540126541126542126543126544126545126546126547126548126549126550126551126552126553126554126555126556126557126558126559126560126561126562126563126564126565126566126567126568126569126570126571126572126573126574126575126576126577126578126579126580126581126582126583126584126585126586126587126588126589126590126591126592126593126594126595126596126597126598126599126600126601126602126603126604126605126606126607126608126609126610126611126612126613126614126615126616126617126618126619126620126621126622126623126624126625126626126627126628126629126630126631126632126633126634126635126636126637126638126639126640126641126642126643126644126645126646126647126648126649126650126651126652126653126654126655126656126657126658126659126660126661126662126663126664126665126666126667126668126669126670126671126672126673126674126675126676126677126678126679126680126681126682126683126684126685126686126687126688126689126690126691126692126693126694126695126696126697126698126699126700126701126702126703126704126705126706126707126708126709126710126711126712126713126714126715126716126717126718126719126720126721126722126723126724126725126726126727126728126729126730126731126732126733126734126735126736126737126738126739126740126741126742126743126744126745126746126747126748126749126750126751126752126753126754126755126756126757126758126759126760126761126762126763126764126765126766126767126768126769126770126771126772126773126774126775126776126777126778126779126780126781126782126783126784126785126786126787126788126789126790126791126792126793126794126795126796126797126798126799126800126801126802126803126804126805126806126807126808126809126810126811126812126813126814126815126816126817126818126819126820126821126822126823126824126825126826126827126828126829126830126831126832126833126834126835126836126837126838126839126840126841126842126843126844126845126846126847126848126849126850126851126852126853126854126855126856126857126858126859126860126861126862126863126864126865126866126867126868126869126870126871126872126873126874126875126876126877126878126879126880126881126882126883126884126885126886126887126888126889126890126891126892126893126894126895126896126897126898126899126900126901126902126903126904126905126906126907126908126909126910126911126912126913126914126915126916126917126918126919126920126921126922126923126924126925126926126927126928126929126930126931126932126933126934126935126936126937126938126939126940126941126942126943126944126945126946126947126948126949126950126951126952126953126954126955126956126957126958126959126960126961126962126963126964126965126966126967126968126969126970126971126972126973126974126975126976126977126978126979126980126981126982126983126984126985126986126987126988126989126990126991126992126993126994126995126996126997126998126999127000127001127002127003127004127005127006127007127008127009127010127011127012127013127014127015127016127017127018127019127020127021127022127023127024127025127026127027127028127029127030127031127032127033127034127035127036127037127038127039127040127041127042127043127044127045127046127047127048127049127050127051127052127053127054127055127056127057127058127059127060127061127062127063127064127065127066127067127068127069127070127071127072127073127074127075127076127077127078127079127080127081127082127083127084127085127086127087127088127089127090127091127092127093127094127095127096127097127098127099127100127101127102127103127104127105127106127107127108127109127110127111127112127113127114127115127116127117127118127119127120127121127122127123127124127125127126127127127128127129127130127131127132127133127134127135127136127137127138127139127140127141127142127143127144127145127146127147127148127149127150127151127152127153127154127155127156127157127158127159127160127161127162127163127164127165127166127167127168127169127170127171127172127173127174127175127176127177127178127179127180127181127182127183127184127185127186127187127188127189127190127191127192127193127194127195127196127197127198127199127200127201127202127203127204127205127206127207127208127209127210127211127212127213127214127215127216127217127218127219127220127221127222127223127224127225127226127227127228127229127230127231127232127233127234127235127236127237127238127239127240127241127242127243127244127245127246127247127248127249127250127251127252127253127254127255127256127257127258127259127260127261127262127263127264127265127266127267127268127269127270127271127272127273127274127275127276127277127278127279127280127281127282127283127284127285127286127287127288127289127290127291127292127293127294127295127296127297127298127299127300127301127302127303127304127305127306127307127308127309127310127311127312127313127314127315127316127317127318127319127320127321127322127323127324127325127326127327127328127329127330127331127332127333127334127335127336127337127338127339127340127341127342127343127344127345127346127347127348127349127350127351127352127353127354127355127356127357127358127359127360127361127362127363127364127365127366127367127368127369127370127371127372127373127374127375127376127377127378127379127380127381127382127383127384127385127386127387127388127389127390127391127392127393127394127395127396127397127398127399127400127401127402127403127404127405127406127407127408127409127410127411127412127413127414127415127416127417127418127419127420127421127422127423127424127425127426127427127428127429127430127431127432127433127434127435127436127437127438127439127440127441127442127443127444127445127446127447127448127449127450127451127452127453127454127455127456127457127458127459127460127461127462127463127464127465127466127467127468127469127470127471127472127473127474127475127476127477127478127479127480127481127482127483127484127485127486127487127488127489127490127491127492127493127494127495127496127497127498127499127500127501127502127503127504127505127506127507127508127509127510127511127512127513127514127515127516127517127518127519127520127521127522127523127524127525127526127527127528127529127530127531127532127533127534127535127536127537127538127539127540127541127542127543127544127545127546127547127548127549127550127551127552127553127554127555127556127557127558127559127560127561127562127563127564127565127566127567127568127569127570127571127572127573127574127575127576127577127578127579127580127581127582127583127584127585127586127587127588127589127590127591127592127593127594127595127596127597127598127599127600127601127602127603127604127605127606127607127608127609127610127611127612127613127614127615127616127617127618127619127620127621127622127623127624127625127626127627127628127629127630127631127632127633127634127635127636127637127638127639127640127641127642127643127644127645127646127647127648127649127650127651127652127653127654127655127656127657127658127659127660127661127662127663127664127665127666127667127668127669127670127671127672127673127674127675127676127677127678127679127680127681127682127683127684127685127686127687127688127689127690127691127692127693127694127695127696127697127698127699127700127701127702127703127704127705127706127707127708127709127710127711127712127713127714127715127716127717127718127719127720127721127722127723127724127725127726127727127728127729127730127731127732127733127734127735127736127737127738127739127740127741127742127743127744127745127746127747127748127749127750127751127752127753127754127755127756127757127758127759127760127761127762127763127764127765127766127767127768127769127770127771127772127773127774127775127776127777127778127779127780127781127782127783127784127785127786127787127788127789127790127791127792127793127794127795127796127797127798127799127800127801127802127803127804127805127806127807127808127809127810127811127812127813127814127815127816127817127818127819127820127821127822127823127824127825127826127827127828127829127830127831127832127833127834127835127836127837127838127839127840127841127842127843127844127845127846127847127848127849127850127851127852127853127854127855127856127857127858127859127860127861127862127863127864127865127866127867127868127869127870127871127872127873127874127875127876127877127878127879127880127881127882127883127884127885127886127887127888127889127890127891127892127893127894127895127896127897127898127899127900127901127902127903127904127905127906127907127908127909127910127911127912127913127914127915127916127917127918127919127920127921127922127923127924127925127926127927127928127929127930127931127932127933127934127935127936127937127938127939127940127941127942127943127944127945127946127947127948127949127950127951127952127953127954127955127956127957127958127959127960127961127962127963127964127965127966127967127968127969127970127971127972127973127974127975127976127977127978127979127980127981127982127983127984127985127986127987127988127989127990127991127992127993127994127995127996127997127998127999128000128001128002128003128004128005128006128007128008128009128010128011128012128013128014128015128016128017128018128019128020128021128022128023128024128025128026128027128028128029128030128031128032128033128034128035128036128037128038128039128040128041128042128043128044128045128046128047128048128049128050128051128052128053128054128055128056128057128058128059128060128061128062128063128064128065128066128067128068128069128070128071128072128073128074128075128076128077128078128079128080128081128082128083128084128085128086128087128088128089128090128091128092128093128094128095128096128097128098128099128100128101128102128103128104128105128106128107128108128109128110128111128112128113128114128115128116128117128118128119128120128121128122128123128124128125128126128127128128128129128130128131128132128133128134128135128136128137128138128139128140128141128142128143128144128145128146128147128148128149128150128151128152128153128154128155128156128157128158128159128160128161128162128163128164128165128166128167128168128169128170128171128172128173128174128175128176128177128178128179128180128181128182128183128184128185128186128187128188128189128190128191128192128193128194128195128196128197128198128199128200128201128202128203128204128205128206128207128208128209128210128211128212128213128214128215128216128217128218128219128220128221128222128223128224128225128226128227128228128229128230128231128232128233128234128235128236128237128238128239128240128241128242128243128244128245128246128247128248128249128250128251128252128253128254128255128256128257128258128259128260128261128262128263128264128265128266128267128268128269128270128271128272128273128274128275128276128277128278128279128280128281128282128283128284128285128286128287128288128289128290128291128292128293128294128295128296128297128298128299128300128301128302128303128304128305128306128307128308128309128310128311128312128313128314128315128316128317128318128319128320128321128322128323128324128325128326128327128328128329128330128331128332128333128334128335128336128337128338128339128340128341128342128343128344128345128346128347128348128349128350128351128352128353128354128355128356128357128358128359128360128361128362128363128364128365128366128367128368128369128370128371128372128373128374128375128376128377128378128379128380128381128382128383128384128385128386128387128388128389128390128391128392128393128394128395128396128397128398128399128400128401128402128403128404128405128406128407128408128409128410128411128412128413128414128415128416128417128418128419128420128421128422128423128424128425128426128427128428128429128430128431128432128433128434128435128436128437128438128439128440128441128442128443128444128445128446128447128448128449128450128451128452128453128454128455128456128457128458128459128460128461128462128463128464128465128466128467128468128469128470128471128472128473128474128475128476128477128478128479128480128481128482128483128484128485128486128487128488128489128490128491128492128493128494128495128496128497128498128499128500128501128502128503128504128505128506128507128508128509128510128511128512128513128514128515128516128517128518128519128520128521128522128523128524128525128526128527128528128529128530128531128532128533128534128535128536128537128538128539128540128541128542128543128544128545128546128547128548128549128550128551128552128553128554128555128556128557128558128559128560128561128562128563128564128565128566128567128568128569128570128571128572128573128574128575128576128577128578128579128580128581128582128583128584128585128586128587128588128589128590128591128592128593128594128595128596128597128598128599128600128601128602128603128604128605128606128607128608128609128610128611128612128613128614128615128616128617128618128619128620128621128622128623128624128625128626128627128628128629128630128631128632128633128634128635128636128637128638128639128640128641128642128643128644128645128646128647128648128649128650128651128652128653128654128655128656128657128658128659128660128661128662128663128664128665128666128667128668128669128670128671128672128673128674128675128676128677128678128679128680128681128682128683128684128685128686128687128688128689128690128691128692128693128694128695128696128697128698128699128700128701128702128703128704128705128706128707128708128709128710128711128712128713128714128715128716128717128718128719128720128721128722128723128724128725128726128727128728128729128730128731128732128733128734128735128736128737128738128739128740128741128742128743128744128745128746128747128748128749128750128751128752128753128754128755128756128757128758128759128760128761128762128763128764128765128766128767128768128769128770128771128772128773128774128775128776128777128778128779128780128781128782128783128784128785128786128787128788128789128790128791128792128793128794128795128796128797128798128799128800128801128802128803128804128805128806128807128808128809128810128811128812128813128814128815128816128817128818128819128820128821128822128823128824128825128826128827128828128829128830128831128832128833128834128835128836128837128838128839128840128841128842128843128844128845128846128847128848128849128850128851128852128853128854128855128856128857128858128859128860128861128862128863128864128865128866128867128868128869128870128871128872128873128874128875128876128877128878128879128880128881128882128883128884128885128886128887128888128889128890128891128892128893128894128895128896128897128898128899128900128901128902128903128904128905128906128907128908128909128910128911128912128913128914128915128916128917128918128919128920128921128922128923128924128925128926128927128928128929128930128931128932128933128934128935128936128937128938128939128940128941128942128943128944128945128946128947128948128949128950128951128952128953128954128955128956128957128958128959128960128961128962128963128964128965128966128967128968128969128970128971128972128973128974128975128976128977128978128979128980128981128982128983128984128985128986128987128988128989128990128991128992128993128994128995128996128997128998128999129000129001129002129003129004129005129006129007129008129009129010129011129012129013129014129015129016129017129018129019129020129021129022129023129024129025129026129027129028129029129030129031129032129033129034129035129036129037129038129039129040129041129042129043129044129045129046129047129048129049129050129051129052129053129054129055129056129057129058129059129060129061129062129063129064129065129066129067129068129069129070129071129072129073129074129075129076129077129078129079129080129081129082129083129084129085129086129087129088129089129090129091129092129093129094129095129096129097129098129099129100129101129102129103129104129105129106129107129108129109129110129111129112129113129114129115129116129117129118129119129120129121129122129123129124129125129126129127129128129129129130129131129132129133129134129135129136129137129138129139129140129141129142129143129144129145129146129147129148129149129150129151129152129153129154129155129156129157129158129159129160129161129162129163129164129165129166129167129168129169129170129171129172129173129174129175129176129177129178129179129180129181129182129183129184129185129186129187129188129189129190129191129192129193129194129195129196129197129198129199129200129201129202129203129204129205129206129207129208129209129210129211129212129213129214129215129216129217129218129219129220129221129222129223129224129225129226129227129228129229129230129231129232129233129234129235129236129237129238129239129240129241129242129243129244129245129246129247129248129249129250129251129252129253129254129255129256129257129258129259129260129261129262129263129264129265129266129267129268129269129270129271129272129273129274129275129276129277129278129279129280129281129282129283129284129285129286129287129288129289129290129291129292129293129294129295129296129297129298129299129300129301129302129303129304129305129306129307129308129309129310129311129312129313129314129315129316129317129318129319129320129321129322129323129324129325129326129327129328129329129330129331129332129333129334129335129336129337129338129339129340129341129342129343129344129345129346129347129348129349129350129351129352129353129354129355129356129357129358129359129360129361129362129363129364129365129366129367129368129369129370129371129372129373129374129375129376129377129378129379129380129381129382129383129384129385129386129387129388129389129390129391129392129393129394129395129396129397129398129399129400129401129402129403129404129405129406129407129408129409129410129411129412129413129414129415129416129417129418129419129420129421129422129423129424129425129426129427129428129429129430129431129432129433129434129435129436129437129438129439129440129441129442129443129444129445129446129447129448129449129450129451129452129453129454129455129456129457129458129459129460129461129462129463129464129465129466129467129468129469129470129471129472129473129474129475129476129477129478129479129480129481129482129483129484129485129486129487129488129489129490129491129492129493129494129495129496129497129498129499129500129501129502129503129504129505129506129507129508129509129510129511129512129513129514129515129516129517129518129519129520129521129522129523129524129525129526129527129528129529129530129531129532129533129534129535129536129537129538129539129540129541129542129543129544129545129546129547129548129549129550129551129552129553129554129555129556129557129558129559129560129561129562129563129564129565129566129567129568129569129570129571129572129573129574129575129576129577129578129579129580129581129582129583129584129585129586129587129588129589129590129591129592129593129594129595129596129597129598129599129600129601129602129603129604129605129606129607129608129609129610129611129612129613129614129615129616129617129618129619129620129621129622129623129624129625129626129627129628129629129630129631129632129633129634129635129636129637129638129639129640129641129642129643129644129645129646129647129648129649129650129651129652129653129654129655129656129657129658129659129660129661129662129663129664129665129666129667129668129669129670129671129672129673129674129675129676129677129678129679129680129681129682129683129684129685129686129687129688129689129690129691129692129693129694129695129696129697129698129699129700129701129702129703129704129705129706129707129708129709129710129711129712129713129714129715129716129717129718129719129720129721129722129723129724129725129726129727129728129729129730129731129732129733129734129735129736129737129738129739129740129741129742129743129744129745129746129747129748129749129750129751129752129753129754129755129756129757129758129759129760129761129762129763129764129765129766129767129768129769129770129771129772129773129774129775129776129777129778129779129780129781129782129783129784129785129786129787129788129789129790129791129792129793129794129795129796129797129798129799129800129801129802129803129804129805129806129807129808129809129810129811129812129813129814129815129816129817129818129819129820129821129822129823129824129825129826129827129828129829129830129831129832129833129834129835129836129837129838129839129840129841129842129843129844129845129846129847129848129849129850129851129852129853129854129855129856129857129858129859129860129861129862129863129864129865129866129867129868129869129870129871129872129873129874129875129876129877129878129879129880129881129882129883129884129885129886129887129888129889129890129891129892129893129894129895129896129897129898129899129900129901129902129903129904129905129906129907129908129909129910129911129912129913129914129915129916129917129918129919129920129921129922129923129924129925129926129927129928129929129930129931129932129933129934129935129936129937129938129939129940129941129942129943129944129945129946129947129948129949129950129951129952129953129954129955129956129957129958129959129960129961129962129963129964129965129966129967129968129969129970129971129972129973129974129975129976129977129978129979129980129981129982129983129984129985129986129987129988129989129990129991129992129993129994129995129996129997129998129999130000130001130002130003130004130005130006130007130008130009130010130011130012130013130014130015130016130017130018130019130020130021130022130023130024130025130026130027130028130029130030130031130032130033130034130035130036130037130038130039130040130041130042130043130044130045130046130047130048130049130050130051130052130053130054130055130056130057130058130059130060130061130062130063130064130065130066130067130068130069130070130071130072130073130074130075130076130077130078130079130080130081130082130083130084130085130086130087130088130089130090130091130092130093130094130095130096130097130098130099130100130101130102130103130104130105130106130107130108130109130110130111130112130113130114130115130116130117130118130119130120130121130122130123130124130125130126130127130128130129130130130131130132130133130134130135130136130137130138130139130140130141130142130143130144130145130146130147130148130149130150130151130152130153130154130155130156130157130158130159130160130161130162130163130164130165130166130167130168130169130170130171130172130173130174130175130176130177130178130179130180130181130182130183130184130185130186130187130188130189130190130191130192130193130194130195130196130197130198130199130200130201130202130203130204130205130206130207130208130209130210130211130212130213130214130215130216130217130218130219130220130221130222130223130224130225130226130227130228130229130230130231130232130233130234130235130236130237130238130239130240130241130242130243130244130245130246130247130248130249130250130251130252130253130254130255130256130257130258130259130260130261130262130263130264130265130266130267130268130269130270130271130272130273130274130275130276130277130278130279130280130281130282130283130284130285130286130287130288130289130290130291130292130293130294130295130296130297130298130299130300130301130302130303130304130305130306130307130308130309130310130311130312130313130314130315130316130317130318130319130320130321130322130323130324130325130326130327130328130329130330130331130332130333130334130335130336130337130338130339130340130341130342130343130344130345130346130347130348130349130350130351130352130353130354130355130356130357130358130359130360130361130362130363130364130365130366130367130368130369130370130371130372130373130374130375130376130377130378130379130380130381130382130383130384130385130386130387130388130389130390130391130392130393130394130395130396130397130398130399130400130401130402130403130404130405130406130407130408130409130410130411130412130413130414130415130416130417130418130419130420130421130422130423130424130425130426130427130428130429130430130431130432130433130434130435130436130437130438130439130440130441130442130443130444130445130446130447130448130449130450130451130452130453130454130455130456130457130458130459130460130461130462130463130464130465130466130467130468130469130470130471130472130473130474130475130476130477130478130479130480130481130482130483130484130485130486130487130488130489130490130491130492130493130494130495130496130497130498130499130500130501130502130503130504130505130506130507130508130509130510130511130512130513130514130515130516130517130518130519130520130521130522130523130524130525130526130527130528130529130530130531130532130533130534130535130536130537130538130539130540130541130542130543130544130545130546130547130548130549130550130551130552130553130554130555130556130557130558130559130560130561130562130563130564130565130566130567130568130569130570130571130572130573130574130575130576130577130578130579130580130581130582130583130584130585130586130587130588130589130590130591130592130593130594130595130596130597130598130599130600130601130602130603130604130605130606130607130608130609130610130611130612130613130614130615130616130617130618130619130620130621130622130623130624130625130626130627130628130629130630130631130632130633130634130635130636130637130638130639130640130641130642130643130644130645130646130647130648130649130650130651130652130653130654130655130656130657130658130659130660130661130662130663130664130665130666130667130668130669130670130671130672130673130674130675130676130677130678130679130680130681130682130683130684130685130686130687130688130689130690130691130692130693130694130695130696130697130698130699130700130701130702130703130704130705130706130707130708130709130710130711130712130713130714130715130716130717130718130719130720130721130722130723130724130725130726130727130728130729130730130731130732130733130734130735130736130737130738130739130740130741130742130743130744130745130746130747130748130749130750130751130752130753130754130755130756130757130758130759130760130761130762130763130764130765130766130767130768130769130770130771130772130773130774130775130776130777130778130779130780130781130782130783130784130785130786130787130788130789130790130791130792130793130794130795130796130797130798130799130800130801130802130803130804130805130806130807130808130809130810130811130812130813130814130815130816130817130818130819130820130821130822130823130824130825130826130827130828130829130830130831130832130833130834130835130836130837130838130839130840130841130842130843130844130845130846130847130848130849130850130851130852130853130854130855130856130857130858130859130860130861130862130863130864130865130866130867130868130869130870130871130872130873130874130875130876130877130878130879130880130881130882130883130884130885130886130887130888130889130890130891130892130893130894130895130896130897130898130899130900130901130902130903130904130905130906130907130908130909130910130911130912130913130914130915130916130917130918130919130920130921130922130923130924130925130926130927130928130929130930130931130932130933130934130935130936130937130938130939130940130941130942130943130944130945130946130947130948130949130950130951130952130953130954130955130956130957130958130959130960130961130962130963130964130965130966130967130968130969130970130971130972130973130974130975130976130977130978130979130980130981130982130983130984130985130986130987130988130989130990130991130992130993130994130995130996130997130998130999131000131001131002131003131004131005131006131007131008131009131010131011131012131013131014131015131016131017131018131019131020131021131022131023131024131025131026131027131028131029131030131031131032131033131034131035131036131037131038131039131040131041131042131043131044131045131046131047131048131049131050131051131052131053131054131055131056131057131058131059131060131061131062131063131064131065131066131067131068131069131070131071131072131073131074131075131076131077131078131079131080131081131082131083131084131085131086131087131088131089131090131091131092131093131094131095131096131097131098131099131100131101131102131103131104131105131106131107131108131109131110131111131112131113131114131115131116131117131118131119131120131121131122131123131124131125131126131127131128131129131130131131131132131133131134131135131136131137131138131139131140131141131142131143131144131145131146131147131148131149131150131151131152131153131154131155131156131157131158131159131160131161131162131163131164131165131166131167131168131169131170131171131172131173131174131175131176131177131178131179131180131181131182131183131184131185131186131187131188131189131190131191131192131193131194131195131196131197131198131199131200131201131202131203131204131205131206131207131208131209131210131211131212131213131214131215131216131217131218131219131220131221131222131223131224131225131226131227131228131229131230131231131232131233131234131235131236131237131238131239131240131241131242131243131244131245131246131247131248131249131250131251131252131253131254131255131256131257131258131259131260131261131262131263131264131265131266131267131268131269131270131271131272131273131274131275131276131277131278131279131280131281131282131283131284131285131286131287131288131289131290131291131292131293131294131295131296131297131298131299131300131301131302131303131304131305131306131307131308131309131310131311131312131313131314131315131316131317131318131319131320131321131322131323131324131325131326131327131328131329131330131331131332131333131334131335131336131337131338131339131340131341131342131343131344131345131346131347131348131349131350131351131352131353131354131355131356131357131358131359131360131361131362131363131364131365131366131367131368131369131370131371131372131373131374131375131376131377131378131379131380131381131382131383131384131385131386131387131388131389131390131391131392131393131394131395131396131397131398131399131400131401131402131403131404131405131406131407131408131409131410131411131412131413131414131415131416131417131418131419131420131421131422131423131424131425131426131427131428131429131430131431131432131433131434131435131436131437131438131439131440131441131442131443131444131445131446131447131448131449131450131451131452131453131454131455131456131457131458131459131460131461131462131463131464131465131466131467131468131469131470131471131472131473131474131475131476131477131478131479131480131481131482131483131484131485131486131487131488131489131490131491131492131493131494131495131496131497131498131499131500131501131502131503131504131505131506131507131508131509131510131511131512131513131514131515131516131517131518131519131520131521131522131523131524131525131526131527131528131529131530131531131532131533131534131535131536131537131538131539131540131541131542131543131544131545131546131547131548131549131550131551131552131553131554131555131556131557131558131559131560131561131562131563131564131565131566131567131568131569131570131571131572131573131574131575131576131577131578131579131580131581131582131583131584131585131586131587131588131589131590131591131592131593131594131595131596131597131598131599131600131601131602131603131604131605131606131607131608131609131610131611131612131613131614131615131616131617131618131619131620131621131622131623131624131625131626131627131628131629131630131631131632131633131634131635131636131637131638131639131640131641131642131643131644131645131646131647131648131649131650131651131652131653131654131655131656131657131658131659131660131661131662131663131664131665131666131667131668131669131670131671131672131673131674131675131676131677131678131679131680131681131682131683131684131685131686131687131688131689131690131691131692131693131694131695131696131697131698131699131700131701131702131703131704131705131706131707131708131709131710131711131712131713131714131715131716131717131718131719131720131721131722131723131724131725131726131727131728131729131730131731131732131733131734131735131736131737131738131739131740131741131742131743131744131745131746131747131748131749131750131751131752131753131754131755131756131757131758131759131760131761131762131763131764131765131766131767131768131769131770131771131772131773131774131775131776131777131778131779131780131781131782131783131784131785131786131787131788131789131790131791131792131793131794131795131796131797131798131799131800131801131802131803131804131805131806131807131808131809131810131811131812131813131814131815131816131817131818131819131820131821131822131823131824131825131826131827131828131829131830131831131832131833131834131835131836131837131838131839131840131841131842131843131844131845131846131847131848131849131850131851131852131853131854131855131856131857131858131859131860131861131862131863131864131865131866131867131868131869131870131871131872131873131874131875131876131877131878131879131880131881131882131883131884131885131886131887131888131889131890131891131892131893131894131895131896131897131898131899131900131901131902131903131904131905131906131907131908131909131910131911131912131913131914131915131916131917131918131919131920131921131922131923131924131925131926131927131928131929131930131931131932131933131934131935131936131937131938131939131940131941131942131943131944131945131946131947131948131949131950131951131952131953131954131955131956131957131958131959131960131961131962131963131964131965131966131967131968131969131970131971131972131973131974131975131976131977131978131979131980131981131982131983131984131985131986131987131988131989131990131991131992131993131994131995131996131997131998131999132000132001132002132003132004132005132006132007132008132009132010132011132012132013132014132015132016132017132018132019132020132021132022132023132024132025132026132027132028132029132030132031132032132033132034132035132036132037132038132039132040132041132042132043132044132045132046132047132048132049132050132051132052132053132054132055132056132057132058132059132060132061132062132063132064132065132066132067132068132069132070132071132072132073132074132075132076132077132078132079132080132081132082132083132084132085132086132087132088132089132090132091132092132093132094132095132096132097132098132099132100132101132102132103132104132105132106132107132108132109132110132111132112132113132114132115132116132117132118132119132120132121132122132123132124132125132126132127132128132129132130132131132132132133132134132135132136132137132138132139132140132141132142132143132144132145132146132147132148132149132150132151132152132153132154132155132156132157132158132159132160132161132162132163132164132165132166132167132168132169132170132171132172132173132174132175132176132177132178132179132180132181132182132183132184132185132186132187132188132189132190132191132192132193132194132195132196132197132198132199132200132201132202132203132204132205132206132207132208132209132210132211132212132213132214132215132216132217132218132219132220132221132222132223132224132225132226132227132228132229132230132231132232132233132234132235132236132237132238132239132240132241132242132243132244132245132246132247132248132249132250132251132252132253132254132255132256132257132258132259132260132261132262132263132264132265132266132267132268132269132270132271132272132273132274132275132276132277132278132279132280132281132282132283132284132285132286132287132288132289132290132291132292132293132294132295132296132297132298132299132300132301132302132303132304132305132306132307132308132309132310132311132312132313132314132315132316132317132318132319132320132321132322132323132324132325132326132327132328132329132330132331132332132333132334132335132336132337132338132339132340132341132342132343132344132345132346132347132348132349132350132351132352132353132354132355132356132357132358132359132360132361132362132363132364132365132366132367132368132369132370132371132372132373132374132375132376132377132378132379132380132381132382132383132384132385132386132387132388132389132390132391132392132393132394132395132396132397132398132399132400132401132402132403132404132405132406132407132408132409132410132411132412132413132414132415132416132417132418132419132420132421132422132423132424132425132426132427132428132429132430132431132432132433132434132435132436132437132438132439132440132441132442132443132444132445132446132447132448132449132450132451132452132453132454132455132456132457132458132459132460132461132462132463132464132465132466132467132468132469132470132471132472132473132474132475132476132477132478132479132480132481132482132483132484132485132486132487132488132489132490132491132492132493132494132495132496132497132498132499132500132501132502132503132504132505132506132507132508132509132510132511132512132513132514132515132516132517132518132519132520132521132522132523132524132525132526132527132528132529132530132531132532132533132534132535132536132537132538132539132540132541132542132543132544132545132546132547132548132549132550132551132552132553132554132555132556132557132558132559132560132561132562132563132564132565132566132567132568132569132570132571132572132573132574132575132576132577132578132579132580132581132582132583132584132585132586132587132588132589132590132591132592132593132594132595132596132597132598132599132600132601132602132603132604132605132606132607132608132609132610132611132612132613132614132615132616132617132618132619132620132621132622132623132624132625132626132627132628132629132630132631132632132633132634132635132636132637132638132639132640132641132642132643132644132645132646132647132648132649132650132651132652132653132654132655132656132657132658132659132660132661132662132663132664132665132666132667132668132669132670132671132672132673132674132675132676132677132678132679132680132681132682132683132684132685132686132687132688132689132690132691132692132693132694132695132696132697132698132699132700132701132702132703132704132705132706132707132708132709132710132711132712132713132714132715132716132717132718132719132720132721132722132723132724132725132726132727132728132729132730132731132732132733132734132735132736132737132738132739132740132741132742132743132744132745132746132747132748132749132750132751132752132753132754132755132756132757132758132759132760132761132762132763132764132765132766132767132768132769132770132771132772132773132774132775132776132777132778132779132780132781132782132783132784132785132786132787132788132789132790132791132792132793132794132795132796132797132798132799132800132801132802132803132804132805132806132807132808132809132810132811132812132813132814132815132816132817132818132819132820132821132822132823132824132825132826132827132828132829132830132831132832132833132834132835132836132837132838132839132840132841132842132843132844132845132846132847132848132849132850132851132852132853132854132855132856132857132858132859132860132861132862132863132864132865132866132867132868132869132870132871132872132873132874132875132876132877132878132879132880132881132882132883132884132885132886132887132888132889132890132891132892132893132894132895132896132897132898132899132900132901132902132903132904132905132906132907132908132909132910132911132912132913132914132915132916132917132918132919132920132921132922132923132924132925132926132927132928132929132930132931132932132933132934132935132936132937132938132939132940132941132942132943132944132945132946132947132948132949132950132951132952132953132954132955132956132957132958132959132960132961132962132963132964132965132966132967132968132969132970132971132972132973132974132975132976132977132978132979132980132981132982132983132984132985132986132987132988132989132990132991132992132993132994132995132996132997132998132999133000133001133002133003133004133005133006133007133008133009133010133011133012133013133014133015133016133017133018133019133020133021133022133023133024133025133026133027133028133029133030133031133032133033133034133035133036133037133038133039133040133041133042133043133044133045133046133047133048133049133050133051133052133053133054133055133056133057133058133059133060133061133062133063133064133065133066133067133068133069133070133071133072133073133074133075133076133077133078133079133080133081133082133083133084133085133086133087133088133089133090133091133092133093133094133095133096133097133098133099133100133101133102133103133104133105133106133107133108133109133110133111133112133113133114133115133116133117133118133119133120133121133122133123133124133125133126133127133128133129133130133131133132133133133134133135133136133137133138133139133140133141133142133143133144133145133146133147133148133149133150133151133152133153133154133155133156133157133158133159133160133161133162133163133164133165133166133167133168133169133170133171133172133173133174133175133176133177133178133179133180133181133182133183133184133185133186133187133188133189133190133191133192133193133194133195133196133197133198133199133200133201133202133203133204133205133206133207133208133209133210133211133212133213133214133215133216133217133218133219133220133221133222133223133224133225133226133227133228133229133230133231133232133233133234133235133236133237133238133239133240133241133242133243133244133245133246133247133248133249133250133251133252133253133254133255133256133257133258133259133260133261133262133263133264133265133266133267133268133269133270133271133272133273133274133275133276133277133278133279133280133281133282133283133284133285133286133287133288133289133290133291133292133293133294133295133296133297133298133299133300133301133302133303133304133305133306133307133308133309133310133311133312133313133314133315133316133317133318133319133320133321133322133323133324133325133326133327133328133329133330133331133332133333133334133335133336133337133338133339133340133341133342133343133344133345133346133347133348133349133350133351133352133353133354133355133356133357133358133359133360133361133362133363133364133365133366133367133368133369133370133371133372133373133374133375133376133377133378133379133380133381133382133383133384133385133386133387133388133389133390133391133392133393133394133395133396133397133398133399133400133401133402133403133404133405133406133407133408133409133410133411133412133413133414133415133416133417133418133419133420133421133422133423133424133425133426133427133428133429133430133431133432133433133434133435133436133437133438133439133440133441133442133443133444133445133446133447133448133449133450133451133452133453133454133455133456133457133458133459133460133461133462133463133464133465133466133467133468133469133470133471133472133473133474133475133476133477133478133479133480133481133482133483133484133485133486133487133488133489133490133491133492133493133494133495133496133497133498133499133500133501133502133503133504133505133506133507133508133509133510133511133512133513133514133515133516133517133518133519133520133521133522133523133524133525133526133527133528133529133530133531133532133533133534133535133536133537133538133539133540133541133542133543133544133545133546133547133548133549133550133551133552133553133554133555133556133557133558133559133560133561133562133563133564133565133566133567133568133569133570133571133572133573133574133575133576133577133578133579133580133581133582133583133584133585133586133587133588133589133590133591133592133593133594133595133596133597133598133599133600133601133602133603133604133605133606133607133608133609133610133611133612133613133614133615133616133617133618133619133620133621133622133623133624133625133626133627133628133629133630133631133632133633133634133635133636133637133638133639133640133641133642133643133644133645133646133647133648133649133650133651133652133653133654133655133656133657133658133659133660133661133662133663133664133665133666133667133668133669133670133671133672133673133674133675133676133677133678133679133680133681133682133683133684133685133686133687133688133689133690133691133692133693133694133695133696133697133698133699133700133701133702133703133704133705133706133707133708133709133710133711133712133713133714133715133716133717133718133719133720133721133722133723133724133725133726133727133728133729133730133731133732133733133734133735133736133737133738133739133740133741133742133743133744133745133746133747133748133749133750133751133752133753133754133755133756133757133758133759133760133761133762133763133764133765133766133767133768133769133770133771133772133773133774133775133776133777133778133779133780133781133782133783133784133785133786133787133788133789133790133791133792133793133794133795133796133797133798133799133800133801133802133803133804133805133806133807133808133809133810133811133812133813133814133815133816133817133818133819133820133821133822133823133824133825133826133827133828133829133830133831133832133833133834133835133836133837133838133839133840133841133842133843133844133845133846133847133848133849133850133851133852133853133854133855133856133857133858133859133860133861133862133863133864133865133866133867133868133869133870133871133872133873133874133875133876133877133878133879133880133881133882133883133884133885133886133887133888133889133890133891133892133893133894133895133896133897133898133899133900133901133902133903133904133905133906133907133908133909133910133911133912133913133914133915133916133917133918133919133920133921133922133923133924133925133926133927133928133929133930133931133932133933133934133935133936133937133938133939133940133941133942133943133944133945133946133947133948133949133950133951133952133953133954133955133956133957133958133959133960133961133962133963133964133965133966133967133968133969133970133971133972133973133974133975133976133977133978133979133980133981133982133983133984133985133986133987133988133989133990133991133992133993133994133995133996133997133998133999134000134001134002134003134004134005134006134007134008134009134010134011134012134013134014134015134016134017134018134019134020134021134022134023134024134025134026134027134028134029134030134031134032134033134034134035134036134037134038134039134040134041134042134043134044134045134046134047134048134049134050134051134052134053134054134055134056134057134058134059134060134061134062134063134064134065134066134067134068134069134070134071134072134073134074134075134076134077134078134079134080134081134082134083134084134085134086134087134088134089134090134091134092134093134094134095134096134097134098134099134100134101134102134103134104134105134106134107134108134109134110134111134112134113134114134115134116134117134118134119134120134121134122134123134124134125134126134127134128134129134130134131134132134133134134134135134136134137134138134139134140134141134142134143134144134145134146134147134148134149134150134151134152134153134154134155134156134157134158134159134160134161134162134163134164134165134166134167134168134169134170134171134172134173134174134175134176134177134178134179134180134181134182134183134184134185134186134187134188134189134190134191134192134193134194134195134196134197134198134199134200134201134202134203134204134205134206134207134208134209134210134211134212134213134214134215134216134217134218134219134220134221134222134223134224134225134226134227134228134229134230134231134232134233134234134235134236134237134238134239134240134241134242134243134244134245134246134247134248134249134250134251134252134253134254134255134256134257134258134259134260134261134262134263134264134265134266134267134268134269134270134271134272134273134274134275134276134277134278134279134280134281134282134283134284134285134286134287134288134289134290134291134292134293134294134295134296134297134298134299134300134301134302134303134304134305134306134307134308134309134310134311134312134313134314134315134316134317134318134319134320134321134322134323134324134325134326134327134328134329134330134331134332134333134334134335134336134337134338134339134340134341134342134343134344134345134346134347134348134349134350134351134352134353134354134355134356134357134358134359134360134361134362134363134364134365134366134367134368134369134370134371134372134373134374134375134376134377134378134379134380134381134382134383134384134385134386134387134388134389134390134391134392134393134394134395134396134397134398134399134400134401134402134403134404134405134406134407134408134409134410134411134412134413134414134415134416134417134418134419134420134421134422134423134424134425134426134427134428134429134430134431134432134433134434134435134436134437134438134439134440134441134442134443134444134445134446134447134448134449134450134451134452134453134454134455134456134457134458134459134460134461134462134463134464134465134466134467134468134469134470134471134472134473134474134475134476134477134478134479134480134481134482134483134484134485134486134487134488134489134490134491134492134493134494134495134496134497134498134499134500134501134502134503134504134505134506134507134508134509134510134511134512134513134514134515134516134517134518134519134520134521134522134523134524134525134526134527134528134529134530134531134532134533134534134535134536134537134538134539134540134541134542134543134544134545134546134547134548134549134550134551134552134553134554134555134556134557134558134559134560134561134562134563134564134565134566134567134568134569134570134571134572134573134574134575134576134577134578134579134580134581134582134583134584134585134586134587134588134589134590134591134592134593134594134595134596134597134598134599134600134601134602134603134604134605134606134607134608134609134610134611134612134613134614134615134616134617134618134619134620134621134622134623134624134625134626134627134628134629134630134631134632134633134634134635134636134637134638134639134640134641134642134643134644134645134646134647134648134649134650134651134652134653134654134655134656134657134658134659134660134661134662134663134664134665134666134667134668134669134670134671134672134673134674134675134676134677134678134679134680134681134682134683134684134685134686134687134688134689134690134691134692134693134694134695134696134697134698134699134700134701134702134703134704134705134706134707134708134709134710134711134712134713134714134715134716134717134718134719134720134721134722134723134724134725134726134727134728134729134730134731134732134733134734134735134736134737134738134739134740134741134742134743134744134745134746134747134748134749134750134751134752134753134754134755134756134757134758134759134760134761134762134763134764134765134766134767134768134769134770134771134772134773134774134775134776134777134778134779134780134781134782134783134784134785134786134787134788134789134790134791134792134793134794134795134796134797134798134799134800134801134802134803134804134805134806134807134808134809134810134811134812134813134814134815134816134817134818134819134820134821134822134823134824134825134826134827134828134829134830134831134832134833134834134835134836134837134838134839134840134841134842134843134844134845134846134847134848134849134850134851134852134853134854134855134856134857134858134859134860134861134862134863134864134865134866134867134868134869134870134871134872134873134874134875134876134877134878134879134880134881134882134883134884134885134886134887134888134889134890134891134892134893134894134895134896134897134898134899134900134901134902134903134904134905134906134907134908134909134910134911134912134913134914134915134916134917134918134919134920134921134922134923134924134925134926134927134928134929134930134931134932134933134934134935134936134937134938134939134940134941134942134943134944134945134946134947134948134949134950134951134952134953134954134955134956134957134958134959134960134961134962134963134964134965134966134967134968134969134970134971134972134973134974134975134976134977134978134979134980134981134982134983134984134985134986134987134988134989134990134991134992134993134994134995134996134997134998134999135000135001135002135003135004135005135006135007135008135009135010135011135012135013135014135015135016135017135018135019135020135021135022135023135024135025135026135027135028135029135030135031135032135033135034135035135036135037135038135039135040135041135042135043135044135045135046135047135048135049135050135051135052135053135054135055135056135057135058135059135060135061135062135063135064135065135066135067135068135069135070135071135072135073135074135075135076135077135078135079135080135081135082135083135084135085135086135087135088135089135090135091135092135093135094135095135096135097135098135099135100135101135102135103135104135105135106135107135108135109135110135111135112135113135114135115135116135117135118135119135120135121135122135123135124135125135126135127135128135129135130135131135132135133135134135135135136135137135138135139135140135141135142135143135144135145135146135147135148135149135150135151135152135153135154135155135156135157135158135159135160135161135162135163135164135165135166135167135168135169135170135171135172135173135174135175135176135177135178135179135180135181135182135183135184135185135186135187135188135189135190135191135192135193135194135195135196135197135198135199135200135201135202135203135204135205135206135207135208135209135210135211135212135213135214135215135216135217135218135219135220135221135222135223135224135225135226135227135228135229135230135231135232135233135234135235135236135237135238135239135240135241135242135243135244135245135246135247135248135249135250135251135252135253135254135255135256135257135258135259135260135261135262135263135264135265135266135267135268135269135270135271135272135273135274135275135276135277135278135279135280135281135282135283135284135285135286135287135288135289135290135291135292135293135294135295135296135297135298135299135300135301135302135303135304135305135306135307135308135309135310135311135312135313135314135315135316135317135318135319135320135321135322135323135324135325135326135327135328135329135330135331135332135333135334135335135336135337135338135339135340135341135342135343135344135345135346135347135348135349135350135351135352135353135354135355135356135357135358135359135360135361135362135363135364135365135366135367135368135369135370135371135372135373135374135375135376135377135378135379135380135381135382135383135384135385135386135387135388135389135390135391135392135393135394135395135396135397135398135399135400135401135402135403135404135405135406135407135408135409135410135411135412135413135414135415135416135417135418135419135420135421135422135423135424135425135426135427135428135429135430135431135432135433135434135435135436135437135438135439135440135441135442135443135444135445135446135447135448135449135450135451135452135453135454135455135456135457135458135459135460135461135462135463135464135465135466135467135468135469135470135471135472135473135474135475135476135477135478135479135480135481135482135483135484135485135486135487135488135489135490135491135492135493135494135495135496135497135498135499135500135501135502135503135504135505135506135507135508135509135510135511135512135513135514135515135516135517135518135519135520135521135522135523135524135525135526135527135528135529135530135531135532135533135534135535135536135537135538135539135540135541135542135543135544135545135546135547135548135549135550135551135552135553135554135555135556135557135558135559135560135561135562135563135564135565135566135567135568135569135570135571135572135573135574135575135576135577135578135579135580135581135582135583135584135585135586135587135588135589135590135591135592135593135594135595135596135597135598135599135600135601135602135603135604135605135606135607135608135609135610135611135612135613135614135615135616135617135618135619135620135621135622135623135624135625135626135627135628135629135630135631135632135633135634135635135636135637135638135639135640135641135642135643135644135645135646135647135648135649135650135651135652135653135654135655135656135657135658135659135660135661135662135663135664135665135666135667135668135669135670135671135672135673135674135675135676135677135678135679135680135681135682135683135684135685135686135687135688135689135690135691135692135693135694135695135696135697135698135699135700135701135702135703135704135705135706135707135708135709135710135711135712135713135714135715135716135717135718135719135720135721135722135723135724135725135726135727135728135729135730135731135732135733135734135735135736135737135738135739135740135741135742135743135744135745135746135747135748135749135750135751135752135753135754135755135756135757135758135759135760135761135762135763135764135765135766135767135768135769135770135771135772135773135774135775135776135777135778135779135780135781135782135783135784135785135786135787135788135789135790135791135792135793135794135795135796135797135798135799135800135801135802135803135804135805135806135807135808135809135810135811135812135813135814135815135816135817135818135819135820135821135822135823135824135825135826135827135828135829135830135831135832135833135834135835135836135837135838135839135840135841135842135843135844135845135846135847135848135849135850135851135852135853135854135855135856135857135858135859135860135861135862135863135864135865135866135867135868135869135870135871135872135873135874135875135876135877135878135879135880135881135882135883135884135885135886135887135888135889135890135891135892135893135894135895135896135897135898135899135900135901135902135903135904135905135906135907135908135909135910135911135912135913135914135915135916135917135918135919135920135921135922135923135924135925135926135927135928135929135930135931135932135933135934135935135936135937135938135939135940135941135942135943135944135945135946135947135948135949135950135951135952135953135954135955135956135957135958135959135960135961135962135963135964135965135966135967135968135969135970135971135972135973135974135975135976135977135978135979135980135981135982135983135984135985135986135987135988135989135990135991135992135993135994135995135996135997135998135999136000136001136002136003136004136005136006136007136008136009136010136011136012136013136014136015136016136017136018136019136020136021136022136023136024136025136026136027136028136029136030136031136032136033136034136035136036136037136038136039136040136041136042136043136044136045136046136047136048136049136050136051136052136053136054136055136056136057136058136059136060136061136062136063136064136065136066136067136068136069136070136071136072136073136074136075136076136077136078136079136080136081136082136083136084136085136086136087136088136089136090136091136092136093136094136095136096136097136098136099136100136101136102136103136104136105136106136107136108136109136110136111136112136113136114136115136116136117136118136119136120136121136122136123136124136125136126136127136128136129136130136131136132136133136134136135136136136137136138136139136140136141136142136143136144136145136146136147136148136149136150136151136152136153136154136155136156136157136158136159136160136161136162136163136164136165136166136167136168136169136170136171136172136173136174136175136176136177136178136179136180136181136182136183136184136185136186136187136188136189136190136191136192136193136194136195136196136197136198136199136200136201136202136203136204136205136206136207136208136209136210136211136212136213136214136215136216136217136218136219136220136221136222136223136224136225136226136227136228136229136230136231136232136233136234136235136236136237136238136239136240136241136242136243136244136245136246136247136248136249136250136251136252136253136254136255136256136257136258136259136260136261136262136263136264136265136266136267136268136269136270136271136272136273136274136275136276136277136278136279136280136281136282136283136284136285136286136287136288136289136290136291136292136293136294136295136296136297136298136299136300136301136302136303136304136305136306136307136308136309136310136311136312136313136314136315136316136317136318136319136320136321136322136323136324136325136326136327136328136329136330136331136332136333136334136335136336136337136338136339136340136341136342136343136344136345136346136347136348136349136350136351136352136353136354136355136356136357136358136359136360136361136362136363136364136365136366136367136368136369136370136371136372136373136374136375136376136377136378136379136380136381136382136383136384136385136386136387136388136389136390136391136392136393136394136395136396136397136398136399136400136401136402136403136404136405136406136407136408136409136410136411136412136413136414136415136416136417136418136419136420136421136422136423136424136425136426136427136428136429136430136431136432136433136434136435136436136437136438136439136440136441136442136443136444136445136446136447136448136449136450136451136452136453136454136455136456136457136458136459136460136461136462136463136464136465136466136467136468136469136470136471136472136473136474136475136476136477136478136479136480136481136482136483136484136485136486136487136488136489136490136491136492136493136494136495136496136497136498136499136500136501136502136503136504136505136506136507136508136509136510136511136512136513136514136515136516136517136518136519136520136521136522136523136524136525136526136527136528136529136530136531136532136533136534136535136536136537136538136539136540136541136542136543136544136545136546136547136548136549136550136551136552136553136554136555136556136557136558136559136560136561136562136563136564136565136566136567136568136569136570136571136572136573136574136575136576136577136578136579136580136581136582136583136584136585136586136587136588136589136590136591136592136593136594136595136596136597136598136599136600136601136602136603136604136605136606136607136608136609136610136611136612136613136614136615136616136617136618136619136620136621136622136623136624136625136626136627136628136629136630136631136632136633136634136635136636136637136638136639136640136641136642136643136644136645136646136647136648136649136650136651136652136653136654136655136656136657136658136659136660136661136662136663136664136665136666136667136668136669136670136671136672136673136674136675136676136677136678136679136680136681136682136683136684136685136686136687136688136689136690136691136692136693136694136695136696136697136698136699136700136701136702136703136704136705136706136707136708136709136710136711136712136713136714136715136716136717136718136719136720136721136722136723136724136725136726136727136728136729136730136731136732136733136734136735136736136737136738136739136740136741136742136743136744136745136746136747136748136749136750136751136752136753136754136755136756136757136758136759136760136761136762136763136764136765136766136767136768136769136770136771136772136773136774136775136776136777136778136779136780136781136782136783136784136785136786136787136788136789136790136791136792136793136794136795136796136797136798136799136800136801136802136803136804136805136806136807136808136809136810136811136812136813136814136815136816136817136818136819136820136821136822136823136824136825136826136827136828136829136830136831136832136833136834136835136836136837136838136839136840136841136842136843136844136845136846136847136848136849136850136851136852136853136854136855136856136857136858136859136860136861136862136863136864136865136866136867136868136869136870136871136872136873136874136875136876136877136878136879136880136881136882136883136884136885136886136887136888136889136890136891136892136893136894136895136896136897136898136899136900136901136902136903136904136905136906136907136908136909136910136911136912136913136914136915136916136917136918136919136920136921136922136923136924136925136926136927136928136929136930136931136932136933136934136935136936136937136938136939136940136941136942136943136944136945136946136947136948136949136950136951136952136953136954136955136956136957136958136959136960136961136962136963136964136965136966136967136968136969136970136971136972136973136974136975136976136977136978136979136980136981136982136983136984136985136986136987136988136989136990136991136992136993136994136995136996136997136998136999137000137001137002137003137004137005137006137007137008137009137010137011137012137013137014137015137016137017137018137019137020137021137022137023137024137025137026137027137028137029137030137031137032137033137034137035137036137037137038137039137040137041137042137043137044137045137046137047137048137049137050137051137052137053137054137055137056137057137058137059137060137061137062137063137064137065137066137067137068137069137070137071137072137073137074137075137076137077137078137079137080137081137082137083137084137085137086137087137088137089137090137091137092137093137094137095137096137097137098137099137100137101137102137103137104137105137106137107137108137109137110137111137112137113137114137115137116137117137118137119137120137121137122137123137124137125137126137127137128137129137130137131137132137133137134137135137136137137137138137139137140137141137142137143137144137145137146137147137148137149137150137151137152137153137154137155137156137157137158137159137160137161137162137163137164137165137166137167137168137169137170137171137172137173137174137175137176137177137178137179137180137181137182137183137184137185137186137187137188137189137190137191137192137193137194137195137196137197137198137199137200137201137202137203137204137205137206137207137208137209137210137211137212137213137214137215137216137217137218137219137220137221137222137223137224137225137226137227137228137229137230137231137232137233137234137235137236137237137238137239137240137241137242137243137244137245137246137247137248137249137250137251137252137253137254137255137256137257137258137259137260137261137262137263137264137265137266137267137268137269137270137271137272137273137274137275137276137277137278137279137280137281137282137283137284137285137286137287137288137289137290137291137292137293137294137295137296137297137298137299137300137301137302137303137304137305137306137307137308137309137310137311137312137313137314137315137316137317137318137319137320137321137322137323137324137325137326137327137328137329137330137331137332137333137334137335137336137337137338137339137340137341137342137343137344137345137346137347137348137349137350137351137352137353137354137355137356137357137358137359137360137361137362137363137364137365137366137367137368137369137370137371137372137373137374137375137376137377137378137379137380137381137382137383137384137385137386137387137388137389137390137391137392137393137394137395137396137397137398137399137400137401137402137403137404137405137406137407137408137409137410137411137412137413137414137415137416137417137418137419137420137421137422137423137424137425137426137427137428137429137430137431137432137433137434137435137436137437137438137439137440137441137442137443137444137445137446137447137448137449137450137451137452137453137454137455137456137457137458137459137460137461137462137463137464137465137466137467137468137469137470137471137472137473137474137475137476137477137478137479137480137481137482137483137484137485137486137487137488137489137490137491137492137493137494137495137496137497137498137499137500137501137502137503137504137505137506137507137508137509137510137511137512137513137514137515137516137517137518137519137520137521137522137523137524137525137526137527137528137529137530137531137532137533137534137535137536137537137538137539137540137541137542137543137544137545137546137547137548137549137550137551137552137553137554137555137556137557137558137559137560137561137562137563137564137565137566137567137568137569137570137571137572137573137574137575137576137577137578137579137580137581137582137583137584137585137586137587137588137589137590137591137592137593137594137595137596137597137598137599137600137601137602137603137604137605137606137607137608137609137610137611137612137613137614137615137616137617137618137619137620137621137622137623137624137625137626137627137628137629137630137631137632137633137634137635137636137637137638137639137640137641137642137643137644137645137646137647137648137649137650137651137652137653137654137655137656137657137658137659137660137661137662137663137664137665137666137667137668137669137670137671137672137673137674137675137676137677137678137679137680137681137682137683137684137685137686137687137688137689137690137691137692137693137694137695137696137697137698137699137700137701137702137703137704137705137706137707137708137709137710137711137712137713137714137715137716137717137718137719137720137721137722137723137724137725137726137727137728137729137730137731137732137733137734137735137736137737137738137739137740137741137742137743137744137745137746137747137748137749137750137751137752137753137754137755137756137757137758137759137760137761137762137763137764137765137766137767137768137769137770137771137772137773137774137775137776137777137778137779137780137781137782137783137784137785137786137787137788137789137790137791137792137793137794137795137796137797137798137799137800137801137802137803137804137805137806137807137808137809137810137811137812137813137814137815137816137817137818137819137820137821137822137823137824137825137826137827137828137829137830137831137832137833137834137835137836137837137838137839137840137841137842137843137844137845137846137847137848137849137850137851137852137853137854137855137856137857137858137859137860137861137862137863137864137865137866137867137868137869137870137871137872137873137874137875137876137877137878137879137880137881137882137883137884137885137886137887137888137889137890137891137892137893137894137895137896137897137898137899137900137901137902137903137904137905137906137907137908137909137910137911137912137913137914137915137916137917137918137919137920137921137922137923137924137925137926137927137928137929137930137931137932137933137934137935137936137937137938137939137940137941137942137943137944137945137946137947137948137949137950137951137952137953137954137955137956137957137958137959137960137961137962137963137964137965137966137967137968137969137970137971137972137973137974137975137976137977137978137979137980137981137982137983137984137985137986137987137988137989137990137991137992137993137994137995137996137997137998137999138000138001138002138003138004138005138006138007138008138009138010138011138012138013138014138015138016138017138018138019138020138021138022138023138024138025138026138027138028138029138030138031138032138033138034138035138036138037138038138039138040138041138042138043138044138045138046138047138048138049138050138051138052138053138054138055138056138057138058138059138060138061138062138063138064138065138066138067138068138069138070138071138072138073138074138075138076138077138078138079138080138081138082138083138084138085138086138087138088138089138090138091138092138093138094138095138096138097138098138099138100138101138102138103138104138105138106138107138108138109138110138111138112138113138114138115138116138117138118138119138120138121138122138123138124138125138126138127138128138129138130138131138132138133138134138135138136138137138138138139138140138141138142138143138144138145138146138147138148138149138150138151138152138153138154138155138156138157138158138159138160138161138162138163138164138165138166138167138168138169138170138171138172138173138174138175138176138177138178138179138180138181138182138183138184138185138186138187138188138189138190138191138192138193138194138195138196138197138198138199138200138201138202138203138204138205138206138207138208138209138210138211138212138213138214138215138216138217138218138219138220138221138222138223138224138225138226138227138228138229138230138231138232138233138234138235138236138237138238138239138240138241138242138243138244138245138246138247138248138249138250138251138252138253138254138255138256138257138258138259138260138261138262138263138264138265138266138267138268138269138270138271138272138273138274138275138276138277138278138279138280138281138282138283138284138285138286138287138288138289138290138291138292138293138294138295138296138297138298138299138300138301138302138303138304138305138306138307138308138309138310138311138312138313138314138315138316138317138318138319138320138321138322138323138324138325138326138327138328138329138330138331138332138333138334138335138336138337138338138339138340138341138342138343138344138345138346138347138348138349138350138351138352138353138354138355138356138357138358138359138360138361138362138363138364138365138366138367138368138369138370138371138372138373138374138375138376138377138378138379138380138381138382138383138384138385138386138387138388138389138390138391138392138393138394138395138396138397138398138399138400138401138402138403138404138405138406138407138408138409138410138411138412138413138414138415138416138417138418138419138420138421138422138423138424138425138426138427138428138429138430138431138432138433138434138435138436138437138438138439138440138441138442138443138444138445138446138447138448138449138450138451138452138453138454138455138456138457138458138459138460138461138462138463138464138465138466138467138468138469138470138471138472138473138474138475138476138477138478138479138480138481138482138483138484138485138486138487138488138489138490138491138492138493138494138495138496138497138498138499138500138501138502138503138504138505138506138507138508138509138510138511138512138513138514138515138516138517138518138519138520138521138522138523138524138525138526138527138528138529138530138531138532138533138534138535138536138537138538138539138540138541138542138543138544138545138546138547138548138549138550138551138552138553138554138555138556138557138558138559138560138561138562138563138564138565138566138567138568138569138570138571138572138573138574138575138576138577138578138579138580138581138582138583138584138585138586138587138588138589138590138591138592138593138594138595138596138597138598138599138600138601138602138603138604138605138606138607138608138609138610138611138612138613138614138615138616138617138618138619138620138621138622138623138624138625138626138627138628138629138630138631138632138633138634138635138636138637138638138639138640138641138642138643138644138645138646138647138648138649138650138651138652138653138654138655138656138657138658138659138660138661138662138663138664138665138666138667138668138669138670138671138672138673138674138675138676138677138678138679138680138681138682138683138684138685138686138687138688138689138690138691138692138693138694138695138696138697138698138699138700138701138702138703138704138705138706138707138708138709138710138711138712138713138714138715138716138717138718138719138720138721138722138723138724138725138726138727138728138729138730138731138732138733138734138735138736138737138738138739138740138741138742138743138744138745138746138747138748138749138750138751138752138753138754138755138756138757138758138759138760138761138762138763138764138765138766138767138768138769138770138771138772138773138774138775138776138777138778138779138780138781138782138783138784138785138786138787138788138789138790138791138792138793138794138795138796138797138798138799138800138801138802138803138804138805138806138807138808138809138810138811138812138813138814138815138816138817138818138819138820138821138822138823138824138825138826138827138828138829138830138831138832138833138834138835138836138837138838138839138840138841138842138843138844138845138846138847138848138849138850138851138852138853138854138855138856138857138858138859138860138861138862138863138864138865138866138867138868138869138870138871138872138873138874138875138876138877138878138879138880138881138882138883138884138885138886138887138888138889138890138891138892138893138894138895138896138897138898138899138900138901138902138903138904138905138906138907138908138909138910138911138912138913138914138915138916138917138918138919138920138921138922138923138924138925138926138927138928138929138930138931138932138933138934138935138936138937138938138939138940138941138942138943138944138945138946138947138948138949138950138951138952138953138954138955138956138957138958138959138960138961138962138963138964138965138966138967138968138969138970138971138972138973138974138975138976138977138978138979138980138981138982138983138984138985138986138987138988138989138990138991138992138993138994138995138996138997138998138999139000139001139002139003139004139005139006139007139008139009139010139011139012139013139014139015139016139017139018139019139020139021139022139023139024139025139026139027139028139029139030139031139032139033139034139035139036139037139038139039139040139041139042139043139044139045139046139047139048139049139050139051139052139053139054139055139056139057139058139059139060139061139062139063139064139065139066139067139068139069139070139071139072139073139074139075139076139077139078139079139080139081139082139083139084139085139086139087139088139089139090139091139092139093139094139095139096139097139098139099139100139101139102139103139104139105139106139107139108139109139110139111139112139113139114139115139116139117139118139119139120139121139122139123139124139125139126139127139128139129139130139131139132139133139134139135139136139137139138139139139140139141139142139143139144139145139146139147139148139149139150139151139152139153139154139155139156139157139158139159139160139161139162139163139164139165139166139167139168139169139170139171139172139173139174139175139176139177139178139179139180139181139182139183139184139185139186139187139188139189139190139191139192139193139194139195139196139197139198139199139200139201139202139203139204139205139206139207139208139209139210139211139212139213139214139215139216139217139218139219139220139221139222139223139224139225139226139227139228139229139230139231139232139233139234139235139236139237139238139239139240139241139242139243139244139245139246139247139248139249139250139251139252139253139254139255139256139257139258139259139260139261139262139263139264139265139266139267139268139269139270139271139272139273139274139275139276139277139278139279139280139281139282139283139284139285139286139287139288139289139290139291139292139293139294139295139296139297139298139299139300139301139302139303139304139305139306139307139308139309139310139311139312139313139314139315139316139317139318139319139320139321139322139323139324139325139326139327139328139329139330139331139332139333139334139335139336139337139338139339139340139341139342139343139344139345139346139347139348139349139350139351139352139353139354139355139356139357139358139359139360139361139362139363139364139365139366139367139368139369139370139371139372139373139374139375139376139377139378139379139380139381139382139383139384139385139386139387139388139389139390139391139392139393139394139395139396139397139398139399139400139401139402139403139404139405139406139407139408139409139410139411139412139413139414139415139416139417139418139419139420139421139422139423139424139425139426139427139428139429139430139431139432139433139434139435139436139437139438139439139440139441139442139443139444139445139446139447139448139449139450139451139452139453139454139455139456139457139458139459139460139461139462139463139464139465139466139467139468139469139470139471139472139473139474139475139476139477139478139479139480139481139482139483139484139485139486139487139488139489139490139491139492139493139494139495139496139497139498139499139500139501139502139503139504139505139506139507139508139509139510139511139512139513139514139515139516139517139518139519139520139521139522139523139524139525139526139527139528139529139530139531139532139533139534139535139536139537139538139539139540139541139542139543139544139545139546139547139548139549139550139551139552139553139554139555139556139557139558139559139560139561139562139563139564139565139566139567139568139569139570139571139572139573139574139575139576139577139578139579139580139581139582139583139584139585139586139587139588139589139590139591139592139593139594139595139596139597139598139599139600139601139602139603139604139605139606139607139608139609139610139611139612139613139614139615139616139617139618139619139620139621139622139623139624139625139626139627139628139629139630139631139632139633139634139635139636139637139638139639139640139641139642139643139644139645139646139647139648139649139650139651139652139653139654139655139656139657139658139659139660139661139662139663139664139665139666139667139668139669139670139671139672139673139674139675139676139677139678139679139680139681139682139683139684139685139686139687139688139689139690139691139692139693139694139695139696139697139698139699139700139701139702139703139704139705139706139707139708139709139710139711139712139713139714139715139716139717139718139719139720139721139722139723139724139725139726139727139728139729139730139731139732139733139734139735139736139737139738139739139740139741139742139743139744139745139746139747139748139749139750139751139752139753139754139755139756139757139758139759139760139761139762139763139764139765139766139767139768139769139770139771139772139773139774139775139776139777139778139779139780139781139782139783139784139785139786139787139788139789139790139791139792139793139794139795139796139797139798139799139800139801139802139803139804139805139806139807139808139809139810139811139812139813139814139815139816139817139818139819139820139821139822139823139824139825139826139827139828139829139830139831139832139833139834139835139836139837139838139839139840139841139842139843139844139845139846139847139848139849139850139851139852139853139854139855139856139857139858139859139860139861139862139863139864139865139866139867139868139869139870139871139872139873139874139875139876139877139878139879139880139881139882139883139884139885139886139887139888139889139890139891139892139893139894139895139896139897139898139899139900139901139902139903139904139905139906139907139908139909139910139911139912139913139914139915139916139917139918139919139920139921139922139923139924139925139926139927139928139929139930139931139932139933139934139935139936139937139938139939139940139941139942139943139944139945139946139947139948139949139950139951139952139953139954139955139956139957139958139959139960139961139962139963139964139965139966139967139968139969139970139971139972139973139974139975139976139977139978139979139980139981139982139983139984139985139986139987139988139989139990139991139992139993139994139995139996139997139998139999140000140001140002140003140004140005140006140007140008140009140010140011140012140013140014140015140016140017140018140019140020140021140022140023140024140025140026140027140028140029140030140031140032140033140034140035140036140037140038140039140040140041140042140043140044140045140046140047140048140049140050140051140052140053140054140055140056140057140058140059140060140061140062140063140064140065140066140067140068140069140070140071140072140073140074140075140076140077140078140079140080140081140082140083140084140085140086140087140088140089140090140091140092140093140094140095140096140097140098140099140100140101140102140103140104140105140106140107140108140109140110140111140112140113140114140115140116140117140118140119140120140121140122140123140124140125140126140127140128140129140130140131140132140133140134140135140136140137140138140139140140140141140142140143140144140145140146140147140148140149140150140151140152140153140154140155140156140157140158140159140160140161140162140163140164140165140166140167140168140169140170140171140172140173140174140175140176140177140178140179140180140181140182140183140184140185140186140187140188140189140190140191140192140193140194140195140196140197140198140199140200140201140202140203140204140205140206140207140208140209140210140211140212140213140214140215140216140217140218140219140220140221140222140223140224140225140226140227140228140229140230140231140232140233140234140235140236140237140238140239140240140241140242140243140244140245140246140247140248140249140250140251140252140253140254140255140256140257140258140259140260140261140262140263140264140265140266140267140268140269140270140271140272140273140274140275140276140277140278140279140280140281140282140283140284140285140286140287140288140289140290140291140292140293140294140295140296140297140298140299140300140301140302140303140304140305140306140307140308140309140310140311140312140313140314140315140316140317140318140319140320140321140322140323140324140325140326140327140328140329140330140331140332140333140334140335140336140337140338140339140340140341140342140343140344140345140346140347140348140349140350140351140352140353140354140355140356140357140358140359140360140361140362140363140364140365140366140367140368140369140370140371140372140373140374140375140376140377140378140379140380140381140382140383140384140385140386140387140388140389140390140391140392140393140394140395140396140397140398140399140400140401140402140403140404140405140406140407140408140409140410140411140412140413140414140415140416140417140418140419140420140421140422140423140424140425140426140427140428140429140430140431140432140433140434140435140436140437140438140439140440140441140442140443140444140445140446140447140448140449140450140451140452140453140454140455140456140457140458140459140460140461140462140463140464140465140466140467140468140469140470140471140472140473140474140475140476140477140478140479140480140481140482140483140484140485140486140487140488140489140490140491140492140493140494140495140496140497140498140499140500140501140502140503140504140505140506140507140508140509140510140511140512140513140514140515140516140517140518140519140520140521140522140523140524140525140526140527140528140529140530140531140532140533140534140535140536140537140538140539140540140541140542140543140544140545140546140547140548140549140550140551140552140553140554140555140556140557140558140559140560140561140562140563140564140565140566140567140568140569140570140571140572140573140574140575140576140577140578140579140580140581140582140583140584140585140586140587140588140589140590140591140592140593140594140595140596140597140598140599140600140601140602140603140604140605140606140607140608140609140610140611140612140613140614140615140616140617140618140619140620140621140622140623140624140625140626140627140628140629140630140631140632140633140634140635140636140637140638140639140640140641140642140643140644140645140646140647140648140649140650140651140652140653140654140655140656140657140658140659140660140661140662140663140664140665140666140667140668140669140670140671140672140673140674140675140676140677140678140679140680140681140682140683140684140685140686140687140688140689140690140691140692140693140694140695140696140697140698140699140700140701140702140703140704140705140706140707140708140709140710140711140712140713140714140715140716140717140718140719140720140721140722140723140724140725140726140727140728140729140730140731140732140733140734140735140736140737140738140739140740140741140742140743140744140745140746140747140748140749140750140751140752140753140754140755140756140757140758140759140760140761140762140763140764140765140766140767140768140769140770140771140772140773140774140775140776140777140778140779140780140781140782140783140784140785140786140787140788140789140790140791140792140793140794140795140796140797140798140799140800140801140802140803140804140805140806140807140808140809140810140811140812140813140814140815140816140817140818140819140820140821140822140823140824140825140826140827140828140829140830140831140832140833140834140835140836140837140838140839140840140841140842140843140844140845140846140847140848140849140850140851140852140853140854140855140856140857140858140859140860140861140862140863140864140865140866140867140868140869140870140871140872140873140874140875140876140877140878140879140880140881140882140883140884140885140886140887140888140889140890140891140892140893140894140895140896140897140898140899140900140901140902140903140904140905140906140907140908140909140910140911140912140913140914140915140916140917140918140919140920140921140922140923140924140925140926140927140928140929140930140931140932140933140934140935140936140937140938140939140940140941140942140943140944140945140946140947140948140949140950140951140952140953140954140955140956140957140958140959140960140961140962140963140964140965140966140967140968140969140970140971140972140973140974140975140976140977140978140979140980140981140982140983140984140985140986140987140988140989140990140991140992140993140994140995140996140997140998140999141000141001141002141003141004141005141006141007141008141009141010141011141012141013141014141015141016141017141018141019141020141021141022141023141024141025141026141027141028141029141030141031141032141033141034141035141036141037141038141039141040141041141042141043141044141045141046141047141048141049141050141051141052141053141054141055141056141057141058141059141060141061141062141063141064141065141066141067141068141069141070141071141072141073141074141075141076141077141078141079141080141081141082141083141084141085141086141087141088141089141090141091141092141093141094141095141096141097141098141099141100141101141102141103141104141105141106141107141108141109141110141111141112141113141114141115141116141117141118141119141120141121141122141123141124141125141126141127141128141129141130141131141132141133141134141135141136141137141138141139141140141141141142141143141144141145141146141147141148141149141150141151141152141153141154141155141156141157141158141159141160141161141162141163141164141165141166141167141168141169141170141171141172141173141174141175141176141177141178141179141180141181141182141183141184141185141186141187141188141189141190141191141192141193141194141195141196141197141198141199141200141201141202141203141204141205141206141207141208141209141210141211141212141213141214141215141216141217141218141219141220141221141222141223141224141225141226141227141228141229141230141231141232141233141234141235141236141237141238141239141240141241141242141243141244141245141246141247141248141249141250141251141252141253141254141255141256141257141258141259141260141261141262141263141264141265141266141267141268141269141270141271141272141273141274141275141276141277141278141279141280141281141282141283141284141285141286141287141288141289141290141291141292141293141294141295141296141297141298141299141300141301141302141303141304141305141306141307141308141309141310141311141312141313141314141315141316141317141318141319141320141321141322141323141324141325141326141327141328141329141330141331141332141333141334141335141336141337141338141339141340141341141342141343141344141345141346141347141348141349141350141351141352141353141354141355141356141357141358141359141360141361141362141363141364141365141366141367141368141369141370141371141372141373141374141375141376141377141378141379141380141381141382141383141384141385141386141387141388141389141390141391141392141393141394141395141396141397141398141399141400141401141402141403141404141405141406141407141408141409141410141411141412141413141414141415141416141417141418141419141420141421141422141423141424141425141426141427141428141429141430141431141432141433141434141435141436141437141438141439141440141441141442141443141444141445141446141447141448141449141450141451141452141453141454141455141456141457141458141459141460141461141462141463141464141465141466141467141468141469141470141471141472141473141474141475141476141477141478141479141480141481141482141483141484141485141486141487141488141489141490141491141492141493141494141495141496141497141498141499141500141501141502141503141504141505141506141507141508141509141510141511141512141513141514141515141516141517141518141519141520141521141522141523141524141525141526141527141528141529141530141531141532141533141534141535141536141537141538141539141540141541141542141543141544141545141546141547141548141549141550141551141552141553141554141555141556141557141558141559141560141561141562141563141564141565141566141567141568141569141570141571141572141573141574141575141576141577141578141579141580141581141582141583141584141585141586141587141588141589141590141591141592141593141594141595141596141597141598141599141600141601141602141603141604141605141606141607141608141609141610141611141612141613141614141615141616141617141618141619141620141621141622141623141624141625141626141627141628141629141630141631141632141633141634141635141636141637141638141639141640141641141642141643141644141645141646141647141648141649141650141651141652141653141654141655141656141657141658141659141660141661141662141663141664141665141666141667141668141669141670141671141672141673141674141675141676141677141678141679141680141681141682141683141684141685141686141687141688141689141690141691141692141693141694141695141696141697141698141699141700141701141702141703141704141705141706141707141708141709141710141711141712141713141714141715141716141717141718141719141720141721141722141723141724141725141726141727141728141729141730141731141732141733141734141735141736141737141738141739141740141741141742141743141744141745141746141747141748141749141750141751141752141753141754141755141756141757141758141759141760141761141762141763141764141765141766141767141768141769141770141771141772141773141774141775141776141777141778141779141780141781141782141783141784141785141786141787141788141789141790141791141792141793141794141795141796141797141798141799141800141801141802141803141804141805141806141807141808141809141810141811141812141813141814141815141816141817141818141819141820141821141822141823141824141825141826141827141828141829141830141831141832141833141834141835141836141837141838141839141840141841141842141843141844141845141846141847141848141849141850141851141852141853141854141855141856141857141858141859141860141861141862141863141864141865141866141867141868141869141870141871141872141873141874141875141876141877141878141879141880141881141882141883141884141885141886141887141888141889141890141891141892141893141894141895141896141897141898141899141900141901141902141903141904141905141906141907141908141909141910141911141912141913141914141915141916141917141918141919141920141921141922141923141924141925141926141927141928141929141930141931141932141933141934141935141936141937141938141939141940141941141942141943141944141945141946141947141948141949141950141951141952141953141954141955141956141957141958141959141960141961141962141963141964141965141966141967141968141969141970141971141972141973141974141975141976141977141978141979141980141981141982141983141984141985141986141987141988141989141990141991141992141993141994141995141996141997141998141999142000142001142002142003142004142005142006142007142008142009142010142011142012142013142014142015142016142017142018142019142020142021142022142023142024142025142026142027142028142029142030142031142032142033142034142035142036142037142038142039142040142041142042142043142044142045142046142047142048142049142050142051142052142053142054142055142056142057142058142059142060142061142062142063142064142065142066142067142068142069142070142071142072142073142074142075142076142077142078142079142080142081142082142083142084142085142086142087142088142089142090142091142092142093142094142095142096142097142098142099142100142101142102142103142104142105142106142107142108142109142110142111142112142113142114142115142116142117142118142119142120142121142122142123142124142125142126142127142128142129142130142131142132142133142134142135142136142137142138142139142140142141142142142143142144142145142146142147142148142149142150142151142152142153142154142155142156142157142158142159142160142161142162142163142164142165142166142167142168142169142170142171142172142173142174142175142176142177142178142179142180142181142182142183142184142185142186142187142188142189142190142191142192142193142194142195142196142197142198142199142200142201142202142203142204142205142206142207142208142209142210142211142212142213142214142215142216142217142218142219142220142221142222142223142224142225142226142227142228142229142230142231142232142233142234142235142236142237142238142239142240142241142242142243142244142245142246142247142248142249142250142251142252142253142254142255142256142257142258142259142260142261142262142263142264142265142266142267142268142269142270142271142272142273142274142275142276142277142278142279142280142281142282142283142284142285142286142287142288142289142290142291142292142293142294142295142296142297142298142299142300142301142302142303142304142305142306142307142308142309142310142311142312142313142314142315142316142317142318142319142320142321142322142323142324142325142326142327142328142329142330142331142332142333142334142335142336142337142338142339142340142341142342142343142344142345142346142347142348142349142350142351142352142353142354142355142356142357142358142359142360142361142362142363142364142365142366142367142368142369142370142371142372142373142374142375142376142377142378142379142380142381142382142383142384142385142386142387142388142389142390142391142392142393142394142395142396142397142398142399142400142401142402142403142404142405142406142407142408142409142410142411142412142413142414142415142416142417142418142419142420142421142422142423142424142425142426142427142428142429142430142431142432142433142434142435142436142437142438142439142440142441142442142443142444142445142446142447142448142449142450142451142452142453142454142455142456142457142458142459142460142461142462142463142464142465142466142467142468142469142470142471142472142473142474142475142476142477142478142479142480142481142482142483142484142485142486142487142488142489142490142491142492142493142494142495142496142497142498142499142500142501142502142503142504142505142506142507142508142509142510142511142512142513142514142515142516142517142518142519142520142521142522142523142524142525142526142527142528142529142530142531142532142533142534142535142536142537142538142539142540142541142542142543142544142545142546142547142548142549142550142551142552142553142554142555142556142557142558142559142560142561142562142563142564142565142566142567142568142569142570142571142572142573142574142575142576142577142578142579142580142581142582142583142584142585142586142587142588142589142590142591142592142593142594142595142596142597142598142599142600142601142602142603142604142605142606142607142608142609142610142611142612142613142614142615142616142617142618142619142620142621142622142623142624142625142626142627142628142629142630142631142632142633142634142635142636142637142638142639142640142641142642142643142644142645142646142647142648142649142650142651142652142653142654142655142656142657142658142659142660142661142662142663142664142665142666142667142668142669142670142671142672142673142674142675142676142677142678142679142680142681142682142683142684142685142686142687142688142689142690142691142692142693142694142695142696142697142698142699142700142701142702142703142704142705142706142707142708142709142710142711142712142713142714142715142716142717142718142719142720142721142722142723142724142725142726142727142728142729142730142731142732142733142734142735142736142737142738142739142740142741142742142743142744142745142746142747142748142749142750142751142752142753142754142755142756142757142758142759142760142761142762142763142764142765142766142767142768142769142770142771142772142773142774142775142776142777142778142779142780142781142782142783142784142785142786142787142788142789142790142791142792142793142794142795142796142797142798142799142800142801142802142803142804142805142806142807142808142809142810142811142812142813142814142815142816142817142818142819142820142821142822142823142824142825142826142827142828142829142830142831142832142833142834142835142836142837142838142839142840142841142842142843142844142845142846142847142848142849142850142851142852142853142854142855142856142857142858142859142860142861142862142863142864142865142866142867142868142869142870142871142872142873142874142875142876142877142878142879142880142881142882142883142884142885142886142887142888142889142890142891142892142893142894142895142896142897142898142899142900142901142902142903142904142905142906142907142908142909142910142911142912142913142914142915142916142917142918142919142920142921142922142923142924142925142926142927142928142929142930142931142932142933142934142935142936142937142938142939142940142941142942142943142944142945142946142947142948142949142950142951142952142953142954142955142956142957142958142959142960142961142962142963142964142965142966142967142968142969142970142971142972142973142974142975142976142977142978142979142980142981142982142983142984142985142986142987142988142989142990142991142992142993142994142995142996142997142998142999143000143001143002143003143004143005143006143007143008143009143010143011143012143013143014143015143016143017143018143019143020143021143022143023143024143025143026143027143028143029143030143031143032143033143034143035143036143037143038143039143040143041143042143043143044143045143046143047143048143049143050143051143052143053143054143055143056143057143058143059143060143061143062143063143064143065143066143067143068143069143070143071143072143073143074143075143076143077143078143079143080143081143082143083143084143085143086143087143088143089143090143091143092143093143094143095143096143097143098143099143100143101143102143103143104143105143106143107143108143109143110143111143112143113143114143115143116143117143118143119143120143121143122143123143124143125143126143127143128143129143130143131143132143133143134143135143136143137143138143139143140143141143142143143143144143145143146143147143148143149143150143151143152143153143154143155143156143157143158143159143160143161143162143163143164143165143166143167143168143169143170143171143172143173143174143175143176143177143178143179143180143181143182143183143184143185143186143187143188143189143190143191143192143193143194143195143196143197143198143199143200143201143202143203143204143205143206143207143208143209143210143211143212143213143214143215143216143217143218143219143220143221143222143223143224143225143226143227143228143229143230143231143232143233143234143235143236143237143238143239143240143241143242143243143244143245143246143247143248143249143250143251143252143253143254143255143256143257143258143259143260143261143262143263143264143265143266143267143268143269143270143271143272143273143274143275143276143277143278143279143280143281143282143283143284143285143286143287143288143289143290143291143292143293143294143295143296143297143298143299143300143301143302143303143304143305143306143307143308143309143310143311143312143313143314143315143316143317143318143319143320143321143322143323143324143325143326143327143328143329143330143331143332143333143334143335143336143337143338143339143340143341143342143343143344143345143346143347143348143349143350143351143352143353143354143355143356143357143358143359143360143361143362143363143364143365143366143367143368143369143370143371143372143373143374143375143376143377143378143379143380143381143382143383143384143385143386143387143388143389143390143391143392143393143394143395143396143397143398143399143400143401143402143403143404143405143406143407143408143409143410143411143412143413143414143415143416143417143418143419143420143421143422143423143424143425143426143427143428143429143430143431143432143433143434143435143436143437143438143439143440143441143442143443143444143445143446143447143448143449143450143451143452143453143454143455143456143457143458143459143460143461143462143463143464143465143466143467143468143469143470143471143472143473143474143475143476143477143478143479143480143481143482143483143484143485143486143487143488143489143490143491143492143493143494143495143496143497143498143499143500143501143502143503143504143505143506143507143508143509143510143511143512143513143514143515143516143517143518143519143520143521143522143523143524143525143526143527143528143529143530143531143532143533143534143535143536143537143538143539143540143541143542143543143544143545143546143547143548143549143550143551143552143553143554143555143556143557143558143559143560143561143562143563143564143565143566143567143568143569143570143571143572143573143574143575143576143577143578143579143580143581143582143583143584143585143586143587143588143589143590143591143592143593143594143595143596143597143598143599143600143601143602143603143604143605143606143607143608143609143610143611143612143613143614143615143616143617143618143619143620143621143622143623143624143625143626143627143628143629143630143631143632143633143634143635143636143637143638143639143640143641143642143643143644143645143646143647143648143649143650143651143652143653143654143655143656143657143658143659143660143661143662143663143664143665143666143667143668143669143670143671143672143673143674143675143676143677143678143679143680143681143682143683143684143685143686143687143688143689143690143691143692143693143694143695143696143697143698143699143700143701143702143703143704143705143706143707143708143709143710143711143712143713143714143715143716143717143718143719143720143721143722143723143724143725143726143727143728143729143730143731143732143733143734143735143736143737143738143739143740143741143742143743143744143745143746143747143748143749143750143751143752143753143754143755143756143757143758143759143760143761143762143763143764143765143766143767143768143769143770143771143772143773143774143775143776143777143778143779143780143781143782143783143784143785143786143787143788143789143790143791143792143793143794143795143796143797143798143799143800143801143802143803143804143805143806143807143808143809143810143811143812143813143814143815143816143817143818143819143820143821143822143823143824143825143826143827143828143829143830143831143832143833143834143835143836143837143838143839143840143841143842143843143844143845143846143847143848143849143850143851143852143853143854143855143856143857143858143859143860143861143862143863143864143865143866143867143868143869143870143871143872143873143874143875143876143877143878143879143880143881143882143883143884143885143886143887143888143889143890143891143892143893143894143895143896143897143898143899143900143901143902143903143904143905143906143907143908143909143910143911143912143913143914143915143916143917143918143919143920143921143922143923143924143925143926143927143928143929143930143931143932143933143934143935143936143937143938143939143940143941143942143943143944143945143946143947143948143949143950143951143952143953143954143955143956143957143958143959143960143961143962143963143964143965143966143967143968143969143970143971143972143973143974143975143976143977143978143979143980143981143982143983143984143985143986143987143988143989143990143991143992143993143994143995143996143997143998143999144000144001144002144003144004144005144006144007144008144009144010144011144012144013144014144015144016144017144018144019144020144021144022144023144024144025144026144027144028144029144030144031144032144033144034144035144036144037144038144039144040144041144042144043144044144045144046144047144048144049144050144051144052144053144054144055144056144057144058144059144060144061144062144063144064144065144066144067144068144069144070144071144072144073144074144075144076144077144078144079144080144081144082144083144084144085144086144087144088144089144090144091144092144093144094144095144096144097144098144099144100144101144102144103144104144105144106144107144108144109144110144111144112144113144114144115144116144117144118144119144120144121144122144123144124144125144126144127144128144129144130144131144132144133144134144135144136144137144138144139144140144141144142144143144144144145144146144147144148144149144150144151144152144153144154144155144156144157144158144159144160144161144162144163144164144165144166144167144168144169144170144171144172144173144174144175144176144177144178144179144180144181144182144183144184144185144186144187144188144189144190144191144192144193144194144195144196144197144198144199144200144201144202144203144204144205144206144207144208144209144210144211144212144213144214144215144216144217144218144219144220144221144222144223144224144225144226144227144228144229144230144231144232144233144234144235144236144237144238144239144240144241144242144243144244144245144246144247144248144249144250144251144252144253144254144255144256144257144258144259144260144261144262144263144264144265144266144267144268144269144270144271144272144273144274144275144276144277144278144279144280144281144282144283144284144285144286144287144288144289144290144291144292144293144294144295144296144297144298144299144300144301144302144303144304144305144306144307144308144309144310144311144312144313144314144315144316144317144318144319144320144321144322144323144324144325144326144327144328144329144330144331144332144333144334144335144336144337144338144339144340144341144342144343144344144345144346144347144348144349144350144351144352144353144354144355144356144357144358144359144360144361144362144363144364144365144366144367144368144369144370144371144372144373144374144375144376144377144378144379144380144381144382144383144384144385144386144387144388144389144390144391144392144393144394144395144396144397144398144399144400144401144402144403144404144405144406144407144408144409144410144411144412144413144414144415144416144417144418144419144420144421144422144423144424144425144426144427144428144429144430144431144432144433144434144435144436144437144438144439144440144441144442144443144444144445144446144447144448144449144450144451144452144453144454144455144456144457144458144459144460144461144462144463144464144465144466144467144468144469144470144471144472144473144474144475144476144477144478144479144480144481144482144483144484144485144486144487144488144489144490144491144492144493144494144495144496144497144498144499144500144501144502144503144504144505144506144507144508144509144510144511144512144513144514144515144516144517144518144519144520144521144522144523144524144525144526144527144528144529144530144531144532144533144534144535144536144537144538144539144540144541144542144543144544144545144546144547144548144549144550144551144552144553144554144555144556144557144558144559144560144561144562144563144564144565144566144567144568144569144570144571144572144573144574144575144576144577144578144579144580144581144582144583144584144585144586144587144588144589144590144591144592144593144594144595144596144597144598144599144600144601144602144603144604144605144606144607144608144609144610144611144612144613144614144615144616144617144618144619144620144621144622144623144624144625144626144627144628144629144630144631144632144633144634144635144636144637144638144639144640144641144642144643144644144645144646144647144648144649144650144651144652144653144654144655144656144657144658144659144660144661144662144663144664144665144666144667144668144669144670144671144672144673144674144675144676144677144678144679144680144681144682144683144684144685144686144687144688144689144690144691144692144693144694144695144696144697144698144699144700144701144702144703144704144705144706144707144708144709144710144711144712144713144714144715144716144717144718144719144720144721144722144723144724144725144726144727144728144729144730144731144732144733144734144735144736144737144738144739144740144741144742144743144744144745144746144747144748144749144750144751144752144753144754144755144756144757144758144759144760144761144762144763144764144765144766144767144768144769144770144771144772144773144774144775144776144777144778144779144780144781144782144783144784144785144786144787144788144789144790144791144792144793144794144795144796144797144798144799144800144801144802144803144804144805144806144807144808144809144810144811144812144813144814144815144816144817144818144819144820144821144822144823144824144825144826144827144828144829144830144831144832144833144834144835144836144837144838144839144840144841144842144843144844144845144846144847144848144849144850144851144852144853144854144855144856144857144858144859144860144861144862144863144864144865144866144867144868144869144870144871144872144873144874144875144876144877144878144879144880144881144882144883144884144885144886144887144888144889144890144891144892144893144894144895144896144897144898144899144900144901144902144903144904144905144906144907144908144909144910144911144912144913144914144915144916144917144918144919144920144921144922144923144924144925144926144927144928144929144930144931144932144933144934144935144936144937144938144939144940144941144942144943144944144945144946144947144948144949144950144951144952144953144954144955144956144957144958144959144960144961144962144963144964144965144966144967144968144969144970144971144972144973144974144975144976144977144978144979144980144981144982144983144984144985144986144987144988144989144990144991144992144993144994144995144996144997144998144999145000145001145002145003145004145005145006145007145008145009145010145011145012145013145014145015145016145017145018145019145020145021145022145023145024145025145026145027145028145029145030145031145032145033145034145035145036145037145038145039145040145041145042145043145044145045145046145047145048145049145050145051145052145053145054145055145056145057145058145059145060145061145062145063145064145065145066145067145068145069145070145071145072145073145074145075145076145077145078145079145080145081145082145083145084145085145086145087145088145089145090145091145092145093145094145095145096145097145098145099145100145101145102145103145104145105145106145107145108145109145110145111145112145113145114145115145116145117145118145119145120145121145122145123145124145125145126145127145128145129145130145131145132145133145134145135145136145137145138145139145140145141145142145143145144145145145146145147145148145149145150145151145152145153145154145155145156145157145158145159145160145161145162145163145164145165145166145167145168145169145170145171145172145173145174145175145176145177145178145179145180145181145182145183145184145185145186145187145188145189145190145191145192145193145194145195145196145197145198145199145200145201145202145203145204145205145206145207145208145209145210145211145212145213145214145215145216145217145218145219145220145221145222145223145224145225145226145227145228145229145230145231145232145233145234145235145236145237145238145239145240145241145242145243145244145245145246145247145248145249145250145251145252145253145254145255145256145257145258145259145260145261145262145263145264145265145266145267145268145269145270145271145272145273145274145275145276145277145278145279145280145281145282145283145284145285145286145287145288145289145290145291145292145293145294145295145296145297145298145299145300145301145302145303145304145305145306145307145308145309145310145311145312145313145314145315145316145317145318145319145320145321145322145323145324145325145326145327145328145329145330145331145332145333145334145335145336145337145338145339145340145341145342145343145344145345145346145347145348145349145350145351145352145353145354145355145356145357145358145359145360145361145362145363145364145365145366145367145368145369145370145371145372145373145374145375145376145377145378145379145380145381145382145383145384145385145386145387145388145389145390145391145392145393145394145395145396145397145398145399145400145401145402145403145404145405145406145407145408145409145410145411145412145413145414145415145416145417145418145419145420145421145422145423145424145425145426145427145428145429145430145431145432145433145434145435145436145437145438145439145440145441145442145443145444145445145446145447145448145449145450145451145452145453145454145455145456145457145458145459145460145461145462145463145464145465145466145467145468145469145470145471145472145473145474145475145476145477145478145479145480145481145482145483145484145485145486145487145488145489145490145491145492145493145494145495145496145497145498145499145500145501145502145503145504145505145506145507145508145509145510145511145512145513145514145515145516145517145518145519145520145521145522145523145524145525145526145527145528145529145530145531145532145533145534145535145536145537145538145539145540145541145542145543145544145545145546145547145548145549145550145551145552145553145554145555145556145557145558145559145560145561145562145563145564145565145566145567145568145569145570145571145572145573145574145575145576145577145578145579145580145581145582145583145584145585145586145587145588145589145590145591145592145593145594145595145596145597145598145599145600145601145602145603145604145605145606145607145608145609145610145611145612145613145614145615145616145617145618145619145620145621145622145623145624145625145626145627145628145629145630145631145632145633145634145635145636145637145638145639145640145641145642145643145644145645145646145647145648145649145650145651145652145653145654145655145656145657145658145659145660145661145662145663145664145665145666145667145668145669145670145671145672145673145674145675145676145677145678145679145680145681145682145683145684145685145686145687145688145689145690145691145692145693145694145695145696145697145698145699145700145701145702145703145704145705145706145707145708145709145710145711145712145713145714145715145716145717145718145719145720145721145722145723145724145725145726145727145728145729145730145731145732145733145734145735145736145737145738145739145740145741145742145743145744145745145746145747145748145749145750145751145752145753145754145755145756145757145758145759145760145761145762145763145764145765145766145767145768145769145770145771145772145773145774145775145776145777145778145779145780145781145782145783145784145785145786145787145788145789145790145791145792145793145794145795145796145797145798145799145800145801145802145803145804145805145806145807145808145809145810145811145812145813145814145815145816145817145818145819145820145821145822145823145824145825145826145827145828145829145830145831145832145833145834145835145836145837145838145839145840145841145842145843145844145845145846145847145848145849145850145851145852145853145854145855145856145857145858145859145860145861145862145863145864145865145866145867145868145869145870145871145872145873145874145875145876145877145878145879145880145881145882145883145884145885145886145887145888145889145890145891145892145893145894145895145896145897145898145899145900145901145902145903145904145905145906145907145908145909145910145911145912145913145914145915145916145917145918145919145920145921145922145923145924145925145926145927145928145929145930145931145932145933145934145935145936145937145938145939145940145941145942145943145944145945145946145947145948145949145950145951145952145953145954145955145956145957145958145959145960145961145962145963145964145965145966145967145968145969145970145971145972145973145974145975145976145977145978145979145980145981145982145983145984145985145986145987145988145989145990145991145992145993145994145995145996145997145998145999146000146001146002146003146004146005146006146007146008146009146010146011146012146013146014146015146016146017146018146019146020146021146022146023146024146025146026146027146028146029146030146031146032146033146034146035146036146037146038146039146040146041146042146043146044146045146046146047146048146049146050146051146052146053146054146055146056146057146058146059146060146061146062146063146064146065146066146067146068146069146070146071146072146073146074146075146076146077146078146079146080146081146082146083146084146085146086146087146088146089146090146091146092146093146094146095146096146097146098146099146100146101146102146103146104146105146106146107146108146109146110146111146112146113146114146115146116146117146118146119146120146121146122146123146124146125146126146127146128146129146130146131146132146133146134146135146136146137146138146139146140146141146142146143146144146145146146146147146148146149146150146151146152146153146154146155146156146157146158146159146160146161146162146163146164146165146166146167146168146169146170146171146172146173146174146175146176146177146178146179146180146181146182146183146184146185146186146187146188146189146190146191146192146193146194146195146196146197146198146199146200146201146202146203146204146205146206146207146208146209146210146211146212146213146214146215146216146217146218146219146220146221146222146223146224146225146226146227146228146229146230146231146232146233146234146235146236146237146238146239146240146241146242146243146244146245146246146247146248146249146250146251146252146253146254146255146256146257146258146259146260146261146262146263146264146265146266146267146268146269146270146271146272146273146274146275146276146277146278146279146280146281146282146283146284146285146286146287146288146289146290146291146292146293146294146295146296146297146298146299146300146301146302146303146304146305146306146307146308146309146310146311146312146313146314146315146316146317146318146319146320146321146322146323146324146325146326146327146328146329146330146331146332146333146334146335146336146337146338146339146340146341146342146343146344146345146346146347146348146349146350146351146352146353146354146355146356146357146358146359146360146361146362146363146364146365146366146367146368146369146370146371146372146373146374146375146376146377146378146379146380146381146382146383146384146385146386146387146388146389146390146391146392146393146394146395146396146397146398146399146400146401146402146403146404146405146406146407146408146409146410146411146412146413146414146415146416146417146418146419146420146421146422146423146424146425146426146427146428146429146430146431146432146433146434146435146436146437146438146439146440146441146442146443146444146445146446146447146448146449146450146451146452146453146454146455146456146457146458146459146460146461146462146463146464146465146466146467146468146469146470146471146472146473146474146475146476146477146478146479146480146481146482146483146484146485146486146487146488146489146490146491146492146493146494146495146496146497146498146499146500146501146502146503146504146505146506146507146508146509146510146511146512146513146514146515146516146517146518146519146520146521146522146523146524146525146526146527146528146529146530146531146532146533146534146535146536146537146538146539146540146541146542146543146544146545146546146547146548146549146550146551146552146553146554146555146556146557146558146559146560146561146562146563146564146565146566146567146568146569146570146571146572146573146574146575146576146577146578146579146580146581146582146583146584146585146586146587146588146589146590146591146592146593146594146595146596146597146598146599146600146601146602146603146604146605146606146607146608146609146610146611146612146613146614146615146616146617146618146619146620146621146622146623146624146625146626146627146628146629146630146631146632146633146634146635146636146637146638146639146640146641146642146643146644146645146646146647146648146649146650146651146652146653146654146655146656146657146658146659146660146661146662146663146664146665146666146667146668146669146670146671146672146673146674146675146676146677146678146679146680146681146682146683146684146685146686146687146688146689146690146691146692146693146694146695146696146697146698146699146700146701146702146703146704146705146706146707146708146709146710146711146712146713146714146715146716146717146718146719146720146721146722146723146724146725146726146727146728146729146730146731146732146733146734146735146736146737146738146739146740146741146742146743146744146745146746146747146748146749146750146751146752146753146754146755146756146757146758146759146760146761146762146763146764146765146766146767146768146769146770146771146772146773146774146775146776146777146778146779146780146781146782146783146784146785146786146787146788146789146790146791146792146793146794146795146796146797146798146799146800146801146802146803146804146805146806146807146808146809146810146811146812146813146814146815146816146817146818146819146820146821146822146823146824146825146826146827146828146829146830146831146832146833146834146835146836146837146838146839146840146841146842146843146844146845146846146847146848146849146850146851146852146853146854146855146856146857146858146859146860146861146862146863146864146865146866146867146868146869146870146871146872146873146874146875146876146877146878146879146880146881146882146883146884146885146886146887146888146889146890146891146892146893146894146895146896146897146898146899146900146901146902146903146904146905146906146907146908146909146910146911146912146913146914146915146916146917146918146919146920146921146922146923146924146925146926146927146928146929146930146931146932146933146934146935146936146937146938146939146940146941146942146943146944146945146946146947146948146949146950146951146952146953146954146955146956146957146958146959146960146961146962146963146964146965146966146967146968146969146970146971146972146973146974146975146976146977146978146979146980146981146982146983146984146985146986146987146988146989146990146991146992146993146994146995146996146997146998146999147000147001147002147003147004147005147006147007147008147009147010147011147012147013147014147015147016147017147018147019147020147021147022147023147024147025147026147027147028147029147030147031147032147033147034147035147036147037147038147039147040147041147042147043147044147045147046147047147048147049147050147051147052147053147054147055147056147057147058147059147060147061147062147063147064147065147066147067147068147069147070147071147072147073147074147075147076147077147078147079147080147081147082147083147084147085147086147087147088147089147090147091147092147093147094147095147096147097147098147099147100147101147102147103147104147105147106147107147108147109147110147111147112147113147114147115147116147117147118147119147120147121147122147123147124147125147126147127147128147129147130147131147132147133147134147135147136147137147138147139147140147141147142147143147144147145147146147147147148147149147150147151147152147153147154147155147156147157147158147159147160147161147162147163147164147165147166147167147168147169147170147171147172147173147174147175147176147177147178147179147180147181147182147183147184147185147186147187147188147189147190147191147192147193147194147195147196147197147198147199147200147201147202147203147204147205147206147207147208147209147210147211147212147213147214147215147216147217147218147219147220147221147222147223147224147225147226147227147228147229147230147231147232147233147234147235147236147237147238147239147240147241147242147243147244147245147246147247147248147249147250147251147252147253147254147255147256147257147258147259147260147261147262147263147264147265147266147267147268147269147270147271147272147273147274147275147276147277147278147279147280147281147282147283147284147285147286147287147288147289147290147291147292147293147294147295147296147297147298147299147300147301147302147303147304147305147306147307147308147309147310147311147312147313147314147315147316147317147318147319147320147321147322147323147324147325147326147327147328147329147330147331147332147333147334147335147336147337147338147339147340147341147342147343147344147345147346147347147348147349147350147351147352147353147354147355147356147357147358147359147360147361147362147363147364147365147366147367147368147369147370147371147372147373147374147375147376147377147378147379147380147381147382147383147384147385147386147387147388147389147390147391147392147393147394147395147396147397147398147399147400147401147402147403147404147405147406147407147408147409147410147411147412147413147414147415147416147417147418147419147420147421147422147423147424147425147426147427147428147429147430147431147432147433147434147435147436147437147438147439147440147441147442147443147444147445147446147447147448147449147450147451147452147453147454147455147456147457147458147459147460147461147462147463147464147465147466147467147468147469147470147471147472147473147474147475147476147477147478147479147480147481147482147483147484147485147486147487147488147489147490147491147492147493147494147495147496147497147498147499147500147501147502147503147504147505147506147507147508147509147510147511147512147513147514147515147516147517147518147519147520147521147522147523147524147525147526147527147528147529147530147531147532147533147534147535147536147537147538147539147540147541147542147543147544147545147546147547147548147549147550147551147552147553147554147555147556147557147558147559147560147561147562147563147564147565147566147567147568147569147570147571147572147573147574147575147576147577147578147579147580147581147582147583147584147585147586147587147588147589147590147591147592147593147594147595147596147597147598147599147600147601147602147603147604147605147606147607147608147609147610147611147612147613147614147615147616147617147618147619147620147621147622147623147624147625147626147627147628147629147630147631147632147633147634147635147636147637147638147639147640147641147642147643147644147645147646147647147648147649147650147651147652147653147654147655147656147657147658147659147660147661147662147663147664147665147666147667147668147669147670147671147672147673147674147675147676147677147678147679147680147681147682147683147684147685147686147687147688147689147690147691147692147693147694147695147696147697147698147699147700147701147702147703147704147705147706147707147708147709147710147711147712147713147714147715147716147717147718147719147720147721147722147723147724147725147726147727147728147729147730147731147732147733147734147735147736147737147738147739147740147741147742147743147744147745147746147747147748147749147750147751147752147753147754147755147756147757147758147759147760147761147762147763147764147765147766147767147768147769147770147771147772147773147774147775147776147777147778147779147780147781147782147783147784147785147786147787147788147789147790147791147792147793147794147795147796147797147798147799147800147801147802147803147804147805147806147807147808147809147810147811147812147813147814147815147816147817147818147819147820147821147822147823147824147825147826147827147828147829147830147831147832147833147834147835147836147837147838147839147840147841147842147843147844147845147846147847147848147849147850147851147852147853147854147855147856147857147858147859147860147861147862147863147864147865147866147867147868147869147870147871147872147873147874147875147876147877147878147879147880147881147882147883147884147885147886147887147888147889147890147891147892147893147894147895147896147897147898147899147900147901147902147903147904147905147906147907147908147909147910147911147912147913147914147915147916147917147918147919147920147921147922147923147924147925147926147927147928147929147930147931147932147933147934147935147936147937147938147939147940147941147942147943147944147945147946147947147948147949147950147951147952147953147954147955147956147957147958147959147960147961147962147963147964147965147966147967147968147969147970147971147972147973147974147975147976147977147978147979147980147981147982147983147984147985147986147987147988147989147990147991147992147993147994147995147996147997147998147999148000148001148002148003148004148005148006148007148008148009148010148011148012148013148014148015148016148017148018148019148020148021148022148023148024148025148026148027148028148029148030148031148032148033148034148035148036148037148038148039148040148041148042148043148044148045148046148047148048148049148050148051148052148053148054148055148056148057148058148059148060148061148062148063148064148065148066148067148068148069148070148071148072148073148074148075148076148077148078148079148080148081148082148083148084148085148086148087148088148089148090148091148092148093148094148095148096148097148098148099148100148101148102148103148104148105148106148107148108148109148110148111148112148113148114148115148116148117148118148119148120148121148122148123148124148125148126148127148128148129148130148131148132148133148134148135148136148137148138148139148140148141148142148143148144148145148146148147148148148149148150148151148152148153148154148155148156148157148158148159148160148161148162148163148164148165148166148167148168148169148170148171148172148173148174148175148176148177148178148179148180148181148182148183148184148185148186148187148188148189148190148191148192148193148194148195148196148197148198148199148200148201148202148203148204148205148206148207148208148209148210148211148212148213148214148215148216148217148218148219148220148221148222148223148224148225148226148227148228148229148230148231148232148233148234148235148236148237148238148239148240148241148242148243148244148245148246148247148248148249148250148251148252148253148254148255148256148257148258148259148260148261148262148263148264148265148266148267148268148269148270148271148272148273148274148275148276148277148278148279148280148281148282148283148284148285148286148287148288148289148290148291148292148293148294148295148296148297148298148299148300148301148302148303148304148305148306148307148308148309148310148311148312148313148314148315148316148317148318148319148320148321148322148323148324148325148326148327148328148329148330148331148332148333148334148335148336148337148338148339148340148341148342148343148344148345148346148347148348148349148350148351148352148353148354148355148356148357148358148359148360148361148362148363148364148365148366148367148368148369148370148371148372148373148374148375148376148377148378148379148380148381148382148383148384148385148386148387148388148389148390148391148392148393148394148395148396148397148398148399148400148401148402148403148404148405148406148407148408148409148410148411148412148413148414148415148416148417148418148419148420148421148422148423148424148425148426148427148428148429148430148431148432148433148434148435148436148437148438148439148440148441148442148443148444148445148446148447148448148449148450148451148452148453148454148455148456148457148458148459148460148461148462148463148464148465148466148467148468148469148470148471148472148473148474148475148476148477148478148479148480148481148482148483148484148485148486148487148488148489148490148491148492148493148494148495148496148497148498148499148500148501148502148503148504148505148506148507148508148509148510148511148512148513148514148515148516148517148518148519148520148521148522148523148524148525148526148527148528148529148530148531148532148533148534148535148536148537148538148539148540148541148542148543148544148545148546148547148548148549148550148551148552148553148554148555148556148557148558148559148560148561148562148563148564148565148566148567148568148569148570148571148572148573148574148575148576148577148578148579148580148581148582148583148584148585148586148587148588148589148590148591148592148593148594148595148596148597148598148599148600148601148602148603148604148605148606148607148608148609148610148611148612148613148614148615148616148617148618148619148620148621148622148623148624148625148626148627148628148629148630148631148632148633148634148635148636148637148638148639148640148641148642148643148644148645148646148647148648148649148650148651148652148653148654148655148656148657148658148659148660148661148662148663148664148665148666148667148668148669148670148671148672148673148674148675148676148677148678148679148680148681148682148683148684148685148686148687148688148689148690148691148692148693148694148695148696148697148698148699148700148701148702148703148704148705148706148707148708148709148710148711148712148713148714148715148716148717148718148719148720148721148722148723148724148725148726148727148728148729148730148731148732148733148734148735148736148737148738148739148740148741148742148743148744148745148746148747148748148749148750148751148752148753148754148755148756148757148758148759148760148761148762148763148764148765148766148767148768148769148770148771148772148773148774148775148776148777148778148779148780148781148782148783148784148785148786148787148788148789148790148791148792148793148794148795148796148797148798148799148800148801148802148803148804148805148806148807148808148809148810148811148812148813148814148815148816148817148818148819148820148821148822148823148824148825148826148827148828148829148830148831148832148833148834148835148836148837148838148839148840148841148842148843148844148845148846148847148848148849148850148851148852148853148854148855148856148857148858148859148860148861148862148863148864148865148866148867148868148869148870148871148872148873148874148875148876148877148878148879148880148881148882148883148884148885148886148887148888148889148890148891148892148893148894148895148896148897148898148899148900148901148902148903148904148905148906148907148908148909148910148911148912148913148914148915148916148917148918148919148920148921148922148923148924148925148926148927148928148929148930148931148932148933148934148935148936148937148938148939148940148941148942148943148944148945148946148947148948148949148950148951148952148953148954148955148956148957148958148959148960148961148962148963148964148965148966148967148968148969148970148971148972148973148974148975148976148977148978148979148980148981148982148983148984148985148986148987148988148989148990148991148992148993148994148995148996148997148998148999149000149001149002149003149004149005149006149007149008149009149010149011149012149013149014149015149016149017149018149019149020149021149022149023149024149025149026149027149028149029149030149031149032149033149034149035149036149037149038149039149040149041149042149043149044149045149046149047149048149049149050149051149052149053149054149055149056149057149058149059149060149061149062149063149064149065149066149067149068149069149070149071149072149073149074149075149076149077149078149079149080149081149082149083149084149085149086149087149088149089149090149091149092149093149094149095149096149097149098149099149100149101149102149103149104149105149106149107149108149109149110149111149112149113149114149115149116149117149118149119149120149121149122149123149124149125149126149127149128149129149130149131149132149133149134149135149136149137149138149139149140149141149142149143149144149145149146149147149148149149149150149151149152149153149154149155149156149157149158149159149160149161149162149163149164149165149166149167149168149169149170149171149172149173149174149175149176149177149178149179149180149181149182149183149184149185149186149187149188149189149190149191149192149193149194149195149196149197149198149199149200149201149202149203149204149205149206149207149208149209149210149211149212149213149214149215149216149217149218149219149220149221149222149223149224149225149226149227149228149229149230149231149232149233149234149235149236149237149238149239149240149241149242149243149244149245149246149247149248149249149250149251149252149253149254149255149256149257149258149259149260149261149262149263149264149265149266149267149268149269149270149271149272149273149274149275149276149277149278149279149280149281149282149283149284149285149286149287149288149289149290149291149292149293149294149295149296149297149298149299149300149301149302149303149304149305149306149307149308149309149310149311149312149313149314149315149316149317149318149319149320149321149322149323149324149325149326149327149328149329149330149331149332149333149334149335149336149337149338149339149340149341149342149343149344149345149346149347149348149349149350149351149352149353149354149355149356149357149358149359149360149361149362149363149364149365149366149367149368149369149370149371149372149373149374149375149376149377149378149379149380149381149382149383149384149385149386149387149388149389149390149391149392149393149394149395149396149397149398149399149400149401149402149403149404149405149406149407149408149409149410149411149412149413149414149415149416149417149418149419149420149421149422149423149424149425149426149427149428149429149430149431149432149433149434149435149436149437149438149439149440149441149442149443149444149445149446149447149448149449149450149451149452149453149454149455149456149457149458149459149460149461149462149463149464149465149466149467149468149469149470149471149472149473149474149475149476149477149478149479149480149481149482149483149484149485149486149487149488149489149490149491149492149493149494149495149496149497149498149499149500149501149502149503149504149505149506149507149508149509149510149511149512149513149514149515149516149517149518149519149520149521149522149523149524149525149526149527149528149529149530149531149532149533149534149535149536149537149538149539149540149541149542149543149544149545149546149547149548149549149550149551149552149553149554149555149556149557149558149559149560149561149562149563149564149565149566149567149568149569149570149571149572149573149574149575149576149577149578149579149580149581149582149583149584149585149586149587149588149589149590149591149592149593149594149595149596149597149598149599149600149601149602149603149604149605149606149607149608149609149610149611149612149613149614149615149616149617149618149619149620149621149622149623149624149625149626149627149628149629149630149631149632149633149634149635149636149637149638149639149640149641149642149643149644149645149646149647149648149649149650149651149652149653149654149655149656149657149658149659149660149661149662149663149664149665149666149667149668149669149670149671149672149673149674149675149676149677149678149679149680149681149682149683149684149685149686149687149688149689149690149691149692149693149694149695149696149697149698149699149700149701149702149703149704149705149706149707149708149709149710149711149712149713149714149715149716149717149718149719149720149721149722149723149724149725149726149727149728149729149730149731149732149733149734149735149736149737149738149739149740149741149742149743149744149745149746149747149748149749149750149751149752149753149754149755149756149757149758149759149760149761149762149763149764149765149766149767149768149769149770149771149772149773149774149775149776149777149778149779149780149781149782149783149784149785149786149787149788149789149790149791149792149793149794149795149796149797149798149799149800149801149802149803149804149805149806149807149808149809149810149811149812149813149814149815149816149817149818149819149820149821149822149823149824149825149826149827149828149829149830149831149832149833149834149835149836149837149838149839149840149841149842149843149844149845149846149847149848149849149850149851149852149853149854149855149856149857149858149859149860149861149862149863149864149865149866149867149868149869149870149871149872149873149874149875149876149877149878149879149880149881149882149883149884149885149886149887149888149889149890149891149892149893149894149895149896149897149898149899149900149901149902149903149904149905149906149907149908149909149910149911149912149913149914149915149916149917149918149919149920149921149922149923149924149925149926149927149928149929149930149931149932149933149934149935149936149937149938149939149940149941149942149943149944149945149946149947149948149949149950149951149952149953149954149955149956149957149958149959149960149961149962149963149964149965149966149967149968149969149970149971149972149973149974149975149976149977149978149979149980149981149982149983149984149985149986149987149988149989149990149991149992149993149994149995149996149997149998149999150000150001150002150003150004150005150006150007150008150009150010150011150012150013150014150015150016150017150018150019150020150021150022150023150024150025150026150027150028150029150030150031150032150033150034150035150036150037150038150039150040150041150042150043150044150045150046150047150048150049150050150051150052150053150054150055150056150057150058150059150060150061150062150063150064150065150066150067150068150069150070150071150072150073150074150075150076150077150078150079150080150081150082150083150084150085150086150087150088150089150090150091150092150093150094150095150096150097150098150099150100150101150102150103150104150105150106150107150108150109150110150111150112150113150114150115150116150117150118150119150120150121150122150123150124150125150126150127150128150129150130150131150132150133150134150135150136150137150138150139150140150141150142150143150144150145150146150147150148150149150150150151150152150153150154150155150156150157150158150159150160150161150162150163150164150165150166150167150168150169150170150171150172150173150174150175150176150177150178150179150180150181150182150183150184150185150186150187150188150189150190150191150192150193150194150195150196150197150198150199150200150201150202150203150204150205150206150207150208150209150210150211150212150213150214150215150216150217150218150219150220150221150222150223150224150225150226150227150228150229150230150231150232150233150234150235150236150237150238150239150240150241150242150243150244150245150246150247150248150249150250150251150252150253150254150255150256150257150258150259150260150261150262150263150264150265150266150267150268150269150270150271150272150273150274150275150276150277150278150279150280150281150282150283150284150285150286150287150288150289150290150291150292150293150294150295150296150297150298150299150300150301150302150303150304150305150306150307150308150309150310150311150312150313150314150315150316150317150318150319150320150321150322150323150324150325150326150327150328150329150330150331150332150333150334150335150336150337150338150339150340150341150342150343150344150345150346150347150348150349150350150351150352150353150354150355150356150357150358150359150360150361150362150363150364150365150366150367150368150369150370150371150372150373150374150375150376150377150378150379150380150381150382150383150384150385150386150387150388150389150390150391150392150393150394150395150396150397150398150399150400150401150402150403150404150405150406150407150408150409150410150411150412150413150414150415150416150417150418150419150420150421150422150423150424150425150426150427150428150429150430150431150432150433150434150435150436150437150438150439150440150441150442150443150444150445150446150447150448150449150450150451150452150453150454150455150456150457150458150459150460150461150462150463150464150465150466150467150468150469150470150471150472150473150474150475150476150477150478150479150480150481150482150483150484150485150486150487150488150489150490150491150492150493150494150495150496150497150498150499150500150501150502150503150504150505150506150507150508150509150510150511150512150513150514150515150516150517150518150519150520150521150522150523150524150525150526150527150528150529150530150531150532150533150534150535150536150537150538150539150540150541150542150543150544150545150546150547150548150549150550150551150552150553150554150555150556150557150558150559150560150561150562150563150564150565150566150567150568150569150570150571150572150573150574150575150576150577150578150579150580150581150582150583150584150585150586150587150588150589150590150591150592150593150594150595150596150597150598150599150600150601150602150603150604150605150606150607150608150609150610150611150612150613150614150615150616150617150618150619150620150621150622150623150624150625150626150627150628150629150630150631150632150633150634150635150636150637150638150639150640150641150642150643150644150645150646150647150648150649150650150651150652150653150654150655150656150657150658150659150660150661150662150663150664150665150666150667150668150669150670150671150672150673150674150675150676150677150678150679150680150681150682150683150684150685150686150687150688150689150690150691150692150693150694150695150696150697150698150699150700150701150702150703150704150705150706150707150708150709150710150711150712150713150714150715150716150717150718150719150720150721150722150723150724150725150726150727150728150729150730150731150732150733150734150735150736150737150738150739150740150741150742150743150744150745150746150747150748150749150750150751150752150753150754150755150756150757150758150759150760150761150762150763150764150765150766150767150768150769150770150771150772150773150774150775150776150777150778150779150780150781150782150783150784150785150786150787150788150789150790150791150792150793150794150795150796150797150798150799150800150801150802150803150804150805150806150807150808150809150810150811150812150813150814150815150816150817150818150819150820150821150822150823150824150825150826150827150828150829150830150831150832150833150834150835150836150837150838150839150840150841150842150843150844150845150846150847150848150849150850150851150852150853150854150855150856150857150858150859150860150861150862150863150864150865150866150867150868150869150870150871150872150873150874150875150876150877150878150879150880150881150882150883150884150885150886150887150888150889150890150891150892150893150894150895150896150897150898150899150900150901150902150903150904150905150906150907150908150909150910150911150912150913150914150915150916150917150918150919150920150921150922150923150924150925150926150927150928150929150930150931150932150933150934150935150936150937150938150939150940150941150942150943150944150945150946150947150948150949150950150951150952150953150954150955150956150957150958150959150960150961150962150963150964150965150966150967150968150969150970150971150972150973150974150975150976150977150978150979150980150981150982150983150984150985150986150987150988150989150990150991150992150993150994150995150996150997150998150999151000151001151002151003151004151005151006151007151008151009151010151011151012151013151014151015151016151017151018151019151020151021151022151023151024151025151026151027151028151029151030151031151032151033151034151035151036151037151038151039151040151041151042151043151044151045151046151047151048151049151050151051151052151053151054151055151056151057151058151059151060151061151062151063151064151065151066151067151068151069151070151071151072151073151074151075151076151077151078151079151080151081151082151083151084151085151086151087151088151089151090151091151092151093151094151095151096151097151098151099151100151101151102151103151104151105151106151107151108151109151110151111151112151113151114151115151116151117151118151119151120151121151122151123151124151125151126151127151128151129151130151131151132151133151134151135151136151137151138151139151140151141151142151143151144151145151146151147151148151149151150151151151152151153151154151155151156151157151158151159151160151161151162151163151164151165151166151167151168151169151170151171151172151173151174151175151176151177151178151179151180151181151182151183151184151185151186151187151188151189151190151191151192151193151194151195151196151197151198151199151200151201151202151203151204151205151206151207151208151209151210151211151212151213151214151215151216151217151218151219151220151221151222151223151224151225151226151227151228151229151230151231151232151233151234151235151236151237151238151239151240151241151242151243151244151245151246151247151248151249151250151251151252151253151254151255151256151257151258151259151260151261151262151263151264151265151266151267151268151269151270151271151272151273151274151275151276151277151278151279151280151281151282151283151284151285151286151287151288151289151290151291151292151293151294151295151296151297151298151299151300151301151302151303151304151305151306151307151308151309151310151311151312151313151314151315151316151317151318151319151320151321151322151323151324151325151326151327151328151329151330151331151332151333151334151335151336151337151338151339151340151341151342151343151344151345151346151347151348151349151350151351151352151353151354151355151356151357151358151359151360151361151362151363151364151365151366151367151368151369151370151371151372151373151374151375151376151377151378151379151380151381151382151383151384151385151386151387151388151389151390151391151392151393151394151395151396151397151398151399151400151401151402151403151404151405151406151407151408151409151410151411151412151413151414151415151416151417151418151419151420151421151422151423151424151425151426151427151428151429151430151431151432151433151434151435151436151437151438151439151440151441151442151443151444151445151446151447151448151449151450151451151452151453151454151455151456151457151458151459151460151461151462151463151464151465151466151467151468151469151470151471151472151473151474151475151476151477151478151479151480151481151482151483151484151485151486151487151488151489151490151491151492151493151494151495151496151497151498151499151500151501151502151503151504151505151506151507151508151509151510151511151512151513151514151515151516151517151518151519151520151521151522151523151524151525151526151527151528151529151530151531151532151533151534151535151536151537151538151539151540151541151542151543151544151545151546151547151548151549151550151551151552151553151554151555151556151557151558151559151560151561151562151563151564151565151566151567151568151569151570151571151572151573151574151575151576151577151578151579151580151581151582151583151584151585151586151587151588151589151590151591151592151593151594151595151596151597151598151599151600151601151602151603151604151605151606151607151608151609151610151611151612151613151614151615151616151617151618151619151620151621151622151623151624151625151626151627151628151629151630151631151632151633151634151635151636151637151638151639151640151641151642151643151644151645151646151647151648151649151650151651151652151653151654151655151656151657151658151659151660151661151662151663151664151665151666151667151668151669151670151671151672151673151674151675151676151677151678151679151680151681151682151683151684151685151686151687151688151689151690151691151692151693151694151695151696151697151698151699151700151701151702151703151704151705151706151707151708151709151710151711151712151713151714151715151716151717151718151719151720151721151722151723151724151725151726151727151728151729151730151731151732151733151734151735151736151737151738151739151740151741151742151743151744151745151746151747151748151749151750151751151752151753151754151755151756151757151758151759151760151761151762151763151764151765151766151767151768151769151770151771151772151773151774151775151776151777151778151779151780151781151782151783151784151785151786151787151788151789151790151791151792151793151794151795151796151797151798151799151800151801151802151803151804151805151806151807151808151809151810151811151812151813151814151815151816151817151818151819151820151821151822151823151824151825151826151827151828151829151830151831151832151833151834151835151836151837151838151839151840151841151842151843151844151845151846151847151848151849151850151851151852151853151854151855151856151857151858151859151860151861151862151863151864151865151866151867151868151869151870151871151872151873151874151875151876151877151878151879151880151881151882151883151884151885151886151887151888151889151890151891151892151893151894151895151896151897151898151899151900151901151902151903151904151905151906151907151908151909151910151911151912151913151914151915151916151917151918151919151920151921151922151923151924151925151926151927151928151929151930151931151932151933151934151935151936151937151938151939151940151941151942151943151944151945151946151947151948151949151950151951151952151953151954151955151956151957151958151959151960151961151962151963151964151965151966151967151968151969151970151971151972151973151974151975151976151977151978151979151980151981151982151983151984151985151986151987151988151989151990151991151992151993151994151995151996151997151998151999152000152001152002152003152004152005152006152007152008152009152010152011152012152013152014152015152016152017152018152019152020152021152022152023152024152025152026152027152028152029152030152031152032152033152034152035152036152037152038152039152040152041152042152043152044152045152046152047152048152049152050152051152052152053152054152055152056152057152058152059152060152061152062152063152064152065152066152067152068152069152070152071152072152073152074152075152076152077152078152079152080152081152082152083152084152085152086152087152088152089152090152091152092152093152094152095152096152097152098152099152100152101152102152103152104152105152106152107152108152109152110152111152112152113152114152115152116152117152118152119152120152121152122152123152124152125152126152127152128152129152130152131152132152133152134152135152136152137152138152139152140152141152142152143152144152145152146152147152148152149152150152151152152152153152154152155152156152157152158152159152160152161152162152163152164152165152166152167152168152169152170152171152172152173152174152175152176152177152178152179152180152181152182152183152184152185152186152187152188152189152190152191152192152193152194152195152196152197152198152199152200152201152202152203152204152205152206152207152208152209152210152211152212152213152214152215152216152217152218152219152220152221152222152223152224152225152226152227152228152229152230152231152232152233152234152235152236152237152238152239152240152241152242152243152244152245152246152247152248152249152250152251152252152253152254152255152256152257152258152259152260152261152262152263152264152265152266152267152268152269152270152271152272152273152274152275152276152277152278152279152280152281152282152283152284152285152286152287152288152289152290152291152292152293152294152295152296152297152298152299152300152301152302152303152304152305152306152307152308152309152310152311152312152313152314152315152316152317152318152319152320152321152322152323152324152325152326152327152328152329152330152331152332152333152334152335152336152337152338152339152340152341152342152343152344152345152346152347152348152349152350152351152352152353152354152355152356152357152358152359152360152361152362152363152364152365152366152367152368152369152370152371152372152373152374152375152376152377152378152379152380152381152382152383152384152385152386152387152388152389152390152391152392152393152394152395152396152397152398152399152400152401152402152403152404152405152406152407152408152409152410152411152412152413152414152415152416152417152418152419152420152421152422152423152424152425152426152427152428152429152430152431152432152433152434152435152436152437152438152439152440152441152442152443152444152445152446152447152448152449152450152451152452152453152454152455152456152457152458152459152460152461152462152463152464152465152466152467152468152469152470152471152472152473152474152475152476152477152478152479152480152481152482152483152484152485152486152487152488152489152490152491152492152493152494152495152496152497152498152499152500152501152502152503152504152505152506152507152508152509152510152511152512152513152514152515152516152517152518152519152520152521152522152523152524152525152526152527152528152529152530152531152532152533152534152535152536152537152538152539152540152541152542152543152544152545152546152547152548152549152550152551152552152553152554152555152556152557152558152559152560152561152562152563152564152565152566152567152568152569152570152571152572152573152574152575152576152577152578152579152580152581152582152583152584152585152586152587152588152589152590152591152592152593152594152595152596152597152598152599152600152601152602152603152604152605152606152607152608152609152610152611152612152613152614152615152616152617152618152619152620152621152622152623152624152625152626152627152628152629152630152631152632152633152634152635152636152637152638152639152640152641152642152643152644152645152646152647152648152649152650152651152652152653152654152655152656152657152658152659152660152661152662152663152664152665152666152667152668152669152670152671152672152673152674152675152676152677152678152679152680152681152682152683152684152685152686152687152688152689152690152691152692152693152694152695152696152697152698152699152700152701152702152703152704152705152706152707152708152709152710152711152712152713152714152715152716152717152718152719152720152721152722152723152724152725152726152727152728152729152730152731152732152733152734152735152736152737152738152739152740152741152742152743152744152745152746152747152748152749152750152751152752152753152754152755152756152757152758152759152760152761152762152763152764152765152766152767152768152769152770152771152772152773152774152775152776152777152778152779152780152781152782152783152784152785152786152787152788152789152790152791152792152793152794152795152796152797152798152799152800152801152802152803152804152805152806152807152808152809152810152811152812152813152814152815152816152817152818152819152820152821152822152823152824152825152826152827152828152829152830152831152832152833152834152835152836152837152838152839152840152841152842152843152844152845152846152847152848152849152850152851152852152853152854152855152856152857152858152859152860152861152862152863152864152865152866152867152868152869152870152871152872152873152874152875152876152877152878152879152880152881152882152883152884152885152886152887152888152889152890152891152892152893152894152895152896152897152898152899152900152901152902152903152904152905152906152907152908152909152910152911152912152913152914152915152916152917152918152919152920152921152922152923152924152925152926152927152928152929152930152931152932152933152934152935152936152937152938152939152940152941152942152943152944152945152946152947152948152949152950152951152952152953152954152955152956152957152958152959152960152961152962152963152964152965152966152967152968152969152970152971152972152973152974152975152976152977152978152979152980152981152982152983152984152985152986152987152988152989152990152991152992152993152994152995152996152997152998152999153000153001153002153003153004153005153006153007153008153009153010153011153012153013153014153015153016153017153018153019153020153021153022153023153024153025153026153027153028153029153030153031153032153033153034153035153036153037153038153039153040153041153042153043153044153045153046153047153048153049153050153051153052153053153054153055153056153057153058153059153060153061153062153063153064153065153066153067153068153069153070153071153072153073153074153075153076153077153078153079153080153081153082153083153084153085153086153087153088153089153090153091153092153093153094153095153096153097153098153099153100153101153102153103153104153105153106153107153108153109153110153111153112153113153114153115153116153117153118153119153120153121153122153123153124153125153126153127153128153129153130153131153132153133153134153135153136153137153138153139153140153141153142153143153144153145153146153147153148153149153150153151153152153153153154153155153156153157153158153159153160153161153162153163153164153165153166153167153168153169153170153171153172153173153174153175153176153177153178153179153180153181153182153183153184153185153186153187153188153189153190153191153192153193153194153195153196153197153198153199153200153201153202153203153204153205153206153207153208153209153210153211153212153213153214153215153216153217153218153219153220153221153222153223153224153225153226153227153228153229153230153231153232153233153234153235153236153237153238153239153240153241153242153243153244153245153246153247153248153249153250153251153252153253153254153255153256153257153258153259153260153261153262153263153264153265153266153267153268153269153270153271153272153273153274153275153276153277153278153279153280153281153282153283153284153285153286153287153288153289153290153291153292153293153294153295153296153297153298153299153300153301153302153303153304153305153306153307153308153309153310153311153312153313153314153315153316153317153318153319153320153321153322153323153324153325153326153327153328153329153330153331153332153333153334153335153336153337153338153339153340153341153342153343153344153345153346153347153348153349153350153351153352153353153354153355153356153357153358153359153360153361153362153363153364153365153366153367153368153369153370153371153372153373153374153375153376153377153378153379153380153381153382153383153384153385153386153387153388153389153390153391153392153393153394153395153396153397153398153399153400153401153402153403153404153405153406153407153408153409153410153411153412153413153414153415153416153417153418153419153420153421153422153423153424153425153426153427153428153429153430153431153432153433153434153435153436153437153438153439153440153441153442153443153444153445153446153447153448153449153450153451153452153453153454153455153456153457153458153459153460153461153462153463153464153465153466153467153468153469153470153471153472153473153474153475153476153477153478153479153480153481153482153483153484153485153486153487153488153489153490153491153492153493153494153495153496153497153498153499153500153501153502153503153504153505153506153507153508153509153510153511153512153513153514153515153516153517153518153519153520153521153522153523153524153525153526153527153528153529153530153531153532153533153534153535153536153537153538153539153540153541153542153543153544153545153546153547153548153549153550153551153552153553153554153555153556153557153558153559153560153561153562153563153564153565153566153567153568153569153570153571153572153573153574153575153576153577153578153579153580153581153582153583153584153585153586153587153588153589153590153591153592153593153594153595153596153597153598153599153600153601153602153603153604153605153606153607153608153609153610153611153612153613153614153615153616153617153618153619153620153621153622153623153624153625153626153627153628153629153630153631153632153633153634153635153636153637153638153639153640153641153642153643153644153645153646153647153648153649153650153651153652153653153654153655153656153657153658153659153660153661153662153663153664153665153666153667153668153669153670153671153672153673153674153675153676153677153678153679153680153681153682153683153684153685153686153687153688153689153690153691153692153693153694153695153696153697153698153699153700153701153702153703153704153705153706153707153708153709153710153711153712153713153714153715153716153717153718153719153720153721153722153723153724153725153726153727153728153729153730153731153732153733153734153735153736153737153738153739153740153741153742153743153744153745153746153747153748153749153750153751153752153753153754153755153756153757153758153759153760153761153762153763153764153765153766153767153768153769153770153771153772153773153774153775153776153777153778153779153780153781153782153783153784153785153786153787153788153789153790153791153792153793153794153795153796153797153798153799153800153801153802153803153804153805153806153807153808153809153810153811153812153813153814153815153816153817153818153819153820153821153822153823153824153825153826153827153828153829153830153831153832153833153834153835153836153837153838153839153840153841153842153843153844153845153846153847153848153849153850153851153852153853153854153855153856153857153858153859153860153861153862153863153864153865153866153867153868153869153870153871153872153873153874153875153876153877153878153879153880153881153882153883153884153885153886153887153888153889153890153891153892153893153894153895153896153897153898153899153900153901153902153903153904153905153906153907153908153909153910153911153912153913153914153915153916153917153918153919153920153921153922153923153924153925153926153927153928153929153930153931153932153933153934153935153936153937153938153939153940153941153942153943153944153945153946153947153948153949153950153951153952153953153954153955153956153957153958153959153960153961153962153963153964153965153966153967153968153969153970153971153972153973153974153975153976153977153978153979153980153981153982153983153984153985153986153987153988153989153990153991153992153993153994153995153996153997153998153999154000154001154002154003154004154005154006154007154008154009154010154011154012154013154014154015154016154017154018154019154020154021154022154023154024154025154026154027154028154029154030154031154032154033154034154035154036154037154038154039154040154041154042154043154044154045154046154047154048154049154050154051154052154053154054154055154056154057154058154059154060154061154062154063154064154065154066154067154068154069154070154071154072154073154074154075154076154077154078154079154080154081154082154083154084154085154086154087154088154089154090154091154092154093154094154095154096154097154098154099154100154101154102154103154104154105154106154107154108154109154110154111154112154113154114154115154116154117154118154119154120154121154122154123154124154125154126154127154128154129154130154131154132154133154134154135154136154137154138154139154140154141154142154143154144154145154146154147154148154149154150154151154152154153154154154155154156154157154158154159154160154161154162154163154164154165154166154167154168154169154170154171154172154173154174154175154176154177154178154179154180154181154182154183154184154185154186154187154188154189154190154191154192154193154194154195154196154197154198154199154200154201154202154203154204154205154206154207154208154209154210154211154212154213154214154215154216154217154218154219154220154221154222154223154224154225154226154227154228154229154230154231154232154233154234154235154236154237154238154239154240154241154242154243154244154245154246154247154248154249154250154251154252154253154254154255154256154257154258154259154260154261154262154263154264154265154266154267154268154269154270154271154272154273154274154275154276154277154278154279154280154281154282154283154284154285154286154287154288154289154290154291154292154293154294154295154296154297154298154299154300154301154302154303154304154305154306154307154308154309154310154311154312154313154314154315154316154317154318154319154320154321154322154323154324154325154326154327154328154329154330154331154332154333154334154335154336154337154338154339154340154341154342154343154344154345154346154347154348154349154350154351154352154353154354154355154356154357154358154359154360154361154362154363154364154365154366154367154368154369154370154371154372154373154374154375154376154377154378154379154380154381154382154383154384154385154386154387154388154389154390154391154392154393154394154395154396154397154398154399154400154401154402154403154404154405154406154407154408154409154410154411154412154413154414154415154416154417154418154419154420154421154422154423154424154425154426154427154428154429154430154431154432154433154434154435154436154437154438154439154440154441154442154443154444154445154446154447154448154449154450154451154452154453154454154455154456154457154458154459154460154461154462154463154464154465154466154467154468154469154470154471154472154473154474154475154476154477154478154479154480154481154482154483154484154485154486154487154488154489154490154491154492154493154494154495154496154497154498154499154500154501154502154503154504154505154506154507154508154509154510154511154512154513154514154515154516154517154518154519154520154521154522154523154524154525154526154527154528154529154530154531154532154533154534154535154536154537154538154539154540154541154542154543154544154545154546154547154548154549154550154551154552154553154554154555154556154557154558154559154560154561154562154563154564154565154566154567154568154569154570154571154572154573154574154575154576154577154578154579154580154581154582154583154584154585154586154587154588154589154590154591154592154593154594154595154596154597154598154599154600154601154602154603154604154605154606154607154608154609154610154611154612154613154614154615154616154617154618154619154620154621154622154623154624154625154626154627154628154629154630154631154632154633154634154635154636154637154638154639154640154641154642154643154644154645154646154647154648154649154650154651154652154653154654154655154656154657154658154659154660154661154662154663154664154665154666154667154668154669154670154671154672154673154674154675154676154677154678154679154680154681154682154683154684154685154686154687154688154689154690154691154692154693154694154695154696154697154698154699154700154701154702154703154704154705154706154707154708154709154710154711154712154713154714154715154716154717154718154719154720154721154722154723154724154725154726154727154728154729154730154731154732154733154734154735154736154737154738154739154740154741154742154743154744154745154746154747154748154749154750154751154752154753154754154755154756154757154758154759154760154761154762154763154764154765154766154767154768154769154770154771154772154773154774154775154776154777154778154779154780154781154782154783154784154785154786154787154788154789154790154791154792154793154794154795154796154797154798154799154800154801154802154803154804154805154806154807154808154809154810154811154812154813154814154815154816154817154818154819154820154821154822154823154824154825154826154827154828154829154830154831154832154833154834154835154836154837154838154839154840154841154842154843154844154845154846154847154848154849154850154851154852154853154854154855154856154857154858154859154860154861154862154863154864154865154866154867154868154869154870154871154872154873154874154875154876154877154878154879154880154881154882154883154884154885154886154887154888154889154890154891154892154893154894154895154896154897154898154899154900154901154902154903154904154905154906154907154908154909154910154911154912154913154914154915154916154917154918154919154920154921154922154923154924154925154926154927154928154929154930154931154932154933154934154935154936154937154938154939154940154941154942154943154944154945154946154947154948154949154950154951154952154953154954154955154956154957154958154959154960154961154962154963154964154965154966154967154968154969154970154971154972154973154974154975154976154977154978154979154980154981154982154983154984154985154986154987154988154989154990154991154992154993154994154995154996154997154998154999155000155001155002155003155004155005155006155007155008155009155010155011155012155013155014155015155016155017155018155019155020155021155022155023155024155025155026155027155028155029155030155031155032155033155034155035155036155037155038155039155040155041155042155043155044155045155046155047155048155049155050155051155052155053155054155055155056155057155058155059155060155061155062155063155064155065155066155067155068155069155070155071155072155073155074155075155076155077155078155079155080155081155082155083155084155085155086155087155088155089155090155091155092155093155094155095155096155097155098155099155100155101155102155103155104155105155106155107155108155109155110155111155112155113155114155115155116155117155118155119155120155121155122155123155124155125155126155127155128155129155130155131155132155133155134155135155136155137155138155139155140155141155142155143155144155145155146155147155148155149155150155151155152155153155154155155155156155157155158155159155160155161155162155163155164155165155166155167155168155169155170155171155172155173155174155175155176155177155178155179155180155181155182155183155184155185155186155187155188155189155190155191155192155193155194155195155196155197155198155199155200155201155202155203155204155205155206155207155208155209155210155211155212155213155214155215155216155217155218155219155220155221155222155223155224155225155226155227155228155229155230155231155232155233155234155235155236155237155238155239155240155241155242155243155244155245155246155247155248155249155250155251155252155253155254155255155256155257155258155259155260155261155262155263155264155265155266155267155268155269155270155271155272155273155274155275155276155277155278155279155280155281155282155283155284155285155286155287155288155289155290155291155292155293155294155295155296155297155298155299155300155301155302155303155304155305155306155307155308155309155310155311155312155313155314155315155316155317155318155319155320155321155322155323155324155325155326155327155328155329155330155331155332155333155334155335155336155337155338155339155340155341155342155343155344155345155346155347155348155349155350155351155352155353155354155355155356155357155358155359155360155361155362155363155364155365155366155367155368155369155370155371155372155373155374155375155376155377155378155379155380155381155382155383155384155385155386155387155388155389155390155391155392155393155394155395155396155397155398155399155400155401155402155403155404155405155406155407155408155409155410155411155412155413155414155415155416155417155418155419155420155421155422155423155424155425155426155427155428155429155430155431155432155433155434155435155436155437155438155439155440155441155442155443155444155445155446155447155448155449155450155451155452155453155454155455155456155457155458155459155460155461155462155463155464155465155466155467155468155469155470155471155472155473155474155475155476155477155478155479155480155481155482155483155484155485155486155487155488155489155490155491155492155493155494155495155496155497155498155499155500155501155502155503155504155505155506155507155508155509155510155511155512155513155514155515155516155517155518155519155520155521155522155523155524155525155526155527155528155529155530155531155532155533155534155535155536155537155538155539155540155541155542155543155544155545155546155547155548155549155550155551155552155553155554155555155556155557155558155559155560155561155562155563155564155565155566155567155568155569155570155571155572155573155574155575155576155577155578155579155580155581155582155583155584155585155586155587155588155589155590155591155592155593155594155595155596155597155598155599155600155601155602155603155604155605155606155607155608155609155610155611155612155613155614155615155616155617155618155619155620155621155622155623155624155625155626155627155628155629155630155631155632155633155634155635155636155637155638155639155640155641155642155643155644155645155646155647155648155649155650155651155652155653155654155655155656155657155658155659155660155661155662155663155664155665155666155667155668155669155670155671155672155673155674155675155676155677155678155679155680155681155682155683155684155685155686155687155688155689155690155691155692155693155694155695155696155697155698155699155700155701155702155703155704155705155706155707155708155709155710155711155712155713155714155715155716155717155718155719155720155721155722155723155724155725155726155727155728155729155730155731155732155733155734155735155736155737155738155739155740155741155742155743155744155745155746155747155748155749155750155751155752155753155754155755155756155757155758155759155760155761155762155763155764155765155766155767155768155769155770155771155772155773155774155775155776155777155778155779155780155781155782155783155784155785155786155787155788155789155790155791155792155793155794155795155796155797155798155799155800155801155802155803155804155805155806155807155808155809155810155811155812155813155814155815155816155817155818155819155820155821155822155823155824155825155826155827155828155829155830155831155832155833155834155835155836155837155838155839155840155841155842155843155844155845155846155847155848155849155850155851155852155853155854155855155856155857155858155859155860155861155862155863155864155865155866155867155868155869155870155871155872155873155874155875155876155877155878155879155880155881155882155883155884155885155886155887155888155889155890155891155892155893155894155895155896155897155898155899155900155901155902155903155904155905155906155907155908155909155910155911155912155913155914155915155916155917155918155919155920155921155922155923155924155925155926155927155928155929155930155931155932155933155934155935155936155937155938155939155940155941155942155943155944155945155946155947155948155949155950155951155952155953155954155955155956155957155958155959155960155961155962155963155964155965155966155967155968155969155970155971155972155973155974155975155976155977155978155979155980155981155982155983155984155985155986155987155988155989155990155991155992155993155994155995155996155997155998155999156000156001156002156003156004156005156006156007156008156009156010156011156012156013156014156015156016156017156018156019156020156021156022156023156024156025156026156027156028156029156030156031156032156033156034156035156036156037156038156039156040156041156042156043156044156045156046156047156048156049156050156051156052156053156054156055156056156057156058156059156060156061156062156063156064156065156066156067156068156069156070156071156072156073156074156075156076156077156078156079156080156081156082156083156084156085156086156087156088156089156090156091156092156093156094156095156096156097156098156099156100156101156102156103156104156105156106156107156108156109156110156111156112156113156114156115156116156117156118156119156120156121156122156123156124156125156126156127156128156129156130156131156132156133156134156135156136156137156138156139156140156141156142156143156144156145156146156147156148156149156150156151156152156153156154156155156156156157156158156159156160156161156162156163156164156165156166156167156168156169156170156171156172156173156174156175156176156177156178156179156180156181156182156183156184156185156186156187156188156189156190156191156192156193156194156195156196156197156198156199156200156201156202156203156204156205156206156207156208156209156210156211156212156213156214156215156216156217156218156219156220156221156222156223156224156225156226156227156228156229156230156231156232156233156234156235156236156237156238156239156240156241156242156243156244156245156246156247156248156249156250156251156252156253156254156255156256156257156258156259156260156261156262156263156264156265156266156267156268156269156270156271156272156273156274156275156276156277156278156279156280156281156282156283156284156285156286156287156288156289156290156291156292156293156294156295156296156297156298156299156300156301156302156303156304156305156306156307156308156309156310156311156312156313156314156315156316156317156318156319156320156321156322156323156324156325156326156327156328156329156330156331156332156333156334156335156336156337156338156339156340156341156342156343156344156345156346156347156348156349156350156351156352156353156354156355156356156357156358156359156360156361156362156363156364156365156366156367156368156369156370156371156372156373156374156375156376156377156378156379156380156381156382156383156384156385156386156387156388156389156390156391156392156393156394156395156396156397156398156399156400156401156402156403156404156405156406156407156408156409156410156411156412156413156414156415156416156417156418156419156420156421156422156423156424156425156426156427156428156429156430156431156432156433156434156435156436156437156438156439156440156441156442156443156444156445156446156447156448156449156450156451156452156453156454156455156456156457156458156459156460156461156462156463156464156465156466156467156468156469156470156471156472156473156474156475156476156477156478156479156480156481156482156483156484156485156486156487156488156489156490156491156492156493156494156495156496156497156498156499156500156501156502156503156504156505156506156507156508156509156510156511156512156513156514156515156516156517156518156519156520156521156522156523156524156525156526156527156528156529156530156531156532156533156534156535156536156537156538156539156540156541156542156543156544156545156546156547156548156549156550156551156552156553156554156555156556156557156558156559156560156561156562156563156564156565156566156567156568156569156570156571156572156573156574156575156576156577156578156579156580156581156582156583156584156585156586156587156588156589156590156591156592156593156594156595156596156597156598156599156600156601156602156603156604156605156606156607156608156609156610156611156612156613156614156615156616156617156618156619156620156621156622156623156624156625156626156627156628156629156630156631156632156633156634156635156636156637156638156639156640156641156642156643156644156645156646156647156648156649156650156651156652156653156654156655156656156657156658156659156660156661156662156663156664156665156666156667156668156669156670156671156672156673156674156675156676156677156678156679156680156681156682156683156684156685156686156687156688156689156690156691156692156693156694156695156696156697156698156699156700156701156702156703156704156705156706156707156708156709156710156711156712156713156714156715156716156717156718156719156720156721156722156723156724156725156726156727156728156729156730156731156732156733156734156735156736156737156738156739156740156741156742156743156744156745156746156747156748156749156750156751156752156753156754156755156756156757156758156759156760156761156762156763156764156765156766156767156768156769156770156771156772156773156774156775156776156777156778156779156780156781156782156783156784156785156786156787156788156789156790156791156792156793156794156795156796156797156798156799156800156801156802156803156804156805156806156807156808156809156810156811156812156813156814156815156816156817156818156819156820156821156822156823156824156825156826156827156828156829156830156831156832156833156834156835156836156837156838156839156840156841156842156843156844156845156846156847156848156849156850156851156852156853156854156855156856156857156858156859156860156861156862156863156864156865156866156867156868156869156870156871156872156873156874156875156876156877156878156879156880156881156882156883156884156885156886156887156888156889156890156891156892156893156894156895156896156897156898156899156900156901156902156903156904156905156906156907156908156909156910156911156912156913156914156915156916156917156918156919156920156921156922156923156924156925156926156927156928156929156930156931156932156933156934156935156936156937156938156939156940156941156942156943156944156945156946156947156948156949156950156951156952156953156954156955156956156957156958156959156960156961156962156963156964156965156966156967156968156969156970156971156972156973156974156975156976156977156978156979156980156981156982156983156984156985156986156987156988156989156990156991156992156993156994156995156996156997156998156999157000157001157002157003157004157005157006157007157008157009157010157011157012157013157014157015157016157017157018157019157020157021157022157023157024157025157026157027157028157029157030157031157032157033157034157035157036157037157038157039157040157041157042157043157044157045157046157047157048157049157050157051157052157053157054157055157056157057157058157059157060157061157062157063157064157065157066157067157068157069157070157071157072157073157074157075157076157077157078157079157080157081157082157083157084157085157086157087157088157089157090157091157092157093157094157095157096157097157098157099157100157101157102157103157104157105157106157107157108157109157110157111157112157113157114157115157116157117157118157119157120157121157122157123157124157125157126157127157128157129157130157131157132157133157134157135157136157137157138157139157140157141157142157143157144157145157146157147157148157149157150157151157152157153157154157155157156157157157158157159157160157161157162157163157164157165157166157167157168157169157170157171157172157173157174157175157176157177157178157179157180157181157182157183157184157185157186157187157188157189157190157191157192157193157194157195157196157197157198157199157200157201157202157203157204157205157206157207157208157209157210157211157212157213157214157215157216157217157218157219157220157221157222157223157224157225157226157227157228157229157230157231157232157233157234157235157236157237157238157239157240157241157242157243157244157245157246157247157248157249157250157251157252157253157254157255157256157257157258157259157260157261157262157263157264157265157266157267157268157269157270157271157272157273157274157275157276157277157278157279157280157281157282157283157284157285157286157287157288157289157290157291157292157293157294157295157296157297157298157299157300157301157302157303157304157305157306157307157308157309157310157311157312157313157314157315157316157317157318157319157320157321157322157323157324157325157326157327157328157329157330157331157332157333157334157335157336157337157338157339157340157341157342157343157344157345157346157347157348157349157350157351157352157353157354157355157356157357157358157359157360157361157362157363157364157365157366157367157368157369157370157371157372157373157374157375157376157377157378157379157380157381157382157383157384157385157386157387157388157389157390157391157392157393157394157395157396157397157398157399157400157401157402157403157404157405157406157407157408157409157410157411157412157413157414157415157416157417157418157419157420157421157422157423157424157425157426157427157428157429157430157431157432157433157434157435157436157437157438157439157440157441157442157443157444157445157446157447157448157449157450157451157452157453157454157455157456157457157458157459157460157461157462157463157464157465157466157467157468157469157470157471157472157473157474157475157476157477157478157479157480157481157482157483157484157485157486157487157488157489157490157491157492157493157494157495157496157497157498157499157500157501157502157503157504157505157506157507157508157509157510157511157512157513157514157515157516157517157518157519157520157521157522157523157524157525157526157527157528157529157530157531157532157533157534157535157536157537157538157539157540157541157542157543157544157545157546157547157548157549157550157551157552157553157554157555157556157557157558157559157560157561157562157563157564157565157566157567157568157569157570157571157572157573157574157575157576157577157578157579157580157581157582157583157584157585157586157587157588157589157590157591157592157593157594157595157596157597157598157599157600157601157602157603157604157605157606157607157608157609157610157611157612157613157614157615157616157617157618157619157620157621157622157623157624157625157626157627157628157629157630157631157632157633157634157635157636157637157638157639157640157641157642157643157644157645157646157647157648157649157650157651157652157653157654157655157656157657157658157659157660157661157662157663157664157665157666157667157668157669157670157671157672157673157674157675157676157677157678157679157680157681157682157683157684157685157686157687157688157689157690157691157692157693157694157695157696157697157698157699157700157701157702157703157704157705157706157707157708157709157710157711157712157713157714157715157716157717157718157719157720157721157722157723157724157725157726157727157728157729157730157731157732157733157734157735157736157737157738157739157740157741157742157743157744157745157746157747157748157749157750157751157752157753157754157755157756157757157758157759157760157761157762157763157764157765157766157767157768157769157770157771157772157773157774157775157776157777157778157779157780157781157782157783157784157785157786157787157788157789157790157791157792157793157794157795157796157797157798157799157800157801157802157803157804157805157806157807157808157809157810157811157812157813157814157815157816157817157818157819157820157821157822157823157824157825157826157827157828157829157830157831157832157833157834157835157836157837157838157839157840157841157842157843157844157845157846157847157848157849157850157851157852157853157854157855157856157857157858157859157860157861157862157863157864157865157866157867157868157869157870157871157872157873157874157875157876157877157878157879157880157881157882157883157884157885157886157887157888157889157890157891157892157893157894157895157896157897157898157899157900157901157902157903157904157905157906157907157908157909157910157911157912157913157914157915157916157917157918157919157920157921157922157923157924157925157926157927157928157929157930157931157932157933157934157935157936157937157938157939157940157941157942157943157944157945157946157947157948157949157950157951157952157953157954157955157956157957157958157959157960157961157962157963157964157965157966157967157968157969157970157971157972157973157974157975157976157977157978157979157980157981157982157983157984157985157986157987157988157989157990157991157992157993157994157995157996157997157998157999158000158001158002158003158004158005158006158007158008158009158010158011158012158013158014158015158016158017158018158019158020158021158022158023158024158025158026158027158028158029158030158031158032158033158034158035158036158037158038158039158040158041158042158043158044158045158046158047158048158049158050158051158052158053158054158055158056158057158058158059158060158061158062158063158064158065158066158067158068158069158070158071158072158073158074158075158076158077158078158079158080158081158082158083158084158085158086158087158088158089158090158091158092158093158094158095158096158097158098158099158100158101158102158103158104158105158106158107158108158109158110158111158112158113158114158115158116158117158118158119158120158121158122158123158124158125158126158127158128158129158130158131158132158133158134158135158136158137158138158139158140158141158142158143158144158145158146158147158148158149158150158151158152158153158154158155158156158157158158158159158160158161158162158163158164158165158166158167158168158169158170158171158172158173158174158175158176158177158178158179158180158181158182158183158184158185158186158187158188158189158190158191158192158193158194158195158196158197158198158199158200158201158202158203158204158205158206158207158208158209158210158211158212158213158214158215158216158217158218158219158220158221158222158223158224158225158226158227158228158229158230158231158232158233158234158235158236158237158238158239158240158241158242158243158244158245158246158247158248158249158250158251158252158253158254158255158256158257158258158259158260158261158262158263158264158265158266158267158268158269158270158271158272158273158274158275158276158277158278158279158280158281158282158283158284158285158286158287158288158289158290158291158292158293158294158295158296158297158298158299158300158301158302158303158304158305158306158307158308158309158310158311158312158313158314158315158316158317158318158319158320158321158322158323158324158325158326158327158328158329158330158331158332158333158334158335158336158337158338158339158340158341158342158343158344158345158346158347158348158349158350158351158352158353158354158355158356158357158358158359158360158361158362158363158364158365158366158367158368158369158370158371158372158373158374158375158376158377158378158379158380158381158382158383158384158385158386158387158388158389158390158391158392158393158394158395158396158397158398158399158400158401158402158403158404158405158406158407158408158409158410158411158412158413158414158415158416158417158418158419158420158421158422158423158424158425158426158427158428158429158430158431158432158433158434158435158436158437158438158439158440158441158442158443158444158445158446158447158448158449158450158451158452158453158454158455158456158457158458158459158460158461158462158463158464158465158466158467158468158469158470158471158472158473158474158475158476158477158478158479158480158481158482158483158484158485158486158487158488158489158490158491158492158493158494158495158496158497158498158499158500158501158502158503158504158505158506158507158508158509158510158511158512158513158514158515158516158517158518158519158520158521158522158523158524158525158526158527158528158529158530158531158532158533158534158535158536158537158538158539158540158541158542158543158544158545158546158547158548158549158550158551158552158553158554158555158556158557158558158559158560158561158562158563158564158565158566158567158568158569158570158571158572158573158574158575158576158577158578158579158580158581158582158583158584158585158586158587158588158589158590158591158592158593158594158595158596158597158598158599158600158601158602158603158604158605158606158607158608158609158610158611158612158613158614158615158616158617158618158619158620158621158622158623158624158625158626158627158628158629158630158631158632158633158634158635158636158637158638158639158640158641158642158643158644158645158646158647158648158649158650158651158652158653158654158655158656158657158658158659158660158661158662158663158664158665158666158667158668158669158670158671158672158673158674158675158676158677158678158679158680158681158682158683158684158685158686158687158688158689158690158691158692158693158694158695158696158697158698158699158700158701158702158703158704158705158706158707158708158709158710158711158712158713158714158715158716158717158718158719158720158721158722158723158724158725158726158727158728158729158730158731158732158733158734158735158736158737158738158739158740158741158742158743158744158745158746158747158748158749158750158751158752158753158754158755158756158757158758158759158760158761158762158763158764158765158766158767158768158769158770158771158772158773158774158775158776158777158778158779158780158781158782158783158784158785158786158787158788158789158790158791158792158793158794158795158796158797158798158799158800158801158802158803158804158805158806158807158808158809158810158811158812158813158814158815158816158817158818158819158820158821158822158823158824158825158826158827158828158829158830158831158832158833158834158835158836158837158838158839158840158841158842158843158844158845158846158847158848158849158850158851158852158853158854158855158856158857158858158859158860158861158862158863158864158865158866158867158868158869158870158871158872158873158874158875158876158877158878158879158880158881158882158883158884158885158886158887158888158889158890158891158892158893158894158895158896158897158898158899158900158901158902158903158904158905158906158907158908158909158910158911158912158913158914158915158916158917158918158919158920158921158922158923158924158925158926158927158928158929158930158931158932158933158934158935158936158937158938158939158940158941158942158943158944158945158946158947158948158949158950158951158952158953158954158955158956158957158958158959158960158961158962158963158964158965158966158967158968158969158970158971158972158973158974158975158976158977158978158979158980158981158982158983158984158985158986158987158988158989158990158991158992158993158994158995158996158997158998158999159000159001159002159003159004159005159006159007159008159009159010159011159012159013159014159015159016159017159018159019159020159021159022159023159024159025159026159027159028159029159030159031159032159033159034159035159036159037159038159039159040159041159042159043159044159045159046159047159048159049159050159051159052159053159054159055159056159057159058159059159060159061159062159063159064159065159066159067159068159069159070159071159072159073159074159075159076159077159078159079159080159081159082159083159084159085159086159087159088159089159090159091159092159093159094159095159096159097159098159099159100159101159102159103159104159105159106159107159108159109159110159111159112159113159114159115159116159117159118159119159120159121159122159123159124159125159126159127159128159129159130159131159132159133159134159135159136159137159138159139159140159141159142159143159144159145159146159147159148159149159150159151159152159153159154159155159156159157159158159159159160159161159162159163159164159165159166159167159168159169159170159171159172159173159174159175159176159177159178159179159180159181159182159183159184159185159186159187159188159189159190159191159192159193159194159195159196159197159198159199159200159201159202159203159204159205159206159207159208159209159210159211159212159213159214159215159216159217159218159219159220159221159222159223159224159225159226159227159228159229159230159231159232159233159234159235159236159237159238159239159240159241159242159243159244159245159246159247159248159249159250159251159252159253159254159255159256159257159258159259159260159261159262159263159264159265159266159267159268159269159270159271159272159273159274159275159276159277159278159279159280159281159282159283159284159285159286159287159288159289159290159291159292159293159294159295159296159297159298159299159300159301159302159303159304159305159306159307159308159309159310159311159312159313159314159315159316159317159318159319159320159321159322159323159324159325159326159327159328159329159330159331159332159333159334159335159336159337159338159339159340159341159342159343159344159345159346159347159348159349159350159351159352159353159354159355159356159357159358159359159360159361159362159363159364159365159366159367159368159369159370159371159372159373159374159375159376159377159378159379159380159381159382159383159384159385159386159387159388159389159390159391159392159393159394159395159396159397159398159399159400159401159402159403159404159405159406159407159408159409159410159411159412159413159414159415159416159417159418159419159420159421159422159423159424159425159426159427159428159429159430159431159432159433159434159435159436159437159438159439159440159441159442159443159444159445159446159447159448159449159450159451159452159453159454159455159456159457159458159459159460159461159462159463159464159465159466159467159468159469159470159471159472159473159474159475159476159477159478159479159480159481159482159483159484159485159486159487159488159489159490159491159492159493159494159495159496159497159498159499159500159501159502159503159504159505159506159507159508159509159510159511159512159513159514159515159516159517159518159519159520159521159522159523159524159525159526159527159528159529159530159531159532159533159534159535159536159537159538159539159540159541159542159543159544159545159546159547159548159549159550159551159552159553159554159555159556159557159558159559159560159561159562159563159564159565159566159567159568159569159570159571159572159573159574159575159576159577159578159579159580159581159582159583159584159585159586159587159588159589159590159591159592159593159594159595159596159597159598159599159600159601159602159603159604159605159606159607159608159609159610159611159612159613159614159615159616159617159618159619159620159621159622159623159624159625159626159627159628159629159630159631159632159633159634159635159636159637159638159639159640159641159642159643159644159645159646159647159648159649159650159651159652159653159654159655159656159657159658159659159660159661159662159663159664159665159666159667159668159669159670159671159672159673159674159675159676159677159678159679159680159681159682159683159684159685159686159687159688159689159690159691159692159693159694159695159696159697159698159699159700159701159702159703159704159705159706159707159708159709159710159711159712159713159714159715159716159717159718159719159720159721159722159723159724159725159726159727159728159729159730159731159732159733159734159735159736159737159738159739159740159741159742159743159744159745159746159747159748159749159750159751159752159753159754159755159756159757159758159759159760159761159762159763159764159765159766159767159768159769159770159771159772159773159774159775159776159777159778159779159780159781159782159783159784159785159786159787159788159789159790159791159792159793159794159795159796159797159798159799159800159801159802159803159804159805159806159807159808159809159810159811159812159813159814159815159816159817159818159819159820159821159822159823159824159825159826159827159828159829159830159831159832159833159834159835159836159837159838159839159840159841159842159843159844159845159846159847159848159849159850159851159852159853159854159855159856159857159858159859159860159861159862159863159864159865159866159867159868159869159870159871159872159873159874159875159876159877159878159879159880159881159882159883159884159885159886159887159888159889159890159891159892159893159894159895159896159897159898159899159900159901159902159903159904159905159906159907159908159909159910159911159912159913159914159915159916159917159918159919159920159921159922159923159924159925159926159927159928159929159930159931159932159933159934159935159936159937159938159939159940159941159942159943159944159945159946159947159948159949159950159951159952159953159954159955159956159957159958159959159960159961159962159963159964159965159966159967159968159969159970159971159972159973159974159975159976159977159978159979159980159981159982159983159984159985159986159987159988159989159990159991159992159993159994159995159996159997159998159999160000160001160002160003160004160005160006160007160008160009160010160011160012160013160014160015160016160017160018160019160020160021160022160023160024160025160026160027160028160029160030160031160032160033160034160035160036160037160038160039160040160041160042160043160044160045160046160047160048160049160050160051160052160053160054160055160056160057160058160059160060160061160062160063160064160065160066160067160068160069160070160071160072160073160074160075160076160077160078160079160080160081160082160083160084160085160086160087160088160089160090160091160092160093160094160095160096160097160098160099160100160101160102160103160104160105160106160107160108160109160110160111160112160113160114160115160116160117160118160119160120160121160122160123160124160125160126160127160128160129160130160131160132160133160134160135160136160137160138160139160140160141160142160143160144160145160146160147160148160149160150160151160152160153160154160155160156160157160158160159160160160161160162160163160164160165160166160167160168160169160170160171160172160173160174160175160176160177160178160179160180160181160182160183160184160185160186160187160188160189160190160191160192160193160194160195160196160197160198160199160200160201160202160203160204160205160206160207160208160209160210160211160212160213160214160215160216160217160218160219160220160221160222160223160224160225160226160227160228160229160230160231160232160233160234160235160236160237160238160239160240160241160242160243160244160245160246160247160248160249160250160251160252160253160254160255160256160257160258160259160260160261160262160263160264160265160266160267160268160269160270160271160272160273160274160275160276160277160278160279160280160281160282160283160284160285160286160287160288160289160290160291160292160293160294160295160296160297160298160299160300160301160302160303160304160305160306160307160308160309160310160311160312160313160314160315160316160317160318160319160320160321160322160323160324160325160326160327160328160329160330160331160332160333160334160335160336160337160338160339160340160341160342160343160344160345160346160347160348160349160350160351160352160353160354160355160356160357160358160359160360160361160362160363160364160365160366160367160368160369160370160371160372160373160374160375160376160377160378160379160380160381160382160383160384160385160386160387160388160389160390160391160392160393160394160395160396160397160398160399160400160401160402160403160404160405160406160407160408160409160410160411160412160413160414160415160416160417160418160419160420160421160422160423160424160425160426160427160428160429160430160431160432160433160434160435160436160437160438160439160440160441160442160443160444160445160446160447160448160449160450160451160452160453160454160455160456160457160458160459160460160461160462160463160464160465160466160467160468160469160470160471160472160473160474160475160476160477160478160479160480160481160482160483160484160485160486160487160488160489160490160491160492160493160494160495160496160497160498160499160500160501160502160503160504160505160506160507160508160509160510160511160512160513160514160515160516160517160518160519160520160521160522160523160524160525160526160527160528160529160530160531160532160533160534160535160536160537160538160539160540160541160542160543160544160545160546160547160548160549160550160551160552160553160554160555160556160557160558160559160560160561160562160563160564160565160566160567160568160569160570160571160572160573160574160575160576160577160578160579160580160581160582160583160584160585160586160587160588160589160590160591160592160593160594160595160596160597160598160599160600160601160602160603160604160605160606160607160608160609160610160611160612160613160614160615160616160617160618160619160620160621160622160623160624160625160626160627160628160629160630160631160632160633160634160635160636160637160638160639160640160641160642160643160644160645160646160647160648160649160650160651160652160653160654160655160656160657160658160659160660160661160662160663160664160665160666160667160668160669160670160671160672160673160674160675160676160677160678160679160680160681160682160683160684160685160686160687160688160689160690160691160692160693160694160695160696160697160698160699160700160701160702160703160704160705160706160707160708160709160710160711160712160713160714160715160716160717160718160719160720160721160722160723160724160725160726160727160728160729160730160731160732160733160734160735160736160737160738160739160740160741160742160743160744160745160746160747160748160749160750160751160752160753160754160755160756160757160758160759160760160761160762160763160764160765160766160767160768160769160770160771160772160773160774160775160776160777160778160779160780160781160782160783160784160785160786160787160788160789160790160791160792160793160794160795160796160797160798160799160800160801160802160803160804160805160806160807160808160809160810160811160812160813160814160815160816160817160818160819160820160821160822160823160824160825160826160827160828160829160830160831160832160833160834160835160836160837160838160839160840160841160842160843160844160845160846160847160848160849160850160851160852160853160854160855160856160857160858160859160860160861160862160863160864160865160866160867160868160869160870160871160872160873160874160875160876160877160878160879160880160881160882160883160884160885160886160887160888160889160890160891160892160893160894160895160896160897160898160899160900160901160902160903160904160905160906160907160908160909160910160911160912160913160914160915160916160917160918160919160920160921160922160923160924160925160926160927160928160929160930160931160932160933160934160935160936160937160938160939160940160941160942160943160944160945160946160947160948160949160950160951160952160953160954160955160956160957160958160959160960160961160962160963160964160965160966160967160968160969160970160971160972160973160974160975160976160977160978160979160980160981160982160983160984160985160986160987160988160989160990160991160992160993160994160995160996160997160998160999161000161001161002161003161004161005161006161007161008161009161010161011161012161013161014161015161016161017161018161019161020161021161022161023161024161025161026161027161028161029161030161031161032161033161034161035161036161037161038161039161040161041161042161043161044161045161046161047161048161049161050161051161052161053161054161055161056161057161058161059161060161061161062161063161064161065161066161067161068161069161070161071161072161073161074161075161076161077161078161079161080161081161082161083161084161085161086161087161088161089161090161091161092161093161094161095161096161097161098161099161100161101161102161103161104161105161106
  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package compute provides access to the Compute Engine API.
  6. //
  7. // For product documentation, see: https://developers.google.com/compute/docs/reference/latest/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/compute/v0.alpha"
  14. // ...
  15. // ctx := context.Background()
  16. // computeService, err := compute.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // computeService, err := compute.NewService(ctx, option.WithScopes(compute.DevstorageReadWriteScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // computeService, err := compute.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // computeService, err := compute.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package compute // import "google.golang.org/api/compute/v0.alpha"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "compute:alpha"
  71. const apiName = "compute"
  72. const apiVersion = "alpha"
  73. const basePath = "https://www.googleapis.com/compute/alpha/projects/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage your data across Google Cloud Platform services
  77. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  78. // View and manage your Google Compute Engine resources
  79. ComputeScope = "https://www.googleapis.com/auth/compute"
  80. // View your Google Compute Engine resources
  81. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  82. // Manage your data and permissions in Google Cloud Storage
  83. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  84. // View your data in Google Cloud Storage
  85. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  86. // Manage your data in Google Cloud Storage
  87. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  88. )
  89. // NewService creates a new Service.
  90. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  91. scopesOption := option.WithScopes(
  92. "https://www.googleapis.com/auth/cloud-platform",
  93. "https://www.googleapis.com/auth/compute",
  94. "https://www.googleapis.com/auth/compute.readonly",
  95. "https://www.googleapis.com/auth/devstorage.full_control",
  96. "https://www.googleapis.com/auth/devstorage.read_only",
  97. "https://www.googleapis.com/auth/devstorage.read_write",
  98. )
  99. // NOTE: prepend, so we don't override user-specified scopes.
  100. opts = append([]option.ClientOption{scopesOption}, opts...)
  101. client, endpoint, err := htransport.NewClient(ctx, opts...)
  102. if err != nil {
  103. return nil, err
  104. }
  105. s, err := New(client)
  106. if err != nil {
  107. return nil, err
  108. }
  109. if endpoint != "" {
  110. s.BasePath = endpoint
  111. }
  112. return s, nil
  113. }
  114. // New creates a new Service. It uses the provided http.Client for requests.
  115. //
  116. // Deprecated: please use NewService instead.
  117. // To provide a custom HTTP client, use option.WithHTTPClient.
  118. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  119. func New(client *http.Client) (*Service, error) {
  120. if client == nil {
  121. return nil, errors.New("client is nil")
  122. }
  123. s := &Service{client: client, BasePath: basePath}
  124. s.AcceleratorTypes = NewAcceleratorTypesService(s)
  125. s.Addresses = NewAddressesService(s)
  126. s.Autoscalers = NewAutoscalersService(s)
  127. s.BackendBuckets = NewBackendBucketsService(s)
  128. s.BackendServices = NewBackendServicesService(s)
  129. s.DiskTypes = NewDiskTypesService(s)
  130. s.Disks = NewDisksService(s)
  131. s.ExternalVpnGateways = NewExternalVpnGatewaysService(s)
  132. s.Firewalls = NewFirewallsService(s)
  133. s.ForwardingRules = NewForwardingRulesService(s)
  134. s.GlobalAddresses = NewGlobalAddressesService(s)
  135. s.GlobalForwardingRules = NewGlobalForwardingRulesService(s)
  136. s.GlobalNetworkEndpointGroups = NewGlobalNetworkEndpointGroupsService(s)
  137. s.GlobalOperations = NewGlobalOperationsService(s)
  138. s.GlobalOrganizationOperations = NewGlobalOrganizationOperationsService(s)
  139. s.HealthChecks = NewHealthChecksService(s)
  140. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  141. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  142. s.Images = NewImagesService(s)
  143. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  144. s.InstanceGroups = NewInstanceGroupsService(s)
  145. s.InstanceTemplates = NewInstanceTemplatesService(s)
  146. s.Instances = NewInstancesService(s)
  147. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  148. s.InterconnectLocations = NewInterconnectLocationsService(s)
  149. s.Interconnects = NewInterconnectsService(s)
  150. s.LicenseCodes = NewLicenseCodesService(s)
  151. s.Licenses = NewLicensesService(s)
  152. s.MachineImages = NewMachineImagesService(s)
  153. s.MachineTypes = NewMachineTypesService(s)
  154. s.NetworkEndpointGroups = NewNetworkEndpointGroupsService(s)
  155. s.Networks = NewNetworksService(s)
  156. s.NodeGroups = NewNodeGroupsService(s)
  157. s.NodeTemplates = NewNodeTemplatesService(s)
  158. s.NodeTypes = NewNodeTypesService(s)
  159. s.OrganizationSecurityPolicies = NewOrganizationSecurityPoliciesService(s)
  160. s.Projects = NewProjectsService(s)
  161. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  162. s.RegionBackendServices = NewRegionBackendServicesService(s)
  163. s.RegionCommitments = NewRegionCommitmentsService(s)
  164. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  165. s.RegionDisks = NewRegionDisksService(s)
  166. s.RegionHealthCheckServices = NewRegionHealthCheckServicesService(s)
  167. s.RegionHealthChecks = NewRegionHealthChecksService(s)
  168. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  169. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  170. s.RegionNotificationEndpoints = NewRegionNotificationEndpointsService(s)
  171. s.RegionOperations = NewRegionOperationsService(s)
  172. s.RegionSslCertificates = NewRegionSslCertificatesService(s)
  173. s.RegionTargetHttpProxies = NewRegionTargetHttpProxiesService(s)
  174. s.RegionTargetHttpsProxies = NewRegionTargetHttpsProxiesService(s)
  175. s.RegionUrlMaps = NewRegionUrlMapsService(s)
  176. s.Regions = NewRegionsService(s)
  177. s.Reservations = NewReservationsService(s)
  178. s.ResourcePolicies = NewResourcePoliciesService(s)
  179. s.Routers = NewRoutersService(s)
  180. s.Routes = NewRoutesService(s)
  181. s.SecurityPolicies = NewSecurityPoliciesService(s)
  182. s.Snapshots = NewSnapshotsService(s)
  183. s.SslCertificates = NewSslCertificatesService(s)
  184. s.SslPolicies = NewSslPoliciesService(s)
  185. s.Subnetworks = NewSubnetworksService(s)
  186. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  187. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  188. s.TargetInstances = NewTargetInstancesService(s)
  189. s.TargetPools = NewTargetPoolsService(s)
  190. s.TargetSslProxies = NewTargetSslProxiesService(s)
  191. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  192. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  193. s.UrlMaps = NewUrlMapsService(s)
  194. s.VpnGateways = NewVpnGatewaysService(s)
  195. s.VpnTunnels = NewVpnTunnelsService(s)
  196. s.ZoneOperations = NewZoneOperationsService(s)
  197. s.Zones = NewZonesService(s)
  198. return s, nil
  199. }
  200. type Service struct {
  201. client *http.Client
  202. BasePath string // API endpoint base URL
  203. UserAgent string // optional additional User-Agent fragment
  204. AcceleratorTypes *AcceleratorTypesService
  205. Addresses *AddressesService
  206. Autoscalers *AutoscalersService
  207. BackendBuckets *BackendBucketsService
  208. BackendServices *BackendServicesService
  209. DiskTypes *DiskTypesService
  210. Disks *DisksService
  211. ExternalVpnGateways *ExternalVpnGatewaysService
  212. Firewalls *FirewallsService
  213. ForwardingRules *ForwardingRulesService
  214. GlobalAddresses *GlobalAddressesService
  215. GlobalForwardingRules *GlobalForwardingRulesService
  216. GlobalNetworkEndpointGroups *GlobalNetworkEndpointGroupsService
  217. GlobalOperations *GlobalOperationsService
  218. GlobalOrganizationOperations *GlobalOrganizationOperationsService
  219. HealthChecks *HealthChecksService
  220. HttpHealthChecks *HttpHealthChecksService
  221. HttpsHealthChecks *HttpsHealthChecksService
  222. Images *ImagesService
  223. InstanceGroupManagers *InstanceGroupManagersService
  224. InstanceGroups *InstanceGroupsService
  225. InstanceTemplates *InstanceTemplatesService
  226. Instances *InstancesService
  227. InterconnectAttachments *InterconnectAttachmentsService
  228. InterconnectLocations *InterconnectLocationsService
  229. Interconnects *InterconnectsService
  230. LicenseCodes *LicenseCodesService
  231. Licenses *LicensesService
  232. MachineImages *MachineImagesService
  233. MachineTypes *MachineTypesService
  234. NetworkEndpointGroups *NetworkEndpointGroupsService
  235. Networks *NetworksService
  236. NodeGroups *NodeGroupsService
  237. NodeTemplates *NodeTemplatesService
  238. NodeTypes *NodeTypesService
  239. OrganizationSecurityPolicies *OrganizationSecurityPoliciesService
  240. Projects *ProjectsService
  241. RegionAutoscalers *RegionAutoscalersService
  242. RegionBackendServices *RegionBackendServicesService
  243. RegionCommitments *RegionCommitmentsService
  244. RegionDiskTypes *RegionDiskTypesService
  245. RegionDisks *RegionDisksService
  246. RegionHealthCheckServices *RegionHealthCheckServicesService
  247. RegionHealthChecks *RegionHealthChecksService
  248. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  249. RegionInstanceGroups *RegionInstanceGroupsService
  250. RegionNotificationEndpoints *RegionNotificationEndpointsService
  251. RegionOperations *RegionOperationsService
  252. RegionSslCertificates *RegionSslCertificatesService
  253. RegionTargetHttpProxies *RegionTargetHttpProxiesService
  254. RegionTargetHttpsProxies *RegionTargetHttpsProxiesService
  255. RegionUrlMaps *RegionUrlMapsService
  256. Regions *RegionsService
  257. Reservations *ReservationsService
  258. ResourcePolicies *ResourcePoliciesService
  259. Routers *RoutersService
  260. Routes *RoutesService
  261. SecurityPolicies *SecurityPoliciesService
  262. Snapshots *SnapshotsService
  263. SslCertificates *SslCertificatesService
  264. SslPolicies *SslPoliciesService
  265. Subnetworks *SubnetworksService
  266. TargetHttpProxies *TargetHttpProxiesService
  267. TargetHttpsProxies *TargetHttpsProxiesService
  268. TargetInstances *TargetInstancesService
  269. TargetPools *TargetPoolsService
  270. TargetSslProxies *TargetSslProxiesService
  271. TargetTcpProxies *TargetTcpProxiesService
  272. TargetVpnGateways *TargetVpnGatewaysService
  273. UrlMaps *UrlMapsService
  274. VpnGateways *VpnGatewaysService
  275. VpnTunnels *VpnTunnelsService
  276. ZoneOperations *ZoneOperationsService
  277. Zones *ZonesService
  278. }
  279. func (s *Service) userAgent() string {
  280. if s.UserAgent == "" {
  281. return googleapi.UserAgent
  282. }
  283. return googleapi.UserAgent + " " + s.UserAgent
  284. }
  285. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  286. rs := &AcceleratorTypesService{s: s}
  287. return rs
  288. }
  289. type AcceleratorTypesService struct {
  290. s *Service
  291. }
  292. func NewAddressesService(s *Service) *AddressesService {
  293. rs := &AddressesService{s: s}
  294. return rs
  295. }
  296. type AddressesService struct {
  297. s *Service
  298. }
  299. func NewAutoscalersService(s *Service) *AutoscalersService {
  300. rs := &AutoscalersService{s: s}
  301. return rs
  302. }
  303. type AutoscalersService struct {
  304. s *Service
  305. }
  306. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  307. rs := &BackendBucketsService{s: s}
  308. return rs
  309. }
  310. type BackendBucketsService struct {
  311. s *Service
  312. }
  313. func NewBackendServicesService(s *Service) *BackendServicesService {
  314. rs := &BackendServicesService{s: s}
  315. return rs
  316. }
  317. type BackendServicesService struct {
  318. s *Service
  319. }
  320. func NewDiskTypesService(s *Service) *DiskTypesService {
  321. rs := &DiskTypesService{s: s}
  322. return rs
  323. }
  324. type DiskTypesService struct {
  325. s *Service
  326. }
  327. func NewDisksService(s *Service) *DisksService {
  328. rs := &DisksService{s: s}
  329. return rs
  330. }
  331. type DisksService struct {
  332. s *Service
  333. }
  334. func NewExternalVpnGatewaysService(s *Service) *ExternalVpnGatewaysService {
  335. rs := &ExternalVpnGatewaysService{s: s}
  336. return rs
  337. }
  338. type ExternalVpnGatewaysService struct {
  339. s *Service
  340. }
  341. func NewFirewallsService(s *Service) *FirewallsService {
  342. rs := &FirewallsService{s: s}
  343. return rs
  344. }
  345. type FirewallsService struct {
  346. s *Service
  347. }
  348. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  349. rs := &ForwardingRulesService{s: s}
  350. return rs
  351. }
  352. type ForwardingRulesService struct {
  353. s *Service
  354. }
  355. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  356. rs := &GlobalAddressesService{s: s}
  357. return rs
  358. }
  359. type GlobalAddressesService struct {
  360. s *Service
  361. }
  362. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  363. rs := &GlobalForwardingRulesService{s: s}
  364. return rs
  365. }
  366. type GlobalForwardingRulesService struct {
  367. s *Service
  368. }
  369. func NewGlobalNetworkEndpointGroupsService(s *Service) *GlobalNetworkEndpointGroupsService {
  370. rs := &GlobalNetworkEndpointGroupsService{s: s}
  371. return rs
  372. }
  373. type GlobalNetworkEndpointGroupsService struct {
  374. s *Service
  375. }
  376. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  377. rs := &GlobalOperationsService{s: s}
  378. return rs
  379. }
  380. type GlobalOperationsService struct {
  381. s *Service
  382. }
  383. func NewGlobalOrganizationOperationsService(s *Service) *GlobalOrganizationOperationsService {
  384. rs := &GlobalOrganizationOperationsService{s: s}
  385. return rs
  386. }
  387. type GlobalOrganizationOperationsService struct {
  388. s *Service
  389. }
  390. func NewHealthChecksService(s *Service) *HealthChecksService {
  391. rs := &HealthChecksService{s: s}
  392. return rs
  393. }
  394. type HealthChecksService struct {
  395. s *Service
  396. }
  397. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  398. rs := &HttpHealthChecksService{s: s}
  399. return rs
  400. }
  401. type HttpHealthChecksService struct {
  402. s *Service
  403. }
  404. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  405. rs := &HttpsHealthChecksService{s: s}
  406. return rs
  407. }
  408. type HttpsHealthChecksService struct {
  409. s *Service
  410. }
  411. func NewImagesService(s *Service) *ImagesService {
  412. rs := &ImagesService{s: s}
  413. return rs
  414. }
  415. type ImagesService struct {
  416. s *Service
  417. }
  418. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  419. rs := &InstanceGroupManagersService{s: s}
  420. return rs
  421. }
  422. type InstanceGroupManagersService struct {
  423. s *Service
  424. }
  425. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  426. rs := &InstanceGroupsService{s: s}
  427. return rs
  428. }
  429. type InstanceGroupsService struct {
  430. s *Service
  431. }
  432. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  433. rs := &InstanceTemplatesService{s: s}
  434. return rs
  435. }
  436. type InstanceTemplatesService struct {
  437. s *Service
  438. }
  439. func NewInstancesService(s *Service) *InstancesService {
  440. rs := &InstancesService{s: s}
  441. return rs
  442. }
  443. type InstancesService struct {
  444. s *Service
  445. }
  446. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  447. rs := &InterconnectAttachmentsService{s: s}
  448. return rs
  449. }
  450. type InterconnectAttachmentsService struct {
  451. s *Service
  452. }
  453. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  454. rs := &InterconnectLocationsService{s: s}
  455. return rs
  456. }
  457. type InterconnectLocationsService struct {
  458. s *Service
  459. }
  460. func NewInterconnectsService(s *Service) *InterconnectsService {
  461. rs := &InterconnectsService{s: s}
  462. return rs
  463. }
  464. type InterconnectsService struct {
  465. s *Service
  466. }
  467. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  468. rs := &LicenseCodesService{s: s}
  469. return rs
  470. }
  471. type LicenseCodesService struct {
  472. s *Service
  473. }
  474. func NewLicensesService(s *Service) *LicensesService {
  475. rs := &LicensesService{s: s}
  476. return rs
  477. }
  478. type LicensesService struct {
  479. s *Service
  480. }
  481. func NewMachineImagesService(s *Service) *MachineImagesService {
  482. rs := &MachineImagesService{s: s}
  483. return rs
  484. }
  485. type MachineImagesService struct {
  486. s *Service
  487. }
  488. func NewMachineTypesService(s *Service) *MachineTypesService {
  489. rs := &MachineTypesService{s: s}
  490. return rs
  491. }
  492. type MachineTypesService struct {
  493. s *Service
  494. }
  495. func NewNetworkEndpointGroupsService(s *Service) *NetworkEndpointGroupsService {
  496. rs := &NetworkEndpointGroupsService{s: s}
  497. return rs
  498. }
  499. type NetworkEndpointGroupsService struct {
  500. s *Service
  501. }
  502. func NewNetworksService(s *Service) *NetworksService {
  503. rs := &NetworksService{s: s}
  504. return rs
  505. }
  506. type NetworksService struct {
  507. s *Service
  508. }
  509. func NewNodeGroupsService(s *Service) *NodeGroupsService {
  510. rs := &NodeGroupsService{s: s}
  511. return rs
  512. }
  513. type NodeGroupsService struct {
  514. s *Service
  515. }
  516. func NewNodeTemplatesService(s *Service) *NodeTemplatesService {
  517. rs := &NodeTemplatesService{s: s}
  518. return rs
  519. }
  520. type NodeTemplatesService struct {
  521. s *Service
  522. }
  523. func NewNodeTypesService(s *Service) *NodeTypesService {
  524. rs := &NodeTypesService{s: s}
  525. return rs
  526. }
  527. type NodeTypesService struct {
  528. s *Service
  529. }
  530. func NewOrganizationSecurityPoliciesService(s *Service) *OrganizationSecurityPoliciesService {
  531. rs := &OrganizationSecurityPoliciesService{s: s}
  532. return rs
  533. }
  534. type OrganizationSecurityPoliciesService struct {
  535. s *Service
  536. }
  537. func NewProjectsService(s *Service) *ProjectsService {
  538. rs := &ProjectsService{s: s}
  539. return rs
  540. }
  541. type ProjectsService struct {
  542. s *Service
  543. }
  544. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  545. rs := &RegionAutoscalersService{s: s}
  546. return rs
  547. }
  548. type RegionAutoscalersService struct {
  549. s *Service
  550. }
  551. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  552. rs := &RegionBackendServicesService{s: s}
  553. return rs
  554. }
  555. type RegionBackendServicesService struct {
  556. s *Service
  557. }
  558. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  559. rs := &RegionCommitmentsService{s: s}
  560. return rs
  561. }
  562. type RegionCommitmentsService struct {
  563. s *Service
  564. }
  565. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  566. rs := &RegionDiskTypesService{s: s}
  567. return rs
  568. }
  569. type RegionDiskTypesService struct {
  570. s *Service
  571. }
  572. func NewRegionDisksService(s *Service) *RegionDisksService {
  573. rs := &RegionDisksService{s: s}
  574. return rs
  575. }
  576. type RegionDisksService struct {
  577. s *Service
  578. }
  579. func NewRegionHealthCheckServicesService(s *Service) *RegionHealthCheckServicesService {
  580. rs := &RegionHealthCheckServicesService{s: s}
  581. return rs
  582. }
  583. type RegionHealthCheckServicesService struct {
  584. s *Service
  585. }
  586. func NewRegionHealthChecksService(s *Service) *RegionHealthChecksService {
  587. rs := &RegionHealthChecksService{s: s}
  588. return rs
  589. }
  590. type RegionHealthChecksService struct {
  591. s *Service
  592. }
  593. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  594. rs := &RegionInstanceGroupManagersService{s: s}
  595. return rs
  596. }
  597. type RegionInstanceGroupManagersService struct {
  598. s *Service
  599. }
  600. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  601. rs := &RegionInstanceGroupsService{s: s}
  602. return rs
  603. }
  604. type RegionInstanceGroupsService struct {
  605. s *Service
  606. }
  607. func NewRegionNotificationEndpointsService(s *Service) *RegionNotificationEndpointsService {
  608. rs := &RegionNotificationEndpointsService{s: s}
  609. return rs
  610. }
  611. type RegionNotificationEndpointsService struct {
  612. s *Service
  613. }
  614. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  615. rs := &RegionOperationsService{s: s}
  616. return rs
  617. }
  618. type RegionOperationsService struct {
  619. s *Service
  620. }
  621. func NewRegionSslCertificatesService(s *Service) *RegionSslCertificatesService {
  622. rs := &RegionSslCertificatesService{s: s}
  623. return rs
  624. }
  625. type RegionSslCertificatesService struct {
  626. s *Service
  627. }
  628. func NewRegionTargetHttpProxiesService(s *Service) *RegionTargetHttpProxiesService {
  629. rs := &RegionTargetHttpProxiesService{s: s}
  630. return rs
  631. }
  632. type RegionTargetHttpProxiesService struct {
  633. s *Service
  634. }
  635. func NewRegionTargetHttpsProxiesService(s *Service) *RegionTargetHttpsProxiesService {
  636. rs := &RegionTargetHttpsProxiesService{s: s}
  637. return rs
  638. }
  639. type RegionTargetHttpsProxiesService struct {
  640. s *Service
  641. }
  642. func NewRegionUrlMapsService(s *Service) *RegionUrlMapsService {
  643. rs := &RegionUrlMapsService{s: s}
  644. return rs
  645. }
  646. type RegionUrlMapsService struct {
  647. s *Service
  648. }
  649. func NewRegionsService(s *Service) *RegionsService {
  650. rs := &RegionsService{s: s}
  651. return rs
  652. }
  653. type RegionsService struct {
  654. s *Service
  655. }
  656. func NewReservationsService(s *Service) *ReservationsService {
  657. rs := &ReservationsService{s: s}
  658. return rs
  659. }
  660. type ReservationsService struct {
  661. s *Service
  662. }
  663. func NewResourcePoliciesService(s *Service) *ResourcePoliciesService {
  664. rs := &ResourcePoliciesService{s: s}
  665. return rs
  666. }
  667. type ResourcePoliciesService struct {
  668. s *Service
  669. }
  670. func NewRoutersService(s *Service) *RoutersService {
  671. rs := &RoutersService{s: s}
  672. return rs
  673. }
  674. type RoutersService struct {
  675. s *Service
  676. }
  677. func NewRoutesService(s *Service) *RoutesService {
  678. rs := &RoutesService{s: s}
  679. return rs
  680. }
  681. type RoutesService struct {
  682. s *Service
  683. }
  684. func NewSecurityPoliciesService(s *Service) *SecurityPoliciesService {
  685. rs := &SecurityPoliciesService{s: s}
  686. return rs
  687. }
  688. type SecurityPoliciesService struct {
  689. s *Service
  690. }
  691. func NewSnapshotsService(s *Service) *SnapshotsService {
  692. rs := &SnapshotsService{s: s}
  693. return rs
  694. }
  695. type SnapshotsService struct {
  696. s *Service
  697. }
  698. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  699. rs := &SslCertificatesService{s: s}
  700. return rs
  701. }
  702. type SslCertificatesService struct {
  703. s *Service
  704. }
  705. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  706. rs := &SslPoliciesService{s: s}
  707. return rs
  708. }
  709. type SslPoliciesService struct {
  710. s *Service
  711. }
  712. func NewSubnetworksService(s *Service) *SubnetworksService {
  713. rs := &SubnetworksService{s: s}
  714. return rs
  715. }
  716. type SubnetworksService struct {
  717. s *Service
  718. }
  719. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  720. rs := &TargetHttpProxiesService{s: s}
  721. return rs
  722. }
  723. type TargetHttpProxiesService struct {
  724. s *Service
  725. }
  726. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  727. rs := &TargetHttpsProxiesService{s: s}
  728. return rs
  729. }
  730. type TargetHttpsProxiesService struct {
  731. s *Service
  732. }
  733. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  734. rs := &TargetInstancesService{s: s}
  735. return rs
  736. }
  737. type TargetInstancesService struct {
  738. s *Service
  739. }
  740. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  741. rs := &TargetPoolsService{s: s}
  742. return rs
  743. }
  744. type TargetPoolsService struct {
  745. s *Service
  746. }
  747. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  748. rs := &TargetSslProxiesService{s: s}
  749. return rs
  750. }
  751. type TargetSslProxiesService struct {
  752. s *Service
  753. }
  754. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  755. rs := &TargetTcpProxiesService{s: s}
  756. return rs
  757. }
  758. type TargetTcpProxiesService struct {
  759. s *Service
  760. }
  761. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  762. rs := &TargetVpnGatewaysService{s: s}
  763. return rs
  764. }
  765. type TargetVpnGatewaysService struct {
  766. s *Service
  767. }
  768. func NewUrlMapsService(s *Service) *UrlMapsService {
  769. rs := &UrlMapsService{s: s}
  770. return rs
  771. }
  772. type UrlMapsService struct {
  773. s *Service
  774. }
  775. func NewVpnGatewaysService(s *Service) *VpnGatewaysService {
  776. rs := &VpnGatewaysService{s: s}
  777. return rs
  778. }
  779. type VpnGatewaysService struct {
  780. s *Service
  781. }
  782. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  783. rs := &VpnTunnelsService{s: s}
  784. return rs
  785. }
  786. type VpnTunnelsService struct {
  787. s *Service
  788. }
  789. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  790. rs := &ZoneOperationsService{s: s}
  791. return rs
  792. }
  793. type ZoneOperationsService struct {
  794. s *Service
  795. }
  796. func NewZonesService(s *Service) *ZonesService {
  797. rs := &ZonesService{s: s}
  798. return rs
  799. }
  800. type ZonesService struct {
  801. s *Service
  802. }
  803. // AcceleratorConfig: A specification of the type and number of
  804. // accelerator cards attached to the instance.
  805. type AcceleratorConfig struct {
  806. // AcceleratorCount: The number of the guest accelerator cards exposed
  807. // to this instance.
  808. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  809. // AcceleratorType: Full or partial URL of the accelerator type resource
  810. // to attach to this instance. For example:
  811. // projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-
  812. // p100 If you are creating an instance template, specify only the
  813. // accelerator name. See GPUs on Compute Engine for a full list of
  814. // accelerator types.
  815. AcceleratorType string `json:"acceleratorType,omitempty"`
  816. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  817. // unconditionally include in API requests. By default, fields with
  818. // empty values are omitted from API requests. However, any non-pointer,
  819. // non-interface field appearing in ForceSendFields will be sent to the
  820. // server regardless of whether the field is empty or not. This may be
  821. // used to include empty fields in Patch requests.
  822. ForceSendFields []string `json:"-"`
  823. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  824. // include in API requests with the JSON null value. By default, fields
  825. // with empty values are omitted from API requests. However, any field
  826. // with an empty value appearing in NullFields will be sent to the
  827. // server as null. It is an error if a field in this list has a
  828. // non-empty value. This may be used to include null fields in Patch
  829. // requests.
  830. NullFields []string `json:"-"`
  831. }
  832. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  833. type NoMethod AcceleratorConfig
  834. raw := NoMethod(*s)
  835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  836. }
  837. // AcceleratorType: An Accelerator Type resource. (== resource_for
  838. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  839. type AcceleratorType struct {
  840. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  841. // format.
  842. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  843. // Deprecated: [Output Only] The deprecation status associated with this
  844. // accelerator type.
  845. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  846. // Description: [Output Only] An optional textual description of the
  847. // resource.
  848. Description string `json:"description,omitempty"`
  849. // Id: [Output Only] The unique identifier for the resource. This
  850. // identifier is defined by the server.
  851. Id uint64 `json:"id,omitempty,string"`
  852. // Kind: [Output Only] The type of the resource. Always
  853. // compute#acceleratorType for accelerator types.
  854. Kind string `json:"kind,omitempty"`
  855. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  856. // allowed per instance.
  857. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  858. // Name: [Output Only] Name of the resource.
  859. Name string `json:"name,omitempty"`
  860. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  861. // resource.
  862. SelfLink string `json:"selfLink,omitempty"`
  863. // SelfLinkWithId: [Output Only] Server-defined URL for this resource's
  864. // resource id.
  865. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  866. // Zone: [Output Only] The name of the zone where the accelerator type
  867. // resides, such as us-central1-a. You must specify this field as part
  868. // of the HTTP request URL. It is not settable as a field in the request
  869. // body.
  870. Zone string `json:"zone,omitempty"`
  871. // ServerResponse contains the HTTP response code and headers from the
  872. // server.
  873. googleapi.ServerResponse `json:"-"`
  874. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  875. // to unconditionally include in API requests. By default, fields with
  876. // empty values are omitted from API requests. However, any non-pointer,
  877. // non-interface field appearing in ForceSendFields will be sent to the
  878. // server regardless of whether the field is empty or not. This may be
  879. // used to include empty fields in Patch requests.
  880. ForceSendFields []string `json:"-"`
  881. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  882. // include in API requests with the JSON null value. By default, fields
  883. // with empty values are omitted from API requests. However, any field
  884. // with an empty value appearing in NullFields will be sent to the
  885. // server as null. It is an error if a field in this list has a
  886. // non-empty value. This may be used to include null fields in Patch
  887. // requests.
  888. NullFields []string `json:"-"`
  889. }
  890. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  891. type NoMethod AcceleratorType
  892. raw := NoMethod(*s)
  893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  894. }
  895. type AcceleratorTypeAggregatedList struct {
  896. // Id: [Output Only] Unique identifier for the resource; defined by the
  897. // server.
  898. Id string `json:"id,omitempty"`
  899. // Items: A list of AcceleratorTypesScopedList resources.
  900. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  901. // Kind: [Output Only] Type of resource. Always
  902. // compute#acceleratorTypeAggregatedList for aggregated lists of
  903. // accelerator types.
  904. Kind string `json:"kind,omitempty"`
  905. // NextPageToken: [Output Only] This token allows you to get the next
  906. // page of results for list requests. If the number of results is larger
  907. // than maxResults, use the nextPageToken as a value for the query
  908. // parameter pageToken in the next list request. Subsequent list
  909. // requests will have their own nextPageToken to continue paging through
  910. // the results.
  911. NextPageToken string `json:"nextPageToken,omitempty"`
  912. // SelfLink: [Output Only] Server-defined URL for this resource.
  913. SelfLink string `json:"selfLink,omitempty"`
  914. // Warning: [Output Only] Informational warning message.
  915. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  916. // ServerResponse contains the HTTP response code and headers from the
  917. // server.
  918. googleapi.ServerResponse `json:"-"`
  919. // ForceSendFields is a list of field names (e.g. "Id") to
  920. // unconditionally include in API requests. By default, fields with
  921. // empty values are omitted from API requests. However, any non-pointer,
  922. // non-interface field appearing in ForceSendFields will be sent to the
  923. // server regardless of whether the field is empty or not. This may be
  924. // used to include empty fields in Patch requests.
  925. ForceSendFields []string `json:"-"`
  926. // NullFields is a list of field names (e.g. "Id") to include in API
  927. // requests with the JSON null value. By default, fields with empty
  928. // values are omitted from API requests. However, any field with an
  929. // empty value appearing in NullFields will be sent to the server as
  930. // null. It is an error if a field in this list has a non-empty value.
  931. // This may be used to include null fields in Patch requests.
  932. NullFields []string `json:"-"`
  933. }
  934. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  935. type NoMethod AcceleratorTypeAggregatedList
  936. raw := NoMethod(*s)
  937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  938. }
  939. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  940. // warning message.
  941. type AcceleratorTypeAggregatedListWarning struct {
  942. // Code: [Output Only] A warning code, if applicable. For example,
  943. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  944. // the response.
  945. //
  946. // Possible values:
  947. // "CLEANUP_FAILED"
  948. // "DEPRECATED_RESOURCE_USED"
  949. // "DEPRECATED_TYPE_USED"
  950. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  951. // "EXPERIMENTAL_TYPE_USED"
  952. // "EXTERNAL_API_WARNING"
  953. // "FIELD_VALUE_OVERRIDEN"
  954. // "INJECTED_KERNELS_DEPRECATED"
  955. // "MISSING_TYPE_DEPENDENCY"
  956. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  957. // "NEXT_HOP_CANNOT_IP_FORWARD"
  958. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  959. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  960. // "NEXT_HOP_NOT_RUNNING"
  961. // "NOT_CRITICAL_ERROR"
  962. // "NO_RESULTS_ON_PAGE"
  963. // "REQUIRED_TOS_AGREEMENT"
  964. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  965. // "RESOURCE_NOT_DELETED"
  966. // "SCHEMA_VALIDATION_IGNORED"
  967. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  968. // "UNDECLARED_PROPERTIES"
  969. // "UNREACHABLE"
  970. Code string `json:"code,omitempty"`
  971. // Data: [Output Only] Metadata about this warning in key: value format.
  972. // For example:
  973. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  974. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  975. // Message: [Output Only] A human-readable description of the warning
  976. // code.
  977. Message string `json:"message,omitempty"`
  978. // ForceSendFields is a list of field names (e.g. "Code") to
  979. // unconditionally include in API requests. By default, fields with
  980. // empty values are omitted from API requests. However, any non-pointer,
  981. // non-interface field appearing in ForceSendFields will be sent to the
  982. // server regardless of whether the field is empty or not. This may be
  983. // used to include empty fields in Patch requests.
  984. ForceSendFields []string `json:"-"`
  985. // NullFields is a list of field names (e.g. "Code") to include in API
  986. // requests with the JSON null value. By default, fields with empty
  987. // values are omitted from API requests. However, any field with an
  988. // empty value appearing in NullFields will be sent to the server as
  989. // null. It is an error if a field in this list has a non-empty value.
  990. // This may be used to include null fields in Patch requests.
  991. NullFields []string `json:"-"`
  992. }
  993. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  994. type NoMethod AcceleratorTypeAggregatedListWarning
  995. raw := NoMethod(*s)
  996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  997. }
  998. type AcceleratorTypeAggregatedListWarningData struct {
  999. // Key: [Output Only] A key that provides more detail on the warning
  1000. // being returned. For example, for warnings where there are no results
  1001. // in a list request for a particular zone, this key might be scope and
  1002. // the key value might be the zone name. Other examples might be a key
  1003. // indicating a deprecated resource and a suggested replacement, or a
  1004. // warning about invalid network settings (for example, if an instance
  1005. // attempts to perform IP forwarding but is not enabled for IP
  1006. // forwarding).
  1007. Key string `json:"key,omitempty"`
  1008. // Value: [Output Only] A warning data value corresponding to the key.
  1009. Value string `json:"value,omitempty"`
  1010. // ForceSendFields is a list of field names (e.g. "Key") to
  1011. // unconditionally include in API requests. By default, fields with
  1012. // empty values are omitted from API requests. However, any non-pointer,
  1013. // non-interface field appearing in ForceSendFields will be sent to the
  1014. // server regardless of whether the field is empty or not. This may be
  1015. // used to include empty fields in Patch requests.
  1016. ForceSendFields []string `json:"-"`
  1017. // NullFields is a list of field names (e.g. "Key") to include in API
  1018. // requests with the JSON null value. By default, fields with empty
  1019. // values are omitted from API requests. However, any field with an
  1020. // empty value appearing in NullFields will be sent to the server as
  1021. // null. It is an error if a field in this list has a non-empty value.
  1022. // This may be used to include null fields in Patch requests.
  1023. NullFields []string `json:"-"`
  1024. }
  1025. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1026. type NoMethod AcceleratorTypeAggregatedListWarningData
  1027. raw := NoMethod(*s)
  1028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1029. }
  1030. // AcceleratorTypeList: Contains a list of accelerator types.
  1031. type AcceleratorTypeList struct {
  1032. // Id: [Output Only] Unique identifier for the resource; defined by the
  1033. // server.
  1034. Id string `json:"id,omitempty"`
  1035. // Items: A list of AcceleratorType resources.
  1036. Items []*AcceleratorType `json:"items,omitempty"`
  1037. // Kind: [Output Only] Type of resource. Always
  1038. // compute#acceleratorTypeList for lists of accelerator types.
  1039. Kind string `json:"kind,omitempty"`
  1040. // NextPageToken: [Output Only] This token allows you to get the next
  1041. // page of results for list requests. If the number of results is larger
  1042. // than maxResults, use the nextPageToken as a value for the query
  1043. // parameter pageToken in the next list request. Subsequent list
  1044. // requests will have their own nextPageToken to continue paging through
  1045. // the results.
  1046. NextPageToken string `json:"nextPageToken,omitempty"`
  1047. // SelfLink: [Output Only] Server-defined URL for this resource.
  1048. SelfLink string `json:"selfLink,omitempty"`
  1049. // Warning: [Output Only] Informational warning message.
  1050. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  1051. // ServerResponse contains the HTTP response code and headers from the
  1052. // server.
  1053. googleapi.ServerResponse `json:"-"`
  1054. // ForceSendFields is a list of field names (e.g. "Id") to
  1055. // unconditionally include in API requests. By default, fields with
  1056. // empty values are omitted from API requests. However, any non-pointer,
  1057. // non-interface field appearing in ForceSendFields will be sent to the
  1058. // server regardless of whether the field is empty or not. This may be
  1059. // used to include empty fields in Patch requests.
  1060. ForceSendFields []string `json:"-"`
  1061. // NullFields is a list of field names (e.g. "Id") to include in API
  1062. // requests with the JSON null value. By default, fields with empty
  1063. // values are omitted from API requests. However, any field with an
  1064. // empty value appearing in NullFields will be sent to the server as
  1065. // null. It is an error if a field in this list has a non-empty value.
  1066. // This may be used to include null fields in Patch requests.
  1067. NullFields []string `json:"-"`
  1068. }
  1069. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  1070. type NoMethod AcceleratorTypeList
  1071. raw := NoMethod(*s)
  1072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1073. }
  1074. // AcceleratorTypeListWarning: [Output Only] Informational warning
  1075. // message.
  1076. type AcceleratorTypeListWarning struct {
  1077. // Code: [Output Only] A warning code, if applicable. For example,
  1078. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1079. // the response.
  1080. //
  1081. // Possible values:
  1082. // "CLEANUP_FAILED"
  1083. // "DEPRECATED_RESOURCE_USED"
  1084. // "DEPRECATED_TYPE_USED"
  1085. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1086. // "EXPERIMENTAL_TYPE_USED"
  1087. // "EXTERNAL_API_WARNING"
  1088. // "FIELD_VALUE_OVERRIDEN"
  1089. // "INJECTED_KERNELS_DEPRECATED"
  1090. // "MISSING_TYPE_DEPENDENCY"
  1091. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1092. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1093. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1094. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1095. // "NEXT_HOP_NOT_RUNNING"
  1096. // "NOT_CRITICAL_ERROR"
  1097. // "NO_RESULTS_ON_PAGE"
  1098. // "REQUIRED_TOS_AGREEMENT"
  1099. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1100. // "RESOURCE_NOT_DELETED"
  1101. // "SCHEMA_VALIDATION_IGNORED"
  1102. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1103. // "UNDECLARED_PROPERTIES"
  1104. // "UNREACHABLE"
  1105. Code string `json:"code,omitempty"`
  1106. // Data: [Output Only] Metadata about this warning in key: value format.
  1107. // For example:
  1108. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1109. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  1110. // Message: [Output Only] A human-readable description of the warning
  1111. // code.
  1112. Message string `json:"message,omitempty"`
  1113. // ForceSendFields is a list of field names (e.g. "Code") to
  1114. // unconditionally include in API requests. By default, fields with
  1115. // empty values are omitted from API requests. However, any non-pointer,
  1116. // non-interface field appearing in ForceSendFields will be sent to the
  1117. // server regardless of whether the field is empty or not. This may be
  1118. // used to include empty fields in Patch requests.
  1119. ForceSendFields []string `json:"-"`
  1120. // NullFields is a list of field names (e.g. "Code") to include in API
  1121. // requests with the JSON null value. By default, fields with empty
  1122. // values are omitted from API requests. However, any field with an
  1123. // empty value appearing in NullFields will be sent to the server as
  1124. // null. It is an error if a field in this list has a non-empty value.
  1125. // This may be used to include null fields in Patch requests.
  1126. NullFields []string `json:"-"`
  1127. }
  1128. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  1129. type NoMethod AcceleratorTypeListWarning
  1130. raw := NoMethod(*s)
  1131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1132. }
  1133. type AcceleratorTypeListWarningData struct {
  1134. // Key: [Output Only] A key that provides more detail on the warning
  1135. // being returned. For example, for warnings where there are no results
  1136. // in a list request for a particular zone, this key might be scope and
  1137. // the key value might be the zone name. Other examples might be a key
  1138. // indicating a deprecated resource and a suggested replacement, or a
  1139. // warning about invalid network settings (for example, if an instance
  1140. // attempts to perform IP forwarding but is not enabled for IP
  1141. // forwarding).
  1142. Key string `json:"key,omitempty"`
  1143. // Value: [Output Only] A warning data value corresponding to the key.
  1144. Value string `json:"value,omitempty"`
  1145. // ForceSendFields is a list of field names (e.g. "Key") to
  1146. // unconditionally include in API requests. By default, fields with
  1147. // empty values are omitted from API requests. However, any non-pointer,
  1148. // non-interface field appearing in ForceSendFields will be sent to the
  1149. // server regardless of whether the field is empty or not. This may be
  1150. // used to include empty fields in Patch requests.
  1151. ForceSendFields []string `json:"-"`
  1152. // NullFields is a list of field names (e.g. "Key") to include in API
  1153. // requests with the JSON null value. By default, fields with empty
  1154. // values are omitted from API requests. However, any field with an
  1155. // empty value appearing in NullFields will be sent to the server as
  1156. // null. It is an error if a field in this list has a non-empty value.
  1157. // This may be used to include null fields in Patch requests.
  1158. NullFields []string `json:"-"`
  1159. }
  1160. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  1161. type NoMethod AcceleratorTypeListWarningData
  1162. raw := NoMethod(*s)
  1163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1164. }
  1165. type AcceleratorTypesScopedList struct {
  1166. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  1167. // in this scope.
  1168. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  1169. // Warning: [Output Only] An informational warning that appears when the
  1170. // accelerator types list is empty.
  1171. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  1172. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  1173. // unconditionally include in API requests. By default, fields with
  1174. // empty values are omitted from API requests. However, any non-pointer,
  1175. // non-interface field appearing in ForceSendFields will be sent to the
  1176. // server regardless of whether the field is empty or not. This may be
  1177. // used to include empty fields in Patch requests.
  1178. ForceSendFields []string `json:"-"`
  1179. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  1180. // include in API requests with the JSON null value. By default, fields
  1181. // with empty values are omitted from API requests. However, any field
  1182. // with an empty value appearing in NullFields will be sent to the
  1183. // server as null. It is an error if a field in this list has a
  1184. // non-empty value. This may be used to include null fields in Patch
  1185. // requests.
  1186. NullFields []string `json:"-"`
  1187. }
  1188. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  1189. type NoMethod AcceleratorTypesScopedList
  1190. raw := NoMethod(*s)
  1191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1192. }
  1193. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  1194. // warning that appears when the accelerator types list is empty.
  1195. type AcceleratorTypesScopedListWarning struct {
  1196. // Code: [Output Only] A warning code, if applicable. For example,
  1197. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1198. // the response.
  1199. //
  1200. // Possible values:
  1201. // "CLEANUP_FAILED"
  1202. // "DEPRECATED_RESOURCE_USED"
  1203. // "DEPRECATED_TYPE_USED"
  1204. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1205. // "EXPERIMENTAL_TYPE_USED"
  1206. // "EXTERNAL_API_WARNING"
  1207. // "FIELD_VALUE_OVERRIDEN"
  1208. // "INJECTED_KERNELS_DEPRECATED"
  1209. // "MISSING_TYPE_DEPENDENCY"
  1210. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1211. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1212. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1213. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1214. // "NEXT_HOP_NOT_RUNNING"
  1215. // "NOT_CRITICAL_ERROR"
  1216. // "NO_RESULTS_ON_PAGE"
  1217. // "REQUIRED_TOS_AGREEMENT"
  1218. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1219. // "RESOURCE_NOT_DELETED"
  1220. // "SCHEMA_VALIDATION_IGNORED"
  1221. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1222. // "UNDECLARED_PROPERTIES"
  1223. // "UNREACHABLE"
  1224. Code string `json:"code,omitempty"`
  1225. // Data: [Output Only] Metadata about this warning in key: value format.
  1226. // For example:
  1227. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1228. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  1229. // Message: [Output Only] A human-readable description of the warning
  1230. // code.
  1231. Message string `json:"message,omitempty"`
  1232. // ForceSendFields is a list of field names (e.g. "Code") to
  1233. // unconditionally include in API requests. By default, fields with
  1234. // empty values are omitted from API requests. However, any non-pointer,
  1235. // non-interface field appearing in ForceSendFields will be sent to the
  1236. // server regardless of whether the field is empty or not. This may be
  1237. // used to include empty fields in Patch requests.
  1238. ForceSendFields []string `json:"-"`
  1239. // NullFields is a list of field names (e.g. "Code") to include in API
  1240. // requests with the JSON null value. By default, fields with empty
  1241. // values are omitted from API requests. However, any field with an
  1242. // empty value appearing in NullFields will be sent to the server as
  1243. // null. It is an error if a field in this list has a non-empty value.
  1244. // This may be used to include null fields in Patch requests.
  1245. NullFields []string `json:"-"`
  1246. }
  1247. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1248. type NoMethod AcceleratorTypesScopedListWarning
  1249. raw := NoMethod(*s)
  1250. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1251. }
  1252. type AcceleratorTypesScopedListWarningData struct {
  1253. // Key: [Output Only] A key that provides more detail on the warning
  1254. // being returned. For example, for warnings where there are no results
  1255. // in a list request for a particular zone, this key might be scope and
  1256. // the key value might be the zone name. Other examples might be a key
  1257. // indicating a deprecated resource and a suggested replacement, or a
  1258. // warning about invalid network settings (for example, if an instance
  1259. // attempts to perform IP forwarding but is not enabled for IP
  1260. // forwarding).
  1261. Key string `json:"key,omitempty"`
  1262. // Value: [Output Only] A warning data value corresponding to the key.
  1263. Value string `json:"value,omitempty"`
  1264. // ForceSendFields is a list of field names (e.g. "Key") to
  1265. // unconditionally include in API requests. By default, fields with
  1266. // empty values are omitted from API requests. However, any non-pointer,
  1267. // non-interface field appearing in ForceSendFields will be sent to the
  1268. // server regardless of whether the field is empty or not. This may be
  1269. // used to include empty fields in Patch requests.
  1270. ForceSendFields []string `json:"-"`
  1271. // NullFields is a list of field names (e.g. "Key") to include in API
  1272. // requests with the JSON null value. By default, fields with empty
  1273. // values are omitted from API requests. However, any field with an
  1274. // empty value appearing in NullFields will be sent to the server as
  1275. // null. It is an error if a field in this list has a non-empty value.
  1276. // This may be used to include null fields in Patch requests.
  1277. NullFields []string `json:"-"`
  1278. }
  1279. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1280. type NoMethod AcceleratorTypesScopedListWarningData
  1281. raw := NoMethod(*s)
  1282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1283. }
  1284. // AccessConfig: An access configuration attached to an instance's
  1285. // network interface. Only one access config per instance is supported.
  1286. type AccessConfig struct {
  1287. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1288. // for access configs.
  1289. Kind string `json:"kind,omitempty"`
  1290. // Name: The name of this access configuration. The default and
  1291. // recommended name is External NAT but you can use any arbitrary string
  1292. // you would like. For example, My external IP or Network Access.
  1293. Name string `json:"name,omitempty"`
  1294. // NatIP: An external IP address associated with this instance. Specify
  1295. // an unused static external IP address available to the project or
  1296. // leave this field undefined to use an IP from a shared ephemeral IP
  1297. // address pool. If you specify a static external IP address, it must
  1298. // live in the same region as the zone of the instance.
  1299. NatIP string `json:"natIP,omitempty"`
  1300. // NetworkTier: This signifies the networking tier used for configuring
  1301. // this access configuration and can only take the following values:
  1302. // PREMIUM, STANDARD.
  1303. //
  1304. // If an AccessConfig is specified without a valid external IP address,
  1305. // an ephemeral IP will be created with this networkTier.
  1306. //
  1307. // If an AccessConfig with a valid external IP address is specified, it
  1308. // must match that of the networkTier associated with the Address
  1309. // resource owning that IP.
  1310. //
  1311. // Possible values:
  1312. // "PREMIUM"
  1313. // "SELECT"
  1314. // "STANDARD"
  1315. NetworkTier string `json:"networkTier,omitempty"`
  1316. // PublicDnsName: [Output Only] The public DNS domain name for the
  1317. // instance.
  1318. PublicDnsName string `json:"publicDnsName,omitempty"`
  1319. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1320. // This field can only be set when the set_public_ptr field is enabled.
  1321. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1322. // SetPublicDns: Specifies whether a public DNS ?A? record should be
  1323. // created for the external IP address of this access configuration.
  1324. SetPublicDns bool `json:"setPublicDns,omitempty"`
  1325. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1326. // created to map the external IP address of the instance to a DNS
  1327. // domain name.
  1328. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1329. // Type: The type of configuration. The default and only option is
  1330. // ONE_TO_ONE_NAT.
  1331. //
  1332. // Possible values:
  1333. // "ONE_TO_ONE_NAT" (default)
  1334. Type string `json:"type,omitempty"`
  1335. // ForceSendFields is a list of field names (e.g. "Kind") to
  1336. // unconditionally include in API requests. By default, fields with
  1337. // empty values are omitted from API requests. However, any non-pointer,
  1338. // non-interface field appearing in ForceSendFields will be sent to the
  1339. // server regardless of whether the field is empty or not. This may be
  1340. // used to include empty fields in Patch requests.
  1341. ForceSendFields []string `json:"-"`
  1342. // NullFields is a list of field names (e.g. "Kind") to include in API
  1343. // requests with the JSON null value. By default, fields with empty
  1344. // values are omitted from API requests. However, any field with an
  1345. // empty value appearing in NullFields will be sent to the server as
  1346. // null. It is an error if a field in this list has a non-empty value.
  1347. // This may be used to include null fields in Patch requests.
  1348. NullFields []string `json:"-"`
  1349. }
  1350. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1351. type NoMethod AccessConfig
  1352. raw := NoMethod(*s)
  1353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1354. }
  1355. // Address: A reserved address resource. (== resource_for beta.addresses
  1356. // ==) (== resource_for v1.addresses ==) (== resource_for
  1357. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1358. type Address struct {
  1359. // Address: The static IP address represented by this resource.
  1360. Address string `json:"address,omitempty"`
  1361. // AddressType: The type of address to reserve, either INTERNAL or
  1362. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1363. //
  1364. // Possible values:
  1365. // "DNS_FORWARDING"
  1366. // "EXTERNAL"
  1367. // "INTERNAL"
  1368. // "UNSPECIFIED_TYPE"
  1369. AddressType string `json:"addressType,omitempty"`
  1370. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1371. // format.
  1372. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1373. // Description: An optional description of this resource. Provide this
  1374. // property when you create the resource.
  1375. Description string `json:"description,omitempty"`
  1376. // Id: [Output Only] The unique identifier for the resource. This
  1377. // identifier is defined by the server.
  1378. Id uint64 `json:"id,omitempty,string"`
  1379. // IpVersion: The IP Version that will be used by this address. Valid
  1380. // options are IPV4 or IPV6. This can only be specified for a global
  1381. // address.
  1382. //
  1383. // Possible values:
  1384. // "IPV4"
  1385. // "IPV6"
  1386. // "UNSPECIFIED_VERSION"
  1387. IpVersion string `json:"ipVersion,omitempty"`
  1388. // Kind: [Output Only] Type of the resource. Always compute#address for
  1389. // addresses.
  1390. Kind string `json:"kind,omitempty"`
  1391. // LabelFingerprint: A fingerprint for the labels being applied to this
  1392. // Address, which is essentially a hash of the labels set used for
  1393. // optimistic locking. The fingerprint is initially generated by Compute
  1394. // Engine and changes after every request to modify or update labels.
  1395. // You must always provide an up-to-date fingerprint hash in order to
  1396. // update or change labels, otherwise the request will fail with error
  1397. // 412 conditionNotMet.
  1398. //
  1399. // To see the latest fingerprint, make a get() request to retrieve an
  1400. // Address.
  1401. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  1402. // Labels: Labels to apply to this Address resource. These can be later
  1403. // modified by the setLabels method. Each label key/value must comply
  1404. // with RFC1035. Label values may be empty.
  1405. Labels map[string]string `json:"labels,omitempty"`
  1406. // Name: Name of the resource. Provided by the client when the resource
  1407. // is created. The name must be 1-63 characters long, and comply with
  1408. // RFC1035. Specifically, the name must be 1-63 characters long and
  1409. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1410. // the first character must be a lowercase letter, and all following
  1411. // characters must be a dash, lowercase letter, or digit, except the
  1412. // last character, which cannot be a dash.
  1413. Name string `json:"name,omitempty"`
  1414. // Network: The URL of the network in which to reserve the address. This
  1415. // field can only be used with INTERNAL type with VPC_PEERING purpose.
  1416. Network string `json:"network,omitempty"`
  1417. // NetworkTier: This signifies the networking tier used for configuring
  1418. // this Address and can only take the following values: PREMIUM,
  1419. // STANDARD. Global forwarding rules can only be Premium Tier. Regional
  1420. // forwarding rules can be either Premium or Standard Tier. Standard
  1421. // Tier addresses applied to regional forwarding rules can be used with
  1422. // any external load balancer. Regional forwarding rules in Premium Tier
  1423. // can only be used with a Network load balancer.
  1424. //
  1425. // If this field is not specified, it is assumed to be PREMIUM.
  1426. //
  1427. // Possible values:
  1428. // "PREMIUM"
  1429. // "SELECT"
  1430. // "STANDARD"
  1431. NetworkTier string `json:"networkTier,omitempty"`
  1432. // PrefixLength: The prefix length if the resource reprensents an IP
  1433. // range.
  1434. PrefixLength int64 `json:"prefixLength,omitempty"`
  1435. // Purpose: The purpose of resource, only used with INTERNAL type.
  1436. //
  1437. // Possible values:
  1438. // "DNS_RESOLVER"
  1439. // "GCE_ENDPOINT"
  1440. // "NAT_AUTO"
  1441. // "VPC_PEERING"
  1442. Purpose string `json:"purpose,omitempty"`
  1443. // Region: [Output Only] URL of the region where the regional address
  1444. // resides. This field is not applicable to global addresses. You must
  1445. // specify this field as part of the HTTP request URL. You cannot set
  1446. // this field in the request body.
  1447. Region string `json:"region,omitempty"`
  1448. // SelfLink: [Output Only] Server-defined URL for the resource.
  1449. SelfLink string `json:"selfLink,omitempty"`
  1450. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  1451. // with the resource id.
  1452. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  1453. // Status: [Output Only] The status of the address, which can be one of
  1454. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1455. // currently in the process of being reserved. A RESERVED address is
  1456. // currently reserved and available to use. An IN_USE address is
  1457. // currently being used by another resource and is not available.
  1458. //
  1459. // Possible values:
  1460. // "IN_USE"
  1461. // "RESERVED"
  1462. // "RESERVING"
  1463. Status string `json:"status,omitempty"`
  1464. // Subnetwork: The URL of the subnetwork in which to reserve the
  1465. // address. If an IP address is specified, it must be within the
  1466. // subnetwork's IP range. This field can only be used with INTERNAL type
  1467. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1468. Subnetwork string `json:"subnetwork,omitempty"`
  1469. // Users: [Output Only] The URLs of the resources that are using this
  1470. // address.
  1471. Users []string `json:"users,omitempty"`
  1472. // ServerResponse contains the HTTP response code and headers from the
  1473. // server.
  1474. googleapi.ServerResponse `json:"-"`
  1475. // ForceSendFields is a list of field names (e.g. "Address") to
  1476. // unconditionally include in API requests. By default, fields with
  1477. // empty values are omitted from API requests. However, any non-pointer,
  1478. // non-interface field appearing in ForceSendFields will be sent to the
  1479. // server regardless of whether the field is empty or not. This may be
  1480. // used to include empty fields in Patch requests.
  1481. ForceSendFields []string `json:"-"`
  1482. // NullFields is a list of field names (e.g. "Address") to include in
  1483. // API requests with the JSON null value. By default, fields with empty
  1484. // values are omitted from API requests. However, any field with an
  1485. // empty value appearing in NullFields will be sent to the server as
  1486. // null. It is an error if a field in this list has a non-empty value.
  1487. // This may be used to include null fields in Patch requests.
  1488. NullFields []string `json:"-"`
  1489. }
  1490. func (s *Address) MarshalJSON() ([]byte, error) {
  1491. type NoMethod Address
  1492. raw := NoMethod(*s)
  1493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1494. }
  1495. type AddressAggregatedList struct {
  1496. // Id: [Output Only] Unique identifier for the resource; defined by the
  1497. // server.
  1498. Id string `json:"id,omitempty"`
  1499. // Items: A list of AddressesScopedList resources.
  1500. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1501. // Kind: [Output Only] Type of resource. Always
  1502. // compute#addressAggregatedList for aggregated lists of addresses.
  1503. Kind string `json:"kind,omitempty"`
  1504. // NextPageToken: [Output Only] This token allows you to get the next
  1505. // page of results for list requests. If the number of results is larger
  1506. // than maxResults, use the nextPageToken as a value for the query
  1507. // parameter pageToken in the next list request. Subsequent list
  1508. // requests will have their own nextPageToken to continue paging through
  1509. // the results.
  1510. NextPageToken string `json:"nextPageToken,omitempty"`
  1511. // SelfLink: [Output Only] Server-defined URL for this resource.
  1512. SelfLink string `json:"selfLink,omitempty"`
  1513. // Warning: [Output Only] Informational warning message.
  1514. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1515. // ServerResponse contains the HTTP response code and headers from the
  1516. // server.
  1517. googleapi.ServerResponse `json:"-"`
  1518. // ForceSendFields is a list of field names (e.g. "Id") to
  1519. // unconditionally include in API requests. By default, fields with
  1520. // empty values are omitted from API requests. However, any non-pointer,
  1521. // non-interface field appearing in ForceSendFields will be sent to the
  1522. // server regardless of whether the field is empty or not. This may be
  1523. // used to include empty fields in Patch requests.
  1524. ForceSendFields []string `json:"-"`
  1525. // NullFields is a list of field names (e.g. "Id") to include in API
  1526. // requests with the JSON null value. By default, fields with empty
  1527. // values are omitted from API requests. However, any field with an
  1528. // empty value appearing in NullFields will be sent to the server as
  1529. // null. It is an error if a field in this list has a non-empty value.
  1530. // This may be used to include null fields in Patch requests.
  1531. NullFields []string `json:"-"`
  1532. }
  1533. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1534. type NoMethod AddressAggregatedList
  1535. raw := NoMethod(*s)
  1536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1537. }
  1538. // AddressAggregatedListWarning: [Output Only] Informational warning
  1539. // message.
  1540. type AddressAggregatedListWarning struct {
  1541. // Code: [Output Only] A warning code, if applicable. For example,
  1542. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1543. // the response.
  1544. //
  1545. // Possible values:
  1546. // "CLEANUP_FAILED"
  1547. // "DEPRECATED_RESOURCE_USED"
  1548. // "DEPRECATED_TYPE_USED"
  1549. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1550. // "EXPERIMENTAL_TYPE_USED"
  1551. // "EXTERNAL_API_WARNING"
  1552. // "FIELD_VALUE_OVERRIDEN"
  1553. // "INJECTED_KERNELS_DEPRECATED"
  1554. // "MISSING_TYPE_DEPENDENCY"
  1555. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1556. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1557. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1558. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1559. // "NEXT_HOP_NOT_RUNNING"
  1560. // "NOT_CRITICAL_ERROR"
  1561. // "NO_RESULTS_ON_PAGE"
  1562. // "REQUIRED_TOS_AGREEMENT"
  1563. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1564. // "RESOURCE_NOT_DELETED"
  1565. // "SCHEMA_VALIDATION_IGNORED"
  1566. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1567. // "UNDECLARED_PROPERTIES"
  1568. // "UNREACHABLE"
  1569. Code string `json:"code,omitempty"`
  1570. // Data: [Output Only] Metadata about this warning in key: value format.
  1571. // For example:
  1572. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1573. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1574. // Message: [Output Only] A human-readable description of the warning
  1575. // code.
  1576. Message string `json:"message,omitempty"`
  1577. // ForceSendFields is a list of field names (e.g. "Code") to
  1578. // unconditionally include in API requests. By default, fields with
  1579. // empty values are omitted from API requests. However, any non-pointer,
  1580. // non-interface field appearing in ForceSendFields will be sent to the
  1581. // server regardless of whether the field is empty or not. This may be
  1582. // used to include empty fields in Patch requests.
  1583. ForceSendFields []string `json:"-"`
  1584. // NullFields is a list of field names (e.g. "Code") to include in API
  1585. // requests with the JSON null value. By default, fields with empty
  1586. // values are omitted from API requests. However, any field with an
  1587. // empty value appearing in NullFields will be sent to the server as
  1588. // null. It is an error if a field in this list has a non-empty value.
  1589. // This may be used to include null fields in Patch requests.
  1590. NullFields []string `json:"-"`
  1591. }
  1592. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1593. type NoMethod AddressAggregatedListWarning
  1594. raw := NoMethod(*s)
  1595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1596. }
  1597. type AddressAggregatedListWarningData struct {
  1598. // Key: [Output Only] A key that provides more detail on the warning
  1599. // being returned. For example, for warnings where there are no results
  1600. // in a list request for a particular zone, this key might be scope and
  1601. // the key value might be the zone name. Other examples might be a key
  1602. // indicating a deprecated resource and a suggested replacement, or a
  1603. // warning about invalid network settings (for example, if an instance
  1604. // attempts to perform IP forwarding but is not enabled for IP
  1605. // forwarding).
  1606. Key string `json:"key,omitempty"`
  1607. // Value: [Output Only] A warning data value corresponding to the key.
  1608. Value string `json:"value,omitempty"`
  1609. // ForceSendFields is a list of field names (e.g. "Key") to
  1610. // unconditionally include in API requests. By default, fields with
  1611. // empty values are omitted from API requests. However, any non-pointer,
  1612. // non-interface field appearing in ForceSendFields will be sent to the
  1613. // server regardless of whether the field is empty or not. This may be
  1614. // used to include empty fields in Patch requests.
  1615. ForceSendFields []string `json:"-"`
  1616. // NullFields is a list of field names (e.g. "Key") to include in API
  1617. // requests with the JSON null value. By default, fields with empty
  1618. // values are omitted from API requests. However, any field with an
  1619. // empty value appearing in NullFields will be sent to the server as
  1620. // null. It is an error if a field in this list has a non-empty value.
  1621. // This may be used to include null fields in Patch requests.
  1622. NullFields []string `json:"-"`
  1623. }
  1624. func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1625. type NoMethod AddressAggregatedListWarningData
  1626. raw := NoMethod(*s)
  1627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1628. }
  1629. // AddressList: Contains a list of addresses.
  1630. type AddressList struct {
  1631. // Id: [Output Only] Unique identifier for the resource; defined by the
  1632. // server.
  1633. Id string `json:"id,omitempty"`
  1634. // Items: A list of Address resources.
  1635. Items []*Address `json:"items,omitempty"`
  1636. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1637. // lists of addresses.
  1638. Kind string `json:"kind,omitempty"`
  1639. // NextPageToken: [Output Only] This token allows you to get the next
  1640. // page of results for list requests. If the number of results is larger
  1641. // than maxResults, use the nextPageToken as a value for the query
  1642. // parameter pageToken in the next list request. Subsequent list
  1643. // requests will have their own nextPageToken to continue paging through
  1644. // the results.
  1645. NextPageToken string `json:"nextPageToken,omitempty"`
  1646. // SelfLink: [Output Only] Server-defined URL for this resource.
  1647. SelfLink string `json:"selfLink,omitempty"`
  1648. // Warning: [Output Only] Informational warning message.
  1649. Warning *AddressListWarning `json:"warning,omitempty"`
  1650. // ServerResponse contains the HTTP response code and headers from the
  1651. // server.
  1652. googleapi.ServerResponse `json:"-"`
  1653. // ForceSendFields is a list of field names (e.g. "Id") to
  1654. // unconditionally include in API requests. By default, fields with
  1655. // empty values are omitted from API requests. However, any non-pointer,
  1656. // non-interface field appearing in ForceSendFields will be sent to the
  1657. // server regardless of whether the field is empty or not. This may be
  1658. // used to include empty fields in Patch requests.
  1659. ForceSendFields []string `json:"-"`
  1660. // NullFields is a list of field names (e.g. "Id") to include in API
  1661. // requests with the JSON null value. By default, fields with empty
  1662. // values are omitted from API requests. However, any field with an
  1663. // empty value appearing in NullFields will be sent to the server as
  1664. // null. It is an error if a field in this list has a non-empty value.
  1665. // This may be used to include null fields in Patch requests.
  1666. NullFields []string `json:"-"`
  1667. }
  1668. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1669. type NoMethod AddressList
  1670. raw := NoMethod(*s)
  1671. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1672. }
  1673. // AddressListWarning: [Output Only] Informational warning message.
  1674. type AddressListWarning struct {
  1675. // Code: [Output Only] A warning code, if applicable. For example,
  1676. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1677. // the response.
  1678. //
  1679. // Possible values:
  1680. // "CLEANUP_FAILED"
  1681. // "DEPRECATED_RESOURCE_USED"
  1682. // "DEPRECATED_TYPE_USED"
  1683. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1684. // "EXPERIMENTAL_TYPE_USED"
  1685. // "EXTERNAL_API_WARNING"
  1686. // "FIELD_VALUE_OVERRIDEN"
  1687. // "INJECTED_KERNELS_DEPRECATED"
  1688. // "MISSING_TYPE_DEPENDENCY"
  1689. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1690. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1691. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1692. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1693. // "NEXT_HOP_NOT_RUNNING"
  1694. // "NOT_CRITICAL_ERROR"
  1695. // "NO_RESULTS_ON_PAGE"
  1696. // "REQUIRED_TOS_AGREEMENT"
  1697. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1698. // "RESOURCE_NOT_DELETED"
  1699. // "SCHEMA_VALIDATION_IGNORED"
  1700. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1701. // "UNDECLARED_PROPERTIES"
  1702. // "UNREACHABLE"
  1703. Code string `json:"code,omitempty"`
  1704. // Data: [Output Only] Metadata about this warning in key: value format.
  1705. // For example:
  1706. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1707. Data []*AddressListWarningData `json:"data,omitempty"`
  1708. // Message: [Output Only] A human-readable description of the warning
  1709. // code.
  1710. Message string `json:"message,omitempty"`
  1711. // ForceSendFields is a list of field names (e.g. "Code") to
  1712. // unconditionally include in API requests. By default, fields with
  1713. // empty values are omitted from API requests. However, any non-pointer,
  1714. // non-interface field appearing in ForceSendFields will be sent to the
  1715. // server regardless of whether the field is empty or not. This may be
  1716. // used to include empty fields in Patch requests.
  1717. ForceSendFields []string `json:"-"`
  1718. // NullFields is a list of field names (e.g. "Code") to include in API
  1719. // requests with the JSON null value. By default, fields with empty
  1720. // values are omitted from API requests. However, any field with an
  1721. // empty value appearing in NullFields will be sent to the server as
  1722. // null. It is an error if a field in this list has a non-empty value.
  1723. // This may be used to include null fields in Patch requests.
  1724. NullFields []string `json:"-"`
  1725. }
  1726. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1727. type NoMethod AddressListWarning
  1728. raw := NoMethod(*s)
  1729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1730. }
  1731. type AddressListWarningData struct {
  1732. // Key: [Output Only] A key that provides more detail on the warning
  1733. // being returned. For example, for warnings where there are no results
  1734. // in a list request for a particular zone, this key might be scope and
  1735. // the key value might be the zone name. Other examples might be a key
  1736. // indicating a deprecated resource and a suggested replacement, or a
  1737. // warning about invalid network settings (for example, if an instance
  1738. // attempts to perform IP forwarding but is not enabled for IP
  1739. // forwarding).
  1740. Key string `json:"key,omitempty"`
  1741. // Value: [Output Only] A warning data value corresponding to the key.
  1742. Value string `json:"value,omitempty"`
  1743. // ForceSendFields is a list of field names (e.g. "Key") to
  1744. // unconditionally include in API requests. By default, fields with
  1745. // empty values are omitted from API requests. However, any non-pointer,
  1746. // non-interface field appearing in ForceSendFields will be sent to the
  1747. // server regardless of whether the field is empty or not. This may be
  1748. // used to include empty fields in Patch requests.
  1749. ForceSendFields []string `json:"-"`
  1750. // NullFields is a list of field names (e.g. "Key") to include in API
  1751. // requests with the JSON null value. By default, fields with empty
  1752. // values are omitted from API requests. However, any field with an
  1753. // empty value appearing in NullFields will be sent to the server as
  1754. // null. It is an error if a field in this list has a non-empty value.
  1755. // This may be used to include null fields in Patch requests.
  1756. NullFields []string `json:"-"`
  1757. }
  1758. func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1759. type NoMethod AddressListWarningData
  1760. raw := NoMethod(*s)
  1761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1762. }
  1763. type AddressesScopedList struct {
  1764. // Addresses: [Output Only] A list of addresses contained in this scope.
  1765. Addresses []*Address `json:"addresses,omitempty"`
  1766. // Warning: [Output Only] Informational warning which replaces the list
  1767. // of addresses when the list is empty.
  1768. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1769. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1770. // unconditionally include in API requests. By default, fields with
  1771. // empty values are omitted from API requests. However, any non-pointer,
  1772. // non-interface field appearing in ForceSendFields will be sent to the
  1773. // server regardless of whether the field is empty or not. This may be
  1774. // used to include empty fields in Patch requests.
  1775. ForceSendFields []string `json:"-"`
  1776. // NullFields is a list of field names (e.g. "Addresses") to include in
  1777. // API requests with the JSON null value. By default, fields with empty
  1778. // values are omitted from API requests. However, any field with an
  1779. // empty value appearing in NullFields will be sent to the server as
  1780. // null. It is an error if a field in this list has a non-empty value.
  1781. // This may be used to include null fields in Patch requests.
  1782. NullFields []string `json:"-"`
  1783. }
  1784. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1785. type NoMethod AddressesScopedList
  1786. raw := NoMethod(*s)
  1787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1788. }
  1789. // AddressesScopedListWarning: [Output Only] Informational warning which
  1790. // replaces the list of addresses when the list is empty.
  1791. type AddressesScopedListWarning struct {
  1792. // Code: [Output Only] A warning code, if applicable. For example,
  1793. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1794. // the response.
  1795. //
  1796. // Possible values:
  1797. // "CLEANUP_FAILED"
  1798. // "DEPRECATED_RESOURCE_USED"
  1799. // "DEPRECATED_TYPE_USED"
  1800. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1801. // "EXPERIMENTAL_TYPE_USED"
  1802. // "EXTERNAL_API_WARNING"
  1803. // "FIELD_VALUE_OVERRIDEN"
  1804. // "INJECTED_KERNELS_DEPRECATED"
  1805. // "MISSING_TYPE_DEPENDENCY"
  1806. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1807. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1808. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1809. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1810. // "NEXT_HOP_NOT_RUNNING"
  1811. // "NOT_CRITICAL_ERROR"
  1812. // "NO_RESULTS_ON_PAGE"
  1813. // "REQUIRED_TOS_AGREEMENT"
  1814. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1815. // "RESOURCE_NOT_DELETED"
  1816. // "SCHEMA_VALIDATION_IGNORED"
  1817. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1818. // "UNDECLARED_PROPERTIES"
  1819. // "UNREACHABLE"
  1820. Code string `json:"code,omitempty"`
  1821. // Data: [Output Only] Metadata about this warning in key: value format.
  1822. // For example:
  1823. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1824. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1825. // Message: [Output Only] A human-readable description of the warning
  1826. // code.
  1827. Message string `json:"message,omitempty"`
  1828. // ForceSendFields is a list of field names (e.g. "Code") to
  1829. // unconditionally include in API requests. By default, fields with
  1830. // empty values are omitted from API requests. However, any non-pointer,
  1831. // non-interface field appearing in ForceSendFields will be sent to the
  1832. // server regardless of whether the field is empty or not. This may be
  1833. // used to include empty fields in Patch requests.
  1834. ForceSendFields []string `json:"-"`
  1835. // NullFields is a list of field names (e.g. "Code") to include in API
  1836. // requests with the JSON null value. By default, fields with empty
  1837. // values are omitted from API requests. However, any field with an
  1838. // empty value appearing in NullFields will be sent to the server as
  1839. // null. It is an error if a field in this list has a non-empty value.
  1840. // This may be used to include null fields in Patch requests.
  1841. NullFields []string `json:"-"`
  1842. }
  1843. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1844. type NoMethod AddressesScopedListWarning
  1845. raw := NoMethod(*s)
  1846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1847. }
  1848. type AddressesScopedListWarningData struct {
  1849. // Key: [Output Only] A key that provides more detail on the warning
  1850. // being returned. For example, for warnings where there are no results
  1851. // in a list request for a particular zone, this key might be scope and
  1852. // the key value might be the zone name. Other examples might be a key
  1853. // indicating a deprecated resource and a suggested replacement, or a
  1854. // warning about invalid network settings (for example, if an instance
  1855. // attempts to perform IP forwarding but is not enabled for IP
  1856. // forwarding).
  1857. Key string `json:"key,omitempty"`
  1858. // Value: [Output Only] A warning data value corresponding to the key.
  1859. Value string `json:"value,omitempty"`
  1860. // ForceSendFields is a list of field names (e.g. "Key") to
  1861. // unconditionally include in API requests. By default, fields with
  1862. // empty values are omitted from API requests. However, any non-pointer,
  1863. // non-interface field appearing in ForceSendFields will be sent to the
  1864. // server regardless of whether the field is empty or not. This may be
  1865. // used to include empty fields in Patch requests.
  1866. ForceSendFields []string `json:"-"`
  1867. // NullFields is a list of field names (e.g. "Key") to include in API
  1868. // requests with the JSON null value. By default, fields with empty
  1869. // values are omitted from API requests. However, any field with an
  1870. // empty value appearing in NullFields will be sent to the server as
  1871. // null. It is an error if a field in this list has a non-empty value.
  1872. // This may be used to include null fields in Patch requests.
  1873. NullFields []string `json:"-"`
  1874. }
  1875. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1876. type NoMethod AddressesScopedListWarningData
  1877. raw := NoMethod(*s)
  1878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1879. }
  1880. // AliasIpRange: An alias IP range attached to an instance's network
  1881. // interface.
  1882. type AliasIpRange struct {
  1883. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1884. // This IP CIDR range must belong to the specified subnetwork and cannot
  1885. // contain IP addresses reserved by system or used by other network
  1886. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1887. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1888. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1889. // SubnetworkRangeName: Optional subnetwork secondary range name
  1890. // specifying the secondary range from which to allocate the IP CIDR
  1891. // range for this alias IP range. If left unspecified, the primary range
  1892. // of the subnetwork will be used.
  1893. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1894. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1895. // unconditionally include in API requests. By default, fields with
  1896. // empty values are omitted from API requests. However, any non-pointer,
  1897. // non-interface field appearing in ForceSendFields will be sent to the
  1898. // server regardless of whether the field is empty or not. This may be
  1899. // used to include empty fields in Patch requests.
  1900. ForceSendFields []string `json:"-"`
  1901. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1902. // in API requests with the JSON null value. By default, fields with
  1903. // empty values are omitted from API requests. However, any field with
  1904. // an empty value appearing in NullFields will be sent to the server as
  1905. // null. It is an error if a field in this list has a non-empty value.
  1906. // This may be used to include null fields in Patch requests.
  1907. NullFields []string `json:"-"`
  1908. }
  1909. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1910. type NoMethod AliasIpRange
  1911. raw := NoMethod(*s)
  1912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1913. }
  1914. type AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk struct {
  1915. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  1916. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  1917. // Interface: Specifies the disk interface to use for attaching this
  1918. // disk, which is either SCSI or NVME. The default is SCSI. For
  1919. // performance characteristics of SCSI over NVMe, see Local SSD
  1920. // performance.
  1921. //
  1922. // Possible values:
  1923. // "NVDIMM"
  1924. // "NVME"
  1925. // "SCSI"
  1926. Interface string `json:"interface,omitempty"`
  1927. // ForceSendFields is a list of field names (e.g. "DiskSizeGb") 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. "DiskSizeGb") to include in
  1935. // API 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 *AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk) MarshalJSON() ([]byte, error) {
  1943. type NoMethod AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk
  1944. raw := NoMethod(*s)
  1945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1946. }
  1947. // AllocationSpecificSKUAllocationReservedInstanceProperties: Properties
  1948. // of the SKU instances being reserved.
  1949. type AllocationSpecificSKUAllocationReservedInstanceProperties struct {
  1950. // GuestAccelerators: Specifies accelerator type and count.
  1951. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  1952. // LocalSsds: Specifies amount of local ssd to reserve with each
  1953. // instance. The type of disk is local-ssd.
  1954. LocalSsds []*AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk `json:"localSsds,omitempty"`
  1955. // MachineType: Specifies type of machine (name only) which has fixed
  1956. // number of vCPUs and fixed amount of memory. This also includes
  1957. // specifying custom machine type following
  1958. // custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
  1959. MachineType string `json:"machineType,omitempty"`
  1960. // MinCpuPlatform: Minimum cpu platform the reservation.
  1961. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  1962. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  1963. // to unconditionally include in API requests. By default, fields with
  1964. // empty values are omitted from API requests. However, any non-pointer,
  1965. // non-interface field appearing in ForceSendFields will be sent to the
  1966. // server regardless of whether the field is empty or not. This may be
  1967. // used to include empty fields in Patch requests.
  1968. ForceSendFields []string `json:"-"`
  1969. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  1970. // include in API requests with the JSON null value. By default, fields
  1971. // with empty values are omitted from API requests. However, any field
  1972. // with an empty value appearing in NullFields will be sent to the
  1973. // server as null. It is an error if a field in this list has a
  1974. // non-empty value. This may be used to include null fields in Patch
  1975. // requests.
  1976. NullFields []string `json:"-"`
  1977. }
  1978. func (s *AllocationSpecificSKUAllocationReservedInstanceProperties) MarshalJSON() ([]byte, error) {
  1979. type NoMethod AllocationSpecificSKUAllocationReservedInstanceProperties
  1980. raw := NoMethod(*s)
  1981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1982. }
  1983. // AllocationSpecificSKUReservation: This reservation type allows to pre
  1984. // allocate specific instance configuration.
  1985. type AllocationSpecificSKUReservation struct {
  1986. // Count: Specifies number of resources that are allocated.
  1987. Count int64 `json:"count,omitempty,string"`
  1988. // InUseCount: [OutputOnly] Indicates how many resource are in use.
  1989. InUseCount int64 `json:"inUseCount,omitempty,string"`
  1990. // InstanceProperties: The instance properties for this specific sku
  1991. // reservation.
  1992. InstanceProperties *AllocationSpecificSKUAllocationReservedInstanceProperties `json:"instanceProperties,omitempty"`
  1993. // ForceSendFields is a list of field names (e.g. "Count") to
  1994. // unconditionally include in API requests. By default, fields with
  1995. // empty values are omitted from API requests. However, any non-pointer,
  1996. // non-interface field appearing in ForceSendFields will be sent to the
  1997. // server regardless of whether the field is empty or not. This may be
  1998. // used to include empty fields in Patch requests.
  1999. ForceSendFields []string `json:"-"`
  2000. // NullFields is a list of field names (e.g. "Count") to include in API
  2001. // requests with the JSON null value. By default, fields with empty
  2002. // values are omitted from API requests. However, any field with an
  2003. // empty value appearing in NullFields will be sent to the server as
  2004. // null. It is an error if a field in this list has a non-empty value.
  2005. // This may be used to include null fields in Patch requests.
  2006. NullFields []string `json:"-"`
  2007. }
  2008. func (s *AllocationSpecificSKUReservation) MarshalJSON() ([]byte, error) {
  2009. type NoMethod AllocationSpecificSKUReservation
  2010. raw := NoMethod(*s)
  2011. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2012. }
  2013. // AttachedDisk: An instance-attached disk resource.
  2014. type AttachedDisk struct {
  2015. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  2016. // instance is deleted (but not when the disk is detached from the
  2017. // instance).
  2018. AutoDelete bool `json:"autoDelete,omitempty"`
  2019. // Boot: Indicates that this is a boot disk. The virtual machine will
  2020. // use the first partition of the disk for its root filesystem.
  2021. Boot bool `json:"boot,omitempty"`
  2022. // DeviceName: Specifies a unique device name of your choice that is
  2023. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  2024. // system running within the instance. This name can be used to
  2025. // reference the device for mounting, resizing, and so on, from within
  2026. // the instance.
  2027. //
  2028. // If not specified, the server chooses a default device name to apply
  2029. // to this disk, in the form persistent-disk-x, where x is a number
  2030. // assigned by Google Compute Engine. This field is only applicable for
  2031. // persistent disks.
  2032. DeviceName string `json:"deviceName,omitempty"`
  2033. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  2034. // customer-supplied encryption key.
  2035. //
  2036. // If you are creating a new disk, this field encrypts the new disk
  2037. // using an encryption key that you provide. If you are attaching an
  2038. // existing disk that is already encrypted, this field decrypts the disk
  2039. // using the customer-supplied encryption key.
  2040. //
  2041. // If you encrypt a disk using a customer-supplied key, you must provide
  2042. // the same key again when you attempt to use this resource at a later
  2043. // time. For example, you must provide the key when you create a
  2044. // snapshot or an image from the disk or when you attach the disk to a
  2045. // virtual machine instance.
  2046. //
  2047. // If you do not provide an encryption key, then the disk will be
  2048. // encrypted using an automatically generated key and you do not need to
  2049. // provide a key to use the disk later.
  2050. //
  2051. // Instance templates do not store customer-supplied encryption keys, so
  2052. // you cannot use your own keys to encrypt disks in a managed instance
  2053. // group.
  2054. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  2055. // DiskSizeGb: The size of the disk in base-2 GB. This supersedes
  2056. // disk_size_gb in InitializeParams.
  2057. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2058. // GuestOsFeatures: A list of features to enable on the guest operating
  2059. // system. Applicable only for bootable images. Read Enabling guest
  2060. // operating system features to see a list of available options.
  2061. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  2062. // Index: [Output Only] A zero-based index to this disk, where 0 is
  2063. // reserved for the boot disk. If you have many disks attached to an
  2064. // instance, each disk would have a unique index number.
  2065. Index int64 `json:"index,omitempty"`
  2066. // InitializeParams: [Input Only] Specifies the parameters for a new
  2067. // disk that will be created alongside the new instance. Use
  2068. // initialization parameters to create boot disks or local SSDs attached
  2069. // to the new instance.
  2070. //
  2071. // This property is mutually exclusive with the source property; you can
  2072. // only define one or the other, but not both.
  2073. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  2074. // Interface: Specifies the disk interface to use for attaching this
  2075. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  2076. // disks must always use SCSI and the request will fail if you attempt
  2077. // to attach a persistent disk in any other format than SCSI. Local SSDs
  2078. // can use either NVME or SCSI. For performance characteristics of SCSI
  2079. // over NVMe, see Local SSD performance.
  2080. //
  2081. // Possible values:
  2082. // "NVDIMM"
  2083. // "NVME"
  2084. // "SCSI"
  2085. Interface string `json:"interface,omitempty"`
  2086. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  2087. // for attached disks.
  2088. Kind string `json:"kind,omitempty"`
  2089. // Licenses: [Output Only] Any valid publicly visible licenses.
  2090. Licenses []string `json:"licenses,omitempty"`
  2091. // Mode: The mode in which to attach this disk, either READ_WRITE or
  2092. // READ_ONLY. If not specified, the default is to attach the disk in
  2093. // READ_WRITE mode.
  2094. //
  2095. // Possible values:
  2096. // "READ_ONLY"
  2097. // "READ_WRITE"
  2098. Mode string `json:"mode,omitempty"`
  2099. // SavedState: For LocalSSD disks on VM Instances in STOPPED or
  2100. // SUSPENDED state, this field is set to PRESERVED if the LocalSSD data
  2101. // has been saved to a persistent location by customer request. (see the
  2102. // discard_local_ssd option on Stop/Suspend). Read-only in the api.
  2103. //
  2104. // Possible values:
  2105. // "DISK_SAVED_STATE_UNSPECIFIED"
  2106. // "PRESERVED"
  2107. SavedState string `json:"savedState,omitempty"`
  2108. // ShieldedInstanceInitialState: [Output Only] shielded vm initial state
  2109. // stored on disk
  2110. ShieldedInstanceInitialState *InitialStateConfig `json:"shieldedInstanceInitialState,omitempty"`
  2111. // Source: Specifies a valid partial or full URL to an existing
  2112. // Persistent Disk resource. When creating a new instance, one of
  2113. // initializeParams.sourceImage or disks.source is required except for
  2114. // local SSD.
  2115. //
  2116. // If desired, you can also attach existing non-root persistent disks
  2117. // using this property. This field is only applicable for persistent
  2118. // disks.
  2119. //
  2120. // Note that for InstanceTemplate, specify the disk name, not the URL
  2121. // for the disk.
  2122. Source string `json:"source,omitempty"`
  2123. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  2124. // If not specified, the default is PERSISTENT.
  2125. //
  2126. // Possible values:
  2127. // "PERSISTENT"
  2128. // "SCRATCH"
  2129. Type string `json:"type,omitempty"`
  2130. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  2131. // unconditionally include in API requests. By default, fields with
  2132. // empty values are omitted from API requests. However, any non-pointer,
  2133. // non-interface field appearing in ForceSendFields will be sent to the
  2134. // server regardless of whether the field is empty or not. This may be
  2135. // used to include empty fields in Patch requests.
  2136. ForceSendFields []string `json:"-"`
  2137. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  2138. // API requests with the JSON null value. By default, fields with empty
  2139. // values are omitted from API requests. However, any field with an
  2140. // empty value appearing in NullFields will be sent to the server as
  2141. // null. It is an error if a field in this list has a non-empty value.
  2142. // This may be used to include null fields in Patch requests.
  2143. NullFields []string `json:"-"`
  2144. }
  2145. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  2146. type NoMethod AttachedDisk
  2147. raw := NoMethod(*s)
  2148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2149. }
  2150. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  2151. // for a new disk that will be created alongside the new instance. Use
  2152. // initialization parameters to create boot disks or local SSDs attached
  2153. // to the new instance.
  2154. //
  2155. // This property is mutually exclusive with the source property; you can
  2156. // only define one or the other, but not both.
  2157. type AttachedDiskInitializeParams struct {
  2158. // Description: An optional description. Provide this property when
  2159. // creating the disk.
  2160. Description string `json:"description,omitempty"`
  2161. // DiskName: Specifies the disk name. If not specified, the default is
  2162. // to use the name of the instance. If the disk with the instance name
  2163. // exists already in the given zone/region, a new name will be
  2164. // automatically generated.
  2165. DiskName string `json:"diskName,omitempty"`
  2166. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  2167. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2168. // DiskType: Specifies the disk type to use to create the instance. If
  2169. // not specified, the default is pd-standard, specified using the full
  2170. // URL. For
  2171. // example:
  2172. // https://www.googleapis.com/compute/v1/projects/project/zones/
  2173. // zone/diskTypes/pd-standard
  2174. //
  2175. //
  2176. // Other values include pd-ssd and local-ssd. If you define this field,
  2177. // you can provide either the full or partial URL. For example, the
  2178. // following are valid values:
  2179. // -
  2180. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  2181. // - projects/project/zones/zone/diskTypes/diskType
  2182. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  2183. // is the name of the disk type, not URL.
  2184. DiskType string `json:"diskType,omitempty"`
  2185. // GuestOsFeatures: A list of features to enable on the guest operating
  2186. // system. Applicable only for bootable images. Read Enabling guest
  2187. // operating system features to see a list of available options.
  2188. //
  2189. // Guest OS features are applied by merging
  2190. // initializeParams.guestOsFeatures and disks.guestOsFeatures
  2191. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  2192. // Labels: Labels to apply to this disk. These can be later modified by
  2193. // the disks.setLabels method. This field is only applicable for
  2194. // persistent disks.
  2195. Labels map[string]string `json:"labels,omitempty"`
  2196. // ReplicaZones: URLs of the zones where the disk should be replicated
  2197. // to. Only applicable for regional resources.
  2198. ReplicaZones []string `json:"replicaZones,omitempty"`
  2199. // ResourcePolicies: Resource policies applied to this disk for
  2200. // automatic snapshot creations. Specified using the full or partial
  2201. // URL. For instance template, specify only the resource policy name.
  2202. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  2203. // SourceImage: The source image to create this disk. When creating a
  2204. // new instance, one of initializeParams.sourceImage or disks.source is
  2205. // required except for local SSD.
  2206. //
  2207. // To create a disk with one of the public operating system images,
  2208. // specify the image by its family name. For example, specify
  2209. // family/debian-9 to use the latest Debian 9
  2210. // image:
  2211. // projects/debian-cloud/global/images/family/debian-9
  2212. //
  2213. //
  2214. // Alternati
  2215. // vely, use a specific version of a public operating system
  2216. // image:
  2217. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  2218. //
  2219. //
  2220. //
  2221. // To create a disk with a custom image that you created, specify the
  2222. // image name in the following
  2223. // format:
  2224. // global/images/my-custom-image
  2225. //
  2226. //
  2227. // You can also specify a custom image by its image family, which
  2228. // returns the latest version of the image in that family. Replace the
  2229. // image name with
  2230. // family/family-name:
  2231. // global/images/family/my-image-family
  2232. //
  2233. //
  2234. // If the source image is deleted later, this field will not be set.
  2235. SourceImage string `json:"sourceImage,omitempty"`
  2236. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  2237. // source image. Required if the source image is protected by a
  2238. // customer-supplied encryption key.
  2239. //
  2240. // Instance templates do not store customer-supplied encryption keys, so
  2241. // you cannot create disks for instances in a managed instance group if
  2242. // the source images are encrypted with your own keys.
  2243. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  2244. // SourceSnapshot: The source snapshot to create this disk. When
  2245. // creating a new instance, one of initializeParams.sourceSnapshot or
  2246. // disks.source is required except for local SSD.
  2247. //
  2248. // To create a disk with a snapshot that you created, specify the
  2249. // snapshot name in the following
  2250. // format:
  2251. // global/snapshots/my-backup
  2252. //
  2253. //
  2254. // If the source snapshot is deleted later, this field will not be set.
  2255. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  2256. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  2257. // the source snapshot.
  2258. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  2259. // ForceSendFields is a list of field names (e.g. "Description") to
  2260. // unconditionally include in API requests. By default, fields with
  2261. // empty values are omitted from API requests. However, any non-pointer,
  2262. // non-interface field appearing in ForceSendFields will be sent to the
  2263. // server regardless of whether the field is empty or not. This may be
  2264. // used to include empty fields in Patch requests.
  2265. ForceSendFields []string `json:"-"`
  2266. // NullFields is a list of field names (e.g. "Description") to include
  2267. // in API requests with the JSON null value. By default, fields with
  2268. // empty values are omitted from API requests. However, any field with
  2269. // an empty value appearing in NullFields will be sent to the server as
  2270. // null. It is an error if a field in this list has a non-empty value.
  2271. // This may be used to include null fields in Patch requests.
  2272. NullFields []string `json:"-"`
  2273. }
  2274. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  2275. type NoMethod AttachedDiskInitializeParams
  2276. raw := NoMethod(*s)
  2277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2278. }
  2279. // AuditConfig: Specifies the audit configuration for a service. The
  2280. // configuration determines which permission types are logged, and what
  2281. // identities, if any, are exempted from logging. An AuditConfig must
  2282. // have one or more AuditLogConfigs.
  2283. //
  2284. // If there are AuditConfigs for both `allServices` and a specific
  2285. // service, the union of the two AuditConfigs is used for that service:
  2286. // the log_types specified in each AuditConfig are enabled, and the
  2287. // exempted_members in each AuditLogConfig are exempted.
  2288. //
  2289. // Example Policy with multiple AuditConfigs:
  2290. //
  2291. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  2292. // [ { "log_type": "DATA_READ", "exempted_members": [
  2293. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  2294. // "log_type": "ADMIN_READ", } ] }, { "service":
  2295. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  2296. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  2297. // "user:bar@gmail.com" ] } ] } ] }
  2298. //
  2299. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  2300. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  2301. // logging, and bar@gmail.com from DATA_WRITE logging.
  2302. type AuditConfig struct {
  2303. // AuditLogConfigs: The configuration for logging of each type of
  2304. // permission.
  2305. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  2306. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2307. // Service: Specifies a service that will be enabled for audit logging.
  2308. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  2309. // `allServices` is a special value that covers all services.
  2310. Service string `json:"service,omitempty"`
  2311. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  2312. // unconditionally include in API requests. By default, fields with
  2313. // empty values are omitted from API requests. However, any non-pointer,
  2314. // non-interface field appearing in ForceSendFields will be sent to the
  2315. // server regardless of whether the field is empty or not. This may be
  2316. // used to include empty fields in Patch requests.
  2317. ForceSendFields []string `json:"-"`
  2318. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  2319. // include in API requests with the JSON null value. By default, fields
  2320. // with empty values are omitted from API requests. However, any field
  2321. // with an empty value appearing in NullFields will be sent to the
  2322. // server as null. It is an error if a field in this list has a
  2323. // non-empty value. This may be used to include null fields in Patch
  2324. // requests.
  2325. NullFields []string `json:"-"`
  2326. }
  2327. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  2328. type NoMethod AuditConfig
  2329. raw := NoMethod(*s)
  2330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2331. }
  2332. // AuditLogConfig: Provides the configuration for logging a type of
  2333. // permissions. Example:
  2334. //
  2335. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  2336. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  2337. // "DATA_WRITE", } ] }
  2338. //
  2339. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  2340. // foo@gmail.com from DATA_READ logging.
  2341. type AuditLogConfig struct {
  2342. // ExemptedMembers: Specifies the identities that do not cause logging
  2343. // for this type of permission. Follows the same format of
  2344. // [Binding.members][].
  2345. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2346. // LogType: The log type that this config enables.
  2347. //
  2348. // Possible values:
  2349. // "ADMIN_READ"
  2350. // "DATA_READ"
  2351. // "DATA_WRITE"
  2352. // "LOG_TYPE_UNSPECIFIED"
  2353. LogType string `json:"logType,omitempty"`
  2354. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  2355. // unconditionally include in API requests. By default, fields with
  2356. // empty values are omitted from API requests. However, any non-pointer,
  2357. // non-interface field appearing in ForceSendFields will be sent to the
  2358. // server regardless of whether the field is empty or not. This may be
  2359. // used to include empty fields in Patch requests.
  2360. ForceSendFields []string `json:"-"`
  2361. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  2362. // include in API requests with the JSON null value. By default, fields
  2363. // with empty values are omitted from API requests. However, any field
  2364. // with an empty value appearing in NullFields will be sent to the
  2365. // server as null. It is an error if a field in this list has a
  2366. // non-empty value. This may be used to include null fields in Patch
  2367. // requests.
  2368. NullFields []string `json:"-"`
  2369. }
  2370. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  2371. type NoMethod AuditLogConfig
  2372. raw := NoMethod(*s)
  2373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2374. }
  2375. // AuthenticationPolicy: The authentication settings for the backend
  2376. // service.
  2377. type AuthenticationPolicy struct {
  2378. // Origins: List of authentication methods that can be used for origin
  2379. // authentication. Similar to peers, these will be evaluated in order
  2380. // the first valid one will be used to set origin identity. If none of
  2381. // these methods pass, the request will be rejected with authentication
  2382. // failed error (401). Leave the list empty if origin authentication is
  2383. // not required.
  2384. Origins []*OriginAuthenticationMethod `json:"origins,omitempty"`
  2385. // Peers: List of authentication methods that can be used for peer
  2386. // authentication. They will be evaluated in order the first valid one
  2387. // will be used to set peer identity. If none of these methods pass, the
  2388. // request will be rejected with authentication failed error (401).
  2389. // Leave the list empty if peer authentication is not required.
  2390. Peers []*PeerAuthenticationMethod `json:"peers,omitempty"`
  2391. // PrincipalBinding: Define whether peer or origin identity should be
  2392. // used for principal. Default value is USE_PEER. If peer (or origin)
  2393. // identity is not available, either because peer/origin authentication
  2394. // is not defined, or failed, principal will be left unset. In other
  2395. // words, binding rule does not affect the decision to accept or reject
  2396. // request. This field can be set to one of the following: USE_PEER:
  2397. // Principal will be set to the identity from peer authentication.
  2398. // USE_ORIGIN: Principal will be set to the identity from origin
  2399. // authentication.
  2400. //
  2401. // Possible values:
  2402. // "INVALID"
  2403. // "USE_ORIGIN"
  2404. // "USE_PEER"
  2405. PrincipalBinding string `json:"principalBinding,omitempty"`
  2406. // ServerTlsContext: Configures the mechanism to obtain server-side
  2407. // security certificates and identity information.
  2408. ServerTlsContext *TlsContext `json:"serverTlsContext,omitempty"`
  2409. // ForceSendFields is a list of field names (e.g. "Origins") to
  2410. // unconditionally include in API requests. By default, fields with
  2411. // empty values are omitted from API requests. However, any non-pointer,
  2412. // non-interface field appearing in ForceSendFields will be sent to the
  2413. // server regardless of whether the field is empty or not. This may be
  2414. // used to include empty fields in Patch requests.
  2415. ForceSendFields []string `json:"-"`
  2416. // NullFields is a list of field names (e.g. "Origins") to include in
  2417. // API requests with the JSON null value. By default, fields with empty
  2418. // values are omitted from API requests. However, any field with an
  2419. // empty value appearing in NullFields will be sent to the server as
  2420. // null. It is an error if a field in this list has a non-empty value.
  2421. // This may be used to include null fields in Patch requests.
  2422. NullFields []string `json:"-"`
  2423. }
  2424. func (s *AuthenticationPolicy) MarshalJSON() ([]byte, error) {
  2425. type NoMethod AuthenticationPolicy
  2426. raw := NoMethod(*s)
  2427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2428. }
  2429. // AuthorizationConfig: Authorization configuration provides
  2430. // service-level and method-level access control for a service.
  2431. type AuthorizationConfig struct {
  2432. // Policies: List of RbacPolicies.
  2433. Policies []*RbacPolicy `json:"policies,omitempty"`
  2434. // ForceSendFields is a list of field names (e.g. "Policies") to
  2435. // unconditionally include in API requests. By default, fields with
  2436. // empty values are omitted from API requests. However, any non-pointer,
  2437. // non-interface field appearing in ForceSendFields will be sent to the
  2438. // server regardless of whether the field is empty or not. This may be
  2439. // used to include empty fields in Patch requests.
  2440. ForceSendFields []string `json:"-"`
  2441. // NullFields is a list of field names (e.g. "Policies") to include in
  2442. // API requests with the JSON null value. By default, fields with empty
  2443. // values are omitted from API requests. However, any field with an
  2444. // empty value appearing in NullFields will be sent to the server as
  2445. // null. It is an error if a field in this list has a non-empty value.
  2446. // This may be used to include null fields in Patch requests.
  2447. NullFields []string `json:"-"`
  2448. }
  2449. func (s *AuthorizationConfig) MarshalJSON() ([]byte, error) {
  2450. type NoMethod AuthorizationConfig
  2451. raw := NoMethod(*s)
  2452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2453. }
  2454. // AuthorizationLoggingOptions: Authorization-related information used
  2455. // by Cloud Audit Logging.
  2456. type AuthorizationLoggingOptions struct {
  2457. // PermissionType: The type of the permission that was checked.
  2458. //
  2459. // Possible values:
  2460. // "ADMIN_READ"
  2461. // "ADMIN_WRITE"
  2462. // "DATA_READ"
  2463. // "DATA_WRITE"
  2464. // "PERMISSION_TYPE_UNSPECIFIED"
  2465. PermissionType string `json:"permissionType,omitempty"`
  2466. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  2467. // unconditionally include in API requests. By default, fields with
  2468. // empty values are omitted from API requests. However, any non-pointer,
  2469. // non-interface field appearing in ForceSendFields will be sent to the
  2470. // server regardless of whether the field is empty or not. This may be
  2471. // used to include empty fields in Patch requests.
  2472. ForceSendFields []string `json:"-"`
  2473. // NullFields is a list of field names (e.g. "PermissionType") to
  2474. // include in API requests with the JSON null value. By default, fields
  2475. // with empty values are omitted from API requests. However, any field
  2476. // with an empty value appearing in NullFields will be sent to the
  2477. // server as null. It is an error if a field in this list has a
  2478. // non-empty value. This may be used to include null fields in Patch
  2479. // requests.
  2480. NullFields []string `json:"-"`
  2481. }
  2482. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  2483. type NoMethod AuthorizationLoggingOptions
  2484. raw := NoMethod(*s)
  2485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2486. }
  2487. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  2488. // to automatically scale virtual machine instances in managed instance
  2489. // groups according to an autoscaling policy that you define. For more
  2490. // information, read Autoscaling Groups of Instances. (== resource_for
  2491. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  2492. // resource_for beta.regionAutoscalers ==) (== resource_for
  2493. // v1.regionAutoscalers ==)
  2494. type Autoscaler struct {
  2495. // AutoscalingPolicy: The configuration parameters for the autoscaling
  2496. // algorithm. You can define one or more of the policies for an
  2497. // autoscaler: cpuUtilization, customMetricUtilizations, and
  2498. // loadBalancingUtilization.
  2499. //
  2500. // If none of these are specified, the default will be to autoscale
  2501. // based on cpuUtilization to 0.6 or 60%.
  2502. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  2503. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2504. // format.
  2505. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2506. // Description: An optional description of this resource. Provide this
  2507. // property when you create the resource.
  2508. Description string `json:"description,omitempty"`
  2509. // Id: [Output Only] The unique identifier for the resource. This
  2510. // identifier is defined by the server.
  2511. Id uint64 `json:"id,omitempty,string"`
  2512. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  2513. // for autoscalers.
  2514. Kind string `json:"kind,omitempty"`
  2515. // Name: Name of the resource. Provided by the client when the resource
  2516. // is created. The name must be 1-63 characters long, and comply with
  2517. // RFC1035. Specifically, the name must be 1-63 characters long and
  2518. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2519. // the first character must be a lowercase letter, and all following
  2520. // characters must be a dash, lowercase letter, or digit, except the
  2521. // last character, which cannot be a dash.
  2522. Name string `json:"name,omitempty"`
  2523. // RecommendedSize: [Output Only] Target recommended MIG size (number of
  2524. // instances) computed by autoscaler. Autoscaler calculates recommended
  2525. // MIG size even when autoscaling policy mode is different from ON. This
  2526. // field is empty when autoscaler is not connected to the existing
  2527. // managed instance group or autoscaler did not generate its prediction.
  2528. RecommendedSize int64 `json:"recommendedSize,omitempty"`
  2529. // Region: [Output Only] URL of the region where the instance group
  2530. // resides (for autoscalers living in regional scope).
  2531. Region string `json:"region,omitempty"`
  2532. // SelfLink: [Output Only] Server-defined URL for the resource.
  2533. SelfLink string `json:"selfLink,omitempty"`
  2534. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  2535. // with the resource id.
  2536. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  2537. // Status: [Output Only] The status of the autoscaler configuration.
  2538. //
  2539. // Possible values:
  2540. // "ACTIVE"
  2541. // "DELETING"
  2542. // "ERROR"
  2543. // "PENDING"
  2544. Status string `json:"status,omitempty"`
  2545. // StatusDetails: [Output Only] Human-readable details about the current
  2546. // state of the autoscaler. Read the documentation for Commonly returned
  2547. // status messages for examples of status messages you might encounter.
  2548. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  2549. // Target: URL of the managed instance group that this autoscaler will
  2550. // scale.
  2551. Target string `json:"target,omitempty"`
  2552. // Zone: [Output Only] URL of the zone where the instance group resides
  2553. // (for autoscalers living in zonal scope).
  2554. Zone string `json:"zone,omitempty"`
  2555. // ServerResponse contains the HTTP response code and headers from the
  2556. // server.
  2557. googleapi.ServerResponse `json:"-"`
  2558. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  2559. // to unconditionally include in API requests. By default, fields with
  2560. // empty values are omitted from API requests. However, any non-pointer,
  2561. // non-interface field appearing in ForceSendFields will be sent to the
  2562. // server regardless of whether the field is empty or not. This may be
  2563. // used to include empty fields in Patch requests.
  2564. ForceSendFields []string `json:"-"`
  2565. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  2566. // include in API requests with the JSON null value. By default, fields
  2567. // with empty values are omitted from API requests. However, any field
  2568. // with an empty value appearing in NullFields will be sent to the
  2569. // server as null. It is an error if a field in this list has a
  2570. // non-empty value. This may be used to include null fields in Patch
  2571. // requests.
  2572. NullFields []string `json:"-"`
  2573. }
  2574. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  2575. type NoMethod Autoscaler
  2576. raw := NoMethod(*s)
  2577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2578. }
  2579. type AutoscalerAggregatedList struct {
  2580. // Id: [Output Only] Unique identifier for the resource; defined by the
  2581. // server.
  2582. Id string `json:"id,omitempty"`
  2583. // Items: A list of AutoscalersScopedList resources.
  2584. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  2585. // Kind: [Output Only] Type of resource. Always
  2586. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  2587. Kind string `json:"kind,omitempty"`
  2588. // NextPageToken: [Output Only] This token allows you to get the next
  2589. // page of results for list requests. If the number of results is larger
  2590. // than maxResults, use the nextPageToken as a value for the query
  2591. // parameter pageToken in the next list request. Subsequent list
  2592. // requests will have their own nextPageToken to continue paging through
  2593. // the results.
  2594. NextPageToken string `json:"nextPageToken,omitempty"`
  2595. // SelfLink: [Output Only] Server-defined URL for this resource.
  2596. SelfLink string `json:"selfLink,omitempty"`
  2597. // Warning: [Output Only] Informational warning message.
  2598. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  2599. // ServerResponse contains the HTTP response code and headers from the
  2600. // server.
  2601. googleapi.ServerResponse `json:"-"`
  2602. // ForceSendFields is a list of field names (e.g. "Id") to
  2603. // unconditionally include in API requests. By default, fields with
  2604. // empty values are omitted from API requests. However, any non-pointer,
  2605. // non-interface field appearing in ForceSendFields will be sent to the
  2606. // server regardless of whether the field is empty or not. This may be
  2607. // used to include empty fields in Patch requests.
  2608. ForceSendFields []string `json:"-"`
  2609. // NullFields is a list of field names (e.g. "Id") to include in API
  2610. // requests with the JSON null value. By default, fields with empty
  2611. // values are omitted from API requests. However, any field with an
  2612. // empty value appearing in NullFields will be sent to the server as
  2613. // null. It is an error if a field in this list has a non-empty value.
  2614. // This may be used to include null fields in Patch requests.
  2615. NullFields []string `json:"-"`
  2616. }
  2617. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  2618. type NoMethod AutoscalerAggregatedList
  2619. raw := NoMethod(*s)
  2620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2621. }
  2622. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  2623. // message.
  2624. type AutoscalerAggregatedListWarning struct {
  2625. // Code: [Output Only] A warning code, if applicable. For example,
  2626. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2627. // the response.
  2628. //
  2629. // Possible values:
  2630. // "CLEANUP_FAILED"
  2631. // "DEPRECATED_RESOURCE_USED"
  2632. // "DEPRECATED_TYPE_USED"
  2633. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2634. // "EXPERIMENTAL_TYPE_USED"
  2635. // "EXTERNAL_API_WARNING"
  2636. // "FIELD_VALUE_OVERRIDEN"
  2637. // "INJECTED_KERNELS_DEPRECATED"
  2638. // "MISSING_TYPE_DEPENDENCY"
  2639. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2640. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2641. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2642. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2643. // "NEXT_HOP_NOT_RUNNING"
  2644. // "NOT_CRITICAL_ERROR"
  2645. // "NO_RESULTS_ON_PAGE"
  2646. // "REQUIRED_TOS_AGREEMENT"
  2647. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2648. // "RESOURCE_NOT_DELETED"
  2649. // "SCHEMA_VALIDATION_IGNORED"
  2650. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2651. // "UNDECLARED_PROPERTIES"
  2652. // "UNREACHABLE"
  2653. Code string `json:"code,omitempty"`
  2654. // Data: [Output Only] Metadata about this warning in key: value format.
  2655. // For example:
  2656. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2657. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  2658. // Message: [Output Only] A human-readable description of the warning
  2659. // code.
  2660. Message string `json:"message,omitempty"`
  2661. // ForceSendFields is a list of field names (e.g. "Code") to
  2662. // unconditionally include in API requests. By default, fields with
  2663. // empty values are omitted from API requests. However, any non-pointer,
  2664. // non-interface field appearing in ForceSendFields will be sent to the
  2665. // server regardless of whether the field is empty or not. This may be
  2666. // used to include empty fields in Patch requests.
  2667. ForceSendFields []string `json:"-"`
  2668. // NullFields is a list of field names (e.g. "Code") to include in API
  2669. // requests with the JSON null value. By default, fields with empty
  2670. // values are omitted from API requests. However, any field with an
  2671. // empty value appearing in NullFields will be sent to the server as
  2672. // null. It is an error if a field in this list has a non-empty value.
  2673. // This may be used to include null fields in Patch requests.
  2674. NullFields []string `json:"-"`
  2675. }
  2676. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2677. type NoMethod AutoscalerAggregatedListWarning
  2678. raw := NoMethod(*s)
  2679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2680. }
  2681. type AutoscalerAggregatedListWarningData struct {
  2682. // Key: [Output Only] A key that provides more detail on the warning
  2683. // being returned. For example, for warnings where there are no results
  2684. // in a list request for a particular zone, this key might be scope and
  2685. // the key value might be the zone name. Other examples might be a key
  2686. // indicating a deprecated resource and a suggested replacement, or a
  2687. // warning about invalid network settings (for example, if an instance
  2688. // attempts to perform IP forwarding but is not enabled for IP
  2689. // forwarding).
  2690. Key string `json:"key,omitempty"`
  2691. // Value: [Output Only] A warning data value corresponding to the key.
  2692. Value string `json:"value,omitempty"`
  2693. // ForceSendFields is a list of field names (e.g. "Key") to
  2694. // unconditionally include in API requests. By default, fields with
  2695. // empty values are omitted from API requests. However, any non-pointer,
  2696. // non-interface field appearing in ForceSendFields will be sent to the
  2697. // server regardless of whether the field is empty or not. This may be
  2698. // used to include empty fields in Patch requests.
  2699. ForceSendFields []string `json:"-"`
  2700. // NullFields is a list of field names (e.g. "Key") to include in API
  2701. // requests with the JSON null value. By default, fields with empty
  2702. // values are omitted from API requests. However, any field with an
  2703. // empty value appearing in NullFields will be sent to the server as
  2704. // null. It is an error if a field in this list has a non-empty value.
  2705. // This may be used to include null fields in Patch requests.
  2706. NullFields []string `json:"-"`
  2707. }
  2708. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2709. type NoMethod AutoscalerAggregatedListWarningData
  2710. raw := NoMethod(*s)
  2711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2712. }
  2713. // AutoscalerList: Contains a list of Autoscaler resources.
  2714. type AutoscalerList struct {
  2715. // Id: [Output Only] Unique identifier for the resource; defined by the
  2716. // server.
  2717. Id string `json:"id,omitempty"`
  2718. // Items: A list of Autoscaler resources.
  2719. Items []*Autoscaler `json:"items,omitempty"`
  2720. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  2721. // for lists of autoscalers.
  2722. Kind string `json:"kind,omitempty"`
  2723. // NextPageToken: [Output Only] This token allows you to get the next
  2724. // page of results for list requests. If the number of results is larger
  2725. // than maxResults, use the nextPageToken as a value for the query
  2726. // parameter pageToken in the next list request. Subsequent list
  2727. // requests will have their own nextPageToken to continue paging through
  2728. // the results.
  2729. NextPageToken string `json:"nextPageToken,omitempty"`
  2730. // SelfLink: [Output Only] Server-defined URL for this resource.
  2731. SelfLink string `json:"selfLink,omitempty"`
  2732. // Warning: [Output Only] Informational warning message.
  2733. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  2734. // ServerResponse contains the HTTP response code and headers from the
  2735. // server.
  2736. googleapi.ServerResponse `json:"-"`
  2737. // ForceSendFields is a list of field names (e.g. "Id") to
  2738. // unconditionally include in API requests. By default, fields with
  2739. // empty values are omitted from API requests. However, any non-pointer,
  2740. // non-interface field appearing in ForceSendFields will be sent to the
  2741. // server regardless of whether the field is empty or not. This may be
  2742. // used to include empty fields in Patch requests.
  2743. ForceSendFields []string `json:"-"`
  2744. // NullFields is a list of field names (e.g. "Id") to include in API
  2745. // requests with the JSON null value. By default, fields with empty
  2746. // values are omitted from API requests. However, any field with an
  2747. // empty value appearing in NullFields will be sent to the server as
  2748. // null. It is an error if a field in this list has a non-empty value.
  2749. // This may be used to include null fields in Patch requests.
  2750. NullFields []string `json:"-"`
  2751. }
  2752. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  2753. type NoMethod AutoscalerList
  2754. raw := NoMethod(*s)
  2755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2756. }
  2757. // AutoscalerListWarning: [Output Only] Informational warning message.
  2758. type AutoscalerListWarning struct {
  2759. // Code: [Output Only] A warning code, if applicable. For example,
  2760. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2761. // the response.
  2762. //
  2763. // Possible values:
  2764. // "CLEANUP_FAILED"
  2765. // "DEPRECATED_RESOURCE_USED"
  2766. // "DEPRECATED_TYPE_USED"
  2767. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2768. // "EXPERIMENTAL_TYPE_USED"
  2769. // "EXTERNAL_API_WARNING"
  2770. // "FIELD_VALUE_OVERRIDEN"
  2771. // "INJECTED_KERNELS_DEPRECATED"
  2772. // "MISSING_TYPE_DEPENDENCY"
  2773. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2774. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2775. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2776. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2777. // "NEXT_HOP_NOT_RUNNING"
  2778. // "NOT_CRITICAL_ERROR"
  2779. // "NO_RESULTS_ON_PAGE"
  2780. // "REQUIRED_TOS_AGREEMENT"
  2781. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2782. // "RESOURCE_NOT_DELETED"
  2783. // "SCHEMA_VALIDATION_IGNORED"
  2784. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2785. // "UNDECLARED_PROPERTIES"
  2786. // "UNREACHABLE"
  2787. Code string `json:"code,omitempty"`
  2788. // Data: [Output Only] Metadata about this warning in key: value format.
  2789. // For example:
  2790. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2791. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  2792. // Message: [Output Only] A human-readable description of the warning
  2793. // code.
  2794. Message string `json:"message,omitempty"`
  2795. // ForceSendFields is a list of field names (e.g. "Code") to
  2796. // unconditionally include in API requests. By default, fields with
  2797. // empty values are omitted from API requests. However, any non-pointer,
  2798. // non-interface field appearing in ForceSendFields will be sent to the
  2799. // server regardless of whether the field is empty or not. This may be
  2800. // used to include empty fields in Patch requests.
  2801. ForceSendFields []string `json:"-"`
  2802. // NullFields is a list of field names (e.g. "Code") to include in API
  2803. // requests with the JSON null value. By default, fields with empty
  2804. // values are omitted from API requests. However, any field with an
  2805. // empty value appearing in NullFields will be sent to the server as
  2806. // null. It is an error if a field in this list has a non-empty value.
  2807. // This may be used to include null fields in Patch requests.
  2808. NullFields []string `json:"-"`
  2809. }
  2810. func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  2811. type NoMethod AutoscalerListWarning
  2812. raw := NoMethod(*s)
  2813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2814. }
  2815. type AutoscalerListWarningData struct {
  2816. // Key: [Output Only] A key that provides more detail on the warning
  2817. // being returned. For example, for warnings where there are no results
  2818. // in a list request for a particular zone, this key might be scope and
  2819. // the key value might be the zone name. Other examples might be a key
  2820. // indicating a deprecated resource and a suggested replacement, or a
  2821. // warning about invalid network settings (for example, if an instance
  2822. // attempts to perform IP forwarding but is not enabled for IP
  2823. // forwarding).
  2824. Key string `json:"key,omitempty"`
  2825. // Value: [Output Only] A warning data value corresponding to the key.
  2826. Value string `json:"value,omitempty"`
  2827. // ForceSendFields is a list of field names (e.g. "Key") to
  2828. // unconditionally include in API requests. By default, fields with
  2829. // empty values are omitted from API requests. However, any non-pointer,
  2830. // non-interface field appearing in ForceSendFields will be sent to the
  2831. // server regardless of whether the field is empty or not. This may be
  2832. // used to include empty fields in Patch requests.
  2833. ForceSendFields []string `json:"-"`
  2834. // NullFields is a list of field names (e.g. "Key") to include in API
  2835. // requests with the JSON null value. By default, fields with empty
  2836. // values are omitted from API requests. However, any field with an
  2837. // empty value appearing in NullFields will be sent to the server as
  2838. // null. It is an error if a field in this list has a non-empty value.
  2839. // This may be used to include null fields in Patch requests.
  2840. NullFields []string `json:"-"`
  2841. }
  2842. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  2843. type NoMethod AutoscalerListWarningData
  2844. raw := NoMethod(*s)
  2845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2846. }
  2847. type AutoscalerStatusDetails struct {
  2848. // Message: The status message.
  2849. Message string `json:"message,omitempty"`
  2850. // Type: The type of error returned.
  2851. //
  2852. // Possible values:
  2853. // "ALL_INSTANCES_UNHEALTHY"
  2854. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  2855. // "CAPPED_AT_MAX_NUM_REPLICAS"
  2856. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  2857. // "CUSTOM_METRIC_INVALID"
  2858. // "MIN_EQUALS_MAX"
  2859. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  2860. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  2861. // "MORE_THAN_ONE_BACKEND_SERVICE"
  2862. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  2863. // "REGION_RESOURCE_STOCKOUT"
  2864. // "SCALING_TARGET_DOES_NOT_EXIST"
  2865. // "UNKNOWN"
  2866. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  2867. // "ZONE_RESOURCE_STOCKOUT"
  2868. Type string `json:"type,omitempty"`
  2869. // ForceSendFields is a list of field names (e.g. "Message") to
  2870. // unconditionally include in API requests. By default, fields with
  2871. // empty values are omitted from API requests. However, any non-pointer,
  2872. // non-interface field appearing in ForceSendFields will be sent to the
  2873. // server regardless of whether the field is empty or not. This may be
  2874. // used to include empty fields in Patch requests.
  2875. ForceSendFields []string `json:"-"`
  2876. // NullFields is a list of field names (e.g. "Message") to include in
  2877. // API requests with the JSON null value. By default, fields with empty
  2878. // values are omitted from API requests. However, any field with an
  2879. // empty value appearing in NullFields will be sent to the server as
  2880. // null. It is an error if a field in this list has a non-empty value.
  2881. // This may be used to include null fields in Patch requests.
  2882. NullFields []string `json:"-"`
  2883. }
  2884. func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  2885. type NoMethod AutoscalerStatusDetails
  2886. raw := NoMethod(*s)
  2887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2888. }
  2889. type AutoscalersScopedList struct {
  2890. // Autoscalers: [Output Only] A list of autoscalers contained in this
  2891. // scope.
  2892. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  2893. // Warning: [Output Only] Informational warning which replaces the list
  2894. // of autoscalers when the list is empty.
  2895. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  2896. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  2897. // unconditionally include in API requests. By default, fields with
  2898. // empty values are omitted from API requests. However, any non-pointer,
  2899. // non-interface field appearing in ForceSendFields will be sent to the
  2900. // server regardless of whether the field is empty or not. This may be
  2901. // used to include empty fields in Patch requests.
  2902. ForceSendFields []string `json:"-"`
  2903. // NullFields is a list of field names (e.g. "Autoscalers") to include
  2904. // in API requests with the JSON null value. By default, fields with
  2905. // empty values are omitted from API requests. However, any field with
  2906. // an empty value appearing in NullFields will be sent to the server as
  2907. // null. It is an error if a field in this list has a non-empty value.
  2908. // This may be used to include null fields in Patch requests.
  2909. NullFields []string `json:"-"`
  2910. }
  2911. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  2912. type NoMethod AutoscalersScopedList
  2913. raw := NoMethod(*s)
  2914. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2915. }
  2916. // AutoscalersScopedListWarning: [Output Only] Informational warning
  2917. // which replaces the list of autoscalers when the list is empty.
  2918. type AutoscalersScopedListWarning struct {
  2919. // Code: [Output Only] A warning code, if applicable. For example,
  2920. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2921. // the response.
  2922. //
  2923. // Possible values:
  2924. // "CLEANUP_FAILED"
  2925. // "DEPRECATED_RESOURCE_USED"
  2926. // "DEPRECATED_TYPE_USED"
  2927. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2928. // "EXPERIMENTAL_TYPE_USED"
  2929. // "EXTERNAL_API_WARNING"
  2930. // "FIELD_VALUE_OVERRIDEN"
  2931. // "INJECTED_KERNELS_DEPRECATED"
  2932. // "MISSING_TYPE_DEPENDENCY"
  2933. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2934. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2935. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2936. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2937. // "NEXT_HOP_NOT_RUNNING"
  2938. // "NOT_CRITICAL_ERROR"
  2939. // "NO_RESULTS_ON_PAGE"
  2940. // "REQUIRED_TOS_AGREEMENT"
  2941. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2942. // "RESOURCE_NOT_DELETED"
  2943. // "SCHEMA_VALIDATION_IGNORED"
  2944. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2945. // "UNDECLARED_PROPERTIES"
  2946. // "UNREACHABLE"
  2947. Code string `json:"code,omitempty"`
  2948. // Data: [Output Only] Metadata about this warning in key: value format.
  2949. // For example:
  2950. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2951. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  2952. // Message: [Output Only] A human-readable description of the warning
  2953. // code.
  2954. Message string `json:"message,omitempty"`
  2955. // ForceSendFields is a list of field names (e.g. "Code") to
  2956. // unconditionally include in API requests. By default, fields with
  2957. // empty values are omitted from API requests. However, any non-pointer,
  2958. // non-interface field appearing in ForceSendFields will be sent to the
  2959. // server regardless of whether the field is empty or not. This may be
  2960. // used to include empty fields in Patch requests.
  2961. ForceSendFields []string `json:"-"`
  2962. // NullFields is a list of field names (e.g. "Code") to include in API
  2963. // requests with the JSON null value. By default, fields with empty
  2964. // values are omitted from API requests. However, any field with an
  2965. // empty value appearing in NullFields will be sent to the server as
  2966. // null. It is an error if a field in this list has a non-empty value.
  2967. // This may be used to include null fields in Patch requests.
  2968. NullFields []string `json:"-"`
  2969. }
  2970. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  2971. type NoMethod AutoscalersScopedListWarning
  2972. raw := NoMethod(*s)
  2973. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2974. }
  2975. type AutoscalersScopedListWarningData struct {
  2976. // Key: [Output Only] A key that provides more detail on the warning
  2977. // being returned. For example, for warnings where there are no results
  2978. // in a list request for a particular zone, this key might be scope and
  2979. // the key value might be the zone name. Other examples might be a key
  2980. // indicating a deprecated resource and a suggested replacement, or a
  2981. // warning about invalid network settings (for example, if an instance
  2982. // attempts to perform IP forwarding but is not enabled for IP
  2983. // forwarding).
  2984. Key string `json:"key,omitempty"`
  2985. // Value: [Output Only] A warning data value corresponding to the key.
  2986. Value string `json:"value,omitempty"`
  2987. // ForceSendFields is a list of field names (e.g. "Key") to
  2988. // unconditionally include in API requests. By default, fields with
  2989. // empty values are omitted from API requests. However, any non-pointer,
  2990. // non-interface field appearing in ForceSendFields will be sent to the
  2991. // server regardless of whether the field is empty or not. This may be
  2992. // used to include empty fields in Patch requests.
  2993. ForceSendFields []string `json:"-"`
  2994. // NullFields is a list of field names (e.g. "Key") to include in API
  2995. // requests with the JSON null value. By default, fields with empty
  2996. // values are omitted from API requests. However, any field with an
  2997. // empty value appearing in NullFields will be sent to the server as
  2998. // null. It is an error if a field in this list has a non-empty value.
  2999. // This may be used to include null fields in Patch requests.
  3000. NullFields []string `json:"-"`
  3001. }
  3002. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  3003. type NoMethod AutoscalersScopedListWarningData
  3004. raw := NoMethod(*s)
  3005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3006. }
  3007. // AutoscalingPolicy: Cloud Autoscaler policy.
  3008. type AutoscalingPolicy struct {
  3009. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  3010. // wait before it starts collecting information from a new instance.
  3011. // This prevents the autoscaler from collecting information when the
  3012. // instance is initializing, during which the collected usage would not
  3013. // be reliable. The default time autoscaler waits is 60
  3014. // seconds.
  3015. //
  3016. // Virtual machine initialization times might vary because of numerous
  3017. // factors. We recommend that you test how long an instance may take to
  3018. // initialize. To do this, create an instance and time the startup
  3019. // process.
  3020. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  3021. // CpuUtilization: Defines the CPU utilization policy that allows the
  3022. // autoscaler to scale based on the average CPU utilization of a managed
  3023. // instance group.
  3024. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  3025. // CustomMetricUtilizations: Configuration parameters of autoscaling
  3026. // based on a custom metric.
  3027. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  3028. // LoadBalancingUtilization: Configuration parameters of autoscaling
  3029. // based on load balancer.
  3030. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  3031. // MaxNumReplicas: The maximum number of instances that the autoscaler
  3032. // can scale up to. This is required when creating or updating an
  3033. // autoscaler. The maximum number of replicas should not be lower than
  3034. // minimal number of replicas.
  3035. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  3036. // MinNumReplicas: The minimum number of replicas that the autoscaler
  3037. // can scale down to. This cannot be less than 0. If not provided,
  3038. // autoscaler will choose a default value depending on maximum number of
  3039. // instances allowed.
  3040. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  3041. // Mode: Defines operating mode for this policy.
  3042. //
  3043. // Possible values:
  3044. // "OFF"
  3045. // "ON"
  3046. // "ONLY_DOWN"
  3047. // "ONLY_UP"
  3048. Mode string `json:"mode,omitempty"`
  3049. // QueueBasedScaling: Configuration parameters of autoscaling based on
  3050. // queuing system.
  3051. QueueBasedScaling *AutoscalingPolicyQueueBasedScaling `json:"queueBasedScaling,omitempty"`
  3052. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  3053. // to unconditionally include in API requests. By default, fields with
  3054. // empty values are omitted from API requests. However, any non-pointer,
  3055. // non-interface field appearing in ForceSendFields will be sent to the
  3056. // server regardless of whether the field is empty or not. This may be
  3057. // used to include empty fields in Patch requests.
  3058. ForceSendFields []string `json:"-"`
  3059. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  3060. // include in API requests with the JSON null value. By default, fields
  3061. // with empty values are omitted from API requests. However, any field
  3062. // with an empty value appearing in NullFields will be sent to the
  3063. // server as null. It is an error if a field in this list has a
  3064. // non-empty value. This may be used to include null fields in Patch
  3065. // requests.
  3066. NullFields []string `json:"-"`
  3067. }
  3068. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  3069. type NoMethod AutoscalingPolicy
  3070. raw := NoMethod(*s)
  3071. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3072. }
  3073. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  3074. type AutoscalingPolicyCpuUtilization struct {
  3075. // UtilizationTarget: The target CPU utilization that the autoscaler
  3076. // should maintain. Must be a float value in the range (0, 1]. If not
  3077. // specified, the default is 0.6.
  3078. //
  3079. // If the CPU level is below the target utilization, the autoscaler
  3080. // scales down the number of instances until it reaches the minimum
  3081. // number of instances you specified or until the average CPU of your
  3082. // instances reaches the target utilization.
  3083. //
  3084. // If the average CPU is above the target utilization, the autoscaler
  3085. // scales up until it reaches the maximum number of instances you
  3086. // specified or until the average utilization reaches the target
  3087. // utilization.
  3088. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3089. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  3090. // to unconditionally include in API requests. By default, fields with
  3091. // empty values are omitted from API requests. However, any non-pointer,
  3092. // non-interface field appearing in ForceSendFields will be sent to the
  3093. // server regardless of whether the field is empty or not. This may be
  3094. // used to include empty fields in Patch requests.
  3095. ForceSendFields []string `json:"-"`
  3096. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  3097. // include in API requests with the JSON null value. By default, fields
  3098. // with empty values are omitted from API requests. However, any field
  3099. // with an empty value appearing in NullFields will be sent to the
  3100. // server as null. It is an error if a field in this list has a
  3101. // non-empty value. This may be used to include null fields in Patch
  3102. // requests.
  3103. NullFields []string `json:"-"`
  3104. }
  3105. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  3106. type NoMethod AutoscalingPolicyCpuUtilization
  3107. raw := NoMethod(*s)
  3108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3109. }
  3110. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  3111. type NoMethod AutoscalingPolicyCpuUtilization
  3112. var s1 struct {
  3113. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3114. *NoMethod
  3115. }
  3116. s1.NoMethod = (*NoMethod)(s)
  3117. if err := json.Unmarshal(data, &s1); err != nil {
  3118. return err
  3119. }
  3120. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3121. return nil
  3122. }
  3123. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  3124. // policy.
  3125. type AutoscalingPolicyCustomMetricUtilization struct {
  3126. // Filter: A filter string, compatible with a Stackdriver Monitoring
  3127. // filter string for TimeSeries.list API call. This filter is used to
  3128. // select a specific TimeSeries for the purpose of autoscaling and to
  3129. // determine whether the metric is exporting per-instance or per-group
  3130. // data.
  3131. //
  3132. // For the filter to be valid for autoscaling purposes, the following
  3133. // rules apply:
  3134. // - You can only use the AND operator for joining selectors.
  3135. // - You can only use direct equality comparison operator (=) without
  3136. // any functions for each selector.
  3137. // - You can specify the metric in both the filter string and in the
  3138. // metric field. However, if specified in both places, the metric must
  3139. // be identical.
  3140. // - The monitored resource type determines what kind of values are
  3141. // expected for the metric. If it is a gce_instance, the autoscaler
  3142. // expects the metric to include a separate TimeSeries for each instance
  3143. // in a group. In such a case, you cannot filter on resource labels.
  3144. // If the resource type is any other value, the autoscaler expects this
  3145. // metric to contain values that apply to the entire autoscaled instance
  3146. // group and resource label filtering can be performed to point
  3147. // autoscaler at the correct TimeSeries to scale upon. This is called a
  3148. // per-group metric for the purpose of autoscaling.
  3149. //
  3150. // If not specified, the type defaults to gce_instance.
  3151. //
  3152. // You should provide a filter that is selective enough to pick just one
  3153. // TimeSeries for the autoscaled group or for each of the instances (if
  3154. // you are using gce_instance resource type). If multiple TimeSeries are
  3155. // returned upon the query execution, the autoscaler will sum their
  3156. // respective values to obtain its scaling value.
  3157. Filter string `json:"filter,omitempty"`
  3158. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  3159. // The metric cannot have negative values.
  3160. //
  3161. // The metric must have a value type of INT64 or DOUBLE.
  3162. Metric string `json:"metric,omitempty"`
  3163. // SingleInstanceAssignment: If scaling is based on a per-group metric
  3164. // value that represents the total amount of work to be done or resource
  3165. // usage, set this value to an amount assigned for a single instance of
  3166. // the scaled group. Autoscaler will keep the number of instances
  3167. // proportional to the value of this metric, the metric itself should
  3168. // not change value due to group resizing.
  3169. //
  3170. // A good metric to use with the target is for example
  3171. // pubsub.googleapis.com/subscription/num_undelivered_messages or a
  3172. // custom metric exporting the total number of requests coming to your
  3173. // instances.
  3174. //
  3175. // A bad example would be a metric exporting an average or median
  3176. // latency, since this value can't include a chunk assignable to a
  3177. // single instance, it could be better used with utilization_target
  3178. // instead.
  3179. SingleInstanceAssignment float64 `json:"singleInstanceAssignment,omitempty"`
  3180. // UtilizationTarget: The target value of the metric that autoscaler
  3181. // should maintain. This must be a positive value. A utilization metric
  3182. // scales number of virtual machines handling requests to increase or
  3183. // decrease proportionally to the metric.
  3184. //
  3185. // For example, a good metric to use as a utilization_target is
  3186. // compute.googleapis.com/instance/network/received_bytes_count. The
  3187. // autoscaler will work to keep this value constant for each of the
  3188. // instances.
  3189. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3190. // UtilizationTargetType: Defines how target utilization value is
  3191. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  3192. // DELTA_PER_SECOND, or DELTA_PER_MINUTE.
  3193. //
  3194. // Possible values:
  3195. // "DELTA_PER_MINUTE"
  3196. // "DELTA_PER_SECOND"
  3197. // "GAUGE"
  3198. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  3199. // ForceSendFields is a list of field names (e.g. "Filter") 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. "Filter") to include in API
  3207. // requests with the JSON null value. By default, fields with empty
  3208. // values are omitted from API requests. However, any field with an
  3209. // 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 *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  3215. type NoMethod AutoscalingPolicyCustomMetricUtilization
  3216. raw := NoMethod(*s)
  3217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3218. }
  3219. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  3220. type NoMethod AutoscalingPolicyCustomMetricUtilization
  3221. var s1 struct {
  3222. SingleInstanceAssignment gensupport.JSONFloat64 `json:"singleInstanceAssignment"`
  3223. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3224. *NoMethod
  3225. }
  3226. s1.NoMethod = (*NoMethod)(s)
  3227. if err := json.Unmarshal(data, &s1); err != nil {
  3228. return err
  3229. }
  3230. s.SingleInstanceAssignment = float64(s1.SingleInstanceAssignment)
  3231. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3232. return nil
  3233. }
  3234. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  3235. // of autoscaling based on load balancing.
  3236. type AutoscalingPolicyLoadBalancingUtilization struct {
  3237. // UtilizationTarget: Fraction of backend capacity utilization (set in
  3238. // HTTP(S) load balancing configuration) that autoscaler should
  3239. // maintain. Must be a positive float value. If not defined, the default
  3240. // is 0.8.
  3241. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3242. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  3243. // to unconditionally include in API requests. By default, fields with
  3244. // empty values are omitted from API requests. However, any non-pointer,
  3245. // non-interface field appearing in ForceSendFields will be sent to the
  3246. // server regardless of whether the field is empty or not. This may be
  3247. // used to include empty fields in Patch requests.
  3248. ForceSendFields []string `json:"-"`
  3249. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  3250. // include in API requests with the JSON null value. By default, fields
  3251. // with empty values are omitted from API requests. However, any field
  3252. // with an empty value appearing in NullFields will be sent to the
  3253. // server as null. It is an error if a field in this list has a
  3254. // non-empty value. This may be used to include null fields in Patch
  3255. // requests.
  3256. NullFields []string `json:"-"`
  3257. }
  3258. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  3259. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  3260. raw := NoMethod(*s)
  3261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3262. }
  3263. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  3264. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  3265. var s1 struct {
  3266. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3267. *NoMethod
  3268. }
  3269. s1.NoMethod = (*NoMethod)(s)
  3270. if err := json.Unmarshal(data, &s1); err != nil {
  3271. return err
  3272. }
  3273. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3274. return nil
  3275. }
  3276. // AutoscalingPolicyQueueBasedScaling: Configuration parameters of
  3277. // autoscaling based on queuing system.
  3278. type AutoscalingPolicyQueueBasedScaling struct {
  3279. // AcceptableBacklogPerInstance: Scaling based on the average number of
  3280. // tasks in the queue per each active instance. The autoscaler keeps the
  3281. // average number of tasks per instance below this number, based on data
  3282. // collected in the last couple of minutes. The autoscaler will also
  3283. // take into account incoming tasks when calculating when to scale.
  3284. AcceptableBacklogPerInstance float64 `json:"acceptableBacklogPerInstance,omitempty"`
  3285. // CloudPubSub: Configuration for Cloud Pub/Sub subscription queue.
  3286. CloudPubSub *AutoscalingPolicyQueueBasedScalingCloudPubSub `json:"cloudPubSub,omitempty"`
  3287. // SingleWorkerThroughputPerSec: The scaling algorithm will also
  3288. // calculate throughput estimates on its own; if you explicitly provide
  3289. // this value, the autoscaler will take into account your value as well
  3290. // as automatic estimates when deciding how to scale.
  3291. SingleWorkerThroughputPerSec float64 `json:"singleWorkerThroughputPerSec,omitempty"`
  3292. // ForceSendFields is a list of field names (e.g.
  3293. // "AcceptableBacklogPerInstance") to unconditionally include in API
  3294. // requests. By default, fields with empty values are omitted from API
  3295. // requests. However, any non-pointer, non-interface field appearing in
  3296. // ForceSendFields will be sent to the server regardless of whether the
  3297. // field is empty or not. This may be used to include empty fields in
  3298. // Patch requests.
  3299. ForceSendFields []string `json:"-"`
  3300. // NullFields is a list of field names (e.g.
  3301. // "AcceptableBacklogPerInstance") to include in API requests with the
  3302. // JSON null value. By default, fields with empty values are omitted
  3303. // from API requests. However, any field with an empty value appearing
  3304. // in NullFields will be sent to the server as null. It is an error if a
  3305. // field in this list has a non-empty value. This may be used to include
  3306. // null fields in Patch requests.
  3307. NullFields []string `json:"-"`
  3308. }
  3309. func (s *AutoscalingPolicyQueueBasedScaling) MarshalJSON() ([]byte, error) {
  3310. type NoMethod AutoscalingPolicyQueueBasedScaling
  3311. raw := NoMethod(*s)
  3312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3313. }
  3314. func (s *AutoscalingPolicyQueueBasedScaling) UnmarshalJSON(data []byte) error {
  3315. type NoMethod AutoscalingPolicyQueueBasedScaling
  3316. var s1 struct {
  3317. AcceptableBacklogPerInstance gensupport.JSONFloat64 `json:"acceptableBacklogPerInstance"`
  3318. SingleWorkerThroughputPerSec gensupport.JSONFloat64 `json:"singleWorkerThroughputPerSec"`
  3319. *NoMethod
  3320. }
  3321. s1.NoMethod = (*NoMethod)(s)
  3322. if err := json.Unmarshal(data, &s1); err != nil {
  3323. return err
  3324. }
  3325. s.AcceptableBacklogPerInstance = float64(s1.AcceptableBacklogPerInstance)
  3326. s.SingleWorkerThroughputPerSec = float64(s1.SingleWorkerThroughputPerSec)
  3327. return nil
  3328. }
  3329. // AutoscalingPolicyQueueBasedScalingCloudPubSub: Configuration
  3330. // parameters for scaling based on Cloud Pub/Sub subscription queue.
  3331. type AutoscalingPolicyQueueBasedScalingCloudPubSub struct {
  3332. // Subscription: Cloud Pub/Sub subscription used for scaling. Provide
  3333. // the partial URL (starting with projects/) or just the subscription
  3334. // name. The subscription must be assigned to the topic specified in
  3335. // topicName and must be in a pull configuration. The subscription must
  3336. // belong to the same project as the Autoscaler.
  3337. Subscription string `json:"subscription,omitempty"`
  3338. // Topic: Cloud Pub/Sub topic used for scaling. Provide the partial URL
  3339. // or partial URL (starting with projects/) or just the topic name. The
  3340. // topic must belong to the same project as the Autoscaler resource.
  3341. Topic string `json:"topic,omitempty"`
  3342. // ForceSendFields is a list of field names (e.g. "Subscription") to
  3343. // unconditionally include in API requests. By default, fields with
  3344. // empty values are omitted from API requests. However, any non-pointer,
  3345. // non-interface field appearing in ForceSendFields will be sent to the
  3346. // server regardless of whether the field is empty or not. This may be
  3347. // used to include empty fields in Patch requests.
  3348. ForceSendFields []string `json:"-"`
  3349. // NullFields is a list of field names (e.g. "Subscription") to include
  3350. // in API requests with the JSON null value. By default, fields with
  3351. // empty values are omitted from API requests. However, any field with
  3352. // an empty value appearing in NullFields will be sent to the server as
  3353. // null. It is an error if a field in this list has a non-empty value.
  3354. // This may be used to include null fields in Patch requests.
  3355. NullFields []string `json:"-"`
  3356. }
  3357. func (s *AutoscalingPolicyQueueBasedScalingCloudPubSub) MarshalJSON() ([]byte, error) {
  3358. type NoMethod AutoscalingPolicyQueueBasedScalingCloudPubSub
  3359. raw := NoMethod(*s)
  3360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3361. }
  3362. // Backend: Message containing information of one individual backend.
  3363. type Backend struct {
  3364. // BalancingMode: Specifies the balancing mode for this backend. For
  3365. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  3366. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  3367. // TCP/SSL).
  3368. //
  3369. // For Internal Load Balancing, the default and only supported mode is
  3370. // CONNECTION.
  3371. //
  3372. // Possible values:
  3373. // "CONNECTION"
  3374. // "RATE"
  3375. // "UTILIZATION"
  3376. BalancingMode string `json:"balancingMode,omitempty"`
  3377. // CapacityScaler: A multiplier applied to the group's maximum servicing
  3378. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  3379. // 1, which means the group will serve up to 100% of its configured
  3380. // capacity (depending on balancingMode). A setting of 0 means the group
  3381. // is completely drained, offering 0% of its available Capacity. Valid
  3382. // range is [0.0,1.0].
  3383. //
  3384. // This cannot be used for internal load balancing.
  3385. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  3386. // Description: An optional description of this resource. Provide this
  3387. // property when you create the resource.
  3388. Description string `json:"description,omitempty"`
  3389. // Failover: This field designates whether this is a failover backend.
  3390. // More than one failover backend can be configured for a given
  3391. // BackendService.
  3392. Failover bool `json:"failover,omitempty"`
  3393. // Group: The fully-qualified URL of an Instance Group or Network
  3394. // Endpoint Group resource. In case of instance group this defines the
  3395. // list of instances that serve traffic. Member virtual machine
  3396. // instances from each instance group must live in the same zone as the
  3397. // instance group itself. No two backends in a backend service are
  3398. // allowed to use same Instance Group resource.
  3399. //
  3400. // For Network Endpoint Groups this defines list of endpoints. All
  3401. // endpoints of Network Endpoint Group must be hosted on instances
  3402. // located in the same zone as the Network Endpoint Group.
  3403. //
  3404. // Backend service can not contain mix of Instance Group and Network
  3405. // Endpoint Group backends.
  3406. //
  3407. // Note that you must specify an Instance Group or Network Endpoint
  3408. // Group resource using the fully-qualified URL, rather than a partial
  3409. // URL.
  3410. //
  3411. // When the BackendService has load balancing scheme INTERNAL, the
  3412. // instance group must be within the same region as the BackendService.
  3413. // Network Endpoint Groups are not supported for INTERNAL load balancing
  3414. // scheme.
  3415. Group string `json:"group,omitempty"`
  3416. // MaxConnections: The max number of simultaneous connections for the
  3417. // group. Can be used with either CONNECTION or UTILIZATION balancing
  3418. // modes. For CONNECTION mode, either maxConnections or
  3419. // maxConnectionsPerInstance must be set.
  3420. //
  3421. // This cannot be used for internal load balancing.
  3422. MaxConnections int64 `json:"maxConnections,omitempty"`
  3423. // MaxConnectionsPerEndpoint: The max number of simultaneous connections
  3424. // that a single backend network endpoint can handle. This is used to
  3425. // calculate the capacity of the group. Can be used in either CONNECTION
  3426. // or UTILIZATION balancing modes. For CONNECTION mode, either
  3427. // maxConnections or maxConnectionsPerEndpoint must be set.
  3428. //
  3429. // This cannot be used for internal load balancing.
  3430. MaxConnectionsPerEndpoint int64 `json:"maxConnectionsPerEndpoint,omitempty"`
  3431. // MaxConnectionsPerInstance: The max number of simultaneous connections
  3432. // that a single backend instance can handle. This is used to calculate
  3433. // the capacity of the group. Can be used in either CONNECTION or
  3434. // UTILIZATION balancing modes. For CONNECTION mode, either
  3435. // maxConnections or maxConnectionsPerInstance must be set.
  3436. //
  3437. // This cannot be used for internal load balancing.
  3438. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  3439. // MaxRate: The max requests per second (RPS) of the group. Can be used
  3440. // with either RATE or UTILIZATION balancing modes, but required if RATE
  3441. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  3442. // set.
  3443. //
  3444. // This cannot be used for internal load balancing.
  3445. MaxRate int64 `json:"maxRate,omitempty"`
  3446. // MaxRatePerEndpoint: The max requests per second (RPS) that a single
  3447. // backend network endpoint can handle. This is used to calculate the
  3448. // capacity of the group. Can be used in either balancing mode. For RATE
  3449. // mode, either maxRate or maxRatePerEndpoint must be set.
  3450. //
  3451. // This cannot be used for internal load balancing.
  3452. MaxRatePerEndpoint float64 `json:"maxRatePerEndpoint,omitempty"`
  3453. // MaxRatePerInstance: The max requests per second (RPS) that a single
  3454. // backend instance can handle. This is used to calculate the capacity
  3455. // of the group. Can be used in either balancing mode. For RATE mode,
  3456. // either maxRate or maxRatePerInstance must be set.
  3457. //
  3458. // This cannot be used for internal load balancing.
  3459. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  3460. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  3461. // defines the CPU utilization target for the group. The default is 0.8.
  3462. // Valid range is [0.0, 1.0].
  3463. //
  3464. // This cannot be used for internal load balancing.
  3465. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  3466. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  3467. // unconditionally include in API requests. By default, fields with
  3468. // empty values are omitted from API requests. However, any non-pointer,
  3469. // non-interface field appearing in ForceSendFields will be sent to the
  3470. // server regardless of whether the field is empty or not. This may be
  3471. // used to include empty fields in Patch requests.
  3472. ForceSendFields []string `json:"-"`
  3473. // NullFields is a list of field names (e.g. "BalancingMode") to include
  3474. // in API requests with the JSON null value. By default, fields with
  3475. // empty values are omitted from API requests. However, any field with
  3476. // an empty value appearing in NullFields will be sent to the server as
  3477. // null. It is an error if a field in this list has a non-empty value.
  3478. // This may be used to include null fields in Patch requests.
  3479. NullFields []string `json:"-"`
  3480. }
  3481. func (s *Backend) MarshalJSON() ([]byte, error) {
  3482. type NoMethod Backend
  3483. raw := NoMethod(*s)
  3484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3485. }
  3486. func (s *Backend) UnmarshalJSON(data []byte) error {
  3487. type NoMethod Backend
  3488. var s1 struct {
  3489. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  3490. MaxRatePerEndpoint gensupport.JSONFloat64 `json:"maxRatePerEndpoint"`
  3491. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  3492. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  3493. *NoMethod
  3494. }
  3495. s1.NoMethod = (*NoMethod)(s)
  3496. if err := json.Unmarshal(data, &s1); err != nil {
  3497. return err
  3498. }
  3499. s.CapacityScaler = float64(s1.CapacityScaler)
  3500. s.MaxRatePerEndpoint = float64(s1.MaxRatePerEndpoint)
  3501. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  3502. s.MaxUtilization = float64(s1.MaxUtilization)
  3503. return nil
  3504. }
  3505. // BackendBucket: A BackendBucket resource. This resource defines a
  3506. // Cloud Storage bucket.
  3507. type BackendBucket struct {
  3508. // BucketName: Cloud Storage bucket name.
  3509. BucketName string `json:"bucketName,omitempty"`
  3510. // CdnPolicy: Cloud CDN configuration for this BackendBucket.
  3511. CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
  3512. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3513. // format.
  3514. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3515. // Description: An optional textual description of the resource;
  3516. // provided by the client when the resource is created.
  3517. Description string `json:"description,omitempty"`
  3518. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  3519. EnableCdn bool `json:"enableCdn,omitempty"`
  3520. // Id: [Output Only] Unique identifier for the resource; defined by the
  3521. // server.
  3522. Id uint64 `json:"id,omitempty,string"`
  3523. // Kind: Type of the resource.
  3524. Kind string `json:"kind,omitempty"`
  3525. // Name: Name of the resource. Provided by the client when the resource
  3526. // is created. The name must be 1-63 characters long, and comply with
  3527. // RFC1035. Specifically, the name must be 1-63 characters long and
  3528. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3529. // the first character must be a lowercase letter, and all following
  3530. // characters must be a dash, lowercase letter, or digit, except the
  3531. // last character, which cannot be a dash.
  3532. Name string `json:"name,omitempty"`
  3533. // SelfLink: [Output Only] Server-defined URL for the resource.
  3534. SelfLink string `json:"selfLink,omitempty"`
  3535. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  3536. // with the resource id.
  3537. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  3538. // ServerResponse contains the HTTP response code and headers from the
  3539. // server.
  3540. googleapi.ServerResponse `json:"-"`
  3541. // ForceSendFields is a list of field names (e.g. "BucketName") to
  3542. // unconditionally include in API requests. By default, fields with
  3543. // empty values are omitted from API requests. However, any non-pointer,
  3544. // non-interface field appearing in ForceSendFields will be sent to the
  3545. // server regardless of whether the field is empty or not. This may be
  3546. // used to include empty fields in Patch requests.
  3547. ForceSendFields []string `json:"-"`
  3548. // NullFields is a list of field names (e.g. "BucketName") to include in
  3549. // API requests with the JSON null value. By default, fields with empty
  3550. // values are omitted from API requests. However, any field with an
  3551. // empty value appearing in NullFields will be sent to the server as
  3552. // null. It is an error if a field in this list has a non-empty value.
  3553. // This may be used to include null fields in Patch requests.
  3554. NullFields []string `json:"-"`
  3555. }
  3556. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  3557. type NoMethod BackendBucket
  3558. raw := NoMethod(*s)
  3559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3560. }
  3561. // BackendBucketCdnPolicy: Message containing Cloud CDN configuration
  3562. // for a backend bucket.
  3563. type BackendBucketCdnPolicy struct {
  3564. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  3565. // signed URL request will be considered fresh. After this time period,
  3566. // the response will be revalidated before being served. Defaults to 1hr
  3567. // (3600s). When serving responses to signed URL requests, Cloud CDN
  3568. // will internally behave as though all responses from this backend had
  3569. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  3570. // existing Cache-Control header. The actual headers served in responses
  3571. // will not be altered.
  3572. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3573. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  3574. // request URLs.
  3575. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3576. // ForceSendFields is a list of field names (e.g.
  3577. // "SignedUrlCacheMaxAgeSec") to unconditionally include in API
  3578. // requests. By default, fields with empty values are omitted from API
  3579. // requests. However, any non-pointer, non-interface field appearing in
  3580. // ForceSendFields will be sent to the server regardless of whether the
  3581. // field is empty or not. This may be used to include empty fields in
  3582. // Patch requests.
  3583. ForceSendFields []string `json:"-"`
  3584. // NullFields is a list of field names (e.g. "SignedUrlCacheMaxAgeSec")
  3585. // to include in API requests with the JSON null value. By default,
  3586. // fields with empty values are omitted from API requests. However, any
  3587. // field with an empty value appearing in NullFields will be sent to the
  3588. // server as null. It is an error if a field in this list has a
  3589. // non-empty value. This may be used to include null fields in Patch
  3590. // requests.
  3591. NullFields []string `json:"-"`
  3592. }
  3593. func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
  3594. type NoMethod BackendBucketCdnPolicy
  3595. raw := NoMethod(*s)
  3596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3597. }
  3598. // BackendBucketList: Contains a list of BackendBucket resources.
  3599. type BackendBucketList struct {
  3600. // Id: [Output Only] Unique identifier for the resource; defined by the
  3601. // server.
  3602. Id string `json:"id,omitempty"`
  3603. // Items: A list of BackendBucket resources.
  3604. Items []*BackendBucket `json:"items,omitempty"`
  3605. // Kind: Type of resource.
  3606. Kind string `json:"kind,omitempty"`
  3607. // NextPageToken: [Output Only] This token allows you to get the next
  3608. // page of results for list requests. If the number of results is larger
  3609. // than maxResults, use the nextPageToken as a value for the query
  3610. // parameter pageToken in the next list request. Subsequent list
  3611. // requests will have their own nextPageToken to continue paging through
  3612. // the results.
  3613. NextPageToken string `json:"nextPageToken,omitempty"`
  3614. // SelfLink: [Output Only] Server-defined URL for this resource.
  3615. SelfLink string `json:"selfLink,omitempty"`
  3616. // Warning: [Output Only] Informational warning message.
  3617. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  3618. // ServerResponse contains the HTTP response code and headers from the
  3619. // server.
  3620. googleapi.ServerResponse `json:"-"`
  3621. // ForceSendFields is a list of field names (e.g. "Id") to
  3622. // unconditionally include in API requests. By default, fields with
  3623. // empty values are omitted from API requests. However, any non-pointer,
  3624. // non-interface field appearing in ForceSendFields will be sent to the
  3625. // server regardless of whether the field is empty or not. This may be
  3626. // used to include empty fields in Patch requests.
  3627. ForceSendFields []string `json:"-"`
  3628. // NullFields is a list of field names (e.g. "Id") to include in API
  3629. // requests with the JSON null value. By default, fields with empty
  3630. // values are omitted from API requests. However, any field with an
  3631. // empty value appearing in NullFields will be sent to the server as
  3632. // null. It is an error if a field in this list has a non-empty value.
  3633. // This may be used to include null fields in Patch requests.
  3634. NullFields []string `json:"-"`
  3635. }
  3636. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  3637. type NoMethod BackendBucketList
  3638. raw := NoMethod(*s)
  3639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3640. }
  3641. // BackendBucketListWarning: [Output Only] Informational warning
  3642. // message.
  3643. type BackendBucketListWarning struct {
  3644. // Code: [Output Only] A warning code, if applicable. For example,
  3645. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3646. // the response.
  3647. //
  3648. // Possible values:
  3649. // "CLEANUP_FAILED"
  3650. // "DEPRECATED_RESOURCE_USED"
  3651. // "DEPRECATED_TYPE_USED"
  3652. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3653. // "EXPERIMENTAL_TYPE_USED"
  3654. // "EXTERNAL_API_WARNING"
  3655. // "FIELD_VALUE_OVERRIDEN"
  3656. // "INJECTED_KERNELS_DEPRECATED"
  3657. // "MISSING_TYPE_DEPENDENCY"
  3658. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3659. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3660. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3661. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3662. // "NEXT_HOP_NOT_RUNNING"
  3663. // "NOT_CRITICAL_ERROR"
  3664. // "NO_RESULTS_ON_PAGE"
  3665. // "REQUIRED_TOS_AGREEMENT"
  3666. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3667. // "RESOURCE_NOT_DELETED"
  3668. // "SCHEMA_VALIDATION_IGNORED"
  3669. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3670. // "UNDECLARED_PROPERTIES"
  3671. // "UNREACHABLE"
  3672. Code string `json:"code,omitempty"`
  3673. // Data: [Output Only] Metadata about this warning in key: value format.
  3674. // For example:
  3675. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3676. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  3677. // Message: [Output Only] A human-readable description of the warning
  3678. // code.
  3679. Message string `json:"message,omitempty"`
  3680. // ForceSendFields is a list of field names (e.g. "Code") to
  3681. // unconditionally include in API requests. By default, fields with
  3682. // empty values are omitted from API requests. However, any non-pointer,
  3683. // non-interface field appearing in ForceSendFields will be sent to the
  3684. // server regardless of whether the field is empty or not. This may be
  3685. // used to include empty fields in Patch requests.
  3686. ForceSendFields []string `json:"-"`
  3687. // NullFields is a list of field names (e.g. "Code") to include in API
  3688. // requests with the JSON null value. By default, fields with empty
  3689. // values are omitted from API requests. However, any field with an
  3690. // empty value appearing in NullFields will be sent to the server as
  3691. // null. It is an error if a field in this list has a non-empty value.
  3692. // This may be used to include null fields in Patch requests.
  3693. NullFields []string `json:"-"`
  3694. }
  3695. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  3696. type NoMethod BackendBucketListWarning
  3697. raw := NoMethod(*s)
  3698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3699. }
  3700. type BackendBucketListWarningData struct {
  3701. // Key: [Output Only] A key that provides more detail on the warning
  3702. // being returned. For example, for warnings where there are no results
  3703. // in a list request for a particular zone, this key might be scope and
  3704. // the key value might be the zone name. Other examples might be a key
  3705. // indicating a deprecated resource and a suggested replacement, or a
  3706. // warning about invalid network settings (for example, if an instance
  3707. // attempts to perform IP forwarding but is not enabled for IP
  3708. // forwarding).
  3709. Key string `json:"key,omitempty"`
  3710. // Value: [Output Only] A warning data value corresponding to the key.
  3711. Value string `json:"value,omitempty"`
  3712. // ForceSendFields is a list of field names (e.g. "Key") to
  3713. // unconditionally include in API requests. By default, fields with
  3714. // empty values are omitted from API requests. However, any non-pointer,
  3715. // non-interface field appearing in ForceSendFields will be sent to the
  3716. // server regardless of whether the field is empty or not. This may be
  3717. // used to include empty fields in Patch requests.
  3718. ForceSendFields []string `json:"-"`
  3719. // NullFields is a list of field names (e.g. "Key") to include in API
  3720. // requests with the JSON null value. By default, fields with empty
  3721. // values are omitted from API requests. However, any field with an
  3722. // empty value appearing in NullFields will be sent to the server as
  3723. // null. It is an error if a field in this list has a non-empty value.
  3724. // This may be used to include null fields in Patch requests.
  3725. NullFields []string `json:"-"`
  3726. }
  3727. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  3728. type NoMethod BackendBucketListWarningData
  3729. raw := NoMethod(*s)
  3730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3731. }
  3732. // BackendService: A BackendService resource. This resource defines a
  3733. // group of backend virtual machines and their serving capacity. (==
  3734. // resource_for v1.backendService ==) (== resource_for
  3735. // beta.backendService ==)
  3736. type BackendService struct {
  3737. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  3738. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  3739. // non-persistent and lasts only until the end of the browser session
  3740. // (or equivalent). The maximum allowed value for TTL is one day.
  3741. //
  3742. // When the load balancing scheme is INTERNAL, this field is not used.
  3743. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  3744. // AppEngineBackend: Directs request to an App Engine app.
  3745. // cloudFunctionBackend and backends[] must be empty if this is set.
  3746. AppEngineBackend *BackendServiceAppEngineBackend `json:"appEngineBackend,omitempty"`
  3747. // Backends: The list of backends that serve this BackendService.
  3748. Backends []*Backend `json:"backends,omitempty"`
  3749. // CdnPolicy: Cloud CDN configuration for this BackendService.
  3750. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  3751. // CircuitBreakers: Settings controlling the volume of connections to a
  3752. // backend service.
  3753. //
  3754. // This field is applicable to either:
  3755. // - A regional backend service with the service_protocol set to HTTP,
  3756. // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED.
  3757. //
  3758. // - A global backend service with the load_balancing_scheme set to
  3759. // INTERNAL_SELF_MANAGED.
  3760. CircuitBreakers *CircuitBreakers `json:"circuitBreakers,omitempty"`
  3761. // CloudFunctionBackend: Directs request to a cloud function.
  3762. // appEngineBackend and backends[] must be empty if this is set.
  3763. CloudFunctionBackend *BackendServiceCloudFunctionBackend `json:"cloudFunctionBackend,omitempty"`
  3764. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  3765. // ConsistentHash: Consistent Hash-based load balancing can be used to
  3766. // provide soft session affinity based on HTTP headers, cookies or other
  3767. // properties. This load balancing policy is applicable only for HTTP
  3768. // connections. The affinity to a particular destination host will be
  3769. // lost when one or more hosts are added/removed from the destination
  3770. // service. This field specifies parameters that control consistent
  3771. // hashing. This field is only applicable when localityLbPolicy is set
  3772. // to MAGLEV or RING_HASH.
  3773. //
  3774. // This field is applicable to either:
  3775. // - A regional backend service with the service_protocol set to HTTP,
  3776. // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED.
  3777. //
  3778. // - A global backend service with the load_balancing_scheme set to
  3779. // INTERNAL_SELF_MANAGED.
  3780. ConsistentHash *ConsistentHashLoadBalancerSettings `json:"consistentHash,omitempty"`
  3781. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3782. // format.
  3783. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3784. // CustomRequestHeaders: Headers that the HTTP/S load balancer should
  3785. // add to proxied requests.
  3786. CustomRequestHeaders []string `json:"customRequestHeaders,omitempty"`
  3787. // Description: An optional description of this resource. Provide this
  3788. // property when you create the resource.
  3789. Description string `json:"description,omitempty"`
  3790. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  3791. //
  3792. // When the load balancing scheme is INTERNAL, this field is not used.
  3793. EnableCDN bool `json:"enableCDN,omitempty"`
  3794. FailoverPolicy *BackendServiceFailoverPolicy `json:"failoverPolicy,omitempty"`
  3795. // Fingerprint: Fingerprint of this resource. A hash of the contents
  3796. // stored in this object. This field is used in optimistic locking. This
  3797. // field will be ignored when inserting a BackendService. An up-to-date
  3798. // fingerprint must be provided in order to update the BackendService,
  3799. // otherwise the request will fail with error 412 conditionNotMet.
  3800. //
  3801. // To see the latest fingerprint, make a get() request to retrieve a
  3802. // BackendService.
  3803. Fingerprint string `json:"fingerprint,omitempty"`
  3804. // HealthChecks: The list of URLs to the HttpHealthCheck or
  3805. // HttpsHealthCheck resource for health checking this BackendService.
  3806. // Currently at most one health check can be specified, and a health
  3807. // check is required for Compute Engine backend services. A health check
  3808. // must not be specified for App Engine backend and Cloud Function
  3809. // backend.
  3810. //
  3811. // For internal load balancing, a URL to a HealthCheck resource must be
  3812. // specified instead.
  3813. HealthChecks []string `json:"healthChecks,omitempty"`
  3814. Iap *BackendServiceIAP `json:"iap,omitempty"`
  3815. // Id: [Output Only] The unique identifier for the resource. This
  3816. // identifier is defined by the server.
  3817. Id uint64 `json:"id,omitempty,string"`
  3818. // Kind: [Output Only] Type of resource. Always compute#backendService
  3819. // for backend services.
  3820. Kind string `json:"kind,omitempty"`
  3821. // LoadBalancingScheme: Indicates whether the backend service will be
  3822. // used with internal or external load balancing. A backend service
  3823. // created for one type of load balancing cannot be used with the other.
  3824. // Possible values are INTERNAL and EXTERNAL.
  3825. //
  3826. // Possible values:
  3827. // "EXTERNAL"
  3828. // "INTERNAL"
  3829. // "INTERNAL_MANAGED"
  3830. // "INTERNAL_SELF_MANAGED"
  3831. // "INVALID_LOAD_BALANCING_SCHEME"
  3832. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  3833. // LocalityLbPolicy: The load balancing algorithm used within the scope
  3834. // of the locality. The possible values are:
  3835. // - ROUND_ROBIN: This is a simple policy in which each healthy backend
  3836. // is selected in round robin order. This is the default.
  3837. // - LEAST_REQUEST: An O(1) algorithm which selects two random healthy
  3838. // hosts and picks the host which has fewer active requests.
  3839. // - RING_HASH: The ring/modulo hash load balancer implements consistent
  3840. // hashing to backends. The algorithm has the property that the
  3841. // addition/removal of a host from a set of N hosts only affects 1/N of
  3842. // the requests.
  3843. // - RANDOM: The load balancer selects a random healthy host.
  3844. // - ORIGINAL_DESTINATION: Backend host is selected based on the client
  3845. // connection metadata, i.e., connections are opened to the same address
  3846. // as the destination address of the incoming connection before the
  3847. // connection was redirected to the load balancer.
  3848. // - MAGLEV: used as a drop in replacement for the ring hash load
  3849. // balancer. Maglev is not as stable as ring hash but has faster table
  3850. // lookup build times and host selection times. For more information
  3851. // about Maglev, refer to https://ai.google/research/pubs/pub44824
  3852. //
  3853. //
  3854. // This field is applicable to either:
  3855. // - A regional backend service with the service_protocol set to HTTP,
  3856. // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED.
  3857. //
  3858. // - A global backend service with the load_balancing_scheme set to
  3859. // INTERNAL_SELF_MANAGED.
  3860. //
  3861. // Possible values:
  3862. // "INVALID_LB_POLICY"
  3863. // "LEAST_REQUEST"
  3864. // "MAGLEV"
  3865. // "ORIGINAL_DESTINATION"
  3866. // "RANDOM"
  3867. // "RING_HASH"
  3868. // "ROUND_ROBIN"
  3869. LocalityLbPolicy string `json:"localityLbPolicy,omitempty"`
  3870. // LogConfig: This field denotes the logging options for the load
  3871. // balancer traffic served by this backend service. If logging is
  3872. // enabled, logs will be exported to Stackdriver.
  3873. LogConfig *BackendServiceLogConfig `json:"logConfig,omitempty"`
  3874. // Name: Name of the resource. Provided by the client when the resource
  3875. // is created. The name must be 1-63 characters long, and comply with
  3876. // RFC1035. Specifically, the name must be 1-63 characters long and
  3877. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3878. // the first character must be a lowercase letter, and all following
  3879. // characters must be a dash, lowercase letter, or digit, except the
  3880. // last character, which cannot be a dash.
  3881. Name string `json:"name,omitempty"`
  3882. // OutlierDetection: Settings controlling eviction of unhealthy hosts
  3883. // from the load balancing pool. This field is applicable to either:
  3884. // - A regional backend service with the service_protocol set to HTTP,
  3885. // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED.
  3886. //
  3887. // - A global backend service with the load_balancing_scheme set to
  3888. // INTERNAL_SELF_MANAGED.
  3889. OutlierDetection *OutlierDetection `json:"outlierDetection,omitempty"`
  3890. // Port: Deprecated in favor of portName. The TCP port to connect on the
  3891. // backend. The default value is 80.
  3892. //
  3893. // This cannot be used for internal load balancing.
  3894. Port int64 `json:"port,omitempty"`
  3895. // PortName: Name of backend port. The same name should appear in the
  3896. // instance groups referenced by this service. Required when the load
  3897. // balancing scheme is EXTERNAL.
  3898. //
  3899. // When the load balancing scheme is INTERNAL, this field is not used.
  3900. PortName string `json:"portName,omitempty"`
  3901. // Protocol: The protocol this BackendService uses to communicate with
  3902. // backends.
  3903. //
  3904. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  3905. // HTTP.
  3906. //
  3907. // For internal load balancing, the possible values are TCP and UDP, and
  3908. // the default is TCP.
  3909. //
  3910. // Possible values:
  3911. // "HTTP"
  3912. // "HTTP2"
  3913. // "HTTPS"
  3914. // "SSL"
  3915. // "TCP"
  3916. // "UDP"
  3917. Protocol string `json:"protocol,omitempty"`
  3918. // Region: [Output Only] URL of the region where the regional backend
  3919. // service resides. This field is not applicable to global backend
  3920. // services. You must specify this field as part of the HTTP request
  3921. // URL. It is not settable as a field in the request body.
  3922. Region string `json:"region,omitempty"`
  3923. // SecurityPolicy: [Output Only] The resource URL for the security
  3924. // policy associated with this backend service.
  3925. SecurityPolicy string `json:"securityPolicy,omitempty"`
  3926. // SecuritySettings: This field specifies the security policy that
  3927. // applies to this backend service. This field is applicable to either:
  3928. //
  3929. // - A regional backend service with the service_protocol set to HTTP,
  3930. // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED.
  3931. //
  3932. // - A global backend service with the load_balancing_scheme set to
  3933. // INTERNAL_SELF_MANAGED.
  3934. SecuritySettings *SecuritySettings `json:"securitySettings,omitempty"`
  3935. // SelfLink: [Output Only] Server-defined URL for the resource.
  3936. SelfLink string `json:"selfLink,omitempty"`
  3937. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  3938. // with the resource id.
  3939. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  3940. // SessionAffinity: Type of session affinity to use. The default is
  3941. // NONE.
  3942. //
  3943. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  3944. // or GENERATED_COOKIE.
  3945. //
  3946. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  3947. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  3948. //
  3949. // When the protocol is UDP, this field is not used.
  3950. //
  3951. // Possible values:
  3952. // "CLIENT_IP"
  3953. // "CLIENT_IP_PORT_PROTO"
  3954. // "CLIENT_IP_PROTO"
  3955. // "GENERATED_COOKIE"
  3956. // "HEADER_FIELD"
  3957. // "HTTP_COOKIE"
  3958. // "NONE"
  3959. SessionAffinity string `json:"sessionAffinity,omitempty"`
  3960. // TimeoutSec: How many seconds to wait for the backend before
  3961. // considering it a failed request. Default is 30 seconds.
  3962. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  3963. // ServerResponse contains the HTTP response code and headers from the
  3964. // server.
  3965. googleapi.ServerResponse `json:"-"`
  3966. // ForceSendFields is a list of field names (e.g.
  3967. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  3968. // By default, fields with empty values are omitted from API requests.
  3969. // However, any non-pointer, non-interface field appearing in
  3970. // ForceSendFields will be sent to the server regardless of whether the
  3971. // field is empty or not. This may be used to include empty fields in
  3972. // Patch requests.
  3973. ForceSendFields []string `json:"-"`
  3974. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  3975. // include in API requests with the JSON null value. By default, fields
  3976. // with empty values are omitted from API requests. However, any field
  3977. // with an empty value appearing in NullFields will be sent to the
  3978. // server as null. It is an error if a field in this list has a
  3979. // non-empty value. This may be used to include null fields in Patch
  3980. // requests.
  3981. NullFields []string `json:"-"`
  3982. }
  3983. func (s *BackendService) MarshalJSON() ([]byte, error) {
  3984. type NoMethod BackendService
  3985. raw := NoMethod(*s)
  3986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3987. }
  3988. // BackendServiceAggregatedList: Contains a list of
  3989. // BackendServicesScopedList.
  3990. type BackendServiceAggregatedList struct {
  3991. // Id: [Output Only] Unique identifier for the resource; defined by the
  3992. // server.
  3993. Id string `json:"id,omitempty"`
  3994. // Items: A list of BackendServicesScopedList resources.
  3995. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  3996. // Kind: Type of resource.
  3997. Kind string `json:"kind,omitempty"`
  3998. // NextPageToken: [Output Only] This token allows you to get the next
  3999. // page of results for list requests. If the number of results is larger
  4000. // than maxResults, use the nextPageToken as a value for the query
  4001. // parameter pageToken in the next list request. Subsequent list
  4002. // requests will have their own nextPageToken to continue paging through
  4003. // the results.
  4004. NextPageToken string `json:"nextPageToken,omitempty"`
  4005. // SelfLink: [Output Only] Server-defined URL for this resource.
  4006. SelfLink string `json:"selfLink,omitempty"`
  4007. // Warning: [Output Only] Informational warning message.
  4008. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  4009. // ServerResponse contains the HTTP response code and headers from the
  4010. // server.
  4011. googleapi.ServerResponse `json:"-"`
  4012. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") 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 *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  4028. type NoMethod BackendServiceAggregatedList
  4029. raw := NoMethod(*s)
  4030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4031. }
  4032. // BackendServiceAggregatedListWarning: [Output Only] Informational
  4033. // warning message.
  4034. type BackendServiceAggregatedListWarning struct {
  4035. // Code: [Output Only] A warning code, if applicable. For example,
  4036. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4037. // the response.
  4038. //
  4039. // Possible values:
  4040. // "CLEANUP_FAILED"
  4041. // "DEPRECATED_RESOURCE_USED"
  4042. // "DEPRECATED_TYPE_USED"
  4043. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4044. // "EXPERIMENTAL_TYPE_USED"
  4045. // "EXTERNAL_API_WARNING"
  4046. // "FIELD_VALUE_OVERRIDEN"
  4047. // "INJECTED_KERNELS_DEPRECATED"
  4048. // "MISSING_TYPE_DEPENDENCY"
  4049. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4050. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4051. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4052. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4053. // "NEXT_HOP_NOT_RUNNING"
  4054. // "NOT_CRITICAL_ERROR"
  4055. // "NO_RESULTS_ON_PAGE"
  4056. // "REQUIRED_TOS_AGREEMENT"
  4057. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4058. // "RESOURCE_NOT_DELETED"
  4059. // "SCHEMA_VALIDATION_IGNORED"
  4060. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4061. // "UNDECLARED_PROPERTIES"
  4062. // "UNREACHABLE"
  4063. Code string `json:"code,omitempty"`
  4064. // Data: [Output Only] Metadata about this warning in key: value format.
  4065. // For example:
  4066. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4067. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  4068. // Message: [Output Only] A human-readable description of the warning
  4069. // code.
  4070. Message string `json:"message,omitempty"`
  4071. // ForceSendFields is a list of field names (e.g. "Code") to
  4072. // unconditionally include in API requests. By default, fields with
  4073. // empty values are omitted from API requests. However, any non-pointer,
  4074. // non-interface field appearing in ForceSendFields will be sent to the
  4075. // server regardless of whether the field is empty or not. This may be
  4076. // used to include empty fields in Patch requests.
  4077. ForceSendFields []string `json:"-"`
  4078. // NullFields is a list of field names (e.g. "Code") to include in API
  4079. // requests with the JSON null value. By default, fields with empty
  4080. // values are omitted from API requests. However, any field with an
  4081. // empty value appearing in NullFields will be sent to the server as
  4082. // null. It is an error if a field in this list has a non-empty value.
  4083. // This may be used to include null fields in Patch requests.
  4084. NullFields []string `json:"-"`
  4085. }
  4086. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4087. type NoMethod BackendServiceAggregatedListWarning
  4088. raw := NoMethod(*s)
  4089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4090. }
  4091. type BackendServiceAggregatedListWarningData struct {
  4092. // Key: [Output Only] A key that provides more detail on the warning
  4093. // being returned. For example, for warnings where there are no results
  4094. // in a list request for a particular zone, this key might be scope and
  4095. // the key value might be the zone name. Other examples might be a key
  4096. // indicating a deprecated resource and a suggested replacement, or a
  4097. // warning about invalid network settings (for example, if an instance
  4098. // attempts to perform IP forwarding but is not enabled for IP
  4099. // forwarding).
  4100. Key string `json:"key,omitempty"`
  4101. // Value: [Output Only] A warning data value corresponding to the key.
  4102. Value string `json:"value,omitempty"`
  4103. // ForceSendFields is a list of field names (e.g. "Key") to
  4104. // unconditionally include in API requests. By default, fields with
  4105. // empty values are omitted from API requests. However, any non-pointer,
  4106. // non-interface field appearing in ForceSendFields will be sent to the
  4107. // server regardless of whether the field is empty or not. This may be
  4108. // used to include empty fields in Patch requests.
  4109. ForceSendFields []string `json:"-"`
  4110. // NullFields is a list of field names (e.g. "Key") to include in API
  4111. // requests with the JSON null value. By default, fields with empty
  4112. // values are omitted from API requests. However, any field with an
  4113. // empty value appearing in NullFields will be sent to the server as
  4114. // null. It is an error if a field in this list has a non-empty value.
  4115. // This may be used to include null fields in Patch requests.
  4116. NullFields []string `json:"-"`
  4117. }
  4118. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4119. type NoMethod BackendServiceAggregatedListWarningData
  4120. raw := NoMethod(*s)
  4121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4122. }
  4123. // BackendServiceAppEngineBackend: Configuration of a App Engine
  4124. // backend.
  4125. type BackendServiceAppEngineBackend struct {
  4126. // AppEngineService: Optional. App Engine app service name.
  4127. AppEngineService string `json:"appEngineService,omitempty"`
  4128. // TargetProject: Required. Project ID of the project hosting the app.
  4129. // This is the project ID of this project. Reference to another project
  4130. // is not allowed.
  4131. TargetProject string `json:"targetProject,omitempty"`
  4132. // Version: Optional. Version of App Engine app service. When empty, App
  4133. // Engine will do its normal traffic split.
  4134. Version string `json:"version,omitempty"`
  4135. // ForceSendFields is a list of field names (e.g. "AppEngineService") to
  4136. // unconditionally include in API requests. By default, fields with
  4137. // empty values are omitted from API requests. However, any non-pointer,
  4138. // non-interface field appearing in ForceSendFields will be sent to the
  4139. // server regardless of whether the field is empty or not. This may be
  4140. // used to include empty fields in Patch requests.
  4141. ForceSendFields []string `json:"-"`
  4142. // NullFields is a list of field names (e.g. "AppEngineService") to
  4143. // include in API requests with the JSON null value. By default, fields
  4144. // with empty values are omitted from API requests. However, any field
  4145. // with an empty value appearing in NullFields will be sent to the
  4146. // server as null. It is an error if a field in this list has a
  4147. // non-empty value. This may be used to include null fields in Patch
  4148. // requests.
  4149. NullFields []string `json:"-"`
  4150. }
  4151. func (s *BackendServiceAppEngineBackend) MarshalJSON() ([]byte, error) {
  4152. type NoMethod BackendServiceAppEngineBackend
  4153. raw := NoMethod(*s)
  4154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4155. }
  4156. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  4157. // for a backend service.
  4158. type BackendServiceCdnPolicy struct {
  4159. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  4160. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  4161. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  4162. // signed URL request will be considered fresh. After this time period,
  4163. // the response will be revalidated before being served. Defaults to 1hr
  4164. // (3600s). When serving responses to signed URL requests, Cloud CDN
  4165. // will internally behave as though all responses from this backend had
  4166. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  4167. // existing Cache-Control header. The actual headers served in responses
  4168. // will not be altered.
  4169. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  4170. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  4171. // request URLs.
  4172. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  4173. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  4174. // unconditionally include in API requests. By default, fields with
  4175. // empty values are omitted from API requests. However, any non-pointer,
  4176. // non-interface field appearing in ForceSendFields will be sent to the
  4177. // server regardless of whether the field is empty or not. This may be
  4178. // used to include empty fields in Patch requests.
  4179. ForceSendFields []string `json:"-"`
  4180. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  4181. // include in API requests with the JSON null value. By default, fields
  4182. // with empty values are omitted from API requests. However, any field
  4183. // with an empty value appearing in NullFields will be sent to the
  4184. // server as null. It is an error if a field in this list has a
  4185. // non-empty value. This may be used to include null fields in Patch
  4186. // requests.
  4187. NullFields []string `json:"-"`
  4188. }
  4189. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  4190. type NoMethod BackendServiceCdnPolicy
  4191. raw := NoMethod(*s)
  4192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4193. }
  4194. // BackendServiceCloudFunctionBackend: Configuration of a Cloud Function
  4195. // backend.
  4196. type BackendServiceCloudFunctionBackend struct {
  4197. // FunctionName: Required. A cloud function name. Special value ?*?
  4198. // represents all cloud functions in the project.
  4199. FunctionName string `json:"functionName,omitempty"`
  4200. // TargetProject: Required. Project ID of the project hosting the cloud
  4201. // function.
  4202. TargetProject string `json:"targetProject,omitempty"`
  4203. // ForceSendFields is a list of field names (e.g. "FunctionName") to
  4204. // unconditionally include in API requests. By default, fields with
  4205. // empty values are omitted from API requests. However, any non-pointer,
  4206. // non-interface field appearing in ForceSendFields will be sent to the
  4207. // server regardless of whether the field is empty or not. This may be
  4208. // used to include empty fields in Patch requests.
  4209. ForceSendFields []string `json:"-"`
  4210. // NullFields is a list of field names (e.g. "FunctionName") to include
  4211. // in API requests with the JSON null value. By default, fields with
  4212. // empty values are omitted from API requests. However, any field with
  4213. // an empty value appearing in NullFields will be sent to the server as
  4214. // null. It is an error if a field in this list has a non-empty value.
  4215. // This may be used to include null fields in Patch requests.
  4216. NullFields []string `json:"-"`
  4217. }
  4218. func (s *BackendServiceCloudFunctionBackend) MarshalJSON() ([]byte, error) {
  4219. type NoMethod BackendServiceCloudFunctionBackend
  4220. raw := NoMethod(*s)
  4221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4222. }
  4223. type BackendServiceFailoverPolicy struct {
  4224. // DisableConnectionDrainOnFailover: On failover or failback, this field
  4225. // indicates whether connection drain will be honored. Setting this to
  4226. // true has the following effect: connections to the old active pool are
  4227. // not drained. Connections to the new active pool use the timeout of 10
  4228. // min (currently fixed). Setting to false has the following effect:
  4229. // both old and new connections will have a drain timeout of 10
  4230. // min.
  4231. //
  4232. // This can be set to true only if the protocol is TCP.
  4233. //
  4234. // The default is false.
  4235. DisableConnectionDrainOnFailover bool `json:"disableConnectionDrainOnFailover,omitempty"`
  4236. // DropTrafficIfUnhealthy: This option is used only when no healthy VMs
  4237. // are detected in the primary and backup instance groups. When set to
  4238. // true, traffic is dropped. When set to false, new connections are sent
  4239. // across all VMs in the primary group.
  4240. //
  4241. // The default is false.
  4242. DropTrafficIfUnhealthy bool `json:"dropTrafficIfUnhealthy,omitempty"`
  4243. // FailoverRatio: The value of the field must be in [0, 1]. If the ratio
  4244. // of the healthy VMs in the primary backend is at or below this number,
  4245. // traffic arriving at the load-balanced IP will be directed to the
  4246. // failover backend.
  4247. //
  4248. // In case where 'failoverRatio' is not set or all the VMs in the backup
  4249. // backend are unhealthy, the traffic will be directed back to the
  4250. // primary backend in the "force" mode, where traffic will be spread to
  4251. // the healthy VMs with the best effort, or to all VMs when no VM is
  4252. // healthy.
  4253. //
  4254. // This field is only used with l4 load balancing.
  4255. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  4256. // ForceSendFields is a list of field names (e.g.
  4257. // "DisableConnectionDrainOnFailover") to unconditionally include in API
  4258. // requests. By default, fields with empty values are omitted from API
  4259. // requests. However, any non-pointer, non-interface field appearing in
  4260. // ForceSendFields will be sent to the server regardless of whether the
  4261. // field is empty or not. This may be used to include empty fields in
  4262. // Patch requests.
  4263. ForceSendFields []string `json:"-"`
  4264. // NullFields is a list of field names (e.g.
  4265. // "DisableConnectionDrainOnFailover") to include in API requests with
  4266. // the JSON null value. By default, fields with empty values are omitted
  4267. // from API requests. However, any field with an empty value appearing
  4268. // in NullFields will be sent to the server as null. It is an error if a
  4269. // field in this list has a non-empty value. This may be used to include
  4270. // null fields in Patch requests.
  4271. NullFields []string `json:"-"`
  4272. }
  4273. func (s *BackendServiceFailoverPolicy) MarshalJSON() ([]byte, error) {
  4274. type NoMethod BackendServiceFailoverPolicy
  4275. raw := NoMethod(*s)
  4276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4277. }
  4278. func (s *BackendServiceFailoverPolicy) UnmarshalJSON(data []byte) error {
  4279. type NoMethod BackendServiceFailoverPolicy
  4280. var s1 struct {
  4281. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  4282. *NoMethod
  4283. }
  4284. s1.NoMethod = (*NoMethod)(s)
  4285. if err := json.Unmarshal(data, &s1); err != nil {
  4286. return err
  4287. }
  4288. s.FailoverRatio = float64(s1.FailoverRatio)
  4289. return nil
  4290. }
  4291. type BackendServiceGroupHealth struct {
  4292. // Annotations: Metadata defined as annotations on the network endpoint
  4293. // group.
  4294. Annotations map[string]string `json:"annotations,omitempty"`
  4295. // HealthStatus: Health state of the backend instances or endpoints in
  4296. // requested instance or network endpoint group, determined based on
  4297. // configured health checks.
  4298. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  4299. // Kind: [Output Only] Type of resource. Always
  4300. // compute#backendServiceGroupHealth for the health of backend services.
  4301. Kind string `json:"kind,omitempty"`
  4302. // ServerResponse contains the HTTP response code and headers from the
  4303. // server.
  4304. googleapi.ServerResponse `json:"-"`
  4305. // ForceSendFields is a list of field names (e.g. "Annotations") to
  4306. // unconditionally include in API requests. By default, fields with
  4307. // empty values are omitted from API requests. However, any non-pointer,
  4308. // non-interface field appearing in ForceSendFields will be sent to the
  4309. // server regardless of whether the field is empty or not. This may be
  4310. // used to include empty fields in Patch requests.
  4311. ForceSendFields []string `json:"-"`
  4312. // NullFields is a list of field names (e.g. "Annotations") to include
  4313. // in API requests with the JSON null value. By default, fields with
  4314. // empty values are omitted from API requests. However, any field with
  4315. // an empty value appearing in NullFields will be sent to the server as
  4316. // null. It is an error if a field in this list has a non-empty value.
  4317. // This may be used to include null fields in Patch requests.
  4318. NullFields []string `json:"-"`
  4319. }
  4320. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  4321. type NoMethod BackendServiceGroupHealth
  4322. raw := NoMethod(*s)
  4323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4324. }
  4325. // BackendServiceIAP: Identity-Aware Proxy
  4326. type BackendServiceIAP struct {
  4327. Enabled bool `json:"enabled,omitempty"`
  4328. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  4329. // Oauth2ClientInfo: [Input Only] OAuth client info required to generate
  4330. // client id to be used for IAP.
  4331. Oauth2ClientInfo *BackendServiceIAPOAuth2ClientInfo `json:"oauth2ClientInfo,omitempty"`
  4332. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  4333. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  4334. // field oauth2_client_secret above.
  4335. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  4336. // ForceSendFields is a list of field names (e.g. "Enabled") to
  4337. // unconditionally include in API requests. By default, fields with
  4338. // empty values are omitted from API requests. However, any non-pointer,
  4339. // non-interface field appearing in ForceSendFields will be sent to the
  4340. // server regardless of whether the field is empty or not. This may be
  4341. // used to include empty fields in Patch requests.
  4342. ForceSendFields []string `json:"-"`
  4343. // NullFields is a list of field names (e.g. "Enabled") to include in
  4344. // API requests with the JSON null value. By default, fields with empty
  4345. // values are omitted from API requests. However, any field with an
  4346. // empty value appearing in NullFields will be sent to the server as
  4347. // null. It is an error if a field in this list has a non-empty value.
  4348. // This may be used to include null fields in Patch requests.
  4349. NullFields []string `json:"-"`
  4350. }
  4351. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  4352. type NoMethod BackendServiceIAP
  4353. raw := NoMethod(*s)
  4354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4355. }
  4356. type BackendServiceIAPOAuth2ClientInfo struct {
  4357. // ApplicationName: Application name to be used in OAuth consent screen.
  4358. ApplicationName string `json:"applicationName,omitempty"`
  4359. // ClientName: Name of the client to be generated. Optional - If not
  4360. // provided, the name will be autogenerated by the backend.
  4361. ClientName string `json:"clientName,omitempty"`
  4362. // DeveloperEmailAddress: Developer's information to be used in OAuth
  4363. // consent screen.
  4364. DeveloperEmailAddress string `json:"developerEmailAddress,omitempty"`
  4365. // ForceSendFields is a list of field names (e.g. "ApplicationName") to
  4366. // unconditionally include in API requests. By default, fields with
  4367. // empty values are omitted from API requests. However, any non-pointer,
  4368. // non-interface field appearing in ForceSendFields will be sent to the
  4369. // server regardless of whether the field is empty or not. This may be
  4370. // used to include empty fields in Patch requests.
  4371. ForceSendFields []string `json:"-"`
  4372. // NullFields is a list of field names (e.g. "ApplicationName") to
  4373. // include in API requests with the JSON null value. By default, fields
  4374. // with empty values are omitted from API requests. However, any field
  4375. // with an empty value appearing in NullFields will be sent to the
  4376. // server as null. It is an error if a field in this list has a
  4377. // non-empty value. This may be used to include null fields in Patch
  4378. // requests.
  4379. NullFields []string `json:"-"`
  4380. }
  4381. func (s *BackendServiceIAPOAuth2ClientInfo) MarshalJSON() ([]byte, error) {
  4382. type NoMethod BackendServiceIAPOAuth2ClientInfo
  4383. raw := NoMethod(*s)
  4384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4385. }
  4386. // BackendServiceList: Contains a list of BackendService resources.
  4387. type BackendServiceList struct {
  4388. // Id: [Output Only] Unique identifier for the resource; defined by the
  4389. // server.
  4390. Id string `json:"id,omitempty"`
  4391. // Items: A list of BackendService resources.
  4392. Items []*BackendService `json:"items,omitempty"`
  4393. // Kind: [Output Only] Type of resource. Always
  4394. // compute#backendServiceList for lists of backend services.
  4395. Kind string `json:"kind,omitempty"`
  4396. // NextPageToken: [Output Only] This token allows you to get the next
  4397. // page of results for list requests. If the number of results is larger
  4398. // than maxResults, use the nextPageToken as a value for the query
  4399. // parameter pageToken in the next list request. Subsequent list
  4400. // requests will have their own nextPageToken to continue paging through
  4401. // the results.
  4402. NextPageToken string `json:"nextPageToken,omitempty"`
  4403. // SelfLink: [Output Only] Server-defined URL for this resource.
  4404. SelfLink string `json:"selfLink,omitempty"`
  4405. // Warning: [Output Only] Informational warning message.
  4406. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  4407. // ServerResponse contains the HTTP response code and headers from the
  4408. // server.
  4409. googleapi.ServerResponse `json:"-"`
  4410. // ForceSendFields is a list of field names (e.g. "Id") to
  4411. // unconditionally include in API requests. By default, fields with
  4412. // empty values are omitted from API requests. However, any non-pointer,
  4413. // non-interface field appearing in ForceSendFields will be sent to the
  4414. // server regardless of whether the field is empty or not. This may be
  4415. // used to include empty fields in Patch requests.
  4416. ForceSendFields []string `json:"-"`
  4417. // NullFields is a list of field names (e.g. "Id") to include in API
  4418. // requests with the JSON null value. By default, fields with empty
  4419. // values are omitted from API requests. However, any field with an
  4420. // empty value appearing in NullFields will be sent to the server as
  4421. // null. It is an error if a field in this list has a non-empty value.
  4422. // This may be used to include null fields in Patch requests.
  4423. NullFields []string `json:"-"`
  4424. }
  4425. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  4426. type NoMethod BackendServiceList
  4427. raw := NoMethod(*s)
  4428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4429. }
  4430. // BackendServiceListWarning: [Output Only] Informational warning
  4431. // message.
  4432. type BackendServiceListWarning struct {
  4433. // Code: [Output Only] A warning code, if applicable. For example,
  4434. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4435. // the response.
  4436. //
  4437. // Possible values:
  4438. // "CLEANUP_FAILED"
  4439. // "DEPRECATED_RESOURCE_USED"
  4440. // "DEPRECATED_TYPE_USED"
  4441. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4442. // "EXPERIMENTAL_TYPE_USED"
  4443. // "EXTERNAL_API_WARNING"
  4444. // "FIELD_VALUE_OVERRIDEN"
  4445. // "INJECTED_KERNELS_DEPRECATED"
  4446. // "MISSING_TYPE_DEPENDENCY"
  4447. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4448. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4449. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4450. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4451. // "NEXT_HOP_NOT_RUNNING"
  4452. // "NOT_CRITICAL_ERROR"
  4453. // "NO_RESULTS_ON_PAGE"
  4454. // "REQUIRED_TOS_AGREEMENT"
  4455. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4456. // "RESOURCE_NOT_DELETED"
  4457. // "SCHEMA_VALIDATION_IGNORED"
  4458. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4459. // "UNDECLARED_PROPERTIES"
  4460. // "UNREACHABLE"
  4461. Code string `json:"code,omitempty"`
  4462. // Data: [Output Only] Metadata about this warning in key: value format.
  4463. // For example:
  4464. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4465. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  4466. // Message: [Output Only] A human-readable description of the warning
  4467. // code.
  4468. Message string `json:"message,omitempty"`
  4469. // ForceSendFields is a list of field names (e.g. "Code") to
  4470. // unconditionally include in API requests. By default, fields with
  4471. // empty values are omitted from API requests. However, any non-pointer,
  4472. // non-interface field appearing in ForceSendFields will be sent to the
  4473. // server regardless of whether the field is empty or not. This may be
  4474. // used to include empty fields in Patch requests.
  4475. ForceSendFields []string `json:"-"`
  4476. // NullFields is a list of field names (e.g. "Code") to include in API
  4477. // requests with the JSON null value. By default, fields with empty
  4478. // values are omitted from API requests. However, any field with an
  4479. // empty value appearing in NullFields will be sent to the server as
  4480. // null. It is an error if a field in this list has a non-empty value.
  4481. // This may be used to include null fields in Patch requests.
  4482. NullFields []string `json:"-"`
  4483. }
  4484. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  4485. type NoMethod BackendServiceListWarning
  4486. raw := NoMethod(*s)
  4487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4488. }
  4489. type BackendServiceListWarningData struct {
  4490. // Key: [Output Only] A key that provides more detail on the warning
  4491. // being returned. For example, for warnings where there are no results
  4492. // in a list request for a particular zone, this key might be scope and
  4493. // the key value might be the zone name. Other examples might be a key
  4494. // indicating a deprecated resource and a suggested replacement, or a
  4495. // warning about invalid network settings (for example, if an instance
  4496. // attempts to perform IP forwarding but is not enabled for IP
  4497. // forwarding).
  4498. Key string `json:"key,omitempty"`
  4499. // Value: [Output Only] A warning data value corresponding to the key.
  4500. Value string `json:"value,omitempty"`
  4501. // ForceSendFields is a list of field names (e.g. "Key") to
  4502. // unconditionally include in API requests. By default, fields with
  4503. // empty values are omitted from API requests. However, any non-pointer,
  4504. // non-interface field appearing in ForceSendFields will be sent to the
  4505. // server regardless of whether the field is empty or not. This may be
  4506. // used to include empty fields in Patch requests.
  4507. ForceSendFields []string `json:"-"`
  4508. // NullFields is a list of field names (e.g. "Key") to include in API
  4509. // requests with the JSON null value. By default, fields with empty
  4510. // values are omitted from API requests. However, any field with an
  4511. // empty value appearing in NullFields will be sent to the server as
  4512. // null. It is an error if a field in this list has a non-empty value.
  4513. // This may be used to include null fields in Patch requests.
  4514. NullFields []string `json:"-"`
  4515. }
  4516. func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  4517. type NoMethod BackendServiceListWarningData
  4518. raw := NoMethod(*s)
  4519. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4520. }
  4521. // BackendServiceLogConfig: The available logging options for the load
  4522. // balancer traffic served by this backend service.
  4523. type BackendServiceLogConfig struct {
  4524. // Enable: This field denotes whether to enable logging for the load
  4525. // balancer traffic served by this backend service.
  4526. Enable bool `json:"enable,omitempty"`
  4527. // SampleRate: This field can only be specified if logging is enabled
  4528. // for this backend service. The value of the field must be in [0, 1].
  4529. // This configures the sampling rate of requests to the load balancer
  4530. // where 1.0 means all logged requests are reported and 0.0 means no
  4531. // logged requests are reported. The default value is 1.0.
  4532. SampleRate float64 `json:"sampleRate,omitempty"`
  4533. // ForceSendFields is a list of field names (e.g. "Enable") to
  4534. // unconditionally include in API requests. By default, fields with
  4535. // empty values are omitted from API requests. However, any non-pointer,
  4536. // non-interface field appearing in ForceSendFields will be sent to the
  4537. // server regardless of whether the field is empty or not. This may be
  4538. // used to include empty fields in Patch requests.
  4539. ForceSendFields []string `json:"-"`
  4540. // NullFields is a list of field names (e.g. "Enable") to include in API
  4541. // requests with the JSON null value. By default, fields with empty
  4542. // values are omitted from API requests. However, any field with an
  4543. // empty value appearing in NullFields will be sent to the server as
  4544. // null. It is an error if a field in this list has a non-empty value.
  4545. // This may be used to include null fields in Patch requests.
  4546. NullFields []string `json:"-"`
  4547. }
  4548. func (s *BackendServiceLogConfig) MarshalJSON() ([]byte, error) {
  4549. type NoMethod BackendServiceLogConfig
  4550. raw := NoMethod(*s)
  4551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4552. }
  4553. func (s *BackendServiceLogConfig) UnmarshalJSON(data []byte) error {
  4554. type NoMethod BackendServiceLogConfig
  4555. var s1 struct {
  4556. SampleRate gensupport.JSONFloat64 `json:"sampleRate"`
  4557. *NoMethod
  4558. }
  4559. s1.NoMethod = (*NoMethod)(s)
  4560. if err := json.Unmarshal(data, &s1); err != nil {
  4561. return err
  4562. }
  4563. s.SampleRate = float64(s1.SampleRate)
  4564. return nil
  4565. }
  4566. type BackendServiceReference struct {
  4567. BackendService string `json:"backendService,omitempty"`
  4568. // ForceSendFields is a list of field names (e.g. "BackendService") to
  4569. // unconditionally include in API requests. By default, fields with
  4570. // empty values are omitted from API requests. However, any non-pointer,
  4571. // non-interface field appearing in ForceSendFields will be sent to the
  4572. // server regardless of whether the field is empty or not. This may be
  4573. // used to include empty fields in Patch requests.
  4574. ForceSendFields []string `json:"-"`
  4575. // NullFields is a list of field names (e.g. "BackendService") to
  4576. // include in API requests with the JSON null value. By default, fields
  4577. // with empty values are omitted from API requests. However, any field
  4578. // with an empty value appearing in NullFields will be sent to the
  4579. // server as null. It is an error if a field in this list has a
  4580. // non-empty value. This may be used to include null fields in Patch
  4581. // requests.
  4582. NullFields []string `json:"-"`
  4583. }
  4584. func (s *BackendServiceReference) MarshalJSON() ([]byte, error) {
  4585. type NoMethod BackendServiceReference
  4586. raw := NoMethod(*s)
  4587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4588. }
  4589. type BackendServicesScopedList struct {
  4590. // BackendServices: A list of BackendServices contained in this scope.
  4591. BackendServices []*BackendService `json:"backendServices,omitempty"`
  4592. // Warning: Informational warning which replaces the list of backend
  4593. // services when the list is empty.
  4594. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  4595. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  4596. // unconditionally include in API requests. By default, fields with
  4597. // empty values are omitted from API requests. However, any non-pointer,
  4598. // non-interface field appearing in ForceSendFields will be sent to the
  4599. // server regardless of whether the field is empty or not. This may be
  4600. // used to include empty fields in Patch requests.
  4601. ForceSendFields []string `json:"-"`
  4602. // NullFields is a list of field names (e.g. "BackendServices") to
  4603. // include in API requests with the JSON null value. By default, fields
  4604. // with empty values are omitted from API requests. However, any field
  4605. // with an empty value appearing in NullFields will be sent to the
  4606. // server as null. It is an error if a field in this list has a
  4607. // non-empty value. This may be used to include null fields in Patch
  4608. // requests.
  4609. NullFields []string `json:"-"`
  4610. }
  4611. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  4612. type NoMethod BackendServicesScopedList
  4613. raw := NoMethod(*s)
  4614. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4615. }
  4616. // BackendServicesScopedListWarning: Informational warning which
  4617. // replaces the list of backend services when the list is empty.
  4618. type BackendServicesScopedListWarning struct {
  4619. // Code: [Output Only] A warning code, if applicable. For example,
  4620. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4621. // the response.
  4622. //
  4623. // Possible values:
  4624. // "CLEANUP_FAILED"
  4625. // "DEPRECATED_RESOURCE_USED"
  4626. // "DEPRECATED_TYPE_USED"
  4627. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4628. // "EXPERIMENTAL_TYPE_USED"
  4629. // "EXTERNAL_API_WARNING"
  4630. // "FIELD_VALUE_OVERRIDEN"
  4631. // "INJECTED_KERNELS_DEPRECATED"
  4632. // "MISSING_TYPE_DEPENDENCY"
  4633. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4634. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4635. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4636. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4637. // "NEXT_HOP_NOT_RUNNING"
  4638. // "NOT_CRITICAL_ERROR"
  4639. // "NO_RESULTS_ON_PAGE"
  4640. // "REQUIRED_TOS_AGREEMENT"
  4641. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4642. // "RESOURCE_NOT_DELETED"
  4643. // "SCHEMA_VALIDATION_IGNORED"
  4644. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4645. // "UNDECLARED_PROPERTIES"
  4646. // "UNREACHABLE"
  4647. Code string `json:"code,omitempty"`
  4648. // Data: [Output Only] Metadata about this warning in key: value format.
  4649. // For example:
  4650. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4651. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  4652. // Message: [Output Only] A human-readable description of the warning
  4653. // code.
  4654. Message string `json:"message,omitempty"`
  4655. // ForceSendFields is a list of field names (e.g. "Code") to
  4656. // unconditionally include in API requests. By default, fields with
  4657. // empty values are omitted from API requests. However, any non-pointer,
  4658. // non-interface field appearing in ForceSendFields will be sent to the
  4659. // server regardless of whether the field is empty or not. This may be
  4660. // used to include empty fields in Patch requests.
  4661. ForceSendFields []string `json:"-"`
  4662. // NullFields is a list of field names (e.g. "Code") to include in API
  4663. // requests with the JSON null value. By default, fields with empty
  4664. // values are omitted from API requests. However, any field with an
  4665. // empty value appearing in NullFields will be sent to the server as
  4666. // null. It is an error if a field in this list has a non-empty value.
  4667. // This may be used to include null fields in Patch requests.
  4668. NullFields []string `json:"-"`
  4669. }
  4670. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  4671. type NoMethod BackendServicesScopedListWarning
  4672. raw := NoMethod(*s)
  4673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4674. }
  4675. type BackendServicesScopedListWarningData struct {
  4676. // Key: [Output Only] A key that provides more detail on the warning
  4677. // being returned. For example, for warnings where there are no results
  4678. // in a list request for a particular zone, this key might be scope and
  4679. // the key value might be the zone name. Other examples might be a key
  4680. // indicating a deprecated resource and a suggested replacement, or a
  4681. // warning about invalid network settings (for example, if an instance
  4682. // attempts to perform IP forwarding but is not enabled for IP
  4683. // forwarding).
  4684. Key string `json:"key,omitempty"`
  4685. // Value: [Output Only] A warning data value corresponding to the key.
  4686. Value string `json:"value,omitempty"`
  4687. // ForceSendFields is a list of field names (e.g. "Key") to
  4688. // unconditionally include in API requests. By default, fields with
  4689. // empty values are omitted from API requests. However, any non-pointer,
  4690. // non-interface field appearing in ForceSendFields will be sent to the
  4691. // server regardless of whether the field is empty or not. This may be
  4692. // used to include empty fields in Patch requests.
  4693. ForceSendFields []string `json:"-"`
  4694. // NullFields is a list of field names (e.g. "Key") to include in API
  4695. // requests with the JSON null value. By default, fields with empty
  4696. // values are omitted from API requests. However, any field with an
  4697. // empty value appearing in NullFields will be sent to the server as
  4698. // null. It is an error if a field in this list has a non-empty value.
  4699. // This may be used to include null fields in Patch requests.
  4700. NullFields []string `json:"-"`
  4701. }
  4702. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  4703. type NoMethod BackendServicesScopedListWarningData
  4704. raw := NoMethod(*s)
  4705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4706. }
  4707. // Binding: Associates `members` with a `role`.
  4708. type Binding struct {
  4709. // Condition: The condition that is associated with this binding. NOTE:
  4710. // An unsatisfied condition will not allow user access via current
  4711. // binding. Different bindings, including their conditions, are examined
  4712. // independently.
  4713. Condition *Expr `json:"condition,omitempty"`
  4714. // Members: Specifies the identities requesting access for a Cloud
  4715. // Platform resource. `members` can have the following values:
  4716. //
  4717. // * `allUsers`: A special identifier that represents anyone who is on
  4718. // the internet; with or without a Google account.
  4719. //
  4720. // * `allAuthenticatedUsers`: A special identifier that represents
  4721. // anyone who is authenticated with a Google account or a service
  4722. // account.
  4723. //
  4724. // * `user:{emailid}`: An email address that represents a specific
  4725. // Google account. For example, `alice@gmail.com` .
  4726. //
  4727. //
  4728. //
  4729. // * `serviceAccount:{emailid}`: An email address that represents a
  4730. // service account. For example,
  4731. // `my-other-app@appspot.gserviceaccount.com`.
  4732. //
  4733. // * `group:{emailid}`: An email address that represents a Google group.
  4734. // For example, `admins@example.com`.
  4735. //
  4736. //
  4737. //
  4738. // * `domain:{domain}`: The G Suite domain (primary) that represents all
  4739. // the users of that domain. For example, `google.com` or `example.com`.
  4740. Members []string `json:"members,omitempty"`
  4741. // Role: Role that is assigned to `members`. For example,
  4742. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  4743. Role string `json:"role,omitempty"`
  4744. // ForceSendFields is a list of field names (e.g. "Condition") to
  4745. // unconditionally include in API requests. By default, fields with
  4746. // empty values are omitted from API requests. However, any non-pointer,
  4747. // non-interface field appearing in ForceSendFields will be sent to the
  4748. // server regardless of whether the field is empty or not. This may be
  4749. // used to include empty fields in Patch requests.
  4750. ForceSendFields []string `json:"-"`
  4751. // NullFields is a list of field names (e.g. "Condition") to include in
  4752. // API requests with the JSON null value. By default, fields with empty
  4753. // values are omitted from API requests. However, any field with an
  4754. // empty value appearing in NullFields will be sent to the server as
  4755. // null. It is an error if a field in this list has a non-empty value.
  4756. // This may be used to include null fields in Patch requests.
  4757. NullFields []string `json:"-"`
  4758. }
  4759. func (s *Binding) MarshalJSON() ([]byte, error) {
  4760. type NoMethod Binding
  4761. raw := NoMethod(*s)
  4762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4763. }
  4764. type CacheInvalidationRule struct {
  4765. // Host: If set, this invalidation rule will only apply to requests with
  4766. // a Host header matching host.
  4767. Host string `json:"host,omitempty"`
  4768. Path string `json:"path,omitempty"`
  4769. // ForceSendFields is a list of field names (e.g. "Host") to
  4770. // unconditionally include in API requests. By default, fields with
  4771. // empty values are omitted from API requests. However, any non-pointer,
  4772. // non-interface field appearing in ForceSendFields will be sent to the
  4773. // server regardless of whether the field is empty or not. This may be
  4774. // used to include empty fields in Patch requests.
  4775. ForceSendFields []string `json:"-"`
  4776. // NullFields is a list of field names (e.g. "Host") to include in API
  4777. // requests with the JSON null value. By default, fields with empty
  4778. // values are omitted from API requests. However, any field with an
  4779. // empty value appearing in NullFields will be sent to the server as
  4780. // null. It is an error if a field in this list has a non-empty value.
  4781. // This may be used to include null fields in Patch requests.
  4782. NullFields []string `json:"-"`
  4783. }
  4784. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  4785. type NoMethod CacheInvalidationRule
  4786. raw := NoMethod(*s)
  4787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4788. }
  4789. // CacheKeyPolicy: Message containing what to include in the cache key
  4790. // for a request for Cloud CDN.
  4791. type CacheKeyPolicy struct {
  4792. // IncludeHost: If true, requests to different hosts will be cached
  4793. // separately.
  4794. IncludeHost bool `json:"includeHost,omitempty"`
  4795. // IncludeProtocol: If true, http and https requests will be cached
  4796. // separately.
  4797. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  4798. // IncludeQueryString: If true, include query string parameters in the
  4799. // cache key according to query_string_whitelist and
  4800. // query_string_blacklist. If neither is set, the entire query string
  4801. // will be included. If false, the query string will be excluded from
  4802. // the cache key entirely.
  4803. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  4804. // QueryStringBlacklist: Names of query string parameters to exclude in
  4805. // cache keys. All other parameters will be included. Either specify
  4806. // query_string_whitelist or query_string_blacklist, not both. '&' and
  4807. // '=' will be percent encoded and not treated as delimiters.
  4808. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  4809. // QueryStringWhitelist: Names of query string parameters to include in
  4810. // cache keys. All other parameters will be excluded. Either specify
  4811. // query_string_whitelist or query_string_blacklist, not both. '&' and
  4812. // '=' will be percent encoded and not treated as delimiters.
  4813. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  4814. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  4815. // unconditionally include in API requests. By default, fields with
  4816. // empty values are omitted from API requests. However, any non-pointer,
  4817. // non-interface field appearing in ForceSendFields will be sent to the
  4818. // server regardless of whether the field is empty or not. This may be
  4819. // used to include empty fields in Patch requests.
  4820. ForceSendFields []string `json:"-"`
  4821. // NullFields is a list of field names (e.g. "IncludeHost") to include
  4822. // in API requests with the JSON null value. By default, fields with
  4823. // empty values are omitted from API requests. However, any field with
  4824. // an empty value appearing in NullFields will be sent to the server as
  4825. // null. It is an error if a field in this list has a non-empty value.
  4826. // This may be used to include null fields in Patch requests.
  4827. NullFields []string `json:"-"`
  4828. }
  4829. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  4830. type NoMethod CacheKeyPolicy
  4831. raw := NoMethod(*s)
  4832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4833. }
  4834. // CallCredentials: gRPC call credentials to access the SDS server.
  4835. type CallCredentials struct {
  4836. // AccessToken: The access token that is used as call credential for the
  4837. // SDS server. This field is used only if callCredentialType is
  4838. // ACCESS_TOKEN.
  4839. AccessToken string `json:"accessToken,omitempty"`
  4840. // CallCredentialType: The type of call credentials to use for GRPC
  4841. // requests to the SDS server. This field can be set to one of the
  4842. // following: ACCESS_TOKEN: An access token is used as call credentials
  4843. // for the SDS server. GCE_VM: The local GCE VM service account
  4844. // credentials are used to access the SDS server. JWT_SERVICE_TOKEN: The
  4845. // user provisioned service account credentials are used to access the
  4846. // SDS server. FROM_PLUGIN: Custom authenticator credentials are used to
  4847. // access the SDS server.
  4848. //
  4849. // Possible values:
  4850. // "ACCESS_TOKEN"
  4851. // "FROM_PLUGIN"
  4852. // "GCE_VM"
  4853. // "INVALID"
  4854. // "JWT_SERVICE_ACCOUNT"
  4855. CallCredentialType string `json:"callCredentialType,omitempty"`
  4856. // FromPlugin: Custom authenticator credentials.
  4857. FromPlugin *MetadataCredentialsFromPlugin `json:"fromPlugin,omitempty"`
  4858. // JwtServiceAccount: This service account credentials are used as call
  4859. // credentials for the SDS server. This field is used only if
  4860. // callCredentialType is JWT_SERVICE_ACCOUNT.
  4861. JwtServiceAccount *ServiceAccountJwtAccessCredentials `json:"jwtServiceAccount,omitempty"`
  4862. // ForceSendFields is a list of field names (e.g. "AccessToken") to
  4863. // unconditionally include in API requests. By default, fields with
  4864. // empty values are omitted from API requests. However, any non-pointer,
  4865. // non-interface field appearing in ForceSendFields will be sent to the
  4866. // server regardless of whether the field is empty or not. This may be
  4867. // used to include empty fields in Patch requests.
  4868. ForceSendFields []string `json:"-"`
  4869. // NullFields is a list of field names (e.g. "AccessToken") to include
  4870. // in API requests with the JSON null value. By default, fields with
  4871. // empty values are omitted from API requests. However, any field with
  4872. // an empty value appearing in NullFields will be sent to the server as
  4873. // null. It is an error if a field in this list has a non-empty value.
  4874. // This may be used to include null fields in Patch requests.
  4875. NullFields []string `json:"-"`
  4876. }
  4877. func (s *CallCredentials) MarshalJSON() ([]byte, error) {
  4878. type NoMethod CallCredentials
  4879. raw := NoMethod(*s)
  4880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4881. }
  4882. // ChannelCredentials: gRPC channel credentials to access the SDS
  4883. // server.
  4884. type ChannelCredentials struct {
  4885. // Certificates: The call credentials to access the SDS server.
  4886. Certificates *TlsCertificatePaths `json:"certificates,omitempty"`
  4887. // ChannelCredentialType: The channel credentials to access the SDS
  4888. // server. This field can be set to one of the following: CERTIFICATES:
  4889. // Use TLS certificates to access the SDS server. GCE_VM: Use local GCE
  4890. // VM credentials to access the SDS server.
  4891. //
  4892. // Possible values:
  4893. // "CERTIFICATES"
  4894. // "GCE_VM"
  4895. // "INVALID"
  4896. ChannelCredentialType string `json:"channelCredentialType,omitempty"`
  4897. // ForceSendFields is a list of field names (e.g. "Certificates") to
  4898. // unconditionally include in API requests. By default, fields with
  4899. // empty values are omitted from API requests. However, any non-pointer,
  4900. // non-interface field appearing in ForceSendFields will be sent to the
  4901. // server regardless of whether the field is empty or not. This may be
  4902. // used to include empty fields in Patch requests.
  4903. ForceSendFields []string `json:"-"`
  4904. // NullFields is a list of field names (e.g. "Certificates") to include
  4905. // in API requests with the JSON null value. By default, fields with
  4906. // empty values are omitted from API requests. However, any field with
  4907. // an empty value appearing in NullFields will be sent to the server as
  4908. // null. It is an error if a field in this list has a non-empty value.
  4909. // This may be used to include null fields in Patch requests.
  4910. NullFields []string `json:"-"`
  4911. }
  4912. func (s *ChannelCredentials) MarshalJSON() ([]byte, error) {
  4913. type NoMethod ChannelCredentials
  4914. raw := NoMethod(*s)
  4915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4916. }
  4917. // CircuitBreakers: Settings controlling the volume of connections to a
  4918. // backend service.
  4919. type CircuitBreakers struct {
  4920. // ConnectTimeout: The timeout for new network connections to hosts.
  4921. ConnectTimeout *Duration `json:"connectTimeout,omitempty"`
  4922. // MaxConnections: The maximum number of connections to the backend
  4923. // cluster. If not specified, the default is 1024.
  4924. MaxConnections int64 `json:"maxConnections,omitempty"`
  4925. // MaxPendingRequests: The maximum number of pending requests allowed to
  4926. // the backend cluster. If not specified, the default is 1024.
  4927. MaxPendingRequests int64 `json:"maxPendingRequests,omitempty"`
  4928. // MaxRequests: The maximum number of parallel requests that allowed to
  4929. // the backend cluster. If not specified, the default is 1024.
  4930. MaxRequests int64 `json:"maxRequests,omitempty"`
  4931. // MaxRequestsPerConnection: Maximum requests for a single backend
  4932. // connection. This parameter is respected by both the HTTP/1.1 and
  4933. // HTTP/2 implementations. If not specified, there is no limit. Setting
  4934. // this parameter to 1 will effectively disable keep alive.
  4935. MaxRequestsPerConnection int64 `json:"maxRequestsPerConnection,omitempty"`
  4936. // MaxRetries: The maximum number of parallel retries allowed to the
  4937. // backend cluster. If not specified, the default is 3.
  4938. MaxRetries int64 `json:"maxRetries,omitempty"`
  4939. // ForceSendFields is a list of field names (e.g. "ConnectTimeout") to
  4940. // unconditionally include in API requests. By default, fields with
  4941. // empty values are omitted from API requests. However, any non-pointer,
  4942. // non-interface field appearing in ForceSendFields will be sent to the
  4943. // server regardless of whether the field is empty or not. This may be
  4944. // used to include empty fields in Patch requests.
  4945. ForceSendFields []string `json:"-"`
  4946. // NullFields is a list of field names (e.g. "ConnectTimeout") to
  4947. // include in API requests with the JSON null value. By default, fields
  4948. // with empty values are omitted from API requests. However, any field
  4949. // with an empty value appearing in NullFields will be sent to the
  4950. // server as null. It is an error if a field in this list has a
  4951. // non-empty value. This may be used to include null fields in Patch
  4952. // requests.
  4953. NullFields []string `json:"-"`
  4954. }
  4955. func (s *CircuitBreakers) MarshalJSON() ([]byte, error) {
  4956. type NoMethod CircuitBreakers
  4957. raw := NoMethod(*s)
  4958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4959. }
  4960. // ClientTlsSettings: The client side authentication settings for
  4961. // connection originating from the backend service.
  4962. type ClientTlsSettings struct {
  4963. // ClientTlsContext: Configures the mechanism to obtain client-side
  4964. // security certificates and identity information. This field is only
  4965. // applicable when mode is set to MUTUAL.
  4966. ClientTlsContext *TlsContext `json:"clientTlsContext,omitempty"`
  4967. // Mode: Indicates whether connections to this port should be secured
  4968. // using TLS. The value of this field determines how TLS is enforced.
  4969. // This can be set to one of the following values: DISABLE: Do not setup
  4970. // a TLS connection to the backends. SIMPLE: Originate a TLS connection
  4971. // to the backends. MUTUAL: Secure connections to the backends using
  4972. // mutual TLS by presenting client certificates for authentication.
  4973. //
  4974. // Possible values:
  4975. // "DISABLE"
  4976. // "INVALID"
  4977. // "MUTUAL"
  4978. // "SIMPLE"
  4979. Mode string `json:"mode,omitempty"`
  4980. // Sni: SNI string to present to the server during TLS handshake. This
  4981. // field is applicable only when mode is SIMPLE or MUTUAL.
  4982. Sni string `json:"sni,omitempty"`
  4983. // SubjectAltNames: A list of alternate names to verify the subject
  4984. // identity in the certificate.If specified, the proxy will verify that
  4985. // the server certificate's subject alt name matches one of the
  4986. // specified values. This field is applicable only when mode is SIMPLE
  4987. // or MUTUAL.
  4988. SubjectAltNames []string `json:"subjectAltNames,omitempty"`
  4989. // ForceSendFields is a list of field names (e.g. "ClientTlsContext") to
  4990. // unconditionally include in API requests. By default, fields with
  4991. // empty values are omitted from API requests. However, any non-pointer,
  4992. // non-interface field appearing in ForceSendFields will be sent to the
  4993. // server regardless of whether the field is empty or not. This may be
  4994. // used to include empty fields in Patch requests.
  4995. ForceSendFields []string `json:"-"`
  4996. // NullFields is a list of field names (e.g. "ClientTlsContext") to
  4997. // include in API requests with the JSON null value. By default, fields
  4998. // with empty values are omitted from API requests. However, any field
  4999. // with an empty value appearing in NullFields will be sent to the
  5000. // server as null. It is an error if a field in this list has a
  5001. // non-empty value. This may be used to include null fields in Patch
  5002. // requests.
  5003. NullFields []string `json:"-"`
  5004. }
  5005. func (s *ClientTlsSettings) MarshalJSON() ([]byte, error) {
  5006. type NoMethod ClientTlsSettings
  5007. raw := NoMethod(*s)
  5008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5009. }
  5010. // Commitment: Represents a Commitment resource. Creating a Commitment
  5011. // resource means that you are purchasing a committed use contract with
  5012. // an explicit start and end time. You can create commitments based on
  5013. // vCPUs and memory usage and receive discounted rates. For full
  5014. // details, read Signing Up for Committed Use Discounts.
  5015. //
  5016. // Committed use discounts are subject to Google Cloud Platform's
  5017. // Service Specific Terms. By purchasing a committed use discount, you
  5018. // agree to these terms. Committed use discounts will not renew, so you
  5019. // must purchase a new commitment to continue receiving discounts. (==
  5020. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  5021. type Commitment struct {
  5022. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5023. // format.
  5024. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5025. // Description: An optional description of this resource. Provide this
  5026. // property when you create the resource.
  5027. Description string `json:"description,omitempty"`
  5028. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  5029. // format.
  5030. EndTimestamp string `json:"endTimestamp,omitempty"`
  5031. // Id: [Output Only] The unique identifier for the resource. This
  5032. // identifier is defined by the server.
  5033. Id uint64 `json:"id,omitempty,string"`
  5034. // Kind: [Output Only] Type of the resource. Always compute#commitment
  5035. // for commitments.
  5036. Kind string `json:"kind,omitempty"`
  5037. // Name: Name of the resource. Provided by the client when the resource
  5038. // is created. The name must be 1-63 characters long, and comply with
  5039. // RFC1035. Specifically, the name must be 1-63 characters long and
  5040. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5041. // the first character must be a lowercase letter, and all following
  5042. // characters must be a dash, lowercase letter, or digit, except the
  5043. // last character, which cannot be a dash.
  5044. Name string `json:"name,omitempty"`
  5045. // Plan: The plan for this commitment, which determines duration and
  5046. // discount rate. The currently supported plans are TWELVE_MONTH (1
  5047. // year), and THIRTY_SIX_MONTH (3 years).
  5048. //
  5049. // Possible values:
  5050. // "INVALID"
  5051. // "THIRTY_SIX_MONTH"
  5052. // "TWELVE_MONTH"
  5053. Plan string `json:"plan,omitempty"`
  5054. // Region: [Output Only] URL of the region where this commitment may be
  5055. // used.
  5056. Region string `json:"region,omitempty"`
  5057. // Reservations: List of reservations for this commitment.
  5058. Reservations []*Reservation `json:"reservations,omitempty"`
  5059. // Resources: A list of commitment amounts for particular resources.
  5060. // Note that VCPU and MEMORY resource commitments must occur together.
  5061. Resources []*ResourceCommitment `json:"resources,omitempty"`
  5062. // SelfLink: [Output Only] Server-defined URL for the resource.
  5063. SelfLink string `json:"selfLink,omitempty"`
  5064. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  5065. // with the resource id.
  5066. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  5067. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  5068. // format.
  5069. StartTimestamp string `json:"startTimestamp,omitempty"`
  5070. // Status: [Output Only] Status of the commitment with regards to
  5071. // eventual expiration (each commitment has an end date defined). One of
  5072. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  5073. //
  5074. // Possible values:
  5075. // "ACTIVE"
  5076. // "CREATING"
  5077. // "EXPIRED"
  5078. // "NOT_YET_ACTIVE"
  5079. Status string `json:"status,omitempty"`
  5080. // StatusMessage: [Output Only] An optional, human-readable explanation
  5081. // of the status.
  5082. StatusMessage string `json:"statusMessage,omitempty"`
  5083. // Type: The type of commitment, which affects the discount rate and the
  5084. // eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that
  5085. // will only apply to memory optimized machines.
  5086. //
  5087. // Possible values:
  5088. // "COMPUTE_OPTIMIZED"
  5089. // "GENERAL_PURPOSE"
  5090. // "MEMORY_OPTIMIZED"
  5091. // "TYPE_UNSPECIFIED"
  5092. Type string `json:"type,omitempty"`
  5093. // ServerResponse contains the HTTP response code and headers from the
  5094. // server.
  5095. googleapi.ServerResponse `json:"-"`
  5096. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5097. // to unconditionally include in API requests. By default, fields with
  5098. // empty values are omitted from API requests. However, any non-pointer,
  5099. // non-interface field appearing in ForceSendFields will be sent to the
  5100. // server regardless of whether the field is empty or not. This may be
  5101. // used to include empty fields in Patch requests.
  5102. ForceSendFields []string `json:"-"`
  5103. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5104. // include in API requests with the JSON null value. By default, fields
  5105. // with empty values are omitted from API requests. However, any field
  5106. // with an empty value appearing in NullFields will be sent to the
  5107. // server as null. It is an error if a field in this list has a
  5108. // non-empty value. This may be used to include null fields in Patch
  5109. // requests.
  5110. NullFields []string `json:"-"`
  5111. }
  5112. func (s *Commitment) MarshalJSON() ([]byte, error) {
  5113. type NoMethod Commitment
  5114. raw := NoMethod(*s)
  5115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5116. }
  5117. type CommitmentAggregatedList struct {
  5118. // Id: [Output Only] Unique identifier for the resource; defined by the
  5119. // server.
  5120. Id string `json:"id,omitempty"`
  5121. // Items: A list of CommitmentsScopedList resources.
  5122. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  5123. // Kind: [Output Only] Type of resource. Always
  5124. // compute#commitmentAggregatedList for aggregated lists of commitments.
  5125. Kind string `json:"kind,omitempty"`
  5126. // NextPageToken: [Output Only] This token allows you to get the next
  5127. // page of results for list requests. If the number of results is larger
  5128. // than maxResults, use the nextPageToken as a value for the query
  5129. // parameter pageToken in the next list request. Subsequent list
  5130. // requests will have their own nextPageToken to continue paging through
  5131. // the results.
  5132. NextPageToken string `json:"nextPageToken,omitempty"`
  5133. // SelfLink: [Output Only] Server-defined URL for this resource.
  5134. SelfLink string `json:"selfLink,omitempty"`
  5135. // Warning: [Output Only] Informational warning message.
  5136. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  5137. // ServerResponse contains the HTTP response code and headers from the
  5138. // server.
  5139. googleapi.ServerResponse `json:"-"`
  5140. // ForceSendFields is a list of field names (e.g. "Id") to
  5141. // unconditionally include in API requests. By default, fields with
  5142. // empty values are omitted from API requests. However, any non-pointer,
  5143. // non-interface field appearing in ForceSendFields will be sent to the
  5144. // server regardless of whether the field is empty or not. This may be
  5145. // used to include empty fields in Patch requests.
  5146. ForceSendFields []string `json:"-"`
  5147. // NullFields is a list of field names (e.g. "Id") to include in API
  5148. // requests with the JSON null value. By default, fields with empty
  5149. // values are omitted from API requests. However, any field with an
  5150. // empty value appearing in NullFields will be sent to the server as
  5151. // null. It is an error if a field in this list has a non-empty value.
  5152. // This may be used to include null fields in Patch requests.
  5153. NullFields []string `json:"-"`
  5154. }
  5155. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  5156. type NoMethod CommitmentAggregatedList
  5157. raw := NoMethod(*s)
  5158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5159. }
  5160. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  5161. // message.
  5162. type CommitmentAggregatedListWarning struct {
  5163. // Code: [Output Only] A warning code, if applicable. For example,
  5164. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5165. // the response.
  5166. //
  5167. // Possible values:
  5168. // "CLEANUP_FAILED"
  5169. // "DEPRECATED_RESOURCE_USED"
  5170. // "DEPRECATED_TYPE_USED"
  5171. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5172. // "EXPERIMENTAL_TYPE_USED"
  5173. // "EXTERNAL_API_WARNING"
  5174. // "FIELD_VALUE_OVERRIDEN"
  5175. // "INJECTED_KERNELS_DEPRECATED"
  5176. // "MISSING_TYPE_DEPENDENCY"
  5177. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5178. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5179. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5180. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5181. // "NEXT_HOP_NOT_RUNNING"
  5182. // "NOT_CRITICAL_ERROR"
  5183. // "NO_RESULTS_ON_PAGE"
  5184. // "REQUIRED_TOS_AGREEMENT"
  5185. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5186. // "RESOURCE_NOT_DELETED"
  5187. // "SCHEMA_VALIDATION_IGNORED"
  5188. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5189. // "UNDECLARED_PROPERTIES"
  5190. // "UNREACHABLE"
  5191. Code string `json:"code,omitempty"`
  5192. // Data: [Output Only] Metadata about this warning in key: value format.
  5193. // For example:
  5194. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5195. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  5196. // Message: [Output Only] A human-readable description of the warning
  5197. // code.
  5198. Message string `json:"message,omitempty"`
  5199. // ForceSendFields is a list of field names (e.g. "Code") to
  5200. // unconditionally include in API requests. By default, fields with
  5201. // empty values are omitted from API requests. However, any non-pointer,
  5202. // non-interface field appearing in ForceSendFields will be sent to the
  5203. // server regardless of whether the field is empty or not. This may be
  5204. // used to include empty fields in Patch requests.
  5205. ForceSendFields []string `json:"-"`
  5206. // NullFields is a list of field names (e.g. "Code") to include in API
  5207. // requests with the JSON null value. By default, fields with empty
  5208. // values are omitted from API requests. However, any field with an
  5209. // empty value appearing in NullFields will be sent to the server as
  5210. // null. It is an error if a field in this list has a non-empty value.
  5211. // This may be used to include null fields in Patch requests.
  5212. NullFields []string `json:"-"`
  5213. }
  5214. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5215. type NoMethod CommitmentAggregatedListWarning
  5216. raw := NoMethod(*s)
  5217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5218. }
  5219. type CommitmentAggregatedListWarningData struct {
  5220. // Key: [Output Only] A key that provides more detail on the warning
  5221. // being returned. For example, for warnings where there are no results
  5222. // in a list request for a particular zone, this key might be scope and
  5223. // the key value might be the zone name. Other examples might be a key
  5224. // indicating a deprecated resource and a suggested replacement, or a
  5225. // warning about invalid network settings (for example, if an instance
  5226. // attempts to perform IP forwarding but is not enabled for IP
  5227. // forwarding).
  5228. Key string `json:"key,omitempty"`
  5229. // Value: [Output Only] A warning data value corresponding to the key.
  5230. Value string `json:"value,omitempty"`
  5231. // ForceSendFields is a list of field names (e.g. "Key") to
  5232. // unconditionally include in API requests. By default, fields with
  5233. // empty values are omitted from API requests. However, any non-pointer,
  5234. // non-interface field appearing in ForceSendFields will be sent to the
  5235. // server regardless of whether the field is empty or not. This may be
  5236. // used to include empty fields in Patch requests.
  5237. ForceSendFields []string `json:"-"`
  5238. // NullFields is a list of field names (e.g. "Key") to include in API
  5239. // requests with the JSON null value. By default, fields with empty
  5240. // values are omitted from API requests. However, any field with an
  5241. // empty value appearing in NullFields will be sent to the server as
  5242. // null. It is an error if a field in this list has a non-empty value.
  5243. // This may be used to include null fields in Patch requests.
  5244. NullFields []string `json:"-"`
  5245. }
  5246. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5247. type NoMethod CommitmentAggregatedListWarningData
  5248. raw := NoMethod(*s)
  5249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5250. }
  5251. // CommitmentList: Contains a list of Commitment resources.
  5252. type CommitmentList struct {
  5253. // Id: [Output Only] Unique identifier for the resource; defined by the
  5254. // server.
  5255. Id string `json:"id,omitempty"`
  5256. // Items: A list of Commitment resources.
  5257. Items []*Commitment `json:"items,omitempty"`
  5258. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  5259. // for lists of commitments.
  5260. Kind string `json:"kind,omitempty"`
  5261. // NextPageToken: [Output Only] This token allows you to get the next
  5262. // page of results for list requests. If the number of results is larger
  5263. // than maxResults, use the nextPageToken as a value for the query
  5264. // parameter pageToken in the next list request. Subsequent list
  5265. // requests will have their own nextPageToken to continue paging through
  5266. // the results.
  5267. NextPageToken string `json:"nextPageToken,omitempty"`
  5268. // SelfLink: [Output Only] Server-defined URL for this resource.
  5269. SelfLink string `json:"selfLink,omitempty"`
  5270. // Warning: [Output Only] Informational warning message.
  5271. Warning *CommitmentListWarning `json:"warning,omitempty"`
  5272. // ServerResponse contains the HTTP response code and headers from the
  5273. // server.
  5274. googleapi.ServerResponse `json:"-"`
  5275. // ForceSendFields is a list of field names (e.g. "Id") to
  5276. // unconditionally include in API requests. By default, fields with
  5277. // empty values are omitted from API requests. However, any non-pointer,
  5278. // non-interface field appearing in ForceSendFields will be sent to the
  5279. // server regardless of whether the field is empty or not. This may be
  5280. // used to include empty fields in Patch requests.
  5281. ForceSendFields []string `json:"-"`
  5282. // NullFields is a list of field names (e.g. "Id") to include in API
  5283. // requests with the JSON null value. By default, fields with empty
  5284. // values are omitted from API requests. However, any field with an
  5285. // empty value appearing in NullFields will be sent to the server as
  5286. // null. It is an error if a field in this list has a non-empty value.
  5287. // This may be used to include null fields in Patch requests.
  5288. NullFields []string `json:"-"`
  5289. }
  5290. func (s *CommitmentList) MarshalJSON() ([]byte, error) {
  5291. type NoMethod CommitmentList
  5292. raw := NoMethod(*s)
  5293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5294. }
  5295. // CommitmentListWarning: [Output Only] Informational warning message.
  5296. type CommitmentListWarning struct {
  5297. // Code: [Output Only] A warning code, if applicable. For example,
  5298. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5299. // the response.
  5300. //
  5301. // Possible values:
  5302. // "CLEANUP_FAILED"
  5303. // "DEPRECATED_RESOURCE_USED"
  5304. // "DEPRECATED_TYPE_USED"
  5305. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5306. // "EXPERIMENTAL_TYPE_USED"
  5307. // "EXTERNAL_API_WARNING"
  5308. // "FIELD_VALUE_OVERRIDEN"
  5309. // "INJECTED_KERNELS_DEPRECATED"
  5310. // "MISSING_TYPE_DEPENDENCY"
  5311. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5312. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5313. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5314. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5315. // "NEXT_HOP_NOT_RUNNING"
  5316. // "NOT_CRITICAL_ERROR"
  5317. // "NO_RESULTS_ON_PAGE"
  5318. // "REQUIRED_TOS_AGREEMENT"
  5319. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5320. // "RESOURCE_NOT_DELETED"
  5321. // "SCHEMA_VALIDATION_IGNORED"
  5322. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5323. // "UNDECLARED_PROPERTIES"
  5324. // "UNREACHABLE"
  5325. Code string `json:"code,omitempty"`
  5326. // Data: [Output Only] Metadata about this warning in key: value format.
  5327. // For example:
  5328. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5329. Data []*CommitmentListWarningData `json:"data,omitempty"`
  5330. // Message: [Output Only] A human-readable description of the warning
  5331. // code.
  5332. Message string `json:"message,omitempty"`
  5333. // ForceSendFields is a list of field names (e.g. "Code") to
  5334. // unconditionally include in API requests. By default, fields with
  5335. // empty values are omitted from API requests. However, any non-pointer,
  5336. // non-interface field appearing in ForceSendFields will be sent to the
  5337. // server regardless of whether the field is empty or not. This may be
  5338. // used to include empty fields in Patch requests.
  5339. ForceSendFields []string `json:"-"`
  5340. // NullFields is a list of field names (e.g. "Code") to include in API
  5341. // requests with the JSON null value. By default, fields with empty
  5342. // values are omitted from API requests. However, any field with an
  5343. // empty value appearing in NullFields will be sent to the server as
  5344. // null. It is an error if a field in this list has a non-empty value.
  5345. // This may be used to include null fields in Patch requests.
  5346. NullFields []string `json:"-"`
  5347. }
  5348. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  5349. type NoMethod CommitmentListWarning
  5350. raw := NoMethod(*s)
  5351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5352. }
  5353. type CommitmentListWarningData struct {
  5354. // Key: [Output Only] A key that provides more detail on the warning
  5355. // being returned. For example, for warnings where there are no results
  5356. // in a list request for a particular zone, this key might be scope and
  5357. // the key value might be the zone name. Other examples might be a key
  5358. // indicating a deprecated resource and a suggested replacement, or a
  5359. // warning about invalid network settings (for example, if an instance
  5360. // attempts to perform IP forwarding but is not enabled for IP
  5361. // forwarding).
  5362. Key string `json:"key,omitempty"`
  5363. // Value: [Output Only] A warning data value corresponding to the key.
  5364. Value string `json:"value,omitempty"`
  5365. // ForceSendFields is a list of field names (e.g. "Key") to
  5366. // unconditionally include in API requests. By default, fields with
  5367. // empty values are omitted from API requests. However, any non-pointer,
  5368. // non-interface field appearing in ForceSendFields will be sent to the
  5369. // server regardless of whether the field is empty or not. This may be
  5370. // used to include empty fields in Patch requests.
  5371. ForceSendFields []string `json:"-"`
  5372. // NullFields is a list of field names (e.g. "Key") to include in API
  5373. // requests with the JSON null value. By default, fields with empty
  5374. // values are omitted from API requests. However, any field with an
  5375. // empty value appearing in NullFields will be sent to the server as
  5376. // null. It is an error if a field in this list has a non-empty value.
  5377. // This may be used to include null fields in Patch requests.
  5378. NullFields []string `json:"-"`
  5379. }
  5380. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  5381. type NoMethod CommitmentListWarningData
  5382. raw := NoMethod(*s)
  5383. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5384. }
  5385. type CommitmentsScopedList struct {
  5386. // Commitments: [Output Only] A list of commitments contained in this
  5387. // scope.
  5388. Commitments []*Commitment `json:"commitments,omitempty"`
  5389. // Warning: [Output Only] Informational warning which replaces the list
  5390. // of commitments when the list is empty.
  5391. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  5392. // ForceSendFields is a list of field names (e.g. "Commitments") to
  5393. // unconditionally include in API requests. By default, fields with
  5394. // empty values are omitted from API requests. However, any non-pointer,
  5395. // non-interface field appearing in ForceSendFields will be sent to the
  5396. // server regardless of whether the field is empty or not. This may be
  5397. // used to include empty fields in Patch requests.
  5398. ForceSendFields []string `json:"-"`
  5399. // NullFields is a list of field names (e.g. "Commitments") to include
  5400. // in API requests with the JSON null value. By default, fields with
  5401. // empty values are omitted from API requests. However, any field with
  5402. // an empty value appearing in NullFields will be sent to the server as
  5403. // null. It is an error if a field in this list has a non-empty value.
  5404. // This may be used to include null fields in Patch requests.
  5405. NullFields []string `json:"-"`
  5406. }
  5407. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  5408. type NoMethod CommitmentsScopedList
  5409. raw := NoMethod(*s)
  5410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5411. }
  5412. // CommitmentsScopedListWarning: [Output Only] Informational warning
  5413. // which replaces the list of commitments when the list is empty.
  5414. type CommitmentsScopedListWarning struct {
  5415. // Code: [Output Only] A warning code, if applicable. For example,
  5416. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5417. // the response.
  5418. //
  5419. // Possible values:
  5420. // "CLEANUP_FAILED"
  5421. // "DEPRECATED_RESOURCE_USED"
  5422. // "DEPRECATED_TYPE_USED"
  5423. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5424. // "EXPERIMENTAL_TYPE_USED"
  5425. // "EXTERNAL_API_WARNING"
  5426. // "FIELD_VALUE_OVERRIDEN"
  5427. // "INJECTED_KERNELS_DEPRECATED"
  5428. // "MISSING_TYPE_DEPENDENCY"
  5429. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5430. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5431. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5432. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5433. // "NEXT_HOP_NOT_RUNNING"
  5434. // "NOT_CRITICAL_ERROR"
  5435. // "NO_RESULTS_ON_PAGE"
  5436. // "REQUIRED_TOS_AGREEMENT"
  5437. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5438. // "RESOURCE_NOT_DELETED"
  5439. // "SCHEMA_VALIDATION_IGNORED"
  5440. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5441. // "UNDECLARED_PROPERTIES"
  5442. // "UNREACHABLE"
  5443. Code string `json:"code,omitempty"`
  5444. // Data: [Output Only] Metadata about this warning in key: value format.
  5445. // For example:
  5446. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5447. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  5448. // Message: [Output Only] A human-readable description of the warning
  5449. // code.
  5450. Message string `json:"message,omitempty"`
  5451. // ForceSendFields is a list of field names (e.g. "Code") to
  5452. // unconditionally include in API requests. By default, fields with
  5453. // empty values are omitted from API requests. However, any non-pointer,
  5454. // non-interface field appearing in ForceSendFields will be sent to the
  5455. // server regardless of whether the field is empty or not. This may be
  5456. // used to include empty fields in Patch requests.
  5457. ForceSendFields []string `json:"-"`
  5458. // NullFields is a list of field names (e.g. "Code") to include in API
  5459. // requests with the JSON null value. By default, fields with empty
  5460. // values are omitted from API requests. However, any field with an
  5461. // empty value appearing in NullFields will be sent to the server as
  5462. // null. It is an error if a field in this list has a non-empty value.
  5463. // This may be used to include null fields in Patch requests.
  5464. NullFields []string `json:"-"`
  5465. }
  5466. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  5467. type NoMethod CommitmentsScopedListWarning
  5468. raw := NoMethod(*s)
  5469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5470. }
  5471. type CommitmentsScopedListWarningData struct {
  5472. // Key: [Output Only] A key that provides more detail on the warning
  5473. // being returned. For example, for warnings where there are no results
  5474. // in a list request for a particular zone, this key might be scope and
  5475. // the key value might be the zone name. Other examples might be a key
  5476. // indicating a deprecated resource and a suggested replacement, or a
  5477. // warning about invalid network settings (for example, if an instance
  5478. // attempts to perform IP forwarding but is not enabled for IP
  5479. // forwarding).
  5480. Key string `json:"key,omitempty"`
  5481. // Value: [Output Only] A warning data value corresponding to the key.
  5482. Value string `json:"value,omitempty"`
  5483. // ForceSendFields is a list of field names (e.g. "Key") to
  5484. // unconditionally include in API requests. By default, fields with
  5485. // empty values are omitted from API requests. However, any non-pointer,
  5486. // non-interface field appearing in ForceSendFields will be sent to the
  5487. // server regardless of whether the field is empty or not. This may be
  5488. // used to include empty fields in Patch requests.
  5489. ForceSendFields []string `json:"-"`
  5490. // NullFields is a list of field names (e.g. "Key") to include in API
  5491. // requests with the JSON null value. By default, fields with empty
  5492. // values are omitted from API requests. However, any field with an
  5493. // empty value appearing in NullFields will be sent to the server as
  5494. // null. It is an error if a field in this list has a non-empty value.
  5495. // This may be used to include null fields in Patch requests.
  5496. NullFields []string `json:"-"`
  5497. }
  5498. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  5499. type NoMethod CommitmentsScopedListWarningData
  5500. raw := NoMethod(*s)
  5501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5502. }
  5503. // Condition: A condition to be met.
  5504. type Condition struct {
  5505. // Iam: Trusted attributes supplied by the IAM system.
  5506. //
  5507. // Possible values:
  5508. // "APPROVER"
  5509. // "ATTRIBUTION"
  5510. // "AUTHORITY"
  5511. // "CREDENTIALS_TYPE"
  5512. // "JUSTIFICATION_TYPE"
  5513. // "NO_ATTR"
  5514. // "SECURITY_REALM"
  5515. Iam string `json:"iam,omitempty"`
  5516. // Op: An operator to apply the subject with.
  5517. //
  5518. // Possible values:
  5519. // "DISCHARGED"
  5520. // "EQUALS"
  5521. // "IN"
  5522. // "NOT_EQUALS"
  5523. // "NOT_IN"
  5524. // "NO_OP"
  5525. Op string `json:"op,omitempty"`
  5526. // Svc: Trusted attributes discharged by the service.
  5527. Svc string `json:"svc,omitempty"`
  5528. // Sys: Trusted attributes supplied by any service that owns resources
  5529. // and uses the IAM system for access control.
  5530. //
  5531. // Possible values:
  5532. // "IP"
  5533. // "NAME"
  5534. // "NO_ATTR"
  5535. // "REGION"
  5536. // "SERVICE"
  5537. Sys string `json:"sys,omitempty"`
  5538. // Values: The objects of the condition.
  5539. Values []string `json:"values,omitempty"`
  5540. // ForceSendFields is a list of field names (e.g. "Iam") to
  5541. // unconditionally include in API requests. By default, fields with
  5542. // empty values are omitted from API requests. However, any non-pointer,
  5543. // non-interface field appearing in ForceSendFields will be sent to the
  5544. // server regardless of whether the field is empty or not. This may be
  5545. // used to include empty fields in Patch requests.
  5546. ForceSendFields []string `json:"-"`
  5547. // NullFields is a list of field names (e.g. "Iam") to include in API
  5548. // requests with the JSON null value. By default, fields with empty
  5549. // values are omitted from API requests. However, any field with an
  5550. // empty value appearing in NullFields will be sent to the server as
  5551. // null. It is an error if a field in this list has a non-empty value.
  5552. // This may be used to include null fields in Patch requests.
  5553. NullFields []string `json:"-"`
  5554. }
  5555. func (s *Condition) MarshalJSON() ([]byte, error) {
  5556. type NoMethod Condition
  5557. raw := NoMethod(*s)
  5558. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5559. }
  5560. // ConnectionDraining: Message containing connection draining
  5561. // configuration.
  5562. type ConnectionDraining struct {
  5563. // DrainingTimeoutSec: Time for which instance will be drained (not
  5564. // accept new connections, but still work to finish started).
  5565. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  5566. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  5567. // to unconditionally include in API requests. By default, fields with
  5568. // empty values are omitted from API requests. However, any non-pointer,
  5569. // non-interface field appearing in ForceSendFields will be sent to the
  5570. // server regardless of whether the field is empty or not. This may be
  5571. // used to include empty fields in Patch requests.
  5572. ForceSendFields []string `json:"-"`
  5573. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  5574. // include in API requests with the JSON null value. By default, fields
  5575. // with empty values are omitted from API requests. However, any field
  5576. // with an empty value appearing in NullFields will be sent to the
  5577. // server as null. It is an error if a field in this list has a
  5578. // non-empty value. This may be used to include null fields in Patch
  5579. // requests.
  5580. NullFields []string `json:"-"`
  5581. }
  5582. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  5583. type NoMethod ConnectionDraining
  5584. raw := NoMethod(*s)
  5585. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5586. }
  5587. // ConsistentHashLoadBalancerSettings: This message defines settings for
  5588. // a consistent hash style load balancer.
  5589. type ConsistentHashLoadBalancerSettings struct {
  5590. // HttpCookie: Hash is based on HTTP Cookie. This field describes a HTTP
  5591. // cookie that will be used as the hash key for the consistent hash load
  5592. // balancer. If the cookie is not present, it will be generated. This
  5593. // field is applicable if the sessionAffinity is set to HTTP_COOKIE.
  5594. HttpCookie *ConsistentHashLoadBalancerSettingsHttpCookie `json:"httpCookie,omitempty"`
  5595. // HttpHeaderName: The hash based on the value of the specified header
  5596. // field. This field is applicable if the sessionAffinity is set to
  5597. // HEADER_FIELD.
  5598. HttpHeaderName string `json:"httpHeaderName,omitempty"`
  5599. // MinimumRingSize: The minimum number of virtual nodes to use for the
  5600. // hash ring. Defaults to 1024. Larger ring sizes result in more
  5601. // granular load distributions. If the number of hosts in the load
  5602. // balancing pool is larger than the ring size, each host will be
  5603. // assigned a single virtual node.
  5604. MinimumRingSize int64 `json:"minimumRingSize,omitempty,string"`
  5605. // ForceSendFields is a list of field names (e.g. "HttpCookie") to
  5606. // unconditionally include in API requests. By default, fields with
  5607. // empty values are omitted from API requests. However, any non-pointer,
  5608. // non-interface field appearing in ForceSendFields will be sent to the
  5609. // server regardless of whether the field is empty or not. This may be
  5610. // used to include empty fields in Patch requests.
  5611. ForceSendFields []string `json:"-"`
  5612. // NullFields is a list of field names (e.g. "HttpCookie") to include in
  5613. // API requests with the JSON null value. By default, fields with empty
  5614. // values are omitted from API requests. However, any field with an
  5615. // empty value appearing in NullFields will be sent to the server as
  5616. // null. It is an error if a field in this list has a non-empty value.
  5617. // This may be used to include null fields in Patch requests.
  5618. NullFields []string `json:"-"`
  5619. }
  5620. func (s *ConsistentHashLoadBalancerSettings) MarshalJSON() ([]byte, error) {
  5621. type NoMethod ConsistentHashLoadBalancerSettings
  5622. raw := NoMethod(*s)
  5623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5624. }
  5625. // ConsistentHashLoadBalancerSettingsHttpCookie: The information about
  5626. // the HTTP Cookie on which the hash function is based for load
  5627. // balancing policies that use a consistent hash.
  5628. type ConsistentHashLoadBalancerSettingsHttpCookie struct {
  5629. // Name: Name of the cookie.
  5630. Name string `json:"name,omitempty"`
  5631. // Path: Path to set for the cookie.
  5632. Path string `json:"path,omitempty"`
  5633. // Ttl: Lifetime of the cookie.
  5634. Ttl *Duration `json:"ttl,omitempty"`
  5635. // ForceSendFields is a list of field names (e.g. "Name") to
  5636. // unconditionally include in API requests. By default, fields with
  5637. // empty values are omitted from API requests. However, any non-pointer,
  5638. // non-interface field appearing in ForceSendFields will be sent to the
  5639. // server regardless of whether the field is empty or not. This may be
  5640. // used to include empty fields in Patch requests.
  5641. ForceSendFields []string `json:"-"`
  5642. // NullFields is a list of field names (e.g. "Name") to include in API
  5643. // requests with the JSON null value. By default, fields with empty
  5644. // values are omitted from API requests. However, any field with an
  5645. // empty value appearing in NullFields will be sent to the server as
  5646. // null. It is an error if a field in this list has a non-empty value.
  5647. // This may be used to include null fields in Patch requests.
  5648. NullFields []string `json:"-"`
  5649. }
  5650. func (s *ConsistentHashLoadBalancerSettingsHttpCookie) MarshalJSON() ([]byte, error) {
  5651. type NoMethod ConsistentHashLoadBalancerSettingsHttpCookie
  5652. raw := NoMethod(*s)
  5653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5654. }
  5655. // CorsPolicy: The specification for allowing client side cross-origin
  5656. // requests. Please see W3C Recommendation for Cross Origin Resource
  5657. // Sharing
  5658. type CorsPolicy struct {
  5659. // AllowCredentials: In response to a preflight request, setting this to
  5660. // true indicates that the actual request can include user credentials.
  5661. // This translates to the Access-Control-Allow-Credentials
  5662. // header.
  5663. // Default is false.
  5664. AllowCredentials bool `json:"allowCredentials,omitempty"`
  5665. // AllowHeaders: Specifies the content for the
  5666. // Access-Control-Allow-Headers header.
  5667. AllowHeaders []string `json:"allowHeaders,omitempty"`
  5668. // AllowMethods: Specifies the content for the
  5669. // Access-Control-Allow-Methods header.
  5670. AllowMethods []string `json:"allowMethods,omitempty"`
  5671. // AllowOriginRegexes: Specifies the regualar expression patterns that
  5672. // match allowed origins. For regular expression grammar please see
  5673. // en.cppreference.com/w/cpp/regex/ecmascript
  5674. // An origin is allowed if it matches either allow_origins or
  5675. // allow_origin_regex.
  5676. AllowOriginRegexes []string `json:"allowOriginRegexes,omitempty"`
  5677. // AllowOrigins: Specifies the list of origins that will be allowed to
  5678. // do CORS requests.
  5679. // An origin is allowed if it matches either allow_origins or
  5680. // allow_origin_regex.
  5681. AllowOrigins []string `json:"allowOrigins,omitempty"`
  5682. // Disabled: If true, specifies the CORS policy is disabled. The default
  5683. // value of false, which indicates that the CORS policy is in effect.
  5684. Disabled bool `json:"disabled,omitempty"`
  5685. // ExposeHeaders: Specifies the content for the
  5686. // Access-Control-Expose-Headers header.
  5687. ExposeHeaders []string `json:"exposeHeaders,omitempty"`
  5688. // MaxAge: Specifies how long the results of a preflight request can be
  5689. // cached. This translates to the content for the Access-Control-Max-Age
  5690. // header.
  5691. MaxAge int64 `json:"maxAge,omitempty"`
  5692. // ForceSendFields is a list of field names (e.g. "AllowCredentials") to
  5693. // unconditionally include in API requests. By default, fields with
  5694. // empty values are omitted from API requests. However, any non-pointer,
  5695. // non-interface field appearing in ForceSendFields will be sent to the
  5696. // server regardless of whether the field is empty or not. This may be
  5697. // used to include empty fields in Patch requests.
  5698. ForceSendFields []string `json:"-"`
  5699. // NullFields is a list of field names (e.g. "AllowCredentials") to
  5700. // include in API requests with the JSON null value. By default, fields
  5701. // with empty values are omitted from API requests. However, any field
  5702. // with an empty value appearing in NullFields will be sent to the
  5703. // server as null. It is an error if a field in this list has a
  5704. // non-empty value. This may be used to include null fields in Patch
  5705. // requests.
  5706. NullFields []string `json:"-"`
  5707. }
  5708. func (s *CorsPolicy) MarshalJSON() ([]byte, error) {
  5709. type NoMethod CorsPolicy
  5710. raw := NoMethod(*s)
  5711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5712. }
  5713. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  5714. type CustomerEncryptionKey struct {
  5715. // KmsKeyName: The name of the encryption key that is stored in Google
  5716. // Cloud KMS.
  5717. KmsKeyName string `json:"kmsKeyName,omitempty"`
  5718. KmsKeyServiceAccount string `json:"kmsKeyServiceAccount,omitempty"`
  5719. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  5720. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  5721. RawKey string `json:"rawKey,omitempty"`
  5722. // RsaEncryptedKey: Specifies an RFC 4648 base64 encoded, RSA-wrapped
  5723. // 2048-bit customer-supplied encryption key to either encrypt or
  5724. // decrypt this resource.
  5725. //
  5726. // The key must meet the following requirements before you can provide
  5727. // it to Compute Engine:
  5728. // - The key is wrapped using a RSA public key certificate provided by
  5729. // Google.
  5730. // - After being wrapped, the key must be encoded in RFC 4648 base64
  5731. // encoding. Gets the RSA public key certificate provided by Google
  5732. // at:
  5733. // https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingre
  5734. // ss.pem
  5735. RsaEncryptedKey string `json:"rsaEncryptedKey,omitempty"`
  5736. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  5737. // customer-supplied encryption key that protects this resource.
  5738. Sha256 string `json:"sha256,omitempty"`
  5739. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  5740. // unconditionally include in API requests. By default, fields with
  5741. // empty values are omitted from API requests. However, any non-pointer,
  5742. // non-interface field appearing in ForceSendFields will be sent to the
  5743. // server regardless of whether the field is empty or not. This may be
  5744. // used to include empty fields in Patch requests.
  5745. ForceSendFields []string `json:"-"`
  5746. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  5747. // API requests with the JSON null value. By default, fields with empty
  5748. // values are omitted from API requests. However, any field with an
  5749. // empty value appearing in NullFields will be sent to the server as
  5750. // null. It is an error if a field in this list has a non-empty value.
  5751. // This may be used to include null fields in Patch requests.
  5752. NullFields []string `json:"-"`
  5753. }
  5754. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  5755. type NoMethod CustomerEncryptionKey
  5756. raw := NoMethod(*s)
  5757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5758. }
  5759. type CustomerEncryptionKeyProtectedDisk struct {
  5760. // DiskEncryptionKey: Decrypts data associated with the disk with a
  5761. // customer-supplied encryption key.
  5762. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  5763. // Source: Specifies a valid partial or full URL to an existing
  5764. // Persistent Disk resource. This field is only applicable for
  5765. // persistent disks.
  5766. Source string `json:"source,omitempty"`
  5767. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  5768. // to unconditionally include in API requests. By default, fields with
  5769. // empty values are omitted from API requests. However, any non-pointer,
  5770. // non-interface field appearing in ForceSendFields will be sent to the
  5771. // server regardless of whether the field is empty or not. This may be
  5772. // used to include empty fields in Patch requests.
  5773. ForceSendFields []string `json:"-"`
  5774. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  5775. // include in API requests with the JSON null value. By default, fields
  5776. // with empty values are omitted from API requests. However, any field
  5777. // with an empty value appearing in NullFields will be sent to the
  5778. // server as null. It is an error if a field in this list has a
  5779. // non-empty value. This may be used to include null fields in Patch
  5780. // requests.
  5781. NullFields []string `json:"-"`
  5782. }
  5783. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  5784. type NoMethod CustomerEncryptionKeyProtectedDisk
  5785. raw := NoMethod(*s)
  5786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5787. }
  5788. // DeprecationStatus: Deprecation status for a public resource.
  5789. type DeprecationStatus struct {
  5790. // Deleted: An optional RFC3339 timestamp on or after which the state of
  5791. // this resource is intended to change to DELETED. This is only
  5792. // informational and the status will not change unless the client
  5793. // explicitly changes it.
  5794. Deleted string `json:"deleted,omitempty"`
  5795. // Deprecated: An optional RFC3339 timestamp on or after which the state
  5796. // of this resource is intended to change to DEPRECATED. This is only
  5797. // informational and the status will not change unless the client
  5798. // explicitly changes it.
  5799. Deprecated string `json:"deprecated,omitempty"`
  5800. // Obsolete: An optional RFC3339 timestamp on or after which the state
  5801. // of this resource is intended to change to OBSOLETE. This is only
  5802. // informational and the status will not change unless the client
  5803. // explicitly changes it.
  5804. Obsolete string `json:"obsolete,omitempty"`
  5805. // Replacement: The URL of the suggested replacement for a deprecated
  5806. // resource. The suggested replacement resource must be the same kind of
  5807. // resource as the deprecated resource.
  5808. Replacement string `json:"replacement,omitempty"`
  5809. // State: The deprecation state of this resource. This can be ACTIVE,
  5810. // DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the
  5811. // end of life date for an image, can use ACTIVE. Operations which
  5812. // create a new resource using a DEPRECATED resource will return
  5813. // successfully, but with a warning indicating the deprecated resource
  5814. // and recommending its replacement. Operations which use OBSOLETE or
  5815. // DELETED resources will be rejected and result in an error.
  5816. //
  5817. // Possible values:
  5818. // "ACTIVE"
  5819. // "DELETED"
  5820. // "DEPRECATED"
  5821. // "OBSOLETE"
  5822. State string `json:"state,omitempty"`
  5823. // ForceSendFields is a list of field names (e.g. "Deleted") to
  5824. // unconditionally include in API requests. By default, fields with
  5825. // empty values are omitted from API requests. However, any non-pointer,
  5826. // non-interface field appearing in ForceSendFields will be sent to the
  5827. // server regardless of whether the field is empty or not. This may be
  5828. // used to include empty fields in Patch requests.
  5829. ForceSendFields []string `json:"-"`
  5830. // NullFields is a list of field names (e.g. "Deleted") to include in
  5831. // API requests with the JSON null value. By default, fields with empty
  5832. // values are omitted from API requests. However, any field with an
  5833. // empty value appearing in NullFields will be sent to the server as
  5834. // null. It is an error if a field in this list has a non-empty value.
  5835. // This may be used to include null fields in Patch requests.
  5836. NullFields []string `json:"-"`
  5837. }
  5838. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  5839. type NoMethod DeprecationStatus
  5840. raw := NoMethod(*s)
  5841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5842. }
  5843. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  5844. // resource_for v1.disks ==)
  5845. type Disk struct {
  5846. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5847. // format.
  5848. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5849. // Description: An optional description of this resource. Provide this
  5850. // property when you create the resource.
  5851. Description string `json:"description,omitempty"`
  5852. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  5853. // encryption key.
  5854. //
  5855. // After you encrypt a disk with a customer-supplied key, you must
  5856. // provide the same key if you use the disk later (e.g. to create a disk
  5857. // snapshot, to create a disk image, to create a machine image, or to
  5858. // attach the disk to a virtual machine).
  5859. //
  5860. // Customer-supplied encryption keys do not protect access to metadata
  5861. // of the disk.
  5862. //
  5863. // If you do not provide an encryption key when creating the disk, then
  5864. // the disk will be encrypted using an automatically generated key and
  5865. // you do not need to provide a key to use the disk later.
  5866. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  5867. // GuestOsFeatures: A list of features to enable on the guest operating
  5868. // system. Applicable only for bootable images. Read Enabling guest
  5869. // operating system features to see a list of available options.
  5870. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  5871. // Id: [Output Only] The unique identifier for the resource. This
  5872. // identifier is defined by the server.
  5873. Id uint64 `json:"id,omitempty,string"`
  5874. // Kind: [Output Only] Type of the resource. Always compute#disk for
  5875. // disks.
  5876. Kind string `json:"kind,omitempty"`
  5877. // LabelFingerprint: A fingerprint for the labels being applied to this
  5878. // disk, which is essentially a hash of the labels set used for
  5879. // optimistic locking. The fingerprint is initially generated by Compute
  5880. // Engine and changes after every request to modify or update labels.
  5881. // You must always provide an up-to-date fingerprint hash in order to
  5882. // update or change labels, otherwise the request will fail with error
  5883. // 412 conditionNotMet.
  5884. //
  5885. // To see the latest fingerprint, make a get() request to retrieve a
  5886. // disk.
  5887. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  5888. // Labels: Labels to apply to this disk. These can be later modified by
  5889. // the setLabels method.
  5890. Labels map[string]string `json:"labels,omitempty"`
  5891. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  5892. // text format.
  5893. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  5894. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  5895. // text format.
  5896. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  5897. // LicenseCodes: Integer license codes indicating which licenses are
  5898. // attached to this disk.
  5899. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  5900. // Licenses: A list of publicly visible licenses. Reserved for Google's
  5901. // use.
  5902. Licenses []string `json:"licenses,omitempty"`
  5903. // MultiWriter: Indicates whether or not the disk can be read/write
  5904. // attached to more than one instance.
  5905. MultiWriter bool `json:"multiWriter,omitempty"`
  5906. // Name: Name of the resource. Provided by the client when the resource
  5907. // is created. The name must be 1-63 characters long, and comply with
  5908. // RFC1035. Specifically, the name must be 1-63 characters long and
  5909. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5910. // the first character must be a lowercase letter, and all following
  5911. // characters must be a dash, lowercase letter, or digit, except the
  5912. // last character, which cannot be a dash.
  5913. Name string `json:"name,omitempty"`
  5914. // Options: Internal use only.
  5915. Options string `json:"options,omitempty"`
  5916. // PhysicalBlockSizeBytes: Physical block size of the persistent disk,
  5917. // in bytes. If not present in a request, a default value is used.
  5918. // Currently supported sizes are 4096 and 16384, other sizes may be
  5919. // added in the future. If an unsupported value is requested, the error
  5920. // message will list the supported values for the caller's project.
  5921. PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"`
  5922. // Region: [Output Only] URL of the region where the disk resides. Only
  5923. // applicable for regional resources. You must specify this field as
  5924. // part of the HTTP request URL. It is not settable as a field in the
  5925. // request body.
  5926. Region string `json:"region,omitempty"`
  5927. // ReplicaZones: URLs of the zones where the disk should be replicated
  5928. // to. Only applicable for regional resources.
  5929. ReplicaZones []string `json:"replicaZones,omitempty"`
  5930. // ResourcePolicies: Resource policies applied to this disk for
  5931. // automatic snapshot creations.
  5932. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  5933. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  5934. // resource.
  5935. SelfLink string `json:"selfLink,omitempty"`
  5936. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  5937. // this field when creating a persistent disk using the sourceImage or
  5938. // sourceSnapshot parameter, or specify it alone to create an empty
  5939. // persistent disk.
  5940. //
  5941. // If you specify this field along with sourceImage or sourceSnapshot,
  5942. // the value of sizeGb must not be less than the size of the sourceImage
  5943. // or the size of the snapshot. Acceptable values are 1 to 65536,
  5944. // inclusive.
  5945. SizeGb int64 `json:"sizeGb,omitempty,string"`
  5946. // SourceDisk: The source disk used to create this disk. You can provide
  5947. // this as a partial or full URL to the resource. For example, the
  5948. // following are valid values:
  5949. // -
  5950. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  5951. // - projects/project/zones/zone/disks/disk
  5952. // - zones/zone/disks/disk
  5953. SourceDisk string `json:"sourceDisk,omitempty"`
  5954. // SourceDiskId: [Output Only] The unique ID of the disk used to create
  5955. // this disk. This value identifies the exact disk that was used to
  5956. // create this persistent disk. For example, if you created the
  5957. // persistent disk from a disk that was later deleted and recreated
  5958. // under the same name, the source disk ID would identify the exact
  5959. // version of the disk that was used.
  5960. SourceDiskId string `json:"sourceDiskId,omitempty"`
  5961. // SourceImage: The source image used to create this disk. If the source
  5962. // image is deleted, this field will not be set.
  5963. //
  5964. // To create a disk with one of the public operating system images,
  5965. // specify the image by its family name. For example, specify
  5966. // family/debian-9 to use the latest Debian 9
  5967. // image:
  5968. // projects/debian-cloud/global/images/family/debian-9
  5969. //
  5970. //
  5971. // Alternati
  5972. // vely, use a specific version of a public operating system
  5973. // image:
  5974. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  5975. //
  5976. //
  5977. //
  5978. // To create a disk with a custom image that you created, specify the
  5979. // image name in the following
  5980. // format:
  5981. // global/images/my-custom-image
  5982. //
  5983. //
  5984. // You can also specify a custom image by its image family, which
  5985. // returns the latest version of the image in that family. Replace the
  5986. // image name with
  5987. // family/family-name:
  5988. // global/images/family/my-image-family
  5989. SourceImage string `json:"sourceImage,omitempty"`
  5990. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  5991. // source image. Required if the source image is protected by a
  5992. // customer-supplied encryption key.
  5993. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  5994. // SourceImageId: [Output Only] The ID value of the image used to create
  5995. // this disk. This value identifies the exact image that was used to
  5996. // create this persistent disk. For example, if you created the
  5997. // persistent disk from an image that was later deleted and recreated
  5998. // under the same name, the source image ID would identify the exact
  5999. // version of the image that was used.
  6000. SourceImageId string `json:"sourceImageId,omitempty"`
  6001. // SourceSnapshot: The source snapshot used to create this disk. You can
  6002. // provide this as a partial or full URL to the resource. For example,
  6003. // the following are valid values:
  6004. // -
  6005. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  6006. // - projects/project/global/snapshots/snapshot
  6007. // - global/snapshots/snapshot
  6008. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  6009. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  6010. // the source snapshot. Required if the source snapshot is protected by
  6011. // a customer-supplied encryption key.
  6012. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  6013. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  6014. // create this disk. This value identifies the exact snapshot that was
  6015. // used to create this persistent disk. For example, if you created the
  6016. // persistent disk from a snapshot that was later deleted and recreated
  6017. // under the same name, the source snapshot ID would identify the exact
  6018. // version of the snapshot that was used.
  6019. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  6020. // Status: [Output Only] The status of disk creation.
  6021. //
  6022. // Possible values:
  6023. // "CREATING"
  6024. // "DELETING"
  6025. // "FAILED"
  6026. // "READY"
  6027. // "RESTORING"
  6028. Status string `json:"status,omitempty"`
  6029. // StorageType: [Deprecated] Storage type of the persistent disk.
  6030. //
  6031. // Possible values:
  6032. // "HDD"
  6033. // "SSD"
  6034. StorageType string `json:"storageType,omitempty"`
  6035. // Type: URL of the disk type resource describing which disk type to use
  6036. // to create the disk. Provide this when creating the disk. For example:
  6037. // projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
  6038. Type string `json:"type,omitempty"`
  6039. // Users: [Output Only] Links to the users of the disk (attached
  6040. // instances) in form: projects/project/zones/zone/instances/instance
  6041. Users []string `json:"users,omitempty"`
  6042. // Zone: [Output Only] URL of the zone where the disk resides. You must
  6043. // specify this field as part of the HTTP request URL. It is not
  6044. // settable as a field in the request body.
  6045. Zone string `json:"zone,omitempty"`
  6046. // ServerResponse contains the HTTP response code and headers from the
  6047. // server.
  6048. googleapi.ServerResponse `json:"-"`
  6049. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6050. // to unconditionally include in API requests. By default, fields with
  6051. // empty values are omitted from API requests. However, any non-pointer,
  6052. // non-interface field appearing in ForceSendFields will be sent to the
  6053. // server regardless of whether the field is empty or not. This may be
  6054. // used to include empty fields in Patch requests.
  6055. ForceSendFields []string `json:"-"`
  6056. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  6057. // include in API requests with the JSON null value. By default, fields
  6058. // with empty values are omitted from API requests. However, any field
  6059. // with an empty value appearing in NullFields will be sent to the
  6060. // server as null. It is an error if a field in this list has a
  6061. // non-empty value. This may be used to include null fields in Patch
  6062. // requests.
  6063. NullFields []string `json:"-"`
  6064. }
  6065. func (s *Disk) MarshalJSON() ([]byte, error) {
  6066. type NoMethod Disk
  6067. raw := NoMethod(*s)
  6068. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6069. }
  6070. type DiskAggregatedList struct {
  6071. // Id: [Output Only] Unique identifier for the resource; defined by the
  6072. // server.
  6073. Id string `json:"id,omitempty"`
  6074. // Items: A list of DisksScopedList resources.
  6075. Items map[string]DisksScopedList `json:"items,omitempty"`
  6076. // Kind: [Output Only] Type of resource. Always
  6077. // compute#diskAggregatedList for aggregated lists of persistent disks.
  6078. Kind string `json:"kind,omitempty"`
  6079. // NextPageToken: [Output Only] This token allows you to get the next
  6080. // page of results for list requests. If the number of results is larger
  6081. // than maxResults, use the nextPageToken as a value for the query
  6082. // parameter pageToken in the next list request. Subsequent list
  6083. // requests will have their own nextPageToken to continue paging through
  6084. // the results.
  6085. NextPageToken string `json:"nextPageToken,omitempty"`
  6086. // SelfLink: [Output Only] Server-defined URL for this resource.
  6087. SelfLink string `json:"selfLink,omitempty"`
  6088. // Warning: [Output Only] Informational warning message.
  6089. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  6090. // ServerResponse contains the HTTP response code and headers from the
  6091. // server.
  6092. googleapi.ServerResponse `json:"-"`
  6093. // ForceSendFields is a list of field names (e.g. "Id") to
  6094. // unconditionally include in API requests. By default, fields with
  6095. // empty values are omitted from API requests. However, any non-pointer,
  6096. // non-interface field appearing in ForceSendFields will be sent to the
  6097. // server regardless of whether the field is empty or not. This may be
  6098. // used to include empty fields in Patch requests.
  6099. ForceSendFields []string `json:"-"`
  6100. // NullFields is a list of field names (e.g. "Id") to include in API
  6101. // requests with the JSON null value. By default, fields with empty
  6102. // values are omitted from API requests. However, any field with an
  6103. // empty value appearing in NullFields will be sent to the server as
  6104. // null. It is an error if a field in this list has a non-empty value.
  6105. // This may be used to include null fields in Patch requests.
  6106. NullFields []string `json:"-"`
  6107. }
  6108. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  6109. type NoMethod DiskAggregatedList
  6110. raw := NoMethod(*s)
  6111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6112. }
  6113. // DiskAggregatedListWarning: [Output Only] Informational warning
  6114. // message.
  6115. type DiskAggregatedListWarning struct {
  6116. // Code: [Output Only] A warning code, if applicable. For example,
  6117. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6118. // the response.
  6119. //
  6120. // Possible values:
  6121. // "CLEANUP_FAILED"
  6122. // "DEPRECATED_RESOURCE_USED"
  6123. // "DEPRECATED_TYPE_USED"
  6124. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6125. // "EXPERIMENTAL_TYPE_USED"
  6126. // "EXTERNAL_API_WARNING"
  6127. // "FIELD_VALUE_OVERRIDEN"
  6128. // "INJECTED_KERNELS_DEPRECATED"
  6129. // "MISSING_TYPE_DEPENDENCY"
  6130. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6131. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6132. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6133. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6134. // "NEXT_HOP_NOT_RUNNING"
  6135. // "NOT_CRITICAL_ERROR"
  6136. // "NO_RESULTS_ON_PAGE"
  6137. // "REQUIRED_TOS_AGREEMENT"
  6138. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6139. // "RESOURCE_NOT_DELETED"
  6140. // "SCHEMA_VALIDATION_IGNORED"
  6141. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6142. // "UNDECLARED_PROPERTIES"
  6143. // "UNREACHABLE"
  6144. Code string `json:"code,omitempty"`
  6145. // Data: [Output Only] Metadata about this warning in key: value format.
  6146. // For example:
  6147. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6148. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  6149. // Message: [Output Only] A human-readable description of the warning
  6150. // code.
  6151. Message string `json:"message,omitempty"`
  6152. // ForceSendFields is a list of field names (e.g. "Code") to
  6153. // unconditionally include in API requests. By default, fields with
  6154. // empty values are omitted from API requests. However, any non-pointer,
  6155. // non-interface field appearing in ForceSendFields will be sent to the
  6156. // server regardless of whether the field is empty or not. This may be
  6157. // used to include empty fields in Patch requests.
  6158. ForceSendFields []string `json:"-"`
  6159. // NullFields is a list of field names (e.g. "Code") to include in API
  6160. // requests with the JSON null value. By default, fields with empty
  6161. // values are omitted from API requests. However, any field with an
  6162. // empty value appearing in NullFields will be sent to the server as
  6163. // null. It is an error if a field in this list has a non-empty value.
  6164. // This may be used to include null fields in Patch requests.
  6165. NullFields []string `json:"-"`
  6166. }
  6167. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  6168. type NoMethod DiskAggregatedListWarning
  6169. raw := NoMethod(*s)
  6170. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6171. }
  6172. type DiskAggregatedListWarningData struct {
  6173. // Key: [Output Only] A key that provides more detail on the warning
  6174. // being returned. For example, for warnings where there are no results
  6175. // in a list request for a particular zone, this key might be scope and
  6176. // the key value might be the zone name. Other examples might be a key
  6177. // indicating a deprecated resource and a suggested replacement, or a
  6178. // warning about invalid network settings (for example, if an instance
  6179. // attempts to perform IP forwarding but is not enabled for IP
  6180. // forwarding).
  6181. Key string `json:"key,omitempty"`
  6182. // Value: [Output Only] A warning data value corresponding to the key.
  6183. Value string `json:"value,omitempty"`
  6184. // ForceSendFields is a list of field names (e.g. "Key") to
  6185. // unconditionally include in API requests. By default, fields with
  6186. // empty values are omitted from API requests. However, any non-pointer,
  6187. // non-interface field appearing in ForceSendFields will be sent to the
  6188. // server regardless of whether the field is empty or not. This may be
  6189. // used to include empty fields in Patch requests.
  6190. ForceSendFields []string `json:"-"`
  6191. // NullFields is a list of field names (e.g. "Key") to include in API
  6192. // requests with the JSON null value. By default, fields with empty
  6193. // values are omitted from API requests. However, any field with an
  6194. // empty value appearing in NullFields will be sent to the server as
  6195. // null. It is an error if a field in this list has a non-empty value.
  6196. // This may be used to include null fields in Patch requests.
  6197. NullFields []string `json:"-"`
  6198. }
  6199. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6200. type NoMethod DiskAggregatedListWarningData
  6201. raw := NoMethod(*s)
  6202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6203. }
  6204. // DiskInstantiationConfig: A specification of the desired way to
  6205. // instantiate a disk in the instance template when its created from a
  6206. // source instance.
  6207. type DiskInstantiationConfig struct {
  6208. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  6209. // instance is deleted (but not when the disk is detached from the
  6210. // instance).
  6211. AutoDelete bool `json:"autoDelete,omitempty"`
  6212. // CustomImage: The custom source image to be used to restore this disk
  6213. // when instantiating this instance template.
  6214. CustomImage string `json:"customImage,omitempty"`
  6215. // DeviceName: Specifies the device name of the disk to which the
  6216. // configurations apply to.
  6217. DeviceName string `json:"deviceName,omitempty"`
  6218. // InstantiateFrom: Specifies whether to include the disk and what image
  6219. // to use. Possible values are:
  6220. // - source-image: to use the same image that was used to create the
  6221. // source instance's corresponding disk. Applicable to the boot disk and
  6222. // additional read-write disks.
  6223. // - source-image-family: to use the same image family that was used to
  6224. // create the source instance's corresponding disk. Applicable to the
  6225. // boot disk and additional read-write disks.
  6226. // - custom-image: to use a user-provided image url for disk creation.
  6227. // Applicable to the boot disk and additional read-write disks.
  6228. // - attach-read-only: to attach a read-only disk. Applicable to
  6229. // read-only disks.
  6230. // - do-not-include: to exclude a disk from the template. Applicable to
  6231. // additional read-write disks, local SSDs, and read-only disks.
  6232. //
  6233. // Possible values:
  6234. // "ATTACH_READ_ONLY"
  6235. // "BLANK"
  6236. // "CUSTOM_IMAGE"
  6237. // "DEFAULT"
  6238. // "DO_NOT_INCLUDE"
  6239. // "SOURCE_IMAGE"
  6240. // "SOURCE_IMAGE_FAMILY"
  6241. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  6242. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  6243. // unconditionally include in API requests. By default, fields with
  6244. // empty values are omitted from API requests. However, any non-pointer,
  6245. // non-interface field appearing in ForceSendFields will be sent to the
  6246. // server regardless of whether the field is empty or not. This may be
  6247. // used to include empty fields in Patch requests.
  6248. ForceSendFields []string `json:"-"`
  6249. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  6250. // API requests with the JSON null value. By default, fields with empty
  6251. // values are omitted from API requests. However, any field with an
  6252. // empty value appearing in NullFields will be sent to the server as
  6253. // null. It is an error if a field in this list has a non-empty value.
  6254. // This may be used to include null fields in Patch requests.
  6255. NullFields []string `json:"-"`
  6256. }
  6257. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  6258. type NoMethod DiskInstantiationConfig
  6259. raw := NoMethod(*s)
  6260. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6261. }
  6262. // DiskList: A list of Disk resources.
  6263. type DiskList struct {
  6264. // Id: [Output Only] Unique identifier for the resource; defined by the
  6265. // server.
  6266. Id string `json:"id,omitempty"`
  6267. // Items: A list of Disk resources.
  6268. Items []*Disk `json:"items,omitempty"`
  6269. // Kind: [Output Only] Type of resource. Always compute#diskList for
  6270. // lists of disks.
  6271. Kind string `json:"kind,omitempty"`
  6272. // NextPageToken: [Output Only] This token allows you to get the next
  6273. // page of results for list requests. If the number of results is larger
  6274. // than maxResults, use the nextPageToken as a value for the query
  6275. // parameter pageToken in the next list request. Subsequent list
  6276. // requests will have their own nextPageToken to continue paging through
  6277. // the results.
  6278. NextPageToken string `json:"nextPageToken,omitempty"`
  6279. // SelfLink: [Output Only] Server-defined URL for this resource.
  6280. SelfLink string `json:"selfLink,omitempty"`
  6281. // Warning: [Output Only] Informational warning message.
  6282. Warning *DiskListWarning `json:"warning,omitempty"`
  6283. // ServerResponse contains the HTTP response code and headers from the
  6284. // server.
  6285. googleapi.ServerResponse `json:"-"`
  6286. // ForceSendFields is a list of field names (e.g. "Id") to
  6287. // unconditionally include in API requests. By default, fields with
  6288. // empty values are omitted from API requests. However, any non-pointer,
  6289. // non-interface field appearing in ForceSendFields will be sent to the
  6290. // server regardless of whether the field is empty or not. This may be
  6291. // used to include empty fields in Patch requests.
  6292. ForceSendFields []string `json:"-"`
  6293. // NullFields is a list of field names (e.g. "Id") to include in API
  6294. // requests with the JSON null value. By default, fields with empty
  6295. // values are omitted from API requests. However, any field with an
  6296. // empty value appearing in NullFields will be sent to the server as
  6297. // null. It is an error if a field in this list has a non-empty value.
  6298. // This may be used to include null fields in Patch requests.
  6299. NullFields []string `json:"-"`
  6300. }
  6301. func (s *DiskList) MarshalJSON() ([]byte, error) {
  6302. type NoMethod DiskList
  6303. raw := NoMethod(*s)
  6304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6305. }
  6306. // DiskListWarning: [Output Only] Informational warning message.
  6307. type DiskListWarning struct {
  6308. // Code: [Output Only] A warning code, if applicable. For example,
  6309. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6310. // the response.
  6311. //
  6312. // Possible values:
  6313. // "CLEANUP_FAILED"
  6314. // "DEPRECATED_RESOURCE_USED"
  6315. // "DEPRECATED_TYPE_USED"
  6316. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6317. // "EXPERIMENTAL_TYPE_USED"
  6318. // "EXTERNAL_API_WARNING"
  6319. // "FIELD_VALUE_OVERRIDEN"
  6320. // "INJECTED_KERNELS_DEPRECATED"
  6321. // "MISSING_TYPE_DEPENDENCY"
  6322. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6323. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6324. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6325. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6326. // "NEXT_HOP_NOT_RUNNING"
  6327. // "NOT_CRITICAL_ERROR"
  6328. // "NO_RESULTS_ON_PAGE"
  6329. // "REQUIRED_TOS_AGREEMENT"
  6330. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6331. // "RESOURCE_NOT_DELETED"
  6332. // "SCHEMA_VALIDATION_IGNORED"
  6333. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6334. // "UNDECLARED_PROPERTIES"
  6335. // "UNREACHABLE"
  6336. Code string `json:"code,omitempty"`
  6337. // Data: [Output Only] Metadata about this warning in key: value format.
  6338. // For example:
  6339. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6340. Data []*DiskListWarningData `json:"data,omitempty"`
  6341. // Message: [Output Only] A human-readable description of the warning
  6342. // code.
  6343. Message string `json:"message,omitempty"`
  6344. // ForceSendFields is a list of field names (e.g. "Code") to
  6345. // unconditionally include in API requests. By default, fields with
  6346. // empty values are omitted from API requests. However, any non-pointer,
  6347. // non-interface field appearing in ForceSendFields will be sent to the
  6348. // server regardless of whether the field is empty or not. This may be
  6349. // used to include empty fields in Patch requests.
  6350. ForceSendFields []string `json:"-"`
  6351. // NullFields is a list of field names (e.g. "Code") to include in API
  6352. // requests with the JSON null value. By default, fields with empty
  6353. // values are omitted from API requests. However, any field with an
  6354. // empty value appearing in NullFields will be sent to the server as
  6355. // null. It is an error if a field in this list has a non-empty value.
  6356. // This may be used to include null fields in Patch requests.
  6357. NullFields []string `json:"-"`
  6358. }
  6359. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  6360. type NoMethod DiskListWarning
  6361. raw := NoMethod(*s)
  6362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6363. }
  6364. type DiskListWarningData struct {
  6365. // Key: [Output Only] A key that provides more detail on the warning
  6366. // being returned. For example, for warnings where there are no results
  6367. // in a list request for a particular zone, this key might be scope and
  6368. // the key value might be the zone name. Other examples might be a key
  6369. // indicating a deprecated resource and a suggested replacement, or a
  6370. // warning about invalid network settings (for example, if an instance
  6371. // attempts to perform IP forwarding but is not enabled for IP
  6372. // forwarding).
  6373. Key string `json:"key,omitempty"`
  6374. // Value: [Output Only] A warning data value corresponding to the key.
  6375. Value string `json:"value,omitempty"`
  6376. // ForceSendFields is a list of field names (e.g. "Key") to
  6377. // unconditionally include in API requests. By default, fields with
  6378. // empty values are omitted from API requests. However, any non-pointer,
  6379. // non-interface field appearing in ForceSendFields will be sent to the
  6380. // server regardless of whether the field is empty or not. This may be
  6381. // used to include empty fields in Patch requests.
  6382. ForceSendFields []string `json:"-"`
  6383. // NullFields is a list of field names (e.g. "Key") to include in API
  6384. // requests with the JSON null value. By default, fields with empty
  6385. // values are omitted from API requests. However, any field with an
  6386. // empty value appearing in NullFields will be sent to the server as
  6387. // null. It is an error if a field in this list has a non-empty value.
  6388. // This may be used to include null fields in Patch requests.
  6389. NullFields []string `json:"-"`
  6390. }
  6391. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  6392. type NoMethod DiskListWarningData
  6393. raw := NoMethod(*s)
  6394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6395. }
  6396. type DiskMoveRequest struct {
  6397. // DestinationZone: The URL of the destination zone to move the disk.
  6398. // This can be a full or partial URL. For example, the following are all
  6399. // valid URLs to a zone:
  6400. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  6401. //
  6402. // - projects/project/zones/zone
  6403. // - zones/zone
  6404. DestinationZone string `json:"destinationZone,omitempty"`
  6405. // TargetDisk: The URL of the target disk to move. This can be a full or
  6406. // partial URL. For example, the following are all valid URLs to a disk:
  6407. //
  6408. // -
  6409. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  6410. // - projects/project/zones/zone/disks/disk
  6411. // - zones/zone/disks/disk
  6412. TargetDisk string `json:"targetDisk,omitempty"`
  6413. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  6414. // unconditionally include in API requests. By default, fields with
  6415. // empty values are omitted from API requests. However, any non-pointer,
  6416. // non-interface field appearing in ForceSendFields will be sent to the
  6417. // server regardless of whether the field is empty or not. This may be
  6418. // used to include empty fields in Patch requests.
  6419. ForceSendFields []string `json:"-"`
  6420. // NullFields is a list of field names (e.g. "DestinationZone") to
  6421. // include in API requests with the JSON null value. By default, fields
  6422. // with empty values are omitted from API requests. However, any field
  6423. // with an empty value appearing in NullFields will be sent to the
  6424. // server as null. It is an error if a field in this list has a
  6425. // non-empty value. This may be used to include null fields in Patch
  6426. // requests.
  6427. NullFields []string `json:"-"`
  6428. }
  6429. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  6430. type NoMethod DiskMoveRequest
  6431. raw := NoMethod(*s)
  6432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6433. }
  6434. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  6435. // (== resource_for v1.diskTypes ==)
  6436. type DiskType struct {
  6437. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6438. // format.
  6439. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6440. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  6441. // GB.
  6442. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  6443. // Deprecated: [Output Only] The deprecation status associated with this
  6444. // disk type.
  6445. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  6446. // Description: [Output Only] An optional description of this resource.
  6447. Description string `json:"description,omitempty"`
  6448. // Id: [Output Only] The unique identifier for the resource. This
  6449. // identifier is defined by the server.
  6450. Id uint64 `json:"id,omitempty,string"`
  6451. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  6452. // disk types.
  6453. Kind string `json:"kind,omitempty"`
  6454. // Name: [Output Only] Name of the resource.
  6455. Name string `json:"name,omitempty"`
  6456. // Region: [Output Only] URL of the region where the disk type resides.
  6457. // Only applicable for regional resources. You must specify this field
  6458. // as part of the HTTP request URL. It is not settable as a field in the
  6459. // request body.
  6460. Region string `json:"region,omitempty"`
  6461. // SelfLink: [Output Only] Server-defined URL for the resource.
  6462. SelfLink string `json:"selfLink,omitempty"`
  6463. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  6464. // with the resource id.
  6465. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  6466. // ValidDiskSize: [Output Only] An optional textual description of the
  6467. // valid disk size, such as "10GB-10TB".
  6468. ValidDiskSize string `json:"validDiskSize,omitempty"`
  6469. // Zone: [Output Only] URL of the zone where the disk type resides. You
  6470. // must specify this field as part of the HTTP request URL. It is not
  6471. // settable as a field in the request body.
  6472. Zone string `json:"zone,omitempty"`
  6473. // ServerResponse contains the HTTP response code and headers from the
  6474. // server.
  6475. googleapi.ServerResponse `json:"-"`
  6476. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6477. // to unconditionally include in API requests. By default, fields with
  6478. // empty values are omitted from API requests. However, any non-pointer,
  6479. // non-interface field appearing in ForceSendFields will be sent to the
  6480. // server regardless of whether the field is empty or not. This may be
  6481. // used to include empty fields in Patch requests.
  6482. ForceSendFields []string `json:"-"`
  6483. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  6484. // include in API requests with the JSON null value. By default, fields
  6485. // with empty values are omitted from API requests. However, any field
  6486. // with an empty value appearing in NullFields will be sent to the
  6487. // server as null. It is an error if a field in this list has a
  6488. // non-empty value. This may be used to include null fields in Patch
  6489. // requests.
  6490. NullFields []string `json:"-"`
  6491. }
  6492. func (s *DiskType) MarshalJSON() ([]byte, error) {
  6493. type NoMethod DiskType
  6494. raw := NoMethod(*s)
  6495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6496. }
  6497. type DiskTypeAggregatedList struct {
  6498. // Id: [Output Only] Unique identifier for the resource; defined by the
  6499. // server.
  6500. Id string `json:"id,omitempty"`
  6501. // Items: A list of DiskTypesScopedList resources.
  6502. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  6503. // Kind: [Output Only] Type of resource. Always
  6504. // compute#diskTypeAggregatedList.
  6505. Kind string `json:"kind,omitempty"`
  6506. // NextPageToken: [Output Only] This token allows you to get the next
  6507. // page of results for list requests. If the number of results is larger
  6508. // than maxResults, use the nextPageToken as a value for the query
  6509. // parameter pageToken in the next list request. Subsequent list
  6510. // requests will have their own nextPageToken to continue paging through
  6511. // the results.
  6512. NextPageToken string `json:"nextPageToken,omitempty"`
  6513. // SelfLink: [Output Only] Server-defined URL for this resource.
  6514. SelfLink string `json:"selfLink,omitempty"`
  6515. // Warning: [Output Only] Informational warning message.
  6516. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  6517. // ServerResponse contains the HTTP response code and headers from the
  6518. // server.
  6519. googleapi.ServerResponse `json:"-"`
  6520. // ForceSendFields is a list of field names (e.g. "Id") to
  6521. // unconditionally include in API requests. By default, fields with
  6522. // empty values are omitted from API requests. However, any non-pointer,
  6523. // non-interface field appearing in ForceSendFields will be sent to the
  6524. // server regardless of whether the field is empty or not. This may be
  6525. // used to include empty fields in Patch requests.
  6526. ForceSendFields []string `json:"-"`
  6527. // NullFields is a list of field names (e.g. "Id") to include in API
  6528. // requests with the JSON null value. By default, fields with empty
  6529. // values are omitted from API requests. However, any field with an
  6530. // empty value appearing in NullFields will be sent to the server as
  6531. // null. It is an error if a field in this list has a non-empty value.
  6532. // This may be used to include null fields in Patch requests.
  6533. NullFields []string `json:"-"`
  6534. }
  6535. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  6536. type NoMethod DiskTypeAggregatedList
  6537. raw := NoMethod(*s)
  6538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6539. }
  6540. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  6541. // message.
  6542. type DiskTypeAggregatedListWarning struct {
  6543. // Code: [Output Only] A warning code, if applicable. For example,
  6544. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6545. // the response.
  6546. //
  6547. // Possible values:
  6548. // "CLEANUP_FAILED"
  6549. // "DEPRECATED_RESOURCE_USED"
  6550. // "DEPRECATED_TYPE_USED"
  6551. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6552. // "EXPERIMENTAL_TYPE_USED"
  6553. // "EXTERNAL_API_WARNING"
  6554. // "FIELD_VALUE_OVERRIDEN"
  6555. // "INJECTED_KERNELS_DEPRECATED"
  6556. // "MISSING_TYPE_DEPENDENCY"
  6557. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6558. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6559. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6560. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6561. // "NEXT_HOP_NOT_RUNNING"
  6562. // "NOT_CRITICAL_ERROR"
  6563. // "NO_RESULTS_ON_PAGE"
  6564. // "REQUIRED_TOS_AGREEMENT"
  6565. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6566. // "RESOURCE_NOT_DELETED"
  6567. // "SCHEMA_VALIDATION_IGNORED"
  6568. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6569. // "UNDECLARED_PROPERTIES"
  6570. // "UNREACHABLE"
  6571. Code string `json:"code,omitempty"`
  6572. // Data: [Output Only] Metadata about this warning in key: value format.
  6573. // For example:
  6574. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6575. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  6576. // Message: [Output Only] A human-readable description of the warning
  6577. // code.
  6578. Message string `json:"message,omitempty"`
  6579. // ForceSendFields is a list of field names (e.g. "Code") to
  6580. // unconditionally include in API requests. By default, fields with
  6581. // empty values are omitted from API requests. However, any non-pointer,
  6582. // non-interface field appearing in ForceSendFields will be sent to the
  6583. // server regardless of whether the field is empty or not. This may be
  6584. // used to include empty fields in Patch requests.
  6585. ForceSendFields []string `json:"-"`
  6586. // NullFields is a list of field names (e.g. "Code") to include in API
  6587. // requests with the JSON null value. By default, fields with empty
  6588. // values are omitted from API requests. However, any field with an
  6589. // empty value appearing in NullFields will be sent to the server as
  6590. // null. It is an error if a field in this list has a non-empty value.
  6591. // This may be used to include null fields in Patch requests.
  6592. NullFields []string `json:"-"`
  6593. }
  6594. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  6595. type NoMethod DiskTypeAggregatedListWarning
  6596. raw := NoMethod(*s)
  6597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6598. }
  6599. type DiskTypeAggregatedListWarningData struct {
  6600. // Key: [Output Only] A key that provides more detail on the warning
  6601. // being returned. For example, for warnings where there are no results
  6602. // in a list request for a particular zone, this key might be scope and
  6603. // the key value might be the zone name. Other examples might be a key
  6604. // indicating a deprecated resource and a suggested replacement, or a
  6605. // warning about invalid network settings (for example, if an instance
  6606. // attempts to perform IP forwarding but is not enabled for IP
  6607. // forwarding).
  6608. Key string `json:"key,omitempty"`
  6609. // Value: [Output Only] A warning data value corresponding to the key.
  6610. Value string `json:"value,omitempty"`
  6611. // ForceSendFields is a list of field names (e.g. "Key") to
  6612. // unconditionally include in API requests. By default, fields with
  6613. // empty values are omitted from API requests. However, any non-pointer,
  6614. // non-interface field appearing in ForceSendFields will be sent to the
  6615. // server regardless of whether the field is empty or not. This may be
  6616. // used to include empty fields in Patch requests.
  6617. ForceSendFields []string `json:"-"`
  6618. // NullFields is a list of field names (e.g. "Key") to include in API
  6619. // requests with the JSON null value. By default, fields with empty
  6620. // values are omitted from API requests. However, any field with an
  6621. // empty value appearing in NullFields will be sent to the server as
  6622. // null. It is an error if a field in this list has a non-empty value.
  6623. // This may be used to include null fields in Patch requests.
  6624. NullFields []string `json:"-"`
  6625. }
  6626. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6627. type NoMethod DiskTypeAggregatedListWarningData
  6628. raw := NoMethod(*s)
  6629. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6630. }
  6631. // DiskTypeList: Contains a list of disk types.
  6632. type DiskTypeList struct {
  6633. // Id: [Output Only] Unique identifier for the resource; defined by the
  6634. // server.
  6635. Id string `json:"id,omitempty"`
  6636. // Items: A list of DiskType resources.
  6637. Items []*DiskType `json:"items,omitempty"`
  6638. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  6639. // disk types.
  6640. Kind string `json:"kind,omitempty"`
  6641. // NextPageToken: [Output Only] This token allows you to get the next
  6642. // page of results for list requests. If the number of results is larger
  6643. // than maxResults, use the nextPageToken as a value for the query
  6644. // parameter pageToken in the next list request. Subsequent list
  6645. // requests will have their own nextPageToken to continue paging through
  6646. // the results.
  6647. NextPageToken string `json:"nextPageToken,omitempty"`
  6648. // SelfLink: [Output Only] Server-defined URL for this resource.
  6649. SelfLink string `json:"selfLink,omitempty"`
  6650. // Warning: [Output Only] Informational warning message.
  6651. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  6652. // ServerResponse contains the HTTP response code and headers from the
  6653. // server.
  6654. googleapi.ServerResponse `json:"-"`
  6655. // ForceSendFields is a list of field names (e.g. "Id") to
  6656. // unconditionally include in API requests. By default, fields with
  6657. // empty values are omitted from API requests. However, any non-pointer,
  6658. // non-interface field appearing in ForceSendFields will be sent to the
  6659. // server regardless of whether the field is empty or not. This may be
  6660. // used to include empty fields in Patch requests.
  6661. ForceSendFields []string `json:"-"`
  6662. // NullFields is a list of field names (e.g. "Id") to include in API
  6663. // requests with the JSON null value. By default, fields with empty
  6664. // values are omitted from API requests. However, any field with an
  6665. // empty value appearing in NullFields will be sent to the server as
  6666. // null. It is an error if a field in this list has a non-empty value.
  6667. // This may be used to include null fields in Patch requests.
  6668. NullFields []string `json:"-"`
  6669. }
  6670. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  6671. type NoMethod DiskTypeList
  6672. raw := NoMethod(*s)
  6673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6674. }
  6675. // DiskTypeListWarning: [Output Only] Informational warning message.
  6676. type DiskTypeListWarning struct {
  6677. // Code: [Output Only] A warning code, if applicable. For example,
  6678. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6679. // the response.
  6680. //
  6681. // Possible values:
  6682. // "CLEANUP_FAILED"
  6683. // "DEPRECATED_RESOURCE_USED"
  6684. // "DEPRECATED_TYPE_USED"
  6685. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6686. // "EXPERIMENTAL_TYPE_USED"
  6687. // "EXTERNAL_API_WARNING"
  6688. // "FIELD_VALUE_OVERRIDEN"
  6689. // "INJECTED_KERNELS_DEPRECATED"
  6690. // "MISSING_TYPE_DEPENDENCY"
  6691. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6692. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6693. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6694. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6695. // "NEXT_HOP_NOT_RUNNING"
  6696. // "NOT_CRITICAL_ERROR"
  6697. // "NO_RESULTS_ON_PAGE"
  6698. // "REQUIRED_TOS_AGREEMENT"
  6699. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6700. // "RESOURCE_NOT_DELETED"
  6701. // "SCHEMA_VALIDATION_IGNORED"
  6702. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6703. // "UNDECLARED_PROPERTIES"
  6704. // "UNREACHABLE"
  6705. Code string `json:"code,omitempty"`
  6706. // Data: [Output Only] Metadata about this warning in key: value format.
  6707. // For example:
  6708. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6709. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  6710. // Message: [Output Only] A human-readable description of the warning
  6711. // code.
  6712. Message string `json:"message,omitempty"`
  6713. // ForceSendFields is a list of field names (e.g. "Code") to
  6714. // unconditionally include in API requests. By default, fields with
  6715. // empty values are omitted from API requests. However, any non-pointer,
  6716. // non-interface field appearing in ForceSendFields will be sent to the
  6717. // server regardless of whether the field is empty or not. This may be
  6718. // used to include empty fields in Patch requests.
  6719. ForceSendFields []string `json:"-"`
  6720. // NullFields is a list of field names (e.g. "Code") to include in API
  6721. // requests with the JSON null value. By default, fields with empty
  6722. // values are omitted from API requests. However, any field with an
  6723. // empty value appearing in NullFields will be sent to the server as
  6724. // null. It is an error if a field in this list has a non-empty value.
  6725. // This may be used to include null fields in Patch requests.
  6726. NullFields []string `json:"-"`
  6727. }
  6728. func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  6729. type NoMethod DiskTypeListWarning
  6730. raw := NoMethod(*s)
  6731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6732. }
  6733. type DiskTypeListWarningData struct {
  6734. // Key: [Output Only] A key that provides more detail on the warning
  6735. // being returned. For example, for warnings where there are no results
  6736. // in a list request for a particular zone, this key might be scope and
  6737. // the key value might be the zone name. Other examples might be a key
  6738. // indicating a deprecated resource and a suggested replacement, or a
  6739. // warning about invalid network settings (for example, if an instance
  6740. // attempts to perform IP forwarding but is not enabled for IP
  6741. // forwarding).
  6742. Key string `json:"key,omitempty"`
  6743. // Value: [Output Only] A warning data value corresponding to the key.
  6744. Value string `json:"value,omitempty"`
  6745. // ForceSendFields is a list of field names (e.g. "Key") to
  6746. // unconditionally include in API requests. By default, fields with
  6747. // empty values are omitted from API requests. However, any non-pointer,
  6748. // non-interface field appearing in ForceSendFields will be sent to the
  6749. // server regardless of whether the field is empty or not. This may be
  6750. // used to include empty fields in Patch requests.
  6751. ForceSendFields []string `json:"-"`
  6752. // NullFields is a list of field names (e.g. "Key") to include in API
  6753. // requests with the JSON null value. By default, fields with empty
  6754. // values are omitted from API requests. However, any field with an
  6755. // empty value appearing in NullFields will be sent to the server as
  6756. // null. It is an error if a field in this list has a non-empty value.
  6757. // This may be used to include null fields in Patch requests.
  6758. NullFields []string `json:"-"`
  6759. }
  6760. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  6761. type NoMethod DiskTypeListWarningData
  6762. raw := NoMethod(*s)
  6763. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6764. }
  6765. type DiskTypesScopedList struct {
  6766. // DiskTypes: [Output Only] A list of disk types contained in this
  6767. // scope.
  6768. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  6769. // Warning: [Output Only] Informational warning which replaces the list
  6770. // of disk types when the list is empty.
  6771. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  6772. // ForceSendFields is a list of field names (e.g. "DiskTypes") 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. "DiskTypes") to include in
  6780. // API requests with the JSON null value. By default, fields with empty
  6781. // values are omitted from API requests. However, any field with an
  6782. // empty value appearing in NullFields will be sent to the server as
  6783. // null. It is an error if a field in this list has a non-empty value.
  6784. // This may be used to include null fields in Patch requests.
  6785. NullFields []string `json:"-"`
  6786. }
  6787. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  6788. type NoMethod DiskTypesScopedList
  6789. raw := NoMethod(*s)
  6790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6791. }
  6792. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  6793. // replaces the list of disk types when the list is empty.
  6794. type DiskTypesScopedListWarning struct {
  6795. // Code: [Output Only] A warning code, if applicable. For example,
  6796. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6797. // the response.
  6798. //
  6799. // Possible values:
  6800. // "CLEANUP_FAILED"
  6801. // "DEPRECATED_RESOURCE_USED"
  6802. // "DEPRECATED_TYPE_USED"
  6803. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6804. // "EXPERIMENTAL_TYPE_USED"
  6805. // "EXTERNAL_API_WARNING"
  6806. // "FIELD_VALUE_OVERRIDEN"
  6807. // "INJECTED_KERNELS_DEPRECATED"
  6808. // "MISSING_TYPE_DEPENDENCY"
  6809. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6810. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6811. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6812. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6813. // "NEXT_HOP_NOT_RUNNING"
  6814. // "NOT_CRITICAL_ERROR"
  6815. // "NO_RESULTS_ON_PAGE"
  6816. // "REQUIRED_TOS_AGREEMENT"
  6817. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6818. // "RESOURCE_NOT_DELETED"
  6819. // "SCHEMA_VALIDATION_IGNORED"
  6820. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6821. // "UNDECLARED_PROPERTIES"
  6822. // "UNREACHABLE"
  6823. Code string `json:"code,omitempty"`
  6824. // Data: [Output Only] Metadata about this warning in key: value format.
  6825. // For example:
  6826. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6827. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  6828. // Message: [Output Only] A human-readable description of the warning
  6829. // code.
  6830. Message string `json:"message,omitempty"`
  6831. // ForceSendFields is a list of field names (e.g. "Code") to
  6832. // unconditionally include in API requests. By default, fields with
  6833. // empty values are omitted from API requests. However, any non-pointer,
  6834. // non-interface field appearing in ForceSendFields will be sent to the
  6835. // server regardless of whether the field is empty or not. This may be
  6836. // used to include empty fields in Patch requests.
  6837. ForceSendFields []string `json:"-"`
  6838. // NullFields is a list of field names (e.g. "Code") to include in API
  6839. // requests with the JSON null value. By default, fields with empty
  6840. // values are omitted from API requests. However, any field with an
  6841. // empty value appearing in NullFields will be sent to the server as
  6842. // null. It is an error if a field in this list has a non-empty value.
  6843. // This may be used to include null fields in Patch requests.
  6844. NullFields []string `json:"-"`
  6845. }
  6846. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  6847. type NoMethod DiskTypesScopedListWarning
  6848. raw := NoMethod(*s)
  6849. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6850. }
  6851. type DiskTypesScopedListWarningData struct {
  6852. // Key: [Output Only] A key that provides more detail on the warning
  6853. // being returned. For example, for warnings where there are no results
  6854. // in a list request for a particular zone, this key might be scope and
  6855. // the key value might be the zone name. Other examples might be a key
  6856. // indicating a deprecated resource and a suggested replacement, or a
  6857. // warning about invalid network settings (for example, if an instance
  6858. // attempts to perform IP forwarding but is not enabled for IP
  6859. // forwarding).
  6860. Key string `json:"key,omitempty"`
  6861. // Value: [Output Only] A warning data value corresponding to the key.
  6862. Value string `json:"value,omitempty"`
  6863. // ForceSendFields is a list of field names (e.g. "Key") to
  6864. // unconditionally include in API requests. By default, fields with
  6865. // empty values are omitted from API requests. However, any non-pointer,
  6866. // non-interface field appearing in ForceSendFields will be sent to the
  6867. // server regardless of whether the field is empty or not. This may be
  6868. // used to include empty fields in Patch requests.
  6869. ForceSendFields []string `json:"-"`
  6870. // NullFields is a list of field names (e.g. "Key") to include in API
  6871. // requests with the JSON null value. By default, fields with empty
  6872. // values are omitted from API requests. However, any field with an
  6873. // empty value appearing in NullFields will be sent to the server as
  6874. // null. It is an error if a field in this list has a non-empty value.
  6875. // This may be used to include null fields in Patch requests.
  6876. NullFields []string `json:"-"`
  6877. }
  6878. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6879. type NoMethod DiskTypesScopedListWarningData
  6880. raw := NoMethod(*s)
  6881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6882. }
  6883. type DisksAddResourcePoliciesRequest struct {
  6884. // ResourcePolicies: Resource policies to be added to this disk.
  6885. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6886. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  6887. // unconditionally include in API requests. By default, fields with
  6888. // empty values are omitted from API requests. However, any non-pointer,
  6889. // non-interface field appearing in ForceSendFields will be sent to the
  6890. // server regardless of whether the field is empty or not. This may be
  6891. // used to include empty fields in Patch requests.
  6892. ForceSendFields []string `json:"-"`
  6893. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  6894. // include in API requests with the JSON null value. By default, fields
  6895. // with empty values are omitted from API requests. However, any field
  6896. // with an empty value appearing in NullFields will be sent to the
  6897. // server as null. It is an error if a field in this list has a
  6898. // non-empty value. This may be used to include null fields in Patch
  6899. // requests.
  6900. NullFields []string `json:"-"`
  6901. }
  6902. func (s *DisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  6903. type NoMethod DisksAddResourcePoliciesRequest
  6904. raw := NoMethod(*s)
  6905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6906. }
  6907. type DisksRemoveResourcePoliciesRequest struct {
  6908. // ResourcePolicies: Resource policies to be removed from this disk.
  6909. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6910. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  6911. // unconditionally include in API requests. By default, fields with
  6912. // empty values are omitted from API requests. However, any non-pointer,
  6913. // non-interface field appearing in ForceSendFields will be sent to the
  6914. // server regardless of whether the field is empty or not. This may be
  6915. // used to include empty fields in Patch requests.
  6916. ForceSendFields []string `json:"-"`
  6917. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  6918. // include in API requests with the JSON null value. By default, fields
  6919. // with empty values are omitted from API requests. However, any field
  6920. // with an empty value appearing in NullFields will be sent to the
  6921. // server as null. It is an error if a field in this list has a
  6922. // non-empty value. This may be used to include null fields in Patch
  6923. // requests.
  6924. NullFields []string `json:"-"`
  6925. }
  6926. func (s *DisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  6927. type NoMethod DisksRemoveResourcePoliciesRequest
  6928. raw := NoMethod(*s)
  6929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6930. }
  6931. type DisksResizeRequest struct {
  6932. // SizeGb: The new size of the persistent disk, which is specified in
  6933. // GB.
  6934. SizeGb int64 `json:"sizeGb,omitempty,string"`
  6935. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  6936. // unconditionally include in API requests. By default, fields with
  6937. // empty values are omitted from API requests. However, any non-pointer,
  6938. // non-interface field appearing in ForceSendFields will be sent to the
  6939. // server regardless of whether the field is empty or not. This may be
  6940. // used to include empty fields in Patch requests.
  6941. ForceSendFields []string `json:"-"`
  6942. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  6943. // requests with the JSON null value. By default, fields with empty
  6944. // values are omitted from API requests. However, any field with an
  6945. // empty value appearing in NullFields will be sent to the server as
  6946. // null. It is an error if a field in this list has a non-empty value.
  6947. // This may be used to include null fields in Patch requests.
  6948. NullFields []string `json:"-"`
  6949. }
  6950. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  6951. type NoMethod DisksResizeRequest
  6952. raw := NoMethod(*s)
  6953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6954. }
  6955. type DisksScopedList struct {
  6956. // Disks: [Output Only] A list of disks contained in this scope.
  6957. Disks []*Disk `json:"disks,omitempty"`
  6958. // Warning: [Output Only] Informational warning which replaces the list
  6959. // of disks when the list is empty.
  6960. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  6961. // ForceSendFields is a list of field names (e.g. "Disks") to
  6962. // unconditionally include in API requests. By default, fields with
  6963. // empty values are omitted from API requests. However, any non-pointer,
  6964. // non-interface field appearing in ForceSendFields will be sent to the
  6965. // server regardless of whether the field is empty or not. This may be
  6966. // used to include empty fields in Patch requests.
  6967. ForceSendFields []string `json:"-"`
  6968. // NullFields is a list of field names (e.g. "Disks") to include in API
  6969. // requests with the JSON null value. By default, fields with empty
  6970. // values are omitted from API requests. However, any field with an
  6971. // empty value appearing in NullFields will be sent to the server as
  6972. // null. It is an error if a field in this list has a non-empty value.
  6973. // This may be used to include null fields in Patch requests.
  6974. NullFields []string `json:"-"`
  6975. }
  6976. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  6977. type NoMethod DisksScopedList
  6978. raw := NoMethod(*s)
  6979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6980. }
  6981. // DisksScopedListWarning: [Output Only] Informational warning which
  6982. // replaces the list of disks when the list is empty.
  6983. type DisksScopedListWarning struct {
  6984. // Code: [Output Only] A warning code, if applicable. For example,
  6985. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6986. // the response.
  6987. //
  6988. // Possible values:
  6989. // "CLEANUP_FAILED"
  6990. // "DEPRECATED_RESOURCE_USED"
  6991. // "DEPRECATED_TYPE_USED"
  6992. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6993. // "EXPERIMENTAL_TYPE_USED"
  6994. // "EXTERNAL_API_WARNING"
  6995. // "FIELD_VALUE_OVERRIDEN"
  6996. // "INJECTED_KERNELS_DEPRECATED"
  6997. // "MISSING_TYPE_DEPENDENCY"
  6998. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6999. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7000. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7001. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7002. // "NEXT_HOP_NOT_RUNNING"
  7003. // "NOT_CRITICAL_ERROR"
  7004. // "NO_RESULTS_ON_PAGE"
  7005. // "REQUIRED_TOS_AGREEMENT"
  7006. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7007. // "RESOURCE_NOT_DELETED"
  7008. // "SCHEMA_VALIDATION_IGNORED"
  7009. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7010. // "UNDECLARED_PROPERTIES"
  7011. // "UNREACHABLE"
  7012. Code string `json:"code,omitempty"`
  7013. // Data: [Output Only] Metadata about this warning in key: value format.
  7014. // For example:
  7015. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7016. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  7017. // Message: [Output Only] A human-readable description of the warning
  7018. // code.
  7019. Message string `json:"message,omitempty"`
  7020. // ForceSendFields is a list of field names (e.g. "Code") to
  7021. // unconditionally include in API requests. By default, fields with
  7022. // empty values are omitted from API requests. However, any non-pointer,
  7023. // non-interface field appearing in ForceSendFields will be sent to the
  7024. // server regardless of whether the field is empty or not. This may be
  7025. // used to include empty fields in Patch requests.
  7026. ForceSendFields []string `json:"-"`
  7027. // NullFields is a list of field names (e.g. "Code") to include in API
  7028. // requests with the JSON null value. By default, fields with empty
  7029. // values are omitted from API requests. However, any field with an
  7030. // empty value appearing in NullFields will be sent to the server as
  7031. // null. It is an error if a field in this list has a non-empty value.
  7032. // This may be used to include null fields in Patch requests.
  7033. NullFields []string `json:"-"`
  7034. }
  7035. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  7036. type NoMethod DisksScopedListWarning
  7037. raw := NoMethod(*s)
  7038. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7039. }
  7040. type DisksScopedListWarningData struct {
  7041. // Key: [Output Only] A key that provides more detail on the warning
  7042. // being returned. For example, for warnings where there are no results
  7043. // in a list request for a particular zone, this key might be scope and
  7044. // the key value might be the zone name. Other examples might be a key
  7045. // indicating a deprecated resource and a suggested replacement, or a
  7046. // warning about invalid network settings (for example, if an instance
  7047. // attempts to perform IP forwarding but is not enabled for IP
  7048. // forwarding).
  7049. Key string `json:"key,omitempty"`
  7050. // Value: [Output Only] A warning data value corresponding to the key.
  7051. Value string `json:"value,omitempty"`
  7052. // ForceSendFields is a list of field names (e.g. "Key") to
  7053. // unconditionally include in API requests. By default, fields with
  7054. // empty values are omitted from API requests. However, any non-pointer,
  7055. // non-interface field appearing in ForceSendFields will be sent to the
  7056. // server regardless of whether the field is empty or not. This may be
  7057. // used to include empty fields in Patch requests.
  7058. ForceSendFields []string `json:"-"`
  7059. // NullFields is a list of field names (e.g. "Key") to include in API
  7060. // requests with the JSON null value. By default, fields with empty
  7061. // values are omitted from API requests. However, any field with an
  7062. // empty value appearing in NullFields will be sent to the server as
  7063. // null. It is an error if a field in this list has a non-empty value.
  7064. // This may be used to include null fields in Patch requests.
  7065. NullFields []string `json:"-"`
  7066. }
  7067. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  7068. type NoMethod DisksScopedListWarningData
  7069. raw := NoMethod(*s)
  7070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7071. }
  7072. // DisplayDevice: A set of Display Device options
  7073. type DisplayDevice struct {
  7074. // EnableDisplay: Defines whether the instance has Display enabled.
  7075. EnableDisplay bool `json:"enableDisplay,omitempty"`
  7076. // ForceSendFields is a list of field names (e.g. "EnableDisplay") to
  7077. // unconditionally include in API requests. By default, fields with
  7078. // empty values are omitted from API requests. However, any non-pointer,
  7079. // non-interface field appearing in ForceSendFields will be sent to the
  7080. // server regardless of whether the field is empty or not. This may be
  7081. // used to include empty fields in Patch requests.
  7082. ForceSendFields []string `json:"-"`
  7083. // NullFields is a list of field names (e.g. "EnableDisplay") to include
  7084. // in API requests with the JSON null value. By default, fields with
  7085. // empty values are omitted from API requests. However, any field with
  7086. // an empty value appearing in NullFields will be sent to the server as
  7087. // null. It is an error if a field in this list has a non-empty value.
  7088. // This may be used to include null fields in Patch requests.
  7089. NullFields []string `json:"-"`
  7090. }
  7091. func (s *DisplayDevice) MarshalJSON() ([]byte, error) {
  7092. type NoMethod DisplayDevice
  7093. raw := NoMethod(*s)
  7094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7095. }
  7096. type DistributionPolicy struct {
  7097. // Zones: Zones where the regional managed instance group will create
  7098. // and manage instances.
  7099. Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
  7100. // ForceSendFields is a list of field names (e.g. "Zones") to
  7101. // unconditionally include in API requests. By default, fields with
  7102. // empty values are omitted from API requests. However, any non-pointer,
  7103. // non-interface field appearing in ForceSendFields will be sent to the
  7104. // server regardless of whether the field is empty or not. This may be
  7105. // used to include empty fields in Patch requests.
  7106. ForceSendFields []string `json:"-"`
  7107. // NullFields is a list of field names (e.g. "Zones") to include in API
  7108. // requests with the JSON null value. By default, fields with empty
  7109. // values are omitted from API requests. However, any field with an
  7110. // empty value appearing in NullFields will be sent to the server as
  7111. // null. It is an error if a field in this list has a non-empty value.
  7112. // This may be used to include null fields in Patch requests.
  7113. NullFields []string `json:"-"`
  7114. }
  7115. func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
  7116. type NoMethod DistributionPolicy
  7117. raw := NoMethod(*s)
  7118. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7119. }
  7120. type DistributionPolicyZoneConfiguration struct {
  7121. // Zone: The URL of the zone. The zone must exist in the region where
  7122. // the managed instance group is located.
  7123. Zone string `json:"zone,omitempty"`
  7124. // ForceSendFields is a list of field names (e.g. "Zone") to
  7125. // unconditionally include in API requests. By default, fields with
  7126. // empty values are omitted from API requests. However, any non-pointer,
  7127. // non-interface field appearing in ForceSendFields will be sent to the
  7128. // server regardless of whether the field is empty or not. This may be
  7129. // used to include empty fields in Patch requests.
  7130. ForceSendFields []string `json:"-"`
  7131. // NullFields is a list of field names (e.g. "Zone") to include in API
  7132. // requests with the JSON null value. By default, fields with empty
  7133. // values are omitted from API requests. However, any field with an
  7134. // empty value appearing in NullFields will be sent to the server as
  7135. // null. It is an error if a field in this list has a non-empty value.
  7136. // This may be used to include null fields in Patch requests.
  7137. NullFields []string `json:"-"`
  7138. }
  7139. func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
  7140. type NoMethod DistributionPolicyZoneConfiguration
  7141. raw := NoMethod(*s)
  7142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7143. }
  7144. // Duration: A Duration represents a fixed-length span of time
  7145. // represented as a count of seconds and fractions of seconds at
  7146. // nanosecond resolution. It is independent of any calendar and concepts
  7147. // like "day" or "month". Range is approximately 10,000 years.
  7148. type Duration struct {
  7149. // Nanos: Span of time that's a fraction of a second at nanosecond
  7150. // resolution. Durations less than one second are represented with a 0
  7151. // `seconds` field and a positive `nanos` field. Must be from 0 to
  7152. // 999,999,999 inclusive.
  7153. Nanos int64 `json:"nanos,omitempty"`
  7154. // Seconds: Span of time at a resolution of a second. Must be from 0 to
  7155. // 315,576,000,000 inclusive. Note: these bounds are computed from: 60
  7156. // sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
  7157. Seconds int64 `json:"seconds,omitempty,string"`
  7158. // ForceSendFields is a list of field names (e.g. "Nanos") to
  7159. // unconditionally include in API requests. By default, fields with
  7160. // empty values are omitted from API requests. However, any non-pointer,
  7161. // non-interface field appearing in ForceSendFields will be sent to the
  7162. // server regardless of whether the field is empty or not. This may be
  7163. // used to include empty fields in Patch requests.
  7164. ForceSendFields []string `json:"-"`
  7165. // NullFields is a list of field names (e.g. "Nanos") to include in API
  7166. // requests with the JSON null value. By default, fields with empty
  7167. // values are omitted from API requests. However, any field with an
  7168. // empty value appearing in NullFields will be sent to the server as
  7169. // null. It is an error if a field in this list has a non-empty value.
  7170. // This may be used to include null fields in Patch requests.
  7171. NullFields []string `json:"-"`
  7172. }
  7173. func (s *Duration) MarshalJSON() ([]byte, error) {
  7174. type NoMethod Duration
  7175. raw := NoMethod(*s)
  7176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7177. }
  7178. type ExchangedPeeringRoute struct {
  7179. // DestRange: The destination range of the route.
  7180. DestRange string `json:"destRange,omitempty"`
  7181. // Imported: If the peering route is imported if there is no
  7182. // confliction.
  7183. Imported bool `json:"imported,omitempty"`
  7184. // NextHopRegion: The region of peering route next hop, only applies to
  7185. // dynamic routes.
  7186. NextHopRegion string `json:"nextHopRegion,omitempty"`
  7187. // Priority: The priority of the peering route.
  7188. Priority int64 `json:"priority,omitempty"`
  7189. // Type: The type of the peering route.
  7190. //
  7191. // Possible values:
  7192. // "DYNAMIC_PEERING_ROUTE"
  7193. // "STATIC_PEERING_ROUTE"
  7194. // "SUBNET_PEERING_ROUTE"
  7195. Type string `json:"type,omitempty"`
  7196. // ForceSendFields is a list of field names (e.g. "DestRange") to
  7197. // unconditionally include in API requests. By default, fields with
  7198. // empty values are omitted from API requests. However, any non-pointer,
  7199. // non-interface field appearing in ForceSendFields will be sent to the
  7200. // server regardless of whether the field is empty or not. This may be
  7201. // used to include empty fields in Patch requests.
  7202. ForceSendFields []string `json:"-"`
  7203. // NullFields is a list of field names (e.g. "DestRange") to include in
  7204. // API requests with the JSON null value. By default, fields with empty
  7205. // values are omitted from API requests. However, any field with an
  7206. // empty value appearing in NullFields will be sent to the server as
  7207. // null. It is an error if a field in this list has a non-empty value.
  7208. // This may be used to include null fields in Patch requests.
  7209. NullFields []string `json:"-"`
  7210. }
  7211. func (s *ExchangedPeeringRoute) MarshalJSON() ([]byte, error) {
  7212. type NoMethod ExchangedPeeringRoute
  7213. raw := NoMethod(*s)
  7214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7215. }
  7216. type ExchangedPeeringRoutesList struct {
  7217. // Id: [Output Only] Unique identifier for the resource; defined by the
  7218. // server.
  7219. Id string `json:"id,omitempty"`
  7220. // Items: A list of ExchangedPeeringRoute resources.
  7221. Items []*ExchangedPeeringRoute `json:"items,omitempty"`
  7222. // Kind: [Output Only] Type of resource. Always
  7223. // compute#exchangedPeeringRoutesList for exchanged peering routes
  7224. // lists.
  7225. Kind string `json:"kind,omitempty"`
  7226. // NextPageToken: [Output Only] This token allows you to get the next
  7227. // page of results for list requests. If the number of results is larger
  7228. // than maxResults, use the nextPageToken as a value for the query
  7229. // parameter pageToken in the next list request. Subsequent list
  7230. // requests will have their own nextPageToken to continue paging through
  7231. // the results.
  7232. NextPageToken string `json:"nextPageToken,omitempty"`
  7233. // SelfLink: [Output Only] Server-defined URL for this resource.
  7234. SelfLink string `json:"selfLink,omitempty"`
  7235. // Warning: [Output Only] Informational warning message.
  7236. Warning *ExchangedPeeringRoutesListWarning `json:"warning,omitempty"`
  7237. // ServerResponse contains the HTTP response code and headers from the
  7238. // server.
  7239. googleapi.ServerResponse `json:"-"`
  7240. // ForceSendFields is a list of field names (e.g. "Id") to
  7241. // unconditionally include in API requests. By default, fields with
  7242. // empty values are omitted from API requests. However, any non-pointer,
  7243. // non-interface field appearing in ForceSendFields will be sent to the
  7244. // server regardless of whether the field is empty or not. This may be
  7245. // used to include empty fields in Patch requests.
  7246. ForceSendFields []string `json:"-"`
  7247. // NullFields is a list of field names (e.g. "Id") to include in API
  7248. // requests with the JSON null value. By default, fields with empty
  7249. // values are omitted from API requests. However, any field with an
  7250. // empty value appearing in NullFields will be sent to the server as
  7251. // null. It is an error if a field in this list has a non-empty value.
  7252. // This may be used to include null fields in Patch requests.
  7253. NullFields []string `json:"-"`
  7254. }
  7255. func (s *ExchangedPeeringRoutesList) MarshalJSON() ([]byte, error) {
  7256. type NoMethod ExchangedPeeringRoutesList
  7257. raw := NoMethod(*s)
  7258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7259. }
  7260. // ExchangedPeeringRoutesListWarning: [Output Only] Informational
  7261. // warning message.
  7262. type ExchangedPeeringRoutesListWarning struct {
  7263. // Code: [Output Only] A warning code, if applicable. For example,
  7264. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7265. // the response.
  7266. //
  7267. // Possible values:
  7268. // "CLEANUP_FAILED"
  7269. // "DEPRECATED_RESOURCE_USED"
  7270. // "DEPRECATED_TYPE_USED"
  7271. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7272. // "EXPERIMENTAL_TYPE_USED"
  7273. // "EXTERNAL_API_WARNING"
  7274. // "FIELD_VALUE_OVERRIDEN"
  7275. // "INJECTED_KERNELS_DEPRECATED"
  7276. // "MISSING_TYPE_DEPENDENCY"
  7277. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7278. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7279. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7280. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7281. // "NEXT_HOP_NOT_RUNNING"
  7282. // "NOT_CRITICAL_ERROR"
  7283. // "NO_RESULTS_ON_PAGE"
  7284. // "REQUIRED_TOS_AGREEMENT"
  7285. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7286. // "RESOURCE_NOT_DELETED"
  7287. // "SCHEMA_VALIDATION_IGNORED"
  7288. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7289. // "UNDECLARED_PROPERTIES"
  7290. // "UNREACHABLE"
  7291. Code string `json:"code,omitempty"`
  7292. // Data: [Output Only] Metadata about this warning in key: value format.
  7293. // For example:
  7294. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7295. Data []*ExchangedPeeringRoutesListWarningData `json:"data,omitempty"`
  7296. // Message: [Output Only] A human-readable description of the warning
  7297. // code.
  7298. Message string `json:"message,omitempty"`
  7299. // ForceSendFields is a list of field names (e.g. "Code") to
  7300. // unconditionally include in API requests. By default, fields with
  7301. // empty values are omitted from API requests. However, any non-pointer,
  7302. // non-interface field appearing in ForceSendFields will be sent to the
  7303. // server regardless of whether the field is empty or not. This may be
  7304. // used to include empty fields in Patch requests.
  7305. ForceSendFields []string `json:"-"`
  7306. // NullFields is a list of field names (e.g. "Code") to include in API
  7307. // requests with the JSON null value. By default, fields with empty
  7308. // values are omitted from API requests. However, any field with an
  7309. // empty value appearing in NullFields will be sent to the server as
  7310. // null. It is an error if a field in this list has a non-empty value.
  7311. // This may be used to include null fields in Patch requests.
  7312. NullFields []string `json:"-"`
  7313. }
  7314. func (s *ExchangedPeeringRoutesListWarning) MarshalJSON() ([]byte, error) {
  7315. type NoMethod ExchangedPeeringRoutesListWarning
  7316. raw := NoMethod(*s)
  7317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7318. }
  7319. type ExchangedPeeringRoutesListWarningData struct {
  7320. // Key: [Output Only] A key that provides more detail on the warning
  7321. // being returned. For example, for warnings where there are no results
  7322. // in a list request for a particular zone, this key might be scope and
  7323. // the key value might be the zone name. Other examples might be a key
  7324. // indicating a deprecated resource and a suggested replacement, or a
  7325. // warning about invalid network settings (for example, if an instance
  7326. // attempts to perform IP forwarding but is not enabled for IP
  7327. // forwarding).
  7328. Key string `json:"key,omitempty"`
  7329. // Value: [Output Only] A warning data value corresponding to the key.
  7330. Value string `json:"value,omitempty"`
  7331. // ForceSendFields is a list of field names (e.g. "Key") to
  7332. // unconditionally include in API requests. By default, fields with
  7333. // empty values are omitted from API requests. However, any non-pointer,
  7334. // non-interface field appearing in ForceSendFields will be sent to the
  7335. // server regardless of whether the field is empty or not. This may be
  7336. // used to include empty fields in Patch requests.
  7337. ForceSendFields []string `json:"-"`
  7338. // NullFields is a list of field names (e.g. "Key") to include in API
  7339. // requests with the JSON null value. By default, fields with empty
  7340. // values are omitted from API requests. However, any field with an
  7341. // empty value appearing in NullFields will be sent to the server as
  7342. // null. It is an error if a field in this list has a non-empty value.
  7343. // This may be used to include null fields in Patch requests.
  7344. NullFields []string `json:"-"`
  7345. }
  7346. func (s *ExchangedPeeringRoutesListWarningData) MarshalJSON() ([]byte, error) {
  7347. type NoMethod ExchangedPeeringRoutesListWarningData
  7348. raw := NoMethod(*s)
  7349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7350. }
  7351. // Expr: Represents an expression text. Example:
  7352. //
  7353. // title: "User account presence" description: "Determines whether the
  7354. // request has a user account" expression: "size(request.user) > 0"
  7355. type Expr struct {
  7356. // Description: An optional description of the expression. This is a
  7357. // longer text which describes the expression, e.g. when hovered over it
  7358. // in a UI.
  7359. Description string `json:"description,omitempty"`
  7360. // Expression: Textual representation of an expression in Common
  7361. // Expression Language syntax.
  7362. //
  7363. // The application context of the containing message determines which
  7364. // well-known feature set of CEL is supported.
  7365. Expression string `json:"expression,omitempty"`
  7366. // Location: An optional string indicating the location of the
  7367. // expression for error reporting, e.g. a file name and a position in
  7368. // the file.
  7369. Location string `json:"location,omitempty"`
  7370. // Title: An optional title for the expression, i.e. a short string
  7371. // describing its purpose. This can be used e.g. in UIs which allow to
  7372. // enter the expression.
  7373. Title string `json:"title,omitempty"`
  7374. // ForceSendFields is a list of field names (e.g. "Description") to
  7375. // unconditionally include in API requests. By default, fields with
  7376. // empty values are omitted from API requests. However, any non-pointer,
  7377. // non-interface field appearing in ForceSendFields will be sent to the
  7378. // server regardless of whether the field is empty or not. This may be
  7379. // used to include empty fields in Patch requests.
  7380. ForceSendFields []string `json:"-"`
  7381. // NullFields is a list of field names (e.g. "Description") to include
  7382. // in API requests with the JSON null value. By default, fields with
  7383. // empty values are omitted from API requests. However, any field with
  7384. // an empty value appearing in NullFields will be sent to the server as
  7385. // null. It is an error if a field in this list has a non-empty value.
  7386. // This may be used to include null fields in Patch requests.
  7387. NullFields []string `json:"-"`
  7388. }
  7389. func (s *Expr) MarshalJSON() ([]byte, error) {
  7390. type NoMethod Expr
  7391. raw := NoMethod(*s)
  7392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7393. }
  7394. // ExternalVpnGateway: External VPN gateway is the on-premises VPN
  7395. // gateway(s) or another cloud provider?s VPN gateway that connects to
  7396. // your Google Cloud VPN gateway. To create a highly available VPN from
  7397. // Google Cloud to your on-premises side or another Cloud provider's VPN
  7398. // gateway, you must create a external VPN gateway resource in GCP,
  7399. // which provides the information to GCP about your external VPN
  7400. // gateway.
  7401. type ExternalVpnGateway struct {
  7402. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7403. // format.
  7404. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7405. // Description: An optional description of this resource. Provide this
  7406. // property when you create the resource.
  7407. Description string `json:"description,omitempty"`
  7408. // Id: [Output Only] The unique identifier for the resource. This
  7409. // identifier is defined by the server.
  7410. Id uint64 `json:"id,omitempty,string"`
  7411. // Interfaces: List of interfaces for this external VPN gateway.
  7412. Interfaces []*ExternalVpnGatewayInterface `json:"interfaces,omitempty"`
  7413. // Kind: [Output Only] Type of the resource. Always
  7414. // compute#externalVpnGateway for externalVpnGateways.
  7415. Kind string `json:"kind,omitempty"`
  7416. // LabelFingerprint: A fingerprint for the labels being applied to this
  7417. // ExternalVpnGateway, which is essentially a hash of the labels set
  7418. // used for optimistic locking. The fingerprint is initially generated
  7419. // by Compute Engine and changes after every request to modify or update
  7420. // labels. You must always provide an up-to-date fingerprint hash in
  7421. // order to update or change labels, otherwise the request will fail
  7422. // with error 412 conditionNotMet.
  7423. //
  7424. // To see the latest fingerprint, make a get() request to retrieve an
  7425. // ExternalVpnGateway.
  7426. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7427. // Labels: Labels to apply to this ExternalVpnGateway resource. These
  7428. // can be later modified by the setLabels method. Each label key/value
  7429. // must comply with RFC1035. Label values may be empty.
  7430. Labels map[string]string `json:"labels,omitempty"`
  7431. // Name: Name of the resource. Provided by the client when the resource
  7432. // is created. The name must be 1-63 characters long, and comply with
  7433. // RFC1035. Specifically, the name must be 1-63 characters long and
  7434. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7435. // the first character must be a lowercase letter, and all following
  7436. // characters must be a dash, lowercase letter, or digit, except the
  7437. // last character, which cannot be a dash.
  7438. Name string `json:"name,omitempty"`
  7439. // RedundancyType: Indicates the user-supplied redundancy type of this
  7440. // external VPN gateway.
  7441. //
  7442. // Possible values:
  7443. // "FOUR_IPS_REDUNDANCY"
  7444. // "SINGLE_IP_INTERNALLY_REDUNDANT"
  7445. // "TWO_IPS_REDUNDANCY"
  7446. RedundancyType string `json:"redundancyType,omitempty"`
  7447. // SelfLink: [Output Only] Server-defined URL for the resource.
  7448. SelfLink string `json:"selfLink,omitempty"`
  7449. // ServerResponse contains the HTTP response code and headers from the
  7450. // server.
  7451. googleapi.ServerResponse `json:"-"`
  7452. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  7453. // to unconditionally include in API requests. By default, fields with
  7454. // empty values are omitted from API requests. However, any non-pointer,
  7455. // non-interface field appearing in ForceSendFields will be sent to the
  7456. // server regardless of whether the field is empty or not. This may be
  7457. // used to include empty fields in Patch requests.
  7458. ForceSendFields []string `json:"-"`
  7459. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  7460. // include in API requests with the JSON null value. By default, fields
  7461. // with empty values are omitted from API requests. However, any field
  7462. // with an empty value appearing in NullFields will be sent to the
  7463. // server as null. It is an error if a field in this list has a
  7464. // non-empty value. This may be used to include null fields in Patch
  7465. // requests.
  7466. NullFields []string `json:"-"`
  7467. }
  7468. func (s *ExternalVpnGateway) MarshalJSON() ([]byte, error) {
  7469. type NoMethod ExternalVpnGateway
  7470. raw := NoMethod(*s)
  7471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7472. }
  7473. // ExternalVpnGatewayInterface: The interface for the external VPN
  7474. // gateway.
  7475. type ExternalVpnGatewayInterface struct {
  7476. // Id: The numeric ID of this interface. The allowed input values for
  7477. // this id for different redundancy types of external VPN gateway:
  7478. // SINGLE_IP_INTERNALLY_REDUNDANT - 0 TWO_IPS_REDUNDANCY - 0, 1
  7479. // FOUR_IPS_REDUNDANCY - 0, 1, 2, 3
  7480. Id int64 `json:"id,omitempty"`
  7481. // IpAddress: IP address of the interface in the external VPN gateway.
  7482. // Only IPv4 is supported. This IP address can be either from your
  7483. // on-premise gateway or another Cloud provider?s VPN gateway, it cannot
  7484. // be an IP address from Google Compute Engine.
  7485. IpAddress string `json:"ipAddress,omitempty"`
  7486. // ForceSendFields is a list of field names (e.g. "Id") to
  7487. // unconditionally include in API requests. By default, fields with
  7488. // empty values are omitted from API requests. However, any non-pointer,
  7489. // non-interface field appearing in ForceSendFields will be sent to the
  7490. // server regardless of whether the field is empty or not. This may be
  7491. // used to include empty fields in Patch requests.
  7492. ForceSendFields []string `json:"-"`
  7493. // NullFields is a list of field names (e.g. "Id") to include in API
  7494. // requests with the JSON null value. By default, fields with empty
  7495. // values are omitted from API requests. However, any field with an
  7496. // empty value appearing in NullFields will be sent to the server as
  7497. // null. It is an error if a field in this list has a non-empty value.
  7498. // This may be used to include null fields in Patch requests.
  7499. NullFields []string `json:"-"`
  7500. }
  7501. func (s *ExternalVpnGatewayInterface) MarshalJSON() ([]byte, error) {
  7502. type NoMethod ExternalVpnGatewayInterface
  7503. raw := NoMethod(*s)
  7504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7505. }
  7506. // ExternalVpnGatewayList: Response to the list request, and contains a
  7507. // list of externalVpnGateways.
  7508. type ExternalVpnGatewayList struct {
  7509. Etag string `json:"etag,omitempty"`
  7510. // Id: [Output Only] Unique identifier for the resource; defined by the
  7511. // server.
  7512. Id string `json:"id,omitempty"`
  7513. // Items: A list of ExternalVpnGateway resources.
  7514. Items []*ExternalVpnGateway `json:"items,omitempty"`
  7515. // Kind: [Output Only] Type of resource. Always
  7516. // compute#externalVpnGatewayList for lists of externalVpnGateways.
  7517. Kind string `json:"kind,omitempty"`
  7518. // NextPageToken: [Output Only] This token allows you to get the next
  7519. // page of results for list requests. If the number of results is larger
  7520. // than maxResults, use the nextPageToken as a value for the query
  7521. // parameter pageToken in the next list request. Subsequent list
  7522. // requests will have their own nextPageToken to continue paging through
  7523. // the results.
  7524. NextPageToken string `json:"nextPageToken,omitempty"`
  7525. // SelfLink: [Output Only] Server-defined URL for this resource.
  7526. SelfLink string `json:"selfLink,omitempty"`
  7527. // Warning: [Output Only] Informational warning message.
  7528. Warning *ExternalVpnGatewayListWarning `json:"warning,omitempty"`
  7529. // ServerResponse contains the HTTP response code and headers from the
  7530. // server.
  7531. googleapi.ServerResponse `json:"-"`
  7532. // ForceSendFields is a list of field names (e.g. "Etag") to
  7533. // unconditionally include in API requests. By default, fields with
  7534. // empty values are omitted from API requests. However, any non-pointer,
  7535. // non-interface field appearing in ForceSendFields will be sent to the
  7536. // server regardless of whether the field is empty or not. This may be
  7537. // used to include empty fields in Patch requests.
  7538. ForceSendFields []string `json:"-"`
  7539. // NullFields is a list of field names (e.g. "Etag") to include in API
  7540. // requests with the JSON null value. By default, fields with empty
  7541. // values are omitted from API requests. However, any field with an
  7542. // empty value appearing in NullFields will be sent to the server as
  7543. // null. It is an error if a field in this list has a non-empty value.
  7544. // This may be used to include null fields in Patch requests.
  7545. NullFields []string `json:"-"`
  7546. }
  7547. func (s *ExternalVpnGatewayList) MarshalJSON() ([]byte, error) {
  7548. type NoMethod ExternalVpnGatewayList
  7549. raw := NoMethod(*s)
  7550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7551. }
  7552. // ExternalVpnGatewayListWarning: [Output Only] Informational warning
  7553. // message.
  7554. type ExternalVpnGatewayListWarning struct {
  7555. // Code: [Output Only] A warning code, if applicable. For example,
  7556. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7557. // the response.
  7558. //
  7559. // Possible values:
  7560. // "CLEANUP_FAILED"
  7561. // "DEPRECATED_RESOURCE_USED"
  7562. // "DEPRECATED_TYPE_USED"
  7563. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7564. // "EXPERIMENTAL_TYPE_USED"
  7565. // "EXTERNAL_API_WARNING"
  7566. // "FIELD_VALUE_OVERRIDEN"
  7567. // "INJECTED_KERNELS_DEPRECATED"
  7568. // "MISSING_TYPE_DEPENDENCY"
  7569. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7570. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7571. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7572. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7573. // "NEXT_HOP_NOT_RUNNING"
  7574. // "NOT_CRITICAL_ERROR"
  7575. // "NO_RESULTS_ON_PAGE"
  7576. // "REQUIRED_TOS_AGREEMENT"
  7577. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7578. // "RESOURCE_NOT_DELETED"
  7579. // "SCHEMA_VALIDATION_IGNORED"
  7580. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7581. // "UNDECLARED_PROPERTIES"
  7582. // "UNREACHABLE"
  7583. Code string `json:"code,omitempty"`
  7584. // Data: [Output Only] Metadata about this warning in key: value format.
  7585. // For example:
  7586. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7587. Data []*ExternalVpnGatewayListWarningData `json:"data,omitempty"`
  7588. // Message: [Output Only] A human-readable description of the warning
  7589. // code.
  7590. Message string `json:"message,omitempty"`
  7591. // ForceSendFields is a list of field names (e.g. "Code") to
  7592. // unconditionally include in API requests. By default, fields with
  7593. // empty values are omitted from API requests. However, any non-pointer,
  7594. // non-interface field appearing in ForceSendFields will be sent to the
  7595. // server regardless of whether the field is empty or not. This may be
  7596. // used to include empty fields in Patch requests.
  7597. ForceSendFields []string `json:"-"`
  7598. // NullFields is a list of field names (e.g. "Code") to include in API
  7599. // requests with the JSON null value. By default, fields with empty
  7600. // values are omitted from API requests. However, any field with an
  7601. // empty value appearing in NullFields will be sent to the server as
  7602. // null. It is an error if a field in this list has a non-empty value.
  7603. // This may be used to include null fields in Patch requests.
  7604. NullFields []string `json:"-"`
  7605. }
  7606. func (s *ExternalVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  7607. type NoMethod ExternalVpnGatewayListWarning
  7608. raw := NoMethod(*s)
  7609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7610. }
  7611. type ExternalVpnGatewayListWarningData struct {
  7612. // Key: [Output Only] A key that provides more detail on the warning
  7613. // being returned. For example, for warnings where there are no results
  7614. // in a list request for a particular zone, this key might be scope and
  7615. // the key value might be the zone name. Other examples might be a key
  7616. // indicating a deprecated resource and a suggested replacement, or a
  7617. // warning about invalid network settings (for example, if an instance
  7618. // attempts to perform IP forwarding but is not enabled for IP
  7619. // forwarding).
  7620. Key string `json:"key,omitempty"`
  7621. // Value: [Output Only] A warning data value corresponding to the key.
  7622. Value string `json:"value,omitempty"`
  7623. // ForceSendFields is a list of field names (e.g. "Key") to
  7624. // unconditionally include in API requests. By default, fields with
  7625. // empty values are omitted from API requests. However, any non-pointer,
  7626. // non-interface field appearing in ForceSendFields will be sent to the
  7627. // server regardless of whether the field is empty or not. This may be
  7628. // used to include empty fields in Patch requests.
  7629. ForceSendFields []string `json:"-"`
  7630. // NullFields is a list of field names (e.g. "Key") to include in API
  7631. // requests with the JSON null value. By default, fields with empty
  7632. // values are omitted from API requests. However, any field with an
  7633. // empty value appearing in NullFields will be sent to the server as
  7634. // null. It is an error if a field in this list has a non-empty value.
  7635. // This may be used to include null fields in Patch requests.
  7636. NullFields []string `json:"-"`
  7637. }
  7638. func (s *ExternalVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  7639. type NoMethod ExternalVpnGatewayListWarningData
  7640. raw := NoMethod(*s)
  7641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7642. }
  7643. type FileContentBuffer struct {
  7644. // Content: The raw content in the secure keys file.
  7645. Content string `json:"content,omitempty"`
  7646. // Possible values:
  7647. // "BIN"
  7648. // "UNDEFINED"
  7649. // "X509"
  7650. FileType string `json:"fileType,omitempty"`
  7651. // ForceSendFields is a list of field names (e.g. "Content") to
  7652. // unconditionally include in API requests. By default, fields with
  7653. // empty values are omitted from API requests. However, any non-pointer,
  7654. // non-interface field appearing in ForceSendFields will be sent to the
  7655. // server regardless of whether the field is empty or not. This may be
  7656. // used to include empty fields in Patch requests.
  7657. ForceSendFields []string `json:"-"`
  7658. // NullFields is a list of field names (e.g. "Content") to include in
  7659. // API requests with the JSON null value. By default, fields with empty
  7660. // values are omitted from API requests. However, any field with an
  7661. // empty value appearing in NullFields will be sent to the server as
  7662. // null. It is an error if a field in this list has a non-empty value.
  7663. // This may be used to include null fields in Patch requests.
  7664. NullFields []string `json:"-"`
  7665. }
  7666. func (s *FileContentBuffer) MarshalJSON() ([]byte, error) {
  7667. type NoMethod FileContentBuffer
  7668. raw := NoMethod(*s)
  7669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7670. }
  7671. // Firewall: Represents a Firewall resource.
  7672. type Firewall struct {
  7673. // Allowed: The list of ALLOW rules specified by this firewall. Each
  7674. // rule specifies a protocol and port-range tuple that describes a
  7675. // permitted connection.
  7676. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  7677. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7678. // format.
  7679. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7680. // Denied: The list of DENY rules specified by this firewall. Each rule
  7681. // specifies a protocol and port-range tuple that describes a denied
  7682. // connection.
  7683. Denied []*FirewallDenied `json:"denied,omitempty"`
  7684. // Description: An optional description of this resource. Provide this
  7685. // property when you create the resource.
  7686. Description string `json:"description,omitempty"`
  7687. // DestinationRanges: If destination ranges are specified, the firewall
  7688. // will apply only to traffic that has destination IP address in these
  7689. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  7690. // supported.
  7691. DestinationRanges []string `json:"destinationRanges,omitempty"`
  7692. // Direction: Direction of traffic to which this firewall applies;
  7693. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  7694. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  7695. // specify sourceRanges OR sourceTags.
  7696. //
  7697. // Possible values:
  7698. // "EGRESS"
  7699. // "INGRESS"
  7700. Direction string `json:"direction,omitempty"`
  7701. // Disabled: Denotes whether the firewall rule is disabled, i.e not
  7702. // applied to the network it is associated with. When set to true, the
  7703. // firewall rule is not enforced and the network behaves as if it did
  7704. // not exist. If this is unspecified, the firewall rule will be enabled.
  7705. Disabled bool `json:"disabled,omitempty"`
  7706. // EnableLogging: Deprecated in favor of enable in LogConfig. This field
  7707. // denotes whether to enable logging for a particular firewall rule. If
  7708. // logging is enabled, logs will be exported to Stackdriver.
  7709. EnableLogging bool `json:"enableLogging,omitempty"`
  7710. // Id: [Output Only] The unique identifier for the resource. This
  7711. // identifier is defined by the server.
  7712. Id uint64 `json:"id,omitempty,string"`
  7713. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  7714. // firewall rules.
  7715. Kind string `json:"kind,omitempty"`
  7716. // LogConfig: This field denotes the logging options for a particular
  7717. // firewall rule. If logging is enabled, logs will be exported to
  7718. // Stackdriver.
  7719. LogConfig *FirewallLogConfig `json:"logConfig,omitempty"`
  7720. // Name: Name of the resource; provided by the client when the resource
  7721. // is created. The name must be 1-63 characters long, and comply with
  7722. // RFC1035. Specifically, the name must be 1-63 characters long and
  7723. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7724. // the first character must be a lowercase letter, and all following
  7725. // characters must be a dash, lowercase letter, or digit, except the
  7726. // last character, which cannot be a dash.
  7727. Name string `json:"name,omitempty"`
  7728. // Network: URL of the network resource for this firewall rule. If not
  7729. // specified when creating a firewall rule, the default network is
  7730. // used:
  7731. // global/networks/default
  7732. // If you choose to specify this property, you can specify the network
  7733. // as a full or partial URL. For example, the following are all valid
  7734. // URLs:
  7735. // -
  7736. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  7737. // - projects/myproject/global/networks/my-network
  7738. // - global/networks/default
  7739. Network string `json:"network,omitempty"`
  7740. // Priority: Priority for this rule. This is an integer between 0 and
  7741. // 65535, both inclusive. When not specified, the value assumed is 1000.
  7742. // Relative priorities determine precedence of conflicting rules. Lower
  7743. // value of priority implies higher precedence (eg, a rule with priority
  7744. // 0 has higher precedence than a rule with priority 1). DENY rules take
  7745. // precedence over ALLOW rules having equal priority.
  7746. Priority int64 `json:"priority,omitempty"`
  7747. // SelfLink: [Output Only] Server-defined URL for the resource.
  7748. SelfLink string `json:"selfLink,omitempty"`
  7749. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  7750. // with the resource id.
  7751. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  7752. // SourceRanges: If source ranges are specified, the firewall will apply
  7753. // only to traffic that has source IP address in these ranges. These
  7754. // ranges must be expressed in CIDR format. One or both of sourceRanges
  7755. // and sourceTags may be set. If both properties are set, the firewall
  7756. // will apply to traffic that has source IP address within sourceRanges
  7757. // OR the source IP that belongs to a tag listed in the sourceTags
  7758. // property. The connection does not need to match both properties for
  7759. // the firewall to apply. Only IPv4 is supported.
  7760. SourceRanges []string `json:"sourceRanges,omitempty"`
  7761. // SourceServiceAccounts: If source service accounts are specified, the
  7762. // firewall will apply only to traffic originating from an instance with
  7763. // a service account in this list. Source service accounts cannot be
  7764. // used to control traffic to an instance's external IP address because
  7765. // service accounts are associated with an instance, not an IP address.
  7766. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  7767. // both are set, the firewall will apply to traffic that has source IP
  7768. // address within sourceRanges OR the source IP belongs to an instance
  7769. // with service account listed in sourceServiceAccount. The connection
  7770. // does not need to match both properties for the firewall to apply.
  7771. // sourceServiceAccounts cannot be used at the same time as sourceTags
  7772. // or targetTags.
  7773. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  7774. // SourceTags: If source tags are specified, the firewall rule applies
  7775. // only to traffic with source IPs that match the primary network
  7776. // interfaces of VM instances that have the tag and are in the same VPC
  7777. // network. Source tags cannot be used to control traffic to an
  7778. // instance's external IP address, it only applies to traffic between
  7779. // instances in the same virtual network. Because tags are associated
  7780. // with instances, not IP addresses. One or both of sourceRanges and
  7781. // sourceTags may be set. If both properties are set, the firewall will
  7782. // apply to traffic that has source IP address within sourceRanges OR
  7783. // the source IP that belongs to a tag listed in the sourceTags
  7784. // property. The connection does not need to match both properties for
  7785. // the firewall to apply.
  7786. SourceTags []string `json:"sourceTags,omitempty"`
  7787. // TargetServiceAccounts: A list of service accounts indicating sets of
  7788. // instances located in the network that may make network connections as
  7789. // specified in allowed[]. targetServiceAccounts cannot be used at the
  7790. // same time as targetTags or sourceTags. If neither
  7791. // targetServiceAccounts nor targetTags are specified, the firewall rule
  7792. // applies to all instances on the specified network.
  7793. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  7794. // TargetTags: A list of tags that controls which instances the firewall
  7795. // rule applies to. If targetTags are specified, then the firewall rule
  7796. // applies only to instances in the VPC network that have one of those
  7797. // tags. If no targetTags are specified, the firewall rule applies to
  7798. // all instances on the specified network.
  7799. TargetTags []string `json:"targetTags,omitempty"`
  7800. // ServerResponse contains the HTTP response code and headers from the
  7801. // server.
  7802. googleapi.ServerResponse `json:"-"`
  7803. // ForceSendFields is a list of field names (e.g. "Allowed") to
  7804. // unconditionally include in API requests. By default, fields with
  7805. // empty values are omitted from API requests. However, any non-pointer,
  7806. // non-interface field appearing in ForceSendFields will be sent to the
  7807. // server regardless of whether the field is empty or not. This may be
  7808. // used to include empty fields in Patch requests.
  7809. ForceSendFields []string `json:"-"`
  7810. // NullFields is a list of field names (e.g. "Allowed") to include in
  7811. // API requests with the JSON null value. By default, fields with empty
  7812. // values are omitted from API requests. However, any field with an
  7813. // empty value appearing in NullFields will be sent to the server as
  7814. // null. It is an error if a field in this list has a non-empty value.
  7815. // This may be used to include null fields in Patch requests.
  7816. NullFields []string `json:"-"`
  7817. }
  7818. func (s *Firewall) MarshalJSON() ([]byte, error) {
  7819. type NoMethod Firewall
  7820. raw := NoMethod(*s)
  7821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7822. }
  7823. type FirewallAllowed struct {
  7824. // IPProtocol: The IP protocol to which this rule applies. The protocol
  7825. // type is required when creating a firewall rule. This value can either
  7826. // be one of the following well known protocol strings (tcp, udp, icmp,
  7827. // esp, ah, ipip, sctp), or the IP protocol number.
  7828. IPProtocol string `json:"IPProtocol,omitempty"`
  7829. // Ports: An optional list of ports to which this rule applies. This
  7830. // field is only applicable for UDP or TCP protocol. Each entry must be
  7831. // either an integer or a range. If not specified, this rule applies to
  7832. // connections through any port.
  7833. //
  7834. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  7835. Ports []string `json:"ports,omitempty"`
  7836. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  7837. // unconditionally include in API requests. By default, fields with
  7838. // empty values are omitted from API requests. However, any non-pointer,
  7839. // non-interface field appearing in ForceSendFields will be sent to the
  7840. // server regardless of whether the field is empty or not. This may be
  7841. // used to include empty fields in Patch requests.
  7842. ForceSendFields []string `json:"-"`
  7843. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  7844. // API requests with the JSON null value. By default, fields with empty
  7845. // values are omitted from API requests. However, any field with an
  7846. // empty value appearing in NullFields will be sent to the server as
  7847. // null. It is an error if a field in this list has a non-empty value.
  7848. // This may be used to include null fields in Patch requests.
  7849. NullFields []string `json:"-"`
  7850. }
  7851. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  7852. type NoMethod FirewallAllowed
  7853. raw := NoMethod(*s)
  7854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7855. }
  7856. type FirewallDenied struct {
  7857. // IPProtocol: The IP protocol to which this rule applies. The protocol
  7858. // type is required when creating a firewall rule. This value can either
  7859. // be one of the following well known protocol strings (tcp, udp, icmp,
  7860. // esp, ah, ipip, sctp), or the IP protocol number.
  7861. IPProtocol string `json:"IPProtocol,omitempty"`
  7862. // Ports: An optional list of ports to which this rule applies. This
  7863. // field is only applicable for UDP or TCP protocol. Each entry must be
  7864. // either an integer or a range. If not specified, this rule applies to
  7865. // connections through any port.
  7866. //
  7867. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  7868. Ports []string `json:"ports,omitempty"`
  7869. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  7870. // unconditionally include in API requests. By default, fields with
  7871. // empty values are omitted from API requests. However, any non-pointer,
  7872. // non-interface field appearing in ForceSendFields will be sent to the
  7873. // server regardless of whether the field is empty or not. This may be
  7874. // used to include empty fields in Patch requests.
  7875. ForceSendFields []string `json:"-"`
  7876. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  7877. // API requests with the JSON null value. By default, fields with empty
  7878. // values are omitted from API requests. However, any field with an
  7879. // empty value appearing in NullFields will be sent to the server as
  7880. // null. It is an error if a field in this list has a non-empty value.
  7881. // This may be used to include null fields in Patch requests.
  7882. NullFields []string `json:"-"`
  7883. }
  7884. func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
  7885. type NoMethod FirewallDenied
  7886. raw := NoMethod(*s)
  7887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7888. }
  7889. // FirewallList: Contains a list of firewalls.
  7890. type FirewallList struct {
  7891. // Id: [Output Only] Unique identifier for the resource; defined by the
  7892. // server.
  7893. Id string `json:"id,omitempty"`
  7894. // Items: A list of Firewall resources.
  7895. Items []*Firewall `json:"items,omitempty"`
  7896. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  7897. // lists of firewalls.
  7898. Kind string `json:"kind,omitempty"`
  7899. // NextPageToken: [Output Only] This token allows you to get the next
  7900. // page of results for list requests. If the number of results is larger
  7901. // than maxResults, use the nextPageToken as a value for the query
  7902. // parameter pageToken in the next list request. Subsequent list
  7903. // requests will have their own nextPageToken to continue paging through
  7904. // the results.
  7905. NextPageToken string `json:"nextPageToken,omitempty"`
  7906. // SelfLink: [Output Only] Server-defined URL for this resource.
  7907. SelfLink string `json:"selfLink,omitempty"`
  7908. // Warning: [Output Only] Informational warning message.
  7909. Warning *FirewallListWarning `json:"warning,omitempty"`
  7910. // ServerResponse contains the HTTP response code and headers from the
  7911. // server.
  7912. googleapi.ServerResponse `json:"-"`
  7913. // ForceSendFields is a list of field names (e.g. "Id") to
  7914. // unconditionally include in API requests. By default, fields with
  7915. // empty values are omitted from API requests. However, any non-pointer,
  7916. // non-interface field appearing in ForceSendFields will be sent to the
  7917. // server regardless of whether the field is empty or not. This may be
  7918. // used to include empty fields in Patch requests.
  7919. ForceSendFields []string `json:"-"`
  7920. // NullFields is a list of field names (e.g. "Id") to include in API
  7921. // requests with the JSON null value. By default, fields with empty
  7922. // values are omitted from API requests. However, any field with an
  7923. // empty value appearing in NullFields will be sent to the server as
  7924. // null. It is an error if a field in this list has a non-empty value.
  7925. // This may be used to include null fields in Patch requests.
  7926. NullFields []string `json:"-"`
  7927. }
  7928. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  7929. type NoMethod FirewallList
  7930. raw := NoMethod(*s)
  7931. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7932. }
  7933. // FirewallListWarning: [Output Only] Informational warning message.
  7934. type FirewallListWarning struct {
  7935. // Code: [Output Only] A warning code, if applicable. For example,
  7936. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7937. // the response.
  7938. //
  7939. // Possible values:
  7940. // "CLEANUP_FAILED"
  7941. // "DEPRECATED_RESOURCE_USED"
  7942. // "DEPRECATED_TYPE_USED"
  7943. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7944. // "EXPERIMENTAL_TYPE_USED"
  7945. // "EXTERNAL_API_WARNING"
  7946. // "FIELD_VALUE_OVERRIDEN"
  7947. // "INJECTED_KERNELS_DEPRECATED"
  7948. // "MISSING_TYPE_DEPENDENCY"
  7949. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7950. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7951. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7952. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7953. // "NEXT_HOP_NOT_RUNNING"
  7954. // "NOT_CRITICAL_ERROR"
  7955. // "NO_RESULTS_ON_PAGE"
  7956. // "REQUIRED_TOS_AGREEMENT"
  7957. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7958. // "RESOURCE_NOT_DELETED"
  7959. // "SCHEMA_VALIDATION_IGNORED"
  7960. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7961. // "UNDECLARED_PROPERTIES"
  7962. // "UNREACHABLE"
  7963. Code string `json:"code,omitempty"`
  7964. // Data: [Output Only] Metadata about this warning in key: value format.
  7965. // For example:
  7966. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7967. Data []*FirewallListWarningData `json:"data,omitempty"`
  7968. // Message: [Output Only] A human-readable description of the warning
  7969. // code.
  7970. Message string `json:"message,omitempty"`
  7971. // ForceSendFields is a list of field names (e.g. "Code") to
  7972. // unconditionally include in API requests. By default, fields with
  7973. // empty values are omitted from API requests. However, any non-pointer,
  7974. // non-interface field appearing in ForceSendFields will be sent to the
  7975. // server regardless of whether the field is empty or not. This may be
  7976. // used to include empty fields in Patch requests.
  7977. ForceSendFields []string `json:"-"`
  7978. // NullFields is a list of field names (e.g. "Code") to include in API
  7979. // requests with the JSON null value. By default, fields with empty
  7980. // values are omitted from API requests. However, any field with an
  7981. // empty value appearing in NullFields will be sent to the server as
  7982. // null. It is an error if a field in this list has a non-empty value.
  7983. // This may be used to include null fields in Patch requests.
  7984. NullFields []string `json:"-"`
  7985. }
  7986. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  7987. type NoMethod FirewallListWarning
  7988. raw := NoMethod(*s)
  7989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7990. }
  7991. type FirewallListWarningData struct {
  7992. // Key: [Output Only] A key that provides more detail on the warning
  7993. // being returned. For example, for warnings where there are no results
  7994. // in a list request for a particular zone, this key might be scope and
  7995. // the key value might be the zone name. Other examples might be a key
  7996. // indicating a deprecated resource and a suggested replacement, or a
  7997. // warning about invalid network settings (for example, if an instance
  7998. // attempts to perform IP forwarding but is not enabled for IP
  7999. // forwarding).
  8000. Key string `json:"key,omitempty"`
  8001. // Value: [Output Only] A warning data value corresponding to the key.
  8002. Value string `json:"value,omitempty"`
  8003. // ForceSendFields is a list of field names (e.g. "Key") to
  8004. // unconditionally include in API requests. By default, fields with
  8005. // empty values are omitted from API requests. However, any non-pointer,
  8006. // non-interface field appearing in ForceSendFields will be sent to the
  8007. // server regardless of whether the field is empty or not. This may be
  8008. // used to include empty fields in Patch requests.
  8009. ForceSendFields []string `json:"-"`
  8010. // NullFields is a list of field names (e.g. "Key") to include in API
  8011. // requests with the JSON null value. By default, fields with empty
  8012. // values are omitted from API requests. However, any field with an
  8013. // empty value appearing in NullFields will be sent to the server as
  8014. // null. It is an error if a field in this list has a non-empty value.
  8015. // This may be used to include null fields in Patch requests.
  8016. NullFields []string `json:"-"`
  8017. }
  8018. func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  8019. type NoMethod FirewallListWarningData
  8020. raw := NoMethod(*s)
  8021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8022. }
  8023. // FirewallLogConfig: The available logging options for a firewall rule.
  8024. type FirewallLogConfig struct {
  8025. // Enable: This field denotes whether to enable logging for a particular
  8026. // firewall rule.
  8027. Enable bool `json:"enable,omitempty"`
  8028. // Metadata: This field can only be specified for a particular firewall
  8029. // rule if logging is enabled for that rule. This field denotes whether
  8030. // to include or exclude metadata for firewall logs.
  8031. //
  8032. // Possible values:
  8033. // "EXCLUDE_ALL_METADATA"
  8034. // "INCLUDE_ALL_METADATA"
  8035. Metadata string `json:"metadata,omitempty"`
  8036. // ForceSendFields is a list of field names (e.g. "Enable") to
  8037. // unconditionally include in API requests. By default, fields with
  8038. // empty values are omitted from API requests. However, any non-pointer,
  8039. // non-interface field appearing in ForceSendFields will be sent to the
  8040. // server regardless of whether the field is empty or not. This may be
  8041. // used to include empty fields in Patch requests.
  8042. ForceSendFields []string `json:"-"`
  8043. // NullFields is a list of field names (e.g. "Enable") to include in API
  8044. // requests with the JSON null value. By default, fields with empty
  8045. // values are omitted from API requests. However, any field with an
  8046. // empty value appearing in NullFields will be sent to the server as
  8047. // null. It is an error if a field in this list has a non-empty value.
  8048. // This may be used to include null fields in Patch requests.
  8049. NullFields []string `json:"-"`
  8050. }
  8051. func (s *FirewallLogConfig) MarshalJSON() ([]byte, error) {
  8052. type NoMethod FirewallLogConfig
  8053. raw := NoMethod(*s)
  8054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8055. }
  8056. // FixedOrPercent: Encapsulates numeric value that can be either
  8057. // absolute or relative.
  8058. type FixedOrPercent struct {
  8059. // Calculated: [Output Only] Absolute value of VM instances calculated
  8060. // based on the specific mode.
  8061. //
  8062. //
  8063. // - If the value is fixed, then the calculated value is equal to the
  8064. // fixed value.
  8065. // - If the value is a percent, then the calculated value is percent/100
  8066. // * targetSize. For example, the calculated value of a 80% of a managed
  8067. // instance group with 150 instances would be (80/100 * 150) = 120 VM
  8068. // instances. If there is a remainder, the number is rounded up.
  8069. Calculated int64 `json:"calculated,omitempty"`
  8070. // Fixed: Specifies a fixed number of VM instances. This must be a
  8071. // positive integer.
  8072. Fixed int64 `json:"fixed,omitempty"`
  8073. // Percent: Specifies a percentage of instances between 0 to 100%,
  8074. // inclusive. For example, specify 80 for 80%.
  8075. Percent int64 `json:"percent,omitempty"`
  8076. // ForceSendFields is a list of field names (e.g. "Calculated") to
  8077. // unconditionally include in API requests. By default, fields with
  8078. // empty values are omitted from API requests. However, any non-pointer,
  8079. // non-interface field appearing in ForceSendFields will be sent to the
  8080. // server regardless of whether the field is empty or not. This may be
  8081. // used to include empty fields in Patch requests.
  8082. ForceSendFields []string `json:"-"`
  8083. // NullFields is a list of field names (e.g. "Calculated") to include in
  8084. // API requests with the JSON null value. By default, fields with empty
  8085. // values are omitted from API requests. However, any field with an
  8086. // empty value appearing in NullFields will be sent to the server as
  8087. // null. It is an error if a field in this list has a non-empty value.
  8088. // This may be used to include null fields in Patch requests.
  8089. NullFields []string `json:"-"`
  8090. }
  8091. func (s *FixedOrPercent) MarshalJSON() ([]byte, error) {
  8092. type NoMethod FixedOrPercent
  8093. raw := NoMethod(*s)
  8094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8095. }
  8096. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  8097. // specifies which pool of target virtual machines to forward a packet
  8098. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  8099. // resource_for beta.forwardingRules ==) (== resource_for
  8100. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  8101. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  8102. // beta.regionForwardingRules ==) (== resource_for
  8103. // v1.regionForwardingRules ==)
  8104. type ForwardingRule struct {
  8105. // IPAddress: The IP address that this forwarding rule is serving on
  8106. // behalf of.
  8107. //
  8108. // Addresses are restricted based on the forwarding rule's load
  8109. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  8110. // regional).
  8111. //
  8112. // When the load balancing scheme is EXTERNAL, for global forwarding
  8113. // rules, the address must be a global IP, and for regional forwarding
  8114. // rules, the address must live in the same region as the forwarding
  8115. // rule. If this field is empty, an ephemeral IPv4 address from the same
  8116. // scope (global or regional) will be assigned. A regional forwarding
  8117. // rule supports IPv4 only. A global forwarding rule supports either
  8118. // IPv4 or IPv6.
  8119. //
  8120. // When the load balancing scheme is INTERNAL_SELF_MANAGED, this must be
  8121. // a URL reference to an existing Address resource ( internal regional
  8122. // static IP address), with a purpose of GCE_END_POINT and address_type
  8123. // of INTERNAL.
  8124. //
  8125. // When the load balancing scheme is INTERNAL, this can only be an RFC
  8126. // 1918 IP address belonging to the network/subnet configured for the
  8127. // forwarding rule. By default, if this field is empty, an ephemeral
  8128. // internal IP address will be automatically allocated from the IP range
  8129. // of the subnet or network configured for this forwarding rule.
  8130. //
  8131. // An address can be specified either by a literal IP address or a URL
  8132. // reference to an existing Address resource. The following examples are
  8133. // all valid:
  8134. // - 100.1.2.3
  8135. // -
  8136. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  8137. // - projects/project/regions/region/addresses/address
  8138. // - regions/region/addresses/address
  8139. // - global/addresses/address
  8140. // - address
  8141. IPAddress string `json:"IPAddress,omitempty"`
  8142. // IPProtocol: The IP protocol to which this rule applies. Valid options
  8143. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  8144. //
  8145. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  8146. // valid. When the load balancing scheme is INTERNAL_SELF_MANAGED, only
  8147. // TCPis valid.
  8148. //
  8149. // Possible values:
  8150. // "AH"
  8151. // "ESP"
  8152. // "ICMP"
  8153. // "SCTP"
  8154. // "TCP"
  8155. // "UDP"
  8156. IPProtocol string `json:"IPProtocol,omitempty"`
  8157. // AllPorts: This field is used along with the backend_service field for
  8158. // internal load balancing or with the target field for internal
  8159. // TargetInstance. This field cannot be used with port or portRange
  8160. // fields.
  8161. //
  8162. // When the load balancing scheme is INTERNAL and protocol is TCP/UDP,
  8163. // specify this field to allow packets addressed to any ports will be
  8164. // forwarded to the backends configured with this forwarding rule.
  8165. AllPorts bool `json:"allPorts,omitempty"`
  8166. // AllowGlobalAccess: This field is used along with the backend_service
  8167. // field for internal load balancing or with the target field for
  8168. // internal TargetInstance. If the field is set to TRUE, clients can
  8169. // access ILB from all regions. Otherwise only allows access from
  8170. // clients in the same region as the internal load balancer.
  8171. AllowGlobalAccess bool `json:"allowGlobalAccess,omitempty"`
  8172. // BackendService: This field is only used for INTERNAL load
  8173. // balancing.
  8174. //
  8175. // For internal load balancing, this field identifies the BackendService
  8176. // resource to receive the matched traffic.
  8177. BackendService string `json:"backendService,omitempty"`
  8178. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8179. // format.
  8180. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8181. // Description: An optional description of this resource. Provide this
  8182. // property when you create the resource.
  8183. Description string `json:"description,omitempty"`
  8184. // Fingerprint: Fingerprint of this resource. A hash of the contents
  8185. // stored in this object. This field is used in optimistic locking. This
  8186. // field will be ignored when inserting a ForwardingRule. Include the
  8187. // fingerprint in patch request to ensure that you do not overwrite
  8188. // changes that were applied from another concurrent request.
  8189. //
  8190. // To see the latest fingerprint, make a get() request to retrieve a
  8191. // ForwardingRule.
  8192. Fingerprint string `json:"fingerprint,omitempty"`
  8193. // Id: [Output Only] The unique identifier for the resource. This
  8194. // identifier is defined by the server.
  8195. Id uint64 `json:"id,omitempty,string"`
  8196. // IpVersion: The IP Version that will be used by this forwarding rule.
  8197. // Valid options are IPV4 or IPV6. This can only be specified for an
  8198. // external global forwarding rule.
  8199. //
  8200. // Possible values:
  8201. // "IPV4"
  8202. // "IPV6"
  8203. // "UNSPECIFIED_VERSION"
  8204. IpVersion string `json:"ipVersion,omitempty"`
  8205. // Kind: [Output Only] Type of the resource. Always
  8206. // compute#forwardingRule for Forwarding Rule resources.
  8207. Kind string `json:"kind,omitempty"`
  8208. // LabelFingerprint: A fingerprint for the labels being applied to this
  8209. // resource, which is essentially a hash of the labels set used for
  8210. // optimistic locking. The fingerprint is initially generated by Compute
  8211. // Engine and changes after every request to modify or update labels.
  8212. // You must always provide an up-to-date fingerprint hash in order to
  8213. // update or change labels, otherwise the request will fail with error
  8214. // 412 conditionNotMet.
  8215. //
  8216. // To see the latest fingerprint, make a get() request to retrieve a
  8217. // ForwardingRule.
  8218. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8219. // Labels: Labels to apply to this resource. These can be later modified
  8220. // by the setLabels method. Each label key/value pair must comply with
  8221. // RFC1035. Label values may be empty.
  8222. Labels map[string]string `json:"labels,omitempty"`
  8223. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  8224. // used for and can only take the following values: INTERNAL,
  8225. // INTERNAL_SELF_MANAGED, EXTERNAL. The value of INTERNAL means that
  8226. // this will be used for Internal Network Load Balancing (TCP, UDP). The
  8227. // value of INTERNAL_SELF_MANAGED means that this will be used for
  8228. // Internal Global HTTP(S) LB. The value of EXTERNAL means that this
  8229. // will be used for External Load Balancing (HTTP(S) LB, External
  8230. // TCP/UDP LB, SSL Proxy)
  8231. //
  8232. // Possible values:
  8233. // "EXTERNAL"
  8234. // "INTERNAL"
  8235. // "INTERNAL_MANAGED"
  8236. // "INTERNAL_SELF_MANAGED"
  8237. // "INVALID"
  8238. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  8239. // MetadataFilters: Opaque filter criteria used by Loadbalancer to
  8240. // restrict routing configuration to a limited set xDS compliant
  8241. // clients. In their xDS requests to Loadbalancer, xDS clients present
  8242. // node metadata. If a match takes place, the relevant routing
  8243. // configuration is made available to those proxies.
  8244. // For each metadataFilter in this list, if its filterMatchCriteria is
  8245. // set to MATCH_ANY, at least one of the filterLabels must match the
  8246. // corresponding label provided in the metadata. If its
  8247. // filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels
  8248. // must match with corresponding labels in the provided
  8249. // metadata.
  8250. // metadataFilters specified here can be overridden by those specified
  8251. // in the UrlMap that this ForwardingRule references.
  8252. // metadataFilters only applies to Loadbalancers that have their
  8253. // loadBalancingScheme set to INTERNAL_SELF_MANAGED.
  8254. MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`
  8255. // Name: Name of the resource; provided by the client when the resource
  8256. // is created. The name must be 1-63 characters long, and comply with
  8257. // RFC1035. Specifically, the name must be 1-63 characters long and
  8258. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  8259. // the first character must be a lowercase letter, and all following
  8260. // characters must be a dash, lowercase letter, or digit, except the
  8261. // last character, which cannot be a dash.
  8262. Name string `json:"name,omitempty"`
  8263. // Network: This field is not used for external load balancing.
  8264. //
  8265. // For INTERNAL and INTERNAL_SELF_MANAGED load balancing, this field
  8266. // identifies the network that the load balanced IP should belong to for
  8267. // this Forwarding Rule. If this field is not specified, the default
  8268. // network will be used.
  8269. Network string `json:"network,omitempty"`
  8270. // NetworkTier: This signifies the networking tier used for configuring
  8271. // this load balancer and can only take the following values: PREMIUM ,
  8272. // STANDARD.
  8273. //
  8274. // For regional ForwardingRule, the valid values are PREMIUM and
  8275. // STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
  8276. //
  8277. // If this field is not specified, it is assumed to be PREMIUM. If
  8278. // IPAddress is specified, this value must be equal to the networkTier
  8279. // of the Address.
  8280. //
  8281. // Possible values:
  8282. // "PREMIUM"
  8283. // "SELECT"
  8284. // "STANDARD"
  8285. NetworkTier string `json:"networkTier,omitempty"`
  8286. // PortRange: This field is used along with the target field for
  8287. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  8288. // TargetVpnGateway, TargetPool, TargetInstance.
  8289. //
  8290. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  8291. // addressed to ports in the specified range will be forwarded to
  8292. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  8293. // must have disjoint port ranges.
  8294. //
  8295. // Some types of forwarding target have constraints on the acceptable
  8296. // ports:
  8297. // - TargetHttpProxy: 80, 8080
  8298. // - TargetHttpsProxy: 443
  8299. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  8300. // 995, 1688, 1883, 5222
  8301. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  8302. // 995, 1688, 1883, 5222
  8303. // - TargetVpnGateway: 500, 4500
  8304. PortRange string `json:"portRange,omitempty"`
  8305. // Ports: This field is used along with the backend_service field for
  8306. // internal load balancing.
  8307. //
  8308. // When the load balancing scheme is INTERNAL, a list of ports can be
  8309. // configured, for example, ['80'], ['8000','9000'] etc. Only packets
  8310. // addressed to these ports will be forwarded to the backends configured
  8311. // with this forwarding rule.
  8312. //
  8313. // You may specify a maximum of up to 5 ports.
  8314. Ports []string `json:"ports,omitempty"`
  8315. // Region: [Output Only] URL of the region where the regional forwarding
  8316. // rule resides. This field is not applicable to global forwarding
  8317. // rules. You must specify this field as part of the HTTP request URL.
  8318. // It is not settable as a field in the request body.
  8319. Region string `json:"region,omitempty"`
  8320. // SelfLink: [Output Only] Server-defined URL for the resource.
  8321. SelfLink string `json:"selfLink,omitempty"`
  8322. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  8323. // with the resource id.
  8324. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  8325. // ServiceLabel: An optional prefix to the service name for this
  8326. // Forwarding Rule. If specified, will be the first label of the fully
  8327. // qualified service name.
  8328. //
  8329. // The label must be 1-63 characters long, and comply with RFC1035.
  8330. // Specifically, the label must be 1-63 characters long and match the
  8331. // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  8332. // character must be a lowercase letter, and all following characters
  8333. // must be a dash, lowercase letter, or digit, except the last
  8334. // character, which cannot be a dash.
  8335. //
  8336. // This field is only used for internal load balancing.
  8337. ServiceLabel string `json:"serviceLabel,omitempty"`
  8338. // ServiceName: [Output Only] The internal fully qualified service name
  8339. // for this Forwarding Rule.
  8340. //
  8341. // This field is only used for internal load balancing.
  8342. ServiceName string `json:"serviceName,omitempty"`
  8343. // Subnetwork: This field is only used for INTERNAL load balancing.
  8344. //
  8345. // For internal load balancing, this field identifies the subnetwork
  8346. // that the load balanced IP should belong to for this Forwarding
  8347. // Rule.
  8348. //
  8349. // If the network specified is in auto subnet mode, this field is
  8350. // optional. However, if the network is in custom subnet mode, a
  8351. // subnetwork must be specified.
  8352. Subnetwork string `json:"subnetwork,omitempty"`
  8353. // Target: The URL of the target resource to receive the matched
  8354. // traffic. For regional forwarding rules, this target must live in the
  8355. // same region as the forwarding rule. For global forwarding rules, this
  8356. // target must be a global load balancing resource. The forwarded
  8357. // traffic must be of a type appropriate to the target object. For
  8358. // INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are
  8359. // valid.
  8360. Target string `json:"target,omitempty"`
  8361. // ServerResponse contains the HTTP response code and headers from the
  8362. // server.
  8363. googleapi.ServerResponse `json:"-"`
  8364. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  8365. // unconditionally include in API requests. By default, fields with
  8366. // empty values are omitted from API requests. However, any non-pointer,
  8367. // non-interface field appearing in ForceSendFields will be sent to the
  8368. // server regardless of whether the field is empty or not. This may be
  8369. // used to include empty fields in Patch requests.
  8370. ForceSendFields []string `json:"-"`
  8371. // NullFields is a list of field names (e.g. "IPAddress") to include in
  8372. // API requests with the JSON null value. By default, fields with empty
  8373. // values are omitted from API requests. However, any field with an
  8374. // empty value appearing in NullFields will be sent to the server as
  8375. // null. It is an error if a field in this list has a non-empty value.
  8376. // This may be used to include null fields in Patch requests.
  8377. NullFields []string `json:"-"`
  8378. }
  8379. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  8380. type NoMethod ForwardingRule
  8381. raw := NoMethod(*s)
  8382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8383. }
  8384. type ForwardingRuleAggregatedList struct {
  8385. // Id: [Output Only] Unique identifier for the resource; defined by the
  8386. // server.
  8387. Id string `json:"id,omitempty"`
  8388. // Items: A list of ForwardingRulesScopedList resources.
  8389. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  8390. // Kind: [Output Only] Type of resource. Always
  8391. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  8392. Kind string `json:"kind,omitempty"`
  8393. // NextPageToken: [Output Only] This token allows you to get the next
  8394. // page of results for list requests. If the number of results is larger
  8395. // than maxResults, use the nextPageToken as a value for the query
  8396. // parameter pageToken in the next list request. Subsequent list
  8397. // requests will have their own nextPageToken to continue paging through
  8398. // the results.
  8399. NextPageToken string `json:"nextPageToken,omitempty"`
  8400. // SelfLink: [Output Only] Server-defined URL for this resource.
  8401. SelfLink string `json:"selfLink,omitempty"`
  8402. // Warning: [Output Only] Informational warning message.
  8403. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  8404. // ServerResponse contains the HTTP response code and headers from the
  8405. // server.
  8406. googleapi.ServerResponse `json:"-"`
  8407. // ForceSendFields is a list of field names (e.g. "Id") to
  8408. // unconditionally include in API requests. By default, fields with
  8409. // empty values are omitted from API requests. However, any non-pointer,
  8410. // non-interface field appearing in ForceSendFields will be sent to the
  8411. // server regardless of whether the field is empty or not. This may be
  8412. // used to include empty fields in Patch requests.
  8413. ForceSendFields []string `json:"-"`
  8414. // NullFields is a list of field names (e.g. "Id") to include in API
  8415. // requests with the JSON null value. By default, fields with empty
  8416. // values are omitted from API requests. However, any field with an
  8417. // empty value appearing in NullFields will be sent to the server as
  8418. // null. It is an error if a field in this list has a non-empty value.
  8419. // This may be used to include null fields in Patch requests.
  8420. NullFields []string `json:"-"`
  8421. }
  8422. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  8423. type NoMethod ForwardingRuleAggregatedList
  8424. raw := NoMethod(*s)
  8425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8426. }
  8427. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  8428. // warning message.
  8429. type ForwardingRuleAggregatedListWarning struct {
  8430. // Code: [Output Only] A warning code, if applicable. For example,
  8431. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8432. // the response.
  8433. //
  8434. // Possible values:
  8435. // "CLEANUP_FAILED"
  8436. // "DEPRECATED_RESOURCE_USED"
  8437. // "DEPRECATED_TYPE_USED"
  8438. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8439. // "EXPERIMENTAL_TYPE_USED"
  8440. // "EXTERNAL_API_WARNING"
  8441. // "FIELD_VALUE_OVERRIDEN"
  8442. // "INJECTED_KERNELS_DEPRECATED"
  8443. // "MISSING_TYPE_DEPENDENCY"
  8444. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8445. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8446. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8447. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8448. // "NEXT_HOP_NOT_RUNNING"
  8449. // "NOT_CRITICAL_ERROR"
  8450. // "NO_RESULTS_ON_PAGE"
  8451. // "REQUIRED_TOS_AGREEMENT"
  8452. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8453. // "RESOURCE_NOT_DELETED"
  8454. // "SCHEMA_VALIDATION_IGNORED"
  8455. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8456. // "UNDECLARED_PROPERTIES"
  8457. // "UNREACHABLE"
  8458. Code string `json:"code,omitempty"`
  8459. // Data: [Output Only] Metadata about this warning in key: value format.
  8460. // For example:
  8461. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8462. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  8463. // Message: [Output Only] A human-readable description of the warning
  8464. // code.
  8465. Message string `json:"message,omitempty"`
  8466. // ForceSendFields is a list of field names (e.g. "Code") to
  8467. // unconditionally include in API requests. By default, fields with
  8468. // empty values are omitted from API requests. However, any non-pointer,
  8469. // non-interface field appearing in ForceSendFields will be sent to the
  8470. // server regardless of whether the field is empty or not. This may be
  8471. // used to include empty fields in Patch requests.
  8472. ForceSendFields []string `json:"-"`
  8473. // NullFields is a list of field names (e.g. "Code") to include in API
  8474. // requests with the JSON null value. By default, fields with empty
  8475. // values are omitted from API requests. However, any field with an
  8476. // empty value appearing in NullFields will be sent to the server as
  8477. // null. It is an error if a field in this list has a non-empty value.
  8478. // This may be used to include null fields in Patch requests.
  8479. NullFields []string `json:"-"`
  8480. }
  8481. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8482. type NoMethod ForwardingRuleAggregatedListWarning
  8483. raw := NoMethod(*s)
  8484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8485. }
  8486. type ForwardingRuleAggregatedListWarningData struct {
  8487. // Key: [Output Only] A key that provides more detail on the warning
  8488. // being returned. For example, for warnings where there are no results
  8489. // in a list request for a particular zone, this key might be scope and
  8490. // the key value might be the zone name. Other examples might be a key
  8491. // indicating a deprecated resource and a suggested replacement, or a
  8492. // warning about invalid network settings (for example, if an instance
  8493. // attempts to perform IP forwarding but is not enabled for IP
  8494. // forwarding).
  8495. Key string `json:"key,omitempty"`
  8496. // Value: [Output Only] A warning data value corresponding to the key.
  8497. Value string `json:"value,omitempty"`
  8498. // ForceSendFields is a list of field names (e.g. "Key") to
  8499. // unconditionally include in API requests. By default, fields with
  8500. // empty values are omitted from API requests. However, any non-pointer,
  8501. // non-interface field appearing in ForceSendFields will be sent to the
  8502. // server regardless of whether the field is empty or not. This may be
  8503. // used to include empty fields in Patch requests.
  8504. ForceSendFields []string `json:"-"`
  8505. // NullFields is a list of field names (e.g. "Key") to include in API
  8506. // requests with the JSON null value. By default, fields with empty
  8507. // values are omitted from API requests. However, any field with an
  8508. // empty value appearing in NullFields will be sent to the server as
  8509. // null. It is an error if a field in this list has a non-empty value.
  8510. // This may be used to include null fields in Patch requests.
  8511. NullFields []string `json:"-"`
  8512. }
  8513. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8514. type NoMethod ForwardingRuleAggregatedListWarningData
  8515. raw := NoMethod(*s)
  8516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8517. }
  8518. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  8519. type ForwardingRuleList struct {
  8520. // Id: [Output Only] Unique identifier for the resource; defined by the
  8521. // server.
  8522. Id string `json:"id,omitempty"`
  8523. // Items: A list of ForwardingRule resources.
  8524. Items []*ForwardingRule `json:"items,omitempty"`
  8525. // Kind: Type of resource.
  8526. Kind string `json:"kind,omitempty"`
  8527. // NextPageToken: [Output Only] This token allows you to get the next
  8528. // page of results for list requests. If the number of results is larger
  8529. // than maxResults, use the nextPageToken as a value for the query
  8530. // parameter pageToken in the next list request. Subsequent list
  8531. // requests will have their own nextPageToken to continue paging through
  8532. // the results.
  8533. NextPageToken string `json:"nextPageToken,omitempty"`
  8534. // SelfLink: [Output Only] Server-defined URL for this resource.
  8535. SelfLink string `json:"selfLink,omitempty"`
  8536. // Warning: [Output Only] Informational warning message.
  8537. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  8538. // ServerResponse contains the HTTP response code and headers from the
  8539. // server.
  8540. googleapi.ServerResponse `json:"-"`
  8541. // ForceSendFields is a list of field names (e.g. "Id") to
  8542. // unconditionally include in API requests. By default, fields with
  8543. // empty values are omitted from API requests. However, any non-pointer,
  8544. // non-interface field appearing in ForceSendFields will be sent to the
  8545. // server regardless of whether the field is empty or not. This may be
  8546. // used to include empty fields in Patch requests.
  8547. ForceSendFields []string `json:"-"`
  8548. // NullFields is a list of field names (e.g. "Id") to include in API
  8549. // requests with the JSON null value. By default, fields with empty
  8550. // values are omitted from API requests. However, any field with an
  8551. // empty value appearing in NullFields will be sent to the server as
  8552. // null. It is an error if a field in this list has a non-empty value.
  8553. // This may be used to include null fields in Patch requests.
  8554. NullFields []string `json:"-"`
  8555. }
  8556. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  8557. type NoMethod ForwardingRuleList
  8558. raw := NoMethod(*s)
  8559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8560. }
  8561. // ForwardingRuleListWarning: [Output Only] Informational warning
  8562. // message.
  8563. type ForwardingRuleListWarning struct {
  8564. // Code: [Output Only] A warning code, if applicable. For example,
  8565. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8566. // the response.
  8567. //
  8568. // Possible values:
  8569. // "CLEANUP_FAILED"
  8570. // "DEPRECATED_RESOURCE_USED"
  8571. // "DEPRECATED_TYPE_USED"
  8572. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8573. // "EXPERIMENTAL_TYPE_USED"
  8574. // "EXTERNAL_API_WARNING"
  8575. // "FIELD_VALUE_OVERRIDEN"
  8576. // "INJECTED_KERNELS_DEPRECATED"
  8577. // "MISSING_TYPE_DEPENDENCY"
  8578. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8579. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8580. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8581. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8582. // "NEXT_HOP_NOT_RUNNING"
  8583. // "NOT_CRITICAL_ERROR"
  8584. // "NO_RESULTS_ON_PAGE"
  8585. // "REQUIRED_TOS_AGREEMENT"
  8586. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8587. // "RESOURCE_NOT_DELETED"
  8588. // "SCHEMA_VALIDATION_IGNORED"
  8589. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8590. // "UNDECLARED_PROPERTIES"
  8591. // "UNREACHABLE"
  8592. Code string `json:"code,omitempty"`
  8593. // Data: [Output Only] Metadata about this warning in key: value format.
  8594. // For example:
  8595. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8596. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  8597. // Message: [Output Only] A human-readable description of the warning
  8598. // code.
  8599. Message string `json:"message,omitempty"`
  8600. // ForceSendFields is a list of field names (e.g. "Code") to
  8601. // unconditionally include in API requests. By default, fields with
  8602. // empty values are omitted from API requests. However, any non-pointer,
  8603. // non-interface field appearing in ForceSendFields will be sent to the
  8604. // server regardless of whether the field is empty or not. This may be
  8605. // used to include empty fields in Patch requests.
  8606. ForceSendFields []string `json:"-"`
  8607. // NullFields is a list of field names (e.g. "Code") to include in API
  8608. // requests with the JSON null value. By default, fields with empty
  8609. // values are omitted from API requests. However, any field with an
  8610. // empty value appearing in NullFields will be sent to the server as
  8611. // null. It is an error if a field in this list has a non-empty value.
  8612. // This may be used to include null fields in Patch requests.
  8613. NullFields []string `json:"-"`
  8614. }
  8615. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  8616. type NoMethod ForwardingRuleListWarning
  8617. raw := NoMethod(*s)
  8618. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8619. }
  8620. type ForwardingRuleListWarningData struct {
  8621. // Key: [Output Only] A key that provides more detail on the warning
  8622. // being returned. For example, for warnings where there are no results
  8623. // in a list request for a particular zone, this key might be scope and
  8624. // the key value might be the zone name. Other examples might be a key
  8625. // indicating a deprecated resource and a suggested replacement, or a
  8626. // warning about invalid network settings (for example, if an instance
  8627. // attempts to perform IP forwarding but is not enabled for IP
  8628. // forwarding).
  8629. Key string `json:"key,omitempty"`
  8630. // Value: [Output Only] A warning data value corresponding to the key.
  8631. Value string `json:"value,omitempty"`
  8632. // ForceSendFields is a list of field names (e.g. "Key") to
  8633. // unconditionally include in API requests. By default, fields with
  8634. // empty values are omitted from API requests. However, any non-pointer,
  8635. // non-interface field appearing in ForceSendFields will be sent to the
  8636. // server regardless of whether the field is empty or not. This may be
  8637. // used to include empty fields in Patch requests.
  8638. ForceSendFields []string `json:"-"`
  8639. // NullFields is a list of field names (e.g. "Key") to include in API
  8640. // requests with the JSON null value. By default, fields with empty
  8641. // values are omitted from API requests. However, any field with an
  8642. // empty value appearing in NullFields will be sent to the server as
  8643. // null. It is an error if a field in this list has a non-empty value.
  8644. // This may be used to include null fields in Patch requests.
  8645. NullFields []string `json:"-"`
  8646. }
  8647. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  8648. type NoMethod ForwardingRuleListWarningData
  8649. raw := NoMethod(*s)
  8650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8651. }
  8652. type ForwardingRuleReference struct {
  8653. ForwardingRule string `json:"forwardingRule,omitempty"`
  8654. // ForceSendFields is a list of field names (e.g. "ForwardingRule") to
  8655. // unconditionally include in API requests. By default, fields with
  8656. // empty values are omitted from API requests. However, any non-pointer,
  8657. // non-interface field appearing in ForceSendFields will be sent to the
  8658. // server regardless of whether the field is empty or not. This may be
  8659. // used to include empty fields in Patch requests.
  8660. ForceSendFields []string `json:"-"`
  8661. // NullFields is a list of field names (e.g. "ForwardingRule") to
  8662. // include in API requests with the JSON null value. By default, fields
  8663. // with empty values are omitted from API requests. However, any field
  8664. // with an empty value appearing in NullFields will be sent to the
  8665. // server as null. It is an error if a field in this list has a
  8666. // non-empty value. This may be used to include null fields in Patch
  8667. // requests.
  8668. NullFields []string `json:"-"`
  8669. }
  8670. func (s *ForwardingRuleReference) MarshalJSON() ([]byte, error) {
  8671. type NoMethod ForwardingRuleReference
  8672. raw := NoMethod(*s)
  8673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8674. }
  8675. type ForwardingRulesScopedList struct {
  8676. // ForwardingRules: A list of forwarding rules contained in this scope.
  8677. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  8678. // Warning: Informational warning which replaces the list of forwarding
  8679. // rules when the list is empty.
  8680. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  8681. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  8682. // unconditionally include in API requests. By default, fields with
  8683. // empty values are omitted from API requests. However, any non-pointer,
  8684. // non-interface field appearing in ForceSendFields will be sent to the
  8685. // server regardless of whether the field is empty or not. This may be
  8686. // used to include empty fields in Patch requests.
  8687. ForceSendFields []string `json:"-"`
  8688. // NullFields is a list of field names (e.g. "ForwardingRules") to
  8689. // include in API requests with the JSON null value. By default, fields
  8690. // with empty values are omitted from API requests. However, any field
  8691. // with an empty value appearing in NullFields will be sent to the
  8692. // server as null. It is an error if a field in this list has a
  8693. // non-empty value. This may be used to include null fields in Patch
  8694. // requests.
  8695. NullFields []string `json:"-"`
  8696. }
  8697. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  8698. type NoMethod ForwardingRulesScopedList
  8699. raw := NoMethod(*s)
  8700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8701. }
  8702. // ForwardingRulesScopedListWarning: Informational warning which
  8703. // replaces the list of forwarding rules when the list is empty.
  8704. type ForwardingRulesScopedListWarning struct {
  8705. // Code: [Output Only] A warning code, if applicable. For example,
  8706. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8707. // the response.
  8708. //
  8709. // Possible values:
  8710. // "CLEANUP_FAILED"
  8711. // "DEPRECATED_RESOURCE_USED"
  8712. // "DEPRECATED_TYPE_USED"
  8713. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8714. // "EXPERIMENTAL_TYPE_USED"
  8715. // "EXTERNAL_API_WARNING"
  8716. // "FIELD_VALUE_OVERRIDEN"
  8717. // "INJECTED_KERNELS_DEPRECATED"
  8718. // "MISSING_TYPE_DEPENDENCY"
  8719. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8720. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8721. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8722. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8723. // "NEXT_HOP_NOT_RUNNING"
  8724. // "NOT_CRITICAL_ERROR"
  8725. // "NO_RESULTS_ON_PAGE"
  8726. // "REQUIRED_TOS_AGREEMENT"
  8727. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8728. // "RESOURCE_NOT_DELETED"
  8729. // "SCHEMA_VALIDATION_IGNORED"
  8730. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8731. // "UNDECLARED_PROPERTIES"
  8732. // "UNREACHABLE"
  8733. Code string `json:"code,omitempty"`
  8734. // Data: [Output Only] Metadata about this warning in key: value format.
  8735. // For example:
  8736. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8737. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  8738. // Message: [Output Only] A human-readable description of the warning
  8739. // code.
  8740. Message string `json:"message,omitempty"`
  8741. // ForceSendFields is a list of field names (e.g. "Code") to
  8742. // unconditionally include in API requests. By default, fields with
  8743. // empty values are omitted from API requests. However, any non-pointer,
  8744. // non-interface field appearing in ForceSendFields will be sent to the
  8745. // server regardless of whether the field is empty or not. This may be
  8746. // used to include empty fields in Patch requests.
  8747. ForceSendFields []string `json:"-"`
  8748. // NullFields is a list of field names (e.g. "Code") to include in API
  8749. // requests with the JSON null value. By default, fields with empty
  8750. // values are omitted from API requests. However, any field with an
  8751. // empty value appearing in NullFields will be sent to the server as
  8752. // null. It is an error if a field in this list has a non-empty value.
  8753. // This may be used to include null fields in Patch requests.
  8754. NullFields []string `json:"-"`
  8755. }
  8756. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  8757. type NoMethod ForwardingRulesScopedListWarning
  8758. raw := NoMethod(*s)
  8759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8760. }
  8761. type ForwardingRulesScopedListWarningData struct {
  8762. // Key: [Output Only] A key that provides more detail on the warning
  8763. // being returned. For example, for warnings where there are no results
  8764. // in a list request for a particular zone, this key might be scope and
  8765. // the key value might be the zone name. Other examples might be a key
  8766. // indicating a deprecated resource and a suggested replacement, or a
  8767. // warning about invalid network settings (for example, if an instance
  8768. // attempts to perform IP forwarding but is not enabled for IP
  8769. // forwarding).
  8770. Key string `json:"key,omitempty"`
  8771. // Value: [Output Only] A warning data value corresponding to the key.
  8772. Value string `json:"value,omitempty"`
  8773. // ForceSendFields is a list of field names (e.g. "Key") to
  8774. // unconditionally include in API requests. By default, fields with
  8775. // empty values are omitted from API requests. However, any non-pointer,
  8776. // non-interface field appearing in ForceSendFields will be sent to the
  8777. // server regardless of whether the field is empty or not. This may be
  8778. // used to include empty fields in Patch requests.
  8779. ForceSendFields []string `json:"-"`
  8780. // NullFields is a list of field names (e.g. "Key") to include in API
  8781. // requests with the JSON null value. By default, fields with empty
  8782. // values are omitted from API requests. However, any field with an
  8783. // empty value appearing in NullFields will be sent to the server as
  8784. // null. It is an error if a field in this list has a non-empty value.
  8785. // This may be used to include null fields in Patch requests.
  8786. NullFields []string `json:"-"`
  8787. }
  8788. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  8789. type NoMethod ForwardingRulesScopedListWarningData
  8790. raw := NoMethod(*s)
  8791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8792. }
  8793. type GlobalNetworkEndpointGroupsAttachEndpointsRequest struct {
  8794. // NetworkEndpoints: The list of network endpoints to be attached.
  8795. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  8796. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  8797. // unconditionally include in API requests. By default, fields with
  8798. // empty values are omitted from API requests. However, any non-pointer,
  8799. // non-interface field appearing in ForceSendFields will be sent to the
  8800. // server regardless of whether the field is empty or not. This may be
  8801. // used to include empty fields in Patch requests.
  8802. ForceSendFields []string `json:"-"`
  8803. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  8804. // include in API requests with the JSON null value. By default, fields
  8805. // with empty values are omitted from API requests. However, any field
  8806. // with an empty value appearing in NullFields will be sent to the
  8807. // server as null. It is an error if a field in this list has a
  8808. // non-empty value. This may be used to include null fields in Patch
  8809. // requests.
  8810. NullFields []string `json:"-"`
  8811. }
  8812. func (s *GlobalNetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
  8813. type NoMethod GlobalNetworkEndpointGroupsAttachEndpointsRequest
  8814. raw := NoMethod(*s)
  8815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8816. }
  8817. type GlobalNetworkEndpointGroupsDetachEndpointsRequest struct {
  8818. // NetworkEndpoints: The list of network endpoints to be detached.
  8819. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  8820. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  8821. // unconditionally include in API requests. By default, fields with
  8822. // empty values are omitted from API requests. However, any non-pointer,
  8823. // non-interface field appearing in ForceSendFields will be sent to the
  8824. // server regardless of whether the field is empty or not. This may be
  8825. // used to include empty fields in Patch requests.
  8826. ForceSendFields []string `json:"-"`
  8827. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  8828. // include in API requests with the JSON null value. By default, fields
  8829. // with empty values are omitted from API requests. However, any field
  8830. // with an empty value appearing in NullFields will be sent to the
  8831. // server as null. It is an error if a field in this list has a
  8832. // non-empty value. This may be used to include null fields in Patch
  8833. // requests.
  8834. NullFields []string `json:"-"`
  8835. }
  8836. func (s *GlobalNetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
  8837. type NoMethod GlobalNetworkEndpointGroupsDetachEndpointsRequest
  8838. raw := NoMethod(*s)
  8839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8840. }
  8841. type GlobalSetLabelsRequest struct {
  8842. // LabelFingerprint: The fingerprint of the previous set of labels for
  8843. // this resource, used to detect conflicts. The fingerprint is initially
  8844. // generated by Compute Engine and changes after every request to modify
  8845. // or update labels. You must always provide an up-to-date fingerprint
  8846. // hash when updating or changing labels, otherwise the request will
  8847. // fail with error 412 conditionNotMet. Make a get() request to the
  8848. // resource to get the latest fingerprint.
  8849. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8850. // Labels: A list of labels to apply for this resource. Each label key &
  8851. // value must comply with RFC1035. Specifically, the name must be 1-63
  8852. // characters long and match the regular expression
  8853. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  8854. // a lowercase letter, and all following characters must be a dash,
  8855. // lowercase letter, or digit, except the last character, which cannot
  8856. // be a dash. For example, "webserver-frontend": "images". A label value
  8857. // can also be empty (e.g. "my-label": "").
  8858. Labels map[string]string `json:"labels,omitempty"`
  8859. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  8860. // unconditionally include in API requests. By default, fields with
  8861. // empty values are omitted from API requests. However, any non-pointer,
  8862. // non-interface field appearing in ForceSendFields will be sent to the
  8863. // server regardless of whether the field is empty or not. This may be
  8864. // used to include empty fields in Patch requests.
  8865. ForceSendFields []string `json:"-"`
  8866. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  8867. // include in API requests with the JSON null value. By default, fields
  8868. // with empty values are omitted from API requests. However, any field
  8869. // with an empty value appearing in NullFields will be sent to the
  8870. // server as null. It is an error if a field in this list has a
  8871. // non-empty value. This may be used to include null fields in Patch
  8872. // requests.
  8873. NullFields []string `json:"-"`
  8874. }
  8875. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  8876. type NoMethod GlobalSetLabelsRequest
  8877. raw := NoMethod(*s)
  8878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8879. }
  8880. type GlobalSetPolicyRequest struct {
  8881. // Bindings: Flatten Policy to create a backward compatible wire-format.
  8882. // Deprecated. Use 'policy' to specify bindings.
  8883. Bindings []*Binding `json:"bindings,omitempty"`
  8884. // Etag: Flatten Policy to create a backward compatible wire-format.
  8885. // Deprecated. Use 'policy' to specify the etag.
  8886. Etag string `json:"etag,omitempty"`
  8887. // Policy: REQUIRED: The complete policy to be applied to the
  8888. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  8889. // empty policy is in general a valid policy but certain services (like
  8890. // Projects) might reject them.
  8891. Policy *Policy `json:"policy,omitempty"`
  8892. // ForceSendFields is a list of field names (e.g. "Bindings") to
  8893. // unconditionally include in API requests. By default, fields with
  8894. // empty values are omitted from API requests. However, any non-pointer,
  8895. // non-interface field appearing in ForceSendFields will be sent to the
  8896. // server regardless of whether the field is empty or not. This may be
  8897. // used to include empty fields in Patch requests.
  8898. ForceSendFields []string `json:"-"`
  8899. // NullFields is a list of field names (e.g. "Bindings") to include in
  8900. // API requests with the JSON null value. By default, fields with empty
  8901. // values are omitted from API requests. However, any field with an
  8902. // empty value appearing in NullFields will be sent to the server as
  8903. // null. It is an error if a field in this list has a non-empty value.
  8904. // This may be used to include null fields in Patch requests.
  8905. NullFields []string `json:"-"`
  8906. }
  8907. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  8908. type NoMethod GlobalSetPolicyRequest
  8909. raw := NoMethod(*s)
  8910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8911. }
  8912. // GrpcServiceConfig: gRPC config to access the SDS server.
  8913. type GrpcServiceConfig struct {
  8914. // CallCredentials: The call credentials to access the SDS server.
  8915. CallCredentials *CallCredentials `json:"callCredentials,omitempty"`
  8916. // ChannelCredentials: The channel credentials to access the SDS server.
  8917. ChannelCredentials *ChannelCredentials `json:"channelCredentials,omitempty"`
  8918. // TargetUri: The target URI of the SDS server.
  8919. TargetUri string `json:"targetUri,omitempty"`
  8920. // ForceSendFields is a list of field names (e.g. "CallCredentials") to
  8921. // unconditionally include in API requests. By default, fields with
  8922. // empty values are omitted from API requests. However, any non-pointer,
  8923. // non-interface field appearing in ForceSendFields will be sent to the
  8924. // server regardless of whether the field is empty or not. This may be
  8925. // used to include empty fields in Patch requests.
  8926. ForceSendFields []string `json:"-"`
  8927. // NullFields is a list of field names (e.g. "CallCredentials") to
  8928. // include in API requests with the JSON null value. By default, fields
  8929. // with empty values are omitted from API requests. However, any field
  8930. // with an empty value appearing in NullFields will be sent to the
  8931. // server as null. It is an error if a field in this list has a
  8932. // non-empty value. This may be used to include null fields in Patch
  8933. // requests.
  8934. NullFields []string `json:"-"`
  8935. }
  8936. func (s *GrpcServiceConfig) MarshalJSON() ([]byte, error) {
  8937. type NoMethod GrpcServiceConfig
  8938. raw := NoMethod(*s)
  8939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8940. }
  8941. // GuestAttributes: A guest attributes entry.
  8942. type GuestAttributes struct {
  8943. // Kind: [Output Only] Type of the resource. Always
  8944. // compute#guestAttributes for guest attributes entry.
  8945. Kind string `json:"kind,omitempty"`
  8946. // QueryPath: The path to be queried. This can be the default namespace
  8947. // ('/') or a nested namespace ('//') or a specified key ('//')
  8948. QueryPath string `json:"queryPath,omitempty"`
  8949. // QueryValue: [Output Only] The value of the requested queried path.
  8950. QueryValue *GuestAttributesValue `json:"queryValue,omitempty"`
  8951. // SelfLink: [Output Only] Server-defined URL for this resource.
  8952. SelfLink string `json:"selfLink,omitempty"`
  8953. // VariableKey: The key to search for.
  8954. VariableKey string `json:"variableKey,omitempty"`
  8955. // VariableValue: [Output Only] The value found for the requested key.
  8956. VariableValue string `json:"variableValue,omitempty"`
  8957. // ServerResponse contains the HTTP response code and headers from the
  8958. // server.
  8959. googleapi.ServerResponse `json:"-"`
  8960. // ForceSendFields is a list of field names (e.g. "Kind") to
  8961. // unconditionally include in API requests. By default, fields with
  8962. // empty values are omitted from API requests. However, any non-pointer,
  8963. // non-interface field appearing in ForceSendFields will be sent to the
  8964. // server regardless of whether the field is empty or not. This may be
  8965. // used to include empty fields in Patch requests.
  8966. ForceSendFields []string `json:"-"`
  8967. // NullFields is a list of field names (e.g. "Kind") to include in API
  8968. // requests with the JSON null value. By default, fields with empty
  8969. // values are omitted from API requests. However, any field with an
  8970. // empty value appearing in NullFields will be sent to the server as
  8971. // null. It is an error if a field in this list has a non-empty value.
  8972. // This may be used to include null fields in Patch requests.
  8973. NullFields []string `json:"-"`
  8974. }
  8975. func (s *GuestAttributes) MarshalJSON() ([]byte, error) {
  8976. type NoMethod GuestAttributes
  8977. raw := NoMethod(*s)
  8978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8979. }
  8980. // GuestAttributesEntry: A guest attributes namespace/key/value entry.
  8981. type GuestAttributesEntry struct {
  8982. // Key: Key for the guest attribute entry.
  8983. Key string `json:"key,omitempty"`
  8984. // Namespace: Namespace for the guest attribute entry.
  8985. Namespace string `json:"namespace,omitempty"`
  8986. // Value: Value for the guest attribute entry.
  8987. Value string `json:"value,omitempty"`
  8988. // ForceSendFields is a list of field names (e.g. "Key") to
  8989. // unconditionally include in API requests. By default, fields with
  8990. // empty values are omitted from API requests. However, any non-pointer,
  8991. // non-interface field appearing in ForceSendFields will be sent to the
  8992. // server regardless of whether the field is empty or not. This may be
  8993. // used to include empty fields in Patch requests.
  8994. ForceSendFields []string `json:"-"`
  8995. // NullFields is a list of field names (e.g. "Key") to include in API
  8996. // requests with the JSON null value. By default, fields with empty
  8997. // values are omitted from API requests. However, any field with an
  8998. // empty value appearing in NullFields will be sent to the server as
  8999. // null. It is an error if a field in this list has a non-empty value.
  9000. // This may be used to include null fields in Patch requests.
  9001. NullFields []string `json:"-"`
  9002. }
  9003. func (s *GuestAttributesEntry) MarshalJSON() ([]byte, error) {
  9004. type NoMethod GuestAttributesEntry
  9005. raw := NoMethod(*s)
  9006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9007. }
  9008. // GuestAttributesValue: Array of guest attribute namespace/key/value
  9009. // tuples.
  9010. type GuestAttributesValue struct {
  9011. Items []*GuestAttributesEntry `json:"items,omitempty"`
  9012. // ForceSendFields is a list of field names (e.g. "Items") to
  9013. // unconditionally include in API requests. By default, fields with
  9014. // empty values are omitted from API requests. However, any non-pointer,
  9015. // non-interface field appearing in ForceSendFields will be sent to the
  9016. // server regardless of whether the field is empty or not. This may be
  9017. // used to include empty fields in Patch requests.
  9018. ForceSendFields []string `json:"-"`
  9019. // NullFields is a list of field names (e.g. "Items") to include in API
  9020. // requests with the JSON null value. By default, fields with empty
  9021. // values are omitted from API requests. However, any field with an
  9022. // empty value appearing in NullFields will be sent to the server as
  9023. // null. It is an error if a field in this list has a non-empty value.
  9024. // This may be used to include null fields in Patch requests.
  9025. NullFields []string `json:"-"`
  9026. }
  9027. func (s *GuestAttributesValue) MarshalJSON() ([]byte, error) {
  9028. type NoMethod GuestAttributesValue
  9029. raw := NoMethod(*s)
  9030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9031. }
  9032. // GuestOsFeature: Guest OS features.
  9033. type GuestOsFeature struct {
  9034. // Type: The ID of a supported feature. Read Enabling guest operating
  9035. // system features to see a list of available options.
  9036. //
  9037. // Possible values:
  9038. // "FEATURE_TYPE_UNSPECIFIED"
  9039. // "GVNIC"
  9040. // "MULTI_IP_SUBNET"
  9041. // "SECURE_BOOT"
  9042. // "UEFI_COMPATIBLE"
  9043. // "VIRTIO_SCSI_MULTIQUEUE"
  9044. // "WINDOWS"
  9045. Type string `json:"type,omitempty"`
  9046. // ForceSendFields is a list of field names (e.g. "Type") to
  9047. // unconditionally include in API requests. By default, fields with
  9048. // empty values are omitted from API requests. However, any non-pointer,
  9049. // non-interface field appearing in ForceSendFields will be sent to the
  9050. // server regardless of whether the field is empty or not. This may be
  9051. // used to include empty fields in Patch requests.
  9052. ForceSendFields []string `json:"-"`
  9053. // NullFields is a list of field names (e.g. "Type") to include in API
  9054. // requests with the JSON null value. By default, fields with empty
  9055. // values are omitted from API requests. However, any field with an
  9056. // empty value appearing in NullFields will be sent to the server as
  9057. // null. It is an error if a field in this list has a non-empty value.
  9058. // This may be used to include null fields in Patch requests.
  9059. NullFields []string `json:"-"`
  9060. }
  9061. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  9062. type NoMethod GuestOsFeature
  9063. raw := NoMethod(*s)
  9064. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9065. }
  9066. type HTTP2HealthCheck struct {
  9067. // Host: The value of the host header in the HTTP/2 health check
  9068. // request. If left empty (default value), the IP on behalf of which
  9069. // this health check is performed will be used.
  9070. Host string `json:"host,omitempty"`
  9071. // Port: The TCP port number for the health check request. The default
  9072. // value is 443. Valid values are 1 through 65535.
  9073. Port int64 `json:"port,omitempty"`
  9074. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  9075. // both port and port_name are defined, port takes precedence.
  9076. PortName string `json:"portName,omitempty"`
  9077. // PortSpecification: Specifies how port is selected for health
  9078. // checking, can be one of following values:
  9079. // USE_FIXED_PORT: The port number in
  9080. // port
  9081. // is used for health checking.
  9082. // USE_NAMED_PORT: The
  9083. // portName
  9084. // is used for health checking.
  9085. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  9086. // each network endpoint is used for health checking. For other
  9087. // backends, the port or named port specified in the Backend Service is
  9088. // used for health checking.
  9089. //
  9090. //
  9091. // If not specified, HTTP2 health check follows behavior specified
  9092. // in
  9093. // port
  9094. // and
  9095. // portName
  9096. // fields.
  9097. //
  9098. // Possible values:
  9099. // "USE_FIXED_PORT"
  9100. // "USE_NAMED_PORT"
  9101. // "USE_SERVING_PORT"
  9102. PortSpecification string `json:"portSpecification,omitempty"`
  9103. // ProxyHeader: Specifies the type of proxy header to append before
  9104. // sending data to the backend, either NONE or PROXY_V1. The default is
  9105. // NONE.
  9106. //
  9107. // Possible values:
  9108. // "NONE"
  9109. // "PROXY_V1"
  9110. ProxyHeader string `json:"proxyHeader,omitempty"`
  9111. // RequestPath: The request path of the HTTP/2 health check request. The
  9112. // default value is /.
  9113. RequestPath string `json:"requestPath,omitempty"`
  9114. // Response: The string to match anywhere in the first 1024 bytes of the
  9115. // response body. If left empty (the default value), the status code
  9116. // determines health. The response data can only be ASCII.
  9117. Response string `json:"response,omitempty"`
  9118. // ForceSendFields is a list of field names (e.g. "Host") to
  9119. // unconditionally include in API requests. By default, fields with
  9120. // empty values are omitted from API requests. However, any non-pointer,
  9121. // non-interface field appearing in ForceSendFields will be sent to the
  9122. // server regardless of whether the field is empty or not. This may be
  9123. // used to include empty fields in Patch requests.
  9124. ForceSendFields []string `json:"-"`
  9125. // NullFields is a list of field names (e.g. "Host") to include in API
  9126. // requests with the JSON null value. By default, fields with empty
  9127. // values are omitted from API requests. However, any field with an
  9128. // empty value appearing in NullFields will be sent to the server as
  9129. // null. It is an error if a field in this list has a non-empty value.
  9130. // This may be used to include null fields in Patch requests.
  9131. NullFields []string `json:"-"`
  9132. }
  9133. func (s *HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
  9134. type NoMethod HTTP2HealthCheck
  9135. raw := NoMethod(*s)
  9136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9137. }
  9138. type HTTPHealthCheck struct {
  9139. // Host: The value of the host header in the HTTP health check request.
  9140. // If left empty (default value), the IP on behalf of which this health
  9141. // check is performed will be used.
  9142. Host string `json:"host,omitempty"`
  9143. // Port: The TCP port number for the health check request. The default
  9144. // value is 80. Valid values are 1 through 65535.
  9145. Port int64 `json:"port,omitempty"`
  9146. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  9147. // both port and port_name are defined, port takes precedence.
  9148. PortName string `json:"portName,omitempty"`
  9149. // PortSpecification: Specifies how port is selected for health
  9150. // checking, can be one of following values:
  9151. // USE_FIXED_PORT: The port number in
  9152. // port
  9153. // is used for health checking.
  9154. // USE_NAMED_PORT: The
  9155. // portName
  9156. // is used for health checking.
  9157. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  9158. // each network endpoint is used for health checking. For other
  9159. // backends, the port or named port specified in the Backend Service is
  9160. // used for health checking.
  9161. //
  9162. //
  9163. // If not specified, HTTP health check follows behavior specified
  9164. // in
  9165. // port
  9166. // and
  9167. // portName
  9168. // fields.
  9169. //
  9170. // Possible values:
  9171. // "USE_FIXED_PORT"
  9172. // "USE_NAMED_PORT"
  9173. // "USE_SERVING_PORT"
  9174. PortSpecification string `json:"portSpecification,omitempty"`
  9175. // ProxyHeader: Specifies the type of proxy header to append before
  9176. // sending data to the backend, either NONE or PROXY_V1. The default is
  9177. // NONE.
  9178. //
  9179. // Possible values:
  9180. // "NONE"
  9181. // "PROXY_V1"
  9182. ProxyHeader string `json:"proxyHeader,omitempty"`
  9183. // RequestPath: The request path of the HTTP health check request. The
  9184. // default value is /.
  9185. RequestPath string `json:"requestPath,omitempty"`
  9186. // Response: The string to match anywhere in the first 1024 bytes of the
  9187. // response body. If left empty (the default value), the status code
  9188. // determines health. The response data can only be ASCII.
  9189. Response string `json:"response,omitempty"`
  9190. // ForceSendFields is a list of field names (e.g. "Host") to
  9191. // unconditionally include in API requests. By default, fields with
  9192. // empty values are omitted from API requests. However, any non-pointer,
  9193. // non-interface field appearing in ForceSendFields will be sent to the
  9194. // server regardless of whether the field is empty or not. This may be
  9195. // used to include empty fields in Patch requests.
  9196. ForceSendFields []string `json:"-"`
  9197. // NullFields is a list of field names (e.g. "Host") to include in API
  9198. // requests with the JSON null value. By default, fields with empty
  9199. // values are omitted from API requests. However, any field with an
  9200. // empty value appearing in NullFields will be sent to the server as
  9201. // null. It is an error if a field in this list has a non-empty value.
  9202. // This may be used to include null fields in Patch requests.
  9203. NullFields []string `json:"-"`
  9204. }
  9205. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  9206. type NoMethod HTTPHealthCheck
  9207. raw := NoMethod(*s)
  9208. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9209. }
  9210. type HTTPSHealthCheck struct {
  9211. // Host: The value of the host header in the HTTPS health check request.
  9212. // If left empty (default value), the IP on behalf of which this health
  9213. // check is performed will be used.
  9214. Host string `json:"host,omitempty"`
  9215. // Port: The TCP port number for the health check request. The default
  9216. // value is 443. Valid values are 1 through 65535.
  9217. Port int64 `json:"port,omitempty"`
  9218. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  9219. // both port and port_name are defined, port takes precedence.
  9220. PortName string `json:"portName,omitempty"`
  9221. // PortSpecification: Specifies how port is selected for health
  9222. // checking, can be one of following values:
  9223. // USE_FIXED_PORT: The port number in
  9224. // port
  9225. // is used for health checking.
  9226. // USE_NAMED_PORT: The
  9227. // portName
  9228. // is used for health checking.
  9229. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  9230. // each network endpoint is used for health checking. For other
  9231. // backends, the port or named port specified in the Backend Service is
  9232. // used for health checking.
  9233. //
  9234. //
  9235. // If not specified, HTTPS health check follows behavior specified
  9236. // in
  9237. // port
  9238. // and
  9239. // portName
  9240. // fields.
  9241. //
  9242. // Possible values:
  9243. // "USE_FIXED_PORT"
  9244. // "USE_NAMED_PORT"
  9245. // "USE_SERVING_PORT"
  9246. PortSpecification string `json:"portSpecification,omitempty"`
  9247. // ProxyHeader: Specifies the type of proxy header to append before
  9248. // sending data to the backend, either NONE or PROXY_V1. The default is
  9249. // NONE.
  9250. //
  9251. // Possible values:
  9252. // "NONE"
  9253. // "PROXY_V1"
  9254. ProxyHeader string `json:"proxyHeader,omitempty"`
  9255. // RequestPath: The request path of the HTTPS health check request. The
  9256. // default value is /.
  9257. RequestPath string `json:"requestPath,omitempty"`
  9258. // Response: The string to match anywhere in the first 1024 bytes of the
  9259. // response body. If left empty (the default value), the status code
  9260. // determines health. The response data can only be ASCII.
  9261. Response string `json:"response,omitempty"`
  9262. // ForceSendFields is a list of field names (e.g. "Host") to
  9263. // unconditionally include in API requests. By default, fields with
  9264. // empty values are omitted from API requests. However, any non-pointer,
  9265. // non-interface field appearing in ForceSendFields will be sent to the
  9266. // server regardless of whether the field is empty or not. This may be
  9267. // used to include empty fields in Patch requests.
  9268. ForceSendFields []string `json:"-"`
  9269. // NullFields is a list of field names (e.g. "Host") to include in API
  9270. // requests with the JSON null value. By default, fields with empty
  9271. // values are omitted from API requests. However, any field with an
  9272. // empty value appearing in NullFields will be sent to the server as
  9273. // null. It is an error if a field in this list has a non-empty value.
  9274. // This may be used to include null fields in Patch requests.
  9275. NullFields []string `json:"-"`
  9276. }
  9277. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  9278. type NoMethod HTTPSHealthCheck
  9279. raw := NoMethod(*s)
  9280. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9281. }
  9282. // HealthCheck: An HealthCheck resource. This resource defines a
  9283. // template for how individual virtual machines should be checked for
  9284. // health, via one of the supported protocols.
  9285. type HealthCheck struct {
  9286. // CheckIntervalSec: How often (in seconds) to send a health check. The
  9287. // default value is 5 seconds.
  9288. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  9289. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  9290. // format.
  9291. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9292. // Description: An optional description of this resource. Provide this
  9293. // property when you create the resource.
  9294. Description string `json:"description,omitempty"`
  9295. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  9296. // after this many consecutive successes. The default value is 2.
  9297. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  9298. Http2HealthCheck *HTTP2HealthCheck `json:"http2HealthCheck,omitempty"`
  9299. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  9300. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  9301. // Id: [Output Only] The unique identifier for the resource. This
  9302. // identifier is defined by the server.
  9303. Id uint64 `json:"id,omitempty,string"`
  9304. // Kind: Type of the resource.
  9305. Kind string `json:"kind,omitempty"`
  9306. // Name: Name of the resource. Provided by the client when the resource
  9307. // is created. The name must be 1-63 characters long, and comply with
  9308. // RFC1035. Specifically, the name must be 1-63 characters long and
  9309. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9310. // the first character must be a lowercase letter, and all following
  9311. // characters must be a dash, lowercase letter, or digit, except the
  9312. // last character, which cannot be a dash.
  9313. Name string `json:"name,omitempty"`
  9314. // Region: [Output Only] Region where the health check resides. Not
  9315. // applicable to global health checks.
  9316. Region string `json:"region,omitempty"`
  9317. // SelfLink: [Output Only] Server-defined URL for the resource.
  9318. SelfLink string `json:"selfLink,omitempty"`
  9319. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  9320. // with the resource id.
  9321. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  9322. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  9323. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  9324. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  9325. // The default value is 5 seconds. It is invalid for timeoutSec to have
  9326. // greater value than checkIntervalSec.
  9327. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  9328. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP,
  9329. // HTTPS or HTTP2. If not specified, the default is TCP. Exactly one of
  9330. // the protocol-specific health check field must be specified, which
  9331. // must match type field.
  9332. //
  9333. // Possible values:
  9334. // "HTTP"
  9335. // "HTTP2"
  9336. // "HTTPS"
  9337. // "INVALID"
  9338. // "SSL"
  9339. // "TCP"
  9340. // "UDP"
  9341. Type string `json:"type,omitempty"`
  9342. UdpHealthCheck *UDPHealthCheck `json:"udpHealthCheck,omitempty"`
  9343. // UnhealthyThreshold: A so-far healthy instance will be marked
  9344. // unhealthy after this many consecutive failures. The default value is
  9345. // 2.
  9346. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  9347. // ServerResponse contains the HTTP response code and headers from the
  9348. // server.
  9349. googleapi.ServerResponse `json:"-"`
  9350. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  9351. // unconditionally include in API requests. By default, fields with
  9352. // empty values are omitted from API requests. However, any non-pointer,
  9353. // non-interface field appearing in ForceSendFields will be sent to the
  9354. // server regardless of whether the field is empty or not. This may be
  9355. // used to include empty fields in Patch requests.
  9356. ForceSendFields []string `json:"-"`
  9357. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  9358. // include in API requests with the JSON null value. By default, fields
  9359. // with empty values are omitted from API requests. However, any field
  9360. // with an empty value appearing in NullFields will be sent to the
  9361. // server as null. It is an error if a field in this list has a
  9362. // non-empty value. This may be used to include null fields in Patch
  9363. // requests.
  9364. NullFields []string `json:"-"`
  9365. }
  9366. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  9367. type NoMethod HealthCheck
  9368. raw := NoMethod(*s)
  9369. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9370. }
  9371. // HealthCheckList: Contains a list of HealthCheck resources.
  9372. type HealthCheckList struct {
  9373. // Id: [Output Only] Unique identifier for the resource; defined by the
  9374. // server.
  9375. Id string `json:"id,omitempty"`
  9376. // Items: A list of HealthCheck resources.
  9377. Items []*HealthCheck `json:"items,omitempty"`
  9378. // Kind: Type of resource.
  9379. Kind string `json:"kind,omitempty"`
  9380. // NextPageToken: [Output Only] This token allows you to get the next
  9381. // page of results for list requests. If the number of results is larger
  9382. // than maxResults, use the nextPageToken as a value for the query
  9383. // parameter pageToken in the next list request. Subsequent list
  9384. // requests will have their own nextPageToken to continue paging through
  9385. // the results.
  9386. NextPageToken string `json:"nextPageToken,omitempty"`
  9387. // SelfLink: [Output Only] Server-defined URL for this resource.
  9388. SelfLink string `json:"selfLink,omitempty"`
  9389. // Warning: [Output Only] Informational warning message.
  9390. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  9391. // ServerResponse contains the HTTP response code and headers from the
  9392. // server.
  9393. googleapi.ServerResponse `json:"-"`
  9394. // ForceSendFields is a list of field names (e.g. "Id") to
  9395. // unconditionally include in API requests. By default, fields with
  9396. // empty values are omitted from API requests. However, any non-pointer,
  9397. // non-interface field appearing in ForceSendFields will be sent to the
  9398. // server regardless of whether the field is empty or not. This may be
  9399. // used to include empty fields in Patch requests.
  9400. ForceSendFields []string `json:"-"`
  9401. // NullFields is a list of field names (e.g. "Id") to include in API
  9402. // requests with the JSON null value. By default, fields with empty
  9403. // values are omitted from API requests. However, any field with an
  9404. // empty value appearing in NullFields will be sent to the server as
  9405. // null. It is an error if a field in this list has a non-empty value.
  9406. // This may be used to include null fields in Patch requests.
  9407. NullFields []string `json:"-"`
  9408. }
  9409. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  9410. type NoMethod HealthCheckList
  9411. raw := NoMethod(*s)
  9412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9413. }
  9414. // HealthCheckListWarning: [Output Only] Informational warning message.
  9415. type HealthCheckListWarning struct {
  9416. // Code: [Output Only] A warning code, if applicable. For example,
  9417. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9418. // the response.
  9419. //
  9420. // Possible values:
  9421. // "CLEANUP_FAILED"
  9422. // "DEPRECATED_RESOURCE_USED"
  9423. // "DEPRECATED_TYPE_USED"
  9424. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9425. // "EXPERIMENTAL_TYPE_USED"
  9426. // "EXTERNAL_API_WARNING"
  9427. // "FIELD_VALUE_OVERRIDEN"
  9428. // "INJECTED_KERNELS_DEPRECATED"
  9429. // "MISSING_TYPE_DEPENDENCY"
  9430. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9431. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9432. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9433. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9434. // "NEXT_HOP_NOT_RUNNING"
  9435. // "NOT_CRITICAL_ERROR"
  9436. // "NO_RESULTS_ON_PAGE"
  9437. // "REQUIRED_TOS_AGREEMENT"
  9438. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9439. // "RESOURCE_NOT_DELETED"
  9440. // "SCHEMA_VALIDATION_IGNORED"
  9441. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9442. // "UNDECLARED_PROPERTIES"
  9443. // "UNREACHABLE"
  9444. Code string `json:"code,omitempty"`
  9445. // Data: [Output Only] Metadata about this warning in key: value format.
  9446. // For example:
  9447. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9448. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  9449. // Message: [Output Only] A human-readable description of the warning
  9450. // code.
  9451. Message string `json:"message,omitempty"`
  9452. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  9468. type NoMethod HealthCheckListWarning
  9469. raw := NoMethod(*s)
  9470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9471. }
  9472. type HealthCheckListWarningData struct {
  9473. // Key: [Output Only] A key that provides more detail on the warning
  9474. // being returned. For example, for warnings where there are no results
  9475. // in a list request for a particular zone, this key might be scope and
  9476. // the key value might be the zone name. Other examples might be a key
  9477. // indicating a deprecated resource and a suggested replacement, or a
  9478. // warning about invalid network settings (for example, if an instance
  9479. // attempts to perform IP forwarding but is not enabled for IP
  9480. // forwarding).
  9481. Key string `json:"key,omitempty"`
  9482. // Value: [Output Only] A warning data value corresponding to the key.
  9483. Value string `json:"value,omitempty"`
  9484. // ForceSendFields is a list of field names (e.g. "Key") to
  9485. // unconditionally include in API requests. By default, fields with
  9486. // empty values are omitted from API requests. However, any non-pointer,
  9487. // non-interface field appearing in ForceSendFields will be sent to the
  9488. // server regardless of whether the field is empty or not. This may be
  9489. // used to include empty fields in Patch requests.
  9490. ForceSendFields []string `json:"-"`
  9491. // NullFields is a list of field names (e.g. "Key") to include in API
  9492. // requests with the JSON null value. By default, fields with empty
  9493. // values are omitted from API requests. However, any field with an
  9494. // empty value appearing in NullFields will be sent to the server as
  9495. // null. It is an error if a field in this list has a non-empty value.
  9496. // This may be used to include null fields in Patch requests.
  9497. NullFields []string `json:"-"`
  9498. }
  9499. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  9500. type NoMethod HealthCheckListWarningData
  9501. raw := NoMethod(*s)
  9502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9503. }
  9504. // HealthCheckReference: A full or valid partial URL to a health check.
  9505. // For example, the following are valid URLs:
  9506. // -
  9507. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  9508. // - projects/project-id/global/httpHealthChecks/health-check
  9509. // - global/httpHealthChecks/health-check
  9510. type HealthCheckReference struct {
  9511. HealthCheck string `json:"healthCheck,omitempty"`
  9512. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  9513. // unconditionally include in API requests. By default, fields with
  9514. // empty values are omitted from API requests. However, any non-pointer,
  9515. // non-interface field appearing in ForceSendFields will be sent to the
  9516. // server regardless of whether the field is empty or not. This may be
  9517. // used to include empty fields in Patch requests.
  9518. ForceSendFields []string `json:"-"`
  9519. // NullFields is a list of field names (e.g. "HealthCheck") to include
  9520. // in API requests with the JSON null value. By default, fields with
  9521. // empty values are omitted from API requests. However, any field with
  9522. // an empty value appearing in NullFields will be sent to the server as
  9523. // null. It is an error if a field in this list has a non-empty value.
  9524. // This may be used to include null fields in Patch requests.
  9525. NullFields []string `json:"-"`
  9526. }
  9527. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  9528. type NoMethod HealthCheckReference
  9529. raw := NoMethod(*s)
  9530. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9531. }
  9532. // HealthCheckService: A HealthCheckService defines a set of backends on
  9533. // which to perform periodic health checks and an endpoint to which to
  9534. // send notification of changes in the health status of the backends.
  9535. type HealthCheckService struct {
  9536. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9537. // format.
  9538. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9539. // Description: An optional description of this resource. Provide this
  9540. // property when you create the resource.
  9541. Description string `json:"description,omitempty"`
  9542. // HealthChecks: List of URLs to the HealthCheck resources. Must have at
  9543. // least one HealthCheck, and not more than 10. HealthCheck resources
  9544. // must have portSpecification=USE_SERVING_PORT. For regional
  9545. // HealthCheckService, the HealthCheck must be regional and in the same
  9546. // region. For global HealthCheckService, HealthCheck must be global.
  9547. // Mix of regional and global HealthChecks is not supported. Multiple
  9548. // regional HealthChecks must belong to the same region. Regional
  9549. // HealthChecks</code? must belong to the same region as zones of NEGs.
  9550. HealthChecks []string `json:"healthChecks,omitempty"`
  9551. // HealthStatusAggregationStrategy: Policy for how the results from
  9552. // multiple health checks for the same endpoint are aggregated.
  9553. // - NO_AGGREGATION. An EndpointHealth message is returned for each
  9554. // backend in the health check service.
  9555. // - AND. If any backend's health check reports UNHEALTHY, then
  9556. // UNHEALTHY is the HealthState of the entire health check service. If
  9557. // all backend's are healthy, the HealthState of the health check
  9558. // service is HEALTHY. .
  9559. //
  9560. // Possible values:
  9561. // "AND"
  9562. // "NO_AGGREGATION"
  9563. HealthStatusAggregationStrategy string `json:"healthStatusAggregationStrategy,omitempty"`
  9564. // Id: [Output Only] The unique identifier for the resource. This
  9565. // identifier is defined by the server.
  9566. Id uint64 `json:"id,omitempty,string"`
  9567. // Kind: [Output only] Type of the resource. Always
  9568. // compute#healthCheckServicefor health check services.
  9569. Kind string `json:"kind,omitempty"`
  9570. // Name: Name of the resource. The name must be 1-63 characters long,
  9571. // and comply with RFC1035. Specifically, the name must be 1-63
  9572. // characters long and match the regular expression
  9573. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  9574. // a lowercase letter, and all following characters must be a dash,
  9575. // lowercase letter, or digit, except the last character, which cannot
  9576. // be a dash.
  9577. Name string `json:"name,omitempty"`
  9578. // NetworkEndpointGroups: List of URLs to the NetworkEndpointGroup
  9579. // resources. Must not have more than 100. For regional
  9580. // HealthCheckService, NEGs must be in zones in the region of the
  9581. // HealthCheckService.
  9582. NetworkEndpointGroups []string `json:"networkEndpointGroups,omitempty"`
  9583. // NotificationEndpoints: List of URLs to the NotificationEndpoint
  9584. // resources. Must not have more than 10. A list of endpoints for
  9585. // receiving notifications of change in health status. For regional
  9586. // HealthCheckService, NotificationEndpoint must be regional and in the
  9587. // same region. For global HealthCheckService, NotificationEndpoint must
  9588. // be global.
  9589. NotificationEndpoints []string `json:"notificationEndpoints,omitempty"`
  9590. // Region: [Output Only] URL of the region where the health check
  9591. // service resides. This field is not applicable to global health check
  9592. // services. You must specify this field as part of the HTTP request
  9593. // URL. It is not settable as a field in the request body.
  9594. Region string `json:"region,omitempty"`
  9595. // SelfLink: [Output Only] Server-defined URL for the resource.
  9596. SelfLink string `json:"selfLink,omitempty"`
  9597. // SelfLinkWithId: [Output Only] Server-defined URL with id for the
  9598. // resource.
  9599. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  9600. // ServerResponse contains the HTTP response code and headers from the
  9601. // server.
  9602. googleapi.ServerResponse `json:"-"`
  9603. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  9604. // to unconditionally include in API requests. By default, fields with
  9605. // empty values are omitted from API requests. However, any non-pointer,
  9606. // non-interface field appearing in ForceSendFields will be sent to the
  9607. // server regardless of whether the field is empty or not. This may be
  9608. // used to include empty fields in Patch requests.
  9609. ForceSendFields []string `json:"-"`
  9610. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  9611. // include in API requests with the JSON null value. By default, fields
  9612. // with empty values are omitted from API requests. However, any field
  9613. // with an empty value appearing in NullFields will be sent to the
  9614. // server as null. It is an error if a field in this list has a
  9615. // non-empty value. This may be used to include null fields in Patch
  9616. // requests.
  9617. NullFields []string `json:"-"`
  9618. }
  9619. func (s *HealthCheckService) MarshalJSON() ([]byte, error) {
  9620. type NoMethod HealthCheckService
  9621. raw := NoMethod(*s)
  9622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9623. }
  9624. type HealthCheckServicesList struct {
  9625. // Id: [Output Only] Unique identifier for the resource; defined by the
  9626. // server.
  9627. Id string `json:"id,omitempty"`
  9628. // Items: A list of HealthCheckService resources.
  9629. Items []*HealthCheckService `json:"items,omitempty"`
  9630. // Kind: [Output Only] Type of the resource. Always
  9631. // compute#healthCheckServicesList for lists of HealthCheckServices.
  9632. Kind string `json:"kind,omitempty"`
  9633. // NextPageToken: [Output Only] This token allows you to get the next
  9634. // page of results for list requests. If the number of results is larger
  9635. // than maxResults, use the nextPageToken as a value for the query
  9636. // parameter pageToken in the next list request. Subsequent list
  9637. // requests will have their own nextPageToken to continue paging through
  9638. // the results.
  9639. NextPageToken string `json:"nextPageToken,omitempty"`
  9640. // SelfLink: [Output Only] Server-defined URL for this resource.
  9641. SelfLink string `json:"selfLink,omitempty"`
  9642. // Warning: [Output Only] Informational warning message.
  9643. Warning *HealthCheckServicesListWarning `json:"warning,omitempty"`
  9644. // ServerResponse contains the HTTP response code and headers from the
  9645. // server.
  9646. googleapi.ServerResponse `json:"-"`
  9647. // ForceSendFields is a list of field names (e.g. "Id") to
  9648. // unconditionally include in API requests. By default, fields with
  9649. // empty values are omitted from API requests. However, any non-pointer,
  9650. // non-interface field appearing in ForceSendFields will be sent to the
  9651. // server regardless of whether the field is empty or not. This may be
  9652. // used to include empty fields in Patch requests.
  9653. ForceSendFields []string `json:"-"`
  9654. // NullFields is a list of field names (e.g. "Id") to include in API
  9655. // requests with the JSON null value. By default, fields with empty
  9656. // values are omitted from API requests. However, any field with an
  9657. // empty value appearing in NullFields will be sent to the server as
  9658. // null. It is an error if a field in this list has a non-empty value.
  9659. // This may be used to include null fields in Patch requests.
  9660. NullFields []string `json:"-"`
  9661. }
  9662. func (s *HealthCheckServicesList) MarshalJSON() ([]byte, error) {
  9663. type NoMethod HealthCheckServicesList
  9664. raw := NoMethod(*s)
  9665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9666. }
  9667. // HealthCheckServicesListWarning: [Output Only] Informational warning
  9668. // message.
  9669. type HealthCheckServicesListWarning struct {
  9670. // Code: [Output Only] A warning code, if applicable. For example,
  9671. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9672. // the response.
  9673. //
  9674. // Possible values:
  9675. // "CLEANUP_FAILED"
  9676. // "DEPRECATED_RESOURCE_USED"
  9677. // "DEPRECATED_TYPE_USED"
  9678. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9679. // "EXPERIMENTAL_TYPE_USED"
  9680. // "EXTERNAL_API_WARNING"
  9681. // "FIELD_VALUE_OVERRIDEN"
  9682. // "INJECTED_KERNELS_DEPRECATED"
  9683. // "MISSING_TYPE_DEPENDENCY"
  9684. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9685. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9686. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9687. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9688. // "NEXT_HOP_NOT_RUNNING"
  9689. // "NOT_CRITICAL_ERROR"
  9690. // "NO_RESULTS_ON_PAGE"
  9691. // "REQUIRED_TOS_AGREEMENT"
  9692. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9693. // "RESOURCE_NOT_DELETED"
  9694. // "SCHEMA_VALIDATION_IGNORED"
  9695. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9696. // "UNDECLARED_PROPERTIES"
  9697. // "UNREACHABLE"
  9698. Code string `json:"code,omitempty"`
  9699. // Data: [Output Only] Metadata about this warning in key: value format.
  9700. // For example:
  9701. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9702. Data []*HealthCheckServicesListWarningData `json:"data,omitempty"`
  9703. // Message: [Output Only] A human-readable description of the warning
  9704. // code.
  9705. Message string `json:"message,omitempty"`
  9706. // ForceSendFields is a list of field names (e.g. "Code") to
  9707. // unconditionally include in API requests. By default, fields with
  9708. // empty values are omitted from API requests. However, any non-pointer,
  9709. // non-interface field appearing in ForceSendFields will be sent to the
  9710. // server regardless of whether the field is empty or not. This may be
  9711. // used to include empty fields in Patch requests.
  9712. ForceSendFields []string `json:"-"`
  9713. // NullFields is a list of field names (e.g. "Code") to include in API
  9714. // requests with the JSON null value. By default, fields with empty
  9715. // values are omitted from API requests. However, any field with an
  9716. // empty value appearing in NullFields will be sent to the server as
  9717. // null. It is an error if a field in this list has a non-empty value.
  9718. // This may be used to include null fields in Patch requests.
  9719. NullFields []string `json:"-"`
  9720. }
  9721. func (s *HealthCheckServicesListWarning) MarshalJSON() ([]byte, error) {
  9722. type NoMethod HealthCheckServicesListWarning
  9723. raw := NoMethod(*s)
  9724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9725. }
  9726. type HealthCheckServicesListWarningData struct {
  9727. // Key: [Output Only] A key that provides more detail on the warning
  9728. // being returned. For example, for warnings where there are no results
  9729. // in a list request for a particular zone, this key might be scope and
  9730. // the key value might be the zone name. Other examples might be a key
  9731. // indicating a deprecated resource and a suggested replacement, or a
  9732. // warning about invalid network settings (for example, if an instance
  9733. // attempts to perform IP forwarding but is not enabled for IP
  9734. // forwarding).
  9735. Key string `json:"key,omitempty"`
  9736. // Value: [Output Only] A warning data value corresponding to the key.
  9737. Value string `json:"value,omitempty"`
  9738. // ForceSendFields is a list of field names (e.g. "Key") to
  9739. // unconditionally include in API requests. By default, fields with
  9740. // empty values are omitted from API requests. However, any non-pointer,
  9741. // non-interface field appearing in ForceSendFields will be sent to the
  9742. // server regardless of whether the field is empty or not. This may be
  9743. // used to include empty fields in Patch requests.
  9744. ForceSendFields []string `json:"-"`
  9745. // NullFields is a list of field names (e.g. "Key") to include in API
  9746. // requests with the JSON null value. By default, fields with empty
  9747. // values are omitted from API requests. However, any field with an
  9748. // empty value appearing in NullFields will be sent to the server as
  9749. // null. It is an error if a field in this list has a non-empty value.
  9750. // This may be used to include null fields in Patch requests.
  9751. NullFields []string `json:"-"`
  9752. }
  9753. func (s *HealthCheckServicesListWarningData) MarshalJSON() ([]byte, error) {
  9754. type NoMethod HealthCheckServicesListWarningData
  9755. raw := NoMethod(*s)
  9756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9757. }
  9758. type HealthChecksAggregatedList struct {
  9759. // Id: [Output Only] Unique identifier for the resource; defined by the
  9760. // server.
  9761. Id string `json:"id,omitempty"`
  9762. // Items: A list of HealthChecksScopedList resources.
  9763. Items map[string]HealthChecksScopedList `json:"items,omitempty"`
  9764. // Kind: Type of resource.
  9765. Kind string `json:"kind,omitempty"`
  9766. // NextPageToken: [Output Only] This token allows you to get the next
  9767. // page of results for list requests. If the number of results is larger
  9768. // than maxResults, use the nextPageToken as a value for the query
  9769. // parameter pageToken in the next list request. Subsequent list
  9770. // requests will have their own nextPageToken to continue paging through
  9771. // the results.
  9772. NextPageToken string `json:"nextPageToken,omitempty"`
  9773. // SelfLink: [Output Only] Server-defined URL for this resource.
  9774. SelfLink string `json:"selfLink,omitempty"`
  9775. // Warning: [Output Only] Informational warning message.
  9776. Warning *HealthChecksAggregatedListWarning `json:"warning,omitempty"`
  9777. // ServerResponse contains the HTTP response code and headers from the
  9778. // server.
  9779. googleapi.ServerResponse `json:"-"`
  9780. // ForceSendFields is a list of field names (e.g. "Id") to
  9781. // unconditionally include in API requests. By default, fields with
  9782. // empty values are omitted from API requests. However, any non-pointer,
  9783. // non-interface field appearing in ForceSendFields will be sent to the
  9784. // server regardless of whether the field is empty or not. This may be
  9785. // used to include empty fields in Patch requests.
  9786. ForceSendFields []string `json:"-"`
  9787. // NullFields is a list of field names (e.g. "Id") to include in API
  9788. // requests with the JSON null value. By default, fields with empty
  9789. // values are omitted from API requests. However, any field with an
  9790. // empty value appearing in NullFields will be sent to the server as
  9791. // null. It is an error if a field in this list has a non-empty value.
  9792. // This may be used to include null fields in Patch requests.
  9793. NullFields []string `json:"-"`
  9794. }
  9795. func (s *HealthChecksAggregatedList) MarshalJSON() ([]byte, error) {
  9796. type NoMethod HealthChecksAggregatedList
  9797. raw := NoMethod(*s)
  9798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9799. }
  9800. // HealthChecksAggregatedListWarning: [Output Only] Informational
  9801. // warning message.
  9802. type HealthChecksAggregatedListWarning struct {
  9803. // Code: [Output Only] A warning code, if applicable. For example,
  9804. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9805. // the response.
  9806. //
  9807. // Possible values:
  9808. // "CLEANUP_FAILED"
  9809. // "DEPRECATED_RESOURCE_USED"
  9810. // "DEPRECATED_TYPE_USED"
  9811. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9812. // "EXPERIMENTAL_TYPE_USED"
  9813. // "EXTERNAL_API_WARNING"
  9814. // "FIELD_VALUE_OVERRIDEN"
  9815. // "INJECTED_KERNELS_DEPRECATED"
  9816. // "MISSING_TYPE_DEPENDENCY"
  9817. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9818. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9819. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9820. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9821. // "NEXT_HOP_NOT_RUNNING"
  9822. // "NOT_CRITICAL_ERROR"
  9823. // "NO_RESULTS_ON_PAGE"
  9824. // "REQUIRED_TOS_AGREEMENT"
  9825. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9826. // "RESOURCE_NOT_DELETED"
  9827. // "SCHEMA_VALIDATION_IGNORED"
  9828. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9829. // "UNDECLARED_PROPERTIES"
  9830. // "UNREACHABLE"
  9831. Code string `json:"code,omitempty"`
  9832. // Data: [Output Only] Metadata about this warning in key: value format.
  9833. // For example:
  9834. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9835. Data []*HealthChecksAggregatedListWarningData `json:"data,omitempty"`
  9836. // Message: [Output Only] A human-readable description of the warning
  9837. // code.
  9838. Message string `json:"message,omitempty"`
  9839. // ForceSendFields is a list of field names (e.g. "Code") to
  9840. // unconditionally include in API requests. By default, fields with
  9841. // empty values are omitted from API requests. However, any non-pointer,
  9842. // non-interface field appearing in ForceSendFields will be sent to the
  9843. // server regardless of whether the field is empty or not. This may be
  9844. // used to include empty fields in Patch requests.
  9845. ForceSendFields []string `json:"-"`
  9846. // NullFields is a list of field names (e.g. "Code") to include in API
  9847. // requests with the JSON null value. By default, fields with empty
  9848. // values are omitted from API requests. However, any field with an
  9849. // empty value appearing in NullFields will be sent to the server as
  9850. // null. It is an error if a field in this list has a non-empty value.
  9851. // This may be used to include null fields in Patch requests.
  9852. NullFields []string `json:"-"`
  9853. }
  9854. func (s *HealthChecksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  9855. type NoMethod HealthChecksAggregatedListWarning
  9856. raw := NoMethod(*s)
  9857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9858. }
  9859. type HealthChecksAggregatedListWarningData struct {
  9860. // Key: [Output Only] A key that provides more detail on the warning
  9861. // being returned. For example, for warnings where there are no results
  9862. // in a list request for a particular zone, this key might be scope and
  9863. // the key value might be the zone name. Other examples might be a key
  9864. // indicating a deprecated resource and a suggested replacement, or a
  9865. // warning about invalid network settings (for example, if an instance
  9866. // attempts to perform IP forwarding but is not enabled for IP
  9867. // forwarding).
  9868. Key string `json:"key,omitempty"`
  9869. // Value: [Output Only] A warning data value corresponding to the key.
  9870. Value string `json:"value,omitempty"`
  9871. // ForceSendFields is a list of field names (e.g. "Key") to
  9872. // unconditionally include in API requests. By default, fields with
  9873. // empty values are omitted from API requests. However, any non-pointer,
  9874. // non-interface field appearing in ForceSendFields will be sent to the
  9875. // server regardless of whether the field is empty or not. This may be
  9876. // used to include empty fields in Patch requests.
  9877. ForceSendFields []string `json:"-"`
  9878. // NullFields is a list of field names (e.g. "Key") to include in API
  9879. // requests with the JSON null value. By default, fields with empty
  9880. // values are omitted from API requests. However, any field with an
  9881. // empty value appearing in NullFields will be sent to the server as
  9882. // null. It is an error if a field in this list has a non-empty value.
  9883. // This may be used to include null fields in Patch requests.
  9884. NullFields []string `json:"-"`
  9885. }
  9886. func (s *HealthChecksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  9887. type NoMethod HealthChecksAggregatedListWarningData
  9888. raw := NoMethod(*s)
  9889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9890. }
  9891. type HealthChecksScopedList struct {
  9892. // HealthChecks: A list of HealthChecks contained in this scope.
  9893. HealthChecks []*HealthCheck `json:"healthChecks,omitempty"`
  9894. // Warning: Informational warning which replaces the list of backend
  9895. // services when the list is empty.
  9896. Warning *HealthChecksScopedListWarning `json:"warning,omitempty"`
  9897. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  9898. // unconditionally include in API requests. By default, fields with
  9899. // empty values are omitted from API requests. However, any non-pointer,
  9900. // non-interface field appearing in ForceSendFields will be sent to the
  9901. // server regardless of whether the field is empty or not. This may be
  9902. // used to include empty fields in Patch requests.
  9903. ForceSendFields []string `json:"-"`
  9904. // NullFields is a list of field names (e.g. "HealthChecks") to include
  9905. // in API requests with the JSON null value. By default, fields with
  9906. // empty values are omitted from API requests. However, any field with
  9907. // an empty value appearing in NullFields will be sent to the server as
  9908. // null. It is an error if a field in this list has a non-empty value.
  9909. // This may be used to include null fields in Patch requests.
  9910. NullFields []string `json:"-"`
  9911. }
  9912. func (s *HealthChecksScopedList) MarshalJSON() ([]byte, error) {
  9913. type NoMethod HealthChecksScopedList
  9914. raw := NoMethod(*s)
  9915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9916. }
  9917. // HealthChecksScopedListWarning: Informational warning which replaces
  9918. // the list of backend services when the list is empty.
  9919. type HealthChecksScopedListWarning struct {
  9920. // Code: [Output Only] A warning code, if applicable. For example,
  9921. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9922. // the response.
  9923. //
  9924. // Possible values:
  9925. // "CLEANUP_FAILED"
  9926. // "DEPRECATED_RESOURCE_USED"
  9927. // "DEPRECATED_TYPE_USED"
  9928. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9929. // "EXPERIMENTAL_TYPE_USED"
  9930. // "EXTERNAL_API_WARNING"
  9931. // "FIELD_VALUE_OVERRIDEN"
  9932. // "INJECTED_KERNELS_DEPRECATED"
  9933. // "MISSING_TYPE_DEPENDENCY"
  9934. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9935. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9936. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9937. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9938. // "NEXT_HOP_NOT_RUNNING"
  9939. // "NOT_CRITICAL_ERROR"
  9940. // "NO_RESULTS_ON_PAGE"
  9941. // "REQUIRED_TOS_AGREEMENT"
  9942. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9943. // "RESOURCE_NOT_DELETED"
  9944. // "SCHEMA_VALIDATION_IGNORED"
  9945. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9946. // "UNDECLARED_PROPERTIES"
  9947. // "UNREACHABLE"
  9948. Code string `json:"code,omitempty"`
  9949. // Data: [Output Only] Metadata about this warning in key: value format.
  9950. // For example:
  9951. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9952. Data []*HealthChecksScopedListWarningData `json:"data,omitempty"`
  9953. // Message: [Output Only] A human-readable description of the warning
  9954. // code.
  9955. Message string `json:"message,omitempty"`
  9956. // ForceSendFields is a list of field names (e.g. "Code") to
  9957. // unconditionally include in API requests. By default, fields with
  9958. // empty values are omitted from API requests. However, any non-pointer,
  9959. // non-interface field appearing in ForceSendFields will be sent to the
  9960. // server regardless of whether the field is empty or not. This may be
  9961. // used to include empty fields in Patch requests.
  9962. ForceSendFields []string `json:"-"`
  9963. // NullFields is a list of field names (e.g. "Code") to include in API
  9964. // requests with the JSON null value. By default, fields with empty
  9965. // values are omitted from API requests. However, any field with an
  9966. // empty value appearing in NullFields will be sent to the server as
  9967. // null. It is an error if a field in this list has a non-empty value.
  9968. // This may be used to include null fields in Patch requests.
  9969. NullFields []string `json:"-"`
  9970. }
  9971. func (s *HealthChecksScopedListWarning) MarshalJSON() ([]byte, error) {
  9972. type NoMethod HealthChecksScopedListWarning
  9973. raw := NoMethod(*s)
  9974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9975. }
  9976. type HealthChecksScopedListWarningData struct {
  9977. // Key: [Output Only] A key that provides more detail on the warning
  9978. // being returned. For example, for warnings where there are no results
  9979. // in a list request for a particular zone, this key might be scope and
  9980. // the key value might be the zone name. Other examples might be a key
  9981. // indicating a deprecated resource and a suggested replacement, or a
  9982. // warning about invalid network settings (for example, if an instance
  9983. // attempts to perform IP forwarding but is not enabled for IP
  9984. // forwarding).
  9985. Key string `json:"key,omitempty"`
  9986. // Value: [Output Only] A warning data value corresponding to the key.
  9987. Value string `json:"value,omitempty"`
  9988. // ForceSendFields is a list of field names (e.g. "Key") to
  9989. // unconditionally include in API requests. By default, fields with
  9990. // empty values are omitted from API requests. However, any non-pointer,
  9991. // non-interface field appearing in ForceSendFields will be sent to the
  9992. // server regardless of whether the field is empty or not. This may be
  9993. // used to include empty fields in Patch requests.
  9994. ForceSendFields []string `json:"-"`
  9995. // NullFields is a list of field names (e.g. "Key") to include in API
  9996. // requests with the JSON null value. By default, fields with empty
  9997. // values are omitted from API requests. However, any field with an
  9998. // empty value appearing in NullFields will be sent to the server as
  9999. // null. It is an error if a field in this list has a non-empty value.
  10000. // This may be used to include null fields in Patch requests.
  10001. NullFields []string `json:"-"`
  10002. }
  10003. func (s *HealthChecksScopedListWarningData) MarshalJSON() ([]byte, error) {
  10004. type NoMethod HealthChecksScopedListWarningData
  10005. raw := NoMethod(*s)
  10006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10007. }
  10008. type HealthStatus struct {
  10009. // Annotations: Metadata defined as annotations for network endpoint.
  10010. Annotations map[string]string `json:"annotations,omitempty"`
  10011. // HealthState: Health state of the instance.
  10012. //
  10013. // Possible values:
  10014. // "HEALTHY"
  10015. // "UNHEALTHY"
  10016. HealthState string `json:"healthState,omitempty"`
  10017. // Instance: URL of the instance resource.
  10018. Instance string `json:"instance,omitempty"`
  10019. // IpAddress: The IP address represented by this resource.
  10020. IpAddress string `json:"ipAddress,omitempty"`
  10021. // Port: The port on the instance.
  10022. Port int64 `json:"port,omitempty"`
  10023. // ForceSendFields is a list of field names (e.g. "Annotations") to
  10024. // unconditionally include in API requests. By default, fields with
  10025. // empty values are omitted from API requests. However, any non-pointer,
  10026. // non-interface field appearing in ForceSendFields will be sent to the
  10027. // server regardless of whether the field is empty or not. This may be
  10028. // used to include empty fields in Patch requests.
  10029. ForceSendFields []string `json:"-"`
  10030. // NullFields is a list of field names (e.g. "Annotations") to include
  10031. // in API requests with the JSON null value. By default, fields with
  10032. // empty values are omitted from API requests. However, any field with
  10033. // an empty value appearing in NullFields will be sent to the server as
  10034. // null. It is an error if a field in this list has a non-empty value.
  10035. // This may be used to include null fields in Patch requests.
  10036. NullFields []string `json:"-"`
  10037. }
  10038. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  10039. type NoMethod HealthStatus
  10040. raw := NoMethod(*s)
  10041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10042. }
  10043. type HealthStatusForNetworkEndpoint struct {
  10044. // BackendService: URL of the backend service associated with the health
  10045. // state of the network endpoint.
  10046. BackendService *BackendServiceReference `json:"backendService,omitempty"`
  10047. // ForwardingRule: URL of the forwarding rule associated with the health
  10048. // state of the network endpoint.
  10049. ForwardingRule *ForwardingRuleReference `json:"forwardingRule,omitempty"`
  10050. // HealthCheck: URL of the health check associated with the health state
  10051. // of the network endpoint.
  10052. HealthCheck *HealthCheckReference `json:"healthCheck,omitempty"`
  10053. // HealthState: Health state of the network endpoint determined based on
  10054. // the health checks configured.
  10055. //
  10056. // Possible values:
  10057. // "DRAINING"
  10058. // "HEALTHY"
  10059. // "UNHEALTHY"
  10060. // "UNKNOWN"
  10061. HealthState string `json:"healthState,omitempty"`
  10062. // ForceSendFields is a list of field names (e.g. "BackendService") to
  10063. // unconditionally include in API requests. By default, fields with
  10064. // empty values are omitted from API requests. However, any non-pointer,
  10065. // non-interface field appearing in ForceSendFields will be sent to the
  10066. // server regardless of whether the field is empty or not. This may be
  10067. // used to include empty fields in Patch requests.
  10068. ForceSendFields []string `json:"-"`
  10069. // NullFields is a list of field names (e.g. "BackendService") to
  10070. // include in API requests with the JSON null value. By default, fields
  10071. // with empty values are omitted from API requests. However, any field
  10072. // with an empty value appearing in NullFields will be sent to the
  10073. // server as null. It is an error if a field in this list has a
  10074. // non-empty value. This may be used to include null fields in Patch
  10075. // requests.
  10076. NullFields []string `json:"-"`
  10077. }
  10078. func (s *HealthStatusForNetworkEndpoint) MarshalJSON() ([]byte, error) {
  10079. type NoMethod HealthStatusForNetworkEndpoint
  10080. raw := NoMethod(*s)
  10081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10082. }
  10083. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  10084. // use the named PathMatcher to select the BackendService.
  10085. type HostRule struct {
  10086. // Description: An optional description of this resource. Provide this
  10087. // property when you create the resource.
  10088. Description string `json:"description,omitempty"`
  10089. // Hosts: The list of host patterns to match. They must be valid
  10090. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  10091. // case, * must be the first character and must be followed in the
  10092. // pattern by either - or ..
  10093. Hosts []string `json:"hosts,omitempty"`
  10094. // PathMatcher: The name of the PathMatcher to use to match the path
  10095. // portion of the URL if the hostRule matches the URL's host portion.
  10096. PathMatcher string `json:"pathMatcher,omitempty"`
  10097. // ForceSendFields is a list of field names (e.g. "Description") to
  10098. // unconditionally include in API requests. By default, fields with
  10099. // empty values are omitted from API requests. However, any non-pointer,
  10100. // non-interface field appearing in ForceSendFields will be sent to the
  10101. // server regardless of whether the field is empty or not. This may be
  10102. // used to include empty fields in Patch requests.
  10103. ForceSendFields []string `json:"-"`
  10104. // NullFields is a list of field names (e.g. "Description") to include
  10105. // in API requests with the JSON null value. By default, fields with
  10106. // empty values are omitted from API requests. However, any field with
  10107. // an empty value appearing in NullFields will be sent to the server as
  10108. // null. It is an error if a field in this list has a non-empty value.
  10109. // This may be used to include null fields in Patch requests.
  10110. NullFields []string `json:"-"`
  10111. }
  10112. func (s *HostRule) MarshalJSON() ([]byte, error) {
  10113. type NoMethod HostRule
  10114. raw := NoMethod(*s)
  10115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10116. }
  10117. // HttpFaultAbort: Specification for how requests are aborted as part of
  10118. // fault injection.
  10119. type HttpFaultAbort struct {
  10120. // HttpStatus: The HTTP status code used to abort the request.
  10121. // The value must be between 200 and 599 inclusive.
  10122. HttpStatus int64 `json:"httpStatus,omitempty"`
  10123. // Percentage: The percentage of traffic
  10124. // (connections/operations/requests) which will be aborted as part of
  10125. // fault injection.
  10126. // The value must be between 0.0 and 100.0 inclusive.
  10127. Percentage float64 `json:"percentage,omitempty"`
  10128. // ForceSendFields is a list of field names (e.g. "HttpStatus") to
  10129. // unconditionally include in API requests. By default, fields with
  10130. // empty values are omitted from API requests. However, any non-pointer,
  10131. // non-interface field appearing in ForceSendFields will be sent to the
  10132. // server regardless of whether the field is empty or not. This may be
  10133. // used to include empty fields in Patch requests.
  10134. ForceSendFields []string `json:"-"`
  10135. // NullFields is a list of field names (e.g. "HttpStatus") to include in
  10136. // API requests with the JSON null value. By default, fields with empty
  10137. // values are omitted from API requests. However, any field with an
  10138. // empty value appearing in NullFields will be sent to the server as
  10139. // null. It is an error if a field in this list has a non-empty value.
  10140. // This may be used to include null fields in Patch requests.
  10141. NullFields []string `json:"-"`
  10142. }
  10143. func (s *HttpFaultAbort) MarshalJSON() ([]byte, error) {
  10144. type NoMethod HttpFaultAbort
  10145. raw := NoMethod(*s)
  10146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10147. }
  10148. func (s *HttpFaultAbort) UnmarshalJSON(data []byte) error {
  10149. type NoMethod HttpFaultAbort
  10150. var s1 struct {
  10151. Percentage gensupport.JSONFloat64 `json:"percentage"`
  10152. *NoMethod
  10153. }
  10154. s1.NoMethod = (*NoMethod)(s)
  10155. if err := json.Unmarshal(data, &s1); err != nil {
  10156. return err
  10157. }
  10158. s.Percentage = float64(s1.Percentage)
  10159. return nil
  10160. }
  10161. // HttpFaultDelay: Specifies the delay introduced by Loadbalancer before
  10162. // forwarding the request to the backend service as part of fault
  10163. // injection.
  10164. type HttpFaultDelay struct {
  10165. // FixedDelay: Specifies the value of the fixed delay interval.
  10166. FixedDelay *Duration `json:"fixedDelay,omitempty"`
  10167. // Percentage: The percentage of traffic
  10168. // (connections/operations/requests) on which delay will be introduced
  10169. // as part of fault injection.
  10170. // The value must be between 0.0 and 100.0 inclusive.
  10171. Percentage float64 `json:"percentage,omitempty"`
  10172. // ForceSendFields is a list of field names (e.g. "FixedDelay") to
  10173. // unconditionally include in API requests. By default, fields with
  10174. // empty values are omitted from API requests. However, any non-pointer,
  10175. // non-interface field appearing in ForceSendFields will be sent to the
  10176. // server regardless of whether the field is empty or not. This may be
  10177. // used to include empty fields in Patch requests.
  10178. ForceSendFields []string `json:"-"`
  10179. // NullFields is a list of field names (e.g. "FixedDelay") to include in
  10180. // API requests with the JSON null value. By default, fields with empty
  10181. // values are omitted from API requests. However, any field with an
  10182. // empty value appearing in NullFields will be sent to the server as
  10183. // null. It is an error if a field in this list has a non-empty value.
  10184. // This may be used to include null fields in Patch requests.
  10185. NullFields []string `json:"-"`
  10186. }
  10187. func (s *HttpFaultDelay) MarshalJSON() ([]byte, error) {
  10188. type NoMethod HttpFaultDelay
  10189. raw := NoMethod(*s)
  10190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10191. }
  10192. func (s *HttpFaultDelay) UnmarshalJSON(data []byte) error {
  10193. type NoMethod HttpFaultDelay
  10194. var s1 struct {
  10195. Percentage gensupport.JSONFloat64 `json:"percentage"`
  10196. *NoMethod
  10197. }
  10198. s1.NoMethod = (*NoMethod)(s)
  10199. if err := json.Unmarshal(data, &s1); err != nil {
  10200. return err
  10201. }
  10202. s.Percentage = float64(s1.Percentage)
  10203. return nil
  10204. }
  10205. // HttpFaultInjection: The specification for fault injection introduced
  10206. // into traffic to test the resiliency of clients to backend service
  10207. // failure. As part of fault injection, when clients send requests to a
  10208. // backend service, delays can be introduced by Loadbalancer on a
  10209. // percentage of requests before sending those request to the backend
  10210. // service. Similarly requests from clients can be aborted by the
  10211. // Loadbalancer for a percentage of requests.
  10212. type HttpFaultInjection struct {
  10213. // Abort: The specification for how client requests are aborted as part
  10214. // of fault injection.
  10215. Abort *HttpFaultAbort `json:"abort,omitempty"`
  10216. // Delay: The specification for how client requests are delayed as part
  10217. // of fault injection, before being sent to a backend service.
  10218. Delay *HttpFaultDelay `json:"delay,omitempty"`
  10219. // ForceSendFields is a list of field names (e.g. "Abort") to
  10220. // unconditionally include in API requests. By default, fields with
  10221. // empty values are omitted from API requests. However, any non-pointer,
  10222. // non-interface field appearing in ForceSendFields will be sent to the
  10223. // server regardless of whether the field is empty or not. This may be
  10224. // used to include empty fields in Patch requests.
  10225. ForceSendFields []string `json:"-"`
  10226. // NullFields is a list of field names (e.g. "Abort") to include in API
  10227. // requests with the JSON null value. By default, fields with empty
  10228. // values are omitted from API requests. However, any field with an
  10229. // empty value appearing in NullFields will be sent to the server as
  10230. // null. It is an error if a field in this list has a non-empty value.
  10231. // This may be used to include null fields in Patch requests.
  10232. NullFields []string `json:"-"`
  10233. }
  10234. func (s *HttpFaultInjection) MarshalJSON() ([]byte, error) {
  10235. type NoMethod HttpFaultInjection
  10236. raw := NoMethod(*s)
  10237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10238. }
  10239. // HttpHeaderAction: The request and response header transformations
  10240. // that take effect before the request is passed along to the selected
  10241. // backendService.
  10242. type HttpHeaderAction struct {
  10243. // RequestHeadersToAdd: Headers to add to a matching request prior to
  10244. // forwarding the request to the backendService.
  10245. RequestHeadersToAdd []*HttpHeaderOption `json:"requestHeadersToAdd,omitempty"`
  10246. // RequestHeadersToRemove: A list of header names for headers that need
  10247. // to be removed from the request prior to forwarding the request to the
  10248. // backendService.
  10249. RequestHeadersToRemove []string `json:"requestHeadersToRemove,omitempty"`
  10250. // ResponseHeadersToAdd: Headers to add the response prior to sending
  10251. // the response back to the client.
  10252. ResponseHeadersToAdd []*HttpHeaderOption `json:"responseHeadersToAdd,omitempty"`
  10253. // ResponseHeadersToRemove: A list of header names for headers that need
  10254. // to be removed from the response prior to sending the response back to
  10255. // the client.
  10256. ResponseHeadersToRemove []string `json:"responseHeadersToRemove,omitempty"`
  10257. // ForceSendFields is a list of field names (e.g. "RequestHeadersToAdd")
  10258. // to unconditionally include in API requests. By default, fields with
  10259. // empty values are omitted from API requests. However, any non-pointer,
  10260. // non-interface field appearing in ForceSendFields will be sent to the
  10261. // server regardless of whether the field is empty or not. This may be
  10262. // used to include empty fields in Patch requests.
  10263. ForceSendFields []string `json:"-"`
  10264. // NullFields is a list of field names (e.g. "RequestHeadersToAdd") to
  10265. // include in API requests with the JSON null value. By default, fields
  10266. // with empty values are omitted from API requests. However, any field
  10267. // with an empty value appearing in NullFields will be sent to the
  10268. // server as null. It is an error if a field in this list has a
  10269. // non-empty value. This may be used to include null fields in Patch
  10270. // requests.
  10271. NullFields []string `json:"-"`
  10272. }
  10273. func (s *HttpHeaderAction) MarshalJSON() ([]byte, error) {
  10274. type NoMethod HttpHeaderAction
  10275. raw := NoMethod(*s)
  10276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10277. }
  10278. // HttpHeaderMatch: matchRule criteria for request header matches.
  10279. type HttpHeaderMatch struct {
  10280. // ExactMatch: The value should exactly match contents of
  10281. // exactMatch.
  10282. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10283. // presentMatch or rangeMatch must be set.
  10284. ExactMatch string `json:"exactMatch,omitempty"`
  10285. // HeaderName: The name of the HTTP header to match.
  10286. // For matching against the HTTP request's authority, use a headerMatch
  10287. // with the header name ":authority".
  10288. // For matching a request's method, use the headerName ":method".
  10289. HeaderName string `json:"headerName,omitempty"`
  10290. // InvertMatch: If set to false, the headerMatch is considered a match
  10291. // if the match criteria above are met. If set to true, the headerMatch
  10292. // is considered a match if the match criteria above are NOT met.
  10293. // The default setting is false.
  10294. InvertMatch bool `json:"invertMatch,omitempty"`
  10295. // PrefixMatch: The value of the header must start with the contents of
  10296. // prefixMatch.
  10297. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10298. // presentMatch or rangeMatch must be set.
  10299. PrefixMatch string `json:"prefixMatch,omitempty"`
  10300. // PresentMatch: A header with the contents of headerName must exist.
  10301. // The match takes place whether or not the request's header has a value
  10302. // or not.
  10303. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10304. // presentMatch or rangeMatch must be set.
  10305. PresentMatch bool `json:"presentMatch,omitempty"`
  10306. // RangeMatch: The header value must be an integer and its value must be
  10307. // in the range specified in rangeMatch. If the header does not contain
  10308. // an integer, number or is empty, the match fails.
  10309. // For example for a range [-5, 0]
  10310. // - -3 will match.
  10311. // - 0 will not match.
  10312. // - 0.25 will not match.
  10313. // - -3someString will not match.
  10314. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10315. // presentMatch or rangeMatch must be set.
  10316. RangeMatch *Int64RangeMatch `json:"rangeMatch,omitempty"`
  10317. // RegexMatch: The value of the header must match the regualar
  10318. // expression specified in regexMatch. For regular expression grammar,
  10319. // please see: en.cppreference.com/w/cpp/regex/ecmascript
  10320. // For matching against a port specified in the HTTP request, use a
  10321. // headerMatch with headerName set to PORT and a regular expression that
  10322. // satisfies the RFC2616 Host header's port specifier.
  10323. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10324. // presentMatch or rangeMatch must be set.
  10325. RegexMatch string `json:"regexMatch,omitempty"`
  10326. // SuffixMatch: The value of the header must end with the contents of
  10327. // suffixMatch.
  10328. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10329. // presentMatch or rangeMatch must be set.
  10330. SuffixMatch string `json:"suffixMatch,omitempty"`
  10331. // ForceSendFields is a list of field names (e.g. "ExactMatch") to
  10332. // unconditionally include in API requests. By default, fields with
  10333. // empty values are omitted from API requests. However, any non-pointer,
  10334. // non-interface field appearing in ForceSendFields will be sent to the
  10335. // server regardless of whether the field is empty or not. This may be
  10336. // used to include empty fields in Patch requests.
  10337. ForceSendFields []string `json:"-"`
  10338. // NullFields is a list of field names (e.g. "ExactMatch") to include in
  10339. // API requests with the JSON null value. By default, fields with empty
  10340. // values are omitted from API requests. However, any field with an
  10341. // empty value appearing in NullFields will be sent to the server as
  10342. // null. It is an error if a field in this list has a non-empty value.
  10343. // This may be used to include null fields in Patch requests.
  10344. NullFields []string `json:"-"`
  10345. }
  10346. func (s *HttpHeaderMatch) MarshalJSON() ([]byte, error) {
  10347. type NoMethod HttpHeaderMatch
  10348. raw := NoMethod(*s)
  10349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10350. }
  10351. // HttpHeaderOption: Specification determining how headers are added to
  10352. // requests or responses.
  10353. type HttpHeaderOption struct {
  10354. // HeaderName: The name of the header.
  10355. HeaderName string `json:"headerName,omitempty"`
  10356. // HeaderValue: The value of the header to add.
  10357. HeaderValue string `json:"headerValue,omitempty"`
  10358. // Replace: If false, headerValue is appended to any values that already
  10359. // exist for the header. If true, headerValue is set for the header,
  10360. // discarding any values that were set for that header.
  10361. // The default value is false.
  10362. Replace bool `json:"replace,omitempty"`
  10363. // ForceSendFields is a list of field names (e.g. "HeaderName") to
  10364. // unconditionally include in API requests. By default, fields with
  10365. // empty values are omitted from API requests. However, any non-pointer,
  10366. // non-interface field appearing in ForceSendFields will be sent to the
  10367. // server regardless of whether the field is empty or not. This may be
  10368. // used to include empty fields in Patch requests.
  10369. ForceSendFields []string `json:"-"`
  10370. // NullFields is a list of field names (e.g. "HeaderName") to include in
  10371. // API requests with the JSON null value. By default, fields with empty
  10372. // values are omitted from API requests. However, any field with an
  10373. // empty value appearing in NullFields will be sent to the server as
  10374. // null. It is an error if a field in this list has a non-empty value.
  10375. // This may be used to include null fields in Patch requests.
  10376. NullFields []string `json:"-"`
  10377. }
  10378. func (s *HttpHeaderOption) MarshalJSON() ([]byte, error) {
  10379. type NoMethod HttpHeaderOption
  10380. raw := NoMethod(*s)
  10381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10382. }
  10383. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  10384. // template for how individual instances should be checked for health,
  10385. // via HTTP.
  10386. type HttpHealthCheck struct {
  10387. // CheckIntervalSec: How often (in seconds) to send a health check. The
  10388. // default value is 5 seconds.
  10389. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  10390. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10391. // format.
  10392. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10393. // Description: An optional description of this resource. Provide this
  10394. // property when you create the resource.
  10395. Description string `json:"description,omitempty"`
  10396. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  10397. // after this many consecutive successes. The default value is 2.
  10398. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  10399. // Host: The value of the host header in the HTTP health check request.
  10400. // If left empty (default value), the public IP on behalf of which this
  10401. // health check is performed will be used.
  10402. Host string `json:"host,omitempty"`
  10403. // Id: [Output Only] The unique identifier for the resource. This
  10404. // identifier is defined by the server.
  10405. Id uint64 `json:"id,omitempty,string"`
  10406. // Kind: [Output Only] Type of the resource. Always
  10407. // compute#httpHealthCheck for HTTP health checks.
  10408. Kind string `json:"kind,omitempty"`
  10409. // Name: Name of the resource. Provided by the client when the resource
  10410. // is created. The name must be 1-63 characters long, and comply with
  10411. // RFC1035. Specifically, the name must be 1-63 characters long and
  10412. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10413. // the first character must be a lowercase letter, and all following
  10414. // characters must be a dash, lowercase letter, or digit, except the
  10415. // last character, which cannot be a dash.
  10416. Name string `json:"name,omitempty"`
  10417. // Port: The TCP port number for the HTTP health check request. The
  10418. // default value is 80.
  10419. Port int64 `json:"port,omitempty"`
  10420. // RequestPath: The request path of the HTTP health check request. The
  10421. // default value is /.
  10422. RequestPath string `json:"requestPath,omitempty"`
  10423. // SelfLink: [Output Only] Server-defined URL for the resource.
  10424. SelfLink string `json:"selfLink,omitempty"`
  10425. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  10426. // with the resource id.
  10427. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  10428. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  10429. // The default value is 5 seconds. It is invalid for timeoutSec to have
  10430. // greater value than checkIntervalSec.
  10431. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  10432. // UnhealthyThreshold: A so-far healthy instance will be marked
  10433. // unhealthy after this many consecutive failures. The default value is
  10434. // 2.
  10435. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  10436. // ServerResponse contains the HTTP response code and headers from the
  10437. // server.
  10438. googleapi.ServerResponse `json:"-"`
  10439. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  10440. // unconditionally include in API requests. By default, fields with
  10441. // empty values are omitted from API requests. However, any non-pointer,
  10442. // non-interface field appearing in ForceSendFields will be sent to the
  10443. // server regardless of whether the field is empty or not. This may be
  10444. // used to include empty fields in Patch requests.
  10445. ForceSendFields []string `json:"-"`
  10446. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  10447. // include in API requests with the JSON null value. By default, fields
  10448. // with empty values are omitted from API requests. However, any field
  10449. // with an empty value appearing in NullFields will be sent to the
  10450. // server as null. It is an error if a field in this list has a
  10451. // non-empty value. This may be used to include null fields in Patch
  10452. // requests.
  10453. NullFields []string `json:"-"`
  10454. }
  10455. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  10456. type NoMethod HttpHealthCheck
  10457. raw := NoMethod(*s)
  10458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10459. }
  10460. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  10461. type HttpHealthCheckList struct {
  10462. // Id: [Output Only] Unique identifier for the resource; defined by the
  10463. // server.
  10464. Id string `json:"id,omitempty"`
  10465. // Items: A list of HttpHealthCheck resources.
  10466. Items []*HttpHealthCheck `json:"items,omitempty"`
  10467. // Kind: Type of resource.
  10468. Kind string `json:"kind,omitempty"`
  10469. // NextPageToken: [Output Only] This token allows you to get the next
  10470. // page of results for list requests. If the number of results is larger
  10471. // than maxResults, use the nextPageToken as a value for the query
  10472. // parameter pageToken in the next list request. Subsequent list
  10473. // requests will have their own nextPageToken to continue paging through
  10474. // the results.
  10475. NextPageToken string `json:"nextPageToken,omitempty"`
  10476. // SelfLink: [Output Only] Server-defined URL for this resource.
  10477. SelfLink string `json:"selfLink,omitempty"`
  10478. // Warning: [Output Only] Informational warning message.
  10479. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  10480. // ServerResponse contains the HTTP response code and headers from the
  10481. // server.
  10482. googleapi.ServerResponse `json:"-"`
  10483. // ForceSendFields is a list of field names (e.g. "Id") to
  10484. // unconditionally include in API requests. By default, fields with
  10485. // empty values are omitted from API requests. However, any non-pointer,
  10486. // non-interface field appearing in ForceSendFields will be sent to the
  10487. // server regardless of whether the field is empty or not. This may be
  10488. // used to include empty fields in Patch requests.
  10489. ForceSendFields []string `json:"-"`
  10490. // NullFields is a list of field names (e.g. "Id") to include in API
  10491. // requests with the JSON null value. By default, fields with empty
  10492. // values are omitted from API requests. However, any field with an
  10493. // empty value appearing in NullFields will be sent to the server as
  10494. // null. It is an error if a field in this list has a non-empty value.
  10495. // This may be used to include null fields in Patch requests.
  10496. NullFields []string `json:"-"`
  10497. }
  10498. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  10499. type NoMethod HttpHealthCheckList
  10500. raw := NoMethod(*s)
  10501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10502. }
  10503. // HttpHealthCheckListWarning: [Output Only] Informational warning
  10504. // message.
  10505. type HttpHealthCheckListWarning struct {
  10506. // Code: [Output Only] A warning code, if applicable. For example,
  10507. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10508. // the response.
  10509. //
  10510. // Possible values:
  10511. // "CLEANUP_FAILED"
  10512. // "DEPRECATED_RESOURCE_USED"
  10513. // "DEPRECATED_TYPE_USED"
  10514. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10515. // "EXPERIMENTAL_TYPE_USED"
  10516. // "EXTERNAL_API_WARNING"
  10517. // "FIELD_VALUE_OVERRIDEN"
  10518. // "INJECTED_KERNELS_DEPRECATED"
  10519. // "MISSING_TYPE_DEPENDENCY"
  10520. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10521. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10522. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10523. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10524. // "NEXT_HOP_NOT_RUNNING"
  10525. // "NOT_CRITICAL_ERROR"
  10526. // "NO_RESULTS_ON_PAGE"
  10527. // "REQUIRED_TOS_AGREEMENT"
  10528. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10529. // "RESOURCE_NOT_DELETED"
  10530. // "SCHEMA_VALIDATION_IGNORED"
  10531. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10532. // "UNDECLARED_PROPERTIES"
  10533. // "UNREACHABLE"
  10534. Code string `json:"code,omitempty"`
  10535. // Data: [Output Only] Metadata about this warning in key: value format.
  10536. // For example:
  10537. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10538. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  10539. // Message: [Output Only] A human-readable description of the warning
  10540. // code.
  10541. Message string `json:"message,omitempty"`
  10542. // ForceSendFields is a list of field names (e.g. "Code") to
  10543. // unconditionally include in API requests. By default, fields with
  10544. // empty values are omitted from API requests. However, any non-pointer,
  10545. // non-interface field appearing in ForceSendFields will be sent to the
  10546. // server regardless of whether the field is empty or not. This may be
  10547. // used to include empty fields in Patch requests.
  10548. ForceSendFields []string `json:"-"`
  10549. // NullFields is a list of field names (e.g. "Code") to include in API
  10550. // requests with the JSON null value. By default, fields with empty
  10551. // values are omitted from API requests. However, any field with an
  10552. // empty value appearing in NullFields will be sent to the server as
  10553. // null. It is an error if a field in this list has a non-empty value.
  10554. // This may be used to include null fields in Patch requests.
  10555. NullFields []string `json:"-"`
  10556. }
  10557. func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  10558. type NoMethod HttpHealthCheckListWarning
  10559. raw := NoMethod(*s)
  10560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10561. }
  10562. type HttpHealthCheckListWarningData struct {
  10563. // Key: [Output Only] A key that provides more detail on the warning
  10564. // being returned. For example, for warnings where there are no results
  10565. // in a list request for a particular zone, this key might be scope and
  10566. // the key value might be the zone name. Other examples might be a key
  10567. // indicating a deprecated resource and a suggested replacement, or a
  10568. // warning about invalid network settings (for example, if an instance
  10569. // attempts to perform IP forwarding but is not enabled for IP
  10570. // forwarding).
  10571. Key string `json:"key,omitempty"`
  10572. // Value: [Output Only] A warning data value corresponding to the key.
  10573. Value string `json:"value,omitempty"`
  10574. // ForceSendFields is a list of field names (e.g. "Key") to
  10575. // unconditionally include in API requests. By default, fields with
  10576. // empty values are omitted from API requests. However, any non-pointer,
  10577. // non-interface field appearing in ForceSendFields will be sent to the
  10578. // server regardless of whether the field is empty or not. This may be
  10579. // used to include empty fields in Patch requests.
  10580. ForceSendFields []string `json:"-"`
  10581. // NullFields is a list of field names (e.g. "Key") to include in API
  10582. // requests with the JSON null value. By default, fields with empty
  10583. // values are omitted from API requests. However, any field with an
  10584. // empty value appearing in NullFields will be sent to the server as
  10585. // null. It is an error if a field in this list has a non-empty value.
  10586. // This may be used to include null fields in Patch requests.
  10587. NullFields []string `json:"-"`
  10588. }
  10589. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  10590. type NoMethod HttpHealthCheckListWarningData
  10591. raw := NoMethod(*s)
  10592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10593. }
  10594. // HttpQueryParameterMatch: HttpRouteRuleMatch criteria for a request's
  10595. // query parameter.
  10596. type HttpQueryParameterMatch struct {
  10597. // ExactMatch: The queryParameterMatch matches if the value of the
  10598. // parameter exactly matches the contents of exactMatch.
  10599. // Only one of presentMatch, exactMatch and regexMatch must be set.
  10600. ExactMatch string `json:"exactMatch,omitempty"`
  10601. // Name: The name of the query parameter to match. The query parameter
  10602. // must exist in the request, in the absence of which the request match
  10603. // fails.
  10604. Name string `json:"name,omitempty"`
  10605. // PresentMatch: Specifies that the queryParameterMatch matches if the
  10606. // request contains the query parameter, irrespective of whether the
  10607. // parameter has a value or not.
  10608. // Only one of presentMatch, exactMatch and regexMatch must be set.
  10609. PresentMatch bool `json:"presentMatch,omitempty"`
  10610. // RegexMatch: The queryParameterMatch matches if the value of the
  10611. // parameter matches the regular expression specified by regexMatch. For
  10612. // the regular expression grammar, please see
  10613. // en.cppreference.com/w/cpp/regex/ecmascript
  10614. // Only one of presentMatch, exactMatch and regexMatch must be set.
  10615. RegexMatch string `json:"regexMatch,omitempty"`
  10616. // ForceSendFields is a list of field names (e.g. "ExactMatch") to
  10617. // unconditionally include in API requests. By default, fields with
  10618. // empty values are omitted from API requests. However, any non-pointer,
  10619. // non-interface field appearing in ForceSendFields will be sent to the
  10620. // server regardless of whether the field is empty or not. This may be
  10621. // used to include empty fields in Patch requests.
  10622. ForceSendFields []string `json:"-"`
  10623. // NullFields is a list of field names (e.g. "ExactMatch") to include in
  10624. // API requests with the JSON null value. By default, fields with empty
  10625. // values are omitted from API requests. However, any field with an
  10626. // empty value appearing in NullFields will be sent to the server as
  10627. // null. It is an error if a field in this list has a non-empty value.
  10628. // This may be used to include null fields in Patch requests.
  10629. NullFields []string `json:"-"`
  10630. }
  10631. func (s *HttpQueryParameterMatch) MarshalJSON() ([]byte, error) {
  10632. type NoMethod HttpQueryParameterMatch
  10633. raw := NoMethod(*s)
  10634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10635. }
  10636. // HttpRedirectAction: Specifies settings for an HTTP redirect.
  10637. type HttpRedirectAction struct {
  10638. // HostRedirect: The host that will be used in the redirect response
  10639. // instead of the one that was supplied in the request.
  10640. // The value must be between 1 and 255 characters.
  10641. HostRedirect string `json:"hostRedirect,omitempty"`
  10642. // HttpsRedirect: If set to true, the URL scheme in the redirected
  10643. // request is set to https. If set to false, the URL scheme of the
  10644. // redirected request will remain the same as that of the request.
  10645. // This must only be set for UrlMaps used in TargetHttpProxys. Setting
  10646. // this true for TargetHttpsProxy is not permitted.
  10647. // The default is set to false.
  10648. HttpsRedirect bool `json:"httpsRedirect,omitempty"`
  10649. // PathRedirect: The path that will be used in the redirect response
  10650. // instead of the one that was supplied in the request.
  10651. // Only one of pathRedirect or prefixRedirect must be specified.
  10652. // The value must be between 1 and 1024 characters.
  10653. PathRedirect string `json:"pathRedirect,omitempty"`
  10654. // PrefixRedirect: The prefix that replaces the prefixMatch specified in
  10655. // the HttpRouteRuleMatch, retaining the remaining portion of the URL
  10656. // before redirecting the request.
  10657. PrefixRedirect string `json:"prefixRedirect,omitempty"`
  10658. // RedirectResponseCode: The HTTP Status code to use for this
  10659. // RedirectAction.
  10660. // Supported values are:
  10661. // - MOVED_PERMANENTLY_DEFAULT, which is the default value and
  10662. // corresponds to 301.
  10663. // - FOUND, which corresponds to 302.
  10664. // - SEE_OTHER which corresponds to 303.
  10665. // - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the
  10666. // request method will be retained.
  10667. // - PERMANENT_REDIRECT, which corresponds to 308. In this case, the
  10668. // request method will be retained.
  10669. //
  10670. // Possible values:
  10671. // "FOUND"
  10672. // "MOVED_PERMANENTLY_DEFAULT"
  10673. // "PERMANENT_REDIRECT"
  10674. // "SEE_OTHER"
  10675. // "TEMPORARY_REDIRECT"
  10676. RedirectResponseCode string `json:"redirectResponseCode,omitempty"`
  10677. // StripQuery: If set to true, any accompanying query portion of the
  10678. // original URL is removed prior to redirecting the request. If set to
  10679. // false, the query portion of the original URL is retained.
  10680. // The default is set to false.
  10681. StripQuery bool `json:"stripQuery,omitempty"`
  10682. // ForceSendFields is a list of field names (e.g. "HostRedirect") to
  10683. // unconditionally include in API requests. By default, fields with
  10684. // empty values are omitted from API requests. However, any non-pointer,
  10685. // non-interface field appearing in ForceSendFields will be sent to the
  10686. // server regardless of whether the field is empty or not. This may be
  10687. // used to include empty fields in Patch requests.
  10688. ForceSendFields []string `json:"-"`
  10689. // NullFields is a list of field names (e.g. "HostRedirect") to include
  10690. // in API requests with the JSON null value. By default, fields with
  10691. // empty values are omitted from API requests. However, any field with
  10692. // an empty value appearing in NullFields will be sent to the server as
  10693. // null. It is an error if a field in this list has a non-empty value.
  10694. // This may be used to include null fields in Patch requests.
  10695. NullFields []string `json:"-"`
  10696. }
  10697. func (s *HttpRedirectAction) MarshalJSON() ([]byte, error) {
  10698. type NoMethod HttpRedirectAction
  10699. raw := NoMethod(*s)
  10700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10701. }
  10702. // HttpRetryPolicy: The retry policy associates with HttpRouteRule
  10703. type HttpRetryPolicy struct {
  10704. // NumRetries: Specifies the allowed number retries. This number must be
  10705. // > 0.
  10706. NumRetries int64 `json:"numRetries,omitempty"`
  10707. // PerTryTimeout: Specifies a non-zero timeout per retry attempt.
  10708. PerTryTimeout *Duration `json:"perTryTimeout,omitempty"`
  10709. // RetryConditions: Specfies one or more conditions when this retry rule
  10710. // applies. Valid values are:
  10711. // - 5xx: Loadbalancer will attempt a retry if the backend service
  10712. // responds with any 5xx response code, or if the backend service does
  10713. // not respond at all, example: disconnects, reset, read timeout,
  10714. // connection failure, and refused streams.
  10715. // - gateway-error: Similar to 5xx, but only applies to response codes
  10716. // 502, 503 or 504.
  10717. // -
  10718. // - connect-failure: Loadbalancer will retry on failures connecting to
  10719. // backend services, for example due to connection timeouts.
  10720. // - retriable-4xx: Loadbalancer will retry for retriable 4xx response
  10721. // codes. Currently the only retriable error supported is 409.
  10722. // - refused-stream:Loadbalancer will retry if the backend service
  10723. // resets the stream with a REFUSED_STREAM error code. This reset type
  10724. // indicates that it is safe to retry.
  10725. // - cancelledLoadbalancer will retry if the gRPC status code in the
  10726. // response header is set to cancelled
  10727. // - deadline-exceeded: Loadbalancer will retry if the gRPC status code
  10728. // in the response header is set to deadline-exceeded
  10729. // - resource-exhausted: Loadbalancer will retry if the gRPC status code
  10730. // in the response header is set to resource-exhausted
  10731. // - unavailable: Loadbalancer will retry if the gRPC status code in the
  10732. // response header is set to unavailable
  10733. RetryConditions []string `json:"retryConditions,omitempty"`
  10734. // ForceSendFields is a list of field names (e.g. "NumRetries") to
  10735. // unconditionally include in API requests. By default, fields with
  10736. // empty values are omitted from API requests. However, any non-pointer,
  10737. // non-interface field appearing in ForceSendFields will be sent to the
  10738. // server regardless of whether the field is empty or not. This may be
  10739. // used to include empty fields in Patch requests.
  10740. ForceSendFields []string `json:"-"`
  10741. // NullFields is a list of field names (e.g. "NumRetries") to include in
  10742. // API requests with the JSON null value. By default, fields with empty
  10743. // values are omitted from API requests. However, any field with an
  10744. // empty value appearing in NullFields will be sent to the server as
  10745. // null. It is an error if a field in this list has a non-empty value.
  10746. // This may be used to include null fields in Patch requests.
  10747. NullFields []string `json:"-"`
  10748. }
  10749. func (s *HttpRetryPolicy) MarshalJSON() ([]byte, error) {
  10750. type NoMethod HttpRetryPolicy
  10751. raw := NoMethod(*s)
  10752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10753. }
  10754. type HttpRouteAction struct {
  10755. // CorsPolicy: The specification for allowing client side cross-origin
  10756. // requests. Please see W3C Recommendation for Cross Origin Resource
  10757. // Sharing
  10758. CorsPolicy *CorsPolicy `json:"corsPolicy,omitempty"`
  10759. // FaultInjectionPolicy: The specification for fault injection
  10760. // introduced into traffic to test the resiliency of clients to backend
  10761. // service failure. As part of fault injection, when clients send
  10762. // requests to a backend service, delays can be introduced by
  10763. // Loadbalancer on a percentage of requests before sending those request
  10764. // to the backend service. Similarly requests from clients can be
  10765. // aborted by the Loadbalancer for a percentage of requests.
  10766. // timeout and retry_policy will be ignored by clients that are
  10767. // configured with a fault_injection_policy.
  10768. FaultInjectionPolicy *HttpFaultInjection `json:"faultInjectionPolicy,omitempty"`
  10769. // RequestMirrorPolicy: Specifies the policy on how requests intended
  10770. // for the route's backends are shadowed to a separate mirrored backend
  10771. // service. Loadbalancer does not wait for responses from the shadow
  10772. // service. Prior to sending traffic to the shadow service, the host /
  10773. // authority header is suffixed with -shadow.
  10774. RequestMirrorPolicy *RequestMirrorPolicy `json:"requestMirrorPolicy,omitempty"`
  10775. // RetryPolicy: Specifies the retry policy associated with this route.
  10776. RetryPolicy *HttpRetryPolicy `json:"retryPolicy,omitempty"`
  10777. // Timeout: Specifies the timeout for the selected route. Timeout is
  10778. // computed from the time the request is has been fully processed (i.e.
  10779. // end-of-stream) up until the response has been completely processed.
  10780. // Timeout includes all retries.
  10781. // If not specified, the default value is 15 seconds.
  10782. Timeout *Duration `json:"timeout,omitempty"`
  10783. // UrlRewrite: The spec to modify the URL of the request, prior to
  10784. // forwarding the request to the matched service
  10785. UrlRewrite *UrlRewrite `json:"urlRewrite,omitempty"`
  10786. // WeightedBackendServices: A list of weighted backend services to send
  10787. // traffic to when a route match occurs. The weights determine the
  10788. // fraction of traffic that flows to their corresponding backend
  10789. // service. If all traffic needs to go to a single backend service,
  10790. // there must be one weightedBackendService with weight set to a non 0
  10791. // number.
  10792. // Once a backendService is identified and before forwarding the request
  10793. // to the backend service, advanced routing actions like Url rewrites
  10794. // and header transformations are applied depending on additional
  10795. // settings specified in this HttpRouteAction.
  10796. WeightedBackendServices []*WeightedBackendService `json:"weightedBackendServices,omitempty"`
  10797. // ForceSendFields is a list of field names (e.g. "CorsPolicy") to
  10798. // unconditionally include in API requests. By default, fields with
  10799. // empty values are omitted from API requests. However, any non-pointer,
  10800. // non-interface field appearing in ForceSendFields will be sent to the
  10801. // server regardless of whether the field is empty or not. This may be
  10802. // used to include empty fields in Patch requests.
  10803. ForceSendFields []string `json:"-"`
  10804. // NullFields is a list of field names (e.g. "CorsPolicy") to include in
  10805. // API requests with the JSON null value. By default, fields with empty
  10806. // values are omitted from API requests. However, any field with an
  10807. // empty value appearing in NullFields will be sent to the server as
  10808. // null. It is an error if a field in this list has a non-empty value.
  10809. // This may be used to include null fields in Patch requests.
  10810. NullFields []string `json:"-"`
  10811. }
  10812. func (s *HttpRouteAction) MarshalJSON() ([]byte, error) {
  10813. type NoMethod HttpRouteAction
  10814. raw := NoMethod(*s)
  10815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10816. }
  10817. // HttpRouteRule: An HttpRouteRule specifies how to match an HTTP
  10818. // request and the corresponding routing action that load balancing
  10819. // proxies will perform.
  10820. type HttpRouteRule struct {
  10821. // HeaderAction: Specifies changes to request and response headers that
  10822. // need to take effect for the selected backendService.
  10823. // The headerAction specified here are applied before the matching
  10824. // pathMatchers[].headerAction and after
  10825. // pathMatchers[].routeRules[].routeAction.weightedBackendService.backend
  10826. // ServiceWeightAction[].headerAction
  10827. HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
  10828. MatchRules []*HttpRouteRuleMatch `json:"matchRules,omitempty"`
  10829. // RouteAction: In response to a matching matchRule, the load balancer
  10830. // performs advanced routing actions like URL rewrites, header
  10831. // transformations, etc. prior to forwarding the request to the selected
  10832. // backend. If routeAction specifies any weightedBackendServices,
  10833. // service must not be set. Conversely if service is set, routeAction
  10834. // cannot contain any weightedBackendServices.
  10835. // Only one of routeAction or urlRedirect must be set.
  10836. RouteAction *HttpRouteAction `json:"routeAction,omitempty"`
  10837. // Service: The full or partial URL of the backend service resource to
  10838. // which traffic is directed if this rule is matched. If routeAction is
  10839. // additionally specified, advanced routing actions like URL Rewrites,
  10840. // etc. take effect prior to sending the request to the backend.
  10841. // However, if service is specified, routeAction cannot contain any
  10842. // weightedBackendService s. Conversely, if routeAction specifies any
  10843. // weightedBackendServices, service must not be specified.
  10844. // Only one of urlRedirect, service or
  10845. // routeAction.weightedBackendService must be set.
  10846. Service string `json:"service,omitempty"`
  10847. // UrlRedirect: When this rule is matched, the request is redirected to
  10848. // a URL specified by urlRedirect.
  10849. // If urlRedirect is specified, service or routeAction must not be set.
  10850. UrlRedirect *HttpRedirectAction `json:"urlRedirect,omitempty"`
  10851. // ForceSendFields is a list of field names (e.g. "HeaderAction") to
  10852. // unconditionally include in API requests. By default, fields with
  10853. // empty values are omitted from API requests. However, any non-pointer,
  10854. // non-interface field appearing in ForceSendFields will be sent to the
  10855. // server regardless of whether the field is empty or not. This may be
  10856. // used to include empty fields in Patch requests.
  10857. ForceSendFields []string `json:"-"`
  10858. // NullFields is a list of field names (e.g. "HeaderAction") to include
  10859. // in API requests with the JSON null value. By default, fields with
  10860. // empty values are omitted from API requests. However, any field with
  10861. // an empty value appearing in NullFields will be sent to the server as
  10862. // null. It is an error if a field in this list has a non-empty value.
  10863. // This may be used to include null fields in Patch requests.
  10864. NullFields []string `json:"-"`
  10865. }
  10866. func (s *HttpRouteRule) MarshalJSON() ([]byte, error) {
  10867. type NoMethod HttpRouteRule
  10868. raw := NoMethod(*s)
  10869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10870. }
  10871. // HttpRouteRuleMatch: HttpRouteRuleMatch specifies a set of criteria
  10872. // for matching requests to an HttpRouteRule. All specified criteria
  10873. // must be satisfied for a match to occur.
  10874. type HttpRouteRuleMatch struct {
  10875. // FullPathMatch: For satifying the matchRule condition, the path of the
  10876. // request must exactly match the value specified in fullPathMatch after
  10877. // removing any query parameters and anchor that may be part of the
  10878. // original URL.
  10879. // FullPathMatch must be between 1 and 1024 characters.
  10880. // Only one of prefixMatch, fullPathMatch or regexMatch must be
  10881. // specified.
  10882. FullPathMatch string `json:"fullPathMatch,omitempty"`
  10883. // HeaderMatches: Specifies a list of header match criteria, all of
  10884. // which must match corresponding headers in the request.
  10885. HeaderMatches []*HttpHeaderMatch `json:"headerMatches,omitempty"`
  10886. // IgnoreCase: Specifies that prefixMatch and fullPathMatch matches are
  10887. // case sensitive.
  10888. // The default value is false.
  10889. // caseSensitive must not be used with regexMatch.
  10890. IgnoreCase bool `json:"ignoreCase,omitempty"`
  10891. // MetadataFilters: Opaque filter criteria used by Loadbalancer to
  10892. // restrict routing configuration to a limited set xDS compliant
  10893. // clients. In their xDS requests to Loadbalancer, xDS clients present
  10894. // node metadata. If a match takes place, the relevant routing
  10895. // configuration is made available to those proxies.
  10896. // For each metadataFilter in this list, if its filterMatchCriteria is
  10897. // set to MATCH_ANY, at least one of the filterLabels must match the
  10898. // corresponding label provided in the metadata. If its
  10899. // filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels
  10900. // must match with corresponding labels in the provided
  10901. // metadata.
  10902. // metadataFilters specified here can be overrides those specified in
  10903. // ForwardingRule that refers to this UrlMap.
  10904. // metadataFilters only applies to Loadbalancers that have their
  10905. // loadBalancingScheme set to INTERNAL_SELF_MANAGED.
  10906. MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`
  10907. // PrefixMatch: For satifying the matchRule condition, the request's
  10908. // path must begin with the specified prefixMatch. prefixMatch must
  10909. // begin with a /.
  10910. // The value must be between 1 and 1024 characters.
  10911. // Only one of prefixMatch, fullPathMatch or regexMatch must be
  10912. // specified.
  10913. PrefixMatch string `json:"prefixMatch,omitempty"`
  10914. // QueryParameterMatches: Specifies a list of query parameter match
  10915. // criteria, all of which must match corresponding query parameters in
  10916. // the request.
  10917. QueryParameterMatches []*HttpQueryParameterMatch `json:"queryParameterMatches,omitempty"`
  10918. // RegexMatch: For satifying the matchRule condition, the path of the
  10919. // request must satisfy the regular expression specified in regexMatch
  10920. // after removing any query parameters and anchor supplied with the
  10921. // original URL. For regular expression grammar please see
  10922. // en.cppreference.com/w/cpp/regex/ecmascript
  10923. // Only one of prefixMatch, fullPathMatch or regexMatch must be
  10924. // specified.
  10925. RegexMatch string `json:"regexMatch,omitempty"`
  10926. // ForceSendFields is a list of field names (e.g. "FullPathMatch") to
  10927. // unconditionally include in API requests. By default, fields with
  10928. // empty values are omitted from API requests. However, any non-pointer,
  10929. // non-interface field appearing in ForceSendFields will be sent to the
  10930. // server regardless of whether the field is empty or not. This may be
  10931. // used to include empty fields in Patch requests.
  10932. ForceSendFields []string `json:"-"`
  10933. // NullFields is a list of field names (e.g. "FullPathMatch") to include
  10934. // in API requests with the JSON null value. By default, fields with
  10935. // empty values are omitted from API requests. However, any field with
  10936. // an empty value appearing in NullFields will be sent to the server as
  10937. // null. It is an error if a field in this list has a non-empty value.
  10938. // This may be used to include null fields in Patch requests.
  10939. NullFields []string `json:"-"`
  10940. }
  10941. func (s *HttpRouteRuleMatch) MarshalJSON() ([]byte, error) {
  10942. type NoMethod HttpRouteRuleMatch
  10943. raw := NoMethod(*s)
  10944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10945. }
  10946. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  10947. // a template for how individual instances should be checked for health,
  10948. // via HTTPS.
  10949. type HttpsHealthCheck struct {
  10950. // CheckIntervalSec: How often (in seconds) to send a health check. The
  10951. // default value is 5 seconds.
  10952. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  10953. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10954. // format.
  10955. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10956. // Description: An optional description of this resource. Provide this
  10957. // property when you create the resource.
  10958. Description string `json:"description,omitempty"`
  10959. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  10960. // after this many consecutive successes. The default value is 2.
  10961. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  10962. // Host: The value of the host header in the HTTPS health check request.
  10963. // If left empty (default value), the public IP on behalf of which this
  10964. // health check is performed will be used.
  10965. Host string `json:"host,omitempty"`
  10966. // Id: [Output Only] The unique identifier for the resource. This
  10967. // identifier is defined by the server.
  10968. Id uint64 `json:"id,omitempty,string"`
  10969. // Kind: Type of the resource.
  10970. Kind string `json:"kind,omitempty"`
  10971. // Name: Name of the resource. Provided by the client when the resource
  10972. // is created. The name must be 1-63 characters long, and comply with
  10973. // RFC1035. Specifically, the name must be 1-63 characters long and
  10974. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10975. // the first character must be a lowercase letter, and all following
  10976. // characters must be a dash, lowercase letter, or digit, except the
  10977. // last character, which cannot be a dash.
  10978. Name string `json:"name,omitempty"`
  10979. // Port: The TCP port number for the HTTPS health check request. The
  10980. // default value is 443.
  10981. Port int64 `json:"port,omitempty"`
  10982. // RequestPath: The request path of the HTTPS health check request. The
  10983. // default value is "/".
  10984. RequestPath string `json:"requestPath,omitempty"`
  10985. // SelfLink: [Output Only] Server-defined URL for the resource.
  10986. SelfLink string `json:"selfLink,omitempty"`
  10987. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  10988. // with the resource id.
  10989. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  10990. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  10991. // The default value is 5 seconds. It is invalid for timeoutSec to have
  10992. // a greater value than checkIntervalSec.
  10993. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  10994. // UnhealthyThreshold: A so-far healthy instance will be marked
  10995. // unhealthy after this many consecutive failures. The default value is
  10996. // 2.
  10997. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  10998. // ServerResponse contains the HTTP response code and headers from the
  10999. // server.
  11000. googleapi.ServerResponse `json:"-"`
  11001. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  11002. // unconditionally include in API requests. By default, fields with
  11003. // empty values are omitted from API requests. However, any non-pointer,
  11004. // non-interface field appearing in ForceSendFields will be sent to the
  11005. // server regardless of whether the field is empty or not. This may be
  11006. // used to include empty fields in Patch requests.
  11007. ForceSendFields []string `json:"-"`
  11008. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  11009. // include in API requests with the JSON null value. By default, fields
  11010. // with empty values are omitted from API requests. However, any field
  11011. // with an empty value appearing in NullFields will be sent to the
  11012. // server as null. It is an error if a field in this list has a
  11013. // non-empty value. This may be used to include null fields in Patch
  11014. // requests.
  11015. NullFields []string `json:"-"`
  11016. }
  11017. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  11018. type NoMethod HttpsHealthCheck
  11019. raw := NoMethod(*s)
  11020. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11021. }
  11022. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  11023. type HttpsHealthCheckList struct {
  11024. // Id: [Output Only] Unique identifier for the resource; defined by the
  11025. // server.
  11026. Id string `json:"id,omitempty"`
  11027. // Items: A list of HttpsHealthCheck resources.
  11028. Items []*HttpsHealthCheck `json:"items,omitempty"`
  11029. // Kind: Type of resource.
  11030. Kind string `json:"kind,omitempty"`
  11031. // NextPageToken: [Output Only] This token allows you to get the next
  11032. // page of results for list requests. If the number of results is larger
  11033. // than maxResults, use the nextPageToken as a value for the query
  11034. // parameter pageToken in the next list request. Subsequent list
  11035. // requests will have their own nextPageToken to continue paging through
  11036. // the results.
  11037. NextPageToken string `json:"nextPageToken,omitempty"`
  11038. // SelfLink: [Output Only] Server-defined URL for this resource.
  11039. SelfLink string `json:"selfLink,omitempty"`
  11040. // Warning: [Output Only] Informational warning message.
  11041. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  11042. // ServerResponse contains the HTTP response code and headers from the
  11043. // server.
  11044. googleapi.ServerResponse `json:"-"`
  11045. // ForceSendFields is a list of field names (e.g. "Id") to
  11046. // unconditionally include in API requests. By default, fields with
  11047. // empty values are omitted from API requests. However, any non-pointer,
  11048. // non-interface field appearing in ForceSendFields will be sent to the
  11049. // server regardless of whether the field is empty or not. This may be
  11050. // used to include empty fields in Patch requests.
  11051. ForceSendFields []string `json:"-"`
  11052. // NullFields is a list of field names (e.g. "Id") to include in API
  11053. // requests with the JSON null value. By default, fields with empty
  11054. // values are omitted from API requests. However, any field with an
  11055. // empty value appearing in NullFields will be sent to the server as
  11056. // null. It is an error if a field in this list has a non-empty value.
  11057. // This may be used to include null fields in Patch requests.
  11058. NullFields []string `json:"-"`
  11059. }
  11060. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  11061. type NoMethod HttpsHealthCheckList
  11062. raw := NoMethod(*s)
  11063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11064. }
  11065. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  11066. // message.
  11067. type HttpsHealthCheckListWarning struct {
  11068. // Code: [Output Only] A warning code, if applicable. For example,
  11069. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11070. // the response.
  11071. //
  11072. // Possible values:
  11073. // "CLEANUP_FAILED"
  11074. // "DEPRECATED_RESOURCE_USED"
  11075. // "DEPRECATED_TYPE_USED"
  11076. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11077. // "EXPERIMENTAL_TYPE_USED"
  11078. // "EXTERNAL_API_WARNING"
  11079. // "FIELD_VALUE_OVERRIDEN"
  11080. // "INJECTED_KERNELS_DEPRECATED"
  11081. // "MISSING_TYPE_DEPENDENCY"
  11082. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11083. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11084. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11085. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11086. // "NEXT_HOP_NOT_RUNNING"
  11087. // "NOT_CRITICAL_ERROR"
  11088. // "NO_RESULTS_ON_PAGE"
  11089. // "REQUIRED_TOS_AGREEMENT"
  11090. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11091. // "RESOURCE_NOT_DELETED"
  11092. // "SCHEMA_VALIDATION_IGNORED"
  11093. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11094. // "UNDECLARED_PROPERTIES"
  11095. // "UNREACHABLE"
  11096. Code string `json:"code,omitempty"`
  11097. // Data: [Output Only] Metadata about this warning in key: value format.
  11098. // For example:
  11099. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11100. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  11101. // Message: [Output Only] A human-readable description of the warning
  11102. // code.
  11103. Message string `json:"message,omitempty"`
  11104. // ForceSendFields is a list of field names (e.g. "Code") to
  11105. // unconditionally include in API requests. By default, fields with
  11106. // empty values are omitted from API requests. However, any non-pointer,
  11107. // non-interface field appearing in ForceSendFields will be sent to the
  11108. // server regardless of whether the field is empty or not. This may be
  11109. // used to include empty fields in Patch requests.
  11110. ForceSendFields []string `json:"-"`
  11111. // NullFields is a list of field names (e.g. "Code") to include in API
  11112. // requests with the JSON null value. By default, fields with empty
  11113. // values are omitted from API requests. However, any field with an
  11114. // empty value appearing in NullFields will be sent to the server as
  11115. // null. It is an error if a field in this list has a non-empty value.
  11116. // This may be used to include null fields in Patch requests.
  11117. NullFields []string `json:"-"`
  11118. }
  11119. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  11120. type NoMethod HttpsHealthCheckListWarning
  11121. raw := NoMethod(*s)
  11122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11123. }
  11124. type HttpsHealthCheckListWarningData struct {
  11125. // Key: [Output Only] A key that provides more detail on the warning
  11126. // being returned. For example, for warnings where there are no results
  11127. // in a list request for a particular zone, this key might be scope and
  11128. // the key value might be the zone name. Other examples might be a key
  11129. // indicating a deprecated resource and a suggested replacement, or a
  11130. // warning about invalid network settings (for example, if an instance
  11131. // attempts to perform IP forwarding but is not enabled for IP
  11132. // forwarding).
  11133. Key string `json:"key,omitempty"`
  11134. // Value: [Output Only] A warning data value corresponding to the key.
  11135. Value string `json:"value,omitempty"`
  11136. // ForceSendFields is a list of field names (e.g. "Key") to
  11137. // unconditionally include in API requests. By default, fields with
  11138. // empty values are omitted from API requests. However, any non-pointer,
  11139. // non-interface field appearing in ForceSendFields will be sent to the
  11140. // server regardless of whether the field is empty or not. This may be
  11141. // used to include empty fields in Patch requests.
  11142. ForceSendFields []string `json:"-"`
  11143. // NullFields is a list of field names (e.g. "Key") to include in API
  11144. // requests with the JSON null value. By default, fields with empty
  11145. // values are omitted from API requests. However, any field with an
  11146. // empty value appearing in NullFields will be sent to the server as
  11147. // null. It is an error if a field in this list has a non-empty value.
  11148. // This may be used to include null fields in Patch requests.
  11149. NullFields []string `json:"-"`
  11150. }
  11151. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  11152. type NoMethod HttpsHealthCheckListWarningData
  11153. raw := NoMethod(*s)
  11154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11155. }
  11156. // Image: An Image resource. (== resource_for beta.images ==) (==
  11157. // resource_for v1.images ==)
  11158. type Image struct {
  11159. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  11160. // Cloud Storage (in bytes).
  11161. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  11162. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11163. // format.
  11164. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11165. // Deprecated: The deprecation status associated with this image.
  11166. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  11167. // Description: An optional description of this resource. Provide this
  11168. // property when you create the resource.
  11169. Description string `json:"description,omitempty"`
  11170. // DiskSizeGb: Size of the image when restored onto a persistent disk
  11171. // (in GB).
  11172. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  11173. // Family: The name of the image family to which this image belongs. You
  11174. // can create disks by specifying an image family instead of a specific
  11175. // image name. The image family always returns its latest image that is
  11176. // not deprecated. The name of the image family must comply with
  11177. // RFC1035.
  11178. Family string `json:"family,omitempty"`
  11179. // GuestOsFeatures: A list of features to enable on the guest operating
  11180. // system. Applicable only for bootable images. Read Enabling guest
  11181. // operating system features to see a list of available options.
  11182. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  11183. // Id: [Output Only] The unique identifier for the resource. This
  11184. // identifier is defined by the server.
  11185. Id uint64 `json:"id,omitempty,string"`
  11186. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  11187. // encryption key.
  11188. //
  11189. // After you encrypt an image with a customer-supplied key, you must
  11190. // provide the same key if you use the image later (e.g. to create a
  11191. // disk from the image).
  11192. //
  11193. // Customer-supplied encryption keys do not protect access to metadata
  11194. // of the disk.
  11195. //
  11196. // If you do not provide an encryption key when creating the image, then
  11197. // the disk will be encrypted using an automatically generated key and
  11198. // you do not need to provide a key to use the image later.
  11199. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  11200. // Kind: [Output Only] Type of the resource. Always compute#image for
  11201. // images.
  11202. Kind string `json:"kind,omitempty"`
  11203. // LabelFingerprint: A fingerprint for the labels being applied to this
  11204. // image, which is essentially a hash of the labels used for optimistic
  11205. // locking. The fingerprint is initially generated by Compute Engine and
  11206. // changes after every request to modify or update labels. You must
  11207. // always provide an up-to-date fingerprint hash in order to update or
  11208. // change labels, otherwise the request will fail with error 412
  11209. // conditionNotMet.
  11210. //
  11211. // To see the latest fingerprint, make a get() request to retrieve an
  11212. // image.
  11213. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  11214. // Labels: Labels to apply to this image. These can be later modified by
  11215. // the setLabels method.
  11216. Labels map[string]string `json:"labels,omitempty"`
  11217. // LicenseCodes: Integer license codes indicating which licenses are
  11218. // attached to this image.
  11219. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  11220. // Licenses: Any applicable license URI.
  11221. Licenses []string `json:"licenses,omitempty"`
  11222. // Name: Name of the resource; provided by the client when the resource
  11223. // is created. The name must be 1-63 characters long, and comply with
  11224. // RFC1035. Specifically, the name must be 1-63 characters long and
  11225. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  11226. // the first character must be a lowercase letter, and all following
  11227. // characters must be a dash, lowercase letter, or digit, except the
  11228. // last character, which cannot be a dash.
  11229. Name string `json:"name,omitempty"`
  11230. // RawDisk: The parameters of the raw disk image.
  11231. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  11232. // SelfLink: [Output Only] Server-defined URL for the resource.
  11233. SelfLink string `json:"selfLink,omitempty"`
  11234. // SelfLinkWithId: [Output Only] Server-defined URL for this resource's
  11235. // resource id.
  11236. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  11237. // ShieldedInstanceInitialState: Set the secure boot keys of shielded
  11238. // instance.
  11239. ShieldedInstanceInitialState *InitialStateConfig `json:"shieldedInstanceInitialState,omitempty"`
  11240. // SourceDisk: URL of the source disk used to create this image. This
  11241. // can be a full or valid partial URL. You must provide either this
  11242. // property or the rawDisk.source property but not both to create an
  11243. // image. For example, the following are valid values:
  11244. // -
  11245. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  11246. // - projects/project/zones/zone/disks/disk
  11247. // - zones/zone/disks/disk
  11248. SourceDisk string `json:"sourceDisk,omitempty"`
  11249. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  11250. // source disk. Required if the source disk is protected by a
  11251. // customer-supplied encryption key.
  11252. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  11253. // SourceDiskId: [Output Only] The ID value of the disk used to create
  11254. // this image. This value may be used to determine whether the image was
  11255. // taken from the current or a previous instance of a given disk name.
  11256. SourceDiskId string `json:"sourceDiskId,omitempty"`
  11257. // SourceImage: URL of the source image used to create this image. This
  11258. // can be a full or valid partial URL. You must provide exactly one of:
  11259. //
  11260. // - this property, or
  11261. // - the rawDisk.source property, or
  11262. // - the sourceDisk property in order to create an image.
  11263. SourceImage string `json:"sourceImage,omitempty"`
  11264. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  11265. // source image. Required if the source image is protected by a
  11266. // customer-supplied encryption key.
  11267. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  11268. // SourceImageId: [Output Only] The ID value of the image used to create
  11269. // this image. This value may be used to determine whether the image was
  11270. // taken from the current or a previous instance of a given image name.
  11271. SourceImageId string `json:"sourceImageId,omitempty"`
  11272. // SourceSnapshot: URL of the source snapshot used to create this image.
  11273. // This can be a full or valid partial URL. You must provide exactly one
  11274. // of:
  11275. // - this property, or
  11276. // - the sourceImage property, or
  11277. // - the rawDisk.source property, or
  11278. // - the sourceDisk property in order to create an image.
  11279. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  11280. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  11281. // the source snapshot. Required if the source snapshot is protected by
  11282. // a customer-supplied encryption key.
  11283. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  11284. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  11285. // create this image. This value may be used to determine whether the
  11286. // snapshot was taken from the current or a previous instance of a given
  11287. // snapshot name.
  11288. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  11289. // SourceType: The type of the image used to create this disk. The
  11290. // default and only value is RAW
  11291. //
  11292. // Possible values:
  11293. // "RAW" (default)
  11294. SourceType string `json:"sourceType,omitempty"`
  11295. // Status: [Output Only] The status of the image. An image can be used
  11296. // to create other resources, such as instances, only after the image
  11297. // has been successfully created and the status is set to READY.
  11298. // Possible values are FAILED, PENDING, or READY.
  11299. //
  11300. // Possible values:
  11301. // "DELETING"
  11302. // "FAILED"
  11303. // "PENDING"
  11304. // "READY"
  11305. Status string `json:"status,omitempty"`
  11306. // StorageLocations: GCS bucket storage location of the image (regional
  11307. // or multi-regional).
  11308. StorageLocations []string `json:"storageLocations,omitempty"`
  11309. // ServerResponse contains the HTTP response code and headers from the
  11310. // server.
  11311. googleapi.ServerResponse `json:"-"`
  11312. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  11313. // unconditionally include in API requests. By default, fields with
  11314. // empty values are omitted from API requests. However, any non-pointer,
  11315. // non-interface field appearing in ForceSendFields will be sent to the
  11316. // server regardless of whether the field is empty or not. This may be
  11317. // used to include empty fields in Patch requests.
  11318. ForceSendFields []string `json:"-"`
  11319. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  11320. // include in API requests with the JSON null value. By default, fields
  11321. // with empty values are omitted from API requests. However, any field
  11322. // with an empty value appearing in NullFields will be sent to the
  11323. // server as null. It is an error if a field in this list has a
  11324. // non-empty value. This may be used to include null fields in Patch
  11325. // requests.
  11326. NullFields []string `json:"-"`
  11327. }
  11328. func (s *Image) MarshalJSON() ([]byte, error) {
  11329. type NoMethod Image
  11330. raw := NoMethod(*s)
  11331. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11332. }
  11333. // ImageRawDisk: The parameters of the raw disk image.
  11334. type ImageRawDisk struct {
  11335. // ContainerType: The format used to encode and transmit the block
  11336. // device, which should be TAR. This is just a container and
  11337. // transmission format and not a runtime format. Provided by the client
  11338. // when the disk image is created.
  11339. //
  11340. // Possible values:
  11341. // "TAR"
  11342. ContainerType string `json:"containerType,omitempty"`
  11343. // Sha1Checksum: [Deprecated] This field is deprecated. An optional SHA1
  11344. // checksum of the disk image before unpackaging provided by the client
  11345. // when the disk image is created.
  11346. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  11347. // Source: The full Google Cloud Storage URL where the disk image is
  11348. // stored. You must provide either this property or the sourceDisk
  11349. // property but not both.
  11350. Source string `json:"source,omitempty"`
  11351. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  11352. // unconditionally include in API requests. By default, fields with
  11353. // empty values are omitted from API requests. However, any non-pointer,
  11354. // non-interface field appearing in ForceSendFields will be sent to the
  11355. // server regardless of whether the field is empty or not. This may be
  11356. // used to include empty fields in Patch requests.
  11357. ForceSendFields []string `json:"-"`
  11358. // NullFields is a list of field names (e.g. "ContainerType") to include
  11359. // in API requests with the JSON null value. By default, fields with
  11360. // empty values are omitted from API requests. However, any field with
  11361. // an empty value appearing in NullFields will be sent to the server as
  11362. // null. It is an error if a field in this list has a non-empty value.
  11363. // This may be used to include null fields in Patch requests.
  11364. NullFields []string `json:"-"`
  11365. }
  11366. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  11367. type NoMethod ImageRawDisk
  11368. raw := NoMethod(*s)
  11369. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11370. }
  11371. // ImageList: Contains a list of images.
  11372. type ImageList struct {
  11373. // Id: [Output Only] Unique identifier for the resource; defined by the
  11374. // server.
  11375. Id string `json:"id,omitempty"`
  11376. // Items: A list of Image resources.
  11377. Items []*Image `json:"items,omitempty"`
  11378. // Kind: Type of resource.
  11379. Kind string `json:"kind,omitempty"`
  11380. // NextPageToken: [Output Only] This token allows you to get the next
  11381. // page of results for list requests. If the number of results is larger
  11382. // than maxResults, use the nextPageToken as a value for the query
  11383. // parameter pageToken in the next list request. Subsequent list
  11384. // requests will have their own nextPageToken to continue paging through
  11385. // the results.
  11386. NextPageToken string `json:"nextPageToken,omitempty"`
  11387. // SelfLink: [Output Only] Server-defined URL for this resource.
  11388. SelfLink string `json:"selfLink,omitempty"`
  11389. // Warning: [Output Only] Informational warning message.
  11390. Warning *ImageListWarning `json:"warning,omitempty"`
  11391. // ServerResponse contains the HTTP response code and headers from the
  11392. // server.
  11393. googleapi.ServerResponse `json:"-"`
  11394. // ForceSendFields is a list of field names (e.g. "Id") to
  11395. // unconditionally include in API requests. By default, fields with
  11396. // empty values are omitted from API requests. However, any non-pointer,
  11397. // non-interface field appearing in ForceSendFields will be sent to the
  11398. // server regardless of whether the field is empty or not. This may be
  11399. // used to include empty fields in Patch requests.
  11400. ForceSendFields []string `json:"-"`
  11401. // NullFields is a list of field names (e.g. "Id") to include in API
  11402. // requests with the JSON null value. By default, fields with empty
  11403. // values are omitted from API requests. However, any field with an
  11404. // empty value appearing in NullFields will be sent to the server as
  11405. // null. It is an error if a field in this list has a non-empty value.
  11406. // This may be used to include null fields in Patch requests.
  11407. NullFields []string `json:"-"`
  11408. }
  11409. func (s *ImageList) MarshalJSON() ([]byte, error) {
  11410. type NoMethod ImageList
  11411. raw := NoMethod(*s)
  11412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11413. }
  11414. // ImageListWarning: [Output Only] Informational warning message.
  11415. type ImageListWarning struct {
  11416. // Code: [Output Only] A warning code, if applicable. For example,
  11417. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11418. // the response.
  11419. //
  11420. // Possible values:
  11421. // "CLEANUP_FAILED"
  11422. // "DEPRECATED_RESOURCE_USED"
  11423. // "DEPRECATED_TYPE_USED"
  11424. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11425. // "EXPERIMENTAL_TYPE_USED"
  11426. // "EXTERNAL_API_WARNING"
  11427. // "FIELD_VALUE_OVERRIDEN"
  11428. // "INJECTED_KERNELS_DEPRECATED"
  11429. // "MISSING_TYPE_DEPENDENCY"
  11430. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11431. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11432. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11433. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11434. // "NEXT_HOP_NOT_RUNNING"
  11435. // "NOT_CRITICAL_ERROR"
  11436. // "NO_RESULTS_ON_PAGE"
  11437. // "REQUIRED_TOS_AGREEMENT"
  11438. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11439. // "RESOURCE_NOT_DELETED"
  11440. // "SCHEMA_VALIDATION_IGNORED"
  11441. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11442. // "UNDECLARED_PROPERTIES"
  11443. // "UNREACHABLE"
  11444. Code string `json:"code,omitempty"`
  11445. // Data: [Output Only] Metadata about this warning in key: value format.
  11446. // For example:
  11447. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11448. Data []*ImageListWarningData `json:"data,omitempty"`
  11449. // Message: [Output Only] A human-readable description of the warning
  11450. // code.
  11451. Message string `json:"message,omitempty"`
  11452. // ForceSendFields is a list of field names (e.g. "Code") to
  11453. // unconditionally include in API requests. By default, fields with
  11454. // empty values are omitted from API requests. However, any non-pointer,
  11455. // non-interface field appearing in ForceSendFields will be sent to the
  11456. // server regardless of whether the field is empty or not. This may be
  11457. // used to include empty fields in Patch requests.
  11458. ForceSendFields []string `json:"-"`
  11459. // NullFields is a list of field names (e.g. "Code") to include in API
  11460. // requests with the JSON null value. By default, fields with empty
  11461. // values are omitted from API requests. However, any field with an
  11462. // empty value appearing in NullFields will be sent to the server as
  11463. // null. It is an error if a field in this list has a non-empty value.
  11464. // This may be used to include null fields in Patch requests.
  11465. NullFields []string `json:"-"`
  11466. }
  11467. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  11468. type NoMethod ImageListWarning
  11469. raw := NoMethod(*s)
  11470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11471. }
  11472. type ImageListWarningData struct {
  11473. // Key: [Output Only] A key that provides more detail on the warning
  11474. // being returned. For example, for warnings where there are no results
  11475. // in a list request for a particular zone, this key might be scope and
  11476. // the key value might be the zone name. Other examples might be a key
  11477. // indicating a deprecated resource and a suggested replacement, or a
  11478. // warning about invalid network settings (for example, if an instance
  11479. // attempts to perform IP forwarding but is not enabled for IP
  11480. // forwarding).
  11481. Key string `json:"key,omitempty"`
  11482. // Value: [Output Only] A warning data value corresponding to the key.
  11483. Value string `json:"value,omitempty"`
  11484. // ForceSendFields is a list of field names (e.g. "Key") to
  11485. // unconditionally include in API requests. By default, fields with
  11486. // empty values are omitted from API requests. However, any non-pointer,
  11487. // non-interface field appearing in ForceSendFields will be sent to the
  11488. // server regardless of whether the field is empty or not. This may be
  11489. // used to include empty fields in Patch requests.
  11490. ForceSendFields []string `json:"-"`
  11491. // NullFields is a list of field names (e.g. "Key") to include in API
  11492. // requests with the JSON null value. By default, fields with empty
  11493. // values are omitted from API requests. However, any field with an
  11494. // empty value appearing in NullFields will be sent to the server as
  11495. // null. It is an error if a field in this list has a non-empty value.
  11496. // This may be used to include null fields in Patch requests.
  11497. NullFields []string `json:"-"`
  11498. }
  11499. func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
  11500. type NoMethod ImageListWarningData
  11501. raw := NoMethod(*s)
  11502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11503. }
  11504. // InitialStateConfig: Initial State for shielded instance, these are
  11505. // public keys which are safe to store in public
  11506. type InitialStateConfig struct {
  11507. // Dbs: The Key Database (db).
  11508. Dbs []*FileContentBuffer `json:"dbs,omitempty"`
  11509. // Dbxs: The forbidden key database (dbx).
  11510. Dbxs []*FileContentBuffer `json:"dbxs,omitempty"`
  11511. // Keks: The Key Exchange Key (KEK).
  11512. Keks []*FileContentBuffer `json:"keks,omitempty"`
  11513. // Pk: The Platform Key (PK).
  11514. Pk *FileContentBuffer `json:"pk,omitempty"`
  11515. // ForceSendFields is a list of field names (e.g. "Dbs") to
  11516. // unconditionally include in API requests. By default, fields with
  11517. // empty values are omitted from API requests. However, any non-pointer,
  11518. // non-interface field appearing in ForceSendFields will be sent to the
  11519. // server regardless of whether the field is empty or not. This may be
  11520. // used to include empty fields in Patch requests.
  11521. ForceSendFields []string `json:"-"`
  11522. // NullFields is a list of field names (e.g. "Dbs") to include in API
  11523. // requests with the JSON null value. By default, fields with empty
  11524. // values are omitted from API requests. However, any field with an
  11525. // empty value appearing in NullFields will be sent to the server as
  11526. // null. It is an error if a field in this list has a non-empty value.
  11527. // This may be used to include null fields in Patch requests.
  11528. NullFields []string `json:"-"`
  11529. }
  11530. func (s *InitialStateConfig) MarshalJSON() ([]byte, error) {
  11531. type NoMethod InitialStateConfig
  11532. raw := NoMethod(*s)
  11533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11534. }
  11535. // Instance: An Instance resource. (== resource_for beta.instances ==)
  11536. // (== resource_for v1.instances ==)
  11537. type Instance struct {
  11538. // CanIpForward: Allows this instance to send and receive packets with
  11539. // non-matching destination or source IPs. This is required if you plan
  11540. // to use this instance to forward routes. For more information, see
  11541. // Enabling IP Forwarding.
  11542. CanIpForward bool `json:"canIpForward,omitempty"`
  11543. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  11544. CpuPlatform string `json:"cpuPlatform,omitempty"`
  11545. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11546. // format.
  11547. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11548. // DeletionProtection: Whether the resource should be protected against
  11549. // deletion.
  11550. DeletionProtection bool `json:"deletionProtection,omitempty"`
  11551. // Description: An optional description of this resource. Provide this
  11552. // property when you create the resource.
  11553. Description string `json:"description,omitempty"`
  11554. // Disks: Array of disks associated with this instance. Persistent disks
  11555. // must be created before you can assign them.
  11556. Disks []*AttachedDisk `json:"disks,omitempty"`
  11557. // DisplayDevice: Enables display device for the instance.
  11558. DisplayDevice *DisplayDevice `json:"displayDevice,omitempty"`
  11559. // GuestAccelerators: A list of the type and count of accelerator cards
  11560. // attached to the instance.
  11561. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  11562. Hostname string `json:"hostname,omitempty"`
  11563. // Id: [Output Only] The unique identifier for the resource. This
  11564. // identifier is defined by the server.
  11565. Id uint64 `json:"id,omitempty,string"`
  11566. // InstanceEncryptionKey: Encrypts or decrypts data for an instance with
  11567. // a customer-supplied encryption key.
  11568. //
  11569. // If you are creating a new instance, this field encrypts the local SSD
  11570. // and in-memory contents of the instance using a key that you
  11571. // provide.
  11572. //
  11573. // If you are restarting an instance protected with a customer-supplied
  11574. // encryption key, you must provide the correct key in order to
  11575. // successfully restart the instance.
  11576. //
  11577. // If you do not provide an encryption key when creating the instance,
  11578. // then the local SSD and in-memory contents will be encrypted using an
  11579. // automatically generated key and you do not need to provide a key to
  11580. // start the instance later.
  11581. //
  11582. // Instance templates do not store customer-supplied encryption keys, so
  11583. // you cannot use your own keys to encrypt local SSDs and in-memory
  11584. // content in a managed instance group.
  11585. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  11586. // Kind: [Output Only] Type of the resource. Always compute#instance for
  11587. // instances.
  11588. Kind string `json:"kind,omitempty"`
  11589. // LabelFingerprint: A fingerprint for this request, which is
  11590. // essentially a hash of the label's contents and used for optimistic
  11591. // locking. The fingerprint is initially generated by Compute Engine and
  11592. // changes after every request to modify or update labels. You must
  11593. // always provide an up-to-date fingerprint hash in order to update or
  11594. // change labels.
  11595. //
  11596. // To see the latest fingerprint, make get() request to the instance.
  11597. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  11598. // Labels: Labels to apply to this instance. These can be later modified
  11599. // by the setLabels method.
  11600. Labels map[string]string `json:"labels,omitempty"`
  11601. // MachineType: Full or partial URL of the machine type resource to use
  11602. // for this instance, in the format:
  11603. // zones/zone/machineTypes/machine-type. This is provided by the client
  11604. // when the instance is created. For example, the following is a valid
  11605. // partial url to a predefined machine
  11606. // type:
  11607. // zones/us-central1-f/machineTypes/n1-standard-1
  11608. //
  11609. //
  11610. // To create a custom machine type, provide a URL to a machine type in
  11611. // the following format, where CPUS is 1 or an even number up to 32 (2,
  11612. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  11613. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  11614. // 5 GB of memory is 5120
  11615. // MB):
  11616. // zones/zone/machineTypes/custom-CPUS-MEMORY
  11617. //
  11618. //
  11619. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  11620. //
  11621. // For a full list of restrictions, read the Specifications for custom
  11622. // machine types.
  11623. MachineType string `json:"machineType,omitempty"`
  11624. // Metadata: The metadata key/value pairs assigned to this instance.
  11625. // This includes custom metadata and predefined keys.
  11626. Metadata *Metadata `json:"metadata,omitempty"`
  11627. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  11628. // Applicable values are the friendly names of CPU platforms, such as
  11629. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  11630. // Bridge".
  11631. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  11632. // Name: The name of the resource, provided by the client when initially
  11633. // creating the resource. The resource name must be 1-63 characters
  11634. // long, and comply with RFC1035. Specifically, the name must be 1-63
  11635. // characters long and match the regular expression
  11636. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  11637. // a lowercase letter, and all following characters must be a dash,
  11638. // lowercase letter, or digit, except the last character, which cannot
  11639. // be a dash.
  11640. Name string `json:"name,omitempty"`
  11641. // NetworkInterfaces: An array of network configurations for this
  11642. // instance. These specify how interfaces are configured to interact
  11643. // with other network services, such as connecting to the internet.
  11644. // Multiple interfaces are supported per instance.
  11645. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  11646. // PreservedStateSizeGb: Total amount of preserved state for SUSPENDED
  11647. // instances. Read-only in the api.
  11648. PreservedStateSizeGb int64 `json:"preservedStateSizeGb,omitempty,string"`
  11649. // ReservationAffinity: The configuration of desired reservations from
  11650. // which this Instance can consume capacity from.
  11651. ReservationAffinity *ReservationAffinity `json:"reservationAffinity,omitempty"`
  11652. // ResourcePolicies: Resource policies applied to this instance.
  11653. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  11654. // Scheduling: Sets the scheduling options for this instance.
  11655. Scheduling *Scheduling `json:"scheduling,omitempty"`
  11656. // SelfLink: [Output Only] Server-defined URL for this resource.
  11657. SelfLink string `json:"selfLink,omitempty"`
  11658. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  11659. // with the resource id.
  11660. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  11661. // ServiceAccounts: A list of service accounts, with their specified
  11662. // scopes, authorized for this instance. Only one service account per VM
  11663. // instance is supported.
  11664. //
  11665. // Service accounts generate access tokens that can be accessed through
  11666. // the metadata server and used to authenticate applications on the
  11667. // instance. See Service Accounts for more information.
  11668. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  11669. ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
  11670. ShieldedInstanceIntegrityPolicy *ShieldedInstanceIntegrityPolicy `json:"shieldedInstanceIntegrityPolicy,omitempty"`
  11671. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  11672. ShieldedVmIntegrityPolicy *ShieldedVmIntegrityPolicy `json:"shieldedVmIntegrityPolicy,omitempty"`
  11673. // SourceMachineImage: Source machine image
  11674. SourceMachineImage string `json:"sourceMachineImage,omitempty"`
  11675. // SourceMachineImageEncryptionKey: Source GMI encryption key when
  11676. // creating an instance from GMI.
  11677. SourceMachineImageEncryptionKey *CustomerEncryptionKey `json:"sourceMachineImageEncryptionKey,omitempty"`
  11678. // StartRestricted: [Output Only] Whether a VM has been restricted for
  11679. // start because Compute Engine has detected suspicious activity.
  11680. StartRestricted bool `json:"startRestricted,omitempty"`
  11681. // Status: [Output Only] The status of the instance. One of the
  11682. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  11683. // SUSPENDING, SUSPENDED, and TERMINATED.
  11684. //
  11685. // Possible values:
  11686. // "PROVISIONING"
  11687. // "REPAIRING"
  11688. // "RUNNING"
  11689. // "STAGING"
  11690. // "STOPPED"
  11691. // "STOPPING"
  11692. // "SUSPENDED"
  11693. // "SUSPENDING"
  11694. // "TERMINATED"
  11695. Status string `json:"status,omitempty"`
  11696. // StatusMessage: [Output Only] An optional, human-readable explanation
  11697. // of the status.
  11698. StatusMessage string `json:"statusMessage,omitempty"`
  11699. // Tags: Tags to apply to this instance. Tags are used to identify valid
  11700. // sources or targets for network firewalls and are specified by the
  11701. // client during instance creation. The tags can be later modified by
  11702. // the setTags method. Each tag within the list must comply with
  11703. // RFC1035. Multiple tags can be specified via the 'tags.items' field.
  11704. Tags *Tags `json:"tags,omitempty"`
  11705. // Zone: [Output Only] URL of the zone where the instance resides. You
  11706. // must specify this field as part of the HTTP request URL. It is not
  11707. // settable as a field in the request body.
  11708. Zone string `json:"zone,omitempty"`
  11709. // ServerResponse contains the HTTP response code and headers from the
  11710. // server.
  11711. googleapi.ServerResponse `json:"-"`
  11712. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  11713. // unconditionally include in API requests. By default, fields with
  11714. // empty values are omitted from API requests. However, any non-pointer,
  11715. // non-interface field appearing in ForceSendFields will be sent to the
  11716. // server regardless of whether the field is empty or not. This may be
  11717. // used to include empty fields in Patch requests.
  11718. ForceSendFields []string `json:"-"`
  11719. // NullFields is a list of field names (e.g. "CanIpForward") to include
  11720. // in API requests with the JSON null value. By default, fields with
  11721. // empty values are omitted from API requests. However, any field with
  11722. // an empty value appearing in NullFields will be sent to the server as
  11723. // null. It is an error if a field in this list has a non-empty value.
  11724. // This may be used to include null fields in Patch requests.
  11725. NullFields []string `json:"-"`
  11726. }
  11727. func (s *Instance) MarshalJSON() ([]byte, error) {
  11728. type NoMethod Instance
  11729. raw := NoMethod(*s)
  11730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11731. }
  11732. type InstanceAggregatedList struct {
  11733. // Id: [Output Only] Unique identifier for the resource; defined by the
  11734. // server.
  11735. Id string `json:"id,omitempty"`
  11736. // Items: A list of InstancesScopedList resources.
  11737. Items map[string]InstancesScopedList `json:"items,omitempty"`
  11738. // Kind: [Output Only] Type of resource. Always
  11739. // compute#instanceAggregatedList for aggregated lists of Instance
  11740. // resources.
  11741. Kind string `json:"kind,omitempty"`
  11742. // NextPageToken: [Output Only] This token allows you to get the next
  11743. // page of results for list requests. If the number of results is larger
  11744. // than maxResults, use the nextPageToken as a value for the query
  11745. // parameter pageToken in the next list request. Subsequent list
  11746. // requests will have their own nextPageToken to continue paging through
  11747. // the results.
  11748. NextPageToken string `json:"nextPageToken,omitempty"`
  11749. // SelfLink: [Output Only] Server-defined URL for this resource.
  11750. SelfLink string `json:"selfLink,omitempty"`
  11751. // Warning: [Output Only] Informational warning message.
  11752. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  11753. // ServerResponse contains the HTTP response code and headers from the
  11754. // server.
  11755. googleapi.ServerResponse `json:"-"`
  11756. // ForceSendFields is a list of field names (e.g. "Id") to
  11757. // unconditionally include in API requests. By default, fields with
  11758. // empty values are omitted from API requests. However, any non-pointer,
  11759. // non-interface field appearing in ForceSendFields will be sent to the
  11760. // server regardless of whether the field is empty or not. This may be
  11761. // used to include empty fields in Patch requests.
  11762. ForceSendFields []string `json:"-"`
  11763. // NullFields is a list of field names (e.g. "Id") to include in API
  11764. // requests with the JSON null value. By default, fields with empty
  11765. // values are omitted from API requests. However, any field with an
  11766. // empty value appearing in NullFields will be sent to the server as
  11767. // null. It is an error if a field in this list has a non-empty value.
  11768. // This may be used to include null fields in Patch requests.
  11769. NullFields []string `json:"-"`
  11770. }
  11771. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  11772. type NoMethod InstanceAggregatedList
  11773. raw := NoMethod(*s)
  11774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11775. }
  11776. // InstanceAggregatedListWarning: [Output Only] Informational warning
  11777. // message.
  11778. type InstanceAggregatedListWarning struct {
  11779. // Code: [Output Only] A warning code, if applicable. For example,
  11780. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11781. // the response.
  11782. //
  11783. // Possible values:
  11784. // "CLEANUP_FAILED"
  11785. // "DEPRECATED_RESOURCE_USED"
  11786. // "DEPRECATED_TYPE_USED"
  11787. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11788. // "EXPERIMENTAL_TYPE_USED"
  11789. // "EXTERNAL_API_WARNING"
  11790. // "FIELD_VALUE_OVERRIDEN"
  11791. // "INJECTED_KERNELS_DEPRECATED"
  11792. // "MISSING_TYPE_DEPENDENCY"
  11793. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11794. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11795. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11796. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11797. // "NEXT_HOP_NOT_RUNNING"
  11798. // "NOT_CRITICAL_ERROR"
  11799. // "NO_RESULTS_ON_PAGE"
  11800. // "REQUIRED_TOS_AGREEMENT"
  11801. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11802. // "RESOURCE_NOT_DELETED"
  11803. // "SCHEMA_VALIDATION_IGNORED"
  11804. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11805. // "UNDECLARED_PROPERTIES"
  11806. // "UNREACHABLE"
  11807. Code string `json:"code,omitempty"`
  11808. // Data: [Output Only] Metadata about this warning in key: value format.
  11809. // For example:
  11810. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11811. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  11812. // Message: [Output Only] A human-readable description of the warning
  11813. // code.
  11814. Message string `json:"message,omitempty"`
  11815. // ForceSendFields is a list of field names (e.g. "Code") to
  11816. // unconditionally include in API requests. By default, fields with
  11817. // empty values are omitted from API requests. However, any non-pointer,
  11818. // non-interface field appearing in ForceSendFields will be sent to the
  11819. // server regardless of whether the field is empty or not. This may be
  11820. // used to include empty fields in Patch requests.
  11821. ForceSendFields []string `json:"-"`
  11822. // NullFields is a list of field names (e.g. "Code") to include in API
  11823. // requests with the JSON null value. By default, fields with empty
  11824. // values are omitted from API requests. However, any field with an
  11825. // empty value appearing in NullFields will be sent to the server as
  11826. // null. It is an error if a field in this list has a non-empty value.
  11827. // This may be used to include null fields in Patch requests.
  11828. NullFields []string `json:"-"`
  11829. }
  11830. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  11831. type NoMethod InstanceAggregatedListWarning
  11832. raw := NoMethod(*s)
  11833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11834. }
  11835. type InstanceAggregatedListWarningData struct {
  11836. // Key: [Output Only] A key that provides more detail on the warning
  11837. // being returned. For example, for warnings where there are no results
  11838. // in a list request for a particular zone, this key might be scope and
  11839. // the key value might be the zone name. Other examples might be a key
  11840. // indicating a deprecated resource and a suggested replacement, or a
  11841. // warning about invalid network settings (for example, if an instance
  11842. // attempts to perform IP forwarding but is not enabled for IP
  11843. // forwarding).
  11844. Key string `json:"key,omitempty"`
  11845. // Value: [Output Only] A warning data value corresponding to the key.
  11846. Value string `json:"value,omitempty"`
  11847. // ForceSendFields is a list of field names (e.g. "Key") to
  11848. // unconditionally include in API requests. By default, fields with
  11849. // empty values are omitted from API requests. However, any non-pointer,
  11850. // non-interface field appearing in ForceSendFields will be sent to the
  11851. // server regardless of whether the field is empty or not. This may be
  11852. // used to include empty fields in Patch requests.
  11853. ForceSendFields []string `json:"-"`
  11854. // NullFields is a list of field names (e.g. "Key") to include in API
  11855. // requests with the JSON null value. By default, fields with empty
  11856. // values are omitted from API requests. However, any field with an
  11857. // empty value appearing in NullFields will be sent to the server as
  11858. // null. It is an error if a field in this list has a non-empty value.
  11859. // This may be used to include null fields in Patch requests.
  11860. NullFields []string `json:"-"`
  11861. }
  11862. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  11863. type NoMethod InstanceAggregatedListWarningData
  11864. raw := NoMethod(*s)
  11865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11866. }
  11867. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  11868. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  11869. // beta.regionInstanceGroups ==) (== resource_for
  11870. // v1.regionInstanceGroups ==)
  11871. type InstanceGroup struct {
  11872. // CreationTimestamp: [Output Only] The creation timestamp for this
  11873. // instance group in RFC3339 text format.
  11874. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11875. // Description: An optional description of this resource. Provide this
  11876. // property when you create the resource.
  11877. Description string `json:"description,omitempty"`
  11878. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  11879. // system uses this fingerprint to detect conflicts when multiple users
  11880. // change the named ports concurrently.
  11881. Fingerprint string `json:"fingerprint,omitempty"`
  11882. // Id: [Output Only] A unique identifier for this instance group,
  11883. // generated by the server.
  11884. Id uint64 `json:"id,omitempty,string"`
  11885. // Kind: [Output Only] The resource type, which is always
  11886. // compute#instanceGroup for instance groups.
  11887. Kind string `json:"kind,omitempty"`
  11888. // Name: The name of the instance group. The name must be 1-63
  11889. // characters long, and comply with RFC1035.
  11890. Name string `json:"name,omitempty"`
  11891. // NamedPorts: Assigns a name to a port number. For example: {name:
  11892. // "http", port: 80}
  11893. //
  11894. // This allows the system to reference ports by the assigned name
  11895. // instead of a port number. Named ports can also contain multiple
  11896. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  11897. // 8080}]
  11898. //
  11899. // Named ports apply to all instances in this instance group.
  11900. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  11901. // Network: The URL of the network to which all instances in the
  11902. // instance group belong.
  11903. Network string `json:"network,omitempty"`
  11904. // Region: [Output Only] The URL of the region where the instance group
  11905. // is located (for regional resources).
  11906. Region string `json:"region,omitempty"`
  11907. // SelfLink: [Output Only] The URL for this instance group. The server
  11908. // generates this URL.
  11909. SelfLink string `json:"selfLink,omitempty"`
  11910. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  11911. // with the resource id.
  11912. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  11913. // Size: [Output Only] The total number of instances in the instance
  11914. // group.
  11915. Size int64 `json:"size,omitempty"`
  11916. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  11917. // instances in the instance group belong.
  11918. Subnetwork string `json:"subnetwork,omitempty"`
  11919. // Zone: [Output Only] The URL of the zone where the instance group is
  11920. // located (for zonal resources).
  11921. Zone string `json:"zone,omitempty"`
  11922. // ServerResponse contains the HTTP response code and headers from the
  11923. // server.
  11924. googleapi.ServerResponse `json:"-"`
  11925. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  11926. // to unconditionally include in API requests. By default, fields with
  11927. // empty values are omitted from API requests. However, any non-pointer,
  11928. // non-interface field appearing in ForceSendFields will be sent to the
  11929. // server regardless of whether the field is empty or not. This may be
  11930. // used to include empty fields in Patch requests.
  11931. ForceSendFields []string `json:"-"`
  11932. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  11933. // include in API requests with the JSON null value. By default, fields
  11934. // with empty values are omitted from API requests. However, any field
  11935. // with an empty value appearing in NullFields will be sent to the
  11936. // server as null. It is an error if a field in this list has a
  11937. // non-empty value. This may be used to include null fields in Patch
  11938. // requests.
  11939. NullFields []string `json:"-"`
  11940. }
  11941. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  11942. type NoMethod InstanceGroup
  11943. raw := NoMethod(*s)
  11944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11945. }
  11946. type InstanceGroupAggregatedList struct {
  11947. // Id: [Output Only] Unique identifier for the resource; defined by the
  11948. // server.
  11949. Id string `json:"id,omitempty"`
  11950. // Items: A list of InstanceGroupsScopedList resources.
  11951. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  11952. // Kind: [Output Only] The resource type, which is always
  11953. // compute#instanceGroupAggregatedList for aggregated lists of instance
  11954. // groups.
  11955. Kind string `json:"kind,omitempty"`
  11956. // NextPageToken: [Output Only] This token allows you to get the next
  11957. // page of results for list requests. If the number of results is larger
  11958. // than maxResults, use the nextPageToken as a value for the query
  11959. // parameter pageToken in the next list request. Subsequent list
  11960. // requests will have their own nextPageToken to continue paging through
  11961. // the results.
  11962. NextPageToken string `json:"nextPageToken,omitempty"`
  11963. // SelfLink: [Output Only] Server-defined URL for this resource.
  11964. SelfLink string `json:"selfLink,omitempty"`
  11965. // Warning: [Output Only] Informational warning message.
  11966. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  11967. // ServerResponse contains the HTTP response code and headers from the
  11968. // server.
  11969. googleapi.ServerResponse `json:"-"`
  11970. // ForceSendFields is a list of field names (e.g. "Id") to
  11971. // unconditionally include in API requests. By default, fields with
  11972. // empty values are omitted from API requests. However, any non-pointer,
  11973. // non-interface field appearing in ForceSendFields will be sent to the
  11974. // server regardless of whether the field is empty or not. This may be
  11975. // used to include empty fields in Patch requests.
  11976. ForceSendFields []string `json:"-"`
  11977. // NullFields is a list of field names (e.g. "Id") to include in API
  11978. // requests with the JSON null value. By default, fields with empty
  11979. // values are omitted from API requests. However, any field with an
  11980. // empty value appearing in NullFields will be sent to the server as
  11981. // null. It is an error if a field in this list has a non-empty value.
  11982. // This may be used to include null fields in Patch requests.
  11983. NullFields []string `json:"-"`
  11984. }
  11985. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  11986. type NoMethod InstanceGroupAggregatedList
  11987. raw := NoMethod(*s)
  11988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11989. }
  11990. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  11991. // warning message.
  11992. type InstanceGroupAggregatedListWarning struct {
  11993. // Code: [Output Only] A warning code, if applicable. For example,
  11994. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11995. // the response.
  11996. //
  11997. // Possible values:
  11998. // "CLEANUP_FAILED"
  11999. // "DEPRECATED_RESOURCE_USED"
  12000. // "DEPRECATED_TYPE_USED"
  12001. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12002. // "EXPERIMENTAL_TYPE_USED"
  12003. // "EXTERNAL_API_WARNING"
  12004. // "FIELD_VALUE_OVERRIDEN"
  12005. // "INJECTED_KERNELS_DEPRECATED"
  12006. // "MISSING_TYPE_DEPENDENCY"
  12007. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12008. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12009. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12010. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12011. // "NEXT_HOP_NOT_RUNNING"
  12012. // "NOT_CRITICAL_ERROR"
  12013. // "NO_RESULTS_ON_PAGE"
  12014. // "REQUIRED_TOS_AGREEMENT"
  12015. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12016. // "RESOURCE_NOT_DELETED"
  12017. // "SCHEMA_VALIDATION_IGNORED"
  12018. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12019. // "UNDECLARED_PROPERTIES"
  12020. // "UNREACHABLE"
  12021. Code string `json:"code,omitempty"`
  12022. // Data: [Output Only] Metadata about this warning in key: value format.
  12023. // For example:
  12024. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12025. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  12026. // Message: [Output Only] A human-readable description of the warning
  12027. // code.
  12028. Message string `json:"message,omitempty"`
  12029. // ForceSendFields is a list of field names (e.g. "Code") to
  12030. // unconditionally include in API requests. By default, fields with
  12031. // empty values are omitted from API requests. However, any non-pointer,
  12032. // non-interface field appearing in ForceSendFields will be sent to the
  12033. // server regardless of whether the field is empty or not. This may be
  12034. // used to include empty fields in Patch requests.
  12035. ForceSendFields []string `json:"-"`
  12036. // NullFields is a list of field names (e.g. "Code") to include in API
  12037. // requests with the JSON null value. By default, fields with empty
  12038. // values are omitted from API requests. However, any field with an
  12039. // empty value appearing in NullFields will be sent to the server as
  12040. // null. It is an error if a field in this list has a non-empty value.
  12041. // This may be used to include null fields in Patch requests.
  12042. NullFields []string `json:"-"`
  12043. }
  12044. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  12045. type NoMethod InstanceGroupAggregatedListWarning
  12046. raw := NoMethod(*s)
  12047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12048. }
  12049. type InstanceGroupAggregatedListWarningData struct {
  12050. // Key: [Output Only] A key that provides more detail on the warning
  12051. // being returned. For example, for warnings where there are no results
  12052. // in a list request for a particular zone, this key might be scope and
  12053. // the key value might be the zone name. Other examples might be a key
  12054. // indicating a deprecated resource and a suggested replacement, or a
  12055. // warning about invalid network settings (for example, if an instance
  12056. // attempts to perform IP forwarding but is not enabled for IP
  12057. // forwarding).
  12058. Key string `json:"key,omitempty"`
  12059. // Value: [Output Only] A warning data value corresponding to the key.
  12060. Value string `json:"value,omitempty"`
  12061. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  12069. // requests with the JSON null value. By default, fields with empty
  12070. // values are omitted from API requests. However, any field with an
  12071. // 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 *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  12077. type NoMethod InstanceGroupAggregatedListWarningData
  12078. raw := NoMethod(*s)
  12079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12080. }
  12081. // InstanceGroupList: A list of InstanceGroup resources.
  12082. type InstanceGroupList struct {
  12083. // Id: [Output Only] Unique identifier for the resource; defined by the
  12084. // server.
  12085. Id string `json:"id,omitempty"`
  12086. // Items: A list of InstanceGroup resources.
  12087. Items []*InstanceGroup `json:"items,omitempty"`
  12088. // Kind: [Output Only] The resource type, which is always
  12089. // compute#instanceGroupList for instance group lists.
  12090. Kind string `json:"kind,omitempty"`
  12091. // NextPageToken: [Output Only] This token allows you to get the next
  12092. // page of results for list requests. If the number of results is larger
  12093. // than maxResults, use the nextPageToken as a value for the query
  12094. // parameter pageToken in the next list request. Subsequent list
  12095. // requests will have their own nextPageToken to continue paging through
  12096. // the results.
  12097. NextPageToken string `json:"nextPageToken,omitempty"`
  12098. // SelfLink: [Output Only] Server-defined URL for this resource.
  12099. SelfLink string `json:"selfLink,omitempty"`
  12100. // Warning: [Output Only] Informational warning message.
  12101. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  12102. // ServerResponse contains the HTTP response code and headers from the
  12103. // server.
  12104. googleapi.ServerResponse `json:"-"`
  12105. // ForceSendFields is a list of field names (e.g. "Id") to
  12106. // unconditionally include in API requests. By default, fields with
  12107. // empty values are omitted from API requests. However, any non-pointer,
  12108. // non-interface field appearing in ForceSendFields will be sent to the
  12109. // server regardless of whether the field is empty or not. This may be
  12110. // used to include empty fields in Patch requests.
  12111. ForceSendFields []string `json:"-"`
  12112. // NullFields is a list of field names (e.g. "Id") to include in API
  12113. // requests with the JSON null value. By default, fields with empty
  12114. // values are omitted from API requests. However, any field with an
  12115. // empty value appearing in NullFields will be sent to the server as
  12116. // null. It is an error if a field in this list has a non-empty value.
  12117. // This may be used to include null fields in Patch requests.
  12118. NullFields []string `json:"-"`
  12119. }
  12120. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  12121. type NoMethod InstanceGroupList
  12122. raw := NoMethod(*s)
  12123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12124. }
  12125. // InstanceGroupListWarning: [Output Only] Informational warning
  12126. // message.
  12127. type InstanceGroupListWarning struct {
  12128. // Code: [Output Only] A warning code, if applicable. For example,
  12129. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12130. // the response.
  12131. //
  12132. // Possible values:
  12133. // "CLEANUP_FAILED"
  12134. // "DEPRECATED_RESOURCE_USED"
  12135. // "DEPRECATED_TYPE_USED"
  12136. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12137. // "EXPERIMENTAL_TYPE_USED"
  12138. // "EXTERNAL_API_WARNING"
  12139. // "FIELD_VALUE_OVERRIDEN"
  12140. // "INJECTED_KERNELS_DEPRECATED"
  12141. // "MISSING_TYPE_DEPENDENCY"
  12142. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12143. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12144. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12145. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12146. // "NEXT_HOP_NOT_RUNNING"
  12147. // "NOT_CRITICAL_ERROR"
  12148. // "NO_RESULTS_ON_PAGE"
  12149. // "REQUIRED_TOS_AGREEMENT"
  12150. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12151. // "RESOURCE_NOT_DELETED"
  12152. // "SCHEMA_VALIDATION_IGNORED"
  12153. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12154. // "UNDECLARED_PROPERTIES"
  12155. // "UNREACHABLE"
  12156. Code string `json:"code,omitempty"`
  12157. // Data: [Output Only] Metadata about this warning in key: value format.
  12158. // For example:
  12159. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12160. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  12161. // Message: [Output Only] A human-readable description of the warning
  12162. // code.
  12163. Message string `json:"message,omitempty"`
  12164. // ForceSendFields is a list of field names (e.g. "Code") to
  12165. // unconditionally include in API requests. By default, fields with
  12166. // empty values are omitted from API requests. However, any non-pointer,
  12167. // non-interface field appearing in ForceSendFields will be sent to the
  12168. // server regardless of whether the field is empty or not. This may be
  12169. // used to include empty fields in Patch requests.
  12170. ForceSendFields []string `json:"-"`
  12171. // NullFields is a list of field names (e.g. "Code") to include in API
  12172. // requests with the JSON null value. By default, fields with empty
  12173. // values are omitted from API requests. However, any field with an
  12174. // empty value appearing in NullFields will be sent to the server as
  12175. // null. It is an error if a field in this list has a non-empty value.
  12176. // This may be used to include null fields in Patch requests.
  12177. NullFields []string `json:"-"`
  12178. }
  12179. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  12180. type NoMethod InstanceGroupListWarning
  12181. raw := NoMethod(*s)
  12182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12183. }
  12184. type InstanceGroupListWarningData struct {
  12185. // Key: [Output Only] A key that provides more detail on the warning
  12186. // being returned. For example, for warnings where there are no results
  12187. // in a list request for a particular zone, this key might be scope and
  12188. // the key value might be the zone name. Other examples might be a key
  12189. // indicating a deprecated resource and a suggested replacement, or a
  12190. // warning about invalid network settings (for example, if an instance
  12191. // attempts to perform IP forwarding but is not enabled for IP
  12192. // forwarding).
  12193. Key string `json:"key,omitempty"`
  12194. // Value: [Output Only] A warning data value corresponding to the key.
  12195. Value string `json:"value,omitempty"`
  12196. // ForceSendFields is a list of field names (e.g. "Key") to
  12197. // unconditionally include in API requests. By default, fields with
  12198. // empty values are omitted from API requests. However, any non-pointer,
  12199. // non-interface field appearing in ForceSendFields will be sent to the
  12200. // server regardless of whether the field is empty or not. This may be
  12201. // used to include empty fields in Patch requests.
  12202. ForceSendFields []string `json:"-"`
  12203. // NullFields is a list of field names (e.g. "Key") to include in API
  12204. // requests with the JSON null value. By default, fields with empty
  12205. // values are omitted from API requests. However, any field with an
  12206. // empty value appearing in NullFields will be sent to the server as
  12207. // null. It is an error if a field in this list has a non-empty value.
  12208. // This may be used to include null fields in Patch requests.
  12209. NullFields []string `json:"-"`
  12210. }
  12211. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  12212. type NoMethod InstanceGroupListWarningData
  12213. raw := NoMethod(*s)
  12214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12215. }
  12216. // InstanceGroupManager: An Instance Group Manager resource. (==
  12217. // resource_for beta.instanceGroupManagers ==) (== resource_for
  12218. // v1.instanceGroupManagers ==) (== resource_for
  12219. // beta.regionInstanceGroupManagers ==) (== resource_for
  12220. // v1.regionInstanceGroupManagers ==)
  12221. type InstanceGroupManager struct {
  12222. // AutoHealingPolicies: The autohealing policy for this managed instance
  12223. // group. You can specify only one value.
  12224. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  12225. // BaseInstanceName: The base instance name to use for instances in this
  12226. // group. The value must be 1-58 characters long. Instances are named by
  12227. // appending a hyphen and a random four-character string to the base
  12228. // instance name. The base instance name must comply with RFC1035.
  12229. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  12230. // CreationTimestamp: [Output Only] The creation timestamp for this
  12231. // managed instance group in RFC3339 text format.
  12232. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12233. // CurrentActions: [Output Only] The list of instance actions and the
  12234. // number of instances in this managed instance group that are scheduled
  12235. // for each of those actions.
  12236. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  12237. // Description: An optional description of this resource. Provide this
  12238. // property when you create the resource.
  12239. Description string `json:"description,omitempty"`
  12240. // DistributionPolicy: Policy specifying intended distribution of
  12241. // instances in regional managed instance group.
  12242. DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
  12243. // FailoverAction: The action to perform in case of zone failure. Only
  12244. // one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
  12245. //
  12246. // Possible values:
  12247. // "NO_FAILOVER"
  12248. // "UNKNOWN"
  12249. FailoverAction string `json:"failoverAction,omitempty"`
  12250. // Fingerprint: Fingerprint of this resource. This field may be used in
  12251. // optimistic locking. It will be ignored when inserting an
  12252. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  12253. // order to update the InstanceGroupManager, otherwise the request will
  12254. // fail with error 412 conditionNotMet.
  12255. //
  12256. // To see the latest fingerprint, make a get() request to retrieve an
  12257. // InstanceGroupManager.
  12258. Fingerprint string `json:"fingerprint,omitempty"`
  12259. // Id: [Output Only] A unique identifier for this resource type. The
  12260. // server generates this identifier.
  12261. Id uint64 `json:"id,omitempty,string"`
  12262. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  12263. InstanceGroup string `json:"instanceGroup,omitempty"`
  12264. // InstanceTemplate: The URL of the instance template that is specified
  12265. // for this managed instance group. The group uses this template to
  12266. // create all new instances in the managed instance group.
  12267. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  12268. // Kind: [Output Only] The resource type, which is always
  12269. // compute#instanceGroupManager for managed instance groups.
  12270. Kind string `json:"kind,omitempty"`
  12271. // Name: The name of the managed instance group. The name must be 1-63
  12272. // characters long, and comply with RFC1035.
  12273. Name string `json:"name,omitempty"`
  12274. // NamedPorts: Named ports configured for the Instance Groups
  12275. // complementary to this Instance Group Manager.
  12276. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  12277. // PendingActions: [Deprecated] This field is deprecated and will be
  12278. // removed. Prefer using the status field instead. Please contact
  12279. // cloud-updater-feedback@google.com to leave feedback if your workload
  12280. // relies on this field. [Output Only] The list of instance actions and
  12281. // the number of instances in this managed instance group that are
  12282. // pending for each of those actions.
  12283. PendingActions *InstanceGroupManagerPendingActionsSummary `json:"pendingActions,omitempty"`
  12284. // Region: [Output Only] The URL of the region where the managed
  12285. // instance group resides (for regional resources).
  12286. Region string `json:"region,omitempty"`
  12287. // SelfLink: [Output Only] The URL for this managed instance group. The
  12288. // server defines this URL.
  12289. SelfLink string `json:"selfLink,omitempty"`
  12290. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  12291. // with the resource id.
  12292. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  12293. // ServiceAccount: The service account to be used as credentials for all
  12294. // operations performed by the managed instance group on instances. The
  12295. // service accounts needs all permissions required to create and delete
  12296. // instances. By default, the service account
  12297. // {projectNumber}@cloudservices.gserviceaccount.com is used.
  12298. ServiceAccount string `json:"serviceAccount,omitempty"`
  12299. // StatefulPolicy: Stateful configuration for this Instanced Group
  12300. // Manager
  12301. StatefulPolicy *StatefulPolicy `json:"statefulPolicy,omitempty"`
  12302. // Status: [Output Only] The status of this managed instance group.
  12303. Status *InstanceGroupManagerStatus `json:"status,omitempty"`
  12304. // TargetPools: The URLs for all TargetPool resources to which instances
  12305. // in the instanceGroup field are added. The target pools automatically
  12306. // apply to all of the instances in the managed instance group.
  12307. TargetPools []string `json:"targetPools,omitempty"`
  12308. // TargetSize: The target number of running instances for this managed
  12309. // instance group. Deleting or abandoning instances reduces this number.
  12310. // Resizing the group changes this number.
  12311. TargetSize int64 `json:"targetSize,omitempty"`
  12312. // UpdatePolicy: The update policy for this managed instance group.
  12313. UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"`
  12314. // Versions: Specifies the instance templates used by this managed
  12315. // instance group to create instances.
  12316. //
  12317. // Each version is defined by an instanceTemplate and a name. Every
  12318. // version can appear at most once per instance group. This field
  12319. // overrides the top-level instanceTemplate field. Read more about the
  12320. // relationships between these fields. Exactly one version must leave
  12321. // the targetSize field unset. That version will be applied to all
  12322. // remaining instances. For more information, read about canary updates.
  12323. Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
  12324. // Zone: [Output Only] The URL of the zone where the managed instance
  12325. // group is located (for zonal resources).
  12326. Zone string `json:"zone,omitempty"`
  12327. // ServerResponse contains the HTTP response code and headers from the
  12328. // server.
  12329. googleapi.ServerResponse `json:"-"`
  12330. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  12331. // to unconditionally include in API requests. By default, fields with
  12332. // empty values are omitted from API requests. However, any non-pointer,
  12333. // non-interface field appearing in ForceSendFields will be sent to the
  12334. // server regardless of whether the field is empty or not. This may be
  12335. // used to include empty fields in Patch requests.
  12336. ForceSendFields []string `json:"-"`
  12337. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  12338. // include in API requests with the JSON null value. By default, fields
  12339. // with empty values are omitted from API requests. However, any field
  12340. // with an empty value appearing in NullFields will be sent to the
  12341. // server as null. It is an error if a field in this list has a
  12342. // non-empty value. This may be used to include null fields in Patch
  12343. // requests.
  12344. NullFields []string `json:"-"`
  12345. }
  12346. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  12347. type NoMethod InstanceGroupManager
  12348. raw := NoMethod(*s)
  12349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12350. }
  12351. type InstanceGroupManagerActionsSummary struct {
  12352. // Abandoning: [Output Only] The total number of instances in the
  12353. // managed instance group that are scheduled to be abandoned. Abandoning
  12354. // an instance removes it from the managed instance group without
  12355. // deleting it.
  12356. Abandoning int64 `json:"abandoning,omitempty"`
  12357. // Creating: [Output Only] The number of instances in the managed
  12358. // instance group that are scheduled to be created or are currently
  12359. // being created. If the group fails to create any of these instances,
  12360. // it tries again until it creates the instance successfully.
  12361. //
  12362. // If you have disabled creation retries, this field will not be
  12363. // populated; instead, the creatingWithoutRetries field will be
  12364. // populated.
  12365. Creating int64 `json:"creating,omitempty"`
  12366. // CreatingWithoutRetries: [Output Only] The number of instances that
  12367. // the managed instance group will attempt to create. The group attempts
  12368. // to create each instance only once. If the group fails to create any
  12369. // of these instances, it decreases the group's targetSize value
  12370. // accordingly.
  12371. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  12372. // Deleting: [Output Only] The number of instances in the managed
  12373. // instance group that are scheduled to be deleted or are currently
  12374. // being deleted.
  12375. Deleting int64 `json:"deleting,omitempty"`
  12376. // None: [Output Only] The number of instances in the managed instance
  12377. // group that are running and have no scheduled actions.
  12378. None int64 `json:"none,omitempty"`
  12379. // Recreating: [Output Only] The number of instances in the managed
  12380. // instance group that are scheduled to be recreated or are currently
  12381. // being being recreated. Recreating an instance deletes the existing
  12382. // root persistent disk and creates a new disk from the image that is
  12383. // defined in the instance template.
  12384. Recreating int64 `json:"recreating,omitempty"`
  12385. // Refreshing: [Output Only] The number of instances in the managed
  12386. // instance group that are being reconfigured with properties that do
  12387. // not require a restart or a recreate action. For example, setting or
  12388. // removing target pools for the instance.
  12389. Refreshing int64 `json:"refreshing,omitempty"`
  12390. // Restarting: [Output Only] The number of instances in the managed
  12391. // instance group that are scheduled to be restarted or are currently
  12392. // being restarted.
  12393. Restarting int64 `json:"restarting,omitempty"`
  12394. // Verifying: [Output Only] The number of instances in the managed
  12395. // instance group that are being verified. See the
  12396. // managedInstances[].currentAction property in the listManagedInstances
  12397. // method documentation.
  12398. Verifying int64 `json:"verifying,omitempty"`
  12399. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  12400. // unconditionally include in API requests. By default, fields with
  12401. // empty values are omitted from API requests. However, any non-pointer,
  12402. // non-interface field appearing in ForceSendFields will be sent to the
  12403. // server regardless of whether the field is empty or not. This may be
  12404. // used to include empty fields in Patch requests.
  12405. ForceSendFields []string `json:"-"`
  12406. // NullFields is a list of field names (e.g. "Abandoning") to include in
  12407. // API requests with the JSON null value. By default, fields with empty
  12408. // values are omitted from API requests. However, any field with an
  12409. // empty value appearing in NullFields will be sent to the server as
  12410. // null. It is an error if a field in this list has a non-empty value.
  12411. // This may be used to include null fields in Patch requests.
  12412. NullFields []string `json:"-"`
  12413. }
  12414. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  12415. type NoMethod InstanceGroupManagerActionsSummary
  12416. raw := NoMethod(*s)
  12417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12418. }
  12419. type InstanceGroupManagerAggregatedList struct {
  12420. // Id: [Output Only] Unique identifier for the resource; defined by the
  12421. // server.
  12422. Id string `json:"id,omitempty"`
  12423. // Items: A list of InstanceGroupManagersScopedList resources.
  12424. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  12425. // Kind: [Output Only] The resource type, which is always
  12426. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  12427. // managed instance groups.
  12428. Kind string `json:"kind,omitempty"`
  12429. // NextPageToken: [Output Only] This token allows you to get the next
  12430. // page of results for list requests. If the number of results is larger
  12431. // than maxResults, use the nextPageToken as a value for the query
  12432. // parameter pageToken in the next list request. Subsequent list
  12433. // requests will have their own nextPageToken to continue paging through
  12434. // the results.
  12435. NextPageToken string `json:"nextPageToken,omitempty"`
  12436. // SelfLink: [Output Only] Server-defined URL for this resource.
  12437. SelfLink string `json:"selfLink,omitempty"`
  12438. // Warning: [Output Only] Informational warning message.
  12439. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  12440. // ServerResponse contains the HTTP response code and headers from the
  12441. // server.
  12442. googleapi.ServerResponse `json:"-"`
  12443. // ForceSendFields is a list of field names (e.g. "Id") to
  12444. // unconditionally include in API requests. By default, fields with
  12445. // empty values are omitted from API requests. However, any non-pointer,
  12446. // non-interface field appearing in ForceSendFields will be sent to the
  12447. // server regardless of whether the field is empty or not. This may be
  12448. // used to include empty fields in Patch requests.
  12449. ForceSendFields []string `json:"-"`
  12450. // NullFields is a list of field names (e.g. "Id") to include in API
  12451. // requests with the JSON null value. By default, fields with empty
  12452. // values are omitted from API requests. However, any field with an
  12453. // empty value appearing in NullFields will be sent to the server as
  12454. // null. It is an error if a field in this list has a non-empty value.
  12455. // This may be used to include null fields in Patch requests.
  12456. NullFields []string `json:"-"`
  12457. }
  12458. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  12459. type NoMethod InstanceGroupManagerAggregatedList
  12460. raw := NoMethod(*s)
  12461. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12462. }
  12463. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  12464. // Informational warning message.
  12465. type InstanceGroupManagerAggregatedListWarning struct {
  12466. // Code: [Output Only] A warning code, if applicable. For example,
  12467. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12468. // the response.
  12469. //
  12470. // Possible values:
  12471. // "CLEANUP_FAILED"
  12472. // "DEPRECATED_RESOURCE_USED"
  12473. // "DEPRECATED_TYPE_USED"
  12474. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12475. // "EXPERIMENTAL_TYPE_USED"
  12476. // "EXTERNAL_API_WARNING"
  12477. // "FIELD_VALUE_OVERRIDEN"
  12478. // "INJECTED_KERNELS_DEPRECATED"
  12479. // "MISSING_TYPE_DEPENDENCY"
  12480. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12481. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12482. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12483. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12484. // "NEXT_HOP_NOT_RUNNING"
  12485. // "NOT_CRITICAL_ERROR"
  12486. // "NO_RESULTS_ON_PAGE"
  12487. // "REQUIRED_TOS_AGREEMENT"
  12488. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12489. // "RESOURCE_NOT_DELETED"
  12490. // "SCHEMA_VALIDATION_IGNORED"
  12491. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12492. // "UNDECLARED_PROPERTIES"
  12493. // "UNREACHABLE"
  12494. Code string `json:"code,omitempty"`
  12495. // Data: [Output Only] Metadata about this warning in key: value format.
  12496. // For example:
  12497. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12498. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  12499. // Message: [Output Only] A human-readable description of the warning
  12500. // code.
  12501. Message string `json:"message,omitempty"`
  12502. // ForceSendFields is a list of field names (e.g. "Code") to
  12503. // unconditionally include in API requests. By default, fields with
  12504. // empty values are omitted from API requests. However, any non-pointer,
  12505. // non-interface field appearing in ForceSendFields will be sent to the
  12506. // server regardless of whether the field is empty or not. This may be
  12507. // used to include empty fields in Patch requests.
  12508. ForceSendFields []string `json:"-"`
  12509. // NullFields is a list of field names (e.g. "Code") to include in API
  12510. // requests with the JSON null value. By default, fields with empty
  12511. // values are omitted from API requests. However, any field with an
  12512. // empty value appearing in NullFields will be sent to the server as
  12513. // null. It is an error if a field in this list has a non-empty value.
  12514. // This may be used to include null fields in Patch requests.
  12515. NullFields []string `json:"-"`
  12516. }
  12517. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  12518. type NoMethod InstanceGroupManagerAggregatedListWarning
  12519. raw := NoMethod(*s)
  12520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12521. }
  12522. type InstanceGroupManagerAggregatedListWarningData struct {
  12523. // Key: [Output Only] A key that provides more detail on the warning
  12524. // being returned. For example, for warnings where there are no results
  12525. // in a list request for a particular zone, this key might be scope and
  12526. // the key value might be the zone name. Other examples might be a key
  12527. // indicating a deprecated resource and a suggested replacement, or a
  12528. // warning about invalid network settings (for example, if an instance
  12529. // attempts to perform IP forwarding but is not enabled for IP
  12530. // forwarding).
  12531. Key string `json:"key,omitempty"`
  12532. // Value: [Output Only] A warning data value corresponding to the key.
  12533. Value string `json:"value,omitempty"`
  12534. // ForceSendFields is a list of field names (e.g. "Key") to
  12535. // unconditionally include in API requests. By default, fields with
  12536. // empty values are omitted from API requests. However, any non-pointer,
  12537. // non-interface field appearing in ForceSendFields will be sent to the
  12538. // server regardless of whether the field is empty or not. This may be
  12539. // used to include empty fields in Patch requests.
  12540. ForceSendFields []string `json:"-"`
  12541. // NullFields is a list of field names (e.g. "Key") to include in API
  12542. // requests with the JSON null value. By default, fields with empty
  12543. // values are omitted from API requests. However, any field with an
  12544. // empty value appearing in NullFields will be sent to the server as
  12545. // null. It is an error if a field in this list has a non-empty value.
  12546. // This may be used to include null fields in Patch requests.
  12547. NullFields []string `json:"-"`
  12548. }
  12549. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  12550. type NoMethod InstanceGroupManagerAggregatedListWarningData
  12551. raw := NoMethod(*s)
  12552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12553. }
  12554. type InstanceGroupManagerAutoHealingPolicy struct {
  12555. // HealthCheck: The URL for the health check that signals autohealing.
  12556. HealthCheck string `json:"healthCheck,omitempty"`
  12557. // InitialDelaySec: The number of seconds that the managed instance
  12558. // group waits before it applies autohealing policies to new instances
  12559. // or recently recreated instances. This initial delay allows instances
  12560. // to initialize and run their startup scripts before the instance group
  12561. // determines that they are UNHEALTHY. This prevents the managed
  12562. // instance group from recreating its instances prematurely. This value
  12563. // must be from range [0, 3600].
  12564. InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
  12565. // MaxUnavailable: Maximum number of instances that can be unavailable
  12566. // when autohealing. When 'percent' is used, the value is rounded UP.
  12567. // The instance is considered available if all of the following
  12568. // conditions are satisfied: 1. Instance's status is RUNNING. 2.
  12569. // Instance's currentAction is NONE (in particular its liveness health
  12570. // check result was observed to be HEALTHY at least once as it passed
  12571. // VERIFYING). 3. There is no outgoing action on an instance triggered
  12572. // by IGM.
  12573. //
  12574. // By default, number of concurrently autohealed instances is smaller
  12575. // than the managed instance group target size. However, if a zonal
  12576. // managed instance group has only one instance, or a regional managed
  12577. // instance group has only one instance per zone, autohealing will
  12578. // recreate these instances when they become unhealthy.
  12579. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  12580. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  12581. // unconditionally include in API requests. By default, fields with
  12582. // empty values are omitted from API requests. However, any non-pointer,
  12583. // non-interface field appearing in ForceSendFields will be sent to the
  12584. // server regardless of whether the field is empty or not. This may be
  12585. // used to include empty fields in Patch requests.
  12586. ForceSendFields []string `json:"-"`
  12587. // NullFields is a list of field names (e.g. "HealthCheck") to include
  12588. // in API requests with the JSON null value. By default, fields with
  12589. // empty values are omitted from API requests. However, any field with
  12590. // an empty value appearing in NullFields will be sent to the server as
  12591. // null. It is an error if a field in this list has a non-empty value.
  12592. // This may be used to include null fields in Patch requests.
  12593. NullFields []string `json:"-"`
  12594. }
  12595. func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
  12596. type NoMethod InstanceGroupManagerAutoHealingPolicy
  12597. raw := NoMethod(*s)
  12598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12599. }
  12600. // InstanceGroupManagerList: [Output Only] A list of managed instance
  12601. // groups.
  12602. type InstanceGroupManagerList struct {
  12603. // Id: [Output Only] Unique identifier for the resource; defined by the
  12604. // server.
  12605. Id string `json:"id,omitempty"`
  12606. // Items: A list of InstanceGroupManager resources.
  12607. Items []*InstanceGroupManager `json:"items,omitempty"`
  12608. // Kind: [Output Only] The resource type, which is always
  12609. // compute#instanceGroupManagerList for a list of managed instance
  12610. // groups.
  12611. Kind string `json:"kind,omitempty"`
  12612. // NextPageToken: [Output Only] This token allows you to get the next
  12613. // page of results for list requests. If the number of results is larger
  12614. // than maxResults, use the nextPageToken as a value for the query
  12615. // parameter pageToken in the next list request. Subsequent list
  12616. // requests will have their own nextPageToken to continue paging through
  12617. // the results.
  12618. NextPageToken string `json:"nextPageToken,omitempty"`
  12619. // SelfLink: [Output Only] Server-defined URL for this resource.
  12620. SelfLink string `json:"selfLink,omitempty"`
  12621. // Warning: [Output Only] Informational warning message.
  12622. Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
  12623. // ServerResponse contains the HTTP response code and headers from the
  12624. // server.
  12625. googleapi.ServerResponse `json:"-"`
  12626. // ForceSendFields is a list of field names (e.g. "Id") to
  12627. // unconditionally include in API requests. By default, fields with
  12628. // empty values are omitted from API requests. However, any non-pointer,
  12629. // non-interface field appearing in ForceSendFields will be sent to the
  12630. // server regardless of whether the field is empty or not. This may be
  12631. // used to include empty fields in Patch requests.
  12632. ForceSendFields []string `json:"-"`
  12633. // NullFields is a list of field names (e.g. "Id") to include in API
  12634. // requests with the JSON null value. By default, fields with empty
  12635. // values are omitted from API requests. However, any field with an
  12636. // empty value appearing in NullFields will be sent to the server as
  12637. // null. It is an error if a field in this list has a non-empty value.
  12638. // This may be used to include null fields in Patch requests.
  12639. NullFields []string `json:"-"`
  12640. }
  12641. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  12642. type NoMethod InstanceGroupManagerList
  12643. raw := NoMethod(*s)
  12644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12645. }
  12646. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  12647. // message.
  12648. type InstanceGroupManagerListWarning struct {
  12649. // Code: [Output Only] A warning code, if applicable. For example,
  12650. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12651. // the response.
  12652. //
  12653. // Possible values:
  12654. // "CLEANUP_FAILED"
  12655. // "DEPRECATED_RESOURCE_USED"
  12656. // "DEPRECATED_TYPE_USED"
  12657. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12658. // "EXPERIMENTAL_TYPE_USED"
  12659. // "EXTERNAL_API_WARNING"
  12660. // "FIELD_VALUE_OVERRIDEN"
  12661. // "INJECTED_KERNELS_DEPRECATED"
  12662. // "MISSING_TYPE_DEPENDENCY"
  12663. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12664. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12665. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12666. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12667. // "NEXT_HOP_NOT_RUNNING"
  12668. // "NOT_CRITICAL_ERROR"
  12669. // "NO_RESULTS_ON_PAGE"
  12670. // "REQUIRED_TOS_AGREEMENT"
  12671. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12672. // "RESOURCE_NOT_DELETED"
  12673. // "SCHEMA_VALIDATION_IGNORED"
  12674. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12675. // "UNDECLARED_PROPERTIES"
  12676. // "UNREACHABLE"
  12677. Code string `json:"code,omitempty"`
  12678. // Data: [Output Only] Metadata about this warning in key: value format.
  12679. // For example:
  12680. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12681. Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
  12682. // Message: [Output Only] A human-readable description of the warning
  12683. // code.
  12684. Message string `json:"message,omitempty"`
  12685. // ForceSendFields is a list of field names (e.g. "Code") to
  12686. // unconditionally include in API requests. By default, fields with
  12687. // empty values are omitted from API requests. However, any non-pointer,
  12688. // non-interface field appearing in ForceSendFields will be sent to the
  12689. // server regardless of whether the field is empty or not. This may be
  12690. // used to include empty fields in Patch requests.
  12691. ForceSendFields []string `json:"-"`
  12692. // NullFields is a list of field names (e.g. "Code") to include in API
  12693. // requests with the JSON null value. By default, fields with empty
  12694. // values are omitted from API requests. However, any field with an
  12695. // empty value appearing in NullFields will be sent to the server as
  12696. // null. It is an error if a field in this list has a non-empty value.
  12697. // This may be used to include null fields in Patch requests.
  12698. NullFields []string `json:"-"`
  12699. }
  12700. func (s *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  12701. type NoMethod InstanceGroupManagerListWarning
  12702. raw := NoMethod(*s)
  12703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12704. }
  12705. type InstanceGroupManagerListWarningData struct {
  12706. // Key: [Output Only] A key that provides more detail on the warning
  12707. // being returned. For example, for warnings where there are no results
  12708. // in a list request for a particular zone, this key might be scope and
  12709. // the key value might be the zone name. Other examples might be a key
  12710. // indicating a deprecated resource and a suggested replacement, or a
  12711. // warning about invalid network settings (for example, if an instance
  12712. // attempts to perform IP forwarding but is not enabled for IP
  12713. // forwarding).
  12714. Key string `json:"key,omitempty"`
  12715. // Value: [Output Only] A warning data value corresponding to the key.
  12716. Value string `json:"value,omitempty"`
  12717. // ForceSendFields is a list of field names (e.g. "Key") to
  12718. // unconditionally include in API requests. By default, fields with
  12719. // empty values are omitted from API requests. However, any non-pointer,
  12720. // non-interface field appearing in ForceSendFields will be sent to the
  12721. // server regardless of whether the field is empty or not. This may be
  12722. // used to include empty fields in Patch requests.
  12723. ForceSendFields []string `json:"-"`
  12724. // NullFields is a list of field names (e.g. "Key") to include in API
  12725. // requests with the JSON null value. By default, fields with empty
  12726. // values are omitted from API requests. However, any field with an
  12727. // empty value appearing in NullFields will be sent to the server as
  12728. // null. It is an error if a field in this list has a non-empty value.
  12729. // This may be used to include null fields in Patch requests.
  12730. NullFields []string `json:"-"`
  12731. }
  12732. func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  12733. type NoMethod InstanceGroupManagerListWarningData
  12734. raw := NoMethod(*s)
  12735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12736. }
  12737. type InstanceGroupManagerPendingActionsSummary struct {
  12738. // Creating: [Deprecated] This field is deprecated and will be removed.
  12739. // Prefer using the status field instead. Please contact
  12740. // cloud-updater-feedback@google.com to leave feedback if your workload
  12741. // relies on this field. [Output Only] The number of instances in the
  12742. // managed instance group that are pending to be created.
  12743. Creating int64 `json:"creating,omitempty"`
  12744. // Deleting: [Deprecated] This field is deprecated and will be removed.
  12745. // Prefer using the status field instead. Please contact
  12746. // cloud-updater-feedback@google.com to leave feedback if your workload
  12747. // relies on this field. [Output Only] The number of instances in the
  12748. // managed instance group that are pending to be deleted.
  12749. Deleting int64 `json:"deleting,omitempty"`
  12750. // Recreating: [Deprecated] This field is deprecated and will be
  12751. // removed. Prefer using the status field instead. Please contact
  12752. // cloud-updater-feedback@google.com to leave feedback if your workload
  12753. // relies on this field. [Output Only] The number of instances in the
  12754. // managed instance group that are pending to be recreated.
  12755. Recreating int64 `json:"recreating,omitempty"`
  12756. // Restarting: [Deprecated] This field is deprecated and will be
  12757. // removed. Prefer using the status field instead. Please contact
  12758. // cloud-updater-feedback@google.com to leave feedback if your workload
  12759. // relies on this field. [Output Only] The number of instances in the
  12760. // managed instance group that are pending to be restarted.
  12761. Restarting int64 `json:"restarting,omitempty"`
  12762. // ForceSendFields is a list of field names (e.g. "Creating") to
  12763. // unconditionally include in API requests. By default, fields with
  12764. // empty values are omitted from API requests. However, any non-pointer,
  12765. // non-interface field appearing in ForceSendFields will be sent to the
  12766. // server regardless of whether the field is empty or not. This may be
  12767. // used to include empty fields in Patch requests.
  12768. ForceSendFields []string `json:"-"`
  12769. // NullFields is a list of field names (e.g. "Creating") to include in
  12770. // API requests with the JSON null value. By default, fields with empty
  12771. // values are omitted from API requests. However, any field with an
  12772. // empty value appearing in NullFields will be sent to the server as
  12773. // null. It is an error if a field in this list has a non-empty value.
  12774. // This may be used to include null fields in Patch requests.
  12775. NullFields []string `json:"-"`
  12776. }
  12777. func (s *InstanceGroupManagerPendingActionsSummary) MarshalJSON() ([]byte, error) {
  12778. type NoMethod InstanceGroupManagerPendingActionsSummary
  12779. raw := NoMethod(*s)
  12780. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12781. }
  12782. type InstanceGroupManagerStatus struct {
  12783. // IsStable: [Output Only] A bit indicating whether the managed instance
  12784. // group is in a stable state. A stable state means that: none of the
  12785. // instances in the managed instance group is currently undergoing any
  12786. // type of change (for example, creation, restart, or deletion); no
  12787. // future changes are scheduled for instances in the managed instance
  12788. // group; and the managed instance group itself is not being modified.
  12789. IsStable bool `json:"isStable,omitempty"`
  12790. // Stateful: [Output Only] Stateful status of the given Instance Group
  12791. // Manager.
  12792. Stateful *InstanceGroupManagerStatusStateful `json:"stateful,omitempty"`
  12793. // VersionTarget: [Output Only] A status of consistency of Instances'
  12794. // versions with their target version specified by version field on
  12795. // Instance Group Manager.
  12796. VersionTarget *InstanceGroupManagerStatusVersionTarget `json:"versionTarget,omitempty"`
  12797. // ForceSendFields is a list of field names (e.g. "IsStable") to
  12798. // unconditionally include in API requests. By default, fields with
  12799. // empty values are omitted from API requests. However, any non-pointer,
  12800. // non-interface field appearing in ForceSendFields will be sent to the
  12801. // server regardless of whether the field is empty or not. This may be
  12802. // used to include empty fields in Patch requests.
  12803. ForceSendFields []string `json:"-"`
  12804. // NullFields is a list of field names (e.g. "IsStable") to include in
  12805. // API requests with the JSON null value. By default, fields with empty
  12806. // values are omitted from API requests. However, any field with an
  12807. // empty value appearing in NullFields will be sent to the server as
  12808. // null. It is an error if a field in this list has a non-empty value.
  12809. // This may be used to include null fields in Patch requests.
  12810. NullFields []string `json:"-"`
  12811. }
  12812. func (s *InstanceGroupManagerStatus) MarshalJSON() ([]byte, error) {
  12813. type NoMethod InstanceGroupManagerStatus
  12814. raw := NoMethod(*s)
  12815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12816. }
  12817. type InstanceGroupManagerStatusStateful struct {
  12818. // IsStateful: [Output Only] A bit indicating whether the managed
  12819. // instance group is stateful, i.e. has any disks in Stateful Policy or
  12820. // at least one per-instance config. This is determined based on the
  12821. // user intent, the group may be reported as not stateful even when
  12822. // there is still some preserved state on managed instances.
  12823. IsStateful bool `json:"isStateful,omitempty"`
  12824. // ForceSendFields is a list of field names (e.g. "IsStateful") to
  12825. // unconditionally include in API requests. By default, fields with
  12826. // empty values are omitted from API requests. However, any non-pointer,
  12827. // non-interface field appearing in ForceSendFields will be sent to the
  12828. // server regardless of whether the field is empty or not. This may be
  12829. // used to include empty fields in Patch requests.
  12830. ForceSendFields []string `json:"-"`
  12831. // NullFields is a list of field names (e.g. "IsStateful") to include in
  12832. // API requests with the JSON null value. By default, fields with empty
  12833. // values are omitted from API requests. However, any field with an
  12834. // empty value appearing in NullFields will be sent to the server as
  12835. // null. It is an error if a field in this list has a non-empty value.
  12836. // This may be used to include null fields in Patch requests.
  12837. NullFields []string `json:"-"`
  12838. }
  12839. func (s *InstanceGroupManagerStatusStateful) MarshalJSON() ([]byte, error) {
  12840. type NoMethod InstanceGroupManagerStatusStateful
  12841. raw := NoMethod(*s)
  12842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12843. }
  12844. type InstanceGroupManagerStatusVersionTarget struct {
  12845. // IsReached: [Output Only] A bit indicating whether version target has
  12846. // been reached in this managed instance group, i.e. all instances are
  12847. // in their target version. Instances' target version are specified by
  12848. // version field on Instance Group Manager.
  12849. IsReached bool `json:"isReached,omitempty"`
  12850. // ForceSendFields is a list of field names (e.g. "IsReached") to
  12851. // unconditionally include in API requests. By default, fields with
  12852. // empty values are omitted from API requests. However, any non-pointer,
  12853. // non-interface field appearing in ForceSendFields will be sent to the
  12854. // server regardless of whether the field is empty or not. This may be
  12855. // used to include empty fields in Patch requests.
  12856. ForceSendFields []string `json:"-"`
  12857. // NullFields is a list of field names (e.g. "IsReached") to include in
  12858. // API requests with the JSON null value. By default, fields with empty
  12859. // values are omitted from API requests. However, any field with an
  12860. // empty value appearing in NullFields will be sent to the server as
  12861. // null. It is an error if a field in this list has a non-empty value.
  12862. // This may be used to include null fields in Patch requests.
  12863. NullFields []string `json:"-"`
  12864. }
  12865. func (s *InstanceGroupManagerStatusVersionTarget) MarshalJSON() ([]byte, error) {
  12866. type NoMethod InstanceGroupManagerStatusVersionTarget
  12867. raw := NoMethod(*s)
  12868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12869. }
  12870. type InstanceGroupManagerUpdatePolicy struct {
  12871. // Possible values:
  12872. // "NONE"
  12873. // "PROACTIVE"
  12874. InstanceRedistributionType string `json:"instanceRedistributionType,omitempty"`
  12875. // MaxSurge: The maximum number of instances that can be created above
  12876. // the specified targetSize during the update process. By default, a
  12877. // fixed value of 1 is used. This value can be either a fixed number or
  12878. // a percentage if the instance group has 10 or more instances. If you
  12879. // set a percentage, the number of instances will be rounded up if
  12880. // necessary.
  12881. //
  12882. // At least one of either maxSurge or maxUnavailable must be greater
  12883. // than 0. Learn more about maxSurge.
  12884. MaxSurge *FixedOrPercent `json:"maxSurge,omitempty"`
  12885. // MaxUnavailable: The maximum number of instances that can be
  12886. // unavailable during the update process. An instance is considered
  12887. // available if all of the following conditions are satisfied:
  12888. //
  12889. //
  12890. // - The instance's status is RUNNING.
  12891. // - If there is a health check on the instance group, the instance's
  12892. // liveness health check result must be HEALTHY at least once. If there
  12893. // is no health check on the group, then the instance only needs to have
  12894. // a status of RUNNING to be considered available. By default, a fixed
  12895. // value of 1 is used. This value can be either a fixed number or a
  12896. // percentage if the instance group has 10 or more instances. If you set
  12897. // a percentage, the number of instances will be rounded up if
  12898. // necessary.
  12899. //
  12900. // At least one of either maxSurge or maxUnavailable must be greater
  12901. // than 0. Learn more about maxUnavailable.
  12902. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  12903. // MinReadySec: Minimum number of seconds to wait for after a newly
  12904. // created instance becomes available. This value must be from range [0,
  12905. // 3600].
  12906. MinReadySec int64 `json:"minReadySec,omitempty"`
  12907. // MinimalAction: Minimal action to be taken on an instance. You can
  12908. // specify either RESTART to restart existing instances or REPLACE to
  12909. // delete and create new instances from the target template. If you
  12910. // specify a RESTART, the Updater will attempt to perform that action
  12911. // only. However, if the Updater determines that the minimal action you
  12912. // specify is not enough to perform the update, it might perform a more
  12913. // disruptive action.
  12914. //
  12915. // Possible values:
  12916. // "NONE"
  12917. // "REFRESH"
  12918. // "REPLACE"
  12919. // "RESTART"
  12920. MinimalAction string `json:"minimalAction,omitempty"`
  12921. // ReplacementMethod: What action should be used to replace instances.
  12922. // See minimal_action.REPLACE
  12923. //
  12924. // Possible values:
  12925. // "RECREATE"
  12926. // "SUBSTITUTE"
  12927. ReplacementMethod string `json:"replacementMethod,omitempty"`
  12928. // Possible values:
  12929. // "OPPORTUNISTIC"
  12930. // "PROACTIVE"
  12931. Type string `json:"type,omitempty"`
  12932. // ForceSendFields is a list of field names (e.g.
  12933. // "InstanceRedistributionType") to unconditionally include in API
  12934. // requests. By default, fields with empty values are omitted from API
  12935. // requests. However, any non-pointer, non-interface field appearing in
  12936. // ForceSendFields will be sent to the server regardless of whether the
  12937. // field is empty or not. This may be used to include empty fields in
  12938. // Patch requests.
  12939. ForceSendFields []string `json:"-"`
  12940. // NullFields is a list of field names (e.g.
  12941. // "InstanceRedistributionType") to include in API requests with the
  12942. // JSON null value. By default, fields with empty values are omitted
  12943. // from API requests. However, any field with an empty value appearing
  12944. // in NullFields will be sent to the server as null. It is an error if a
  12945. // field in this list has a non-empty value. This may be used to include
  12946. // null fields in Patch requests.
  12947. NullFields []string `json:"-"`
  12948. }
  12949. func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
  12950. type NoMethod InstanceGroupManagerUpdatePolicy
  12951. raw := NoMethod(*s)
  12952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12953. }
  12954. type InstanceGroupManagerVersion struct {
  12955. // InstanceTemplate: The URL of the instance template that is specified
  12956. // for this managed instance group. The group uses this template to
  12957. // create new instances in the managed instance group until the
  12958. // `targetSize` for this version is reached.
  12959. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  12960. // Name: Name of the version. Unique among all versions in the scope of
  12961. // this managed instance group.
  12962. Name string `json:"name,omitempty"`
  12963. // Tag: Tag describing the version. Used to trigger rollout of a target
  12964. // version even if instance_template remains unchanged. Deprecated in
  12965. // favor of 'name'.
  12966. Tag string `json:"tag,omitempty"`
  12967. // TargetSize: Specifies the intended number of instances to be created
  12968. // from the instanceTemplate. The final number of instances created from
  12969. // the template will be equal to:
  12970. // - If expressed as a fixed number, the minimum of either
  12971. // targetSize.fixed or instanceGroupManager.targetSize is used.
  12972. // - if expressed as a percent, the targetSize would be
  12973. // (targetSize.percent/100 * InstanceGroupManager.targetSize) If there
  12974. // is a remainder, the number is rounded up. If unset, this version
  12975. // will update any remaining instances not updated by another version.
  12976. // Read Starting a canary update for more information.
  12977. TargetSize *FixedOrPercent `json:"targetSize,omitempty"`
  12978. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  12979. // unconditionally include in API requests. By default, fields with
  12980. // empty values are omitted from API requests. However, any non-pointer,
  12981. // non-interface field appearing in ForceSendFields will be sent to the
  12982. // server regardless of whether the field is empty or not. This may be
  12983. // used to include empty fields in Patch requests.
  12984. ForceSendFields []string `json:"-"`
  12985. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  12986. // include in API requests with the JSON null value. By default, fields
  12987. // with empty values are omitted from API requests. However, any field
  12988. // with an empty value appearing in NullFields will be sent to the
  12989. // server as null. It is an error if a field in this list has a
  12990. // non-empty value. This may be used to include null fields in Patch
  12991. // requests.
  12992. NullFields []string `json:"-"`
  12993. }
  12994. func (s *InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
  12995. type NoMethod InstanceGroupManagerVersion
  12996. raw := NoMethod(*s)
  12997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12998. }
  12999. type InstanceGroupManagersAbandonInstancesRequest struct {
  13000. // Instances: The URLs of one or more instances to abandon. This can be
  13001. // a full URL or a partial URL, such as
  13002. // zones/[ZONE]/instances/[INSTANCE_NAME].
  13003. Instances []string `json:"instances,omitempty"`
  13004. // ForceSendFields is a list of field names (e.g. "Instances") to
  13005. // unconditionally include in API requests. By default, fields with
  13006. // empty values are omitted from API requests. However, any non-pointer,
  13007. // non-interface field appearing in ForceSendFields will be sent to the
  13008. // server regardless of whether the field is empty or not. This may be
  13009. // used to include empty fields in Patch requests.
  13010. ForceSendFields []string `json:"-"`
  13011. // NullFields is a list of field names (e.g. "Instances") to include in
  13012. // API requests with the JSON null value. By default, fields with empty
  13013. // values are omitted from API requests. However, any field with an
  13014. // empty value appearing in NullFields will be sent to the server as
  13015. // null. It is an error if a field in this list has a non-empty value.
  13016. // This may be used to include null fields in Patch requests.
  13017. NullFields []string `json:"-"`
  13018. }
  13019. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  13020. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  13021. raw := NoMethod(*s)
  13022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13023. }
  13024. // InstanceGroupManagersApplyUpdatesRequest:
  13025. // InstanceGroupManagers.applyUpdatesToInstances
  13026. type InstanceGroupManagersApplyUpdatesRequest struct {
  13027. // Instances: The list of URLs of one or more instances for which we
  13028. // want to apply updates on this managed instance group. This can be a
  13029. // full URL or a partial URL, such as
  13030. // zones/[ZONE]/instances/[INSTANCE_NAME].
  13031. Instances []string `json:"instances,omitempty"`
  13032. // MaximalAction: The maximal action that should be performed on the
  13033. // instances. By default REPLACE. This field is deprecated, please use
  13034. // most_disruptive_allowed_action.
  13035. //
  13036. // Possible values:
  13037. // "NONE"
  13038. // "REFRESH"
  13039. // "REPLACE"
  13040. // "RESTART"
  13041. MaximalAction string `json:"maximalAction,omitempty"`
  13042. // MinimalAction: The minimal action that should be perfomed on the
  13043. // instances. By default NONE.
  13044. //
  13045. // Possible values:
  13046. // "NONE"
  13047. // "REFRESH"
  13048. // "REPLACE"
  13049. // "RESTART"
  13050. MinimalAction string `json:"minimalAction,omitempty"`
  13051. // MostDisruptiveAllowedAction: The most disruptive action that allowed
  13052. // to be performed on the instances. By default REPLACE.
  13053. //
  13054. // Possible values:
  13055. // "NONE"
  13056. // "REFRESH"
  13057. // "REPLACE"
  13058. // "RESTART"
  13059. MostDisruptiveAllowedAction string `json:"mostDisruptiveAllowedAction,omitempty"`
  13060. // ForceSendFields is a list of field names (e.g. "Instances") to
  13061. // unconditionally include in API requests. By default, fields with
  13062. // empty values are omitted from API requests. However, any non-pointer,
  13063. // non-interface field appearing in ForceSendFields will be sent to the
  13064. // server regardless of whether the field is empty or not. This may be
  13065. // used to include empty fields in Patch requests.
  13066. ForceSendFields []string `json:"-"`
  13067. // NullFields is a list of field names (e.g. "Instances") to include in
  13068. // API requests with the JSON null value. By default, fields with empty
  13069. // values are omitted from API requests. However, any field with an
  13070. // empty value appearing in NullFields will be sent to the server as
  13071. // null. It is an error if a field in this list has a non-empty value.
  13072. // This may be used to include null fields in Patch requests.
  13073. NullFields []string `json:"-"`
  13074. }
  13075. func (s *InstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
  13076. type NoMethod InstanceGroupManagersApplyUpdatesRequest
  13077. raw := NoMethod(*s)
  13078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13079. }
  13080. // InstanceGroupManagersCreateInstancesRequest:
  13081. // InstanceGroupManagers.createInstances
  13082. type InstanceGroupManagersCreateInstancesRequest struct {
  13083. // Instances: [Required] List of specifications of per-instance configs.
  13084. Instances []*PerInstanceConfig `json:"instances,omitempty"`
  13085. // ForceSendFields is a list of field names (e.g. "Instances") to
  13086. // unconditionally include in API requests. By default, fields with
  13087. // empty values are omitted from API requests. However, any non-pointer,
  13088. // non-interface field appearing in ForceSendFields will be sent to the
  13089. // server regardless of whether the field is empty or not. This may be
  13090. // used to include empty fields in Patch requests.
  13091. ForceSendFields []string `json:"-"`
  13092. // NullFields is a list of field names (e.g. "Instances") to include in
  13093. // API requests with the JSON null value. By default, fields with empty
  13094. // values are omitted from API requests. However, any field with an
  13095. // empty value appearing in NullFields will be sent to the server as
  13096. // null. It is an error if a field in this list has a non-empty value.
  13097. // This may be used to include null fields in Patch requests.
  13098. NullFields []string `json:"-"`
  13099. }
  13100. func (s *InstanceGroupManagersCreateInstancesRequest) MarshalJSON() ([]byte, error) {
  13101. type NoMethod InstanceGroupManagersCreateInstancesRequest
  13102. raw := NoMethod(*s)
  13103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13104. }
  13105. type InstanceGroupManagersDeleteInstancesRequest struct {
  13106. // Instances: The URLs of one or more instances to delete. This can be a
  13107. // full URL or a partial URL, such as
  13108. // zones/[ZONE]/instances/[INSTANCE_NAME].
  13109. Instances []string `json:"instances,omitempty"`
  13110. // ForceSendFields is a list of field names (e.g. "Instances") to
  13111. // unconditionally include in API requests. By default, fields with
  13112. // empty values are omitted from API requests. However, any non-pointer,
  13113. // non-interface field appearing in ForceSendFields will be sent to the
  13114. // server regardless of whether the field is empty or not. This may be
  13115. // used to include empty fields in Patch requests.
  13116. ForceSendFields []string `json:"-"`
  13117. // NullFields is a list of field names (e.g. "Instances") to include in
  13118. // API requests with the JSON null value. By default, fields with empty
  13119. // values are omitted from API requests. However, any field with an
  13120. // empty value appearing in NullFields will be sent to the server as
  13121. // null. It is an error if a field in this list has a non-empty value.
  13122. // This may be used to include null fields in Patch requests.
  13123. NullFields []string `json:"-"`
  13124. }
  13125. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  13126. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  13127. raw := NoMethod(*s)
  13128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13129. }
  13130. // InstanceGroupManagersDeletePerInstanceConfigsReq:
  13131. // InstanceGroupManagers.deletePerInstanceConfigs
  13132. type InstanceGroupManagersDeletePerInstanceConfigsReq struct {
  13133. // Instances: The list of instances for which we want to delete
  13134. // per-instance configs on this managed instance group.
  13135. Instances []string `json:"instances,omitempty"`
  13136. // Names: The list of instance names for which we want to delete
  13137. // per-instance configs on this managed instance group.
  13138. Names []string `json:"names,omitempty"`
  13139. // ForceSendFields is a list of field names (e.g. "Instances") to
  13140. // unconditionally include in API requests. By default, fields with
  13141. // empty values are omitted from API requests. However, any non-pointer,
  13142. // non-interface field appearing in ForceSendFields will be sent to the
  13143. // server regardless of whether the field is empty or not. This may be
  13144. // used to include empty fields in Patch requests.
  13145. ForceSendFields []string `json:"-"`
  13146. // NullFields is a list of field names (e.g. "Instances") to include in
  13147. // API requests with the JSON null value. By default, fields with empty
  13148. // values are omitted from API requests. However, any field with an
  13149. // empty value appearing in NullFields will be sent to the server as
  13150. // null. It is an error if a field in this list has a non-empty value.
  13151. // This may be used to include null fields in Patch requests.
  13152. NullFields []string `json:"-"`
  13153. }
  13154. func (s *InstanceGroupManagersDeletePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
  13155. type NoMethod InstanceGroupManagersDeletePerInstanceConfigsReq
  13156. raw := NoMethod(*s)
  13157. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13158. }
  13159. type InstanceGroupManagersListManagedInstancesResponse struct {
  13160. // ManagedInstances: [Output Only] The list of instances in the managed
  13161. // instance group.
  13162. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  13163. // NextPageToken: [Output Only] This token allows you to get the next
  13164. // page of results for list requests. If the number of results is larger
  13165. // than maxResults, use the nextPageToken as a value for the query
  13166. // parameter pageToken in the next list request. Subsequent list
  13167. // requests will have their own nextPageToken to continue paging through
  13168. // the results.
  13169. NextPageToken string `json:"nextPageToken,omitempty"`
  13170. // ServerResponse contains the HTTP response code and headers from the
  13171. // server.
  13172. googleapi.ServerResponse `json:"-"`
  13173. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  13174. // unconditionally include in API requests. By default, fields with
  13175. // empty values are omitted from API requests. However, any non-pointer,
  13176. // non-interface field appearing in ForceSendFields will be sent to the
  13177. // server regardless of whether the field is empty or not. This may be
  13178. // used to include empty fields in Patch requests.
  13179. ForceSendFields []string `json:"-"`
  13180. // NullFields is a list of field names (e.g. "ManagedInstances") to
  13181. // include in API requests with the JSON null value. By default, fields
  13182. // with empty values are omitted from API requests. However, any field
  13183. // with an empty value appearing in NullFields will be sent to the
  13184. // server as null. It is an error if a field in this list has a
  13185. // non-empty value. This may be used to include null fields in Patch
  13186. // requests.
  13187. NullFields []string `json:"-"`
  13188. }
  13189. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  13190. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  13191. raw := NoMethod(*s)
  13192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13193. }
  13194. type InstanceGroupManagersListPerInstanceConfigsResp struct {
  13195. // Items: [Output Only] The list of PerInstanceConfig.
  13196. Items []*PerInstanceConfig `json:"items,omitempty"`
  13197. // NextPageToken: [Output Only] This token allows you to get the next
  13198. // page of results for list requests. If the number of results is larger
  13199. // than maxResults, use the nextPageToken as a value for the query
  13200. // parameter pageToken in the next list request. Subsequent list
  13201. // requests will have their own nextPageToken to continue paging through
  13202. // the results.
  13203. NextPageToken string `json:"nextPageToken,omitempty"`
  13204. // Warning: [Output Only] Informational warning message.
  13205. Warning *InstanceGroupManagersListPerInstanceConfigsRespWarning `json:"warning,omitempty"`
  13206. // ServerResponse contains the HTTP response code and headers from the
  13207. // server.
  13208. googleapi.ServerResponse `json:"-"`
  13209. // ForceSendFields is a list of field names (e.g. "Items") to
  13210. // unconditionally include in API requests. By default, fields with
  13211. // empty values are omitted from API requests. However, any non-pointer,
  13212. // non-interface field appearing in ForceSendFields will be sent to the
  13213. // server regardless of whether the field is empty or not. This may be
  13214. // used to include empty fields in Patch requests.
  13215. ForceSendFields []string `json:"-"`
  13216. // NullFields is a list of field names (e.g. "Items") to include in API
  13217. // requests with the JSON null value. By default, fields with empty
  13218. // values are omitted from API requests. However, any field with an
  13219. // empty value appearing in NullFields will be sent to the server as
  13220. // null. It is an error if a field in this list has a non-empty value.
  13221. // This may be used to include null fields in Patch requests.
  13222. NullFields []string `json:"-"`
  13223. }
  13224. func (s *InstanceGroupManagersListPerInstanceConfigsResp) MarshalJSON() ([]byte, error) {
  13225. type NoMethod InstanceGroupManagersListPerInstanceConfigsResp
  13226. raw := NoMethod(*s)
  13227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13228. }
  13229. // InstanceGroupManagersListPerInstanceConfigsRespWarning: [Output Only]
  13230. // Informational warning message.
  13231. type InstanceGroupManagersListPerInstanceConfigsRespWarning struct {
  13232. // Code: [Output Only] A warning code, if applicable. For example,
  13233. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13234. // the response.
  13235. //
  13236. // Possible values:
  13237. // "CLEANUP_FAILED"
  13238. // "DEPRECATED_RESOURCE_USED"
  13239. // "DEPRECATED_TYPE_USED"
  13240. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13241. // "EXPERIMENTAL_TYPE_USED"
  13242. // "EXTERNAL_API_WARNING"
  13243. // "FIELD_VALUE_OVERRIDEN"
  13244. // "INJECTED_KERNELS_DEPRECATED"
  13245. // "MISSING_TYPE_DEPENDENCY"
  13246. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13247. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13248. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13249. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13250. // "NEXT_HOP_NOT_RUNNING"
  13251. // "NOT_CRITICAL_ERROR"
  13252. // "NO_RESULTS_ON_PAGE"
  13253. // "REQUIRED_TOS_AGREEMENT"
  13254. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13255. // "RESOURCE_NOT_DELETED"
  13256. // "SCHEMA_VALIDATION_IGNORED"
  13257. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13258. // "UNDECLARED_PROPERTIES"
  13259. // "UNREACHABLE"
  13260. Code string `json:"code,omitempty"`
  13261. // Data: [Output Only] Metadata about this warning in key: value format.
  13262. // For example:
  13263. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13264. Data []*InstanceGroupManagersListPerInstanceConfigsRespWarningData `json:"data,omitempty"`
  13265. // Message: [Output Only] A human-readable description of the warning
  13266. // code.
  13267. Message string `json:"message,omitempty"`
  13268. // ForceSendFields is a list of field names (e.g. "Code") to
  13269. // unconditionally include in API requests. By default, fields with
  13270. // empty values are omitted from API requests. However, any non-pointer,
  13271. // non-interface field appearing in ForceSendFields will be sent to the
  13272. // server regardless of whether the field is empty or not. This may be
  13273. // used to include empty fields in Patch requests.
  13274. ForceSendFields []string `json:"-"`
  13275. // NullFields is a list of field names (e.g. "Code") to include in API
  13276. // requests with the JSON null value. By default, fields with empty
  13277. // values are omitted from API requests. However, any field with an
  13278. // empty value appearing in NullFields will be sent to the server as
  13279. // null. It is an error if a field in this list has a non-empty value.
  13280. // This may be used to include null fields in Patch requests.
  13281. NullFields []string `json:"-"`
  13282. }
  13283. func (s *InstanceGroupManagersListPerInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
  13284. type NoMethod InstanceGroupManagersListPerInstanceConfigsRespWarning
  13285. raw := NoMethod(*s)
  13286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13287. }
  13288. type InstanceGroupManagersListPerInstanceConfigsRespWarningData struct {
  13289. // Key: [Output Only] A key that provides more detail on the warning
  13290. // being returned. For example, for warnings where there are no results
  13291. // in a list request for a particular zone, this key might be scope and
  13292. // the key value might be the zone name. Other examples might be a key
  13293. // indicating a deprecated resource and a suggested replacement, or a
  13294. // warning about invalid network settings (for example, if an instance
  13295. // attempts to perform IP forwarding but is not enabled for IP
  13296. // forwarding).
  13297. Key string `json:"key,omitempty"`
  13298. // Value: [Output Only] A warning data value corresponding to the key.
  13299. Value string `json:"value,omitempty"`
  13300. // ForceSendFields is a list of field names (e.g. "Key") to
  13301. // unconditionally include in API requests. By default, fields with
  13302. // empty values are omitted from API requests. However, any non-pointer,
  13303. // non-interface field appearing in ForceSendFields will be sent to the
  13304. // server regardless of whether the field is empty or not. This may be
  13305. // used to include empty fields in Patch requests.
  13306. ForceSendFields []string `json:"-"`
  13307. // NullFields is a list of field names (e.g. "Key") to include in API
  13308. // requests with the JSON null value. By default, fields with empty
  13309. // values are omitted from API requests. However, any field with an
  13310. // empty value appearing in NullFields will be sent to the server as
  13311. // null. It is an error if a field in this list has a non-empty value.
  13312. // This may be used to include null fields in Patch requests.
  13313. NullFields []string `json:"-"`
  13314. }
  13315. func (s *InstanceGroupManagersListPerInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
  13316. type NoMethod InstanceGroupManagersListPerInstanceConfigsRespWarningData
  13317. raw := NoMethod(*s)
  13318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13319. }
  13320. // InstanceGroupManagersPatchPerInstanceConfigsReq:
  13321. // InstanceGroupManagers.patchPerInstanceConfigs
  13322. type InstanceGroupManagersPatchPerInstanceConfigsReq struct {
  13323. // PerInstanceConfigs: The list of per-instance configs to insert or
  13324. // patch on this managed instance group.
  13325. PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
  13326. // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
  13327. // to unconditionally include in API requests. By default, fields with
  13328. // empty values are omitted from API requests. However, any non-pointer,
  13329. // non-interface field appearing in ForceSendFields will be sent to the
  13330. // server regardless of whether the field is empty or not. This may be
  13331. // used to include empty fields in Patch requests.
  13332. ForceSendFields []string `json:"-"`
  13333. // NullFields is a list of field names (e.g. "PerInstanceConfigs") to
  13334. // include in API requests with the JSON null value. By default, fields
  13335. // with empty values are omitted from API requests. However, any field
  13336. // with an empty value appearing in NullFields will be sent to the
  13337. // server as null. It is an error if a field in this list has a
  13338. // non-empty value. This may be used to include null fields in Patch
  13339. // requests.
  13340. NullFields []string `json:"-"`
  13341. }
  13342. func (s *InstanceGroupManagersPatchPerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
  13343. type NoMethod InstanceGroupManagersPatchPerInstanceConfigsReq
  13344. raw := NoMethod(*s)
  13345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13346. }
  13347. type InstanceGroupManagersRecreateInstancesRequest struct {
  13348. // Instances: The URLs of one or more instances to recreate. This can be
  13349. // a full URL or a partial URL, such as
  13350. // zones/[ZONE]/instances/[INSTANCE_NAME].
  13351. Instances []string `json:"instances,omitempty"`
  13352. // ForceSendFields is a list of field names (e.g. "Instances") to
  13353. // unconditionally include in API requests. By default, fields with
  13354. // empty values are omitted from API requests. However, any non-pointer,
  13355. // non-interface field appearing in ForceSendFields will be sent to the
  13356. // server regardless of whether the field is empty or not. This may be
  13357. // used to include empty fields in Patch requests.
  13358. ForceSendFields []string `json:"-"`
  13359. // NullFields is a list of field names (e.g. "Instances") to include in
  13360. // API requests with the JSON null value. By default, fields with empty
  13361. // values are omitted from API requests. However, any field with an
  13362. // empty value appearing in NullFields will be sent to the server as
  13363. // null. It is an error if a field in this list has a non-empty value.
  13364. // This may be used to include null fields in Patch requests.
  13365. NullFields []string `json:"-"`
  13366. }
  13367. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  13368. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  13369. raw := NoMethod(*s)
  13370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13371. }
  13372. type InstanceGroupManagersResizeAdvancedRequest struct {
  13373. // NoCreationRetries: If this flag is true, the managed instance group
  13374. // attempts to create all instances initiated by this resize request
  13375. // only once. If there is an error during creation, the managed instance
  13376. // group does not retry create this instance, and we will decrease the
  13377. // targetSize of the request instead. If the flag is false, the group
  13378. // attempts to recreate each instance continuously until it
  13379. // succeeds.
  13380. //
  13381. // This flag matters only in the first attempt of creation of an
  13382. // instance. After an instance is successfully created while this flag
  13383. // is enabled, the instance behaves the same way as all the other
  13384. // instances created with a regular resize request. In particular, if a
  13385. // running instance dies unexpectedly at a later time and needs to be
  13386. // recreated, this mode does not affect the recreation behavior in that
  13387. // scenario.
  13388. //
  13389. // This flag is applicable only to the current resize request. It does
  13390. // not influence other resize requests in any way.
  13391. //
  13392. // You can see which instances is being creating in which mode by
  13393. // calling the get or listManagedInstances API.
  13394. NoCreationRetries bool `json:"noCreationRetries,omitempty"`
  13395. // TargetSize: The number of running instances that the managed instance
  13396. // group should maintain at any given time. The group automatically adds
  13397. // or removes instances to maintain the number of instances specified by
  13398. // this parameter.
  13399. TargetSize int64 `json:"targetSize,omitempty"`
  13400. // ForceSendFields is a list of field names (e.g. "NoCreationRetries")
  13401. // to unconditionally include in API requests. By default, fields with
  13402. // empty values are omitted from API requests. However, any non-pointer,
  13403. // non-interface field appearing in ForceSendFields will be sent to the
  13404. // server regardless of whether the field is empty or not. This may be
  13405. // used to include empty fields in Patch requests.
  13406. ForceSendFields []string `json:"-"`
  13407. // NullFields is a list of field names (e.g. "NoCreationRetries") to
  13408. // include in API requests with the JSON null value. By default, fields
  13409. // with empty values are omitted from API requests. However, any field
  13410. // with an empty value appearing in NullFields will be sent to the
  13411. // server as null. It is an error if a field in this list has a
  13412. // non-empty value. This may be used to include null fields in Patch
  13413. // requests.
  13414. NullFields []string `json:"-"`
  13415. }
  13416. func (s *InstanceGroupManagersResizeAdvancedRequest) MarshalJSON() ([]byte, error) {
  13417. type NoMethod InstanceGroupManagersResizeAdvancedRequest
  13418. raw := NoMethod(*s)
  13419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13420. }
  13421. type InstanceGroupManagersScopedList struct {
  13422. // InstanceGroupManagers: [Output Only] The list of managed instance
  13423. // groups that are contained in the specified project and zone.
  13424. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  13425. // Warning: [Output Only] The warning that replaces the list of managed
  13426. // instance groups when the list is empty.
  13427. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  13428. // ForceSendFields is a list of field names (e.g.
  13429. // "InstanceGroupManagers") to unconditionally include in API requests.
  13430. // By default, fields with empty values are omitted from API requests.
  13431. // However, any non-pointer, non-interface field appearing in
  13432. // ForceSendFields will be sent to the server regardless of whether the
  13433. // field is empty or not. This may be used to include empty fields in
  13434. // Patch requests.
  13435. ForceSendFields []string `json:"-"`
  13436. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  13437. // include in API requests with the JSON null value. By default, fields
  13438. // with empty values are omitted from API requests. However, any field
  13439. // with an empty value appearing in NullFields will be sent to the
  13440. // server as null. It is an error if a field in this list has a
  13441. // non-empty value. This may be used to include null fields in Patch
  13442. // requests.
  13443. NullFields []string `json:"-"`
  13444. }
  13445. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  13446. type NoMethod InstanceGroupManagersScopedList
  13447. raw := NoMethod(*s)
  13448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13449. }
  13450. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  13451. // that replaces the list of managed instance groups when the list is
  13452. // empty.
  13453. type InstanceGroupManagersScopedListWarning struct {
  13454. // Code: [Output Only] A warning code, if applicable. For example,
  13455. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13456. // the response.
  13457. //
  13458. // Possible values:
  13459. // "CLEANUP_FAILED"
  13460. // "DEPRECATED_RESOURCE_USED"
  13461. // "DEPRECATED_TYPE_USED"
  13462. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13463. // "EXPERIMENTAL_TYPE_USED"
  13464. // "EXTERNAL_API_WARNING"
  13465. // "FIELD_VALUE_OVERRIDEN"
  13466. // "INJECTED_KERNELS_DEPRECATED"
  13467. // "MISSING_TYPE_DEPENDENCY"
  13468. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13469. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13470. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13471. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13472. // "NEXT_HOP_NOT_RUNNING"
  13473. // "NOT_CRITICAL_ERROR"
  13474. // "NO_RESULTS_ON_PAGE"
  13475. // "REQUIRED_TOS_AGREEMENT"
  13476. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13477. // "RESOURCE_NOT_DELETED"
  13478. // "SCHEMA_VALIDATION_IGNORED"
  13479. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13480. // "UNDECLARED_PROPERTIES"
  13481. // "UNREACHABLE"
  13482. Code string `json:"code,omitempty"`
  13483. // Data: [Output Only] Metadata about this warning in key: value format.
  13484. // For example:
  13485. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13486. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  13487. // Message: [Output Only] A human-readable description of the warning
  13488. // code.
  13489. Message string `json:"message,omitempty"`
  13490. // ForceSendFields is a list of field names (e.g. "Code") to
  13491. // unconditionally include in API requests. By default, fields with
  13492. // empty values are omitted from API requests. However, any non-pointer,
  13493. // non-interface field appearing in ForceSendFields will be sent to the
  13494. // server regardless of whether the field is empty or not. This may be
  13495. // used to include empty fields in Patch requests.
  13496. ForceSendFields []string `json:"-"`
  13497. // NullFields is a list of field names (e.g. "Code") to include in API
  13498. // requests with the JSON null value. By default, fields with empty
  13499. // values are omitted from API requests. However, any field with an
  13500. // empty value appearing in NullFields will be sent to the server as
  13501. // null. It is an error if a field in this list has a non-empty value.
  13502. // This may be used to include null fields in Patch requests.
  13503. NullFields []string `json:"-"`
  13504. }
  13505. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  13506. type NoMethod InstanceGroupManagersScopedListWarning
  13507. raw := NoMethod(*s)
  13508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13509. }
  13510. type InstanceGroupManagersScopedListWarningData struct {
  13511. // Key: [Output Only] A key that provides more detail on the warning
  13512. // being returned. For example, for warnings where there are no results
  13513. // in a list request for a particular zone, this key might be scope and
  13514. // the key value might be the zone name. Other examples might be a key
  13515. // indicating a deprecated resource and a suggested replacement, or a
  13516. // warning about invalid network settings (for example, if an instance
  13517. // attempts to perform IP forwarding but is not enabled for IP
  13518. // forwarding).
  13519. Key string `json:"key,omitempty"`
  13520. // Value: [Output Only] A warning data value corresponding to the key.
  13521. Value string `json:"value,omitempty"`
  13522. // ForceSendFields is a list of field names (e.g. "Key") to
  13523. // unconditionally include in API requests. By default, fields with
  13524. // empty values are omitted from API requests. However, any non-pointer,
  13525. // non-interface field appearing in ForceSendFields will be sent to the
  13526. // server regardless of whether the field is empty or not. This may be
  13527. // used to include empty fields in Patch requests.
  13528. ForceSendFields []string `json:"-"`
  13529. // NullFields is a list of field names (e.g. "Key") to include in API
  13530. // requests with the JSON null value. By default, fields with empty
  13531. // values are omitted from API requests. However, any field with an
  13532. // empty value appearing in NullFields will be sent to the server as
  13533. // null. It is an error if a field in this list has a non-empty value.
  13534. // This may be used to include null fields in Patch requests.
  13535. NullFields []string `json:"-"`
  13536. }
  13537. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  13538. type NoMethod InstanceGroupManagersScopedListWarningData
  13539. raw := NoMethod(*s)
  13540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13541. }
  13542. type InstanceGroupManagersSetAutoHealingRequest struct {
  13543. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  13544. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  13545. // to unconditionally include in API requests. By default, fields with
  13546. // empty values are omitted from API requests. However, any non-pointer,
  13547. // non-interface field appearing in ForceSendFields will be sent to the
  13548. // server regardless of whether the field is empty or not. This may be
  13549. // used to include empty fields in Patch requests.
  13550. ForceSendFields []string `json:"-"`
  13551. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  13552. // include in API requests with the JSON null value. By default, fields
  13553. // with empty values are omitted from API requests. However, any field
  13554. // with an empty value appearing in NullFields will be sent to the
  13555. // server as null. It is an error if a field in this list has a
  13556. // non-empty value. This may be used to include null fields in Patch
  13557. // requests.
  13558. NullFields []string `json:"-"`
  13559. }
  13560. func (s *InstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  13561. type NoMethod InstanceGroupManagersSetAutoHealingRequest
  13562. raw := NoMethod(*s)
  13563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13564. }
  13565. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  13566. // InstanceTemplate: The URL of the instance template that is specified
  13567. // for this managed instance group. The group uses this template to
  13568. // create all new instances in the managed instance group.
  13569. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  13570. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  13571. // unconditionally include in API requests. By default, fields with
  13572. // empty values are omitted from API requests. However, any non-pointer,
  13573. // non-interface field appearing in ForceSendFields will be sent to the
  13574. // server regardless of whether the field is empty or not. This may be
  13575. // used to include empty fields in Patch requests.
  13576. ForceSendFields []string `json:"-"`
  13577. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  13578. // include in API requests with the JSON null value. By default, fields
  13579. // with empty values are omitted from API requests. However, any field
  13580. // with an empty value appearing in NullFields will be sent to the
  13581. // server as null. It is an error if a field in this list has a
  13582. // non-empty value. This may be used to include null fields in Patch
  13583. // requests.
  13584. NullFields []string `json:"-"`
  13585. }
  13586. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  13587. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  13588. raw := NoMethod(*s)
  13589. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13590. }
  13591. type InstanceGroupManagersSetTargetPoolsRequest struct {
  13592. // Fingerprint: The fingerprint of the target pools information. Use
  13593. // this optional property to prevent conflicts when multiple users
  13594. // change the target pools settings concurrently. Obtain the fingerprint
  13595. // with the instanceGroupManagers.get method. Then, include the
  13596. // fingerprint in your request to ensure that you do not overwrite
  13597. // changes that were applied from another concurrent request.
  13598. Fingerprint string `json:"fingerprint,omitempty"`
  13599. // TargetPools: The list of target pool URLs that instances in this
  13600. // managed instance group belong to. The managed instance group applies
  13601. // these target pools to all of the instances in the group. Existing
  13602. // instances and new instances in the group all receive these target
  13603. // pool settings.
  13604. TargetPools []string `json:"targetPools,omitempty"`
  13605. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  13606. // unconditionally include in API requests. By default, fields with
  13607. // empty values are omitted from API requests. However, any non-pointer,
  13608. // non-interface field appearing in ForceSendFields will be sent to the
  13609. // server regardless of whether the field is empty or not. This may be
  13610. // used to include empty fields in Patch requests.
  13611. ForceSendFields []string `json:"-"`
  13612. // NullFields is a list of field names (e.g. "Fingerprint") to include
  13613. // in API requests with the JSON null value. By default, fields with
  13614. // empty values are omitted from API requests. However, any field with
  13615. // an empty value appearing in NullFields will be sent to the server as
  13616. // null. It is an error if a field in this list has a non-empty value.
  13617. // This may be used to include null fields in Patch requests.
  13618. NullFields []string `json:"-"`
  13619. }
  13620. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  13621. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  13622. raw := NoMethod(*s)
  13623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13624. }
  13625. // InstanceGroupManagersUpdatePerInstanceConfigsReq:
  13626. // InstanceGroupManagers.updatePerInstanceConfigs
  13627. type InstanceGroupManagersUpdatePerInstanceConfigsReq struct {
  13628. // PerInstanceConfigs: The list of per-instance configs to insert or
  13629. // patch on this managed instance group.
  13630. PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
  13631. // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
  13632. // to unconditionally include in API requests. By default, fields with
  13633. // empty values are omitted from API requests. However, any non-pointer,
  13634. // non-interface field appearing in ForceSendFields will be sent to the
  13635. // server regardless of whether the field is empty or not. This may be
  13636. // used to include empty fields in Patch requests.
  13637. ForceSendFields []string `json:"-"`
  13638. // NullFields is a list of field names (e.g. "PerInstanceConfigs") to
  13639. // include in API requests with the JSON null value. By default, fields
  13640. // with empty values are omitted from API requests. However, any field
  13641. // with an empty value appearing in NullFields will be sent to the
  13642. // server as null. It is an error if a field in this list has a
  13643. // non-empty value. This may be used to include null fields in Patch
  13644. // requests.
  13645. NullFields []string `json:"-"`
  13646. }
  13647. func (s *InstanceGroupManagersUpdatePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
  13648. type NoMethod InstanceGroupManagersUpdatePerInstanceConfigsReq
  13649. raw := NoMethod(*s)
  13650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13651. }
  13652. type InstanceGroupsAddInstancesRequest struct {
  13653. // Instances: The list of instances to add to the instance group.
  13654. Instances []*InstanceReference `json:"instances,omitempty"`
  13655. // ForceSendFields is a list of field names (e.g. "Instances") to
  13656. // unconditionally include in API requests. By default, fields with
  13657. // empty values are omitted from API requests. However, any non-pointer,
  13658. // non-interface field appearing in ForceSendFields will be sent to the
  13659. // server regardless of whether the field is empty or not. This may be
  13660. // used to include empty fields in Patch requests.
  13661. ForceSendFields []string `json:"-"`
  13662. // NullFields is a list of field names (e.g. "Instances") to include in
  13663. // API requests with the JSON null value. By default, fields with empty
  13664. // values are omitted from API requests. However, any field with an
  13665. // empty value appearing in NullFields will be sent to the server as
  13666. // null. It is an error if a field in this list has a non-empty value.
  13667. // This may be used to include null fields in Patch requests.
  13668. NullFields []string `json:"-"`
  13669. }
  13670. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  13671. type NoMethod InstanceGroupsAddInstancesRequest
  13672. raw := NoMethod(*s)
  13673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13674. }
  13675. type InstanceGroupsListInstances struct {
  13676. // Id: [Output Only] Unique identifier for the resource; defined by the
  13677. // server.
  13678. Id string `json:"id,omitempty"`
  13679. // Items: A list of InstanceWithNamedPorts resources.
  13680. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  13681. // Kind: [Output Only] The resource type, which is always
  13682. // compute#instanceGroupsListInstances for the list of instances in the
  13683. // specified instance group.
  13684. Kind string `json:"kind,omitempty"`
  13685. // NextPageToken: [Output Only] This token allows you to get the next
  13686. // page of results for list requests. If the number of results is larger
  13687. // than maxResults, use the nextPageToken as a value for the query
  13688. // parameter pageToken in the next list request. Subsequent list
  13689. // requests will have their own nextPageToken to continue paging through
  13690. // the results.
  13691. NextPageToken string `json:"nextPageToken,omitempty"`
  13692. // SelfLink: [Output Only] Server-defined URL for this resource.
  13693. SelfLink string `json:"selfLink,omitempty"`
  13694. // Warning: [Output Only] Informational warning message.
  13695. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  13696. // ServerResponse contains the HTTP response code and headers from the
  13697. // server.
  13698. googleapi.ServerResponse `json:"-"`
  13699. // ForceSendFields is a list of field names (e.g. "Id") to
  13700. // unconditionally include in API requests. By default, fields with
  13701. // empty values are omitted from API requests. However, any non-pointer,
  13702. // non-interface field appearing in ForceSendFields will be sent to the
  13703. // server regardless of whether the field is empty or not. This may be
  13704. // used to include empty fields in Patch requests.
  13705. ForceSendFields []string `json:"-"`
  13706. // NullFields is a list of field names (e.g. "Id") to include in API
  13707. // requests with the JSON null value. By default, fields with empty
  13708. // values are omitted from API requests. However, any field with an
  13709. // empty value appearing in NullFields will be sent to the server as
  13710. // null. It is an error if a field in this list has a non-empty value.
  13711. // This may be used to include null fields in Patch requests.
  13712. NullFields []string `json:"-"`
  13713. }
  13714. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  13715. type NoMethod InstanceGroupsListInstances
  13716. raw := NoMethod(*s)
  13717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13718. }
  13719. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  13720. // warning message.
  13721. type InstanceGroupsListInstancesWarning struct {
  13722. // Code: [Output Only] A warning code, if applicable. For example,
  13723. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13724. // the response.
  13725. //
  13726. // Possible values:
  13727. // "CLEANUP_FAILED"
  13728. // "DEPRECATED_RESOURCE_USED"
  13729. // "DEPRECATED_TYPE_USED"
  13730. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13731. // "EXPERIMENTAL_TYPE_USED"
  13732. // "EXTERNAL_API_WARNING"
  13733. // "FIELD_VALUE_OVERRIDEN"
  13734. // "INJECTED_KERNELS_DEPRECATED"
  13735. // "MISSING_TYPE_DEPENDENCY"
  13736. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13737. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13738. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13739. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13740. // "NEXT_HOP_NOT_RUNNING"
  13741. // "NOT_CRITICAL_ERROR"
  13742. // "NO_RESULTS_ON_PAGE"
  13743. // "REQUIRED_TOS_AGREEMENT"
  13744. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13745. // "RESOURCE_NOT_DELETED"
  13746. // "SCHEMA_VALIDATION_IGNORED"
  13747. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13748. // "UNDECLARED_PROPERTIES"
  13749. // "UNREACHABLE"
  13750. Code string `json:"code,omitempty"`
  13751. // Data: [Output Only] Metadata about this warning in key: value format.
  13752. // For example:
  13753. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13754. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  13755. // Message: [Output Only] A human-readable description of the warning
  13756. // code.
  13757. Message string `json:"message,omitempty"`
  13758. // ForceSendFields is a list of field names (e.g. "Code") to
  13759. // unconditionally include in API requests. By default, fields with
  13760. // empty values are omitted from API requests. However, any non-pointer,
  13761. // non-interface field appearing in ForceSendFields will be sent to the
  13762. // server regardless of whether the field is empty or not. This may be
  13763. // used to include empty fields in Patch requests.
  13764. ForceSendFields []string `json:"-"`
  13765. // NullFields is a list of field names (e.g. "Code") to include in API
  13766. // requests with the JSON null value. By default, fields with empty
  13767. // values are omitted from API requests. However, any field with an
  13768. // empty value appearing in NullFields will be sent to the server as
  13769. // null. It is an error if a field in this list has a non-empty value.
  13770. // This may be used to include null fields in Patch requests.
  13771. NullFields []string `json:"-"`
  13772. }
  13773. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  13774. type NoMethod InstanceGroupsListInstancesWarning
  13775. raw := NoMethod(*s)
  13776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13777. }
  13778. type InstanceGroupsListInstancesWarningData struct {
  13779. // Key: [Output Only] A key that provides more detail on the warning
  13780. // being returned. For example, for warnings where there are no results
  13781. // in a list request for a particular zone, this key might be scope and
  13782. // the key value might be the zone name. Other examples might be a key
  13783. // indicating a deprecated resource and a suggested replacement, or a
  13784. // warning about invalid network settings (for example, if an instance
  13785. // attempts to perform IP forwarding but is not enabled for IP
  13786. // forwarding).
  13787. Key string `json:"key,omitempty"`
  13788. // Value: [Output Only] A warning data value corresponding to the key.
  13789. Value string `json:"value,omitempty"`
  13790. // ForceSendFields is a list of field names (e.g. "Key") to
  13791. // unconditionally include in API requests. By default, fields with
  13792. // empty values are omitted from API requests. However, any non-pointer,
  13793. // non-interface field appearing in ForceSendFields will be sent to the
  13794. // server regardless of whether the field is empty or not. This may be
  13795. // used to include empty fields in Patch requests.
  13796. ForceSendFields []string `json:"-"`
  13797. // NullFields is a list of field names (e.g. "Key") to include in API
  13798. // requests with the JSON null value. By default, fields with empty
  13799. // values are omitted from API requests. However, any field with an
  13800. // empty value appearing in NullFields will be sent to the server as
  13801. // null. It is an error if a field in this list has a non-empty value.
  13802. // This may be used to include null fields in Patch requests.
  13803. NullFields []string `json:"-"`
  13804. }
  13805. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  13806. type NoMethod InstanceGroupsListInstancesWarningData
  13807. raw := NoMethod(*s)
  13808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13809. }
  13810. type InstanceGroupsListInstancesRequest struct {
  13811. // InstanceState: A filter for the state of the instances in the
  13812. // instance group. Valid options are ALL or RUNNING. If you do not
  13813. // specify this parameter the list includes all instances regardless of
  13814. // their state.
  13815. //
  13816. // Possible values:
  13817. // "ALL"
  13818. // "RUNNING"
  13819. InstanceState string `json:"instanceState,omitempty"`
  13820. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  13821. // unconditionally include in API requests. By default, fields with
  13822. // empty values are omitted from API requests. However, any non-pointer,
  13823. // non-interface field appearing in ForceSendFields will be sent to the
  13824. // server regardless of whether the field is empty or not. This may be
  13825. // used to include empty fields in Patch requests.
  13826. ForceSendFields []string `json:"-"`
  13827. // NullFields is a list of field names (e.g. "InstanceState") to include
  13828. // in API requests with the JSON null value. By default, fields with
  13829. // empty values are omitted from API requests. However, any field with
  13830. // an empty value appearing in NullFields will be sent to the server as
  13831. // null. It is an error if a field in this list has a non-empty value.
  13832. // This may be used to include null fields in Patch requests.
  13833. NullFields []string `json:"-"`
  13834. }
  13835. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  13836. type NoMethod InstanceGroupsListInstancesRequest
  13837. raw := NoMethod(*s)
  13838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13839. }
  13840. type InstanceGroupsRemoveInstancesRequest struct {
  13841. // Instances: The list of instances to remove from the instance group.
  13842. Instances []*InstanceReference `json:"instances,omitempty"`
  13843. // ForceSendFields is a list of field names (e.g. "Instances") to
  13844. // unconditionally include in API requests. By default, fields with
  13845. // empty values are omitted from API requests. However, any non-pointer,
  13846. // non-interface field appearing in ForceSendFields will be sent to the
  13847. // server regardless of whether the field is empty or not. This may be
  13848. // used to include empty fields in Patch requests.
  13849. ForceSendFields []string `json:"-"`
  13850. // NullFields is a list of field names (e.g. "Instances") to include in
  13851. // API requests with the JSON null value. By default, fields with empty
  13852. // values are omitted from API requests. However, any field with an
  13853. // empty value appearing in NullFields will be sent to the server as
  13854. // null. It is an error if a field in this list has a non-empty value.
  13855. // This may be used to include null fields in Patch requests.
  13856. NullFields []string `json:"-"`
  13857. }
  13858. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  13859. type NoMethod InstanceGroupsRemoveInstancesRequest
  13860. raw := NoMethod(*s)
  13861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13862. }
  13863. type InstanceGroupsScopedList struct {
  13864. // InstanceGroups: [Output Only] The list of instance groups that are
  13865. // contained in this scope.
  13866. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  13867. // Warning: [Output Only] An informational warning that replaces the
  13868. // list of instance groups when the list is empty.
  13869. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  13870. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  13871. // unconditionally include in API requests. By default, fields with
  13872. // empty values are omitted from API requests. However, any non-pointer,
  13873. // non-interface field appearing in ForceSendFields will be sent to the
  13874. // server regardless of whether the field is empty or not. This may be
  13875. // used to include empty fields in Patch requests.
  13876. ForceSendFields []string `json:"-"`
  13877. // NullFields is a list of field names (e.g. "InstanceGroups") to
  13878. // include in API requests with the JSON null value. By default, fields
  13879. // with empty values are omitted from API requests. However, any field
  13880. // with an empty value appearing in NullFields will be sent to the
  13881. // server as null. It is an error if a field in this list has a
  13882. // non-empty value. This may be used to include null fields in Patch
  13883. // requests.
  13884. NullFields []string `json:"-"`
  13885. }
  13886. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  13887. type NoMethod InstanceGroupsScopedList
  13888. raw := NoMethod(*s)
  13889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13890. }
  13891. // InstanceGroupsScopedListWarning: [Output Only] An informational
  13892. // warning that replaces the list of instance groups when the list is
  13893. // empty.
  13894. type InstanceGroupsScopedListWarning struct {
  13895. // Code: [Output Only] A warning code, if applicable. For example,
  13896. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13897. // the response.
  13898. //
  13899. // Possible values:
  13900. // "CLEANUP_FAILED"
  13901. // "DEPRECATED_RESOURCE_USED"
  13902. // "DEPRECATED_TYPE_USED"
  13903. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13904. // "EXPERIMENTAL_TYPE_USED"
  13905. // "EXTERNAL_API_WARNING"
  13906. // "FIELD_VALUE_OVERRIDEN"
  13907. // "INJECTED_KERNELS_DEPRECATED"
  13908. // "MISSING_TYPE_DEPENDENCY"
  13909. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13910. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13911. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13912. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13913. // "NEXT_HOP_NOT_RUNNING"
  13914. // "NOT_CRITICAL_ERROR"
  13915. // "NO_RESULTS_ON_PAGE"
  13916. // "REQUIRED_TOS_AGREEMENT"
  13917. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13918. // "RESOURCE_NOT_DELETED"
  13919. // "SCHEMA_VALIDATION_IGNORED"
  13920. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13921. // "UNDECLARED_PROPERTIES"
  13922. // "UNREACHABLE"
  13923. Code string `json:"code,omitempty"`
  13924. // Data: [Output Only] Metadata about this warning in key: value format.
  13925. // For example:
  13926. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13927. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  13928. // Message: [Output Only] A human-readable description of the warning
  13929. // code.
  13930. Message string `json:"message,omitempty"`
  13931. // ForceSendFields is a list of field names (e.g. "Code") to
  13932. // unconditionally include in API requests. By default, fields with
  13933. // empty values are omitted from API requests. However, any non-pointer,
  13934. // non-interface field appearing in ForceSendFields will be sent to the
  13935. // server regardless of whether the field is empty or not. This may be
  13936. // used to include empty fields in Patch requests.
  13937. ForceSendFields []string `json:"-"`
  13938. // NullFields is a list of field names (e.g. "Code") to include in API
  13939. // requests with the JSON null value. By default, fields with empty
  13940. // values are omitted from API requests. However, any field with an
  13941. // empty value appearing in NullFields will be sent to the server as
  13942. // null. It is an error if a field in this list has a non-empty value.
  13943. // This may be used to include null fields in Patch requests.
  13944. NullFields []string `json:"-"`
  13945. }
  13946. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  13947. type NoMethod InstanceGroupsScopedListWarning
  13948. raw := NoMethod(*s)
  13949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13950. }
  13951. type InstanceGroupsScopedListWarningData struct {
  13952. // Key: [Output Only] A key that provides more detail on the warning
  13953. // being returned. For example, for warnings where there are no results
  13954. // in a list request for a particular zone, this key might be scope and
  13955. // the key value might be the zone name. Other examples might be a key
  13956. // indicating a deprecated resource and a suggested replacement, or a
  13957. // warning about invalid network settings (for example, if an instance
  13958. // attempts to perform IP forwarding but is not enabled for IP
  13959. // forwarding).
  13960. Key string `json:"key,omitempty"`
  13961. // Value: [Output Only] A warning data value corresponding to the key.
  13962. Value string `json:"value,omitempty"`
  13963. // ForceSendFields is a list of field names (e.g. "Key") to
  13964. // unconditionally include in API requests. By default, fields with
  13965. // empty values are omitted from API requests. However, any non-pointer,
  13966. // non-interface field appearing in ForceSendFields will be sent to the
  13967. // server regardless of whether the field is empty or not. This may be
  13968. // used to include empty fields in Patch requests.
  13969. ForceSendFields []string `json:"-"`
  13970. // NullFields is a list of field names (e.g. "Key") to include in API
  13971. // requests with the JSON null value. By default, fields with empty
  13972. // values are omitted from API requests. However, any field with an
  13973. // empty value appearing in NullFields will be sent to the server as
  13974. // null. It is an error if a field in this list has a non-empty value.
  13975. // This may be used to include null fields in Patch requests.
  13976. NullFields []string `json:"-"`
  13977. }
  13978. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  13979. type NoMethod InstanceGroupsScopedListWarningData
  13980. raw := NoMethod(*s)
  13981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13982. }
  13983. type InstanceGroupsSetNamedPortsRequest struct {
  13984. // Fingerprint: The fingerprint of the named ports information for this
  13985. // instance group. Use this optional property to prevent conflicts when
  13986. // multiple users change the named ports settings concurrently. Obtain
  13987. // the fingerprint with the instanceGroups.get method. Then, include the
  13988. // fingerprint in your request to ensure that you do not overwrite
  13989. // changes that were applied from another concurrent request. A request
  13990. // with an incorrect fingerprint will fail with error 412
  13991. // conditionNotMet.
  13992. Fingerprint string `json:"fingerprint,omitempty"`
  13993. // NamedPorts: The list of named ports to set for this instance group.
  13994. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  13995. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  13996. // unconditionally include in API requests. By default, fields with
  13997. // empty values are omitted from API requests. However, any non-pointer,
  13998. // non-interface field appearing in ForceSendFields will be sent to the
  13999. // server regardless of whether the field is empty or not. This may be
  14000. // used to include empty fields in Patch requests.
  14001. ForceSendFields []string `json:"-"`
  14002. // NullFields is a list of field names (e.g. "Fingerprint") to include
  14003. // in API requests with the JSON null value. By default, fields with
  14004. // empty values are omitted from API requests. However, any field with
  14005. // an empty value appearing in NullFields will be sent to the server as
  14006. // null. It is an error if a field in this list has a non-empty value.
  14007. // This may be used to include null fields in Patch requests.
  14008. NullFields []string `json:"-"`
  14009. }
  14010. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  14011. type NoMethod InstanceGroupsSetNamedPortsRequest
  14012. raw := NoMethod(*s)
  14013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14014. }
  14015. // InstanceList: Contains a list of instances.
  14016. type InstanceList struct {
  14017. // Id: [Output Only] Unique identifier for the resource; defined by the
  14018. // server.
  14019. Id string `json:"id,omitempty"`
  14020. // Items: A list of Instance resources.
  14021. Items []*Instance `json:"items,omitempty"`
  14022. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  14023. // lists of Instance resources.
  14024. Kind string `json:"kind,omitempty"`
  14025. // NextPageToken: [Output Only] This token allows you to get the next
  14026. // page of results for list requests. If the number of results is larger
  14027. // than maxResults, use the nextPageToken as a value for the query
  14028. // parameter pageToken in the next list request. Subsequent list
  14029. // requests will have their own nextPageToken to continue paging through
  14030. // the results.
  14031. NextPageToken string `json:"nextPageToken,omitempty"`
  14032. // SelfLink: [Output Only] Server-defined URL for this resource.
  14033. SelfLink string `json:"selfLink,omitempty"`
  14034. // Warning: [Output Only] Informational warning message.
  14035. Warning *InstanceListWarning `json:"warning,omitempty"`
  14036. // ServerResponse contains the HTTP response code and headers from the
  14037. // server.
  14038. googleapi.ServerResponse `json:"-"`
  14039. // ForceSendFields is a list of field names (e.g. "Id") to
  14040. // unconditionally include in API requests. By default, fields with
  14041. // empty values are omitted from API requests. However, any non-pointer,
  14042. // non-interface field appearing in ForceSendFields will be sent to the
  14043. // server regardless of whether the field is empty or not. This may be
  14044. // used to include empty fields in Patch requests.
  14045. ForceSendFields []string `json:"-"`
  14046. // NullFields is a list of field names (e.g. "Id") to include in API
  14047. // requests with the JSON null value. By default, fields with empty
  14048. // values are omitted from API requests. However, any field with an
  14049. // empty value appearing in NullFields will be sent to the server as
  14050. // null. It is an error if a field in this list has a non-empty value.
  14051. // This may be used to include null fields in Patch requests.
  14052. NullFields []string `json:"-"`
  14053. }
  14054. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  14055. type NoMethod InstanceList
  14056. raw := NoMethod(*s)
  14057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14058. }
  14059. // InstanceListWarning: [Output Only] Informational warning message.
  14060. type InstanceListWarning struct {
  14061. // Code: [Output Only] A warning code, if applicable. For example,
  14062. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14063. // the response.
  14064. //
  14065. // Possible values:
  14066. // "CLEANUP_FAILED"
  14067. // "DEPRECATED_RESOURCE_USED"
  14068. // "DEPRECATED_TYPE_USED"
  14069. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14070. // "EXPERIMENTAL_TYPE_USED"
  14071. // "EXTERNAL_API_WARNING"
  14072. // "FIELD_VALUE_OVERRIDEN"
  14073. // "INJECTED_KERNELS_DEPRECATED"
  14074. // "MISSING_TYPE_DEPENDENCY"
  14075. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14076. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14077. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14078. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14079. // "NEXT_HOP_NOT_RUNNING"
  14080. // "NOT_CRITICAL_ERROR"
  14081. // "NO_RESULTS_ON_PAGE"
  14082. // "REQUIRED_TOS_AGREEMENT"
  14083. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14084. // "RESOURCE_NOT_DELETED"
  14085. // "SCHEMA_VALIDATION_IGNORED"
  14086. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14087. // "UNDECLARED_PROPERTIES"
  14088. // "UNREACHABLE"
  14089. Code string `json:"code,omitempty"`
  14090. // Data: [Output Only] Metadata about this warning in key: value format.
  14091. // For example:
  14092. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14093. Data []*InstanceListWarningData `json:"data,omitempty"`
  14094. // Message: [Output Only] A human-readable description of the warning
  14095. // code.
  14096. Message string `json:"message,omitempty"`
  14097. // ForceSendFields is a list of field names (e.g. "Code") to
  14098. // unconditionally include in API requests. By default, fields with
  14099. // empty values are omitted from API requests. However, any non-pointer,
  14100. // non-interface field appearing in ForceSendFields will be sent to the
  14101. // server regardless of whether the field is empty or not. This may be
  14102. // used to include empty fields in Patch requests.
  14103. ForceSendFields []string `json:"-"`
  14104. // NullFields is a list of field names (e.g. "Code") to include in API
  14105. // requests with the JSON null value. By default, fields with empty
  14106. // values are omitted from API requests. However, any field with an
  14107. // empty value appearing in NullFields will be sent to the server as
  14108. // null. It is an error if a field in this list has a non-empty value.
  14109. // This may be used to include null fields in Patch requests.
  14110. NullFields []string `json:"-"`
  14111. }
  14112. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  14113. type NoMethod InstanceListWarning
  14114. raw := NoMethod(*s)
  14115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14116. }
  14117. type InstanceListWarningData struct {
  14118. // Key: [Output Only] A key that provides more detail on the warning
  14119. // being returned. For example, for warnings where there are no results
  14120. // in a list request for a particular zone, this key might be scope and
  14121. // the key value might be the zone name. Other examples might be a key
  14122. // indicating a deprecated resource and a suggested replacement, or a
  14123. // warning about invalid network settings (for example, if an instance
  14124. // attempts to perform IP forwarding but is not enabled for IP
  14125. // forwarding).
  14126. Key string `json:"key,omitempty"`
  14127. // Value: [Output Only] A warning data value corresponding to the key.
  14128. Value string `json:"value,omitempty"`
  14129. // ForceSendFields is a list of field names (e.g. "Key") to
  14130. // unconditionally include in API requests. By default, fields with
  14131. // empty values are omitted from API requests. However, any non-pointer,
  14132. // non-interface field appearing in ForceSendFields will be sent to the
  14133. // server regardless of whether the field is empty or not. This may be
  14134. // used to include empty fields in Patch requests.
  14135. ForceSendFields []string `json:"-"`
  14136. // NullFields is a list of field names (e.g. "Key") to include in API
  14137. // requests with the JSON null value. By default, fields with empty
  14138. // values are omitted from API requests. However, any field with an
  14139. // empty value appearing in NullFields will be sent to the server as
  14140. // null. It is an error if a field in this list has a non-empty value.
  14141. // This may be used to include null fields in Patch requests.
  14142. NullFields []string `json:"-"`
  14143. }
  14144. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  14145. type NoMethod InstanceListWarningData
  14146. raw := NoMethod(*s)
  14147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14148. }
  14149. // InstanceListReferrers: Contains a list of instance referrers.
  14150. type InstanceListReferrers struct {
  14151. // Id: [Output Only] Unique identifier for the resource; defined by the
  14152. // server.
  14153. Id string `json:"id,omitempty"`
  14154. // Items: A list of Reference resources.
  14155. Items []*Reference `json:"items,omitempty"`
  14156. // Kind: [Output Only] Type of resource. Always
  14157. // compute#instanceListReferrers for lists of Instance referrers.
  14158. Kind string `json:"kind,omitempty"`
  14159. // NextPageToken: [Output Only] This token allows you to get the next
  14160. // page of results for list requests. If the number of results is larger
  14161. // than maxResults, use the nextPageToken as a value for the query
  14162. // parameter pageToken in the next list request. Subsequent list
  14163. // requests will have their own nextPageToken to continue paging through
  14164. // the results.
  14165. NextPageToken string `json:"nextPageToken,omitempty"`
  14166. // SelfLink: [Output Only] Server-defined URL for this resource.
  14167. SelfLink string `json:"selfLink,omitempty"`
  14168. // Warning: [Output Only] Informational warning message.
  14169. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  14170. // ServerResponse contains the HTTP response code and headers from the
  14171. // server.
  14172. googleapi.ServerResponse `json:"-"`
  14173. // ForceSendFields is a list of field names (e.g. "Id") to
  14174. // unconditionally include in API requests. By default, fields with
  14175. // empty values are omitted from API requests. However, any non-pointer,
  14176. // non-interface field appearing in ForceSendFields will be sent to the
  14177. // server regardless of whether the field is empty or not. This may be
  14178. // used to include empty fields in Patch requests.
  14179. ForceSendFields []string `json:"-"`
  14180. // NullFields is a list of field names (e.g. "Id") to include in API
  14181. // requests with the JSON null value. By default, fields with empty
  14182. // values are omitted from API requests. However, any field with an
  14183. // empty value appearing in NullFields will be sent to the server as
  14184. // null. It is an error if a field in this list has a non-empty value.
  14185. // This may be used to include null fields in Patch requests.
  14186. NullFields []string `json:"-"`
  14187. }
  14188. func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  14189. type NoMethod InstanceListReferrers
  14190. raw := NoMethod(*s)
  14191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14192. }
  14193. // InstanceListReferrersWarning: [Output Only] Informational warning
  14194. // message.
  14195. type InstanceListReferrersWarning struct {
  14196. // Code: [Output Only] A warning code, if applicable. For example,
  14197. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14198. // the response.
  14199. //
  14200. // Possible values:
  14201. // "CLEANUP_FAILED"
  14202. // "DEPRECATED_RESOURCE_USED"
  14203. // "DEPRECATED_TYPE_USED"
  14204. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14205. // "EXPERIMENTAL_TYPE_USED"
  14206. // "EXTERNAL_API_WARNING"
  14207. // "FIELD_VALUE_OVERRIDEN"
  14208. // "INJECTED_KERNELS_DEPRECATED"
  14209. // "MISSING_TYPE_DEPENDENCY"
  14210. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14211. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14212. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14213. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14214. // "NEXT_HOP_NOT_RUNNING"
  14215. // "NOT_CRITICAL_ERROR"
  14216. // "NO_RESULTS_ON_PAGE"
  14217. // "REQUIRED_TOS_AGREEMENT"
  14218. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14219. // "RESOURCE_NOT_DELETED"
  14220. // "SCHEMA_VALIDATION_IGNORED"
  14221. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14222. // "UNDECLARED_PROPERTIES"
  14223. // "UNREACHABLE"
  14224. Code string `json:"code,omitempty"`
  14225. // Data: [Output Only] Metadata about this warning in key: value format.
  14226. // For example:
  14227. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14228. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  14229. // Message: [Output Only] A human-readable description of the warning
  14230. // code.
  14231. Message string `json:"message,omitempty"`
  14232. // ForceSendFields is a list of field names (e.g. "Code") to
  14233. // unconditionally include in API requests. By default, fields with
  14234. // empty values are omitted from API requests. However, any non-pointer,
  14235. // non-interface field appearing in ForceSendFields will be sent to the
  14236. // server regardless of whether the field is empty or not. This may be
  14237. // used to include empty fields in Patch requests.
  14238. ForceSendFields []string `json:"-"`
  14239. // NullFields is a list of field names (e.g. "Code") to include in API
  14240. // requests with the JSON null value. By default, fields with empty
  14241. // values are omitted from API requests. However, any field with an
  14242. // empty value appearing in NullFields will be sent to the server as
  14243. // null. It is an error if a field in this list has a non-empty value.
  14244. // This may be used to include null fields in Patch requests.
  14245. NullFields []string `json:"-"`
  14246. }
  14247. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  14248. type NoMethod InstanceListReferrersWarning
  14249. raw := NoMethod(*s)
  14250. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14251. }
  14252. type InstanceListReferrersWarningData struct {
  14253. // Key: [Output Only] A key that provides more detail on the warning
  14254. // being returned. For example, for warnings where there are no results
  14255. // in a list request for a particular zone, this key might be scope and
  14256. // the key value might be the zone name. Other examples might be a key
  14257. // indicating a deprecated resource and a suggested replacement, or a
  14258. // warning about invalid network settings (for example, if an instance
  14259. // attempts to perform IP forwarding but is not enabled for IP
  14260. // forwarding).
  14261. Key string `json:"key,omitempty"`
  14262. // Value: [Output Only] A warning data value corresponding to the key.
  14263. Value string `json:"value,omitempty"`
  14264. // ForceSendFields is a list of field names (e.g. "Key") to
  14265. // unconditionally include in API requests. By default, fields with
  14266. // empty values are omitted from API requests. However, any non-pointer,
  14267. // non-interface field appearing in ForceSendFields will be sent to the
  14268. // server regardless of whether the field is empty or not. This may be
  14269. // used to include empty fields in Patch requests.
  14270. ForceSendFields []string `json:"-"`
  14271. // NullFields is a list of field names (e.g. "Key") to include in API
  14272. // requests with the JSON null value. By default, fields with empty
  14273. // values are omitted from API requests. However, any field with an
  14274. // empty value appearing in NullFields will be sent to the server as
  14275. // null. It is an error if a field in this list has a non-empty value.
  14276. // This may be used to include null fields in Patch requests.
  14277. NullFields []string `json:"-"`
  14278. }
  14279. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  14280. type NoMethod InstanceListReferrersWarningData
  14281. raw := NoMethod(*s)
  14282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14283. }
  14284. type InstanceMoveRequest struct {
  14285. // DestinationZone: The URL of the destination zone to move the
  14286. // instance. This can be a full or partial URL. For example, the
  14287. // following are all valid URLs to a zone:
  14288. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  14289. //
  14290. // - projects/project/zones/zone
  14291. // - zones/zone
  14292. DestinationZone string `json:"destinationZone,omitempty"`
  14293. // TargetInstance: The URL of the target instance to move. This can be a
  14294. // full or partial URL. For example, the following are all valid URLs to
  14295. // an instance:
  14296. // -
  14297. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  14298. // - projects/project/zones/zone/instances/instance
  14299. // - zones/zone/instances/instance
  14300. TargetInstance string `json:"targetInstance,omitempty"`
  14301. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  14302. // unconditionally include in API requests. By default, fields with
  14303. // empty values are omitted from API requests. However, any non-pointer,
  14304. // non-interface field appearing in ForceSendFields will be sent to the
  14305. // server regardless of whether the field is empty or not. This may be
  14306. // used to include empty fields in Patch requests.
  14307. ForceSendFields []string `json:"-"`
  14308. // NullFields is a list of field names (e.g. "DestinationZone") to
  14309. // include in API requests with the JSON null value. By default, fields
  14310. // with empty values are omitted from API requests. However, any field
  14311. // with an empty value appearing in NullFields will be sent to the
  14312. // server as null. It is an error if a field in this list has a
  14313. // non-empty value. This may be used to include null fields in Patch
  14314. // requests.
  14315. NullFields []string `json:"-"`
  14316. }
  14317. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  14318. type NoMethod InstanceMoveRequest
  14319. raw := NoMethod(*s)
  14320. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14321. }
  14322. type InstanceProperties struct {
  14323. // CanIpForward: Enables instances created based on this template to
  14324. // send packets with source IP addresses other than their own and
  14325. // receive packets with destination IP addresses other than their own.
  14326. // If these instances will be used as an IP gateway or it will be set as
  14327. // the next-hop in a Route resource, specify true. If unsure, leave this
  14328. // set to false. See the Enable IP forwarding documentation for more
  14329. // information.
  14330. CanIpForward bool `json:"canIpForward,omitempty"`
  14331. // Description: An optional text description for the instances that are
  14332. // created from this instance template.
  14333. Description string `json:"description,omitempty"`
  14334. // Disks: An array of disks that are associated with the instances that
  14335. // are created from this template.
  14336. Disks []*AttachedDisk `json:"disks,omitempty"`
  14337. // DisplayDevice: Display Device properties to enable support for remote
  14338. // display products like: Teradici, VNC and TeamViewer
  14339. DisplayDevice *DisplayDevice `json:"displayDevice,omitempty"`
  14340. // GuestAccelerators: A list of guest accelerator cards' type and count
  14341. // to use for instances created from the instance template.
  14342. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  14343. // Labels: Labels to apply to instances that are created from this
  14344. // template.
  14345. Labels map[string]string `json:"labels,omitempty"`
  14346. // MachineType: The machine type to use for instances that are created
  14347. // from this template.
  14348. MachineType string `json:"machineType,omitempty"`
  14349. // Metadata: The metadata key/value pairs to assign to instances that
  14350. // are created from this template. These pairs can consist of custom
  14351. // metadata or predefined keys. See Project and instance metadata for
  14352. // more information.
  14353. Metadata *Metadata `json:"metadata,omitempty"`
  14354. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  14355. // instance may be scheduled on the specified or newer cpu/platform.
  14356. // Applicable values are the friendly names of CPU platforms, such as
  14357. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  14358. // Bridge". For more information, read Specifying a Minimum CPU
  14359. // Platform.
  14360. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  14361. // NetworkInterfaces: An array of network access configurations for this
  14362. // interface.
  14363. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  14364. // ReservationAffinity: The configuration of desired reservations which
  14365. // this Instance could consume capacity from.
  14366. ReservationAffinity *ReservationAffinity `json:"reservationAffinity,omitempty"`
  14367. // Scheduling: Specifies the scheduling options for the instances that
  14368. // are created from this template.
  14369. Scheduling *Scheduling `json:"scheduling,omitempty"`
  14370. // ServiceAccounts: A list of service accounts with specified scopes.
  14371. // Access tokens for these service accounts are available to the
  14372. // instances that are created from this template. Use metadata queries
  14373. // to obtain the access tokens for these instances.
  14374. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  14375. ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
  14376. // ShieldedVmConfig: Specifies the Shielded VM options for the instances
  14377. // that are created from this template.
  14378. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  14379. // Tags: A list of tags to apply to the instances that are created from
  14380. // this template. The tags identify valid sources or targets for network
  14381. // firewalls. The setTags method can modify this list of tags. Each tag
  14382. // within the list must comply with RFC1035.
  14383. Tags *Tags `json:"tags,omitempty"`
  14384. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  14385. // unconditionally include in API requests. By default, fields with
  14386. // empty values are omitted from API requests. However, any non-pointer,
  14387. // non-interface field appearing in ForceSendFields will be sent to the
  14388. // server regardless of whether the field is empty or not. This may be
  14389. // used to include empty fields in Patch requests.
  14390. ForceSendFields []string `json:"-"`
  14391. // NullFields is a list of field names (e.g. "CanIpForward") to include
  14392. // in API requests with the JSON null value. By default, fields with
  14393. // empty values are omitted from API requests. However, any field with
  14394. // an empty value appearing in NullFields will be sent to the server as
  14395. // null. It is an error if a field in this list has a non-empty value.
  14396. // This may be used to include null fields in Patch requests.
  14397. NullFields []string `json:"-"`
  14398. }
  14399. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  14400. type NoMethod InstanceProperties
  14401. raw := NoMethod(*s)
  14402. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14403. }
  14404. type InstanceReference struct {
  14405. // Instance: The URL for a specific instance.
  14406. Instance string `json:"instance,omitempty"`
  14407. // ForceSendFields is a list of field names (e.g. "Instance") to
  14408. // unconditionally include in API requests. By default, fields with
  14409. // empty values are omitted from API requests. However, any non-pointer,
  14410. // non-interface field appearing in ForceSendFields will be sent to the
  14411. // server regardless of whether the field is empty or not. This may be
  14412. // used to include empty fields in Patch requests.
  14413. ForceSendFields []string `json:"-"`
  14414. // NullFields is a list of field names (e.g. "Instance") to include in
  14415. // API requests with the JSON null value. By default, fields with empty
  14416. // values are omitted from API requests. However, any field with an
  14417. // empty value appearing in NullFields will be sent to the server as
  14418. // null. It is an error if a field in this list has a non-empty value.
  14419. // This may be used to include null fields in Patch requests.
  14420. NullFields []string `json:"-"`
  14421. }
  14422. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  14423. type NoMethod InstanceReference
  14424. raw := NoMethod(*s)
  14425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14426. }
  14427. // InstanceTemplate: An Instance Template resource. (== resource_for
  14428. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  14429. type InstanceTemplate struct {
  14430. // CreationTimestamp: [Output Only] The creation timestamp for this
  14431. // instance template in RFC3339 text format.
  14432. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14433. // Description: An optional description of this resource. Provide this
  14434. // property when you create the resource.
  14435. Description string `json:"description,omitempty"`
  14436. // Id: [Output Only] A unique identifier for this instance template. The
  14437. // server defines this identifier.
  14438. Id uint64 `json:"id,omitempty,string"`
  14439. // Kind: [Output Only] The resource type, which is always
  14440. // compute#instanceTemplate for instance templates.
  14441. Kind string `json:"kind,omitempty"`
  14442. // Name: Name of the resource; provided by the client when the resource
  14443. // is created. The name must be 1-63 characters long, and comply with
  14444. // RFC1035. Specifically, the name must be 1-63 characters long and
  14445. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  14446. // the first character must be a lowercase letter, and all following
  14447. // characters must be a dash, lowercase letter, or digit, except the
  14448. // last character, which cannot be a dash.
  14449. Name string `json:"name,omitempty"`
  14450. // Properties: The instance properties for this instance template.
  14451. Properties *InstanceProperties `json:"properties,omitempty"`
  14452. // SelfLink: [Output Only] The URL for this instance template. The
  14453. // server defines this URL.
  14454. SelfLink string `json:"selfLink,omitempty"`
  14455. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  14456. // with the resource id.
  14457. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  14458. // SourceInstance: The source instance used to create the template. You
  14459. // can provide this as a partial or full URL to the resource. For
  14460. // example, the following are valid values:
  14461. // -
  14462. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  14463. // - projects/project/zones/zone/instances/instance
  14464. SourceInstance string `json:"sourceInstance,omitempty"`
  14465. // SourceInstanceParams: The source instance params to use to create
  14466. // this instance template.
  14467. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  14468. // ServerResponse contains the HTTP response code and headers from the
  14469. // server.
  14470. googleapi.ServerResponse `json:"-"`
  14471. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14472. // to unconditionally include in API requests. By default, fields with
  14473. // empty values are omitted from API requests. However, any non-pointer,
  14474. // non-interface field appearing in ForceSendFields will be sent to the
  14475. // server regardless of whether the field is empty or not. This may be
  14476. // used to include empty fields in Patch requests.
  14477. ForceSendFields []string `json:"-"`
  14478. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14479. // include in API requests with the JSON null value. By default, fields
  14480. // with empty values are omitted from API requests. However, any field
  14481. // with an empty value appearing in NullFields will be sent to the
  14482. // server as null. It is an error if a field in this list has a
  14483. // non-empty value. This may be used to include null fields in Patch
  14484. // requests.
  14485. NullFields []string `json:"-"`
  14486. }
  14487. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  14488. type NoMethod InstanceTemplate
  14489. raw := NoMethod(*s)
  14490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14491. }
  14492. // InstanceTemplateList: A list of instance templates.
  14493. type InstanceTemplateList struct {
  14494. // Id: [Output Only] Unique identifier for the resource; defined by the
  14495. // server.
  14496. Id string `json:"id,omitempty"`
  14497. // Items: A list of InstanceTemplate resources.
  14498. Items []*InstanceTemplate `json:"items,omitempty"`
  14499. // Kind: [Output Only] The resource type, which is always
  14500. // compute#instanceTemplatesListResponse for instance template lists.
  14501. Kind string `json:"kind,omitempty"`
  14502. // NextPageToken: [Output Only] This token allows you to get the next
  14503. // page of results for list requests. If the number of results is larger
  14504. // than maxResults, use the nextPageToken as a value for the query
  14505. // parameter pageToken in the next list request. Subsequent list
  14506. // requests will have their own nextPageToken to continue paging through
  14507. // the results.
  14508. NextPageToken string `json:"nextPageToken,omitempty"`
  14509. // SelfLink: [Output Only] Server-defined URL for this resource.
  14510. SelfLink string `json:"selfLink,omitempty"`
  14511. // Warning: [Output Only] Informational warning message.
  14512. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  14513. // ServerResponse contains the HTTP response code and headers from the
  14514. // server.
  14515. googleapi.ServerResponse `json:"-"`
  14516. // ForceSendFields is a list of field names (e.g. "Id") to
  14517. // unconditionally include in API requests. By default, fields with
  14518. // empty values are omitted from API requests. However, any non-pointer,
  14519. // non-interface field appearing in ForceSendFields will be sent to the
  14520. // server regardless of whether the field is empty or not. This may be
  14521. // used to include empty fields in Patch requests.
  14522. ForceSendFields []string `json:"-"`
  14523. // NullFields is a list of field names (e.g. "Id") to include in API
  14524. // requests with the JSON null value. By default, fields with empty
  14525. // values are omitted from API requests. However, any field with an
  14526. // empty value appearing in NullFields will be sent to the server as
  14527. // null. It is an error if a field in this list has a non-empty value.
  14528. // This may be used to include null fields in Patch requests.
  14529. NullFields []string `json:"-"`
  14530. }
  14531. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  14532. type NoMethod InstanceTemplateList
  14533. raw := NoMethod(*s)
  14534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14535. }
  14536. // InstanceTemplateListWarning: [Output Only] Informational warning
  14537. // message.
  14538. type InstanceTemplateListWarning struct {
  14539. // Code: [Output Only] A warning code, if applicable. For example,
  14540. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14541. // the response.
  14542. //
  14543. // Possible values:
  14544. // "CLEANUP_FAILED"
  14545. // "DEPRECATED_RESOURCE_USED"
  14546. // "DEPRECATED_TYPE_USED"
  14547. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14548. // "EXPERIMENTAL_TYPE_USED"
  14549. // "EXTERNAL_API_WARNING"
  14550. // "FIELD_VALUE_OVERRIDEN"
  14551. // "INJECTED_KERNELS_DEPRECATED"
  14552. // "MISSING_TYPE_DEPENDENCY"
  14553. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14554. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14555. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14556. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14557. // "NEXT_HOP_NOT_RUNNING"
  14558. // "NOT_CRITICAL_ERROR"
  14559. // "NO_RESULTS_ON_PAGE"
  14560. // "REQUIRED_TOS_AGREEMENT"
  14561. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14562. // "RESOURCE_NOT_DELETED"
  14563. // "SCHEMA_VALIDATION_IGNORED"
  14564. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14565. // "UNDECLARED_PROPERTIES"
  14566. // "UNREACHABLE"
  14567. Code string `json:"code,omitempty"`
  14568. // Data: [Output Only] Metadata about this warning in key: value format.
  14569. // For example:
  14570. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14571. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  14572. // Message: [Output Only] A human-readable description of the warning
  14573. // code.
  14574. Message string `json:"message,omitempty"`
  14575. // ForceSendFields is a list of field names (e.g. "Code") to
  14576. // unconditionally include in API requests. By default, fields with
  14577. // empty values are omitted from API requests. However, any non-pointer,
  14578. // non-interface field appearing in ForceSendFields will be sent to the
  14579. // server regardless of whether the field is empty or not. This may be
  14580. // used to include empty fields in Patch requests.
  14581. ForceSendFields []string `json:"-"`
  14582. // NullFields is a list of field names (e.g. "Code") to include in API
  14583. // requests with the JSON null value. By default, fields with empty
  14584. // values are omitted from API requests. However, any field with an
  14585. // empty value appearing in NullFields will be sent to the server as
  14586. // null. It is an error if a field in this list has a non-empty value.
  14587. // This may be used to include null fields in Patch requests.
  14588. NullFields []string `json:"-"`
  14589. }
  14590. func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  14591. type NoMethod InstanceTemplateListWarning
  14592. raw := NoMethod(*s)
  14593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14594. }
  14595. type InstanceTemplateListWarningData struct {
  14596. // Key: [Output Only] A key that provides more detail on the warning
  14597. // being returned. For example, for warnings where there are no results
  14598. // in a list request for a particular zone, this key might be scope and
  14599. // the key value might be the zone name. Other examples might be a key
  14600. // indicating a deprecated resource and a suggested replacement, or a
  14601. // warning about invalid network settings (for example, if an instance
  14602. // attempts to perform IP forwarding but is not enabled for IP
  14603. // forwarding).
  14604. Key string `json:"key,omitempty"`
  14605. // Value: [Output Only] A warning data value corresponding to the key.
  14606. Value string `json:"value,omitempty"`
  14607. // ForceSendFields is a list of field names (e.g. "Key") to
  14608. // unconditionally include in API requests. By default, fields with
  14609. // empty values are omitted from API requests. However, any non-pointer,
  14610. // non-interface field appearing in ForceSendFields will be sent to the
  14611. // server regardless of whether the field is empty or not. This may be
  14612. // used to include empty fields in Patch requests.
  14613. ForceSendFields []string `json:"-"`
  14614. // NullFields is a list of field names (e.g. "Key") to include in API
  14615. // requests with the JSON null value. By default, fields with empty
  14616. // values are omitted from API requests. However, any field with an
  14617. // empty value appearing in NullFields will be sent to the server as
  14618. // null. It is an error if a field in this list has a non-empty value.
  14619. // This may be used to include null fields in Patch requests.
  14620. NullFields []string `json:"-"`
  14621. }
  14622. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  14623. type NoMethod InstanceTemplateListWarningData
  14624. raw := NoMethod(*s)
  14625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14626. }
  14627. type InstanceWithNamedPorts struct {
  14628. // Instance: [Output Only] The URL of the instance.
  14629. Instance string `json:"instance,omitempty"`
  14630. // NamedPorts: [Output Only] The named ports that belong to this
  14631. // instance group.
  14632. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  14633. // Status: [Output Only] The status of the instance.
  14634. //
  14635. // Possible values:
  14636. // "PROVISIONING"
  14637. // "REPAIRING"
  14638. // "RUNNING"
  14639. // "STAGING"
  14640. // "STOPPED"
  14641. // "STOPPING"
  14642. // "SUSPENDED"
  14643. // "SUSPENDING"
  14644. // "TERMINATED"
  14645. Status string `json:"status,omitempty"`
  14646. // ForceSendFields is a list of field names (e.g. "Instance") to
  14647. // unconditionally include in API requests. By default, fields with
  14648. // empty values are omitted from API requests. However, any non-pointer,
  14649. // non-interface field appearing in ForceSendFields will be sent to the
  14650. // server regardless of whether the field is empty or not. This may be
  14651. // used to include empty fields in Patch requests.
  14652. ForceSendFields []string `json:"-"`
  14653. // NullFields is a list of field names (e.g. "Instance") to include in
  14654. // API requests with the JSON null value. By default, fields with empty
  14655. // values are omitted from API requests. However, any field with an
  14656. // empty value appearing in NullFields will be sent to the server as
  14657. // null. It is an error if a field in this list has a non-empty value.
  14658. // This may be used to include null fields in Patch requests.
  14659. NullFields []string `json:"-"`
  14660. }
  14661. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  14662. type NoMethod InstanceWithNamedPorts
  14663. raw := NoMethod(*s)
  14664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14665. }
  14666. type InstancesAddResourcePoliciesRequest struct {
  14667. // ResourcePolicies: Resource policies to be added to this instance.
  14668. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  14669. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") 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. "ResourcePolicies") to
  14677. // include in API requests with the JSON null value. By default, fields
  14678. // with empty values are omitted from API requests. However, any field
  14679. // with an empty value appearing in NullFields will be sent to the
  14680. // server as null. It is an error if a field in this list has a
  14681. // non-empty value. This may be used to include null fields in Patch
  14682. // requests.
  14683. NullFields []string `json:"-"`
  14684. }
  14685. func (s *InstancesAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  14686. type NoMethod InstancesAddResourcePoliciesRequest
  14687. raw := NoMethod(*s)
  14688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14689. }
  14690. type InstancesGetEffectiveFirewallsResponse struct {
  14691. // Firewalls: Effective firewalls on the instance.
  14692. Firewalls []*Firewall `json:"firewalls,omitempty"`
  14693. // OrganizationFirewalls: Effective firewalls from organization
  14694. // policies.
  14695. OrganizationFirewalls []*InstancesGetEffectiveFirewallsResponseOrganizationFirewallPolicy `json:"organizationFirewalls,omitempty"`
  14696. // ServerResponse contains the HTTP response code and headers from the
  14697. // server.
  14698. googleapi.ServerResponse `json:"-"`
  14699. // ForceSendFields is a list of field names (e.g. "Firewalls") to
  14700. // unconditionally include in API requests. By default, fields with
  14701. // empty values are omitted from API requests. However, any non-pointer,
  14702. // non-interface field appearing in ForceSendFields will be sent to the
  14703. // server regardless of whether the field is empty or not. This may be
  14704. // used to include empty fields in Patch requests.
  14705. ForceSendFields []string `json:"-"`
  14706. // NullFields is a list of field names (e.g. "Firewalls") to include in
  14707. // API requests with the JSON null value. By default, fields with empty
  14708. // values are omitted from API requests. However, any field with an
  14709. // empty value appearing in NullFields will be sent to the server as
  14710. // null. It is an error if a field in this list has a non-empty value.
  14711. // This may be used to include null fields in Patch requests.
  14712. NullFields []string `json:"-"`
  14713. }
  14714. func (s *InstancesGetEffectiveFirewallsResponse) MarshalJSON() ([]byte, error) {
  14715. type NoMethod InstancesGetEffectiveFirewallsResponse
  14716. raw := NoMethod(*s)
  14717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14718. }
  14719. // InstancesGetEffectiveFirewallsResponseOrganizationFirewallPolicy: A
  14720. // pruned SecurityPolicy containing ID and any applicable firewall
  14721. // rules.
  14722. type InstancesGetEffectiveFirewallsResponseOrganizationFirewallPolicy struct {
  14723. // Id: The unique identifier for the security policy. This identifier is
  14724. // defined by the server.
  14725. Id uint64 `json:"id,omitempty,string"`
  14726. // Rules: The rules that apply to the network.
  14727. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  14728. // ForceSendFields is a list of field names (e.g. "Id") to
  14729. // unconditionally include in API requests. By default, fields with
  14730. // empty values are omitted from API requests. However, any non-pointer,
  14731. // non-interface field appearing in ForceSendFields will be sent to the
  14732. // server regardless of whether the field is empty or not. This may be
  14733. // used to include empty fields in Patch requests.
  14734. ForceSendFields []string `json:"-"`
  14735. // NullFields is a list of field names (e.g. "Id") to include in API
  14736. // requests with the JSON null value. By default, fields with empty
  14737. // values are omitted from API requests. However, any field with an
  14738. // empty value appearing in NullFields will be sent to the server as
  14739. // null. It is an error if a field in this list has a non-empty value.
  14740. // This may be used to include null fields in Patch requests.
  14741. NullFields []string `json:"-"`
  14742. }
  14743. func (s *InstancesGetEffectiveFirewallsResponseOrganizationFirewallPolicy) MarshalJSON() ([]byte, error) {
  14744. type NoMethod InstancesGetEffectiveFirewallsResponseOrganizationFirewallPolicy
  14745. raw := NoMethod(*s)
  14746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14747. }
  14748. type InstancesRemoveResourcePoliciesRequest struct {
  14749. // ResourcePolicies: Resource policies to be removed from this instance.
  14750. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  14751. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  14752. // unconditionally include in API requests. By default, fields with
  14753. // empty values are omitted from API requests. However, any non-pointer,
  14754. // non-interface field appearing in ForceSendFields will be sent to the
  14755. // server regardless of whether the field is empty or not. This may be
  14756. // used to include empty fields in Patch requests.
  14757. ForceSendFields []string `json:"-"`
  14758. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  14759. // include in API requests with the JSON null value. By default, fields
  14760. // with empty values are omitted from API requests. However, any field
  14761. // with an empty value appearing in NullFields will be sent to the
  14762. // server as null. It is an error if a field in this list has a
  14763. // non-empty value. This may be used to include null fields in Patch
  14764. // requests.
  14765. NullFields []string `json:"-"`
  14766. }
  14767. func (s *InstancesRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  14768. type NoMethod InstancesRemoveResourcePoliciesRequest
  14769. raw := NoMethod(*s)
  14770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14771. }
  14772. type InstancesResumeRequest struct {
  14773. // Disks: Array of disks associated with this instance that are
  14774. // protected with a customer-supplied encryption key.
  14775. //
  14776. // In order to resume the instance, the disk url and its corresponding
  14777. // key must be provided.
  14778. //
  14779. // If the disk is not protected with a customer-supplied encryption key
  14780. // it should not be specified.
  14781. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  14782. // InstanceEncryptionKey: Decrypts data associated with an instance that
  14783. // is protected with a customer-supplied encryption key.
  14784. //
  14785. // If the instance you are starting is protected with a
  14786. // customer-supplied encryption key, the correct key must be provided
  14787. // otherwise the instance resume will not succeed.
  14788. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  14789. // ForceSendFields is a list of field names (e.g. "Disks") to
  14790. // unconditionally include in API requests. By default, fields with
  14791. // empty values are omitted from API requests. However, any non-pointer,
  14792. // non-interface field appearing in ForceSendFields will be sent to the
  14793. // server regardless of whether the field is empty or not. This may be
  14794. // used to include empty fields in Patch requests.
  14795. ForceSendFields []string `json:"-"`
  14796. // NullFields is a list of field names (e.g. "Disks") to include in API
  14797. // requests with the JSON null value. By default, fields with empty
  14798. // values are omitted from API requests. However, any field with an
  14799. // empty value appearing in NullFields will be sent to the server as
  14800. // null. It is an error if a field in this list has a non-empty value.
  14801. // This may be used to include null fields in Patch requests.
  14802. NullFields []string `json:"-"`
  14803. }
  14804. func (s *InstancesResumeRequest) MarshalJSON() ([]byte, error) {
  14805. type NoMethod InstancesResumeRequest
  14806. raw := NoMethod(*s)
  14807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14808. }
  14809. type InstancesScopedList struct {
  14810. // Instances: [Output Only] A list of instances contained in this scope.
  14811. Instances []*Instance `json:"instances,omitempty"`
  14812. // Warning: [Output Only] Informational warning which replaces the list
  14813. // of instances when the list is empty.
  14814. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  14815. // ForceSendFields is a list of field names (e.g. "Instances") to
  14816. // unconditionally include in API requests. By default, fields with
  14817. // empty values are omitted from API requests. However, any non-pointer,
  14818. // non-interface field appearing in ForceSendFields will be sent to the
  14819. // server regardless of whether the field is empty or not. This may be
  14820. // used to include empty fields in Patch requests.
  14821. ForceSendFields []string `json:"-"`
  14822. // NullFields is a list of field names (e.g. "Instances") to include in
  14823. // API requests with the JSON null value. By default, fields with empty
  14824. // values are omitted from API requests. However, any field with an
  14825. // empty value appearing in NullFields will be sent to the server as
  14826. // null. It is an error if a field in this list has a non-empty value.
  14827. // This may be used to include null fields in Patch requests.
  14828. NullFields []string `json:"-"`
  14829. }
  14830. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  14831. type NoMethod InstancesScopedList
  14832. raw := NoMethod(*s)
  14833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14834. }
  14835. // InstancesScopedListWarning: [Output Only] Informational warning which
  14836. // replaces the list of instances when the list is empty.
  14837. type InstancesScopedListWarning struct {
  14838. // Code: [Output Only] A warning code, if applicable. For example,
  14839. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14840. // the response.
  14841. //
  14842. // Possible values:
  14843. // "CLEANUP_FAILED"
  14844. // "DEPRECATED_RESOURCE_USED"
  14845. // "DEPRECATED_TYPE_USED"
  14846. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14847. // "EXPERIMENTAL_TYPE_USED"
  14848. // "EXTERNAL_API_WARNING"
  14849. // "FIELD_VALUE_OVERRIDEN"
  14850. // "INJECTED_KERNELS_DEPRECATED"
  14851. // "MISSING_TYPE_DEPENDENCY"
  14852. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14853. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14854. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14855. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14856. // "NEXT_HOP_NOT_RUNNING"
  14857. // "NOT_CRITICAL_ERROR"
  14858. // "NO_RESULTS_ON_PAGE"
  14859. // "REQUIRED_TOS_AGREEMENT"
  14860. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14861. // "RESOURCE_NOT_DELETED"
  14862. // "SCHEMA_VALIDATION_IGNORED"
  14863. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14864. // "UNDECLARED_PROPERTIES"
  14865. // "UNREACHABLE"
  14866. Code string `json:"code,omitempty"`
  14867. // Data: [Output Only] Metadata about this warning in key: value format.
  14868. // For example:
  14869. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14870. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  14871. // Message: [Output Only] A human-readable description of the warning
  14872. // code.
  14873. Message string `json:"message,omitempty"`
  14874. // ForceSendFields is a list of field names (e.g. "Code") to
  14875. // unconditionally include in API requests. By default, fields with
  14876. // empty values are omitted from API requests. However, any non-pointer,
  14877. // non-interface field appearing in ForceSendFields will be sent to the
  14878. // server regardless of whether the field is empty or not. This may be
  14879. // used to include empty fields in Patch requests.
  14880. ForceSendFields []string `json:"-"`
  14881. // NullFields is a list of field names (e.g. "Code") to include in API
  14882. // requests with the JSON null value. By default, fields with empty
  14883. // values are omitted from API requests. However, any field with an
  14884. // empty value appearing in NullFields will be sent to the server as
  14885. // null. It is an error if a field in this list has a non-empty value.
  14886. // This may be used to include null fields in Patch requests.
  14887. NullFields []string `json:"-"`
  14888. }
  14889. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  14890. type NoMethod InstancesScopedListWarning
  14891. raw := NoMethod(*s)
  14892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14893. }
  14894. type InstancesScopedListWarningData struct {
  14895. // Key: [Output Only] A key that provides more detail on the warning
  14896. // being returned. For example, for warnings where there are no results
  14897. // in a list request for a particular zone, this key might be scope and
  14898. // the key value might be the zone name. Other examples might be a key
  14899. // indicating a deprecated resource and a suggested replacement, or a
  14900. // warning about invalid network settings (for example, if an instance
  14901. // attempts to perform IP forwarding but is not enabled for IP
  14902. // forwarding).
  14903. Key string `json:"key,omitempty"`
  14904. // Value: [Output Only] A warning data value corresponding to the key.
  14905. Value string `json:"value,omitempty"`
  14906. // ForceSendFields is a list of field names (e.g. "Key") to
  14907. // unconditionally include in API requests. By default, fields with
  14908. // empty values are omitted from API requests. However, any non-pointer,
  14909. // non-interface field appearing in ForceSendFields will be sent to the
  14910. // server regardless of whether the field is empty or not. This may be
  14911. // used to include empty fields in Patch requests.
  14912. ForceSendFields []string `json:"-"`
  14913. // NullFields is a list of field names (e.g. "Key") to include in API
  14914. // requests with the JSON null value. By default, fields with empty
  14915. // values are omitted from API requests. However, any field with an
  14916. // empty value appearing in NullFields will be sent to the server as
  14917. // null. It is an error if a field in this list has a non-empty value.
  14918. // This may be used to include null fields in Patch requests.
  14919. NullFields []string `json:"-"`
  14920. }
  14921. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  14922. type NoMethod InstancesScopedListWarningData
  14923. raw := NoMethod(*s)
  14924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14925. }
  14926. type InstancesSetLabelsRequest struct {
  14927. // LabelFingerprint: Fingerprint of the previous set of labels for this
  14928. // resource, used to prevent conflicts. Provide the latest fingerprint
  14929. // value when making a request to add or change labels.
  14930. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  14931. Labels map[string]string `json:"labels,omitempty"`
  14932. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") 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. "LabelFingerprint") to
  14940. // include in API requests with the JSON null value. By default, fields
  14941. // with empty values are omitted from API requests. However, any field
  14942. // with an empty value appearing in NullFields will be sent to the
  14943. // server as null. It is an error if a field in this list has a
  14944. // non-empty value. This may be used to include null fields in Patch
  14945. // requests.
  14946. NullFields []string `json:"-"`
  14947. }
  14948. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  14949. type NoMethod InstancesSetLabelsRequest
  14950. raw := NoMethod(*s)
  14951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14952. }
  14953. type InstancesSetMachineResourcesRequest struct {
  14954. // GuestAccelerators: A list of the type and count of accelerator cards
  14955. // attached to the instance.
  14956. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  14957. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  14958. // to unconditionally include in API requests. By default, fields with
  14959. // empty values are omitted from API requests. However, any non-pointer,
  14960. // non-interface field appearing in ForceSendFields will be sent to the
  14961. // server regardless of whether the field is empty or not. This may be
  14962. // used to include empty fields in Patch requests.
  14963. ForceSendFields []string `json:"-"`
  14964. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  14965. // include in API requests with the JSON null value. By default, fields
  14966. // with empty values are omitted from API requests. However, any field
  14967. // with an empty value appearing in NullFields will be sent to the
  14968. // server as null. It is an error if a field in this list has a
  14969. // non-empty value. This may be used to include null fields in Patch
  14970. // requests.
  14971. NullFields []string `json:"-"`
  14972. }
  14973. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  14974. type NoMethod InstancesSetMachineResourcesRequest
  14975. raw := NoMethod(*s)
  14976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14977. }
  14978. type InstancesSetMachineTypeRequest struct {
  14979. // MachineType: Full or partial URL of the machine type resource. See
  14980. // Machine Types for a full list of machine types. For example:
  14981. // zones/us-central1-f/machineTypes/n1-standard-1
  14982. MachineType string `json:"machineType,omitempty"`
  14983. // ForceSendFields is a list of field names (e.g. "MachineType") to
  14984. // unconditionally include in API requests. By default, fields with
  14985. // empty values are omitted from API requests. However, any non-pointer,
  14986. // non-interface field appearing in ForceSendFields will be sent to the
  14987. // server regardless of whether the field is empty or not. This may be
  14988. // used to include empty fields in Patch requests.
  14989. ForceSendFields []string `json:"-"`
  14990. // NullFields is a list of field names (e.g. "MachineType") to include
  14991. // in API requests with the JSON null value. By default, fields with
  14992. // empty values are omitted from API requests. However, any field with
  14993. // an empty value appearing in NullFields will be sent to the server as
  14994. // null. It is an error if a field in this list has a non-empty value.
  14995. // This may be used to include null fields in Patch requests.
  14996. NullFields []string `json:"-"`
  14997. }
  14998. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  14999. type NoMethod InstancesSetMachineTypeRequest
  15000. raw := NoMethod(*s)
  15001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15002. }
  15003. type InstancesSetMinCpuPlatformRequest struct {
  15004. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  15005. // at.
  15006. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  15007. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  15008. // unconditionally include in API requests. By default, fields with
  15009. // empty values are omitted from API requests. However, any non-pointer,
  15010. // non-interface field appearing in ForceSendFields will be sent to the
  15011. // server regardless of whether the field is empty or not. This may be
  15012. // used to include empty fields in Patch requests.
  15013. ForceSendFields []string `json:"-"`
  15014. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  15015. // include in API requests with the JSON null value. By default, fields
  15016. // with empty values are omitted from API requests. However, any field
  15017. // with an empty value appearing in NullFields will be sent to the
  15018. // server as null. It is an error if a field in this list has a
  15019. // non-empty value. This may be used to include null fields in Patch
  15020. // requests.
  15021. NullFields []string `json:"-"`
  15022. }
  15023. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  15024. type NoMethod InstancesSetMinCpuPlatformRequest
  15025. raw := NoMethod(*s)
  15026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15027. }
  15028. type InstancesSetServiceAccountRequest struct {
  15029. // Email: Email address of the service account.
  15030. Email string `json:"email,omitempty"`
  15031. // Scopes: The list of scopes to be made available for this service
  15032. // account.
  15033. Scopes []string `json:"scopes,omitempty"`
  15034. // ForceSendFields is a list of field names (e.g. "Email") to
  15035. // unconditionally include in API requests. By default, fields with
  15036. // empty values are omitted from API requests. However, any non-pointer,
  15037. // non-interface field appearing in ForceSendFields will be sent to the
  15038. // server regardless of whether the field is empty or not. This may be
  15039. // used to include empty fields in Patch requests.
  15040. ForceSendFields []string `json:"-"`
  15041. // NullFields is a list of field names (e.g. "Email") to include in API
  15042. // requests with the JSON null value. By default, fields with empty
  15043. // values are omitted from API requests. However, any field with an
  15044. // empty value appearing in NullFields will be sent to the server as
  15045. // null. It is an error if a field in this list has a non-empty value.
  15046. // This may be used to include null fields in Patch requests.
  15047. NullFields []string `json:"-"`
  15048. }
  15049. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  15050. type NoMethod InstancesSetServiceAccountRequest
  15051. raw := NoMethod(*s)
  15052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15053. }
  15054. type InstancesStartWithEncryptionKeyRequest struct {
  15055. // Disks: Array of disks associated with this instance that are
  15056. // protected with a customer-supplied encryption key.
  15057. //
  15058. // In order to start the instance, the disk url and its corresponding
  15059. // key must be provided.
  15060. //
  15061. // If the disk is not protected with a customer-supplied encryption key
  15062. // it should not be specified.
  15063. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  15064. // InstanceEncryptionKey: Decrypts data associated with an instance that
  15065. // is protected with a customer-supplied encryption key.
  15066. //
  15067. // If the instance you are starting is protected with a
  15068. // customer-supplied encryption key, the correct key must be provided
  15069. // otherwise the instance start will not succeed.
  15070. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  15071. // ForceSendFields is a list of field names (e.g. "Disks") to
  15072. // unconditionally include in API requests. By default, fields with
  15073. // empty values are omitted from API requests. However, any non-pointer,
  15074. // non-interface field appearing in ForceSendFields will be sent to the
  15075. // server regardless of whether the field is empty or not. This may be
  15076. // used to include empty fields in Patch requests.
  15077. ForceSendFields []string `json:"-"`
  15078. // NullFields is a list of field names (e.g. "Disks") to include in API
  15079. // requests with the JSON null value. By default, fields with empty
  15080. // values are omitted from API requests. However, any field with an
  15081. // empty value appearing in NullFields will be sent to the server as
  15082. // null. It is an error if a field in this list has a non-empty value.
  15083. // This may be used to include null fields in Patch requests.
  15084. NullFields []string `json:"-"`
  15085. }
  15086. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  15087. type NoMethod InstancesStartWithEncryptionKeyRequest
  15088. raw := NoMethod(*s)
  15089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15090. }
  15091. // Int64RangeMatch: HttpRouteRuleMatch criteria for field values that
  15092. // must stay within the specified integer range.
  15093. type Int64RangeMatch struct {
  15094. // RangeEnd: The end of the range (exclusive) in signed long integer
  15095. // format.
  15096. RangeEnd int64 `json:"rangeEnd,omitempty,string"`
  15097. // RangeStart: The start of the range (inclusive) in signed long integer
  15098. // format.
  15099. RangeStart int64 `json:"rangeStart,omitempty,string"`
  15100. // ForceSendFields is a list of field names (e.g. "RangeEnd") 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. "RangeEnd") to include in
  15108. // API 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 *Int64RangeMatch) MarshalJSON() ([]byte, error) {
  15116. type NoMethod Int64RangeMatch
  15117. raw := NoMethod(*s)
  15118. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15119. }
  15120. // Interconnect: Represents an Interconnects resource. The Interconnects
  15121. // resource is a dedicated connection between Google's network and your
  15122. // on-premises network. For more information, see the Dedicated
  15123. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  15124. // beta.interconnects ==)
  15125. type Interconnect struct {
  15126. // AdminEnabled: Administrative status of the interconnect. When this is
  15127. // set to true, the Interconnect is functional and can carry traffic.
  15128. // When set to false, no packets can be carried over the interconnect
  15129. // and no BGP routes are exchanged over it. By default, the status is
  15130. // set to true.
  15131. AdminEnabled bool `json:"adminEnabled,omitempty"`
  15132. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  15133. // describe the individual circuits in this LAG.
  15134. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  15135. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15136. // format.
  15137. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15138. // CustomerName: Customer name, to put in the Letter of Authorization as
  15139. // the party authorized to request a crossconnect.
  15140. CustomerName string `json:"customerName,omitempty"`
  15141. // Description: An optional description of this resource. Provide this
  15142. // property when you create the resource.
  15143. Description string `json:"description,omitempty"`
  15144. // ExpectedOutages: [Output Only] A list of outages expected for this
  15145. // Interconnect.
  15146. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  15147. // GoogleIpAddress: [Output Only] IP address configured on the Google
  15148. // side of the Interconnect link. This can be used only for ping tests.
  15149. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  15150. // GoogleReferenceId: [Output Only] Google reference ID to be used when
  15151. // raising support tickets with Google or otherwise to debug backend
  15152. // connectivity issues.
  15153. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  15154. // Id: [Output Only] The unique identifier for the resource. This
  15155. // identifier is defined by the server.
  15156. Id uint64 `json:"id,omitempty,string"`
  15157. // InterconnectAttachments: [Output Only] A list of the URLs of all
  15158. // InterconnectAttachments configured to use this Interconnect.
  15159. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  15160. // InterconnectType: Type of interconnect, which can take one of the
  15161. // following values:
  15162. // - PARTNER: A partner-managed interconnection shared between customers
  15163. // though a partner.
  15164. // - DEDICATED: A dedicated physical interconnection with the customer.
  15165. // Note that a value IT_PRIVATE has been deprecated in favor of
  15166. // DEDICATED.
  15167. //
  15168. // Possible values:
  15169. // "DEDICATED"
  15170. // "IT_PRIVATE"
  15171. // "PARTNER"
  15172. InterconnectType string `json:"interconnectType,omitempty"`
  15173. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  15174. // for interconnects.
  15175. Kind string `json:"kind,omitempty"`
  15176. // LabelFingerprint: A fingerprint for the labels being applied to this
  15177. // Interconnect, which is essentially a hash of the labels set used for
  15178. // optimistic locking. The fingerprint is initially generated by Compute
  15179. // Engine and changes after every request to modify or update labels.
  15180. // You must always provide an up-to-date fingerprint hash in order to
  15181. // update or change labels, otherwise the request will fail with error
  15182. // 412 conditionNotMet.
  15183. //
  15184. // To see the latest fingerprint, make a get() request to retrieve an
  15185. // Interconnect.
  15186. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  15187. // Labels: Labels to apply to this Interconnect resource. These can be
  15188. // later modified by the setLabels method. Each label key/value must
  15189. // comply with RFC1035. Label values may be empty.
  15190. Labels map[string]string `json:"labels,omitempty"`
  15191. // LinkType: Type of link requested, which can take one of the following
  15192. // values:
  15193. // - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics
  15194. // - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note
  15195. // that this field indicates the speed of each of the links in the
  15196. // bundle, not the speed of the entire bundle.
  15197. //
  15198. // Possible values:
  15199. // "LINK_TYPE_ETHERNET_100G_LR"
  15200. // "LINK_TYPE_ETHERNET_10G_LR"
  15201. LinkType string `json:"linkType,omitempty"`
  15202. // Location: URL of the InterconnectLocation object that represents
  15203. // where this connection is to be provisioned.
  15204. Location string `json:"location,omitempty"`
  15205. // Name: Name of the resource. Provided by the client when the resource
  15206. // is created. The name must be 1-63 characters long, and comply with
  15207. // RFC1035. Specifically, the name must be 1-63 characters long and
  15208. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  15209. // the first character must be a lowercase letter, and all following
  15210. // characters must be a dash, lowercase letter, or digit, except the
  15211. // last character, which cannot be a dash.
  15212. Name string `json:"name,omitempty"`
  15213. // NocContactEmail: Email address to contact the customer NOC for
  15214. // operations and maintenance notifications regarding this Interconnect.
  15215. // If specified, this will be used for notifications in addition to all
  15216. // other forms described, such as Stackdriver logs alerting and Cloud
  15217. // Notifications.
  15218. NocContactEmail string `json:"nocContactEmail,omitempty"`
  15219. // OperationalStatus: [Output Only] The current status of this
  15220. // Interconnect's functionality, which can take one of the following
  15221. // values:
  15222. // - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to
  15223. // use. Attachments may be provisioned on this Interconnect.
  15224. // - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No
  15225. // attachments may be provisioned on this Interconnect.
  15226. // - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal
  15227. // maintenance. No attachments may be provisioned or updated on this
  15228. // Interconnect.
  15229. //
  15230. // Possible values:
  15231. // "OS_ACTIVE"
  15232. // "OS_UNPROVISIONED"
  15233. OperationalStatus string `json:"operationalStatus,omitempty"`
  15234. // PeerIpAddress: [Output Only] IP address configured on the customer
  15235. // side of the Interconnect link. The customer should configure this IP
  15236. // address during turnup when prompted by Google NOC. This can be used
  15237. // only for ping tests.
  15238. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  15239. // ProvisionedLinkCount: [Output Only] Number of links actually
  15240. // provisioned in this interconnect.
  15241. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  15242. // RequestedLinkCount: Target number of physical links in the link
  15243. // bundle, as requested by the customer.
  15244. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  15245. // SelfLink: [Output Only] Server-defined URL for the resource.
  15246. SelfLink string `json:"selfLink,omitempty"`
  15247. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  15248. // with the resource id.
  15249. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  15250. // State: [Output Only] The current state of Interconnect functionality,
  15251. // which can take one of the following values:
  15252. // - ACTIVE: The Interconnect is valid, turned up and ready to use.
  15253. // Attachments may be provisioned on this Interconnect.
  15254. // - UNPROVISIONED: The Interconnect has not completed turnup. No
  15255. // attachments may be provisioned on this Interconnect.
  15256. // - UNDER_MAINTENANCE: The Interconnect is undergoing internal
  15257. // maintenance. No attachments may be provisioned or updated on this
  15258. // Interconnect.
  15259. //
  15260. // Possible values:
  15261. // "ACTIVE"
  15262. // "UNPROVISIONED"
  15263. State string `json:"state,omitempty"`
  15264. // ServerResponse contains the HTTP response code and headers from the
  15265. // server.
  15266. googleapi.ServerResponse `json:"-"`
  15267. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  15268. // unconditionally include in API requests. By default, fields with
  15269. // empty values are omitted from API requests. However, any non-pointer,
  15270. // non-interface field appearing in ForceSendFields will be sent to the
  15271. // server regardless of whether the field is empty or not. This may be
  15272. // used to include empty fields in Patch requests.
  15273. ForceSendFields []string `json:"-"`
  15274. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  15275. // in API requests with the JSON null value. By default, fields with
  15276. // empty values are omitted from API requests. However, any field with
  15277. // an empty value appearing in NullFields will be sent to the server as
  15278. // null. It is an error if a field in this list has a non-empty value.
  15279. // This may be used to include null fields in Patch requests.
  15280. NullFields []string `json:"-"`
  15281. }
  15282. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  15283. type NoMethod Interconnect
  15284. raw := NoMethod(*s)
  15285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15286. }
  15287. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  15288. // attachment) resource. For more information, see Creating VLAN
  15289. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  15290. // resource_for v1.interconnectAttachments ==)
  15291. type InterconnectAttachment struct {
  15292. // AdminEnabled: Determines whether this Attachment will carry packets.
  15293. // Not present for PARTNER_PROVIDER.
  15294. AdminEnabled bool `json:"adminEnabled,omitempty"`
  15295. // Bandwidth: Provisioned bandwidth capacity for the interconnect
  15296. // attachment. For attachments of type DEDICATED, the user can set the
  15297. // bandwidth. For attachments of type PARTNER, the Google Partner that
  15298. // is operating the interconnect must set the bandwidth. Output only for
  15299. // PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can
  15300. // take one of the following values:
  15301. // - BPS_50M: 50 Mbit/s
  15302. // - BPS_100M: 100 Mbit/s
  15303. // - BPS_200M: 200 Mbit/s
  15304. // - BPS_300M: 300 Mbit/s
  15305. // - BPS_400M: 400 Mbit/s
  15306. // - BPS_500M: 500 Mbit/s
  15307. // - BPS_1G: 1 Gbit/s
  15308. // - BPS_2G: 2 Gbit/s
  15309. // - BPS_5G: 5 Gbit/s
  15310. // - BPS_10G: 10 Gbit/s
  15311. //
  15312. // Possible values:
  15313. // "BPS_100M"
  15314. // "BPS_10G"
  15315. // "BPS_1G"
  15316. // "BPS_200M"
  15317. // "BPS_20G"
  15318. // "BPS_2G"
  15319. // "BPS_300M"
  15320. // "BPS_400M"
  15321. // "BPS_500M"
  15322. // "BPS_50G"
  15323. // "BPS_50M"
  15324. // "BPS_5G"
  15325. Bandwidth string `json:"bandwidth,omitempty"`
  15326. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  15327. // restrict the allocation of cloudRouterIpAddress and
  15328. // customerRouterIpAddress for this attachment. All prefixes must be
  15329. // within link-local address space (169.254.0.0/16) and must be /29 or
  15330. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  15331. // from the supplied candidate prefix(es). The request will fail if all
  15332. // possible /29s are in use on Google?s edge. If not supplied, Google
  15333. // will randomly select an unused /29 from all of link-local space.
  15334. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  15335. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  15336. // be configured on Cloud Router Interface for this interconnect
  15337. // attachment.
  15338. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  15339. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15340. // format.
  15341. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15342. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  15343. // to be configured on the customer router subinterface for this
  15344. // interconnect attachment.
  15345. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  15346. // Description: An optional description of this resource.
  15347. Description string `json:"description,omitempty"`
  15348. // EdgeAvailabilityDomain: Desired availability domain for the
  15349. // attachment. Only available for type PARTNER, at creation time, and
  15350. // can take one of the following values:
  15351. // - AVAILABILITY_DOMAIN_ANY
  15352. // - AVAILABILITY_DOMAIN_1
  15353. // - AVAILABILITY_DOMAIN_2 For improved reliability, customers should
  15354. // configure a pair of attachments, one per availability domain. The
  15355. // selected availability domain will be provided to the Partner via the
  15356. // pairing key, so that the provisioned circuit will lie in the
  15357. // specified domain. If not specified, the value will default to
  15358. // AVAILABILITY_DOMAIN_ANY.
  15359. //
  15360. // Possible values:
  15361. // "AVAILABILITY_DOMAIN_1"
  15362. // "AVAILABILITY_DOMAIN_2"
  15363. // "AVAILABILITY_DOMAIN_ANY"
  15364. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  15365. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  15366. // raising support tickets with Google or otherwise to debug backend
  15367. // connectivity issues.
  15368. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  15369. // Id: [Output Only] The unique identifier for the resource. This
  15370. // identifier is defined by the server.
  15371. Id uint64 `json:"id,omitempty,string"`
  15372. // Interconnect: URL of the underlying Interconnect object that this
  15373. // attachment's traffic will traverse through.
  15374. Interconnect string `json:"interconnect,omitempty"`
  15375. // Kind: [Output Only] Type of the resource. Always
  15376. // compute#interconnectAttachment for interconnect attachments.
  15377. Kind string `json:"kind,omitempty"`
  15378. // LabelFingerprint: A fingerprint for the labels being applied to this
  15379. // InterconnectAttachment, which is essentially a hash of the labels set
  15380. // used for optimistic locking. The fingerprint is initially generated
  15381. // by Compute Engine and changes after every request to modify or update
  15382. // labels. You must always provide an up-to-date fingerprint hash in
  15383. // order to update or change labels, otherwise the request will fail
  15384. // with error 412 conditionNotMet.
  15385. //
  15386. // To see the latest fingerprint, make a get() request to retrieve an
  15387. // InterconnectAttachment.
  15388. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  15389. // Labels: Labels to apply to this InterconnectAttachment resource.
  15390. // These can be later modified by the setLabels method. Each label
  15391. // key/value must comply with RFC1035. Label values may be empty.
  15392. Labels map[string]string `json:"labels,omitempty"`
  15393. // Name: Name of the resource. Provided by the client when the resource
  15394. // is created. The name must be 1-63 characters long, and comply with
  15395. // RFC1035. Specifically, the name must be 1-63 characters long and
  15396. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  15397. // the first character must be a lowercase letter, and all following
  15398. // characters must be a dash, lowercase letter, or digit, except the
  15399. // last character, which cannot be a dash.
  15400. Name string `json:"name,omitempty"`
  15401. // OperationalStatus: [Output Only] The current status of whether or not
  15402. // this interconnect attachment is functional, which can take one of the
  15403. // following values:
  15404. // - OS_ACTIVE: The attachment has been turned up and is ready to use.
  15405. //
  15406. // - OS_UNPROVISIONED: The attachment is not ready to use yet, because
  15407. // turnup is not complete.
  15408. //
  15409. // Possible values:
  15410. // "OS_ACTIVE"
  15411. // "OS_UNPROVISIONED"
  15412. OperationalStatus string `json:"operationalStatus,omitempty"`
  15413. // PairingKey: [Output only for type PARTNER. Input only for
  15414. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  15415. // of an PARTNER attachment used to initiate provisioning with a
  15416. // selected partner. Of the form "XXXXX/region/domain"
  15417. PairingKey string `json:"pairingKey,omitempty"`
  15418. // PartnerAsn: Optional BGP ASN for the router supplied by a Layer 3
  15419. // Partner if they configured BGP on behalf of the customer. Output only
  15420. // for PARTNER type, input only for PARTNER_PROVIDER, not available for
  15421. // DEDICATED.
  15422. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  15423. // PartnerMetadata: Informational metadata about Partner attachments
  15424. // from Partners to display to customers. Output only for for PARTNER
  15425. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  15426. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  15427. // PrivateInterconnectInfo: [Output Only] Information specific to an
  15428. // InterconnectAttachment. This property is populated if the
  15429. // interconnect that this is attached to is of type DEDICATED.
  15430. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  15431. // Region: [Output Only] URL of the region where the regional
  15432. // interconnect attachment resides. You must specify this field as part
  15433. // of the HTTP request URL. It is not settable as a field in the request
  15434. // body.
  15435. Region string `json:"region,omitempty"`
  15436. // Router: URL of the Cloud Router to be used for dynamic routing. This
  15437. // router must be in the same region as this InterconnectAttachment. The
  15438. // InterconnectAttachment will automatically connect the Interconnect to
  15439. // the network & region within which the Cloud Router is configured.
  15440. Router string `json:"router,omitempty"`
  15441. // SelfLink: [Output Only] Server-defined URL for the resource.
  15442. SelfLink string `json:"selfLink,omitempty"`
  15443. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  15444. // with the resource id.
  15445. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  15446. // State: [Output Only] The current state of this attachment's
  15447. // functionality. Enum values ACTIVE and UNPROVISIONED are shared by
  15448. // DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect
  15449. // attachments, while enum values PENDING_PARTNER,
  15450. // PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only
  15451. // PARTNER and PARTNER_PROVIDER interconnect attachments. This state can
  15452. // take one of the following values:
  15453. // - ACTIVE: The attachment has been turned up and is ready to use.
  15454. // - UNPROVISIONED: The attachment is not ready to use yet, because
  15455. // turnup is not complete.
  15456. // - PENDING_PARTNER: A newly-created PARTNER attachment that has not
  15457. // yet been configured on the Partner side.
  15458. // - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of
  15459. // provisioning after a PARTNER_PROVIDER attachment was created that
  15460. // references it.
  15461. // - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is
  15462. // waiting for a customer to activate it.
  15463. // - DEFUNCT: The attachment was deleted externally and is no longer
  15464. // functional. This could be because the associated Interconnect was
  15465. // removed, or because the other side of a Partner attachment was
  15466. // deleted.
  15467. //
  15468. // Possible values:
  15469. // "ACTIVE"
  15470. // "DEFUNCT"
  15471. // "PARTNER_REQUEST_RECEIVED"
  15472. // "PENDING_CUSTOMER"
  15473. // "PENDING_PARTNER"
  15474. // "STATE_UNSPECIFIED"
  15475. // "UNPROVISIONED"
  15476. State string `json:"state,omitempty"`
  15477. // Type: The type of interconnect attachment this is, which can take one
  15478. // of the following values:
  15479. // - DEDICATED: an attachment to a Dedicated Interconnect.
  15480. // - PARTNER: an attachment to a Partner Interconnect, created by the
  15481. // customer.
  15482. // - PARTNER_PROVIDER: an attachment to a Partner Interconnect, created
  15483. // by the partner.
  15484. //
  15485. // Possible values:
  15486. // "DEDICATED"
  15487. // "PARTNER"
  15488. // "PARTNER_PROVIDER"
  15489. Type string `json:"type,omitempty"`
  15490. // VlanTag8021q: The IEEE 802.1Q VLAN tag for this attachment, in the
  15491. // range 2-4094. Only specified at creation time.
  15492. VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
  15493. // ServerResponse contains the HTTP response code and headers from the
  15494. // server.
  15495. googleapi.ServerResponse `json:"-"`
  15496. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  15497. // unconditionally include in API requests. By default, fields with
  15498. // empty values are omitted from API requests. However, any non-pointer,
  15499. // non-interface field appearing in ForceSendFields will be sent to the
  15500. // server regardless of whether the field is empty or not. This may be
  15501. // used to include empty fields in Patch requests.
  15502. ForceSendFields []string `json:"-"`
  15503. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  15504. // in API requests with the JSON null value. By default, fields with
  15505. // empty values are omitted from API requests. However, any field with
  15506. // an empty value appearing in NullFields will be sent to the server as
  15507. // null. It is an error if a field in this list has a non-empty value.
  15508. // This may be used to include null fields in Patch requests.
  15509. NullFields []string `json:"-"`
  15510. }
  15511. func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  15512. type NoMethod InterconnectAttachment
  15513. raw := NoMethod(*s)
  15514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15515. }
  15516. type InterconnectAttachmentAggregatedList struct {
  15517. // Id: [Output Only] Unique identifier for the resource; defined by the
  15518. // server.
  15519. Id string `json:"id,omitempty"`
  15520. // Items: A list of InterconnectAttachmentsScopedList resources.
  15521. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  15522. // Kind: [Output Only] Type of resource. Always
  15523. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  15524. // interconnect attachments.
  15525. Kind string `json:"kind,omitempty"`
  15526. // NextPageToken: [Output Only] This token allows you to get the next
  15527. // page of results for list requests. If the number of results is larger
  15528. // than maxResults, use the nextPageToken as a value for the query
  15529. // parameter pageToken in the next list request. Subsequent list
  15530. // requests will have their own nextPageToken to continue paging through
  15531. // the results.
  15532. NextPageToken string `json:"nextPageToken,omitempty"`
  15533. // SelfLink: [Output Only] Server-defined URL for this resource.
  15534. SelfLink string `json:"selfLink,omitempty"`
  15535. // Warning: [Output Only] Informational warning message.
  15536. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  15537. // ServerResponse contains the HTTP response code and headers from the
  15538. // server.
  15539. googleapi.ServerResponse `json:"-"`
  15540. // ForceSendFields is a list of field names (e.g. "Id") to
  15541. // unconditionally include in API requests. By default, fields with
  15542. // empty values are omitted from API requests. However, any non-pointer,
  15543. // non-interface field appearing in ForceSendFields will be sent to the
  15544. // server regardless of whether the field is empty or not. This may be
  15545. // used to include empty fields in Patch requests.
  15546. ForceSendFields []string `json:"-"`
  15547. // NullFields is a list of field names (e.g. "Id") to include in API
  15548. // requests with the JSON null value. By default, fields with empty
  15549. // values are omitted from API requests. However, any field with an
  15550. // empty value appearing in NullFields will be sent to the server as
  15551. // null. It is an error if a field in this list has a non-empty value.
  15552. // This may be used to include null fields in Patch requests.
  15553. NullFields []string `json:"-"`
  15554. }
  15555. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  15556. type NoMethod InterconnectAttachmentAggregatedList
  15557. raw := NoMethod(*s)
  15558. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15559. }
  15560. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  15561. // Informational warning message.
  15562. type InterconnectAttachmentAggregatedListWarning struct {
  15563. // Code: [Output Only] A warning code, if applicable. For example,
  15564. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15565. // the response.
  15566. //
  15567. // Possible values:
  15568. // "CLEANUP_FAILED"
  15569. // "DEPRECATED_RESOURCE_USED"
  15570. // "DEPRECATED_TYPE_USED"
  15571. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15572. // "EXPERIMENTAL_TYPE_USED"
  15573. // "EXTERNAL_API_WARNING"
  15574. // "FIELD_VALUE_OVERRIDEN"
  15575. // "INJECTED_KERNELS_DEPRECATED"
  15576. // "MISSING_TYPE_DEPENDENCY"
  15577. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15578. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15579. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15580. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15581. // "NEXT_HOP_NOT_RUNNING"
  15582. // "NOT_CRITICAL_ERROR"
  15583. // "NO_RESULTS_ON_PAGE"
  15584. // "REQUIRED_TOS_AGREEMENT"
  15585. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15586. // "RESOURCE_NOT_DELETED"
  15587. // "SCHEMA_VALIDATION_IGNORED"
  15588. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15589. // "UNDECLARED_PROPERTIES"
  15590. // "UNREACHABLE"
  15591. Code string `json:"code,omitempty"`
  15592. // Data: [Output Only] Metadata about this warning in key: value format.
  15593. // For example:
  15594. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15595. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  15596. // Message: [Output Only] A human-readable description of the warning
  15597. // code.
  15598. Message string `json:"message,omitempty"`
  15599. // ForceSendFields is a list of field names (e.g. "Code") to
  15600. // unconditionally include in API requests. By default, fields with
  15601. // empty values are omitted from API requests. However, any non-pointer,
  15602. // non-interface field appearing in ForceSendFields will be sent to the
  15603. // server regardless of whether the field is empty or not. This may be
  15604. // used to include empty fields in Patch requests.
  15605. ForceSendFields []string `json:"-"`
  15606. // NullFields is a list of field names (e.g. "Code") to include in API
  15607. // requests with the JSON null value. By default, fields with empty
  15608. // values are omitted from API requests. However, any field with an
  15609. // empty value appearing in NullFields will be sent to the server as
  15610. // null. It is an error if a field in this list has a non-empty value.
  15611. // This may be used to include null fields in Patch requests.
  15612. NullFields []string `json:"-"`
  15613. }
  15614. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  15615. type NoMethod InterconnectAttachmentAggregatedListWarning
  15616. raw := NoMethod(*s)
  15617. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15618. }
  15619. type InterconnectAttachmentAggregatedListWarningData struct {
  15620. // Key: [Output Only] A key that provides more detail on the warning
  15621. // being returned. For example, for warnings where there are no results
  15622. // in a list request for a particular zone, this key might be scope and
  15623. // the key value might be the zone name. Other examples might be a key
  15624. // indicating a deprecated resource and a suggested replacement, or a
  15625. // warning about invalid network settings (for example, if an instance
  15626. // attempts to perform IP forwarding but is not enabled for IP
  15627. // forwarding).
  15628. Key string `json:"key,omitempty"`
  15629. // Value: [Output Only] A warning data value corresponding to the key.
  15630. Value string `json:"value,omitempty"`
  15631. // ForceSendFields is a list of field names (e.g. "Key") to
  15632. // unconditionally include in API requests. By default, fields with
  15633. // empty values are omitted from API requests. However, any non-pointer,
  15634. // non-interface field appearing in ForceSendFields will be sent to the
  15635. // server regardless of whether the field is empty or not. This may be
  15636. // used to include empty fields in Patch requests.
  15637. ForceSendFields []string `json:"-"`
  15638. // NullFields is a list of field names (e.g. "Key") to include in API
  15639. // requests with the JSON null value. By default, fields with empty
  15640. // values are omitted from API requests. However, any field with an
  15641. // empty value appearing in NullFields will be sent to the server as
  15642. // null. It is an error if a field in this list has a non-empty value.
  15643. // This may be used to include null fields in Patch requests.
  15644. NullFields []string `json:"-"`
  15645. }
  15646. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15647. type NoMethod InterconnectAttachmentAggregatedListWarningData
  15648. raw := NoMethod(*s)
  15649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15650. }
  15651. // InterconnectAttachmentList: Response to the list request, and
  15652. // contains a list of interconnect attachments.
  15653. type InterconnectAttachmentList struct {
  15654. // Id: [Output Only] Unique identifier for the resource; defined by the
  15655. // server.
  15656. Id string `json:"id,omitempty"`
  15657. // Items: A list of InterconnectAttachment resources.
  15658. Items []*InterconnectAttachment `json:"items,omitempty"`
  15659. // Kind: [Output Only] Type of resource. Always
  15660. // compute#interconnectAttachmentList for lists of interconnect
  15661. // attachments.
  15662. Kind string `json:"kind,omitempty"`
  15663. // NextPageToken: [Output Only] This token allows you to get the next
  15664. // page of results for list requests. If the number of results is larger
  15665. // than maxResults, use the nextPageToken as a value for the query
  15666. // parameter pageToken in the next list request. Subsequent list
  15667. // requests will have their own nextPageToken to continue paging through
  15668. // the results.
  15669. NextPageToken string `json:"nextPageToken,omitempty"`
  15670. // SelfLink: [Output Only] Server-defined URL for this resource.
  15671. SelfLink string `json:"selfLink,omitempty"`
  15672. // Warning: [Output Only] Informational warning message.
  15673. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  15674. // ServerResponse contains the HTTP response code and headers from the
  15675. // server.
  15676. googleapi.ServerResponse `json:"-"`
  15677. // ForceSendFields is a list of field names (e.g. "Id") to
  15678. // unconditionally include in API requests. By default, fields with
  15679. // empty values are omitted from API requests. However, any non-pointer,
  15680. // non-interface field appearing in ForceSendFields will be sent to the
  15681. // server regardless of whether the field is empty or not. This may be
  15682. // used to include empty fields in Patch requests.
  15683. ForceSendFields []string `json:"-"`
  15684. // NullFields is a list of field names (e.g. "Id") to include in API
  15685. // requests with the JSON null value. By default, fields with empty
  15686. // values are omitted from API requests. However, any field with an
  15687. // empty value appearing in NullFields will be sent to the server as
  15688. // null. It is an error if a field in this list has a non-empty value.
  15689. // This may be used to include null fields in Patch requests.
  15690. NullFields []string `json:"-"`
  15691. }
  15692. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  15693. type NoMethod InterconnectAttachmentList
  15694. raw := NoMethod(*s)
  15695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15696. }
  15697. // InterconnectAttachmentListWarning: [Output Only] Informational
  15698. // warning message.
  15699. type InterconnectAttachmentListWarning struct {
  15700. // Code: [Output Only] A warning code, if applicable. For example,
  15701. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15702. // the response.
  15703. //
  15704. // Possible values:
  15705. // "CLEANUP_FAILED"
  15706. // "DEPRECATED_RESOURCE_USED"
  15707. // "DEPRECATED_TYPE_USED"
  15708. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15709. // "EXPERIMENTAL_TYPE_USED"
  15710. // "EXTERNAL_API_WARNING"
  15711. // "FIELD_VALUE_OVERRIDEN"
  15712. // "INJECTED_KERNELS_DEPRECATED"
  15713. // "MISSING_TYPE_DEPENDENCY"
  15714. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15715. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15716. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15717. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15718. // "NEXT_HOP_NOT_RUNNING"
  15719. // "NOT_CRITICAL_ERROR"
  15720. // "NO_RESULTS_ON_PAGE"
  15721. // "REQUIRED_TOS_AGREEMENT"
  15722. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15723. // "RESOURCE_NOT_DELETED"
  15724. // "SCHEMA_VALIDATION_IGNORED"
  15725. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15726. // "UNDECLARED_PROPERTIES"
  15727. // "UNREACHABLE"
  15728. Code string `json:"code,omitempty"`
  15729. // Data: [Output Only] Metadata about this warning in key: value format.
  15730. // For example:
  15731. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15732. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  15733. // Message: [Output Only] A human-readable description of the warning
  15734. // code.
  15735. Message string `json:"message,omitempty"`
  15736. // ForceSendFields is a list of field names (e.g. "Code") to
  15737. // unconditionally include in API requests. By default, fields with
  15738. // empty values are omitted from API requests. However, any non-pointer,
  15739. // non-interface field appearing in ForceSendFields will be sent to the
  15740. // server regardless of whether the field is empty or not. This may be
  15741. // used to include empty fields in Patch requests.
  15742. ForceSendFields []string `json:"-"`
  15743. // NullFields is a list of field names (e.g. "Code") to include in API
  15744. // requests with the JSON null value. By default, fields with empty
  15745. // values are omitted from API requests. However, any field with an
  15746. // empty value appearing in NullFields will be sent to the server as
  15747. // null. It is an error if a field in this list has a non-empty value.
  15748. // This may be used to include null fields in Patch requests.
  15749. NullFields []string `json:"-"`
  15750. }
  15751. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  15752. type NoMethod InterconnectAttachmentListWarning
  15753. raw := NoMethod(*s)
  15754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15755. }
  15756. type InterconnectAttachmentListWarningData struct {
  15757. // Key: [Output Only] A key that provides more detail on the warning
  15758. // being returned. For example, for warnings where there are no results
  15759. // in a list request for a particular zone, this key might be scope and
  15760. // the key value might be the zone name. Other examples might be a key
  15761. // indicating a deprecated resource and a suggested replacement, or a
  15762. // warning about invalid network settings (for example, if an instance
  15763. // attempts to perform IP forwarding but is not enabled for IP
  15764. // forwarding).
  15765. Key string `json:"key,omitempty"`
  15766. // Value: [Output Only] A warning data value corresponding to the key.
  15767. Value string `json:"value,omitempty"`
  15768. // ForceSendFields is a list of field names (e.g. "Key") to
  15769. // unconditionally include in API requests. By default, fields with
  15770. // empty values are omitted from API requests. However, any non-pointer,
  15771. // non-interface field appearing in ForceSendFields will be sent to the
  15772. // server regardless of whether the field is empty or not. This may be
  15773. // used to include empty fields in Patch requests.
  15774. ForceSendFields []string `json:"-"`
  15775. // NullFields is a list of field names (e.g. "Key") to include in API
  15776. // requests with the JSON null value. By default, fields with empty
  15777. // values are omitted from API requests. However, any field with an
  15778. // empty value appearing in NullFields will be sent to the server as
  15779. // null. It is an error if a field in this list has a non-empty value.
  15780. // This may be used to include null fields in Patch requests.
  15781. NullFields []string `json:"-"`
  15782. }
  15783. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  15784. type NoMethod InterconnectAttachmentListWarningData
  15785. raw := NoMethod(*s)
  15786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15787. }
  15788. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  15789. // Partner attachments from Partners to display to customers. These
  15790. // fields are propagated from PARTNER_PROVIDER attachments to their
  15791. // corresponding PARTNER attachments.
  15792. type InterconnectAttachmentPartnerMetadata struct {
  15793. // InterconnectName: Plain text name of the Interconnect this attachment
  15794. // is connected to, as displayed in the Partner?s portal. For instance
  15795. // "Chicago 1". This value may be validated to match approved Partner
  15796. // values.
  15797. InterconnectName string `json:"interconnectName,omitempty"`
  15798. // PartnerName: Plain text name of the Partner providing this
  15799. // attachment. This value may be validated to match approved Partner
  15800. // values.
  15801. PartnerName string `json:"partnerName,omitempty"`
  15802. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  15803. // may customise this to be a deep link to the specific resource on the
  15804. // Partner portal. This value may be validated to match approved Partner
  15805. // values.
  15806. PortalUrl string `json:"portalUrl,omitempty"`
  15807. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  15808. // unconditionally include in API requests. By default, fields with
  15809. // empty values are omitted from API requests. However, any non-pointer,
  15810. // non-interface field appearing in ForceSendFields will be sent to the
  15811. // server regardless of whether the field is empty or not. This may be
  15812. // used to include empty fields in Patch requests.
  15813. ForceSendFields []string `json:"-"`
  15814. // NullFields is a list of field names (e.g. "InterconnectName") to
  15815. // include in API requests with the JSON null value. By default, fields
  15816. // with empty values are omitted from API requests. However, any field
  15817. // with an empty value appearing in NullFields will be sent to the
  15818. // server as null. It is an error if a field in this list has a
  15819. // non-empty value. This may be used to include null fields in Patch
  15820. // requests.
  15821. NullFields []string `json:"-"`
  15822. }
  15823. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  15824. type NoMethod InterconnectAttachmentPartnerMetadata
  15825. raw := NoMethod(*s)
  15826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15827. }
  15828. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  15829. // attachment when this belongs to an interconnect of type DEDICATED.
  15830. type InterconnectAttachmentPrivateInfo struct {
  15831. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  15832. // traffic between Google and the customer, going to and from this
  15833. // network and region.
  15834. Tag8021q int64 `json:"tag8021q,omitempty"`
  15835. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  15836. // unconditionally include in API requests. By default, fields with
  15837. // empty values are omitted from API requests. However, any non-pointer,
  15838. // non-interface field appearing in ForceSendFields will be sent to the
  15839. // server regardless of whether the field is empty or not. This may be
  15840. // used to include empty fields in Patch requests.
  15841. ForceSendFields []string `json:"-"`
  15842. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  15843. // API requests with the JSON null value. By default, fields with empty
  15844. // values are omitted from API requests. However, any field with an
  15845. // empty value appearing in NullFields will be sent to the server as
  15846. // null. It is an error if a field in this list has a non-empty value.
  15847. // This may be used to include null fields in Patch requests.
  15848. NullFields []string `json:"-"`
  15849. }
  15850. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  15851. type NoMethod InterconnectAttachmentPrivateInfo
  15852. raw := NoMethod(*s)
  15853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15854. }
  15855. type InterconnectAttachmentsScopedList struct {
  15856. // InterconnectAttachments: A list of interconnect attachments contained
  15857. // in this scope.
  15858. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  15859. // Warning: Informational warning which replaces the list of addresses
  15860. // when the list is empty.
  15861. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  15862. // ForceSendFields is a list of field names (e.g.
  15863. // "InterconnectAttachments") to unconditionally include in API
  15864. // requests. By default, fields with empty values are omitted from API
  15865. // requests. However, any non-pointer, non-interface field appearing in
  15866. // ForceSendFields will be sent to the server regardless of whether the
  15867. // field is empty or not. This may be used to include empty fields in
  15868. // Patch requests.
  15869. ForceSendFields []string `json:"-"`
  15870. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  15871. // to include in API requests with the JSON null value. By default,
  15872. // fields with empty values are omitted from API requests. However, any
  15873. // field with an empty value appearing in NullFields will be sent to the
  15874. // server as null. It is an error if a field in this list has a
  15875. // non-empty value. This may be used to include null fields in Patch
  15876. // requests.
  15877. NullFields []string `json:"-"`
  15878. }
  15879. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  15880. type NoMethod InterconnectAttachmentsScopedList
  15881. raw := NoMethod(*s)
  15882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15883. }
  15884. // InterconnectAttachmentsScopedListWarning: Informational warning which
  15885. // replaces the list of addresses when the list is empty.
  15886. type InterconnectAttachmentsScopedListWarning struct {
  15887. // Code: [Output Only] A warning code, if applicable. For example,
  15888. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15889. // the response.
  15890. //
  15891. // Possible values:
  15892. // "CLEANUP_FAILED"
  15893. // "DEPRECATED_RESOURCE_USED"
  15894. // "DEPRECATED_TYPE_USED"
  15895. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15896. // "EXPERIMENTAL_TYPE_USED"
  15897. // "EXTERNAL_API_WARNING"
  15898. // "FIELD_VALUE_OVERRIDEN"
  15899. // "INJECTED_KERNELS_DEPRECATED"
  15900. // "MISSING_TYPE_DEPENDENCY"
  15901. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15902. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15903. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15904. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15905. // "NEXT_HOP_NOT_RUNNING"
  15906. // "NOT_CRITICAL_ERROR"
  15907. // "NO_RESULTS_ON_PAGE"
  15908. // "REQUIRED_TOS_AGREEMENT"
  15909. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15910. // "RESOURCE_NOT_DELETED"
  15911. // "SCHEMA_VALIDATION_IGNORED"
  15912. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15913. // "UNDECLARED_PROPERTIES"
  15914. // "UNREACHABLE"
  15915. Code string `json:"code,omitempty"`
  15916. // Data: [Output Only] Metadata about this warning in key: value format.
  15917. // For example:
  15918. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15919. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  15920. // Message: [Output Only] A human-readable description of the warning
  15921. // code.
  15922. Message string `json:"message,omitempty"`
  15923. // ForceSendFields is a list of field names (e.g. "Code") to
  15924. // unconditionally include in API requests. By default, fields with
  15925. // empty values are omitted from API requests. However, any non-pointer,
  15926. // non-interface field appearing in ForceSendFields will be sent to the
  15927. // server regardless of whether the field is empty or not. This may be
  15928. // used to include empty fields in Patch requests.
  15929. ForceSendFields []string `json:"-"`
  15930. // NullFields is a list of field names (e.g. "Code") to include in API
  15931. // requests with the JSON null value. By default, fields with empty
  15932. // values are omitted from API requests. However, any field with an
  15933. // empty value appearing in NullFields will be sent to the server as
  15934. // null. It is an error if a field in this list has a non-empty value.
  15935. // This may be used to include null fields in Patch requests.
  15936. NullFields []string `json:"-"`
  15937. }
  15938. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  15939. type NoMethod InterconnectAttachmentsScopedListWarning
  15940. raw := NoMethod(*s)
  15941. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15942. }
  15943. type InterconnectAttachmentsScopedListWarningData struct {
  15944. // Key: [Output Only] A key that provides more detail on the warning
  15945. // being returned. For example, for warnings where there are no results
  15946. // in a list request for a particular zone, this key might be scope and
  15947. // the key value might be the zone name. Other examples might be a key
  15948. // indicating a deprecated resource and a suggested replacement, or a
  15949. // warning about invalid network settings (for example, if an instance
  15950. // attempts to perform IP forwarding but is not enabled for IP
  15951. // forwarding).
  15952. Key string `json:"key,omitempty"`
  15953. // Value: [Output Only] A warning data value corresponding to the key.
  15954. Value string `json:"value,omitempty"`
  15955. // ForceSendFields is a list of field names (e.g. "Key") to
  15956. // unconditionally include in API requests. By default, fields with
  15957. // empty values are omitted from API requests. However, any non-pointer,
  15958. // non-interface field appearing in ForceSendFields will be sent to the
  15959. // server regardless of whether the field is empty or not. This may be
  15960. // used to include empty fields in Patch requests.
  15961. ForceSendFields []string `json:"-"`
  15962. // NullFields is a list of field names (e.g. "Key") to include in API
  15963. // requests with the JSON null value. By default, fields with empty
  15964. // values are omitted from API requests. However, any field with an
  15965. // empty value appearing in NullFields will be sent to the server as
  15966. // null. It is an error if a field in this list has a non-empty value.
  15967. // This may be used to include null fields in Patch requests.
  15968. NullFields []string `json:"-"`
  15969. }
  15970. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  15971. type NoMethod InterconnectAttachmentsScopedListWarningData
  15972. raw := NoMethod(*s)
  15973. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15974. }
  15975. // InterconnectCircuitInfo: Describes a single physical circuit between
  15976. // the Customer and Google. CircuitInfo objects are created by Google,
  15977. // so all fields are output only. Next id: 4
  15978. type InterconnectCircuitInfo struct {
  15979. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  15980. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  15981. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  15982. // at circuit turn-up.
  15983. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  15984. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  15985. // circuit turn-up and provided by Google to the customer in the LOA.
  15986. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  15987. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  15988. // unconditionally include in API requests. By default, fields with
  15989. // empty values are omitted from API requests. However, any non-pointer,
  15990. // non-interface field appearing in ForceSendFields will be sent to the
  15991. // server regardless of whether the field is empty or not. This may be
  15992. // used to include empty fields in Patch requests.
  15993. ForceSendFields []string `json:"-"`
  15994. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  15995. // include in API requests with the JSON null value. By default, fields
  15996. // with empty values are omitted from API requests. However, any field
  15997. // with an empty value appearing in NullFields will be sent to the
  15998. // server as null. It is an error if a field in this list has a
  15999. // non-empty value. This may be used to include null fields in Patch
  16000. // requests.
  16001. NullFields []string `json:"-"`
  16002. }
  16003. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  16004. type NoMethod InterconnectCircuitInfo
  16005. raw := NoMethod(*s)
  16006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16007. }
  16008. // InterconnectDiagnostics: Diagnostics information about interconnect,
  16009. // contains detailed and current technical information about Google?s
  16010. // side of the connection.
  16011. type InterconnectDiagnostics struct {
  16012. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  16013. // describing individual neighbors currently seen by the Google router
  16014. // in the ARP cache for the Interconnect. This will be empty when the
  16015. // Interconnect is not bundled.
  16016. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  16017. // Links: A list of InterconnectDiagnostics.LinkStatus objects,
  16018. // describing the status for each link on the Interconnect.
  16019. Links []*InterconnectDiagnosticsLinkStatus `json:"links,omitempty"`
  16020. // MacAddress: The MAC address of the Interconnect's bundle interface.
  16021. MacAddress string `json:"macAddress,omitempty"`
  16022. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  16023. // unconditionally include in API requests. By default, fields with
  16024. // empty values are omitted from API requests. However, any non-pointer,
  16025. // non-interface field appearing in ForceSendFields will be sent to the
  16026. // server regardless of whether the field is empty or not. This may be
  16027. // used to include empty fields in Patch requests.
  16028. ForceSendFields []string `json:"-"`
  16029. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  16030. // API requests with the JSON null value. By default, fields with empty
  16031. // values are omitted from API requests. However, any field with an
  16032. // empty value appearing in NullFields will be sent to the server as
  16033. // null. It is an error if a field in this list has a non-empty value.
  16034. // This may be used to include null fields in Patch requests.
  16035. NullFields []string `json:"-"`
  16036. }
  16037. func (s *InterconnectDiagnostics) MarshalJSON() ([]byte, error) {
  16038. type NoMethod InterconnectDiagnostics
  16039. raw := NoMethod(*s)
  16040. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16041. }
  16042. // InterconnectDiagnosticsARPEntry: Describing the ARP neighbor entries
  16043. // seen on this link
  16044. type InterconnectDiagnosticsARPEntry struct {
  16045. // IpAddress: The IP address of this ARP neighbor.
  16046. IpAddress string `json:"ipAddress,omitempty"`
  16047. // MacAddress: The MAC address of this ARP neighbor.
  16048. MacAddress string `json:"macAddress,omitempty"`
  16049. // ForceSendFields is a list of field names (e.g. "IpAddress") to
  16050. // unconditionally include in API requests. By default, fields with
  16051. // empty values are omitted from API requests. However, any non-pointer,
  16052. // non-interface field appearing in ForceSendFields will be sent to the
  16053. // server regardless of whether the field is empty or not. This may be
  16054. // used to include empty fields in Patch requests.
  16055. ForceSendFields []string `json:"-"`
  16056. // NullFields is a list of field names (e.g. "IpAddress") to include in
  16057. // API requests with the JSON null value. By default, fields with empty
  16058. // values are omitted from API requests. However, any field with an
  16059. // empty value appearing in NullFields will be sent to the server as
  16060. // null. It is an error if a field in this list has a non-empty value.
  16061. // This may be used to include null fields in Patch requests.
  16062. NullFields []string `json:"-"`
  16063. }
  16064. func (s *InterconnectDiagnosticsARPEntry) MarshalJSON() ([]byte, error) {
  16065. type NoMethod InterconnectDiagnosticsARPEntry
  16066. raw := NoMethod(*s)
  16067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16068. }
  16069. type InterconnectDiagnosticsLinkLACPStatus struct {
  16070. // GoogleSystemId: System ID of the port on Google?s side of the LACP
  16071. // exchange.
  16072. GoogleSystemId string `json:"googleSystemId,omitempty"`
  16073. // NeighborSystemId: System ID of the port on the neighbor?s side of the
  16074. // LACP exchange.
  16075. NeighborSystemId string `json:"neighborSystemId,omitempty"`
  16076. // State: The state of a LACP link, which can take one of the following
  16077. // values:
  16078. // - ACTIVE: The link is configured and active within the bundle.
  16079. // - DETACHED: The link is not configured within the bundle. This means
  16080. // that the rest of the object should be empty.
  16081. //
  16082. // Possible values:
  16083. // "ACTIVE"
  16084. // "DETACHED"
  16085. State string `json:"state,omitempty"`
  16086. // ForceSendFields is a list of field names (e.g. "GoogleSystemId") to
  16087. // unconditionally include in API requests. By default, fields with
  16088. // empty values are omitted from API requests. However, any non-pointer,
  16089. // non-interface field appearing in ForceSendFields will be sent to the
  16090. // server regardless of whether the field is empty or not. This may be
  16091. // used to include empty fields in Patch requests.
  16092. ForceSendFields []string `json:"-"`
  16093. // NullFields is a list of field names (e.g. "GoogleSystemId") to
  16094. // include in API requests with the JSON null value. By default, fields
  16095. // with empty values are omitted from API requests. However, any field
  16096. // with an empty value appearing in NullFields will be sent to the
  16097. // server as null. It is an error if a field in this list has a
  16098. // non-empty value. This may be used to include null fields in Patch
  16099. // requests.
  16100. NullFields []string `json:"-"`
  16101. }
  16102. func (s *InterconnectDiagnosticsLinkLACPStatus) MarshalJSON() ([]byte, error) {
  16103. type NoMethod InterconnectDiagnosticsLinkLACPStatus
  16104. raw := NoMethod(*s)
  16105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16106. }
  16107. type InterconnectDiagnosticsLinkOpticalPower struct {
  16108. // State: The status of the current value when compared to the warning
  16109. // and alarm levels for the receiving or transmitting transceiver.
  16110. // Possible states include:
  16111. // - OK: The value has not crossed a warning threshold.
  16112. // - LOW_WARNING: The value has crossed below the low warning threshold.
  16113. //
  16114. // - HIGH_WARNING: The value has crossed above the high warning
  16115. // threshold.
  16116. // - LOW_ALARM: The value has crossed below the low alarm threshold.
  16117. // - HIGH_ALARM: The value has crossed above the high alarm threshold.
  16118. //
  16119. // Possible values:
  16120. // "HIGH_ALARM"
  16121. // "HIGH_WARNING"
  16122. // "LOW_ALARM"
  16123. // "LOW_WARNING"
  16124. // "OK"
  16125. State string `json:"state,omitempty"`
  16126. // Value: Value of the current receiving or transmitting optical power,
  16127. // read in dBm. Take a known good optical value, give it a 10% margin
  16128. // and trigger warnings relative to that value. In general, a -7dBm
  16129. // warning and a -11dBm alarm are good optical value estimates for most
  16130. // links.
  16131. Value float64 `json:"value,omitempty"`
  16132. // ForceSendFields is a list of field names (e.g. "State") to
  16133. // unconditionally include in API requests. By default, fields with
  16134. // empty values are omitted from API requests. However, any non-pointer,
  16135. // non-interface field appearing in ForceSendFields will be sent to the
  16136. // server regardless of whether the field is empty or not. This may be
  16137. // used to include empty fields in Patch requests.
  16138. ForceSendFields []string `json:"-"`
  16139. // NullFields is a list of field names (e.g. "State") to include in API
  16140. // requests with the JSON null value. By default, fields with empty
  16141. // values are omitted from API requests. However, any field with an
  16142. // empty value appearing in NullFields will be sent to the server as
  16143. // null. It is an error if a field in this list has a non-empty value.
  16144. // This may be used to include null fields in Patch requests.
  16145. NullFields []string `json:"-"`
  16146. }
  16147. func (s *InterconnectDiagnosticsLinkOpticalPower) MarshalJSON() ([]byte, error) {
  16148. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  16149. raw := NoMethod(*s)
  16150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16151. }
  16152. func (s *InterconnectDiagnosticsLinkOpticalPower) UnmarshalJSON(data []byte) error {
  16153. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  16154. var s1 struct {
  16155. Value gensupport.JSONFloat64 `json:"value"`
  16156. *NoMethod
  16157. }
  16158. s1.NoMethod = (*NoMethod)(s)
  16159. if err := json.Unmarshal(data, &s1); err != nil {
  16160. return err
  16161. }
  16162. s.Value = float64(s1.Value)
  16163. return nil
  16164. }
  16165. type InterconnectDiagnosticsLinkStatus struct {
  16166. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  16167. // describing the ARP neighbor entries seen on this link. This will be
  16168. // empty if the link is bundled
  16169. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  16170. // CircuitId: The unique ID for this link assigned during turn up by
  16171. // Google.
  16172. CircuitId string `json:"circuitId,omitempty"`
  16173. // GoogleDemarc: The Demarc address assigned by Google and provided in
  16174. // the LoA.
  16175. GoogleDemarc string `json:"googleDemarc,omitempty"`
  16176. LacpStatus *InterconnectDiagnosticsLinkLACPStatus `json:"lacpStatus,omitempty"`
  16177. // ReceivingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
  16178. // object, describing the current value and status of the received light
  16179. // level.
  16180. ReceivingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"receivingOpticalPower,omitempty"`
  16181. // TransmittingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
  16182. // object, describing the current value and status of the transmitted
  16183. // light level.
  16184. TransmittingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"transmittingOpticalPower,omitempty"`
  16185. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  16186. // unconditionally include in API requests. By default, fields with
  16187. // empty values are omitted from API requests. However, any non-pointer,
  16188. // non-interface field appearing in ForceSendFields will be sent to the
  16189. // server regardless of whether the field is empty or not. This may be
  16190. // used to include empty fields in Patch requests.
  16191. ForceSendFields []string `json:"-"`
  16192. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  16193. // API requests with the JSON null value. By default, fields with empty
  16194. // values are omitted from API requests. However, any field with an
  16195. // empty value appearing in NullFields will be sent to the server as
  16196. // null. It is an error if a field in this list has a non-empty value.
  16197. // This may be used to include null fields in Patch requests.
  16198. NullFields []string `json:"-"`
  16199. }
  16200. func (s *InterconnectDiagnosticsLinkStatus) MarshalJSON() ([]byte, error) {
  16201. type NoMethod InterconnectDiagnosticsLinkStatus
  16202. raw := NoMethod(*s)
  16203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16204. }
  16205. // InterconnectList: Response to the list request, and contains a list
  16206. // of interconnects.
  16207. type InterconnectList struct {
  16208. // Id: [Output Only] Unique identifier for the resource; defined by the
  16209. // server.
  16210. Id string `json:"id,omitempty"`
  16211. // Items: A list of Interconnect resources.
  16212. Items []*Interconnect `json:"items,omitempty"`
  16213. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  16214. // for lists of interconnects.
  16215. Kind string `json:"kind,omitempty"`
  16216. // NextPageToken: [Output Only] This token allows you to get the next
  16217. // page of results for list requests. If the number of results is larger
  16218. // than maxResults, use the nextPageToken as a value for the query
  16219. // parameter pageToken in the next list request. Subsequent list
  16220. // requests will have their own nextPageToken to continue paging through
  16221. // the results.
  16222. NextPageToken string `json:"nextPageToken,omitempty"`
  16223. // SelfLink: [Output Only] Server-defined URL for this resource.
  16224. SelfLink string `json:"selfLink,omitempty"`
  16225. // Warning: [Output Only] Informational warning message.
  16226. Warning *InterconnectListWarning `json:"warning,omitempty"`
  16227. // ServerResponse contains the HTTP response code and headers from the
  16228. // server.
  16229. googleapi.ServerResponse `json:"-"`
  16230. // ForceSendFields is a list of field names (e.g. "Id") to
  16231. // unconditionally include in API requests. By default, fields with
  16232. // empty values are omitted from API requests. However, any non-pointer,
  16233. // non-interface field appearing in ForceSendFields will be sent to the
  16234. // server regardless of whether the field is empty or not. This may be
  16235. // used to include empty fields in Patch requests.
  16236. ForceSendFields []string `json:"-"`
  16237. // NullFields is a list of field names (e.g. "Id") to include in API
  16238. // requests with the JSON null value. By default, fields with empty
  16239. // values are omitted from API requests. However, any field with an
  16240. // empty value appearing in NullFields will be sent to the server as
  16241. // null. It is an error if a field in this list has a non-empty value.
  16242. // This may be used to include null fields in Patch requests.
  16243. NullFields []string `json:"-"`
  16244. }
  16245. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  16246. type NoMethod InterconnectList
  16247. raw := NoMethod(*s)
  16248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16249. }
  16250. // InterconnectListWarning: [Output Only] Informational warning message.
  16251. type InterconnectListWarning struct {
  16252. // Code: [Output Only] A warning code, if applicable. For example,
  16253. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16254. // the response.
  16255. //
  16256. // Possible values:
  16257. // "CLEANUP_FAILED"
  16258. // "DEPRECATED_RESOURCE_USED"
  16259. // "DEPRECATED_TYPE_USED"
  16260. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16261. // "EXPERIMENTAL_TYPE_USED"
  16262. // "EXTERNAL_API_WARNING"
  16263. // "FIELD_VALUE_OVERRIDEN"
  16264. // "INJECTED_KERNELS_DEPRECATED"
  16265. // "MISSING_TYPE_DEPENDENCY"
  16266. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16267. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16268. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16269. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16270. // "NEXT_HOP_NOT_RUNNING"
  16271. // "NOT_CRITICAL_ERROR"
  16272. // "NO_RESULTS_ON_PAGE"
  16273. // "REQUIRED_TOS_AGREEMENT"
  16274. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16275. // "RESOURCE_NOT_DELETED"
  16276. // "SCHEMA_VALIDATION_IGNORED"
  16277. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16278. // "UNDECLARED_PROPERTIES"
  16279. // "UNREACHABLE"
  16280. Code string `json:"code,omitempty"`
  16281. // Data: [Output Only] Metadata about this warning in key: value format.
  16282. // For example:
  16283. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16284. Data []*InterconnectListWarningData `json:"data,omitempty"`
  16285. // Message: [Output Only] A human-readable description of the warning
  16286. // code.
  16287. Message string `json:"message,omitempty"`
  16288. // ForceSendFields is a list of field names (e.g. "Code") to
  16289. // unconditionally include in API requests. By default, fields with
  16290. // empty values are omitted from API requests. However, any non-pointer,
  16291. // non-interface field appearing in ForceSendFields will be sent to the
  16292. // server regardless of whether the field is empty or not. This may be
  16293. // used to include empty fields in Patch requests.
  16294. ForceSendFields []string `json:"-"`
  16295. // NullFields is a list of field names (e.g. "Code") to include in API
  16296. // requests with the JSON null value. By default, fields with empty
  16297. // values are omitted from API requests. However, any field with an
  16298. // empty value appearing in NullFields will be sent to the server as
  16299. // null. It is an error if a field in this list has a non-empty value.
  16300. // This may be used to include null fields in Patch requests.
  16301. NullFields []string `json:"-"`
  16302. }
  16303. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  16304. type NoMethod InterconnectListWarning
  16305. raw := NoMethod(*s)
  16306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16307. }
  16308. type InterconnectListWarningData struct {
  16309. // Key: [Output Only] A key that provides more detail on the warning
  16310. // being returned. For example, for warnings where there are no results
  16311. // in a list request for a particular zone, this key might be scope and
  16312. // the key value might be the zone name. Other examples might be a key
  16313. // indicating a deprecated resource and a suggested replacement, or a
  16314. // warning about invalid network settings (for example, if an instance
  16315. // attempts to perform IP forwarding but is not enabled for IP
  16316. // forwarding).
  16317. Key string `json:"key,omitempty"`
  16318. // Value: [Output Only] A warning data value corresponding to the key.
  16319. Value string `json:"value,omitempty"`
  16320. // ForceSendFields is a list of field names (e.g. "Key") to
  16321. // unconditionally include in API requests. By default, fields with
  16322. // empty values are omitted from API requests. However, any non-pointer,
  16323. // non-interface field appearing in ForceSendFields will be sent to the
  16324. // server regardless of whether the field is empty or not. This may be
  16325. // used to include empty fields in Patch requests.
  16326. ForceSendFields []string `json:"-"`
  16327. // NullFields is a list of field names (e.g. "Key") to include in API
  16328. // requests with the JSON null value. By default, fields with empty
  16329. // values are omitted from API requests. However, any field with an
  16330. // empty value appearing in NullFields will be sent to the server as
  16331. // null. It is an error if a field in this list has a non-empty value.
  16332. // This may be used to include null fields in Patch requests.
  16333. NullFields []string `json:"-"`
  16334. }
  16335. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  16336. type NoMethod InterconnectListWarningData
  16337. raw := NoMethod(*s)
  16338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16339. }
  16340. // InterconnectLocation: Represents an InterconnectLocations resource.
  16341. // The InterconnectLocations resource describes the locations where you
  16342. // can connect to Google's networks. For more information, see
  16343. // Colocation Facilities.
  16344. type InterconnectLocation struct {
  16345. // Address: [Output Only] The postal address of the Point of Presence,
  16346. // each line in the address is separated by a newline character.
  16347. Address string `json:"address,omitempty"`
  16348. // AvailabilityZone: [Output Only] Availability zone for this
  16349. // InterconnectLocation. Within a metropolitan area (metro), maintenance
  16350. // will not be simultaneously scheduled in more than one availability
  16351. // zone. Example: "zone1" or "zone2".
  16352. AvailabilityZone string `json:"availabilityZone,omitempty"`
  16353. // City: [Output Only] Metropolitan area designator that indicates which
  16354. // city an interconnect is located. For example: "Chicago, IL",
  16355. // "Amsterdam, Netherlands".
  16356. City string `json:"city,omitempty"`
  16357. // Continent: [Output Only] Continent for this location, which can take
  16358. // one of the following values:
  16359. // - AFRICA
  16360. // - ASIA_PAC
  16361. // - EUROPE
  16362. // - NORTH_AMERICA
  16363. // - SOUTH_AMERICA
  16364. //
  16365. // Possible values:
  16366. // "AFRICA"
  16367. // "ASIA_PAC"
  16368. // "C_AFRICA"
  16369. // "C_ASIA_PAC"
  16370. // "C_EUROPE"
  16371. // "C_NORTH_AMERICA"
  16372. // "C_SOUTH_AMERICA"
  16373. // "EUROPE"
  16374. // "NORTH_AMERICA"
  16375. // "SOUTH_AMERICA"
  16376. Continent string `json:"continent,omitempty"`
  16377. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16378. // format.
  16379. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16380. // Description: [Output Only] An optional description of the resource.
  16381. Description string `json:"description,omitempty"`
  16382. // FacilityProvider: [Output Only] The name of the provider for this
  16383. // facility (e.g., EQUINIX).
  16384. FacilityProvider string `json:"facilityProvider,omitempty"`
  16385. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  16386. // Identifier for this facility (e.g., Ashburn-DC1).
  16387. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  16388. // Id: [Output Only] The unique identifier for the resource. This
  16389. // identifier is defined by the server.
  16390. Id uint64 `json:"id,omitempty,string"`
  16391. // Kind: [Output Only] Type of the resource. Always
  16392. // compute#interconnectLocation for interconnect locations.
  16393. Kind string `json:"kind,omitempty"`
  16394. // Name: [Output Only] Name of the resource.
  16395. Name string `json:"name,omitempty"`
  16396. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  16397. // facility (corresponding with a netfac type in peeringdb).
  16398. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  16399. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  16400. // objects, that describe parameters pertaining to the relation between
  16401. // this InterconnectLocation and various Google Cloud regions.
  16402. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  16403. // SelfLink: [Output Only] Server-defined URL for the resource.
  16404. SelfLink string `json:"selfLink,omitempty"`
  16405. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  16406. // with the resource id.
  16407. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  16408. // Status: [Output Only] The status of this InterconnectLocation, which
  16409. // can take one of the following values:
  16410. // - CLOSED: The InterconnectLocation is closed and is unavailable for
  16411. // provisioning new Interconnects.
  16412. // - AVAILABLE: The InterconnectLocation is available for provisioning
  16413. // new Interconnects.
  16414. //
  16415. // Possible values:
  16416. // "AVAILABLE"
  16417. // "CLOSED"
  16418. Status string `json:"status,omitempty"`
  16419. // ServerResponse contains the HTTP response code and headers from the
  16420. // server.
  16421. googleapi.ServerResponse `json:"-"`
  16422. // ForceSendFields is a list of field names (e.g. "Address") to
  16423. // unconditionally include in API requests. By default, fields with
  16424. // empty values are omitted from API requests. However, any non-pointer,
  16425. // non-interface field appearing in ForceSendFields will be sent to the
  16426. // server regardless of whether the field is empty or not. This may be
  16427. // used to include empty fields in Patch requests.
  16428. ForceSendFields []string `json:"-"`
  16429. // NullFields is a list of field names (e.g. "Address") to include in
  16430. // API requests with the JSON null value. By default, fields with empty
  16431. // values are omitted from API requests. However, any field with an
  16432. // empty value appearing in NullFields will be sent to the server as
  16433. // null. It is an error if a field in this list has a non-empty value.
  16434. // This may be used to include null fields in Patch requests.
  16435. NullFields []string `json:"-"`
  16436. }
  16437. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  16438. type NoMethod InterconnectLocation
  16439. raw := NoMethod(*s)
  16440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16441. }
  16442. // InterconnectLocationList: Response to the list request, and contains
  16443. // a list of interconnect locations.
  16444. type InterconnectLocationList struct {
  16445. // Id: [Output Only] Unique identifier for the resource; defined by the
  16446. // server.
  16447. Id string `json:"id,omitempty"`
  16448. // Items: A list of InterconnectLocation resources.
  16449. Items []*InterconnectLocation `json:"items,omitempty"`
  16450. // Kind: [Output Only] Type of resource. Always
  16451. // compute#interconnectLocationList for lists of interconnect locations.
  16452. Kind string `json:"kind,omitempty"`
  16453. // NextPageToken: [Output Only] This token allows you to get the next
  16454. // page of results for list requests. If the number of results is larger
  16455. // than maxResults, use the nextPageToken as a value for the query
  16456. // parameter pageToken in the next list request. Subsequent list
  16457. // requests will have their own nextPageToken to continue paging through
  16458. // the results.
  16459. NextPageToken string `json:"nextPageToken,omitempty"`
  16460. // SelfLink: [Output Only] Server-defined URL for this resource.
  16461. SelfLink string `json:"selfLink,omitempty"`
  16462. // Warning: [Output Only] Informational warning message.
  16463. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  16464. // ServerResponse contains the HTTP response code and headers from the
  16465. // server.
  16466. googleapi.ServerResponse `json:"-"`
  16467. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") to include in API
  16475. // requests with the JSON null value. By default, fields with empty
  16476. // values are omitted from API requests. However, any field with an
  16477. // 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 *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  16483. type NoMethod InterconnectLocationList
  16484. raw := NoMethod(*s)
  16485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16486. }
  16487. // InterconnectLocationListWarning: [Output Only] Informational warning
  16488. // message.
  16489. type InterconnectLocationListWarning struct {
  16490. // Code: [Output Only] A warning code, if applicable. For example,
  16491. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16492. // the response.
  16493. //
  16494. // Possible values:
  16495. // "CLEANUP_FAILED"
  16496. // "DEPRECATED_RESOURCE_USED"
  16497. // "DEPRECATED_TYPE_USED"
  16498. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16499. // "EXPERIMENTAL_TYPE_USED"
  16500. // "EXTERNAL_API_WARNING"
  16501. // "FIELD_VALUE_OVERRIDEN"
  16502. // "INJECTED_KERNELS_DEPRECATED"
  16503. // "MISSING_TYPE_DEPENDENCY"
  16504. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16505. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16506. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16507. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16508. // "NEXT_HOP_NOT_RUNNING"
  16509. // "NOT_CRITICAL_ERROR"
  16510. // "NO_RESULTS_ON_PAGE"
  16511. // "REQUIRED_TOS_AGREEMENT"
  16512. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16513. // "RESOURCE_NOT_DELETED"
  16514. // "SCHEMA_VALIDATION_IGNORED"
  16515. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16516. // "UNDECLARED_PROPERTIES"
  16517. // "UNREACHABLE"
  16518. Code string `json:"code,omitempty"`
  16519. // Data: [Output Only] Metadata about this warning in key: value format.
  16520. // For example:
  16521. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16522. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  16523. // Message: [Output Only] A human-readable description of the warning
  16524. // code.
  16525. Message string `json:"message,omitempty"`
  16526. // ForceSendFields is a list of field names (e.g. "Code") to
  16527. // unconditionally include in API requests. By default, fields with
  16528. // empty values are omitted from API requests. However, any non-pointer,
  16529. // non-interface field appearing in ForceSendFields will be sent to the
  16530. // server regardless of whether the field is empty or not. This may be
  16531. // used to include empty fields in Patch requests.
  16532. ForceSendFields []string `json:"-"`
  16533. // NullFields is a list of field names (e.g. "Code") to include in API
  16534. // requests with the JSON null value. By default, fields with empty
  16535. // values are omitted from API requests. However, any field with an
  16536. // empty value appearing in NullFields will be sent to the server as
  16537. // null. It is an error if a field in this list has a non-empty value.
  16538. // This may be used to include null fields in Patch requests.
  16539. NullFields []string `json:"-"`
  16540. }
  16541. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  16542. type NoMethod InterconnectLocationListWarning
  16543. raw := NoMethod(*s)
  16544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16545. }
  16546. type InterconnectLocationListWarningData struct {
  16547. // Key: [Output Only] A key that provides more detail on the warning
  16548. // being returned. For example, for warnings where there are no results
  16549. // in a list request for a particular zone, this key might be scope and
  16550. // the key value might be the zone name. Other examples might be a key
  16551. // indicating a deprecated resource and a suggested replacement, or a
  16552. // warning about invalid network settings (for example, if an instance
  16553. // attempts to perform IP forwarding but is not enabled for IP
  16554. // forwarding).
  16555. Key string `json:"key,omitempty"`
  16556. // Value: [Output Only] A warning data value corresponding to the key.
  16557. Value string `json:"value,omitempty"`
  16558. // ForceSendFields is a list of field names (e.g. "Key") to
  16559. // unconditionally include in API requests. By default, fields with
  16560. // empty values are omitted from API requests. However, any non-pointer,
  16561. // non-interface field appearing in ForceSendFields will be sent to the
  16562. // server regardless of whether the field is empty or not. This may be
  16563. // used to include empty fields in Patch requests.
  16564. ForceSendFields []string `json:"-"`
  16565. // NullFields is a list of field names (e.g. "Key") to include in API
  16566. // requests with the JSON null value. By default, fields with empty
  16567. // values are omitted from API requests. However, any field with an
  16568. // empty value appearing in NullFields will be sent to the server as
  16569. // null. It is an error if a field in this list has a non-empty value.
  16570. // This may be used to include null fields in Patch requests.
  16571. NullFields []string `json:"-"`
  16572. }
  16573. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  16574. type NoMethod InterconnectLocationListWarningData
  16575. raw := NoMethod(*s)
  16576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16577. }
  16578. // InterconnectLocationRegionInfo: Information about any potential
  16579. // InterconnectAttachments between an Interconnect at a specific
  16580. // InterconnectLocation, and a specific Cloud Region.
  16581. type InterconnectLocationRegionInfo struct {
  16582. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  16583. // InterconnectLocation to a VM in this region.
  16584. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  16585. // LocationPresence: Identifies the network presence of this location.
  16586. //
  16587. // Possible values:
  16588. // "GLOBAL"
  16589. // "LOCAL_REGION"
  16590. // "LP_GLOBAL"
  16591. // "LP_LOCAL_REGION"
  16592. LocationPresence string `json:"locationPresence,omitempty"`
  16593. // Region: URL for the region of this location.
  16594. Region string `json:"region,omitempty"`
  16595. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  16596. // unconditionally include in API requests. By default, fields with
  16597. // empty values are omitted from API requests. However, any non-pointer,
  16598. // non-interface field appearing in ForceSendFields will be sent to the
  16599. // server regardless of whether the field is empty or not. This may be
  16600. // used to include empty fields in Patch requests.
  16601. ForceSendFields []string `json:"-"`
  16602. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  16603. // in API requests with the JSON null value. By default, fields with
  16604. // empty values are omitted from API requests. However, any field with
  16605. // an empty value appearing in NullFields will be sent to the server as
  16606. // null. It is an error if a field in this list has a non-empty value.
  16607. // This may be used to include null fields in Patch requests.
  16608. NullFields []string `json:"-"`
  16609. }
  16610. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  16611. type NoMethod InterconnectLocationRegionInfo
  16612. raw := NoMethod(*s)
  16613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16614. }
  16615. // InterconnectOutageNotification: Description of a planned outage on
  16616. // this Interconnect. Next id: 9
  16617. type InterconnectOutageNotification struct {
  16618. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  16619. // Google-side circuit IDs that will be affected.
  16620. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  16621. // Description: A description about the purpose of the outage.
  16622. Description string `json:"description,omitempty"`
  16623. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  16624. // epoch).
  16625. EndTime int64 `json:"endTime,omitempty,string"`
  16626. // IssueType: Form this outage is expected to take, which can take one
  16627. // of the following values:
  16628. // - OUTAGE: The Interconnect may be completely out of service for some
  16629. // or all of the specified window.
  16630. // - PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a
  16631. // whole should remain up, but with reduced bandwidth. Note that the
  16632. // versions of this enum prefixed with "IT_" have been deprecated in
  16633. // favor of the unprefixed values.
  16634. //
  16635. // Possible values:
  16636. // "IT_OUTAGE"
  16637. // "IT_PARTIAL_OUTAGE"
  16638. // "OUTAGE"
  16639. // "PARTIAL_OUTAGE"
  16640. IssueType string `json:"issueType,omitempty"`
  16641. // Name: Unique identifier for this outage notification.
  16642. Name string `json:"name,omitempty"`
  16643. // Source: The party that generated this notification, which can take
  16644. // the following value:
  16645. // - GOOGLE: this notification as generated by Google. Note that the
  16646. // value of NSRC_GOOGLE has been deprecated in favor of GOOGLE.
  16647. //
  16648. // Possible values:
  16649. // "GOOGLE"
  16650. // "NSRC_GOOGLE"
  16651. Source string `json:"source,omitempty"`
  16652. // StartTime: Scheduled start time for the outage (milliseconds since
  16653. // Unix epoch).
  16654. StartTime int64 `json:"startTime,omitempty,string"`
  16655. // State: State of this notification, which can take one of the
  16656. // following values:
  16657. // - ACTIVE: This outage notification is active. The event could be in
  16658. // the past, present, or future. See start_time and end_time for
  16659. // scheduling.
  16660. // - CANCELLED: The outage associated with this notification was
  16661. // cancelled before the outage was due to start. Note that the versions
  16662. // of this enum prefixed with "NS_" have been deprecated in favor of the
  16663. // unprefixed values.
  16664. //
  16665. // Possible values:
  16666. // "ACTIVE"
  16667. // "CANCELLED"
  16668. // "NS_ACTIVE"
  16669. // "NS_CANCELED"
  16670. State string `json:"state,omitempty"`
  16671. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  16672. // unconditionally include in API requests. By default, fields with
  16673. // empty values are omitted from API requests. However, any non-pointer,
  16674. // non-interface field appearing in ForceSendFields will be sent to the
  16675. // server regardless of whether the field is empty or not. This may be
  16676. // used to include empty fields in Patch requests.
  16677. ForceSendFields []string `json:"-"`
  16678. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  16679. // include in API requests with the JSON null value. By default, fields
  16680. // with empty values are omitted from API requests. However, any field
  16681. // with an empty value appearing in NullFields will be sent to the
  16682. // server as null. It is an error if a field in this list has a
  16683. // non-empty value. This may be used to include null fields in Patch
  16684. // requests.
  16685. NullFields []string `json:"-"`
  16686. }
  16687. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  16688. type NoMethod InterconnectOutageNotification
  16689. raw := NoMethod(*s)
  16690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16691. }
  16692. // InterconnectsGetDiagnosticsResponse: Response for the
  16693. // InterconnectsGetDiagnosticsRequest.
  16694. type InterconnectsGetDiagnosticsResponse struct {
  16695. Result *InterconnectDiagnostics `json:"result,omitempty"`
  16696. // ServerResponse contains the HTTP response code and headers from the
  16697. // server.
  16698. googleapi.ServerResponse `json:"-"`
  16699. // ForceSendFields is a list of field names (e.g. "Result") to
  16700. // unconditionally include in API requests. By default, fields with
  16701. // empty values are omitted from API requests. However, any non-pointer,
  16702. // non-interface field appearing in ForceSendFields will be sent to the
  16703. // server regardless of whether the field is empty or not. This may be
  16704. // used to include empty fields in Patch requests.
  16705. ForceSendFields []string `json:"-"`
  16706. // NullFields is a list of field names (e.g. "Result") to include in API
  16707. // requests with the JSON null value. By default, fields with empty
  16708. // values are omitted from API requests. However, any field with an
  16709. // empty value appearing in NullFields will be sent to the server as
  16710. // null. It is an error if a field in this list has a non-empty value.
  16711. // This may be used to include null fields in Patch requests.
  16712. NullFields []string `json:"-"`
  16713. }
  16714. func (s *InterconnectsGetDiagnosticsResponse) MarshalJSON() ([]byte, error) {
  16715. type NoMethod InterconnectsGetDiagnosticsResponse
  16716. raw := NoMethod(*s)
  16717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16718. }
  16719. type InternalIpAddress struct {
  16720. // Cidr: IP CIDR address or range.
  16721. Cidr string `json:"cidr,omitempty"`
  16722. // Owner: The owner of the internal IP address.
  16723. Owner string `json:"owner,omitempty"`
  16724. // Purpose: The purpose of the internal IP address if applicable.
  16725. Purpose string `json:"purpose,omitempty"`
  16726. // Region: The region of the internal IP address if applicable.
  16727. Region string `json:"region,omitempty"`
  16728. // Type: The type of the internal IP address.
  16729. //
  16730. // Possible values:
  16731. // "PEER_RESERVED"
  16732. // "PEER_USED"
  16733. // "REMOTE_RESERVED"
  16734. // "REMOTE_USED"
  16735. // "RESERVED"
  16736. // "SUBNETWORK"
  16737. // "TYPE_UNSPECIFIED"
  16738. Type string `json:"type,omitempty"`
  16739. // ForceSendFields is a list of field names (e.g. "Cidr") to
  16740. // unconditionally include in API requests. By default, fields with
  16741. // empty values are omitted from API requests. However, any non-pointer,
  16742. // non-interface field appearing in ForceSendFields will be sent to the
  16743. // server regardless of whether the field is empty or not. This may be
  16744. // used to include empty fields in Patch requests.
  16745. ForceSendFields []string `json:"-"`
  16746. // NullFields is a list of field names (e.g. "Cidr") to include in API
  16747. // requests with the JSON null value. By default, fields with empty
  16748. // values are omitted from API requests. However, any field with an
  16749. // empty value appearing in NullFields will be sent to the server as
  16750. // null. It is an error if a field in this list has a non-empty value.
  16751. // This may be used to include null fields in Patch requests.
  16752. NullFields []string `json:"-"`
  16753. }
  16754. func (s *InternalIpAddress) MarshalJSON() ([]byte, error) {
  16755. type NoMethod InternalIpAddress
  16756. raw := NoMethod(*s)
  16757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16758. }
  16759. type InternalIpOwner struct {
  16760. // IpCidrRange: IP CIDR range being owned.
  16761. IpCidrRange string `json:"ipCidrRange,omitempty"`
  16762. // Owners: URLs of the IP owners of the IP CIDR range.
  16763. Owners []string `json:"owners,omitempty"`
  16764. // SystemOwned: Whether this IP CIDR range is reserved for system use.
  16765. SystemOwned bool `json:"systemOwned,omitempty"`
  16766. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  16767. // unconditionally include in API requests. By default, fields with
  16768. // empty values are omitted from API requests. However, any non-pointer,
  16769. // non-interface field appearing in ForceSendFields will be sent to the
  16770. // server regardless of whether the field is empty or not. This may be
  16771. // used to include empty fields in Patch requests.
  16772. ForceSendFields []string `json:"-"`
  16773. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  16774. // in API requests with the JSON null value. By default, fields with
  16775. // empty values are omitted from API requests. However, any field with
  16776. // an empty value appearing in NullFields will be sent to the server as
  16777. // null. It is an error if a field in this list has a non-empty value.
  16778. // This may be used to include null fields in Patch requests.
  16779. NullFields []string `json:"-"`
  16780. }
  16781. func (s *InternalIpOwner) MarshalJSON() ([]byte, error) {
  16782. type NoMethod InternalIpOwner
  16783. raw := NoMethod(*s)
  16784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16785. }
  16786. type IpAddressesList struct {
  16787. // Id: [Output Only] Unique identifier for the resource; defined by the
  16788. // server.
  16789. Id string `json:"id,omitempty"`
  16790. // Items: A list of InternalIpAddress resources.
  16791. Items []*InternalIpAddress `json:"items,omitempty"`
  16792. // Kind: [Output Only] Type of resource. Always compute#ipAddressesList
  16793. // for IP addresses lists.
  16794. Kind string `json:"kind,omitempty"`
  16795. // NextPageToken: [Output Only] This token allows you to get the next
  16796. // page of results for list requests. If the number of results is larger
  16797. // than maxResults, use the nextPageToken as a value for the query
  16798. // parameter pageToken in the next list request. Subsequent list
  16799. // requests will have their own nextPageToken to continue paging through
  16800. // the results.
  16801. NextPageToken string `json:"nextPageToken,omitempty"`
  16802. // SelfLink: [Output Only] Server-defined URL for this resource.
  16803. SelfLink string `json:"selfLink,omitempty"`
  16804. // Warning: [Output Only] Informational warning message.
  16805. Warning *IpAddressesListWarning `json:"warning,omitempty"`
  16806. // ServerResponse contains the HTTP response code and headers from the
  16807. // server.
  16808. googleapi.ServerResponse `json:"-"`
  16809. // ForceSendFields is a list of field names (e.g. "Id") to
  16810. // unconditionally include in API requests. By default, fields with
  16811. // empty values are omitted from API requests. However, any non-pointer,
  16812. // non-interface field appearing in ForceSendFields will be sent to the
  16813. // server regardless of whether the field is empty or not. This may be
  16814. // used to include empty fields in Patch requests.
  16815. ForceSendFields []string `json:"-"`
  16816. // NullFields is a list of field names (e.g. "Id") to include in API
  16817. // requests with the JSON null value. By default, fields with empty
  16818. // values are omitted from API requests. However, any field with an
  16819. // empty value appearing in NullFields will be sent to the server as
  16820. // null. It is an error if a field in this list has a non-empty value.
  16821. // This may be used to include null fields in Patch requests.
  16822. NullFields []string `json:"-"`
  16823. }
  16824. func (s *IpAddressesList) MarshalJSON() ([]byte, error) {
  16825. type NoMethod IpAddressesList
  16826. raw := NoMethod(*s)
  16827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16828. }
  16829. // IpAddressesListWarning: [Output Only] Informational warning message.
  16830. type IpAddressesListWarning struct {
  16831. // Code: [Output Only] A warning code, if applicable. For example,
  16832. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16833. // the response.
  16834. //
  16835. // Possible values:
  16836. // "CLEANUP_FAILED"
  16837. // "DEPRECATED_RESOURCE_USED"
  16838. // "DEPRECATED_TYPE_USED"
  16839. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16840. // "EXPERIMENTAL_TYPE_USED"
  16841. // "EXTERNAL_API_WARNING"
  16842. // "FIELD_VALUE_OVERRIDEN"
  16843. // "INJECTED_KERNELS_DEPRECATED"
  16844. // "MISSING_TYPE_DEPENDENCY"
  16845. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16846. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16847. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16848. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16849. // "NEXT_HOP_NOT_RUNNING"
  16850. // "NOT_CRITICAL_ERROR"
  16851. // "NO_RESULTS_ON_PAGE"
  16852. // "REQUIRED_TOS_AGREEMENT"
  16853. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16854. // "RESOURCE_NOT_DELETED"
  16855. // "SCHEMA_VALIDATION_IGNORED"
  16856. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16857. // "UNDECLARED_PROPERTIES"
  16858. // "UNREACHABLE"
  16859. Code string `json:"code,omitempty"`
  16860. // Data: [Output Only] Metadata about this warning in key: value format.
  16861. // For example:
  16862. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16863. Data []*IpAddressesListWarningData `json:"data,omitempty"`
  16864. // Message: [Output Only] A human-readable description of the warning
  16865. // code.
  16866. Message string `json:"message,omitempty"`
  16867. // ForceSendFields is a list of field names (e.g. "Code") to
  16868. // unconditionally include in API requests. By default, fields with
  16869. // empty values are omitted from API requests. However, any non-pointer,
  16870. // non-interface field appearing in ForceSendFields will be sent to the
  16871. // server regardless of whether the field is empty or not. This may be
  16872. // used to include empty fields in Patch requests.
  16873. ForceSendFields []string `json:"-"`
  16874. // NullFields is a list of field names (e.g. "Code") to include in API
  16875. // requests with the JSON null value. By default, fields with empty
  16876. // values are omitted from API requests. However, any field with an
  16877. // empty value appearing in NullFields will be sent to the server as
  16878. // null. It is an error if a field in this list has a non-empty value.
  16879. // This may be used to include null fields in Patch requests.
  16880. NullFields []string `json:"-"`
  16881. }
  16882. func (s *IpAddressesListWarning) MarshalJSON() ([]byte, error) {
  16883. type NoMethod IpAddressesListWarning
  16884. raw := NoMethod(*s)
  16885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16886. }
  16887. type IpAddressesListWarningData struct {
  16888. // Key: [Output Only] A key that provides more detail on the warning
  16889. // being returned. For example, for warnings where there are no results
  16890. // in a list request for a particular zone, this key might be scope and
  16891. // the key value might be the zone name. Other examples might be a key
  16892. // indicating a deprecated resource and a suggested replacement, or a
  16893. // warning about invalid network settings (for example, if an instance
  16894. // attempts to perform IP forwarding but is not enabled for IP
  16895. // forwarding).
  16896. Key string `json:"key,omitempty"`
  16897. // Value: [Output Only] A warning data value corresponding to the key.
  16898. Value string `json:"value,omitempty"`
  16899. // ForceSendFields is a list of field names (e.g. "Key") to
  16900. // unconditionally include in API requests. By default, fields with
  16901. // empty values are omitted from API requests. However, any non-pointer,
  16902. // non-interface field appearing in ForceSendFields will be sent to the
  16903. // server regardless of whether the field is empty or not. This may be
  16904. // used to include empty fields in Patch requests.
  16905. ForceSendFields []string `json:"-"`
  16906. // NullFields is a list of field names (e.g. "Key") to include in API
  16907. // requests with the JSON null value. By default, fields with empty
  16908. // values are omitted from API requests. However, any field with an
  16909. // empty value appearing in NullFields will be sent to the server as
  16910. // null. It is an error if a field in this list has a non-empty value.
  16911. // This may be used to include null fields in Patch requests.
  16912. NullFields []string `json:"-"`
  16913. }
  16914. func (s *IpAddressesListWarningData) MarshalJSON() ([]byte, error) {
  16915. type NoMethod IpAddressesListWarningData
  16916. raw := NoMethod(*s)
  16917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16918. }
  16919. // IpOwnerList: Contains a list of IP owners.
  16920. type IpOwnerList struct {
  16921. // Id: [Output Only] Unique identifier for the resource; defined by the
  16922. // server.
  16923. Id string `json:"id,omitempty"`
  16924. // Items: A list of InternalIpOwner resources.
  16925. Items []*InternalIpOwner `json:"items,omitempty"`
  16926. // Kind: [Output Only] Type of resource. Always compute#ipOwnerList for
  16927. // lists of IP owners.
  16928. Kind string `json:"kind,omitempty"`
  16929. // NextPageToken: [Output Only] This token allows you to get the next
  16930. // page of results for list requests. If the number of results is larger
  16931. // than maxResults, use the nextPageToken as a value for the query
  16932. // parameter pageToken in the next list request. Subsequent list
  16933. // requests will have their own nextPageToken to continue paging through
  16934. // the results.
  16935. NextPageToken string `json:"nextPageToken,omitempty"`
  16936. // SelfLink: [Output Only] Server-defined URL for this resource.
  16937. SelfLink string `json:"selfLink,omitempty"`
  16938. // Warning: [Output Only] Informational warning message.
  16939. Warning *IpOwnerListWarning `json:"warning,omitempty"`
  16940. // ServerResponse contains the HTTP response code and headers from the
  16941. // server.
  16942. googleapi.ServerResponse `json:"-"`
  16943. // ForceSendFields is a list of field names (e.g. "Id") to
  16944. // unconditionally include in API requests. By default, fields with
  16945. // empty values are omitted from API requests. However, any non-pointer,
  16946. // non-interface field appearing in ForceSendFields will be sent to the
  16947. // server regardless of whether the field is empty or not. This may be
  16948. // used to include empty fields in Patch requests.
  16949. ForceSendFields []string `json:"-"`
  16950. // NullFields is a list of field names (e.g. "Id") to include in API
  16951. // requests with the JSON null value. By default, fields with empty
  16952. // values are omitted from API requests. However, any field with an
  16953. // empty value appearing in NullFields will be sent to the server as
  16954. // null. It is an error if a field in this list has a non-empty value.
  16955. // This may be used to include null fields in Patch requests.
  16956. NullFields []string `json:"-"`
  16957. }
  16958. func (s *IpOwnerList) MarshalJSON() ([]byte, error) {
  16959. type NoMethod IpOwnerList
  16960. raw := NoMethod(*s)
  16961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16962. }
  16963. // IpOwnerListWarning: [Output Only] Informational warning message.
  16964. type IpOwnerListWarning struct {
  16965. // Code: [Output Only] A warning code, if applicable. For example,
  16966. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16967. // the response.
  16968. //
  16969. // Possible values:
  16970. // "CLEANUP_FAILED"
  16971. // "DEPRECATED_RESOURCE_USED"
  16972. // "DEPRECATED_TYPE_USED"
  16973. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16974. // "EXPERIMENTAL_TYPE_USED"
  16975. // "EXTERNAL_API_WARNING"
  16976. // "FIELD_VALUE_OVERRIDEN"
  16977. // "INJECTED_KERNELS_DEPRECATED"
  16978. // "MISSING_TYPE_DEPENDENCY"
  16979. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16980. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16981. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16982. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16983. // "NEXT_HOP_NOT_RUNNING"
  16984. // "NOT_CRITICAL_ERROR"
  16985. // "NO_RESULTS_ON_PAGE"
  16986. // "REQUIRED_TOS_AGREEMENT"
  16987. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16988. // "RESOURCE_NOT_DELETED"
  16989. // "SCHEMA_VALIDATION_IGNORED"
  16990. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16991. // "UNDECLARED_PROPERTIES"
  16992. // "UNREACHABLE"
  16993. Code string `json:"code,omitempty"`
  16994. // Data: [Output Only] Metadata about this warning in key: value format.
  16995. // For example:
  16996. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16997. Data []*IpOwnerListWarningData `json:"data,omitempty"`
  16998. // Message: [Output Only] A human-readable description of the warning
  16999. // code.
  17000. Message string `json:"message,omitempty"`
  17001. // ForceSendFields is a list of field names (e.g. "Code") to
  17002. // unconditionally include in API requests. By default, fields with
  17003. // empty values are omitted from API requests. However, any non-pointer,
  17004. // non-interface field appearing in ForceSendFields will be sent to the
  17005. // server regardless of whether the field is empty or not. This may be
  17006. // used to include empty fields in Patch requests.
  17007. ForceSendFields []string `json:"-"`
  17008. // NullFields is a list of field names (e.g. "Code") to include in API
  17009. // requests with the JSON null value. By default, fields with empty
  17010. // values are omitted from API requests. However, any field with an
  17011. // empty value appearing in NullFields will be sent to the server as
  17012. // null. It is an error if a field in this list has a non-empty value.
  17013. // This may be used to include null fields in Patch requests.
  17014. NullFields []string `json:"-"`
  17015. }
  17016. func (s *IpOwnerListWarning) MarshalJSON() ([]byte, error) {
  17017. type NoMethod IpOwnerListWarning
  17018. raw := NoMethod(*s)
  17019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17020. }
  17021. type IpOwnerListWarningData struct {
  17022. // Key: [Output Only] A key that provides more detail on the warning
  17023. // being returned. For example, for warnings where there are no results
  17024. // in a list request for a particular zone, this key might be scope and
  17025. // the key value might be the zone name. Other examples might be a key
  17026. // indicating a deprecated resource and a suggested replacement, or a
  17027. // warning about invalid network settings (for example, if an instance
  17028. // attempts to perform IP forwarding but is not enabled for IP
  17029. // forwarding).
  17030. Key string `json:"key,omitempty"`
  17031. // Value: [Output Only] A warning data value corresponding to the key.
  17032. Value string `json:"value,omitempty"`
  17033. // ForceSendFields is a list of field names (e.g. "Key") to
  17034. // unconditionally include in API requests. By default, fields with
  17035. // empty values are omitted from API requests. However, any non-pointer,
  17036. // non-interface field appearing in ForceSendFields will be sent to the
  17037. // server regardless of whether the field is empty or not. This may be
  17038. // used to include empty fields in Patch requests.
  17039. ForceSendFields []string `json:"-"`
  17040. // NullFields is a list of field names (e.g. "Key") to include in API
  17041. // requests with the JSON null value. By default, fields with empty
  17042. // values are omitted from API requests. However, any field with an
  17043. // empty value appearing in NullFields will be sent to the server as
  17044. // null. It is an error if a field in this list has a non-empty value.
  17045. // This may be used to include null fields in Patch requests.
  17046. NullFields []string `json:"-"`
  17047. }
  17048. func (s *IpOwnerListWarningData) MarshalJSON() ([]byte, error) {
  17049. type NoMethod IpOwnerListWarningData
  17050. raw := NoMethod(*s)
  17051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17052. }
  17053. // Jwt: JWT configuration for origin authentication.
  17054. type Jwt struct {
  17055. // Audiences: A JWT containing any of these audiences will be accepted.
  17056. // The service name will be accepted if audiences is empty. Examples:
  17057. // bookstore_android.apps.googleusercontent.com,
  17058. // bookstore_web.apps.googleusercontent.com
  17059. Audiences []string `json:"audiences,omitempty"`
  17060. // Issuer: Identifies the issuer that issued the JWT, which is usually a
  17061. // URL or an email address. Examples: https://securetoken.google.com,
  17062. // 1234567-compute@developer.gserviceaccount.com
  17063. Issuer string `json:"issuer,omitempty"`
  17064. // JwksPublicKeys: The provider?s public key set to validate the
  17065. // signature of the JWT.
  17066. JwksPublicKeys string `json:"jwksPublicKeys,omitempty"`
  17067. // JwtHeaders: jwt_headers and jwt_params define where to extract the
  17068. // JWT from an HTTP request. If no explicit location is specified, the
  17069. // following default locations are tried in order:
  17070. //
  17071. // 1. The Authorization header using the Bearer schema. See `here `_.
  17072. // Example:
  17073. //
  17074. // Authorization: Bearer .
  17075. //
  17076. // 2. `access_token` query parameter. See `this `_
  17077. //
  17078. // Multiple JWTs can be verified for a request. Each JWT has to be
  17079. // extracted from the locations its issuer specified or from the default
  17080. // locations.
  17081. //
  17082. // This field is set if JWT is sent in a request header. This field
  17083. // specifies the header name. For example, if
  17084. // `header=x-goog-iap-jwt-assertion`, the header format will be
  17085. // x-goog-iap-jwt-assertion: .
  17086. JwtHeaders []*JwtHeader `json:"jwtHeaders,omitempty"`
  17087. // JwtParams: This field is set if JWT is sent in a query parameter.
  17088. // This field specifies the query parameter name. For example, if
  17089. // jwt_params[0] is jwt_token, the JWT format in the query parameter is
  17090. // /path?jwt_token=.
  17091. JwtParams []string `json:"jwtParams,omitempty"`
  17092. // ForceSendFields is a list of field names (e.g. "Audiences") to
  17093. // unconditionally include in API requests. By default, fields with
  17094. // empty values are omitted from API requests. However, any non-pointer,
  17095. // non-interface field appearing in ForceSendFields will be sent to the
  17096. // server regardless of whether the field is empty or not. This may be
  17097. // used to include empty fields in Patch requests.
  17098. ForceSendFields []string `json:"-"`
  17099. // NullFields is a list of field names (e.g. "Audiences") to include in
  17100. // API requests with the JSON null value. By default, fields with empty
  17101. // values are omitted from API requests. However, any field with an
  17102. // empty value appearing in NullFields will be sent to the server as
  17103. // null. It is an error if a field in this list has a non-empty value.
  17104. // This may be used to include null fields in Patch requests.
  17105. NullFields []string `json:"-"`
  17106. }
  17107. func (s *Jwt) MarshalJSON() ([]byte, error) {
  17108. type NoMethod Jwt
  17109. raw := NoMethod(*s)
  17110. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17111. }
  17112. // JwtHeader: This message specifies a header location to extract JWT
  17113. // token.
  17114. type JwtHeader struct {
  17115. // Name: The HTTP header name.
  17116. Name string `json:"name,omitempty"`
  17117. // ValuePrefix: The value prefix. The value format is "value_prefix" For
  17118. // example, for "Authorization: Bearer ", value_prefix="Bearer " with a
  17119. // space at the end.
  17120. ValuePrefix string `json:"valuePrefix,omitempty"`
  17121. // ForceSendFields is a list of field names (e.g. "Name") to
  17122. // unconditionally include in API requests. By default, fields with
  17123. // empty values are omitted from API requests. However, any non-pointer,
  17124. // non-interface field appearing in ForceSendFields will be sent to the
  17125. // server regardless of whether the field is empty or not. This may be
  17126. // used to include empty fields in Patch requests.
  17127. ForceSendFields []string `json:"-"`
  17128. // NullFields is a list of field names (e.g. "Name") to include in API
  17129. // requests with the JSON null value. By default, fields with empty
  17130. // values are omitted from API requests. However, any field with an
  17131. // empty value appearing in NullFields will be sent to the server as
  17132. // null. It is an error if a field in this list has a non-empty value.
  17133. // This may be used to include null fields in Patch requests.
  17134. NullFields []string `json:"-"`
  17135. }
  17136. func (s *JwtHeader) MarshalJSON() ([]byte, error) {
  17137. type NoMethod JwtHeader
  17138. raw := NoMethod(*s)
  17139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17140. }
  17141. // License: A license resource.
  17142. type License struct {
  17143. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  17144. // reflects whether a license charges a usage fee.
  17145. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  17146. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17147. // format.
  17148. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17149. // Description: An optional textual description of the resource;
  17150. // provided by the client when the resource is created.
  17151. Description string `json:"description,omitempty"`
  17152. // Id: [Output Only] The unique identifier for the resource. This
  17153. // identifier is defined by the server.
  17154. Id uint64 `json:"id,omitempty,string"`
  17155. // Kind: [Output Only] Type of resource. Always compute#license for
  17156. // licenses.
  17157. Kind string `json:"kind,omitempty"`
  17158. // LicenseCode: [Output Only] The unique code used to attach this
  17159. // license to images, snapshots, and disks.
  17160. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  17161. // Name: Name of the resource. The name must be 1-63 characters long and
  17162. // comply with RFC1035.
  17163. Name string `json:"name,omitempty"`
  17164. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  17165. // SelfLink: [Output Only] Server-defined URL for the resource.
  17166. SelfLink string `json:"selfLink,omitempty"`
  17167. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  17168. // with the resource id.
  17169. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  17170. // Transferable: If false, licenses will not be copied from the source
  17171. // resource when creating an image from a disk, disk from snapshot, or
  17172. // snapshot from disk.
  17173. Transferable bool `json:"transferable,omitempty"`
  17174. // ServerResponse contains the HTTP response code and headers from the
  17175. // server.
  17176. googleapi.ServerResponse `json:"-"`
  17177. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  17178. // unconditionally include in API requests. By default, fields with
  17179. // empty values are omitted from API requests. However, any non-pointer,
  17180. // non-interface field appearing in ForceSendFields will be sent to the
  17181. // server regardless of whether the field is empty or not. This may be
  17182. // used to include empty fields in Patch requests.
  17183. ForceSendFields []string `json:"-"`
  17184. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  17185. // in API requests with the JSON null value. By default, fields with
  17186. // empty values are omitted from API requests. However, any field with
  17187. // an empty value appearing in NullFields will be sent to the server as
  17188. // null. It is an error if a field in this list has a non-empty value.
  17189. // This may be used to include null fields in Patch requests.
  17190. NullFields []string `json:"-"`
  17191. }
  17192. func (s *License) MarshalJSON() ([]byte, error) {
  17193. type NoMethod License
  17194. raw := NoMethod(*s)
  17195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17196. }
  17197. type LicenseCode struct {
  17198. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17199. // format.
  17200. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17201. // Description: [Output Only] Description of this License Code.
  17202. Description string `json:"description,omitempty"`
  17203. // Id: [Output Only] The unique identifier for the resource. This
  17204. // identifier is defined by the server.
  17205. Id uint64 `json:"id,omitempty,string"`
  17206. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  17207. // licenses.
  17208. Kind string `json:"kind,omitempty"`
  17209. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  17210. // with the same License Code.
  17211. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  17212. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  17213. // long and must be a valid 64 bit integer.
  17214. Name string `json:"name,omitempty"`
  17215. // SelfLink: [Output Only] Server-defined URL for the resource.
  17216. SelfLink string `json:"selfLink,omitempty"`
  17217. // State: [Output Only] Current state of this License Code.
  17218. //
  17219. // Possible values:
  17220. // "DISABLED"
  17221. // "ENABLED"
  17222. // "RESTRICTED"
  17223. // "STATE_UNSPECIFIED"
  17224. // "TERMINATED"
  17225. State string `json:"state,omitempty"`
  17226. // Transferable: [Output Only] If true, the license will remain attached
  17227. // when creating images or snapshots from disks. Otherwise, the license
  17228. // is not transferred.
  17229. Transferable bool `json:"transferable,omitempty"`
  17230. // ServerResponse contains the HTTP response code and headers from the
  17231. // server.
  17232. googleapi.ServerResponse `json:"-"`
  17233. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17234. // to unconditionally include in API requests. By default, fields with
  17235. // empty values are omitted from API requests. However, any non-pointer,
  17236. // non-interface field appearing in ForceSendFields will be sent to the
  17237. // server regardless of whether the field is empty or not. This may be
  17238. // used to include empty fields in Patch requests.
  17239. ForceSendFields []string `json:"-"`
  17240. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17241. // include in API requests with the JSON null value. By default, fields
  17242. // with empty values are omitted from API requests. However, any field
  17243. // with an empty value appearing in NullFields will be sent to the
  17244. // server as null. It is an error if a field in this list has a
  17245. // non-empty value. This may be used to include null fields in Patch
  17246. // requests.
  17247. NullFields []string `json:"-"`
  17248. }
  17249. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  17250. type NoMethod LicenseCode
  17251. raw := NoMethod(*s)
  17252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17253. }
  17254. type LicenseCodeLicenseAlias struct {
  17255. // Description: [Output Only] Description of this License Code.
  17256. Description string `json:"description,omitempty"`
  17257. // SelfLink: [Output Only] URL of license corresponding to this License
  17258. // Code.
  17259. SelfLink string `json:"selfLink,omitempty"`
  17260. // ForceSendFields is a list of field names (e.g. "Description") to
  17261. // unconditionally include in API requests. By default, fields with
  17262. // empty values are omitted from API requests. However, any non-pointer,
  17263. // non-interface field appearing in ForceSendFields will be sent to the
  17264. // server regardless of whether the field is empty or not. This may be
  17265. // used to include empty fields in Patch requests.
  17266. ForceSendFields []string `json:"-"`
  17267. // NullFields is a list of field names (e.g. "Description") to include
  17268. // in API requests with the JSON null value. By default, fields with
  17269. // empty values are omitted from API requests. However, any field with
  17270. // an empty value appearing in NullFields will be sent to the server as
  17271. // null. It is an error if a field in this list has a non-empty value.
  17272. // This may be used to include null fields in Patch requests.
  17273. NullFields []string `json:"-"`
  17274. }
  17275. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  17276. type NoMethod LicenseCodeLicenseAlias
  17277. raw := NoMethod(*s)
  17278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17279. }
  17280. type LicenseResourceRequirements struct {
  17281. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  17282. // Instance. Enforced at Instance creation and Instance start.
  17283. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  17284. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  17285. // Instance creation and Instance start.
  17286. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  17287. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  17288. // unconditionally include in API requests. By default, fields with
  17289. // empty values are omitted from API requests. However, any non-pointer,
  17290. // non-interface field appearing in ForceSendFields will be sent to the
  17291. // server regardless of whether the field is empty or not. This may be
  17292. // used to include empty fields in Patch requests.
  17293. ForceSendFields []string `json:"-"`
  17294. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  17295. // include in API requests with the JSON null value. By default, fields
  17296. // with empty values are omitted from API requests. However, any field
  17297. // with an empty value appearing in NullFields will be sent to the
  17298. // server as null. It is an error if a field in this list has a
  17299. // non-empty value. This may be used to include null fields in Patch
  17300. // requests.
  17301. NullFields []string `json:"-"`
  17302. }
  17303. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  17304. type NoMethod LicenseResourceRequirements
  17305. raw := NoMethod(*s)
  17306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17307. }
  17308. type LicensesListResponse struct {
  17309. // Id: [Output Only] Unique identifier for the resource; defined by the
  17310. // server.
  17311. Id string `json:"id,omitempty"`
  17312. // Items: A list of License resources.
  17313. Items []*License `json:"items,omitempty"`
  17314. // NextPageToken: [Output Only] This token allows you to get the next
  17315. // page of results for list requests. If the number of results is larger
  17316. // than maxResults, use the nextPageToken as a value for the query
  17317. // parameter pageToken in the next list request. Subsequent list
  17318. // requests will have their own nextPageToken to continue paging through
  17319. // the results.
  17320. NextPageToken string `json:"nextPageToken,omitempty"`
  17321. // SelfLink: [Output Only] Server-defined URL for this resource.
  17322. SelfLink string `json:"selfLink,omitempty"`
  17323. // Warning: [Output Only] Informational warning message.
  17324. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  17325. // ServerResponse contains the HTTP response code and headers from the
  17326. // server.
  17327. googleapi.ServerResponse `json:"-"`
  17328. // ForceSendFields is a list of field names (e.g. "Id") to
  17329. // unconditionally include in API requests. By default, fields with
  17330. // empty values are omitted from API requests. However, any non-pointer,
  17331. // non-interface field appearing in ForceSendFields will be sent to the
  17332. // server regardless of whether the field is empty or not. This may be
  17333. // used to include empty fields in Patch requests.
  17334. ForceSendFields []string `json:"-"`
  17335. // NullFields is a list of field names (e.g. "Id") to include in API
  17336. // requests with the JSON null value. By default, fields with empty
  17337. // values are omitted from API requests. However, any field with an
  17338. // empty value appearing in NullFields will be sent to the server as
  17339. // null. It is an error if a field in this list has a non-empty value.
  17340. // This may be used to include null fields in Patch requests.
  17341. NullFields []string `json:"-"`
  17342. }
  17343. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  17344. type NoMethod LicensesListResponse
  17345. raw := NoMethod(*s)
  17346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17347. }
  17348. // LicensesListResponseWarning: [Output Only] Informational warning
  17349. // message.
  17350. type LicensesListResponseWarning struct {
  17351. // Code: [Output Only] A warning code, if applicable. For example,
  17352. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17353. // the response.
  17354. //
  17355. // Possible values:
  17356. // "CLEANUP_FAILED"
  17357. // "DEPRECATED_RESOURCE_USED"
  17358. // "DEPRECATED_TYPE_USED"
  17359. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17360. // "EXPERIMENTAL_TYPE_USED"
  17361. // "EXTERNAL_API_WARNING"
  17362. // "FIELD_VALUE_OVERRIDEN"
  17363. // "INJECTED_KERNELS_DEPRECATED"
  17364. // "MISSING_TYPE_DEPENDENCY"
  17365. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17366. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17367. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17368. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17369. // "NEXT_HOP_NOT_RUNNING"
  17370. // "NOT_CRITICAL_ERROR"
  17371. // "NO_RESULTS_ON_PAGE"
  17372. // "REQUIRED_TOS_AGREEMENT"
  17373. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17374. // "RESOURCE_NOT_DELETED"
  17375. // "SCHEMA_VALIDATION_IGNORED"
  17376. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17377. // "UNDECLARED_PROPERTIES"
  17378. // "UNREACHABLE"
  17379. Code string `json:"code,omitempty"`
  17380. // Data: [Output Only] Metadata about this warning in key: value format.
  17381. // For example:
  17382. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17383. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  17384. // Message: [Output Only] A human-readable description of the warning
  17385. // code.
  17386. Message string `json:"message,omitempty"`
  17387. // ForceSendFields is a list of field names (e.g. "Code") to
  17388. // unconditionally include in API requests. By default, fields with
  17389. // empty values are omitted from API requests. However, any non-pointer,
  17390. // non-interface field appearing in ForceSendFields will be sent to the
  17391. // server regardless of whether the field is empty or not. This may be
  17392. // used to include empty fields in Patch requests.
  17393. ForceSendFields []string `json:"-"`
  17394. // NullFields is a list of field names (e.g. "Code") to include in API
  17395. // requests with the JSON null value. By default, fields with empty
  17396. // values are omitted from API requests. However, any field with an
  17397. // empty value appearing in NullFields will be sent to the server as
  17398. // null. It is an error if a field in this list has a non-empty value.
  17399. // This may be used to include null fields in Patch requests.
  17400. NullFields []string `json:"-"`
  17401. }
  17402. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  17403. type NoMethod LicensesListResponseWarning
  17404. raw := NoMethod(*s)
  17405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17406. }
  17407. type LicensesListResponseWarningData struct {
  17408. // Key: [Output Only] A key that provides more detail on the warning
  17409. // being returned. For example, for warnings where there are no results
  17410. // in a list request for a particular zone, this key might be scope and
  17411. // the key value might be the zone name. Other examples might be a key
  17412. // indicating a deprecated resource and a suggested replacement, or a
  17413. // warning about invalid network settings (for example, if an instance
  17414. // attempts to perform IP forwarding but is not enabled for IP
  17415. // forwarding).
  17416. Key string `json:"key,omitempty"`
  17417. // Value: [Output Only] A warning data value corresponding to the key.
  17418. Value string `json:"value,omitempty"`
  17419. // ForceSendFields is a list of field names (e.g. "Key") to
  17420. // unconditionally include in API requests. By default, fields with
  17421. // empty values are omitted from API requests. However, any non-pointer,
  17422. // non-interface field appearing in ForceSendFields will be sent to the
  17423. // server regardless of whether the field is empty or not. This may be
  17424. // used to include empty fields in Patch requests.
  17425. ForceSendFields []string `json:"-"`
  17426. // NullFields is a list of field names (e.g. "Key") to include in API
  17427. // requests with the JSON null value. By default, fields with empty
  17428. // values are omitted from API requests. However, any field with an
  17429. // empty value appearing in NullFields will be sent to the server as
  17430. // null. It is an error if a field in this list has a non-empty value.
  17431. // This may be used to include null fields in Patch requests.
  17432. NullFields []string `json:"-"`
  17433. }
  17434. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  17435. type NoMethod LicensesListResponseWarningData
  17436. raw := NoMethod(*s)
  17437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17438. }
  17439. type LocalDisk struct {
  17440. // DiskCount: Specifies the number of such disks.
  17441. DiskCount string `json:"diskCount,omitempty"`
  17442. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  17443. DiskSizeGb string `json:"diskSizeGb,omitempty"`
  17444. // DiskType: Specifies the desired disk type on the node. This disk type
  17445. // must be a local storage type (e.g.: local-ssd). Note that for
  17446. // nodeTemplates, this should be the name of the disk type and not its
  17447. // URL.
  17448. DiskType string `json:"diskType,omitempty"`
  17449. // ForceSendFields is a list of field names (e.g. "DiskCount") to
  17450. // unconditionally include in API requests. By default, fields with
  17451. // empty values are omitted from API requests. However, any non-pointer,
  17452. // non-interface field appearing in ForceSendFields will be sent to the
  17453. // server regardless of whether the field is empty or not. This may be
  17454. // used to include empty fields in Patch requests.
  17455. ForceSendFields []string `json:"-"`
  17456. // NullFields is a list of field names (e.g. "DiskCount") to include in
  17457. // API requests with the JSON null value. By default, fields with empty
  17458. // values are omitted from API requests. However, any field with an
  17459. // empty value appearing in NullFields will be sent to the server as
  17460. // null. It is an error if a field in this list has a non-empty value.
  17461. // This may be used to include null fields in Patch requests.
  17462. NullFields []string `json:"-"`
  17463. }
  17464. func (s *LocalDisk) MarshalJSON() ([]byte, error) {
  17465. type NoMethod LocalDisk
  17466. raw := NoMethod(*s)
  17467. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17468. }
  17469. // LogConfig: Specifies what kind of log the caller must write
  17470. type LogConfig struct {
  17471. // CloudAudit: Cloud audit options.
  17472. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  17473. // Counter: Counter options.
  17474. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  17475. // DataAccess: Data access options.
  17476. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  17477. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  17478. // unconditionally include in API requests. By default, fields with
  17479. // empty values are omitted from API requests. However, any non-pointer,
  17480. // non-interface field appearing in ForceSendFields will be sent to the
  17481. // server regardless of whether the field is empty or not. This may be
  17482. // used to include empty fields in Patch requests.
  17483. ForceSendFields []string `json:"-"`
  17484. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  17485. // API requests with the JSON null value. By default, fields with empty
  17486. // values are omitted from API requests. However, any field with an
  17487. // empty value appearing in NullFields will be sent to the server as
  17488. // null. It is an error if a field in this list has a non-empty value.
  17489. // This may be used to include null fields in Patch requests.
  17490. NullFields []string `json:"-"`
  17491. }
  17492. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  17493. type NoMethod LogConfig
  17494. raw := NoMethod(*s)
  17495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17496. }
  17497. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  17498. type LogConfigCloudAuditOptions struct {
  17499. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  17500. // Logging pipeline.
  17501. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  17502. // LogName: The log_name to populate in the Cloud Audit Record.
  17503. //
  17504. // Possible values:
  17505. // "ADMIN_ACTIVITY"
  17506. // "DATA_ACCESS"
  17507. // "UNSPECIFIED_LOG_NAME"
  17508. LogName string `json:"logName,omitempty"`
  17509. // ForceSendFields is a list of field names (e.g.
  17510. // "AuthorizationLoggingOptions") to unconditionally include in API
  17511. // requests. By default, fields with empty values are omitted from API
  17512. // requests. However, any non-pointer, non-interface field appearing in
  17513. // ForceSendFields will be sent to the server regardless of whether the
  17514. // field is empty or not. This may be used to include empty fields in
  17515. // Patch requests.
  17516. ForceSendFields []string `json:"-"`
  17517. // NullFields is a list of field names (e.g.
  17518. // "AuthorizationLoggingOptions") to include in API requests with the
  17519. // JSON null value. By default, fields with empty values are omitted
  17520. // from API requests. However, any field with an empty value appearing
  17521. // in NullFields will be sent to the server as null. It is an error if a
  17522. // field in this list has a non-empty value. This may be used to include
  17523. // null fields in Patch requests.
  17524. NullFields []string `json:"-"`
  17525. }
  17526. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  17527. type NoMethod LogConfigCloudAuditOptions
  17528. raw := NoMethod(*s)
  17529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17530. }
  17531. // LogConfigCounterOptions: Increment a streamz counter with the
  17532. // specified metric and field names.
  17533. //
  17534. // Metric names should start with a '/', generally be lowercase-only,
  17535. // and end in "_count". Field names should not contain an initial slash.
  17536. // The actual exported metric names will have "/iam/policy"
  17537. // prepended.
  17538. //
  17539. // Field names correspond to IAM request parameters and field values are
  17540. // their respective values.
  17541. //
  17542. // Supported field names: - "authority", which is "[token]" if
  17543. // IAMContext.token is present, otherwise the value of
  17544. // IAMContext.authority_selector if present, and otherwise a
  17545. // representation of IAMContext.principal; or - "iam_principal", a
  17546. // representation of IAMContext.principal even if a token or authority
  17547. // selector is present; or - "" (empty string), resulting in a counter
  17548. // with no fields.
  17549. //
  17550. // Examples: counter { metric: "/debug_access_count" field:
  17551. // "iam_principal" } ==> increment counter
  17552. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  17553. // IAMContext.principal]}
  17554. //
  17555. // At this time we do not support multiple field names (though this may
  17556. // be supported in the future).
  17557. type LogConfigCounterOptions struct {
  17558. // Field: The field value to attribute.
  17559. Field string `json:"field,omitempty"`
  17560. // Metric: The metric to update.
  17561. Metric string `json:"metric,omitempty"`
  17562. // ForceSendFields is a list of field names (e.g. "Field") to
  17563. // unconditionally include in API requests. By default, fields with
  17564. // empty values are omitted from API requests. However, any non-pointer,
  17565. // non-interface field appearing in ForceSendFields will be sent to the
  17566. // server regardless of whether the field is empty or not. This may be
  17567. // used to include empty fields in Patch requests.
  17568. ForceSendFields []string `json:"-"`
  17569. // NullFields is a list of field names (e.g. "Field") to include in API
  17570. // requests with the JSON null value. By default, fields with empty
  17571. // values are omitted from API requests. However, any field with an
  17572. // empty value appearing in NullFields will be sent to the server as
  17573. // null. It is an error if a field in this list has a non-empty value.
  17574. // This may be used to include null fields in Patch requests.
  17575. NullFields []string `json:"-"`
  17576. }
  17577. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  17578. type NoMethod LogConfigCounterOptions
  17579. raw := NoMethod(*s)
  17580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17581. }
  17582. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  17583. type LogConfigDataAccessOptions struct {
  17584. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  17585. // the caller. This is relevant only in the LocalIAM implementation, for
  17586. // now.
  17587. //
  17588. // Possible values:
  17589. // "LOG_FAIL_CLOSED"
  17590. // "LOG_MODE_UNSPECIFIED"
  17591. LogMode string `json:"logMode,omitempty"`
  17592. // ForceSendFields is a list of field names (e.g. "LogMode") to
  17593. // unconditionally include in API requests. By default, fields with
  17594. // empty values are omitted from API requests. However, any non-pointer,
  17595. // non-interface field appearing in ForceSendFields will be sent to the
  17596. // server regardless of whether the field is empty or not. This may be
  17597. // used to include empty fields in Patch requests.
  17598. ForceSendFields []string `json:"-"`
  17599. // NullFields is a list of field names (e.g. "LogMode") to include in
  17600. // API requests with the JSON null value. By default, fields with empty
  17601. // values are omitted from API requests. However, any field with an
  17602. // empty value appearing in NullFields will be sent to the server as
  17603. // null. It is an error if a field in this list has a non-empty value.
  17604. // This may be used to include null fields in Patch requests.
  17605. NullFields []string `json:"-"`
  17606. }
  17607. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  17608. type NoMethod LogConfigDataAccessOptions
  17609. raw := NoMethod(*s)
  17610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17611. }
  17612. // MachineImage: Machine image resource.
  17613. type MachineImage struct {
  17614. // CreationTimestamp: [Output Only] The creation timestamp for this
  17615. // machine image in RFC3339 text format.
  17616. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17617. // Description: An optional description of this resource. Provide this
  17618. // property when you create the resource.
  17619. Description string `json:"description,omitempty"`
  17620. // Id: [Output Only] A unique identifier for this machine image. The
  17621. // server defines this identifier.
  17622. Id uint64 `json:"id,omitempty,string"`
  17623. // Kind: [Output Only] The resource type, which is always
  17624. // compute#machineImage for machine image.
  17625. Kind string `json:"kind,omitempty"`
  17626. // MachineImageEncryptionKey: Encrypts the machine image using a
  17627. // customer-supplied encryption key.
  17628. //
  17629. // After you encrypt a machine image using a customer-supplied key, you
  17630. // must provide the same key if you use the machine image later. For
  17631. // example, you must provide the encryption key when you create an
  17632. // instance from the encrypted machine image in a future
  17633. // request.
  17634. //
  17635. // Customer-supplied encryption keys do not protect access to metadata
  17636. // of the machine image.
  17637. //
  17638. // If you do not provide an encryption key when creating the machine
  17639. // image, then the machine image will be encrypted using an
  17640. // automatically generated key and you do not need to provide a key to
  17641. // use the machine image later.
  17642. MachineImageEncryptionKey *CustomerEncryptionKey `json:"machineImageEncryptionKey,omitempty"`
  17643. // Name: Name of the resource; provided by the client when the resource
  17644. // is created. The name must be 1-63 characters long, and comply with
  17645. // RFC1035. Specifically, the name must be 1-63 characters long and
  17646. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  17647. // the first character must be a lowercase letter, and all following
  17648. // characters must be a dash, lowercase letter, or digit, except the
  17649. // last character, which cannot be a dash.
  17650. Name string `json:"name,omitempty"`
  17651. // SelfLink: [Output Only] The URL for this machine image. The server
  17652. // defines this URL.
  17653. SelfLink string `json:"selfLink,omitempty"`
  17654. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  17655. // with the resource id.
  17656. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  17657. // SourceInstance: The source instance used to create the machine image.
  17658. // You can provide this as a partial or full URL to the resource. For
  17659. // example, the following are valid values:
  17660. // -
  17661. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  17662. // - projects/project/zones/zone/instances/instance
  17663. SourceInstance string `json:"sourceInstance,omitempty"`
  17664. // SourceInstanceProperties: [Output Only] Properties of source
  17665. // instance.
  17666. SourceInstanceProperties *SourceInstanceProperties `json:"sourceInstanceProperties,omitempty"`
  17667. // Status: [Output Only] The status of the machine image. One of the
  17668. // following values: INVALID, CREATING, READY, DELETING, and UPLOADING.
  17669. //
  17670. // Possible values:
  17671. // "CREATING"
  17672. // "DELETING"
  17673. // "INVALID"
  17674. // "READY"
  17675. // "UPLOADING"
  17676. Status string `json:"status,omitempty"`
  17677. // StorageLocations: GCS bucket storage location of the machine image
  17678. // (regional or multi-regional).
  17679. StorageLocations []string `json:"storageLocations,omitempty"`
  17680. // ServerResponse contains the HTTP response code and headers from the
  17681. // server.
  17682. googleapi.ServerResponse `json:"-"`
  17683. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17684. // to unconditionally include in API requests. By default, fields with
  17685. // empty values are omitted from API requests. However, any non-pointer,
  17686. // non-interface field appearing in ForceSendFields will be sent to the
  17687. // server regardless of whether the field is empty or not. This may be
  17688. // used to include empty fields in Patch requests.
  17689. ForceSendFields []string `json:"-"`
  17690. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17691. // include in API requests with the JSON null value. By default, fields
  17692. // with empty values are omitted from API requests. However, any field
  17693. // with an empty value appearing in NullFields will be sent to the
  17694. // server as null. It is an error if a field in this list has a
  17695. // non-empty value. This may be used to include null fields in Patch
  17696. // requests.
  17697. NullFields []string `json:"-"`
  17698. }
  17699. func (s *MachineImage) MarshalJSON() ([]byte, error) {
  17700. type NoMethod MachineImage
  17701. raw := NoMethod(*s)
  17702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17703. }
  17704. // MachineImageList: A list of machine images.
  17705. type MachineImageList struct {
  17706. Etag string `json:"etag,omitempty"`
  17707. // Id: [Output Only] Unique identifier for the resource; defined by the
  17708. // server.
  17709. Id string `json:"id,omitempty"`
  17710. // Items: A list of MachineImage resources.
  17711. Items []*MachineImage `json:"items,omitempty"`
  17712. // Kind: [Output Only] The resource type, which is always
  17713. // compute#machineImagesListResponse for machine image lists.
  17714. Kind string `json:"kind,omitempty"`
  17715. // NextPageToken: [Output Only] This token allows you to get the next
  17716. // page of results for list requests. If the number of results is larger
  17717. // than maxResults, use the nextPageToken as a value for the query
  17718. // parameter pageToken in the next list request. Subsequent list
  17719. // requests will have their own nextPageToken to continue paging through
  17720. // the results.
  17721. NextPageToken string `json:"nextPageToken,omitempty"`
  17722. // SelfLink: [Output Only] Server-defined URL for this resource.
  17723. SelfLink string `json:"selfLink,omitempty"`
  17724. // Warning: [Output Only] Informational warning message.
  17725. Warning *MachineImageListWarning `json:"warning,omitempty"`
  17726. // ServerResponse contains the HTTP response code and headers from the
  17727. // server.
  17728. googleapi.ServerResponse `json:"-"`
  17729. // ForceSendFields is a list of field names (e.g. "Etag") to
  17730. // unconditionally include in API requests. By default, fields with
  17731. // empty values are omitted from API requests. However, any non-pointer,
  17732. // non-interface field appearing in ForceSendFields will be sent to the
  17733. // server regardless of whether the field is empty or not. This may be
  17734. // used to include empty fields in Patch requests.
  17735. ForceSendFields []string `json:"-"`
  17736. // NullFields is a list of field names (e.g. "Etag") to include in API
  17737. // requests with the JSON null value. By default, fields with empty
  17738. // values are omitted from API requests. However, any field with an
  17739. // empty value appearing in NullFields will be sent to the server as
  17740. // null. It is an error if a field in this list has a non-empty value.
  17741. // This may be used to include null fields in Patch requests.
  17742. NullFields []string `json:"-"`
  17743. }
  17744. func (s *MachineImageList) MarshalJSON() ([]byte, error) {
  17745. type NoMethod MachineImageList
  17746. raw := NoMethod(*s)
  17747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17748. }
  17749. // MachineImageListWarning: [Output Only] Informational warning message.
  17750. type MachineImageListWarning struct {
  17751. // Code: [Output Only] A warning code, if applicable. For example,
  17752. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17753. // the response.
  17754. //
  17755. // Possible values:
  17756. // "CLEANUP_FAILED"
  17757. // "DEPRECATED_RESOURCE_USED"
  17758. // "DEPRECATED_TYPE_USED"
  17759. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17760. // "EXPERIMENTAL_TYPE_USED"
  17761. // "EXTERNAL_API_WARNING"
  17762. // "FIELD_VALUE_OVERRIDEN"
  17763. // "INJECTED_KERNELS_DEPRECATED"
  17764. // "MISSING_TYPE_DEPENDENCY"
  17765. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17766. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17767. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17768. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17769. // "NEXT_HOP_NOT_RUNNING"
  17770. // "NOT_CRITICAL_ERROR"
  17771. // "NO_RESULTS_ON_PAGE"
  17772. // "REQUIRED_TOS_AGREEMENT"
  17773. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17774. // "RESOURCE_NOT_DELETED"
  17775. // "SCHEMA_VALIDATION_IGNORED"
  17776. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17777. // "UNDECLARED_PROPERTIES"
  17778. // "UNREACHABLE"
  17779. Code string `json:"code,omitempty"`
  17780. // Data: [Output Only] Metadata about this warning in key: value format.
  17781. // For example:
  17782. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17783. Data []*MachineImageListWarningData `json:"data,omitempty"`
  17784. // Message: [Output Only] A human-readable description of the warning
  17785. // code.
  17786. Message string `json:"message,omitempty"`
  17787. // ForceSendFields is a list of field names (e.g. "Code") to
  17788. // unconditionally include in API requests. By default, fields with
  17789. // empty values are omitted from API requests. However, any non-pointer,
  17790. // non-interface field appearing in ForceSendFields will be sent to the
  17791. // server regardless of whether the field is empty or not. This may be
  17792. // used to include empty fields in Patch requests.
  17793. ForceSendFields []string `json:"-"`
  17794. // NullFields is a list of field names (e.g. "Code") to include in API
  17795. // requests with the JSON null value. By default, fields with empty
  17796. // values are omitted from API requests. However, any field with an
  17797. // empty value appearing in NullFields will be sent to the server as
  17798. // null. It is an error if a field in this list has a non-empty value.
  17799. // This may be used to include null fields in Patch requests.
  17800. NullFields []string `json:"-"`
  17801. }
  17802. func (s *MachineImageListWarning) MarshalJSON() ([]byte, error) {
  17803. type NoMethod MachineImageListWarning
  17804. raw := NoMethod(*s)
  17805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17806. }
  17807. type MachineImageListWarningData struct {
  17808. // Key: [Output Only] A key that provides more detail on the warning
  17809. // being returned. For example, for warnings where there are no results
  17810. // in a list request for a particular zone, this key might be scope and
  17811. // the key value might be the zone name. Other examples might be a key
  17812. // indicating a deprecated resource and a suggested replacement, or a
  17813. // warning about invalid network settings (for example, if an instance
  17814. // attempts to perform IP forwarding but is not enabled for IP
  17815. // forwarding).
  17816. Key string `json:"key,omitempty"`
  17817. // Value: [Output Only] A warning data value corresponding to the key.
  17818. Value string `json:"value,omitempty"`
  17819. // ForceSendFields is a list of field names (e.g. "Key") to
  17820. // unconditionally include in API requests. By default, fields with
  17821. // empty values are omitted from API requests. However, any non-pointer,
  17822. // non-interface field appearing in ForceSendFields will be sent to the
  17823. // server regardless of whether the field is empty or not. This may be
  17824. // used to include empty fields in Patch requests.
  17825. ForceSendFields []string `json:"-"`
  17826. // NullFields is a list of field names (e.g. "Key") to include in API
  17827. // requests with the JSON null value. By default, fields with empty
  17828. // values are omitted from API requests. However, any field with an
  17829. // empty value appearing in NullFields will be sent to the server as
  17830. // null. It is an error if a field in this list has a non-empty value.
  17831. // This may be used to include null fields in Patch requests.
  17832. NullFields []string `json:"-"`
  17833. }
  17834. func (s *MachineImageListWarningData) MarshalJSON() ([]byte, error) {
  17835. type NoMethod MachineImageListWarningData
  17836. raw := NoMethod(*s)
  17837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17838. }
  17839. // MachineType: A Machine Type resource. (== resource_for
  17840. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  17841. type MachineType struct {
  17842. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17843. // format.
  17844. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17845. // Deprecated: [Output Only] The deprecation status associated with this
  17846. // machine type.
  17847. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  17848. // Description: [Output Only] An optional textual description of the
  17849. // resource.
  17850. Description string `json:"description,omitempty"`
  17851. // GuestCpus: [Output Only] The number of virtual CPUs that are
  17852. // available to the instance.
  17853. GuestCpus int64 `json:"guestCpus,omitempty"`
  17854. // Id: [Output Only] The unique identifier for the resource. This
  17855. // identifier is defined by the server.
  17856. Id uint64 `json:"id,omitempty,string"`
  17857. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  17858. // CPU. See Shared-core machine types for more information.
  17859. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  17860. // Kind: [Output Only] The type of the resource. Always
  17861. // compute#machineType for machine types.
  17862. Kind string `json:"kind,omitempty"`
  17863. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  17864. // allowed.
  17865. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  17866. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  17867. // disks size (GB) allowed.
  17868. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  17869. // MemoryMb: [Output Only] The amount of physical memory available to
  17870. // the instance, defined in MB.
  17871. MemoryMb int64 `json:"memoryMb,omitempty"`
  17872. // Name: [Output Only] Name of the resource.
  17873. Name string `json:"name,omitempty"`
  17874. // SelfLink: [Output Only] Server-defined URL for the resource.
  17875. SelfLink string `json:"selfLink,omitempty"`
  17876. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  17877. // with the resource id.
  17878. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  17879. // Zone: [Output Only] The name of the zone where the machine type
  17880. // resides, such as us-central1-a.
  17881. Zone string `json:"zone,omitempty"`
  17882. // ServerResponse contains the HTTP response code and headers from the
  17883. // server.
  17884. googleapi.ServerResponse `json:"-"`
  17885. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17886. // to 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. "CreationTimestamp") to
  17893. // include in API requests with the JSON null value. By default, fields
  17894. // with empty values are omitted from API requests. However, any field
  17895. // with an empty value appearing in NullFields will be sent to the
  17896. // server as null. It is an error if a field in this list has a
  17897. // non-empty value. This may be used to include null fields in Patch
  17898. // requests.
  17899. NullFields []string `json:"-"`
  17900. }
  17901. func (s *MachineType) MarshalJSON() ([]byte, error) {
  17902. type NoMethod MachineType
  17903. raw := NoMethod(*s)
  17904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17905. }
  17906. type MachineTypeAggregatedList struct {
  17907. // Id: [Output Only] Unique identifier for the resource; defined by the
  17908. // server.
  17909. Id string `json:"id,omitempty"`
  17910. // Items: A list of MachineTypesScopedList resources.
  17911. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  17912. // Kind: [Output Only] Type of resource. Always
  17913. // compute#machineTypeAggregatedList for aggregated lists of machine
  17914. // types.
  17915. Kind string `json:"kind,omitempty"`
  17916. // NextPageToken: [Output Only] This token allows you to get the next
  17917. // page of results for list requests. If the number of results is larger
  17918. // than maxResults, use the nextPageToken as a value for the query
  17919. // parameter pageToken in the next list request. Subsequent list
  17920. // requests will have their own nextPageToken to continue paging through
  17921. // the results.
  17922. NextPageToken string `json:"nextPageToken,omitempty"`
  17923. // SelfLink: [Output Only] Server-defined URL for this resource.
  17924. SelfLink string `json:"selfLink,omitempty"`
  17925. // Warning: [Output Only] Informational warning message.
  17926. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  17927. // ServerResponse contains the HTTP response code and headers from the
  17928. // server.
  17929. googleapi.ServerResponse `json:"-"`
  17930. // ForceSendFields is a list of field names (e.g. "Id") to
  17931. // unconditionally include in API requests. By default, fields with
  17932. // empty values are omitted from API requests. However, any non-pointer,
  17933. // non-interface field appearing in ForceSendFields will be sent to the
  17934. // server regardless of whether the field is empty or not. This may be
  17935. // used to include empty fields in Patch requests.
  17936. ForceSendFields []string `json:"-"`
  17937. // NullFields is a list of field names (e.g. "Id") to include in API
  17938. // requests with the JSON null value. By default, fields with empty
  17939. // values are omitted from API requests. However, any field with an
  17940. // empty value appearing in NullFields will be sent to the server as
  17941. // null. It is an error if a field in this list has a non-empty value.
  17942. // This may be used to include null fields in Patch requests.
  17943. NullFields []string `json:"-"`
  17944. }
  17945. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  17946. type NoMethod MachineTypeAggregatedList
  17947. raw := NoMethod(*s)
  17948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17949. }
  17950. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  17951. // message.
  17952. type MachineTypeAggregatedListWarning struct {
  17953. // Code: [Output Only] A warning code, if applicable. For example,
  17954. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17955. // the response.
  17956. //
  17957. // Possible values:
  17958. // "CLEANUP_FAILED"
  17959. // "DEPRECATED_RESOURCE_USED"
  17960. // "DEPRECATED_TYPE_USED"
  17961. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17962. // "EXPERIMENTAL_TYPE_USED"
  17963. // "EXTERNAL_API_WARNING"
  17964. // "FIELD_VALUE_OVERRIDEN"
  17965. // "INJECTED_KERNELS_DEPRECATED"
  17966. // "MISSING_TYPE_DEPENDENCY"
  17967. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17968. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17969. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17970. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17971. // "NEXT_HOP_NOT_RUNNING"
  17972. // "NOT_CRITICAL_ERROR"
  17973. // "NO_RESULTS_ON_PAGE"
  17974. // "REQUIRED_TOS_AGREEMENT"
  17975. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17976. // "RESOURCE_NOT_DELETED"
  17977. // "SCHEMA_VALIDATION_IGNORED"
  17978. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17979. // "UNDECLARED_PROPERTIES"
  17980. // "UNREACHABLE"
  17981. Code string `json:"code,omitempty"`
  17982. // Data: [Output Only] Metadata about this warning in key: value format.
  17983. // For example:
  17984. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17985. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  17986. // Message: [Output Only] A human-readable description of the warning
  17987. // code.
  17988. Message string `json:"message,omitempty"`
  17989. // ForceSendFields is a list of field names (e.g. "Code") to
  17990. // unconditionally include in API requests. By default, fields with
  17991. // empty values are omitted from API requests. However, any non-pointer,
  17992. // non-interface field appearing in ForceSendFields will be sent to the
  17993. // server regardless of whether the field is empty or not. This may be
  17994. // used to include empty fields in Patch requests.
  17995. ForceSendFields []string `json:"-"`
  17996. // NullFields is a list of field names (e.g. "Code") to include in API
  17997. // requests with the JSON null value. By default, fields with empty
  17998. // values are omitted from API requests. However, any field with an
  17999. // empty value appearing in NullFields will be sent to the server as
  18000. // null. It is an error if a field in this list has a non-empty value.
  18001. // This may be used to include null fields in Patch requests.
  18002. NullFields []string `json:"-"`
  18003. }
  18004. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18005. type NoMethod MachineTypeAggregatedListWarning
  18006. raw := NoMethod(*s)
  18007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18008. }
  18009. type MachineTypeAggregatedListWarningData struct {
  18010. // Key: [Output Only] A key that provides more detail on the warning
  18011. // being returned. For example, for warnings where there are no results
  18012. // in a list request for a particular zone, this key might be scope and
  18013. // the key value might be the zone name. Other examples might be a key
  18014. // indicating a deprecated resource and a suggested replacement, or a
  18015. // warning about invalid network settings (for example, if an instance
  18016. // attempts to perform IP forwarding but is not enabled for IP
  18017. // forwarding).
  18018. Key string `json:"key,omitempty"`
  18019. // Value: [Output Only] A warning data value corresponding to the key.
  18020. Value string `json:"value,omitempty"`
  18021. // ForceSendFields is a list of field names (e.g. "Key") to
  18022. // unconditionally include in API requests. By default, fields with
  18023. // empty values are omitted from API requests. However, any non-pointer,
  18024. // non-interface field appearing in ForceSendFields will be sent to the
  18025. // server regardless of whether the field is empty or not. This may be
  18026. // used to include empty fields in Patch requests.
  18027. ForceSendFields []string `json:"-"`
  18028. // NullFields is a list of field names (e.g. "Key") to include in API
  18029. // requests with the JSON null value. By default, fields with empty
  18030. // values are omitted from API requests. However, any field with an
  18031. // empty value appearing in NullFields will be sent to the server as
  18032. // null. It is an error if a field in this list has a non-empty value.
  18033. // This may be used to include null fields in Patch requests.
  18034. NullFields []string `json:"-"`
  18035. }
  18036. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18037. type NoMethod MachineTypeAggregatedListWarningData
  18038. raw := NoMethod(*s)
  18039. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18040. }
  18041. // MachineTypeList: Contains a list of machine types.
  18042. type MachineTypeList struct {
  18043. // Id: [Output Only] Unique identifier for the resource; defined by the
  18044. // server.
  18045. Id string `json:"id,omitempty"`
  18046. // Items: A list of MachineType resources.
  18047. Items []*MachineType `json:"items,omitempty"`
  18048. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  18049. // for lists of machine types.
  18050. Kind string `json:"kind,omitempty"`
  18051. // NextPageToken: [Output Only] This token allows you to get the next
  18052. // page of results for list requests. If the number of results is larger
  18053. // than maxResults, use the nextPageToken as a value for the query
  18054. // parameter pageToken in the next list request. Subsequent list
  18055. // requests will have their own nextPageToken to continue paging through
  18056. // the results.
  18057. NextPageToken string `json:"nextPageToken,omitempty"`
  18058. // SelfLink: [Output Only] Server-defined URL for this resource.
  18059. SelfLink string `json:"selfLink,omitempty"`
  18060. // Warning: [Output Only] Informational warning message.
  18061. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  18062. // ServerResponse contains the HTTP response code and headers from the
  18063. // server.
  18064. googleapi.ServerResponse `json:"-"`
  18065. // ForceSendFields is a list of field names (e.g. "Id") to
  18066. // unconditionally include in API requests. By default, fields with
  18067. // empty values are omitted from API requests. However, any non-pointer,
  18068. // non-interface field appearing in ForceSendFields will be sent to the
  18069. // server regardless of whether the field is empty or not. This may be
  18070. // used to include empty fields in Patch requests.
  18071. ForceSendFields []string `json:"-"`
  18072. // NullFields is a list of field names (e.g. "Id") to include in API
  18073. // requests with the JSON null value. By default, fields with empty
  18074. // values are omitted from API requests. However, any field with an
  18075. // empty value appearing in NullFields will be sent to the server as
  18076. // null. It is an error if a field in this list has a non-empty value.
  18077. // This may be used to include null fields in Patch requests.
  18078. NullFields []string `json:"-"`
  18079. }
  18080. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  18081. type NoMethod MachineTypeList
  18082. raw := NoMethod(*s)
  18083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18084. }
  18085. // MachineTypeListWarning: [Output Only] Informational warning message.
  18086. type MachineTypeListWarning struct {
  18087. // Code: [Output Only] A warning code, if applicable. For example,
  18088. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18089. // the response.
  18090. //
  18091. // Possible values:
  18092. // "CLEANUP_FAILED"
  18093. // "DEPRECATED_RESOURCE_USED"
  18094. // "DEPRECATED_TYPE_USED"
  18095. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18096. // "EXPERIMENTAL_TYPE_USED"
  18097. // "EXTERNAL_API_WARNING"
  18098. // "FIELD_VALUE_OVERRIDEN"
  18099. // "INJECTED_KERNELS_DEPRECATED"
  18100. // "MISSING_TYPE_DEPENDENCY"
  18101. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18102. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18103. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18104. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18105. // "NEXT_HOP_NOT_RUNNING"
  18106. // "NOT_CRITICAL_ERROR"
  18107. // "NO_RESULTS_ON_PAGE"
  18108. // "REQUIRED_TOS_AGREEMENT"
  18109. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18110. // "RESOURCE_NOT_DELETED"
  18111. // "SCHEMA_VALIDATION_IGNORED"
  18112. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18113. // "UNDECLARED_PROPERTIES"
  18114. // "UNREACHABLE"
  18115. Code string `json:"code,omitempty"`
  18116. // Data: [Output Only] Metadata about this warning in key: value format.
  18117. // For example:
  18118. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18119. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  18120. // Message: [Output Only] A human-readable description of the warning
  18121. // code.
  18122. Message string `json:"message,omitempty"`
  18123. // ForceSendFields is a list of field names (e.g. "Code") to
  18124. // unconditionally include in API requests. By default, fields with
  18125. // empty values are omitted from API requests. However, any non-pointer,
  18126. // non-interface field appearing in ForceSendFields will be sent to the
  18127. // server regardless of whether the field is empty or not. This may be
  18128. // used to include empty fields in Patch requests.
  18129. ForceSendFields []string `json:"-"`
  18130. // NullFields is a list of field names (e.g. "Code") to include in API
  18131. // requests with the JSON null value. By default, fields with empty
  18132. // values are omitted from API requests. However, any field with an
  18133. // empty value appearing in NullFields will be sent to the server as
  18134. // null. It is an error if a field in this list has a non-empty value.
  18135. // This may be used to include null fields in Patch requests.
  18136. NullFields []string `json:"-"`
  18137. }
  18138. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  18139. type NoMethod MachineTypeListWarning
  18140. raw := NoMethod(*s)
  18141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18142. }
  18143. type MachineTypeListWarningData struct {
  18144. // Key: [Output Only] A key that provides more detail on the warning
  18145. // being returned. For example, for warnings where there are no results
  18146. // in a list request for a particular zone, this key might be scope and
  18147. // the key value might be the zone name. Other examples might be a key
  18148. // indicating a deprecated resource and a suggested replacement, or a
  18149. // warning about invalid network settings (for example, if an instance
  18150. // attempts to perform IP forwarding but is not enabled for IP
  18151. // forwarding).
  18152. Key string `json:"key,omitempty"`
  18153. // Value: [Output Only] A warning data value corresponding to the key.
  18154. Value string `json:"value,omitempty"`
  18155. // ForceSendFields is a list of field names (e.g. "Key") to
  18156. // unconditionally include in API requests. By default, fields with
  18157. // empty values are omitted from API requests. However, any non-pointer,
  18158. // non-interface field appearing in ForceSendFields will be sent to the
  18159. // server regardless of whether the field is empty or not. This may be
  18160. // used to include empty fields in Patch requests.
  18161. ForceSendFields []string `json:"-"`
  18162. // NullFields is a list of field names (e.g. "Key") to include in API
  18163. // requests with the JSON null value. By default, fields with empty
  18164. // values are omitted from API requests. However, any field with an
  18165. // empty value appearing in NullFields will be sent to the server as
  18166. // null. It is an error if a field in this list has a non-empty value.
  18167. // This may be used to include null fields in Patch requests.
  18168. NullFields []string `json:"-"`
  18169. }
  18170. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  18171. type NoMethod MachineTypeListWarningData
  18172. raw := NoMethod(*s)
  18173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18174. }
  18175. type MachineTypesScopedList struct {
  18176. // MachineTypes: [Output Only] A list of machine types contained in this
  18177. // scope.
  18178. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  18179. // Warning: [Output Only] An informational warning that appears when the
  18180. // machine types list is empty.
  18181. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  18182. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  18183. // unconditionally include in API requests. By default, fields with
  18184. // empty values are omitted from API requests. However, any non-pointer,
  18185. // non-interface field appearing in ForceSendFields will be sent to the
  18186. // server regardless of whether the field is empty or not. This may be
  18187. // used to include empty fields in Patch requests.
  18188. ForceSendFields []string `json:"-"`
  18189. // NullFields is a list of field names (e.g. "MachineTypes") to include
  18190. // in API requests with the JSON null value. By default, fields with
  18191. // empty values are omitted from API requests. However, any field with
  18192. // an empty value appearing in NullFields will be sent to the server as
  18193. // null. It is an error if a field in this list has a non-empty value.
  18194. // This may be used to include null fields in Patch requests.
  18195. NullFields []string `json:"-"`
  18196. }
  18197. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  18198. type NoMethod MachineTypesScopedList
  18199. raw := NoMethod(*s)
  18200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18201. }
  18202. // MachineTypesScopedListWarning: [Output Only] An informational warning
  18203. // that appears when the machine types list is empty.
  18204. type MachineTypesScopedListWarning struct {
  18205. // Code: [Output Only] A warning code, if applicable. For example,
  18206. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18207. // the response.
  18208. //
  18209. // Possible values:
  18210. // "CLEANUP_FAILED"
  18211. // "DEPRECATED_RESOURCE_USED"
  18212. // "DEPRECATED_TYPE_USED"
  18213. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18214. // "EXPERIMENTAL_TYPE_USED"
  18215. // "EXTERNAL_API_WARNING"
  18216. // "FIELD_VALUE_OVERRIDEN"
  18217. // "INJECTED_KERNELS_DEPRECATED"
  18218. // "MISSING_TYPE_DEPENDENCY"
  18219. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18220. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18221. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18222. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18223. // "NEXT_HOP_NOT_RUNNING"
  18224. // "NOT_CRITICAL_ERROR"
  18225. // "NO_RESULTS_ON_PAGE"
  18226. // "REQUIRED_TOS_AGREEMENT"
  18227. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18228. // "RESOURCE_NOT_DELETED"
  18229. // "SCHEMA_VALIDATION_IGNORED"
  18230. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18231. // "UNDECLARED_PROPERTIES"
  18232. // "UNREACHABLE"
  18233. Code string `json:"code,omitempty"`
  18234. // Data: [Output Only] Metadata about this warning in key: value format.
  18235. // For example:
  18236. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18237. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  18238. // Message: [Output Only] A human-readable description of the warning
  18239. // code.
  18240. Message string `json:"message,omitempty"`
  18241. // ForceSendFields is a list of field names (e.g. "Code") to
  18242. // unconditionally include in API requests. By default, fields with
  18243. // empty values are omitted from API requests. However, any non-pointer,
  18244. // non-interface field appearing in ForceSendFields will be sent to the
  18245. // server regardless of whether the field is empty or not. This may be
  18246. // used to include empty fields in Patch requests.
  18247. ForceSendFields []string `json:"-"`
  18248. // NullFields is a list of field names (e.g. "Code") to include in API
  18249. // requests with the JSON null value. By default, fields with empty
  18250. // values are omitted from API requests. However, any field with an
  18251. // empty value appearing in NullFields will be sent to the server as
  18252. // null. It is an error if a field in this list has a non-empty value.
  18253. // This may be used to include null fields in Patch requests.
  18254. NullFields []string `json:"-"`
  18255. }
  18256. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  18257. type NoMethod MachineTypesScopedListWarning
  18258. raw := NoMethod(*s)
  18259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18260. }
  18261. type MachineTypesScopedListWarningData struct {
  18262. // Key: [Output Only] A key that provides more detail on the warning
  18263. // being returned. For example, for warnings where there are no results
  18264. // in a list request for a particular zone, this key might be scope and
  18265. // the key value might be the zone name. Other examples might be a key
  18266. // indicating a deprecated resource and a suggested replacement, or a
  18267. // warning about invalid network settings (for example, if an instance
  18268. // attempts to perform IP forwarding but is not enabled for IP
  18269. // forwarding).
  18270. Key string `json:"key,omitempty"`
  18271. // Value: [Output Only] A warning data value corresponding to the key.
  18272. Value string `json:"value,omitempty"`
  18273. // ForceSendFields is a list of field names (e.g. "Key") to
  18274. // unconditionally include in API requests. By default, fields with
  18275. // empty values are omitted from API requests. However, any non-pointer,
  18276. // non-interface field appearing in ForceSendFields will be sent to the
  18277. // server regardless of whether the field is empty or not. This may be
  18278. // used to include empty fields in Patch requests.
  18279. ForceSendFields []string `json:"-"`
  18280. // NullFields is a list of field names (e.g. "Key") to include in API
  18281. // requests with the JSON null value. By default, fields with empty
  18282. // values are omitted from API requests. However, any field with an
  18283. // empty value appearing in NullFields will be sent to the server as
  18284. // null. It is an error if a field in this list has a non-empty value.
  18285. // This may be used to include null fields in Patch requests.
  18286. NullFields []string `json:"-"`
  18287. }
  18288. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  18289. type NoMethod MachineTypesScopedListWarningData
  18290. raw := NoMethod(*s)
  18291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18292. }
  18293. // ManagedInstance: A Managed Instance resource.
  18294. type ManagedInstance struct {
  18295. // CurrentAction: [Output Only] The current action that the managed
  18296. // instance group has scheduled for the instance. Possible values:
  18297. // - NONE The instance is running, and the managed instance group does
  18298. // not have any scheduled actions for this instance.
  18299. // - CREATING The managed instance group is creating this instance. If
  18300. // the group fails to create this instance, it will try again until it
  18301. // is successful.
  18302. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  18303. // to create this instance only once. If the group fails to create this
  18304. // instance, it does not try again and the group's targetSize value is
  18305. // decreased instead.
  18306. // - RECREATING The managed instance group is recreating this instance.
  18307. //
  18308. // - DELETING The managed instance group is permanently deleting this
  18309. // instance.
  18310. // - ABANDONING The managed instance group is abandoning this instance.
  18311. // The instance will be removed from the instance group and from any
  18312. // target pools that are associated with this group.
  18313. // - RESTARTING The managed instance group is restarting the instance.
  18314. //
  18315. // - REFRESHING The managed instance group is applying configuration
  18316. // changes to the instance without stopping it. For example, the group
  18317. // can update the target pool list for an instance without stopping that
  18318. // instance.
  18319. // - VERIFYING The managed instance group has created the instance and
  18320. // it is in the process of being verified.
  18321. //
  18322. // Possible values:
  18323. // "ABANDONING"
  18324. // "CREATING"
  18325. // "CREATING_WITHOUT_RETRIES"
  18326. // "DELETING"
  18327. // "NONE"
  18328. // "RECREATING"
  18329. // "REFRESHING"
  18330. // "RESTARTING"
  18331. // "VERIFYING"
  18332. CurrentAction string `json:"currentAction,omitempty"`
  18333. // Id: [Output only] The unique identifier for this resource. This field
  18334. // is empty when instance does not exist.
  18335. Id uint64 `json:"id,omitempty,string"`
  18336. // Instance: [Output Only] The URL of the instance. The URL can exist
  18337. // even if the instance has not yet been created.
  18338. Instance string `json:"instance,omitempty"`
  18339. // InstanceHealth: [Output Only] Health state of the instance per
  18340. // health-check.
  18341. InstanceHealth []*ManagedInstanceInstanceHealth `json:"instanceHealth,omitempty"`
  18342. // InstanceStatus: [Output Only] The status of the instance. This field
  18343. // is empty when the instance does not exist.
  18344. //
  18345. // Possible values:
  18346. // "PROVISIONING"
  18347. // "REPAIRING"
  18348. // "RUNNING"
  18349. // "STAGING"
  18350. // "STOPPED"
  18351. // "STOPPING"
  18352. // "SUSPENDED"
  18353. // "SUSPENDING"
  18354. // "TERMINATED"
  18355. InstanceStatus string `json:"instanceStatus,omitempty"`
  18356. // InstanceTemplate: [Output Only] The intended template of the
  18357. // instance. This field is empty when current_action is one of {
  18358. // DELETING, ABANDONING }.
  18359. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  18360. // LastAttempt: [Output Only] Information about the last attempt to
  18361. // create or delete the instance.
  18362. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  18363. // Override: [Output Only] Override defined for this instance.
  18364. Override *ManagedInstanceOverride `json:"override,omitempty"`
  18365. // PreservedStateFromConfig: [Output Only] Preserved state applied from
  18366. // per-instance config for this instance.
  18367. PreservedStateFromConfig *PreservedState `json:"preservedStateFromConfig,omitempty"`
  18368. // PreservedStateFromPolicy: [Output Only] Preserved state generated
  18369. // based on stateful policy for this instance.
  18370. PreservedStateFromPolicy *PreservedState `json:"preservedStateFromPolicy,omitempty"`
  18371. // Tag: [Output Only] Tag describing the version.
  18372. Tag string `json:"tag,omitempty"`
  18373. // Version: [Output Only] Intended version of this instance.
  18374. Version *ManagedInstanceVersion `json:"version,omitempty"`
  18375. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  18376. // unconditionally include in API requests. By default, fields with
  18377. // empty values are omitted from API requests. However, any non-pointer,
  18378. // non-interface field appearing in ForceSendFields will be sent to the
  18379. // server regardless of whether the field is empty or not. This may be
  18380. // used to include empty fields in Patch requests.
  18381. ForceSendFields []string `json:"-"`
  18382. // NullFields is a list of field names (e.g. "CurrentAction") to include
  18383. // in API requests with the JSON null value. By default, fields with
  18384. // empty values are omitted from API requests. However, any field with
  18385. // an empty value appearing in NullFields will be sent to the server as
  18386. // null. It is an error if a field in this list has a non-empty value.
  18387. // This may be used to include null fields in Patch requests.
  18388. NullFields []string `json:"-"`
  18389. }
  18390. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  18391. type NoMethod ManagedInstance
  18392. raw := NoMethod(*s)
  18393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18394. }
  18395. type ManagedInstanceInstanceHealth struct {
  18396. // DetailedHealthState: [Output Only] The current detailed instance
  18397. // health state.
  18398. //
  18399. // Possible values:
  18400. // "DRAINING"
  18401. // "HEALTHY"
  18402. // "TIMEOUT"
  18403. // "UNHEALTHY"
  18404. // "UNKNOWN"
  18405. DetailedHealthState string `json:"detailedHealthState,omitempty"`
  18406. // HealthCheck: [Output Only] The URL for the health check that verifies
  18407. // whether the instance is healthy.
  18408. HealthCheck string `json:"healthCheck,omitempty"`
  18409. // HealthState: [Output Only] The current instance health state.
  18410. //
  18411. // Possible values:
  18412. // "HEALTHY"
  18413. // "UNHEALTHY"
  18414. HealthState string `json:"healthState,omitempty"`
  18415. // ForceSendFields is a list of field names (e.g. "DetailedHealthState")
  18416. // to unconditionally include in API requests. By default, fields with
  18417. // empty values are omitted from API requests. However, any non-pointer,
  18418. // non-interface field appearing in ForceSendFields will be sent to the
  18419. // server regardless of whether the field is empty or not. This may be
  18420. // used to include empty fields in Patch requests.
  18421. ForceSendFields []string `json:"-"`
  18422. // NullFields is a list of field names (e.g. "DetailedHealthState") to
  18423. // include in API requests with the JSON null value. By default, fields
  18424. // with empty values are omitted from API requests. However, any field
  18425. // with an empty value appearing in NullFields will be sent to the
  18426. // server as null. It is an error if a field in this list has a
  18427. // non-empty value. This may be used to include null fields in Patch
  18428. // requests.
  18429. NullFields []string `json:"-"`
  18430. }
  18431. func (s *ManagedInstanceInstanceHealth) MarshalJSON() ([]byte, error) {
  18432. type NoMethod ManagedInstanceInstanceHealth
  18433. raw := NoMethod(*s)
  18434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18435. }
  18436. type ManagedInstanceLastAttempt struct {
  18437. // Errors: [Output Only] Encountered errors during the last attempt to
  18438. // create or delete the instance.
  18439. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  18440. // ForceSendFields is a list of field names (e.g. "Errors") to
  18441. // unconditionally include in API requests. By default, fields with
  18442. // empty values are omitted from API requests. However, any non-pointer,
  18443. // non-interface field appearing in ForceSendFields will be sent to the
  18444. // server regardless of whether the field is empty or not. This may be
  18445. // used to include empty fields in Patch requests.
  18446. ForceSendFields []string `json:"-"`
  18447. // NullFields is a list of field names (e.g. "Errors") to include in API
  18448. // requests with the JSON null value. By default, fields with empty
  18449. // values are omitted from API requests. However, any field with an
  18450. // empty value appearing in NullFields will be sent to the server as
  18451. // null. It is an error if a field in this list has a non-empty value.
  18452. // This may be used to include null fields in Patch requests.
  18453. NullFields []string `json:"-"`
  18454. }
  18455. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  18456. type NoMethod ManagedInstanceLastAttempt
  18457. raw := NoMethod(*s)
  18458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18459. }
  18460. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  18461. // during the last attempt to create or delete the instance.
  18462. type ManagedInstanceLastAttemptErrors struct {
  18463. // Errors: [Output Only] The array of errors encountered while
  18464. // processing this operation.
  18465. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  18466. // ForceSendFields is a list of field names (e.g. "Errors") to
  18467. // unconditionally include in API requests. By default, fields with
  18468. // empty values are omitted from API requests. However, any non-pointer,
  18469. // non-interface field appearing in ForceSendFields will be sent to the
  18470. // server regardless of whether the field is empty or not. This may be
  18471. // used to include empty fields in Patch requests.
  18472. ForceSendFields []string `json:"-"`
  18473. // NullFields is a list of field names (e.g. "Errors") to include in API
  18474. // requests with the JSON null value. By default, fields with empty
  18475. // values are omitted from API requests. However, any field with an
  18476. // empty value appearing in NullFields will be sent to the server as
  18477. // null. It is an error if a field in this list has a non-empty value.
  18478. // This may be used to include null fields in Patch requests.
  18479. NullFields []string `json:"-"`
  18480. }
  18481. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  18482. type NoMethod ManagedInstanceLastAttemptErrors
  18483. raw := NoMethod(*s)
  18484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18485. }
  18486. type ManagedInstanceLastAttemptErrorsErrors struct {
  18487. // Code: [Output Only] The error type identifier for this error.
  18488. Code string `json:"code,omitempty"`
  18489. // Location: [Output Only] Indicates the field in the request that
  18490. // caused the error. This property is optional.
  18491. Location string `json:"location,omitempty"`
  18492. // Message: [Output Only] An optional, human-readable error message.
  18493. Message string `json:"message,omitempty"`
  18494. // ForceSendFields is a list of field names (e.g. "Code") to
  18495. // unconditionally include in API requests. By default, fields with
  18496. // empty values are omitted from API requests. However, any non-pointer,
  18497. // non-interface field appearing in ForceSendFields will be sent to the
  18498. // server regardless of whether the field is empty or not. This may be
  18499. // used to include empty fields in Patch requests.
  18500. ForceSendFields []string `json:"-"`
  18501. // NullFields is a list of field names (e.g. "Code") to include in API
  18502. // requests with the JSON null value. By default, fields with empty
  18503. // values are omitted from API requests. However, any field with an
  18504. // empty value appearing in NullFields will be sent to the server as
  18505. // null. It is an error if a field in this list has a non-empty value.
  18506. // This may be used to include null fields in Patch requests.
  18507. NullFields []string `json:"-"`
  18508. }
  18509. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  18510. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  18511. raw := NoMethod(*s)
  18512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18513. }
  18514. // ManagedInstanceOverride: Overrides of stateful properties for a given
  18515. // instance
  18516. type ManagedInstanceOverride struct {
  18517. // Disks: Disk overrides defined for this instance. According to
  18518. // documentation the maximum number of disks attached to an instance is
  18519. // 128: https://cloud.google.com/compute/docs/disks/ However, compute
  18520. // API defines the limit at 140, so this is what we check.
  18521. Disks []*ManagedInstanceOverrideDiskOverride `json:"disks,omitempty"`
  18522. // Metadata: Metadata overrides defined for this instance.
  18523. // TODO(b/69785416) validate the total length is <9 KB
  18524. Metadata []*ManagedInstanceOverrideMetadata `json:"metadata,omitempty"`
  18525. // Origin: [Output Only] Indicates where does the override come from.
  18526. //
  18527. // Possible values:
  18528. // "AUTO_GENERATED"
  18529. // "USER_PROVIDED"
  18530. Origin string `json:"origin,omitempty"`
  18531. // ForceSendFields is a list of field names (e.g. "Disks") to
  18532. // unconditionally include in API requests. By default, fields with
  18533. // empty values are omitted from API requests. However, any non-pointer,
  18534. // non-interface field appearing in ForceSendFields will be sent to the
  18535. // server regardless of whether the field is empty or not. This may be
  18536. // used to include empty fields in Patch requests.
  18537. ForceSendFields []string `json:"-"`
  18538. // NullFields is a list of field names (e.g. "Disks") to include in API
  18539. // requests with the JSON null value. By default, fields with empty
  18540. // values are omitted from API requests. However, any field with an
  18541. // empty value appearing in NullFields will be sent to the server as
  18542. // null. It is an error if a field in this list has a non-empty value.
  18543. // This may be used to include null fields in Patch requests.
  18544. NullFields []string `json:"-"`
  18545. }
  18546. func (s *ManagedInstanceOverride) MarshalJSON() ([]byte, error) {
  18547. type NoMethod ManagedInstanceOverride
  18548. raw := NoMethod(*s)
  18549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18550. }
  18551. type ManagedInstanceOverrideMetadata struct {
  18552. // Key: Key for the metadata entry. Keys must conform to the following
  18553. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  18554. // reflected as part of a URL in the metadata server. Additionally, to
  18555. // avoid ambiguity, keys must not conflict with any other metadata keys
  18556. // for the project.
  18557. Key string `json:"key,omitempty"`
  18558. // Value: Value for the metadata entry. These are free-form strings, and
  18559. // only have meaning as interpreted by the image running in the
  18560. // instance. The only restriction placed on values is that their size
  18561. // must be less than or equal to 262144 bytes (256 KiB).
  18562. Value string `json:"value,omitempty"`
  18563. // ForceSendFields is a list of field names (e.g. "Key") to
  18564. // unconditionally include in API requests. By default, fields with
  18565. // empty values are omitted from API requests. However, any non-pointer,
  18566. // non-interface field appearing in ForceSendFields will be sent to the
  18567. // server regardless of whether the field is empty or not. This may be
  18568. // used to include empty fields in Patch requests.
  18569. ForceSendFields []string `json:"-"`
  18570. // NullFields is a list of field names (e.g. "Key") to include in API
  18571. // requests with the JSON null value. By default, fields with empty
  18572. // values are omitted from API requests. However, any field with an
  18573. // empty value appearing in NullFields will be sent to the server as
  18574. // null. It is an error if a field in this list has a non-empty value.
  18575. // This may be used to include null fields in Patch requests.
  18576. NullFields []string `json:"-"`
  18577. }
  18578. func (s *ManagedInstanceOverrideMetadata) MarshalJSON() ([]byte, error) {
  18579. type NoMethod ManagedInstanceOverrideMetadata
  18580. raw := NoMethod(*s)
  18581. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18582. }
  18583. type ManagedInstanceOverrideDiskOverride struct {
  18584. // DeviceName: The name of the device on the VM
  18585. DeviceName string `json:"deviceName,omitempty"`
  18586. // Mode: The mode in which to attach this disk, either READ_WRITE or
  18587. // READ_ONLY. If not specified, the default is to attach the disk in
  18588. // READ_WRITE mode.
  18589. //
  18590. // Possible values:
  18591. // "READ_ONLY"
  18592. // "READ_WRITE"
  18593. Mode string `json:"mode,omitempty"`
  18594. // Source: The disk that is/will be mounted
  18595. Source string `json:"source,omitempty"`
  18596. // ForceSendFields is a list of field names (e.g. "DeviceName") to
  18597. // unconditionally include in API requests. By default, fields with
  18598. // empty values are omitted from API requests. However, any non-pointer,
  18599. // non-interface field appearing in ForceSendFields will be sent to the
  18600. // server regardless of whether the field is empty or not. This may be
  18601. // used to include empty fields in Patch requests.
  18602. ForceSendFields []string `json:"-"`
  18603. // NullFields is a list of field names (e.g. "DeviceName") to include in
  18604. // API requests with the JSON null value. By default, fields with empty
  18605. // values are omitted from API requests. However, any field with an
  18606. // empty value appearing in NullFields will be sent to the server as
  18607. // null. It is an error if a field in this list has a non-empty value.
  18608. // This may be used to include null fields in Patch requests.
  18609. NullFields []string `json:"-"`
  18610. }
  18611. func (s *ManagedInstanceOverrideDiskOverride) MarshalJSON() ([]byte, error) {
  18612. type NoMethod ManagedInstanceOverrideDiskOverride
  18613. raw := NoMethod(*s)
  18614. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18615. }
  18616. type ManagedInstanceVersion struct {
  18617. // InstanceTemplate: [Output Only] The intended template of the
  18618. // instance. This field is empty when current_action is one of {
  18619. // DELETING, ABANDONING }.
  18620. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  18621. // Name: [Output Only] Name of the version.
  18622. Name string `json:"name,omitempty"`
  18623. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") 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. "InstanceTemplate") to
  18631. // include in API requests with the JSON null value. By default, fields
  18632. // with empty values are omitted from API requests. However, any field
  18633. // with an empty value appearing in NullFields will be sent to the
  18634. // server as null. It is an error if a field in this list has a
  18635. // non-empty value. This may be used to include null fields in Patch
  18636. // requests.
  18637. NullFields []string `json:"-"`
  18638. }
  18639. func (s *ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
  18640. type NoMethod ManagedInstanceVersion
  18641. raw := NoMethod(*s)
  18642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18643. }
  18644. // Metadata: A metadata key/value entry.
  18645. type Metadata struct {
  18646. // Fingerprint: Specifies a fingerprint for this request, which is
  18647. // essentially a hash of the metadata's contents and used for optimistic
  18648. // locking. The fingerprint is initially generated by Compute Engine and
  18649. // changes after every request to modify or update metadata. You must
  18650. // always provide an up-to-date fingerprint hash in order to update or
  18651. // change metadata, otherwise the request will fail with error 412
  18652. // conditionNotMet.
  18653. //
  18654. // To see the latest fingerprint, make a get() request to retrieve the
  18655. // resource.
  18656. Fingerprint string `json:"fingerprint,omitempty"`
  18657. // Items: Array of key/value pairs. The total size of all keys and
  18658. // values must be less than 512 KB.
  18659. Items []*MetadataItems `json:"items,omitempty"`
  18660. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  18661. // metadata.
  18662. Kind string `json:"kind,omitempty"`
  18663. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  18664. // unconditionally include in API requests. By default, fields with
  18665. // empty values are omitted from API requests. However, any non-pointer,
  18666. // non-interface field appearing in ForceSendFields will be sent to the
  18667. // server regardless of whether the field is empty or not. This may be
  18668. // used to include empty fields in Patch requests.
  18669. ForceSendFields []string `json:"-"`
  18670. // NullFields is a list of field names (e.g. "Fingerprint") to include
  18671. // in API requests with the JSON null value. By default, fields with
  18672. // empty values are omitted from API requests. However, any field with
  18673. // an empty value appearing in NullFields will be sent to the server as
  18674. // null. It is an error if a field in this list has a non-empty value.
  18675. // This may be used to include null fields in Patch requests.
  18676. NullFields []string `json:"-"`
  18677. }
  18678. func (s *Metadata) MarshalJSON() ([]byte, error) {
  18679. type NoMethod Metadata
  18680. raw := NoMethod(*s)
  18681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18682. }
  18683. type MetadataItems struct {
  18684. // Key: Key for the metadata entry. Keys must conform to the following
  18685. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  18686. // reflected as part of a URL in the metadata server. Additionally, to
  18687. // avoid ambiguity, keys must not conflict with any other metadata keys
  18688. // for the project.
  18689. Key string `json:"key,omitempty"`
  18690. // Value: Value for the metadata entry. These are free-form strings, and
  18691. // only have meaning as interpreted by the image running in the
  18692. // instance. The only restriction placed on values is that their size
  18693. // must be less than or equal to 262144 bytes (256 KiB).
  18694. Value string `json:"value,omitempty"`
  18695. // ForceSendFields is a list of field names (e.g. "Key") to
  18696. // unconditionally include in API requests. By default, fields with
  18697. // empty values are omitted from API requests. However, any non-pointer,
  18698. // non-interface field appearing in ForceSendFields will be sent to the
  18699. // server regardless of whether the field is empty or not. This may be
  18700. // used to include empty fields in Patch requests.
  18701. ForceSendFields []string `json:"-"`
  18702. // NullFields is a list of field names (e.g. "Key") to include in API
  18703. // requests with the JSON null value. By default, fields with empty
  18704. // values are omitted from API requests. However, any field with an
  18705. // empty value appearing in NullFields will be sent to the server as
  18706. // null. It is an error if a field in this list has a non-empty value.
  18707. // This may be used to include null fields in Patch requests.
  18708. NullFields []string `json:"-"`
  18709. }
  18710. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  18711. type NoMethod MetadataItems
  18712. raw := NoMethod(*s)
  18713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18714. }
  18715. // MetadataCredentialsFromPlugin: Custom authenticator credentials.
  18716. type MetadataCredentialsFromPlugin struct {
  18717. // Name: Plugin name.
  18718. Name string `json:"name,omitempty"`
  18719. // StructConfig: A text proto that conforms to a Struct type definition
  18720. // interpreted by the plugin.
  18721. StructConfig string `json:"structConfig,omitempty"`
  18722. // ForceSendFields is a list of field names (e.g. "Name") to
  18723. // unconditionally include in API requests. By default, fields with
  18724. // empty values are omitted from API requests. However, any non-pointer,
  18725. // non-interface field appearing in ForceSendFields will be sent to the
  18726. // server regardless of whether the field is empty or not. This may be
  18727. // used to include empty fields in Patch requests.
  18728. ForceSendFields []string `json:"-"`
  18729. // NullFields is a list of field names (e.g. "Name") to include in API
  18730. // requests with the JSON null value. By default, fields with empty
  18731. // values are omitted from API requests. However, any field with an
  18732. // empty value appearing in NullFields will be sent to the server as
  18733. // null. It is an error if a field in this list has a non-empty value.
  18734. // This may be used to include null fields in Patch requests.
  18735. NullFields []string `json:"-"`
  18736. }
  18737. func (s *MetadataCredentialsFromPlugin) MarshalJSON() ([]byte, error) {
  18738. type NoMethod MetadataCredentialsFromPlugin
  18739. raw := NoMethod(*s)
  18740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18741. }
  18742. // MetadataFilter: Opaque filter criteria used by loadbalancers to
  18743. // restrict routing configuration to a limited set of loadbalancing
  18744. // proxies. Proxies and sidecars involved in loadbalancing would
  18745. // typically present metadata to the loadbalancers which need to match
  18746. // criteria specified here. If a match takes place, the relevant routing
  18747. // configuration is made available to those proxies.
  18748. // For each metadataFilter in this list, if its filterMatchCriteria is
  18749. // set to MATCH_ANY, at least one of the filterLabels must match the
  18750. // corresponding label provided in the metadata. If its
  18751. // filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels
  18752. // must match with corresponding labels in the provided metadata.
  18753. // An example for using metadataFilters would be: if loadbalancing
  18754. // involves Envoys, they will only receive routing configuration when
  18755. // values in metadataFilters match values supplied in <a
  18756. // href="https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/core/b
  18757. // ase.proto#envoy-api-msg-core-node" Node metadata of their XDS
  18758. // requests to loadbalancers.
  18759. type MetadataFilter struct {
  18760. // FilterLabels: The list of label value pairs that must match labels in
  18761. // the provided metadata based on filterMatchCriteria
  18762. // This list must not be empty and can have at the most 64 entries.
  18763. FilterLabels []*MetadataFilterLabelMatch `json:"filterLabels,omitempty"`
  18764. // FilterMatchCriteria: Specifies how individual filterLabel matches
  18765. // within the list of filterLabels contribute towards the overall
  18766. // metadataFilter match.
  18767. // Supported values are:
  18768. // - MATCH_ANY: At least one of the filterLabels must have a matching
  18769. // label in the provided metadata.
  18770. // - MATCH_ALL: All filterLabels must have matching labels in the
  18771. // provided metadata.
  18772. //
  18773. // Possible values:
  18774. // "MATCH_ALL"
  18775. // "MATCH_ANY"
  18776. // "NOT_SET"
  18777. FilterMatchCriteria string `json:"filterMatchCriteria,omitempty"`
  18778. // ForceSendFields is a list of field names (e.g. "FilterLabels") to
  18779. // unconditionally include in API requests. By default, fields with
  18780. // empty values are omitted from API requests. However, any non-pointer,
  18781. // non-interface field appearing in ForceSendFields will be sent to the
  18782. // server regardless of whether the field is empty or not. This may be
  18783. // used to include empty fields in Patch requests.
  18784. ForceSendFields []string `json:"-"`
  18785. // NullFields is a list of field names (e.g. "FilterLabels") to include
  18786. // in API requests with the JSON null value. By default, fields with
  18787. // empty values are omitted from API requests. However, any field with
  18788. // an empty value appearing in NullFields will be sent to the server as
  18789. // null. It is an error if a field in this list has a non-empty value.
  18790. // This may be used to include null fields in Patch requests.
  18791. NullFields []string `json:"-"`
  18792. }
  18793. func (s *MetadataFilter) MarshalJSON() ([]byte, error) {
  18794. type NoMethod MetadataFilter
  18795. raw := NoMethod(*s)
  18796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18797. }
  18798. // MetadataFilterLabelMatch: MetadataFilter label name value pairs that
  18799. // are expected to match corresponding labels presented as metadata to
  18800. // the loadbalancer.
  18801. type MetadataFilterLabelMatch struct {
  18802. // Name: Name of metadata label.
  18803. // The name can have a maximum length of 1024 characters and must be at
  18804. // least 1 character long.
  18805. Name string `json:"name,omitempty"`
  18806. // Value: The value of the label must match the specified value.
  18807. // value can have a maximum length of 1024 characters.
  18808. Value string `json:"value,omitempty"`
  18809. // ForceSendFields is a list of field names (e.g. "Name") to
  18810. // unconditionally include in API requests. By default, fields with
  18811. // empty values are omitted from API requests. However, any non-pointer,
  18812. // non-interface field appearing in ForceSendFields will be sent to the
  18813. // server regardless of whether the field is empty or not. This may be
  18814. // used to include empty fields in Patch requests.
  18815. ForceSendFields []string `json:"-"`
  18816. // NullFields is a list of field names (e.g. "Name") to include in API
  18817. // requests with the JSON null value. By default, fields with empty
  18818. // values are omitted from API requests. However, any field with an
  18819. // empty value appearing in NullFields will be sent to the server as
  18820. // null. It is an error if a field in this list has a non-empty value.
  18821. // This may be used to include null fields in Patch requests.
  18822. NullFields []string `json:"-"`
  18823. }
  18824. func (s *MetadataFilterLabelMatch) MarshalJSON() ([]byte, error) {
  18825. type NoMethod MetadataFilterLabelMatch
  18826. raw := NoMethod(*s)
  18827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18828. }
  18829. // MutualTls: Configuration for the mutual Tls mode for peer
  18830. // authentication.
  18831. type MutualTls struct {
  18832. // Mode: Specifies if the server TLS is configured to be strict or
  18833. // permissive. This field can be set to one of the following: STRICT:
  18834. // Client certificate must be presented, connection is in TLS.
  18835. // PERMISSIVE: Client certificate can be omitted, connection can be
  18836. // either plaintext or TLS.
  18837. //
  18838. // Possible values:
  18839. // "INVALID"
  18840. // "PERMISSIVE"
  18841. // "STRICT"
  18842. Mode string `json:"mode,omitempty"`
  18843. // ForceSendFields is a list of field names (e.g. "Mode") to
  18844. // unconditionally include in API requests. By default, fields with
  18845. // empty values are omitted from API requests. However, any non-pointer,
  18846. // non-interface field appearing in ForceSendFields will be sent to the
  18847. // server regardless of whether the field is empty or not. This may be
  18848. // used to include empty fields in Patch requests.
  18849. ForceSendFields []string `json:"-"`
  18850. // NullFields is a list of field names (e.g. "Mode") to include in API
  18851. // requests with the JSON null value. By default, fields with empty
  18852. // values are omitted from API requests. However, any field with an
  18853. // empty value appearing in NullFields will be sent to the server as
  18854. // null. It is an error if a field in this list has a non-empty value.
  18855. // This may be used to include null fields in Patch requests.
  18856. NullFields []string `json:"-"`
  18857. }
  18858. func (s *MutualTls) MarshalJSON() ([]byte, error) {
  18859. type NoMethod MutualTls
  18860. raw := NoMethod(*s)
  18861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18862. }
  18863. // NamedPort: The named port. For example: .
  18864. type NamedPort struct {
  18865. // Name: The name for this named port. The name must be 1-63 characters
  18866. // long, and comply with RFC1035.
  18867. Name string `json:"name,omitempty"`
  18868. // Port: The port number, which can be a value between 1 and 65535.
  18869. Port int64 `json:"port,omitempty"`
  18870. // ForceSendFields is a list of field names (e.g. "Name") to
  18871. // unconditionally include in API requests. By default, fields with
  18872. // empty values are omitted from API requests. However, any non-pointer,
  18873. // non-interface field appearing in ForceSendFields will be sent to the
  18874. // server regardless of whether the field is empty or not. This may be
  18875. // used to include empty fields in Patch requests.
  18876. ForceSendFields []string `json:"-"`
  18877. // NullFields is a list of field names (e.g. "Name") to include in API
  18878. // requests with the JSON null value. By default, fields with empty
  18879. // values are omitted from API requests. However, any field with an
  18880. // empty value appearing in NullFields will be sent to the server as
  18881. // null. It is an error if a field in this list has a non-empty value.
  18882. // This may be used to include null fields in Patch requests.
  18883. NullFields []string `json:"-"`
  18884. }
  18885. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  18886. type NoMethod NamedPort
  18887. raw := NoMethod(*s)
  18888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18889. }
  18890. // Network: Represents a Network resource. Read Virtual Private Cloud
  18891. // (VPC) Network Overview for more information. (== resource_for
  18892. // v1.networks ==) (== resource_for beta.networks ==)
  18893. type Network struct {
  18894. // IPv4Range: Deprecated in favor of subnet mode networks. The range of
  18895. // internal addresses that are legal on this network. This range is a
  18896. // CIDR specification, for example: 192.168.0.0/16. Provided by the
  18897. // client when the network is created.
  18898. IPv4Range string `json:"IPv4Range,omitempty"`
  18899. // AutoCreateSubnetworks: When set to true, the VPC network is created
  18900. // in "auto" mode. When set to false, the VPC network is created in
  18901. // "custom" mode.
  18902. //
  18903. // An auto mode VPC network starts with one subnet per region. Each
  18904. // subnet has a predetermined range as described in Auto mode VPC
  18905. // network IP ranges.
  18906. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  18907. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18908. // format.
  18909. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18910. // CrossVmEncryption: [Output Only] Type of VM-to-VM traffic encryption
  18911. // for this network.
  18912. //
  18913. // Possible values:
  18914. // "ENCRYPTED"
  18915. // "UNENCRYPTED"
  18916. CrossVmEncryption string `json:"crossVmEncryption,omitempty"`
  18917. // Description: An optional description of this resource. Provide this
  18918. // property when you create the resource.
  18919. Description string `json:"description,omitempty"`
  18920. // GatewayIPv4: [Output Only] The gateway address for default routing
  18921. // out of the network. This value is read only and is selected by GCP.
  18922. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  18923. // Id: [Output Only] The unique identifier for the resource. This
  18924. // identifier is defined by the server.
  18925. Id uint64 `json:"id,omitempty,string"`
  18926. // Kind: [Output Only] Type of the resource. Always compute#network for
  18927. // networks.
  18928. Kind string `json:"kind,omitempty"`
  18929. // LoadBalancerVmEncryption: [Output Only] Type of LB-to-VM traffic
  18930. // encryption for this network.
  18931. //
  18932. // Possible values:
  18933. // "ENCRYPTED"
  18934. // "UNENCRYPTED"
  18935. LoadBalancerVmEncryption string `json:"loadBalancerVmEncryption,omitempty"`
  18936. // Mtu: Maximum Transmission Unit in bytes. The minimum value for this
  18937. // field is 1460 and the maximum value is 1600 bytes.
  18938. Mtu int64 `json:"mtu,omitempty"`
  18939. // MulticastMode: The multicast mode for this network. If set to ZONAL,
  18940. // multicast is allowed within a zone. If set to DISABLED, multicast is
  18941. // disabled for this network. The default is DISABLED.
  18942. //
  18943. // Possible values:
  18944. // "DISABLED"
  18945. // "ZONAL"
  18946. MulticastMode string `json:"multicastMode,omitempty"`
  18947. // Name: Name of the resource. Provided by the client when the resource
  18948. // is created. The name must be 1-63 characters long, and comply with
  18949. // RFC1035. Specifically, the name must be 1-63 characters long and
  18950. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  18951. // the first character must be a lowercase letter, and all following
  18952. // characters must be a dash, lowercase letter, or digit, except the
  18953. // last character, which cannot be a dash.
  18954. Name string `json:"name,omitempty"`
  18955. // Peerings: [Output Only] A list of network peerings for the resource.
  18956. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  18957. // RoutingConfig: The network-level routing configuration for this
  18958. // network. Used by Cloud Router to determine what type of network-wide
  18959. // routing behavior to enforce.
  18960. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  18961. // SelfLink: [Output Only] Server-defined URL for the resource.
  18962. SelfLink string `json:"selfLink,omitempty"`
  18963. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  18964. // with the resource id.
  18965. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  18966. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  18967. // all subnetworks in this VPC network.
  18968. Subnetworks []string `json:"subnetworks,omitempty"`
  18969. // ServerResponse contains the HTTP response code and headers from the
  18970. // server.
  18971. googleapi.ServerResponse `json:"-"`
  18972. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  18973. // unconditionally include in API requests. By default, fields with
  18974. // empty values are omitted from API requests. However, any non-pointer,
  18975. // non-interface field appearing in ForceSendFields will be sent to the
  18976. // server regardless of whether the field is empty or not. This may be
  18977. // used to include empty fields in Patch requests.
  18978. ForceSendFields []string `json:"-"`
  18979. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  18980. // API requests with the JSON null value. By default, fields with empty
  18981. // values are omitted from API requests. However, any field with an
  18982. // empty value appearing in NullFields will be sent to the server as
  18983. // null. It is an error if a field in this list has a non-empty value.
  18984. // This may be used to include null fields in Patch requests.
  18985. NullFields []string `json:"-"`
  18986. }
  18987. func (s *Network) MarshalJSON() ([]byte, error) {
  18988. type NoMethod Network
  18989. raw := NoMethod(*s)
  18990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18991. }
  18992. // NetworkEndpoint: The network endpoint.
  18993. type NetworkEndpoint struct {
  18994. // Annotations: Metadata defined as annotations on the network endpoint.
  18995. Annotations map[string]string `json:"annotations,omitempty"`
  18996. // Fqdn: Optional fully qualified domain name of network endpoint. This
  18997. // can only be specified when NetworkEndpointGroup.network_endpoint_type
  18998. // is NON_GCP_FQDN_PORT.
  18999. Fqdn string `json:"fqdn,omitempty"`
  19000. // Instance: The name for a specific VM instance that the IP address
  19001. // belongs to. This is required for network endpoints of type
  19002. // GCE_VM_IP_PORT. The instance must be in the same zone of network
  19003. // endpoint group.
  19004. //
  19005. // The name must be 1-63 characters long, and comply with RFC1035.
  19006. Instance string `json:"instance,omitempty"`
  19007. // IpAddress: Optional IPv4 address of network endpoint. The IP address
  19008. // must belong to a VM in GCE (either the primary IP or as part of an
  19009. // aliased IP range). If the IP address is not specified, then the
  19010. // primary IP address for the VM instance in the network that the
  19011. // network endpoint group belongs to will be used.
  19012. IpAddress string `json:"ipAddress,omitempty"`
  19013. // Port: Optional port number of network endpoint. If not specified and
  19014. // the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the
  19015. // defaultPort for the network endpoint group will be used.
  19016. Port int64 `json:"port,omitempty"`
  19017. // ForceSendFields is a list of field names (e.g. "Annotations") to
  19018. // unconditionally include in API requests. By default, fields with
  19019. // empty values are omitted from API requests. However, any non-pointer,
  19020. // non-interface field appearing in ForceSendFields will be sent to the
  19021. // server regardless of whether the field is empty or not. This may be
  19022. // used to include empty fields in Patch requests.
  19023. ForceSendFields []string `json:"-"`
  19024. // NullFields is a list of field names (e.g. "Annotations") to include
  19025. // in API requests with the JSON null value. By default, fields with
  19026. // empty values are omitted from API requests. However, any field with
  19027. // an empty value appearing in NullFields will be sent to the server as
  19028. // null. It is an error if a field in this list has a non-empty value.
  19029. // This may be used to include null fields in Patch requests.
  19030. NullFields []string `json:"-"`
  19031. }
  19032. func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
  19033. type NoMethod NetworkEndpoint
  19034. raw := NoMethod(*s)
  19035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19036. }
  19037. // NetworkEndpointGroup: Represents a collection of network endpoints.
  19038. type NetworkEndpointGroup struct {
  19039. // Annotations: Metadata defined as annotations on the network endpoint
  19040. // group.
  19041. Annotations map[string]string `json:"annotations,omitempty"`
  19042. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19043. // format.
  19044. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19045. // DefaultPort: The default port used if the port number is not
  19046. // specified in the network endpoint.
  19047. DefaultPort int64 `json:"defaultPort,omitempty"`
  19048. // Description: An optional description of this resource. Provide this
  19049. // property when you create the resource.
  19050. Description string `json:"description,omitempty"`
  19051. // Id: [Output Only] The unique identifier for the resource. This
  19052. // identifier is defined by the server.
  19053. Id uint64 `json:"id,omitempty,string"`
  19054. // Kind: [Output Only] Type of the resource. Always
  19055. // compute#networkEndpointGroup for network endpoint group.
  19056. Kind string `json:"kind,omitempty"`
  19057. // LoadBalancer: This field is only valid when the network endpoint
  19058. // group is used for load balancing. [Deprecated] This field is
  19059. // deprecated.
  19060. LoadBalancer *NetworkEndpointGroupLbNetworkEndpointGroup `json:"loadBalancer,omitempty"`
  19061. // Name: Name of the resource; provided by the client when the resource
  19062. // is created. The name must be 1-63 characters long, and comply with
  19063. // RFC1035. Specifically, the name must be 1-63 characters long and
  19064. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19065. // the first character must be a lowercase letter, and all following
  19066. // characters must be a dash, lowercase letter, or digit, except the
  19067. // last character, which cannot be a dash.
  19068. Name string `json:"name,omitempty"`
  19069. // Network: The URL of the network to which all network endpoints in the
  19070. // NEG belong. Uses "default" project network if unspecified.
  19071. Network string `json:"network,omitempty"`
  19072. // NetworkEndpointType: Type of network endpoints in this network
  19073. // endpoint group. Currently the only supported value is GCE_VM_IP_PORT.
  19074. //
  19075. // Possible values:
  19076. // "GCE_VM_IP_PORT"
  19077. // "INTERNET_FQDN_PORT"
  19078. // "INTERNET_IP_PORT"
  19079. // "NON_GCP_PRIVATE_IP_PORT"
  19080. NetworkEndpointType string `json:"networkEndpointType,omitempty"`
  19081. // SelfLink: [Output Only] Server-defined URL for the resource.
  19082. SelfLink string `json:"selfLink,omitempty"`
  19083. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  19084. // with the resource id.
  19085. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  19086. // Size: [Output only] Number of network endpoints in the network
  19087. // endpoint group.
  19088. Size int64 `json:"size,omitempty"`
  19089. // Subnetwork: Optional URL of the subnetwork to which all network
  19090. // endpoints in the NEG belong.
  19091. Subnetwork string `json:"subnetwork,omitempty"`
  19092. // Type: Specify the type of this network endpoint group. Only
  19093. // LOAD_BALANCING is valid for now.
  19094. //
  19095. // Possible values:
  19096. // "LOAD_BALANCING"
  19097. Type string `json:"type,omitempty"`
  19098. // Zone: [Output Only] The URL of the zone where the network endpoint
  19099. // group is located.
  19100. Zone string `json:"zone,omitempty"`
  19101. // ServerResponse contains the HTTP response code and headers from the
  19102. // server.
  19103. googleapi.ServerResponse `json:"-"`
  19104. // ForceSendFields is a list of field names (e.g. "Annotations") to
  19105. // unconditionally include in API requests. By default, fields with
  19106. // empty values are omitted from API requests. However, any non-pointer,
  19107. // non-interface field appearing in ForceSendFields will be sent to the
  19108. // server regardless of whether the field is empty or not. This may be
  19109. // used to include empty fields in Patch requests.
  19110. ForceSendFields []string `json:"-"`
  19111. // NullFields is a list of field names (e.g. "Annotations") to include
  19112. // in API requests with the JSON null value. By default, fields with
  19113. // empty values are omitted from API requests. However, any field with
  19114. // an empty value appearing in NullFields will be sent to the server as
  19115. // null. It is an error if a field in this list has a non-empty value.
  19116. // This may be used to include null fields in Patch requests.
  19117. NullFields []string `json:"-"`
  19118. }
  19119. func (s *NetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  19120. type NoMethod NetworkEndpointGroup
  19121. raw := NoMethod(*s)
  19122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19123. }
  19124. type NetworkEndpointGroupAggregatedList struct {
  19125. // Id: [Output Only] Unique identifier for the resource; defined by the
  19126. // server.
  19127. Id string `json:"id,omitempty"`
  19128. // Items: A list of NetworkEndpointGroupsScopedList resources.
  19129. Items map[string]NetworkEndpointGroupsScopedList `json:"items,omitempty"`
  19130. // Kind: [Output Only] The resource type, which is always
  19131. // compute#networkEndpointGroupAggregatedList for aggregated lists of
  19132. // network endpoint groups.
  19133. Kind string `json:"kind,omitempty"`
  19134. // NextPageToken: [Output Only] This token allows you to get the next
  19135. // page of results for list requests. If the number of results is larger
  19136. // than maxResults, use the nextPageToken as a value for the query
  19137. // parameter pageToken in the next list request. Subsequent list
  19138. // requests will have their own nextPageToken to continue paging through
  19139. // the results.
  19140. NextPageToken string `json:"nextPageToken,omitempty"`
  19141. // SelfLink: [Output Only] Server-defined URL for this resource.
  19142. SelfLink string `json:"selfLink,omitempty"`
  19143. // Warning: [Output Only] Informational warning message.
  19144. Warning *NetworkEndpointGroupAggregatedListWarning `json:"warning,omitempty"`
  19145. // ServerResponse contains the HTTP response code and headers from the
  19146. // server.
  19147. googleapi.ServerResponse `json:"-"`
  19148. // ForceSendFields is a list of field names (e.g. "Id") to
  19149. // unconditionally include in API requests. By default, fields with
  19150. // empty values are omitted from API requests. However, any non-pointer,
  19151. // non-interface field appearing in ForceSendFields will be sent to the
  19152. // server regardless of whether the field is empty or not. This may be
  19153. // used to include empty fields in Patch requests.
  19154. ForceSendFields []string `json:"-"`
  19155. // NullFields is a list of field names (e.g. "Id") to include in API
  19156. // requests with the JSON null value. By default, fields with empty
  19157. // values are omitted from API requests. However, any field with an
  19158. // empty value appearing in NullFields will be sent to the server as
  19159. // null. It is an error if a field in this list has a non-empty value.
  19160. // This may be used to include null fields in Patch requests.
  19161. NullFields []string `json:"-"`
  19162. }
  19163. func (s *NetworkEndpointGroupAggregatedList) MarshalJSON() ([]byte, error) {
  19164. type NoMethod NetworkEndpointGroupAggregatedList
  19165. raw := NoMethod(*s)
  19166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19167. }
  19168. // NetworkEndpointGroupAggregatedListWarning: [Output Only]
  19169. // Informational warning message.
  19170. type NetworkEndpointGroupAggregatedListWarning struct {
  19171. // Code: [Output Only] A warning code, if applicable. For example,
  19172. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19173. // the response.
  19174. //
  19175. // Possible values:
  19176. // "CLEANUP_FAILED"
  19177. // "DEPRECATED_RESOURCE_USED"
  19178. // "DEPRECATED_TYPE_USED"
  19179. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19180. // "EXPERIMENTAL_TYPE_USED"
  19181. // "EXTERNAL_API_WARNING"
  19182. // "FIELD_VALUE_OVERRIDEN"
  19183. // "INJECTED_KERNELS_DEPRECATED"
  19184. // "MISSING_TYPE_DEPENDENCY"
  19185. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19186. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19187. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19188. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19189. // "NEXT_HOP_NOT_RUNNING"
  19190. // "NOT_CRITICAL_ERROR"
  19191. // "NO_RESULTS_ON_PAGE"
  19192. // "REQUIRED_TOS_AGREEMENT"
  19193. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19194. // "RESOURCE_NOT_DELETED"
  19195. // "SCHEMA_VALIDATION_IGNORED"
  19196. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19197. // "UNDECLARED_PROPERTIES"
  19198. // "UNREACHABLE"
  19199. Code string `json:"code,omitempty"`
  19200. // Data: [Output Only] Metadata about this warning in key: value format.
  19201. // For example:
  19202. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19203. Data []*NetworkEndpointGroupAggregatedListWarningData `json:"data,omitempty"`
  19204. // Message: [Output Only] A human-readable description of the warning
  19205. // code.
  19206. Message string `json:"message,omitempty"`
  19207. // ForceSendFields is a list of field names (e.g. "Code") to
  19208. // unconditionally include in API requests. By default, fields with
  19209. // empty values are omitted from API requests. However, any non-pointer,
  19210. // non-interface field appearing in ForceSendFields will be sent to the
  19211. // server regardless of whether the field is empty or not. This may be
  19212. // used to include empty fields in Patch requests.
  19213. ForceSendFields []string `json:"-"`
  19214. // NullFields is a list of field names (e.g. "Code") to include in API
  19215. // requests with the JSON null value. By default, fields with empty
  19216. // values are omitted from API requests. However, any field with an
  19217. // empty value appearing in NullFields will be sent to the server as
  19218. // null. It is an error if a field in this list has a non-empty value.
  19219. // This may be used to include null fields in Patch requests.
  19220. NullFields []string `json:"-"`
  19221. }
  19222. func (s *NetworkEndpointGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  19223. type NoMethod NetworkEndpointGroupAggregatedListWarning
  19224. raw := NoMethod(*s)
  19225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19226. }
  19227. type NetworkEndpointGroupAggregatedListWarningData struct {
  19228. // Key: [Output Only] A key that provides more detail on the warning
  19229. // being returned. For example, for warnings where there are no results
  19230. // in a list request for a particular zone, this key might be scope and
  19231. // the key value might be the zone name. Other examples might be a key
  19232. // indicating a deprecated resource and a suggested replacement, or a
  19233. // warning about invalid network settings (for example, if an instance
  19234. // attempts to perform IP forwarding but is not enabled for IP
  19235. // forwarding).
  19236. Key string `json:"key,omitempty"`
  19237. // Value: [Output Only] A warning data value corresponding to the key.
  19238. Value string `json:"value,omitempty"`
  19239. // ForceSendFields is a list of field names (e.g. "Key") to
  19240. // unconditionally include in API requests. By default, fields with
  19241. // empty values are omitted from API requests. However, any non-pointer,
  19242. // non-interface field appearing in ForceSendFields will be sent to the
  19243. // server regardless of whether the field is empty or not. This may be
  19244. // used to include empty fields in Patch requests.
  19245. ForceSendFields []string `json:"-"`
  19246. // NullFields is a list of field names (e.g. "Key") to include in API
  19247. // requests with the JSON null value. By default, fields with empty
  19248. // values are omitted from API requests. However, any field with an
  19249. // empty value appearing in NullFields will be sent to the server as
  19250. // null. It is an error if a field in this list has a non-empty value.
  19251. // This may be used to include null fields in Patch requests.
  19252. NullFields []string `json:"-"`
  19253. }
  19254. func (s *NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  19255. type NoMethod NetworkEndpointGroupAggregatedListWarningData
  19256. raw := NoMethod(*s)
  19257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19258. }
  19259. // NetworkEndpointGroupLbNetworkEndpointGroup: Load balancing specific
  19260. // fields for network endpoint group.
  19261. type NetworkEndpointGroupLbNetworkEndpointGroup struct {
  19262. // DefaultPort: The default port used if the port number is not
  19263. // specified in the network endpoint. [Deprecated] This field is
  19264. // deprecated.
  19265. DefaultPort int64 `json:"defaultPort,omitempty"`
  19266. // Network: The URL of the network to which all network endpoints in the
  19267. // NEG belong. Uses "default" project network if unspecified.
  19268. // [Deprecated] This field is deprecated.
  19269. Network string `json:"network,omitempty"`
  19270. // Subnetwork: Optional URL of the subnetwork to which all network
  19271. // endpoints in the NEG belong. [Deprecated] This field is deprecated.
  19272. Subnetwork string `json:"subnetwork,omitempty"`
  19273. // Zone: [Output Only] The URL of the zone where the network endpoint
  19274. // group is located. [Deprecated] This field is deprecated.
  19275. Zone string `json:"zone,omitempty"`
  19276. // ForceSendFields is a list of field names (e.g. "DefaultPort") to
  19277. // unconditionally include in API requests. By default, fields with
  19278. // empty values are omitted from API requests. However, any non-pointer,
  19279. // non-interface field appearing in ForceSendFields will be sent to the
  19280. // server regardless of whether the field is empty or not. This may be
  19281. // used to include empty fields in Patch requests.
  19282. ForceSendFields []string `json:"-"`
  19283. // NullFields is a list of field names (e.g. "DefaultPort") to include
  19284. // in API requests with the JSON null value. By default, fields with
  19285. // empty values are omitted from API requests. However, any field with
  19286. // an empty value appearing in NullFields will be sent to the server as
  19287. // null. It is an error if a field in this list has a non-empty value.
  19288. // This may be used to include null fields in Patch requests.
  19289. NullFields []string `json:"-"`
  19290. }
  19291. func (s *NetworkEndpointGroupLbNetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  19292. type NoMethod NetworkEndpointGroupLbNetworkEndpointGroup
  19293. raw := NoMethod(*s)
  19294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19295. }
  19296. type NetworkEndpointGroupList struct {
  19297. // Id: [Output Only] Unique identifier for the resource; defined by the
  19298. // server.
  19299. Id string `json:"id,omitempty"`
  19300. // Items: A list of NetworkEndpointGroup resources.
  19301. Items []*NetworkEndpointGroup `json:"items,omitempty"`
  19302. // Kind: [Output Only] The resource type, which is always
  19303. // compute#networkEndpointGroupList for network endpoint group lists.
  19304. Kind string `json:"kind,omitempty"`
  19305. // NextPageToken: [Output Only] This token allows you to get the next
  19306. // page of results for list requests. If the number of results is larger
  19307. // than maxResults, use the nextPageToken as a value for the query
  19308. // parameter pageToken in the next list request. Subsequent list
  19309. // requests will have their own nextPageToken to continue paging through
  19310. // the results.
  19311. NextPageToken string `json:"nextPageToken,omitempty"`
  19312. // SelfLink: [Output Only] Server-defined URL for this resource.
  19313. SelfLink string `json:"selfLink,omitempty"`
  19314. // Warning: [Output Only] Informational warning message.
  19315. Warning *NetworkEndpointGroupListWarning `json:"warning,omitempty"`
  19316. // ServerResponse contains the HTTP response code and headers from the
  19317. // server.
  19318. googleapi.ServerResponse `json:"-"`
  19319. // ForceSendFields is a list of field names (e.g. "Id") to
  19320. // unconditionally include in API requests. By default, fields with
  19321. // empty values are omitted from API requests. However, any non-pointer,
  19322. // non-interface field appearing in ForceSendFields will be sent to the
  19323. // server regardless of whether the field is empty or not. This may be
  19324. // used to include empty fields in Patch requests.
  19325. ForceSendFields []string `json:"-"`
  19326. // NullFields is a list of field names (e.g. "Id") to include in API
  19327. // requests with the JSON null value. By default, fields with empty
  19328. // values are omitted from API requests. However, any field with an
  19329. // empty value appearing in NullFields will be sent to the server as
  19330. // null. It is an error if a field in this list has a non-empty value.
  19331. // This may be used to include null fields in Patch requests.
  19332. NullFields []string `json:"-"`
  19333. }
  19334. func (s *NetworkEndpointGroupList) MarshalJSON() ([]byte, error) {
  19335. type NoMethod NetworkEndpointGroupList
  19336. raw := NoMethod(*s)
  19337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19338. }
  19339. // NetworkEndpointGroupListWarning: [Output Only] Informational warning
  19340. // message.
  19341. type NetworkEndpointGroupListWarning struct {
  19342. // Code: [Output Only] A warning code, if applicable. For example,
  19343. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19344. // the response.
  19345. //
  19346. // Possible values:
  19347. // "CLEANUP_FAILED"
  19348. // "DEPRECATED_RESOURCE_USED"
  19349. // "DEPRECATED_TYPE_USED"
  19350. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19351. // "EXPERIMENTAL_TYPE_USED"
  19352. // "EXTERNAL_API_WARNING"
  19353. // "FIELD_VALUE_OVERRIDEN"
  19354. // "INJECTED_KERNELS_DEPRECATED"
  19355. // "MISSING_TYPE_DEPENDENCY"
  19356. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19357. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19358. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19359. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19360. // "NEXT_HOP_NOT_RUNNING"
  19361. // "NOT_CRITICAL_ERROR"
  19362. // "NO_RESULTS_ON_PAGE"
  19363. // "REQUIRED_TOS_AGREEMENT"
  19364. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19365. // "RESOURCE_NOT_DELETED"
  19366. // "SCHEMA_VALIDATION_IGNORED"
  19367. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19368. // "UNDECLARED_PROPERTIES"
  19369. // "UNREACHABLE"
  19370. Code string `json:"code,omitempty"`
  19371. // Data: [Output Only] Metadata about this warning in key: value format.
  19372. // For example:
  19373. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19374. Data []*NetworkEndpointGroupListWarningData `json:"data,omitempty"`
  19375. // Message: [Output Only] A human-readable description of the warning
  19376. // code.
  19377. Message string `json:"message,omitempty"`
  19378. // ForceSendFields is a list of field names (e.g. "Code") to
  19379. // unconditionally include in API requests. By default, fields with
  19380. // empty values are omitted from API requests. However, any non-pointer,
  19381. // non-interface field appearing in ForceSendFields will be sent to the
  19382. // server regardless of whether the field is empty or not. This may be
  19383. // used to include empty fields in Patch requests.
  19384. ForceSendFields []string `json:"-"`
  19385. // NullFields is a list of field names (e.g. "Code") to include in API
  19386. // requests with the JSON null value. By default, fields with empty
  19387. // values are omitted from API requests. However, any field with an
  19388. // empty value appearing in NullFields will be sent to the server as
  19389. // null. It is an error if a field in this list has a non-empty value.
  19390. // This may be used to include null fields in Patch requests.
  19391. NullFields []string `json:"-"`
  19392. }
  19393. func (s *NetworkEndpointGroupListWarning) MarshalJSON() ([]byte, error) {
  19394. type NoMethod NetworkEndpointGroupListWarning
  19395. raw := NoMethod(*s)
  19396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19397. }
  19398. type NetworkEndpointGroupListWarningData struct {
  19399. // Key: [Output Only] A key that provides more detail on the warning
  19400. // being returned. For example, for warnings where there are no results
  19401. // in a list request for a particular zone, this key might be scope and
  19402. // the key value might be the zone name. Other examples might be a key
  19403. // indicating a deprecated resource and a suggested replacement, or a
  19404. // warning about invalid network settings (for example, if an instance
  19405. // attempts to perform IP forwarding but is not enabled for IP
  19406. // forwarding).
  19407. Key string `json:"key,omitempty"`
  19408. // Value: [Output Only] A warning data value corresponding to the key.
  19409. Value string `json:"value,omitempty"`
  19410. // ForceSendFields is a list of field names (e.g. "Key") to
  19411. // unconditionally include in API requests. By default, fields with
  19412. // empty values are omitted from API requests. However, any non-pointer,
  19413. // non-interface field appearing in ForceSendFields will be sent to the
  19414. // server regardless of whether the field is empty or not. This may be
  19415. // used to include empty fields in Patch requests.
  19416. ForceSendFields []string `json:"-"`
  19417. // NullFields is a list of field names (e.g. "Key") to include in API
  19418. // requests with the JSON null value. By default, fields with empty
  19419. // values are omitted from API requests. However, any field with an
  19420. // empty value appearing in NullFields will be sent to the server as
  19421. // null. It is an error if a field in this list has a non-empty value.
  19422. // This may be used to include null fields in Patch requests.
  19423. NullFields []string `json:"-"`
  19424. }
  19425. func (s *NetworkEndpointGroupListWarningData) MarshalJSON() ([]byte, error) {
  19426. type NoMethod NetworkEndpointGroupListWarningData
  19427. raw := NoMethod(*s)
  19428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19429. }
  19430. type NetworkEndpointGroupsAttachEndpointsRequest struct {
  19431. // NetworkEndpoints: The list of network endpoints to be attached.
  19432. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  19433. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  19434. // unconditionally include in API requests. By default, fields with
  19435. // empty values are omitted from API requests. However, any non-pointer,
  19436. // non-interface field appearing in ForceSendFields will be sent to the
  19437. // server regardless of whether the field is empty or not. This may be
  19438. // used to include empty fields in Patch requests.
  19439. ForceSendFields []string `json:"-"`
  19440. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  19441. // include in API requests with the JSON null value. By default, fields
  19442. // with empty values are omitted from API requests. However, any field
  19443. // with an empty value appearing in NullFields will be sent to the
  19444. // server as null. It is an error if a field in this list has a
  19445. // non-empty value. This may be used to include null fields in Patch
  19446. // requests.
  19447. NullFields []string `json:"-"`
  19448. }
  19449. func (s *NetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
  19450. type NoMethod NetworkEndpointGroupsAttachEndpointsRequest
  19451. raw := NoMethod(*s)
  19452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19453. }
  19454. type NetworkEndpointGroupsDetachEndpointsRequest struct {
  19455. // NetworkEndpoints: The list of network endpoints to be detached.
  19456. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  19457. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  19458. // unconditionally include in API requests. By default, fields with
  19459. // empty values are omitted from API requests. However, any non-pointer,
  19460. // non-interface field appearing in ForceSendFields will be sent to the
  19461. // server regardless of whether the field is empty or not. This may be
  19462. // used to include empty fields in Patch requests.
  19463. ForceSendFields []string `json:"-"`
  19464. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  19465. // include in API requests with the JSON null value. By default, fields
  19466. // with empty values are omitted from API requests. However, any field
  19467. // with an empty value appearing in NullFields will be sent to the
  19468. // server as null. It is an error if a field in this list has a
  19469. // non-empty value. This may be used to include null fields in Patch
  19470. // requests.
  19471. NullFields []string `json:"-"`
  19472. }
  19473. func (s *NetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
  19474. type NoMethod NetworkEndpointGroupsDetachEndpointsRequest
  19475. raw := NoMethod(*s)
  19476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19477. }
  19478. type NetworkEndpointGroupsListEndpointsRequest struct {
  19479. // EndpointFilters: Optional list of endpoints to query. This is a more
  19480. // efficient but also limited version of filter parameter. Endpoints in
  19481. // the filter must have ip_address and port fields populated, other
  19482. // fields are not supported.
  19483. EndpointFilters []*NetworkEndpointGroupsListEndpointsRequestNetworkEndpointFilter `json:"endpointFilters,omitempty"`
  19484. // HealthStatus: Optional query parameter for showing the health status
  19485. // of each network endpoint. Valid options are SKIP or SHOW. If you
  19486. // don't specifiy this parameter, the health status of network endpoints
  19487. // will not be provided.
  19488. //
  19489. // Possible values:
  19490. // "SHOW"
  19491. // "SKIP"
  19492. HealthStatus string `json:"healthStatus,omitempty"`
  19493. // ForceSendFields is a list of field names (e.g. "EndpointFilters") to
  19494. // unconditionally include in API requests. By default, fields with
  19495. // empty values are omitted from API requests. However, any non-pointer,
  19496. // non-interface field appearing in ForceSendFields will be sent to the
  19497. // server regardless of whether the field is empty or not. This may be
  19498. // used to include empty fields in Patch requests.
  19499. ForceSendFields []string `json:"-"`
  19500. // NullFields is a list of field names (e.g. "EndpointFilters") to
  19501. // include in API requests with the JSON null value. By default, fields
  19502. // with empty values are omitted from API requests. However, any field
  19503. // with an empty value appearing in NullFields will be sent to the
  19504. // server as null. It is an error if a field in this list has a
  19505. // non-empty value. This may be used to include null fields in Patch
  19506. // requests.
  19507. NullFields []string `json:"-"`
  19508. }
  19509. func (s *NetworkEndpointGroupsListEndpointsRequest) MarshalJSON() ([]byte, error) {
  19510. type NoMethod NetworkEndpointGroupsListEndpointsRequest
  19511. raw := NoMethod(*s)
  19512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19513. }
  19514. type NetworkEndpointGroupsListEndpointsRequestNetworkEndpointFilter struct {
  19515. NetworkEndpoint *NetworkEndpoint `json:"networkEndpoint,omitempty"`
  19516. // ForceSendFields is a list of field names (e.g. "NetworkEndpoint") to
  19517. // unconditionally include in API requests. By default, fields with
  19518. // empty values are omitted from API requests. However, any non-pointer,
  19519. // non-interface field appearing in ForceSendFields will be sent to the
  19520. // server regardless of whether the field is empty or not. This may be
  19521. // used to include empty fields in Patch requests.
  19522. ForceSendFields []string `json:"-"`
  19523. // NullFields is a list of field names (e.g. "NetworkEndpoint") to
  19524. // include in API requests with the JSON null value. By default, fields
  19525. // with empty values are omitted from API requests. However, any field
  19526. // with an empty value appearing in NullFields will be sent to the
  19527. // server as null. It is an error if a field in this list has a
  19528. // non-empty value. This may be used to include null fields in Patch
  19529. // requests.
  19530. NullFields []string `json:"-"`
  19531. }
  19532. func (s *NetworkEndpointGroupsListEndpointsRequestNetworkEndpointFilter) MarshalJSON() ([]byte, error) {
  19533. type NoMethod NetworkEndpointGroupsListEndpointsRequestNetworkEndpointFilter
  19534. raw := NoMethod(*s)
  19535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19536. }
  19537. type NetworkEndpointGroupsListNetworkEndpoints struct {
  19538. // Id: [Output Only] Unique identifier for the resource; defined by the
  19539. // server.
  19540. Id string `json:"id,omitempty"`
  19541. // Items: A list of NetworkEndpointWithHealthStatus resources.
  19542. Items []*NetworkEndpointWithHealthStatus `json:"items,omitempty"`
  19543. // Kind: [Output Only] The resource type, which is always
  19544. // compute#networkEndpointGroupsListNetworkEndpoints for the list of
  19545. // network endpoints in the specified network endpoint group.
  19546. Kind string `json:"kind,omitempty"`
  19547. // NextPageToken: [Output Only] This token allows you to get the next
  19548. // page of results for list requests. If the number of results is larger
  19549. // than maxResults, use the nextPageToken as a value for the query
  19550. // parameter pageToken in the next list request. Subsequent list
  19551. // requests will have their own nextPageToken to continue paging through
  19552. // the results.
  19553. NextPageToken string `json:"nextPageToken,omitempty"`
  19554. // Warning: [Output Only] Informational warning message.
  19555. Warning *NetworkEndpointGroupsListNetworkEndpointsWarning `json:"warning,omitempty"`
  19556. // ServerResponse contains the HTTP response code and headers from the
  19557. // server.
  19558. googleapi.ServerResponse `json:"-"`
  19559. // ForceSendFields is a list of field names (e.g. "Id") to
  19560. // unconditionally include in API requests. By default, fields with
  19561. // empty values are omitted from API requests. However, any non-pointer,
  19562. // non-interface field appearing in ForceSendFields will be sent to the
  19563. // server regardless of whether the field is empty or not. This may be
  19564. // used to include empty fields in Patch requests.
  19565. ForceSendFields []string `json:"-"`
  19566. // NullFields is a list of field names (e.g. "Id") to include in API
  19567. // requests with the JSON null value. By default, fields with empty
  19568. // values are omitted from API requests. However, any field with an
  19569. // empty value appearing in NullFields will be sent to the server as
  19570. // null. It is an error if a field in this list has a non-empty value.
  19571. // This may be used to include null fields in Patch requests.
  19572. NullFields []string `json:"-"`
  19573. }
  19574. func (s *NetworkEndpointGroupsListNetworkEndpoints) MarshalJSON() ([]byte, error) {
  19575. type NoMethod NetworkEndpointGroupsListNetworkEndpoints
  19576. raw := NoMethod(*s)
  19577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19578. }
  19579. // NetworkEndpointGroupsListNetworkEndpointsWarning: [Output Only]
  19580. // Informational warning message.
  19581. type NetworkEndpointGroupsListNetworkEndpointsWarning struct {
  19582. // Code: [Output Only] A warning code, if applicable. For example,
  19583. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19584. // the response.
  19585. //
  19586. // Possible values:
  19587. // "CLEANUP_FAILED"
  19588. // "DEPRECATED_RESOURCE_USED"
  19589. // "DEPRECATED_TYPE_USED"
  19590. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19591. // "EXPERIMENTAL_TYPE_USED"
  19592. // "EXTERNAL_API_WARNING"
  19593. // "FIELD_VALUE_OVERRIDEN"
  19594. // "INJECTED_KERNELS_DEPRECATED"
  19595. // "MISSING_TYPE_DEPENDENCY"
  19596. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19597. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19598. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19599. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19600. // "NEXT_HOP_NOT_RUNNING"
  19601. // "NOT_CRITICAL_ERROR"
  19602. // "NO_RESULTS_ON_PAGE"
  19603. // "REQUIRED_TOS_AGREEMENT"
  19604. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19605. // "RESOURCE_NOT_DELETED"
  19606. // "SCHEMA_VALIDATION_IGNORED"
  19607. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19608. // "UNDECLARED_PROPERTIES"
  19609. // "UNREACHABLE"
  19610. Code string `json:"code,omitempty"`
  19611. // Data: [Output Only] Metadata about this warning in key: value format.
  19612. // For example:
  19613. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19614. Data []*NetworkEndpointGroupsListNetworkEndpointsWarningData `json:"data,omitempty"`
  19615. // Message: [Output Only] A human-readable description of the warning
  19616. // code.
  19617. Message string `json:"message,omitempty"`
  19618. // ForceSendFields is a list of field names (e.g. "Code") to
  19619. // unconditionally include in API requests. By default, fields with
  19620. // empty values are omitted from API requests. However, any non-pointer,
  19621. // non-interface field appearing in ForceSendFields will be sent to the
  19622. // server regardless of whether the field is empty or not. This may be
  19623. // used to include empty fields in Patch requests.
  19624. ForceSendFields []string `json:"-"`
  19625. // NullFields is a list of field names (e.g. "Code") to include in API
  19626. // requests with the JSON null value. By default, fields with empty
  19627. // values are omitted from API requests. However, any field with an
  19628. // empty value appearing in NullFields will be sent to the server as
  19629. // null. It is an error if a field in this list has a non-empty value.
  19630. // This may be used to include null fields in Patch requests.
  19631. NullFields []string `json:"-"`
  19632. }
  19633. func (s *NetworkEndpointGroupsListNetworkEndpointsWarning) MarshalJSON() ([]byte, error) {
  19634. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarning
  19635. raw := NoMethod(*s)
  19636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19637. }
  19638. type NetworkEndpointGroupsListNetworkEndpointsWarningData struct {
  19639. // Key: [Output Only] A key that provides more detail on the warning
  19640. // being returned. For example, for warnings where there are no results
  19641. // in a list request for a particular zone, this key might be scope and
  19642. // the key value might be the zone name. Other examples might be a key
  19643. // indicating a deprecated resource and a suggested replacement, or a
  19644. // warning about invalid network settings (for example, if an instance
  19645. // attempts to perform IP forwarding but is not enabled for IP
  19646. // forwarding).
  19647. Key string `json:"key,omitempty"`
  19648. // Value: [Output Only] A warning data value corresponding to the key.
  19649. Value string `json:"value,omitempty"`
  19650. // ForceSendFields is a list of field names (e.g. "Key") to
  19651. // unconditionally include in API requests. By default, fields with
  19652. // empty values are omitted from API requests. However, any non-pointer,
  19653. // non-interface field appearing in ForceSendFields will be sent to the
  19654. // server regardless of whether the field is empty or not. This may be
  19655. // used to include empty fields in Patch requests.
  19656. ForceSendFields []string `json:"-"`
  19657. // NullFields is a list of field names (e.g. "Key") to include in API
  19658. // requests with the JSON null value. By default, fields with empty
  19659. // values are omitted from API requests. However, any field with an
  19660. // empty value appearing in NullFields will be sent to the server as
  19661. // null. It is an error if a field in this list has a non-empty value.
  19662. // This may be used to include null fields in Patch requests.
  19663. NullFields []string `json:"-"`
  19664. }
  19665. func (s *NetworkEndpointGroupsListNetworkEndpointsWarningData) MarshalJSON() ([]byte, error) {
  19666. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarningData
  19667. raw := NoMethod(*s)
  19668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19669. }
  19670. type NetworkEndpointGroupsScopedList struct {
  19671. // NetworkEndpointGroups: [Output Only] The list of network endpoint
  19672. // groups that are contained in this scope.
  19673. NetworkEndpointGroups []*NetworkEndpointGroup `json:"networkEndpointGroups,omitempty"`
  19674. // Warning: [Output Only] An informational warning that replaces the
  19675. // list of network endpoint groups when the list is empty.
  19676. Warning *NetworkEndpointGroupsScopedListWarning `json:"warning,omitempty"`
  19677. // ForceSendFields is a list of field names (e.g.
  19678. // "NetworkEndpointGroups") to unconditionally include in API requests.
  19679. // By default, fields with empty values are omitted from API requests.
  19680. // However, any non-pointer, non-interface field appearing in
  19681. // ForceSendFields will be sent to the server regardless of whether the
  19682. // field is empty or not. This may be used to include empty fields in
  19683. // Patch requests.
  19684. ForceSendFields []string `json:"-"`
  19685. // NullFields is a list of field names (e.g. "NetworkEndpointGroups") to
  19686. // include in API requests with the JSON null value. By default, fields
  19687. // with empty values are omitted from API requests. However, any field
  19688. // with an empty value appearing in NullFields will be sent to the
  19689. // server as null. It is an error if a field in this list has a
  19690. // non-empty value. This may be used to include null fields in Patch
  19691. // requests.
  19692. NullFields []string `json:"-"`
  19693. }
  19694. func (s *NetworkEndpointGroupsScopedList) MarshalJSON() ([]byte, error) {
  19695. type NoMethod NetworkEndpointGroupsScopedList
  19696. raw := NoMethod(*s)
  19697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19698. }
  19699. // NetworkEndpointGroupsScopedListWarning: [Output Only] An
  19700. // informational warning that replaces the list of network endpoint
  19701. // groups when the list is empty.
  19702. type NetworkEndpointGroupsScopedListWarning struct {
  19703. // Code: [Output Only] A warning code, if applicable. For example,
  19704. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19705. // the response.
  19706. //
  19707. // Possible values:
  19708. // "CLEANUP_FAILED"
  19709. // "DEPRECATED_RESOURCE_USED"
  19710. // "DEPRECATED_TYPE_USED"
  19711. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19712. // "EXPERIMENTAL_TYPE_USED"
  19713. // "EXTERNAL_API_WARNING"
  19714. // "FIELD_VALUE_OVERRIDEN"
  19715. // "INJECTED_KERNELS_DEPRECATED"
  19716. // "MISSING_TYPE_DEPENDENCY"
  19717. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19718. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19719. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19720. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19721. // "NEXT_HOP_NOT_RUNNING"
  19722. // "NOT_CRITICAL_ERROR"
  19723. // "NO_RESULTS_ON_PAGE"
  19724. // "REQUIRED_TOS_AGREEMENT"
  19725. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19726. // "RESOURCE_NOT_DELETED"
  19727. // "SCHEMA_VALIDATION_IGNORED"
  19728. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19729. // "UNDECLARED_PROPERTIES"
  19730. // "UNREACHABLE"
  19731. Code string `json:"code,omitempty"`
  19732. // Data: [Output Only] Metadata about this warning in key: value format.
  19733. // For example:
  19734. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19735. Data []*NetworkEndpointGroupsScopedListWarningData `json:"data,omitempty"`
  19736. // Message: [Output Only] A human-readable description of the warning
  19737. // code.
  19738. Message string `json:"message,omitempty"`
  19739. // ForceSendFields is a list of field names (e.g. "Code") to
  19740. // unconditionally include in API requests. By default, fields with
  19741. // empty values are omitted from API requests. However, any non-pointer,
  19742. // non-interface field appearing in ForceSendFields will be sent to the
  19743. // server regardless of whether the field is empty or not. This may be
  19744. // used to include empty fields in Patch requests.
  19745. ForceSendFields []string `json:"-"`
  19746. // NullFields is a list of field names (e.g. "Code") to include in API
  19747. // requests with the JSON null value. By default, fields with empty
  19748. // values are omitted from API requests. However, any field with an
  19749. // empty value appearing in NullFields will be sent to the server as
  19750. // null. It is an error if a field in this list has a non-empty value.
  19751. // This may be used to include null fields in Patch requests.
  19752. NullFields []string `json:"-"`
  19753. }
  19754. func (s *NetworkEndpointGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  19755. type NoMethod NetworkEndpointGroupsScopedListWarning
  19756. raw := NoMethod(*s)
  19757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19758. }
  19759. type NetworkEndpointGroupsScopedListWarningData struct {
  19760. // Key: [Output Only] A key that provides more detail on the warning
  19761. // being returned. For example, for warnings where there are no results
  19762. // in a list request for a particular zone, this key might be scope and
  19763. // the key value might be the zone name. Other examples might be a key
  19764. // indicating a deprecated resource and a suggested replacement, or a
  19765. // warning about invalid network settings (for example, if an instance
  19766. // attempts to perform IP forwarding but is not enabled for IP
  19767. // forwarding).
  19768. Key string `json:"key,omitempty"`
  19769. // Value: [Output Only] A warning data value corresponding to the key.
  19770. Value string `json:"value,omitempty"`
  19771. // ForceSendFields is a list of field names (e.g. "Key") to
  19772. // unconditionally include in API requests. By default, fields with
  19773. // empty values are omitted from API requests. However, any non-pointer,
  19774. // non-interface field appearing in ForceSendFields will be sent to the
  19775. // server regardless of whether the field is empty or not. This may be
  19776. // used to include empty fields in Patch requests.
  19777. ForceSendFields []string `json:"-"`
  19778. // NullFields is a list of field names (e.g. "Key") to include in API
  19779. // requests with the JSON null value. By default, fields with empty
  19780. // values are omitted from API requests. However, any field with an
  19781. // empty value appearing in NullFields will be sent to the server as
  19782. // null. It is an error if a field in this list has a non-empty value.
  19783. // This may be used to include null fields in Patch requests.
  19784. NullFields []string `json:"-"`
  19785. }
  19786. func (s *NetworkEndpointGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  19787. type NoMethod NetworkEndpointGroupsScopedListWarningData
  19788. raw := NoMethod(*s)
  19789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19790. }
  19791. type NetworkEndpointWithHealthStatus struct {
  19792. // Healths: [Output only] The health status of network endpoint;
  19793. Healths []*HealthStatusForNetworkEndpoint `json:"healths,omitempty"`
  19794. // NetworkEndpoint: [Output only] The network endpoint;
  19795. NetworkEndpoint *NetworkEndpoint `json:"networkEndpoint,omitempty"`
  19796. // ForceSendFields is a list of field names (e.g. "Healths") to
  19797. // unconditionally include in API requests. By default, fields with
  19798. // empty values are omitted from API requests. However, any non-pointer,
  19799. // non-interface field appearing in ForceSendFields will be sent to the
  19800. // server regardless of whether the field is empty or not. This may be
  19801. // used to include empty fields in Patch requests.
  19802. ForceSendFields []string `json:"-"`
  19803. // NullFields is a list of field names (e.g. "Healths") to include in
  19804. // API requests with the JSON null value. By default, fields with empty
  19805. // values are omitted from API requests. However, any field with an
  19806. // empty value appearing in NullFields will be sent to the server as
  19807. // null. It is an error if a field in this list has a non-empty value.
  19808. // This may be used to include null fields in Patch requests.
  19809. NullFields []string `json:"-"`
  19810. }
  19811. func (s *NetworkEndpointWithHealthStatus) MarshalJSON() ([]byte, error) {
  19812. type NoMethod NetworkEndpointWithHealthStatus
  19813. raw := NoMethod(*s)
  19814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19815. }
  19816. // NetworkInterface: A network interface resource attached to an
  19817. // instance.
  19818. type NetworkInterface struct {
  19819. // AccessConfigs: An array of configurations for this interface.
  19820. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  19821. // there are no accessConfigs specified, then this instance will have no
  19822. // external internet access.
  19823. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  19824. // AliasIpRanges: An array of alias IP ranges for this network
  19825. // interface. Can only be specified for network interfaces on
  19826. // subnet-mode networks.
  19827. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  19828. // Fingerprint: Fingerprint hash of contents stored in this network
  19829. // interface. This field will be ignored when inserting an Instance or
  19830. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  19831. // in order to update the NetworkInterface, otherwise the request will
  19832. // fail with error 412 conditionNotMet.
  19833. Fingerprint string `json:"fingerprint,omitempty"`
  19834. // Ipv6Address: [Output Only] An IPv6 internal network address for this
  19835. // network interface.
  19836. Ipv6Address string `json:"ipv6Address,omitempty"`
  19837. // Kind: [Output Only] Type of the resource. Always
  19838. // compute#networkInterface for network interfaces.
  19839. Kind string `json:"kind,omitempty"`
  19840. // Name: [Output Only] The name of the network interface, generated by
  19841. // the server. For network devices, these are eth0, eth1, etc.
  19842. Name string `json:"name,omitempty"`
  19843. // Network: URL of the network resource for this instance. When creating
  19844. // an instance, if neither the network nor the subnetwork is specified,
  19845. // the default network global/networks/default is used; if the network
  19846. // is not specified but the subnetwork is specified, the network is
  19847. // inferred.
  19848. //
  19849. // This field is optional when creating a firewall rule. If not
  19850. // specified when creating a firewall rule, the default network
  19851. // global/networks/default is used.
  19852. //
  19853. // If you specify this property, you can specify the network as a full
  19854. // or partial URL. For example, the following are all valid URLs:
  19855. // -
  19856. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  19857. // - projects/project/global/networks/network
  19858. // - global/networks/default
  19859. Network string `json:"network,omitempty"`
  19860. // NetworkIP: An IPv4 internal network address to assign to the instance
  19861. // for this network interface. If not specified by the user, an unused
  19862. // internal IP is assigned by the system.
  19863. NetworkIP string `json:"networkIP,omitempty"`
  19864. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  19865. // the network resource is in legacy mode, do not provide this property.
  19866. // If the network is in auto subnet mode, providing the subnetwork is
  19867. // optional. If the network is in custom subnet mode, then this field
  19868. // should be specified. If you specify this property, you can specify
  19869. // the subnetwork as a full or partial URL. For example, the following
  19870. // are all valid URLs:
  19871. // -
  19872. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  19873. // - regions/region/subnetworks/subnetwork
  19874. Subnetwork string `json:"subnetwork,omitempty"`
  19875. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  19876. // unconditionally include in API requests. By default, fields with
  19877. // empty values are omitted from API requests. However, any non-pointer,
  19878. // non-interface field appearing in ForceSendFields will be sent to the
  19879. // server regardless of whether the field is empty or not. This may be
  19880. // used to include empty fields in Patch requests.
  19881. ForceSendFields []string `json:"-"`
  19882. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  19883. // in API requests with the JSON null value. By default, fields with
  19884. // empty values are omitted from API requests. However, any field with
  19885. // an empty value appearing in NullFields will be sent to the server as
  19886. // null. It is an error if a field in this list has a non-empty value.
  19887. // This may be used to include null fields in Patch requests.
  19888. NullFields []string `json:"-"`
  19889. }
  19890. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  19891. type NoMethod NetworkInterface
  19892. raw := NoMethod(*s)
  19893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19894. }
  19895. // NetworkList: Contains a list of networks.
  19896. type NetworkList struct {
  19897. // Id: [Output Only] Unique identifier for the resource; defined by the
  19898. // server.
  19899. Id string `json:"id,omitempty"`
  19900. // Items: A list of Network resources.
  19901. Items []*Network `json:"items,omitempty"`
  19902. // Kind: [Output Only] Type of resource. Always compute#networkList for
  19903. // lists of networks.
  19904. Kind string `json:"kind,omitempty"`
  19905. // NextPageToken: [Output Only] This token allows you to get the next
  19906. // page of results for list requests. If the number of results is larger
  19907. // than maxResults, use the nextPageToken as a value for the query
  19908. // parameter pageToken in the next list request. Subsequent list
  19909. // requests will have their own nextPageToken to continue paging through
  19910. // the results.
  19911. NextPageToken string `json:"nextPageToken,omitempty"`
  19912. // SelfLink: [Output Only] Server-defined URL for this resource.
  19913. SelfLink string `json:"selfLink,omitempty"`
  19914. // Warning: [Output Only] Informational warning message.
  19915. Warning *NetworkListWarning `json:"warning,omitempty"`
  19916. // ServerResponse contains the HTTP response code and headers from the
  19917. // server.
  19918. googleapi.ServerResponse `json:"-"`
  19919. // ForceSendFields is a list of field names (e.g. "Id") to
  19920. // unconditionally include in API requests. By default, fields with
  19921. // empty values are omitted from API requests. However, any non-pointer,
  19922. // non-interface field appearing in ForceSendFields will be sent to the
  19923. // server regardless of whether the field is empty or not. This may be
  19924. // used to include empty fields in Patch requests.
  19925. ForceSendFields []string `json:"-"`
  19926. // NullFields is a list of field names (e.g. "Id") to include in API
  19927. // requests with the JSON null value. By default, fields with empty
  19928. // values are omitted from API requests. However, any field with an
  19929. // empty value appearing in NullFields will be sent to the server as
  19930. // null. It is an error if a field in this list has a non-empty value.
  19931. // This may be used to include null fields in Patch requests.
  19932. NullFields []string `json:"-"`
  19933. }
  19934. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  19935. type NoMethod NetworkList
  19936. raw := NoMethod(*s)
  19937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19938. }
  19939. // NetworkListWarning: [Output Only] Informational warning message.
  19940. type NetworkListWarning struct {
  19941. // Code: [Output Only] A warning code, if applicable. For example,
  19942. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19943. // the response.
  19944. //
  19945. // Possible values:
  19946. // "CLEANUP_FAILED"
  19947. // "DEPRECATED_RESOURCE_USED"
  19948. // "DEPRECATED_TYPE_USED"
  19949. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19950. // "EXPERIMENTAL_TYPE_USED"
  19951. // "EXTERNAL_API_WARNING"
  19952. // "FIELD_VALUE_OVERRIDEN"
  19953. // "INJECTED_KERNELS_DEPRECATED"
  19954. // "MISSING_TYPE_DEPENDENCY"
  19955. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19956. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19957. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19958. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19959. // "NEXT_HOP_NOT_RUNNING"
  19960. // "NOT_CRITICAL_ERROR"
  19961. // "NO_RESULTS_ON_PAGE"
  19962. // "REQUIRED_TOS_AGREEMENT"
  19963. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19964. // "RESOURCE_NOT_DELETED"
  19965. // "SCHEMA_VALIDATION_IGNORED"
  19966. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19967. // "UNDECLARED_PROPERTIES"
  19968. // "UNREACHABLE"
  19969. Code string `json:"code,omitempty"`
  19970. // Data: [Output Only] Metadata about this warning in key: value format.
  19971. // For example:
  19972. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19973. Data []*NetworkListWarningData `json:"data,omitempty"`
  19974. // Message: [Output Only] A human-readable description of the warning
  19975. // code.
  19976. Message string `json:"message,omitempty"`
  19977. // ForceSendFields is a list of field names (e.g. "Code") to
  19978. // unconditionally include in API requests. By default, fields with
  19979. // empty values are omitted from API requests. However, any non-pointer,
  19980. // non-interface field appearing in ForceSendFields will be sent to the
  19981. // server regardless of whether the field is empty or not. This may be
  19982. // used to include empty fields in Patch requests.
  19983. ForceSendFields []string `json:"-"`
  19984. // NullFields is a list of field names (e.g. "Code") to include in API
  19985. // requests with the JSON null value. By default, fields with empty
  19986. // values are omitted from API requests. However, any field with an
  19987. // empty value appearing in NullFields will be sent to the server as
  19988. // null. It is an error if a field in this list has a non-empty value.
  19989. // This may be used to include null fields in Patch requests.
  19990. NullFields []string `json:"-"`
  19991. }
  19992. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  19993. type NoMethod NetworkListWarning
  19994. raw := NoMethod(*s)
  19995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19996. }
  19997. type NetworkListWarningData struct {
  19998. // Key: [Output Only] A key that provides more detail on the warning
  19999. // being returned. For example, for warnings where there are no results
  20000. // in a list request for a particular zone, this key might be scope and
  20001. // the key value might be the zone name. Other examples might be a key
  20002. // indicating a deprecated resource and a suggested replacement, or a
  20003. // warning about invalid network settings (for example, if an instance
  20004. // attempts to perform IP forwarding but is not enabled for IP
  20005. // forwarding).
  20006. Key string `json:"key,omitempty"`
  20007. // Value: [Output Only] A warning data value corresponding to the key.
  20008. Value string `json:"value,omitempty"`
  20009. // ForceSendFields is a list of field names (e.g. "Key") to
  20010. // unconditionally include in API requests. By default, fields with
  20011. // empty values are omitted from API requests. However, any non-pointer,
  20012. // non-interface field appearing in ForceSendFields will be sent to the
  20013. // server regardless of whether the field is empty or not. This may be
  20014. // used to include empty fields in Patch requests.
  20015. ForceSendFields []string `json:"-"`
  20016. // NullFields is a list of field names (e.g. "Key") to include in API
  20017. // requests with the JSON null value. By default, fields with empty
  20018. // values are omitted from API requests. However, any field with an
  20019. // empty value appearing in NullFields will be sent to the server as
  20020. // null. It is an error if a field in this list has a non-empty value.
  20021. // This may be used to include null fields in Patch requests.
  20022. NullFields []string `json:"-"`
  20023. }
  20024. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  20025. type NoMethod NetworkListWarningData
  20026. raw := NoMethod(*s)
  20027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20028. }
  20029. // NetworkPeering: A network peering attached to a network resource. The
  20030. // message includes the peering name, peer network, peering state, and a
  20031. // flag indicating whether Google Compute Engine should automatically
  20032. // create routes for the peering.
  20033. type NetworkPeering struct {
  20034. // AdvertisePeerSubnetsViaRouters: Whether Cloud Routers in this network
  20035. // can automatically advertise subnets from the peer network.
  20036. AdvertisePeerSubnetsViaRouters bool `json:"advertisePeerSubnetsViaRouters,omitempty"`
  20037. // AutoCreateRoutes: This field will be deprecated soon. Prefer using
  20038. // exchange_subnet_routes instead. Indicates whether full mesh
  20039. // connectivity is created and managed automatically. When it is set to
  20040. // true, Google Compute Engine will automatically create and manage the
  20041. // routes between two networks when the state is ACTIVE. Otherwise, user
  20042. // needs to create routes manually to route packets to peer network.
  20043. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  20044. // ExchangeSubnetRoutes: Whether full mesh connectivity is created and
  20045. // managed automatically. When it is set to true, Google Compute Engine
  20046. // will automatically create and manage the routes between two networks
  20047. // when the peering state is ACTIVE. Otherwise, user needs to create
  20048. // routes manually to route packets to peer network.
  20049. ExchangeSubnetRoutes bool `json:"exchangeSubnetRoutes,omitempty"`
  20050. // ExportCustomRoutes: Whether to export the custom routes to peer
  20051. // network.
  20052. ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
  20053. // ExportSubnetRoutesWithPublicIp: Whether subnet routes with public IP
  20054. // range are exported. The default value is true, all subnet routes are
  20055. // exported. The IPv4 special-use ranges
  20056. // (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always
  20057. // exported to peers and are not controlled by this field.
  20058. ExportSubnetRoutesWithPublicIp bool `json:"exportSubnetRoutesWithPublicIp,omitempty"`
  20059. // ImportCustomRoutes: Whether to import the custom routes from peer
  20060. // network.
  20061. ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
  20062. // ImportSubnetRoutesWithPublicIp: Whether subnet routes with public IP
  20063. // range are imported. The default value is false. The IPv4 special-use
  20064. // ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are
  20065. // always imported from peers and are not controlled by this field.
  20066. ImportSubnetRoutesWithPublicIp bool `json:"importSubnetRoutesWithPublicIp,omitempty"`
  20067. // Name: Name of this peering. Provided by the client when the peering
  20068. // is created. The name must comply with RFC1035. Specifically, the name
  20069. // must be 1-63 characters long and match regular expression
  20070. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  20071. // a lowercase letter, and all the following characters must be a dash,
  20072. // lowercase letter, or digit, except the last character, which cannot
  20073. // be a dash.
  20074. Name string `json:"name,omitempty"`
  20075. // Network: The URL of the peer network. It can be either full URL or
  20076. // partial URL. The peer network may belong to a different project. If
  20077. // the partial URL does not contain project, it is assumed that the peer
  20078. // network is in the same project as the current network.
  20079. Network string `json:"network,omitempty"`
  20080. // PeerMtu: Maximum Transmission Unit in bytes.
  20081. PeerMtu int64 `json:"peerMtu,omitempty"`
  20082. // State: [Output Only] State for the peering.
  20083. //
  20084. // Possible values:
  20085. // "ACTIVE"
  20086. // "INACTIVE"
  20087. State string `json:"state,omitempty"`
  20088. // StateDetails: [Output Only] Details about the current state of the
  20089. // peering.
  20090. StateDetails string `json:"stateDetails,omitempty"`
  20091. // ForceSendFields is a list of field names (e.g.
  20092. // "AdvertisePeerSubnetsViaRouters") to unconditionally include in API
  20093. // requests. By default, fields with empty values are omitted from API
  20094. // requests. However, any non-pointer, non-interface field appearing in
  20095. // ForceSendFields will be sent to the server regardless of whether the
  20096. // field is empty or not. This may be used to include empty fields in
  20097. // Patch requests.
  20098. ForceSendFields []string `json:"-"`
  20099. // NullFields is a list of field names (e.g.
  20100. // "AdvertisePeerSubnetsViaRouters") to include in API requests with the
  20101. // JSON null value. By default, fields with empty values are omitted
  20102. // from API requests. However, any field with an empty value appearing
  20103. // in NullFields will be sent to the server as null. It is an error if a
  20104. // field in this list has a non-empty value. This may be used to include
  20105. // null fields in Patch requests.
  20106. NullFields []string `json:"-"`
  20107. }
  20108. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  20109. type NoMethod NetworkPeering
  20110. raw := NoMethod(*s)
  20111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20112. }
  20113. // NetworkRoutingConfig: A routing configuration attached to a network
  20114. // resource. The message includes the list of routers associated with
  20115. // the network, and a flag indicating the type of routing behavior to
  20116. // enforce network-wide.
  20117. type NetworkRoutingConfig struct {
  20118. // RoutingMode: The network-wide routing mode to use. If set to
  20119. // REGIONAL, this network's cloud routers will only advertise routes
  20120. // with subnets of this network in the same region as the router. If set
  20121. // to GLOBAL, this network's cloud routers will advertise routes with
  20122. // all subnets of this network, across regions.
  20123. //
  20124. // Possible values:
  20125. // "GLOBAL"
  20126. // "REGIONAL"
  20127. RoutingMode string `json:"routingMode,omitempty"`
  20128. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  20129. // unconditionally include in API requests. By default, fields with
  20130. // empty values are omitted from API requests. However, any non-pointer,
  20131. // non-interface field appearing in ForceSendFields will be sent to the
  20132. // server regardless of whether the field is empty or not. This may be
  20133. // used to include empty fields in Patch requests.
  20134. ForceSendFields []string `json:"-"`
  20135. // NullFields is a list of field names (e.g. "RoutingMode") to include
  20136. // in API requests with the JSON null value. By default, fields with
  20137. // empty values are omitted from API requests. However, any field with
  20138. // an empty value appearing in NullFields will be sent to the server as
  20139. // null. It is an error if a field in this list has a non-empty value.
  20140. // This may be used to include null fields in Patch requests.
  20141. NullFields []string `json:"-"`
  20142. }
  20143. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  20144. type NoMethod NetworkRoutingConfig
  20145. raw := NoMethod(*s)
  20146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20147. }
  20148. type NetworksAddPeeringRequest struct {
  20149. // AutoCreateRoutes: This field will be deprecated soon. Prefer using
  20150. // exchange_subnet_routes in network_peering instead. Whether Google
  20151. // Compute Engine manages the routes automatically.
  20152. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  20153. // ExportCustomRoutes: This field will be deprecated soon. Prefer using
  20154. // export_custom_routes in network_peering instead. Whether to export
  20155. // the custom routes to peer network.
  20156. ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
  20157. // ImportCustomRoutes: This field will be deprecated soon. Prefer using
  20158. // import_custom_routes in network_peering instead. Whether to import
  20159. // the custom routes from peer network.
  20160. ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
  20161. // Name: Name of the peering, which should conform to RFC1035.
  20162. Name string `json:"name,omitempty"`
  20163. // NetworkPeering: Network peering parameters. In order to specify route
  20164. // policies for peering using import/export custom routes, you will have
  20165. // to fill all peering related parameters (name, peer network,
  20166. // exchange_subnet_routes) in network_peeringfield. Corresponding fields
  20167. // in NetworksAddPeeringRequest will be deprecated soon.
  20168. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  20169. // PeerNetwork: URL of the peer network. It can be either full URL or
  20170. // partial URL. The peer network may belong to a different project. If
  20171. // the partial URL does not contain project, it is assumed that the peer
  20172. // network is in the same project as the current network.
  20173. PeerNetwork string `json:"peerNetwork,omitempty"`
  20174. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  20175. // unconditionally include in API requests. By default, fields with
  20176. // empty values are omitted from API requests. However, any non-pointer,
  20177. // non-interface field appearing in ForceSendFields will be sent to the
  20178. // server regardless of whether the field is empty or not. This may be
  20179. // used to include empty fields in Patch requests.
  20180. ForceSendFields []string `json:"-"`
  20181. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  20182. // include in API requests with the JSON null value. By default, fields
  20183. // with empty values are omitted from API requests. However, any field
  20184. // with an empty value appearing in NullFields will be sent to the
  20185. // server as null. It is an error if a field in this list has a
  20186. // non-empty value. This may be used to include null fields in Patch
  20187. // requests.
  20188. NullFields []string `json:"-"`
  20189. }
  20190. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  20191. type NoMethod NetworksAddPeeringRequest
  20192. raw := NoMethod(*s)
  20193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20194. }
  20195. type NetworksGetEffectiveFirewallsResponse struct {
  20196. // Firewalls: Effective firewalls on the network.
  20197. Firewalls []*Firewall `json:"firewalls,omitempty"`
  20198. // OrganizationFirewalls: Effective firewalls from organization
  20199. // policies.
  20200. OrganizationFirewalls []*NetworksGetEffectiveFirewallsResponseOrganizationFirewallPolicy `json:"organizationFirewalls,omitempty"`
  20201. // ServerResponse contains the HTTP response code and headers from the
  20202. // server.
  20203. googleapi.ServerResponse `json:"-"`
  20204. // ForceSendFields is a list of field names (e.g. "Firewalls") to
  20205. // unconditionally include in API requests. By default, fields with
  20206. // empty values are omitted from API requests. However, any non-pointer,
  20207. // non-interface field appearing in ForceSendFields will be sent to the
  20208. // server regardless of whether the field is empty or not. This may be
  20209. // used to include empty fields in Patch requests.
  20210. ForceSendFields []string `json:"-"`
  20211. // NullFields is a list of field names (e.g. "Firewalls") to include in
  20212. // API requests with the JSON null value. By default, fields with empty
  20213. // values are omitted from API requests. However, any field with an
  20214. // empty value appearing in NullFields will be sent to the server as
  20215. // null. It is an error if a field in this list has a non-empty value.
  20216. // This may be used to include null fields in Patch requests.
  20217. NullFields []string `json:"-"`
  20218. }
  20219. func (s *NetworksGetEffectiveFirewallsResponse) MarshalJSON() ([]byte, error) {
  20220. type NoMethod NetworksGetEffectiveFirewallsResponse
  20221. raw := NoMethod(*s)
  20222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20223. }
  20224. // NetworksGetEffectiveFirewallsResponseOrganizationFirewallPolicy: A
  20225. // pruned SecurityPolicy containing ID and any applicable firewall
  20226. // rules.
  20227. type NetworksGetEffectiveFirewallsResponseOrganizationFirewallPolicy struct {
  20228. // Id: [Output Only] The unique identifier for the security policy. This
  20229. // identifier is defined by the server.
  20230. Id uint64 `json:"id,omitempty,string"`
  20231. // Rules: The rules that apply to the network.
  20232. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  20233. // ForceSendFields is a list of field names (e.g. "Id") to
  20234. // unconditionally include in API requests. By default, fields with
  20235. // empty values are omitted from API requests. However, any non-pointer,
  20236. // non-interface field appearing in ForceSendFields will be sent to the
  20237. // server regardless of whether the field is empty or not. This may be
  20238. // used to include empty fields in Patch requests.
  20239. ForceSendFields []string `json:"-"`
  20240. // NullFields is a list of field names (e.g. "Id") to include in API
  20241. // requests with the JSON null value. By default, fields with empty
  20242. // values are omitted from API requests. However, any field with an
  20243. // empty value appearing in NullFields will be sent to the server as
  20244. // null. It is an error if a field in this list has a non-empty value.
  20245. // This may be used to include null fields in Patch requests.
  20246. NullFields []string `json:"-"`
  20247. }
  20248. func (s *NetworksGetEffectiveFirewallsResponseOrganizationFirewallPolicy) MarshalJSON() ([]byte, error) {
  20249. type NoMethod NetworksGetEffectiveFirewallsResponseOrganizationFirewallPolicy
  20250. raw := NoMethod(*s)
  20251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20252. }
  20253. type NetworksRemovePeeringRequest struct {
  20254. // Name: Name of the peering, which should conform to RFC1035.
  20255. Name string `json:"name,omitempty"`
  20256. // ForceSendFields is a list of field names (e.g. "Name") to
  20257. // unconditionally include in API requests. By default, fields with
  20258. // empty values are omitted from API requests. However, any non-pointer,
  20259. // non-interface field appearing in ForceSendFields will be sent to the
  20260. // server regardless of whether the field is empty or not. This may be
  20261. // used to include empty fields in Patch requests.
  20262. ForceSendFields []string `json:"-"`
  20263. // NullFields is a list of field names (e.g. "Name") to include in API
  20264. // requests with the JSON null value. By default, fields with empty
  20265. // values are omitted from API requests. However, any field with an
  20266. // empty value appearing in NullFields will be sent to the server as
  20267. // null. It is an error if a field in this list has a non-empty value.
  20268. // This may be used to include null fields in Patch requests.
  20269. NullFields []string `json:"-"`
  20270. }
  20271. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  20272. type NoMethod NetworksRemovePeeringRequest
  20273. raw := NoMethod(*s)
  20274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20275. }
  20276. type NetworksUpdatePeeringRequest struct {
  20277. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  20278. // ForceSendFields is a list of field names (e.g. "NetworkPeering") to
  20279. // unconditionally include in API requests. By default, fields with
  20280. // empty values are omitted from API requests. However, any non-pointer,
  20281. // non-interface field appearing in ForceSendFields will be sent to the
  20282. // server regardless of whether the field is empty or not. This may be
  20283. // used to include empty fields in Patch requests.
  20284. ForceSendFields []string `json:"-"`
  20285. // NullFields is a list of field names (e.g. "NetworkPeering") to
  20286. // include in API requests with the JSON null value. By default, fields
  20287. // with empty values are omitted from API requests. However, any field
  20288. // with an empty value appearing in NullFields will be sent to the
  20289. // server as null. It is an error if a field in this list has a
  20290. // non-empty value. This may be used to include null fields in Patch
  20291. // requests.
  20292. NullFields []string `json:"-"`
  20293. }
  20294. func (s *NetworksUpdatePeeringRequest) MarshalJSON() ([]byte, error) {
  20295. type NoMethod NetworksUpdatePeeringRequest
  20296. raw := NoMethod(*s)
  20297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20298. }
  20299. // NodeGroup: A NodeGroup resource. To create a node group, you must
  20300. // first create a node templates. To learn more about node groups and
  20301. // sole-tenant nodes, read the Sole-tenant nodes documentation. (==
  20302. // resource_for beta.nodeGroups ==) (== resource_for v1.nodeGroups ==)
  20303. type NodeGroup struct {
  20304. AutoscalingPolicy *NodeGroupAutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  20305. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20306. // format.
  20307. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20308. // Description: An optional description of this resource. Provide this
  20309. // property when you create the resource.
  20310. Description string `json:"description,omitempty"`
  20311. // Id: [Output Only] The unique identifier for the resource. This
  20312. // identifier is defined by the server.
  20313. Id uint64 `json:"id,omitempty,string"`
  20314. // Kind: [Output Only] The type of the resource. Always
  20315. // compute#nodeGroup for node group.
  20316. Kind string `json:"kind,omitempty"`
  20317. // Possible values:
  20318. // "MANAGED_HOLDBACK_UNSPECIFIED"
  20319. // "OFF"
  20320. // "ON"
  20321. ManagedHoldback string `json:"managedHoldback,omitempty"`
  20322. // Name: The name of the resource, provided by the client when initially
  20323. // creating the resource. The resource name must be 1-63 characters
  20324. // long, and comply with RFC1035. Specifically, the name must be 1-63
  20325. // characters long and match the regular expression
  20326. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  20327. // a lowercase letter, and all following characters must be a dash,
  20328. // lowercase letter, or digit, except the last character, which cannot
  20329. // be a dash.
  20330. Name string `json:"name,omitempty"`
  20331. // NodeTemplate: The URL of the node template to which this node group
  20332. // belongs.
  20333. NodeTemplate string `json:"nodeTemplate,omitempty"`
  20334. // SelfLink: [Output Only] Server-defined URL for the resource.
  20335. SelfLink string `json:"selfLink,omitempty"`
  20336. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  20337. // with the resource id.
  20338. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  20339. // Size: [Output Only] The total number of nodes in the node group.
  20340. Size int64 `json:"size,omitempty"`
  20341. // Possible values:
  20342. // "CREATING"
  20343. // "DELETING"
  20344. // "INVALID"
  20345. // "READY"
  20346. Status string `json:"status,omitempty"`
  20347. // Zone: [Output Only] The name of the zone where the node group
  20348. // resides, such as us-central1-a.
  20349. Zone string `json:"zone,omitempty"`
  20350. // ServerResponse contains the HTTP response code and headers from the
  20351. // server.
  20352. googleapi.ServerResponse `json:"-"`
  20353. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  20354. // to unconditionally include in API requests. By default, fields with
  20355. // empty values are omitted from API requests. However, any non-pointer,
  20356. // non-interface field appearing in ForceSendFields will be sent to the
  20357. // server regardless of whether the field is empty or not. This may be
  20358. // used to include empty fields in Patch requests.
  20359. ForceSendFields []string `json:"-"`
  20360. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  20361. // include in API requests with the JSON null value. By default, fields
  20362. // with empty values are omitted from API requests. However, any field
  20363. // with an empty value appearing in NullFields will be sent to the
  20364. // server as null. It is an error if a field in this list has a
  20365. // non-empty value. This may be used to include null fields in Patch
  20366. // requests.
  20367. NullFields []string `json:"-"`
  20368. }
  20369. func (s *NodeGroup) MarshalJSON() ([]byte, error) {
  20370. type NoMethod NodeGroup
  20371. raw := NoMethod(*s)
  20372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20373. }
  20374. type NodeGroupAggregatedList struct {
  20375. // Id: [Output Only] Unique identifier for the resource; defined by the
  20376. // server.
  20377. Id string `json:"id,omitempty"`
  20378. // Items: A list of NodeGroupsScopedList resources.
  20379. Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
  20380. // Kind: [Output Only] Type of resource.Always
  20381. // compute#nodeGroupAggregatedList for aggregated lists of node groups.
  20382. Kind string `json:"kind,omitempty"`
  20383. // NextPageToken: [Output Only] This token allows you to get the next
  20384. // page of results for list requests. If the number of results is larger
  20385. // than maxResults, use the nextPageToken as a value for the query
  20386. // parameter pageToken in the next list request. Subsequent list
  20387. // requests will have their own nextPageToken to continue paging through
  20388. // the results.
  20389. NextPageToken string `json:"nextPageToken,omitempty"`
  20390. // SelfLink: [Output Only] Server-defined URL for this resource.
  20391. SelfLink string `json:"selfLink,omitempty"`
  20392. // Warning: [Output Only] Informational warning message.
  20393. Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
  20394. // ServerResponse contains the HTTP response code and headers from the
  20395. // server.
  20396. googleapi.ServerResponse `json:"-"`
  20397. // ForceSendFields is a list of field names (e.g. "Id") to
  20398. // unconditionally include in API requests. By default, fields with
  20399. // empty values are omitted from API requests. However, any non-pointer,
  20400. // non-interface field appearing in ForceSendFields will be sent to the
  20401. // server regardless of whether the field is empty or not. This may be
  20402. // used to include empty fields in Patch requests.
  20403. ForceSendFields []string `json:"-"`
  20404. // NullFields is a list of field names (e.g. "Id") to include in API
  20405. // requests with the JSON null value. By default, fields with empty
  20406. // values are omitted from API requests. However, any field with an
  20407. // empty value appearing in NullFields will be sent to the server as
  20408. // null. It is an error if a field in this list has a non-empty value.
  20409. // This may be used to include null fields in Patch requests.
  20410. NullFields []string `json:"-"`
  20411. }
  20412. func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
  20413. type NoMethod NodeGroupAggregatedList
  20414. raw := NoMethod(*s)
  20415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20416. }
  20417. // NodeGroupAggregatedListWarning: [Output Only] Informational warning
  20418. // message.
  20419. type NodeGroupAggregatedListWarning struct {
  20420. // Code: [Output Only] A warning code, if applicable. For example,
  20421. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20422. // the response.
  20423. //
  20424. // Possible values:
  20425. // "CLEANUP_FAILED"
  20426. // "DEPRECATED_RESOURCE_USED"
  20427. // "DEPRECATED_TYPE_USED"
  20428. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20429. // "EXPERIMENTAL_TYPE_USED"
  20430. // "EXTERNAL_API_WARNING"
  20431. // "FIELD_VALUE_OVERRIDEN"
  20432. // "INJECTED_KERNELS_DEPRECATED"
  20433. // "MISSING_TYPE_DEPENDENCY"
  20434. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20435. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20436. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20437. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20438. // "NEXT_HOP_NOT_RUNNING"
  20439. // "NOT_CRITICAL_ERROR"
  20440. // "NO_RESULTS_ON_PAGE"
  20441. // "REQUIRED_TOS_AGREEMENT"
  20442. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20443. // "RESOURCE_NOT_DELETED"
  20444. // "SCHEMA_VALIDATION_IGNORED"
  20445. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20446. // "UNDECLARED_PROPERTIES"
  20447. // "UNREACHABLE"
  20448. Code string `json:"code,omitempty"`
  20449. // Data: [Output Only] Metadata about this warning in key: value format.
  20450. // For example:
  20451. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20452. Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
  20453. // Message: [Output Only] A human-readable description of the warning
  20454. // code.
  20455. Message string `json:"message,omitempty"`
  20456. // ForceSendFields is a list of field names (e.g. "Code") to
  20457. // unconditionally include in API requests. By default, fields with
  20458. // empty values are omitted from API requests. However, any non-pointer,
  20459. // non-interface field appearing in ForceSendFields will be sent to the
  20460. // server regardless of whether the field is empty or not. This may be
  20461. // used to include empty fields in Patch requests.
  20462. ForceSendFields []string `json:"-"`
  20463. // NullFields is a list of field names (e.g. "Code") to include in API
  20464. // requests with the JSON null value. By default, fields with empty
  20465. // values are omitted from API requests. However, any field with an
  20466. // empty value appearing in NullFields will be sent to the server as
  20467. // null. It is an error if a field in this list has a non-empty value.
  20468. // This may be used to include null fields in Patch requests.
  20469. NullFields []string `json:"-"`
  20470. }
  20471. func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  20472. type NoMethod NodeGroupAggregatedListWarning
  20473. raw := NoMethod(*s)
  20474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20475. }
  20476. type NodeGroupAggregatedListWarningData struct {
  20477. // Key: [Output Only] A key that provides more detail on the warning
  20478. // being returned. For example, for warnings where there are no results
  20479. // in a list request for a particular zone, this key might be scope and
  20480. // the key value might be the zone name. Other examples might be a key
  20481. // indicating a deprecated resource and a suggested replacement, or a
  20482. // warning about invalid network settings (for example, if an instance
  20483. // attempts to perform IP forwarding but is not enabled for IP
  20484. // forwarding).
  20485. Key string `json:"key,omitempty"`
  20486. // Value: [Output Only] A warning data value corresponding to the key.
  20487. Value string `json:"value,omitempty"`
  20488. // ForceSendFields is a list of field names (e.g. "Key") to
  20489. // unconditionally include in API requests. By default, fields with
  20490. // empty values are omitted from API requests. However, any non-pointer,
  20491. // non-interface field appearing in ForceSendFields will be sent to the
  20492. // server regardless of whether the field is empty or not. This may be
  20493. // used to include empty fields in Patch requests.
  20494. ForceSendFields []string `json:"-"`
  20495. // NullFields is a list of field names (e.g. "Key") to include in API
  20496. // requests with the JSON null value. By default, fields with empty
  20497. // values are omitted from API requests. However, any field with an
  20498. // empty value appearing in NullFields will be sent to the server as
  20499. // null. It is an error if a field in this list has a non-empty value.
  20500. // This may be used to include null fields in Patch requests.
  20501. NullFields []string `json:"-"`
  20502. }
  20503. func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  20504. type NoMethod NodeGroupAggregatedListWarningData
  20505. raw := NoMethod(*s)
  20506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20507. }
  20508. type NodeGroupAutoscalingPolicy struct {
  20509. MaxSize int64 `json:"maxSize,omitempty"`
  20510. MinSize int64 `json:"minSize,omitempty"`
  20511. // ForceSendFields is a list of field names (e.g. "MaxSize") to
  20512. // unconditionally include in API requests. By default, fields with
  20513. // empty values are omitted from API requests. However, any non-pointer,
  20514. // non-interface field appearing in ForceSendFields will be sent to the
  20515. // server regardless of whether the field is empty or not. This may be
  20516. // used to include empty fields in Patch requests.
  20517. ForceSendFields []string `json:"-"`
  20518. // NullFields is a list of field names (e.g. "MaxSize") to include in
  20519. // API requests with the JSON null value. By default, fields with empty
  20520. // values are omitted from API requests. However, any field with an
  20521. // empty value appearing in NullFields will be sent to the server as
  20522. // null. It is an error if a field in this list has a non-empty value.
  20523. // This may be used to include null fields in Patch requests.
  20524. NullFields []string `json:"-"`
  20525. }
  20526. func (s *NodeGroupAutoscalingPolicy) MarshalJSON() ([]byte, error) {
  20527. type NoMethod NodeGroupAutoscalingPolicy
  20528. raw := NoMethod(*s)
  20529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20530. }
  20531. // NodeGroupList: Contains a list of nodeGroups.
  20532. type NodeGroupList struct {
  20533. // Id: [Output Only] Unique identifier for the resource; defined by the
  20534. // server.
  20535. Id string `json:"id,omitempty"`
  20536. // Items: A list of NodeGroup resources.
  20537. Items []*NodeGroup `json:"items,omitempty"`
  20538. // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
  20539. // lists of node groups.
  20540. Kind string `json:"kind,omitempty"`
  20541. // NextPageToken: [Output Only] This token allows you to get the next
  20542. // page of results for list requests. If the number of results is larger
  20543. // than maxResults, use the nextPageToken as a value for the query
  20544. // parameter pageToken in the next list request. Subsequent list
  20545. // requests will have their own nextPageToken to continue paging through
  20546. // the results.
  20547. NextPageToken string `json:"nextPageToken,omitempty"`
  20548. // SelfLink: [Output Only] Server-defined URL for this resource.
  20549. SelfLink string `json:"selfLink,omitempty"`
  20550. // Warning: [Output Only] Informational warning message.
  20551. Warning *NodeGroupListWarning `json:"warning,omitempty"`
  20552. // ServerResponse contains the HTTP response code and headers from the
  20553. // server.
  20554. googleapi.ServerResponse `json:"-"`
  20555. // ForceSendFields is a list of field names (e.g. "Id") to
  20556. // unconditionally include in API requests. By default, fields with
  20557. // empty values are omitted from API requests. However, any non-pointer,
  20558. // non-interface field appearing in ForceSendFields will be sent to the
  20559. // server regardless of whether the field is empty or not. This may be
  20560. // used to include empty fields in Patch requests.
  20561. ForceSendFields []string `json:"-"`
  20562. // NullFields is a list of field names (e.g. "Id") to include in API
  20563. // requests with the JSON null value. By default, fields with empty
  20564. // values are omitted from API requests. However, any field with an
  20565. // empty value appearing in NullFields will be sent to the server as
  20566. // null. It is an error if a field in this list has a non-empty value.
  20567. // This may be used to include null fields in Patch requests.
  20568. NullFields []string `json:"-"`
  20569. }
  20570. func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
  20571. type NoMethod NodeGroupList
  20572. raw := NoMethod(*s)
  20573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20574. }
  20575. // NodeGroupListWarning: [Output Only] Informational warning message.
  20576. type NodeGroupListWarning struct {
  20577. // Code: [Output Only] A warning code, if applicable. For example,
  20578. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20579. // the response.
  20580. //
  20581. // Possible values:
  20582. // "CLEANUP_FAILED"
  20583. // "DEPRECATED_RESOURCE_USED"
  20584. // "DEPRECATED_TYPE_USED"
  20585. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20586. // "EXPERIMENTAL_TYPE_USED"
  20587. // "EXTERNAL_API_WARNING"
  20588. // "FIELD_VALUE_OVERRIDEN"
  20589. // "INJECTED_KERNELS_DEPRECATED"
  20590. // "MISSING_TYPE_DEPENDENCY"
  20591. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20592. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20593. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20594. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20595. // "NEXT_HOP_NOT_RUNNING"
  20596. // "NOT_CRITICAL_ERROR"
  20597. // "NO_RESULTS_ON_PAGE"
  20598. // "REQUIRED_TOS_AGREEMENT"
  20599. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20600. // "RESOURCE_NOT_DELETED"
  20601. // "SCHEMA_VALIDATION_IGNORED"
  20602. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20603. // "UNDECLARED_PROPERTIES"
  20604. // "UNREACHABLE"
  20605. Code string `json:"code,omitempty"`
  20606. // Data: [Output Only] Metadata about this warning in key: value format.
  20607. // For example:
  20608. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20609. Data []*NodeGroupListWarningData `json:"data,omitempty"`
  20610. // Message: [Output Only] A human-readable description of the warning
  20611. // code.
  20612. Message string `json:"message,omitempty"`
  20613. // ForceSendFields is a list of field names (e.g. "Code") to
  20614. // unconditionally include in API requests. By default, fields with
  20615. // empty values are omitted from API requests. However, any non-pointer,
  20616. // non-interface field appearing in ForceSendFields will be sent to the
  20617. // server regardless of whether the field is empty or not. This may be
  20618. // used to include empty fields in Patch requests.
  20619. ForceSendFields []string `json:"-"`
  20620. // NullFields is a list of field names (e.g. "Code") to include in API
  20621. // requests with the JSON null value. By default, fields with empty
  20622. // values are omitted from API requests. However, any field with an
  20623. // empty value appearing in NullFields will be sent to the server as
  20624. // null. It is an error if a field in this list has a non-empty value.
  20625. // This may be used to include null fields in Patch requests.
  20626. NullFields []string `json:"-"`
  20627. }
  20628. func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
  20629. type NoMethod NodeGroupListWarning
  20630. raw := NoMethod(*s)
  20631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20632. }
  20633. type NodeGroupListWarningData struct {
  20634. // Key: [Output Only] A key that provides more detail on the warning
  20635. // being returned. For example, for warnings where there are no results
  20636. // in a list request for a particular zone, this key might be scope and
  20637. // the key value might be the zone name. Other examples might be a key
  20638. // indicating a deprecated resource and a suggested replacement, or a
  20639. // warning about invalid network settings (for example, if an instance
  20640. // attempts to perform IP forwarding but is not enabled for IP
  20641. // forwarding).
  20642. Key string `json:"key,omitempty"`
  20643. // Value: [Output Only] A warning data value corresponding to the key.
  20644. Value string `json:"value,omitempty"`
  20645. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
  20661. type NoMethod NodeGroupListWarningData
  20662. raw := NoMethod(*s)
  20663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20664. }
  20665. type NodeGroupNode struct {
  20666. // Disks: Local disk configurations.
  20667. Disks []*LocalDisk `json:"disks,omitempty"`
  20668. // Instances: Instances scheduled on this node.
  20669. Instances []string `json:"instances,omitempty"`
  20670. // Name: The name of the node.
  20671. Name string `json:"name,omitempty"`
  20672. // NodeType: The type of this node.
  20673. NodeType string `json:"nodeType,omitempty"`
  20674. // ServerBinding: Binding properties for the physical server.
  20675. ServerBinding *ServerBinding `json:"serverBinding,omitempty"`
  20676. // Possible values:
  20677. // "CREATING"
  20678. // "DELETING"
  20679. // "INVALID"
  20680. // "READY"
  20681. // "REPAIRING"
  20682. Status string `json:"status,omitempty"`
  20683. // ForceSendFields is a list of field names (e.g. "Disks") to
  20684. // unconditionally include in API requests. By default, fields with
  20685. // empty values are omitted from API requests. However, any non-pointer,
  20686. // non-interface field appearing in ForceSendFields will be sent to the
  20687. // server regardless of whether the field is empty or not. This may be
  20688. // used to include empty fields in Patch requests.
  20689. ForceSendFields []string `json:"-"`
  20690. // NullFields is a list of field names (e.g. "Disks") to include in API
  20691. // requests with the JSON null value. By default, fields with empty
  20692. // values are omitted from API requests. However, any field with an
  20693. // empty value appearing in NullFields will be sent to the server as
  20694. // null. It is an error if a field in this list has a non-empty value.
  20695. // This may be used to include null fields in Patch requests.
  20696. NullFields []string `json:"-"`
  20697. }
  20698. func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
  20699. type NoMethod NodeGroupNode
  20700. raw := NoMethod(*s)
  20701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20702. }
  20703. type NodeGroupsAddNodesRequest struct {
  20704. // AdditionalNodeCount: Count of additional nodes to be added to the
  20705. // node group.
  20706. AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
  20707. // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
  20708. // to unconditionally include in API requests. By default, fields with
  20709. // empty values are omitted from API requests. However, any non-pointer,
  20710. // non-interface field appearing in ForceSendFields will be sent to the
  20711. // server regardless of whether the field is empty or not. This may be
  20712. // used to include empty fields in Patch requests.
  20713. ForceSendFields []string `json:"-"`
  20714. // NullFields is a list of field names (e.g. "AdditionalNodeCount") to
  20715. // include in API requests with the JSON null value. By default, fields
  20716. // with empty values are omitted from API requests. However, any field
  20717. // with an empty value appearing in NullFields will be sent to the
  20718. // server as null. It is an error if a field in this list has a
  20719. // non-empty value. This may be used to include null fields in Patch
  20720. // requests.
  20721. NullFields []string `json:"-"`
  20722. }
  20723. func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
  20724. type NoMethod NodeGroupsAddNodesRequest
  20725. raw := NoMethod(*s)
  20726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20727. }
  20728. type NodeGroupsDeleteNodesRequest struct {
  20729. Nodes []string `json:"nodes,omitempty"`
  20730. // ForceSendFields is a list of field names (e.g. "Nodes") to
  20731. // unconditionally include in API requests. By default, fields with
  20732. // empty values are omitted from API requests. However, any non-pointer,
  20733. // non-interface field appearing in ForceSendFields will be sent to the
  20734. // server regardless of whether the field is empty or not. This may be
  20735. // used to include empty fields in Patch requests.
  20736. ForceSendFields []string `json:"-"`
  20737. // NullFields is a list of field names (e.g. "Nodes") to include in API
  20738. // requests with the JSON null value. By default, fields with empty
  20739. // values are omitted from API requests. However, any field with an
  20740. // empty value appearing in NullFields will be sent to the server as
  20741. // null. It is an error if a field in this list has a non-empty value.
  20742. // This may be used to include null fields in Patch requests.
  20743. NullFields []string `json:"-"`
  20744. }
  20745. func (s *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
  20746. type NoMethod NodeGroupsDeleteNodesRequest
  20747. raw := NoMethod(*s)
  20748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20749. }
  20750. type NodeGroupsListNodes struct {
  20751. // Id: [Output Only] Unique identifier for the resource; defined by the
  20752. // server.
  20753. Id string `json:"id,omitempty"`
  20754. // Items: A list of Node resources.
  20755. Items []*NodeGroupNode `json:"items,omitempty"`
  20756. // Kind: [Output Only] The resource type, which is always
  20757. // compute.nodeGroupsListNodes for the list of nodes in the specified
  20758. // node group.
  20759. Kind string `json:"kind,omitempty"`
  20760. // NextPageToken: [Output Only] This token allows you to get the next
  20761. // page of results for list requests. If the number of results is larger
  20762. // than maxResults, use the nextPageToken as a value for the query
  20763. // parameter pageToken in the next list request. Subsequent list
  20764. // requests will have their own nextPageToken to continue paging through
  20765. // the results.
  20766. NextPageToken string `json:"nextPageToken,omitempty"`
  20767. // SelfLink: [Output Only] Server-defined URL for this resource.
  20768. SelfLink string `json:"selfLink,omitempty"`
  20769. // Warning: [Output Only] Informational warning message.
  20770. Warning *NodeGroupsListNodesWarning `json:"warning,omitempty"`
  20771. // ServerResponse contains the HTTP response code and headers from the
  20772. // server.
  20773. googleapi.ServerResponse `json:"-"`
  20774. // ForceSendFields is a list of field names (e.g. "Id") to
  20775. // unconditionally include in API requests. By default, fields with
  20776. // empty values are omitted from API requests. However, any non-pointer,
  20777. // non-interface field appearing in ForceSendFields will be sent to the
  20778. // server regardless of whether the field is empty or not. This may be
  20779. // used to include empty fields in Patch requests.
  20780. ForceSendFields []string `json:"-"`
  20781. // NullFields is a list of field names (e.g. "Id") to include in API
  20782. // requests with the JSON null value. By default, fields with empty
  20783. // values are omitted from API requests. However, any field with an
  20784. // empty value appearing in NullFields will be sent to the server as
  20785. // null. It is an error if a field in this list has a non-empty value.
  20786. // This may be used to include null fields in Patch requests.
  20787. NullFields []string `json:"-"`
  20788. }
  20789. func (s *NodeGroupsListNodes) MarshalJSON() ([]byte, error) {
  20790. type NoMethod NodeGroupsListNodes
  20791. raw := NoMethod(*s)
  20792. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20793. }
  20794. // NodeGroupsListNodesWarning: [Output Only] Informational warning
  20795. // message.
  20796. type NodeGroupsListNodesWarning struct {
  20797. // Code: [Output Only] A warning code, if applicable. For example,
  20798. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20799. // the response.
  20800. //
  20801. // Possible values:
  20802. // "CLEANUP_FAILED"
  20803. // "DEPRECATED_RESOURCE_USED"
  20804. // "DEPRECATED_TYPE_USED"
  20805. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20806. // "EXPERIMENTAL_TYPE_USED"
  20807. // "EXTERNAL_API_WARNING"
  20808. // "FIELD_VALUE_OVERRIDEN"
  20809. // "INJECTED_KERNELS_DEPRECATED"
  20810. // "MISSING_TYPE_DEPENDENCY"
  20811. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20812. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20813. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20814. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20815. // "NEXT_HOP_NOT_RUNNING"
  20816. // "NOT_CRITICAL_ERROR"
  20817. // "NO_RESULTS_ON_PAGE"
  20818. // "REQUIRED_TOS_AGREEMENT"
  20819. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20820. // "RESOURCE_NOT_DELETED"
  20821. // "SCHEMA_VALIDATION_IGNORED"
  20822. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20823. // "UNDECLARED_PROPERTIES"
  20824. // "UNREACHABLE"
  20825. Code string `json:"code,omitempty"`
  20826. // Data: [Output Only] Metadata about this warning in key: value format.
  20827. // For example:
  20828. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20829. Data []*NodeGroupsListNodesWarningData `json:"data,omitempty"`
  20830. // Message: [Output Only] A human-readable description of the warning
  20831. // code.
  20832. Message string `json:"message,omitempty"`
  20833. // ForceSendFields is a list of field names (e.g. "Code") to
  20834. // unconditionally include in API requests. By default, fields with
  20835. // empty values are omitted from API requests. However, any non-pointer,
  20836. // non-interface field appearing in ForceSendFields will be sent to the
  20837. // server regardless of whether the field is empty or not. This may be
  20838. // used to include empty fields in Patch requests.
  20839. ForceSendFields []string `json:"-"`
  20840. // NullFields is a list of field names (e.g. "Code") to include in API
  20841. // requests with the JSON null value. By default, fields with empty
  20842. // values are omitted from API requests. However, any field with an
  20843. // empty value appearing in NullFields will be sent to the server as
  20844. // null. It is an error if a field in this list has a non-empty value.
  20845. // This may be used to include null fields in Patch requests.
  20846. NullFields []string `json:"-"`
  20847. }
  20848. func (s *NodeGroupsListNodesWarning) MarshalJSON() ([]byte, error) {
  20849. type NoMethod NodeGroupsListNodesWarning
  20850. raw := NoMethod(*s)
  20851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20852. }
  20853. type NodeGroupsListNodesWarningData struct {
  20854. // Key: [Output Only] A key that provides more detail on the warning
  20855. // being returned. For example, for warnings where there are no results
  20856. // in a list request for a particular zone, this key might be scope and
  20857. // the key value might be the zone name. Other examples might be a key
  20858. // indicating a deprecated resource and a suggested replacement, or a
  20859. // warning about invalid network settings (for example, if an instance
  20860. // attempts to perform IP forwarding but is not enabled for IP
  20861. // forwarding).
  20862. Key string `json:"key,omitempty"`
  20863. // Value: [Output Only] A warning data value corresponding to the key.
  20864. Value string `json:"value,omitempty"`
  20865. // ForceSendFields is a list of field names (e.g. "Key") to
  20866. // unconditionally include in API requests. By default, fields with
  20867. // empty values are omitted from API requests. However, any non-pointer,
  20868. // non-interface field appearing in ForceSendFields will be sent to the
  20869. // server regardless of whether the field is empty or not. This may be
  20870. // used to include empty fields in Patch requests.
  20871. ForceSendFields []string `json:"-"`
  20872. // NullFields is a list of field names (e.g. "Key") to include in API
  20873. // requests with the JSON null value. By default, fields with empty
  20874. // values are omitted from API requests. However, any field with an
  20875. // empty value appearing in NullFields will be sent to the server as
  20876. // null. It is an error if a field in this list has a non-empty value.
  20877. // This may be used to include null fields in Patch requests.
  20878. NullFields []string `json:"-"`
  20879. }
  20880. func (s *NodeGroupsListNodesWarningData) MarshalJSON() ([]byte, error) {
  20881. type NoMethod NodeGroupsListNodesWarningData
  20882. raw := NoMethod(*s)
  20883. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20884. }
  20885. type NodeGroupsScopedList struct {
  20886. // NodeGroups: [Output Only] A list of node groups contained in this
  20887. // scope.
  20888. NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
  20889. // Warning: [Output Only] An informational warning that appears when the
  20890. // nodeGroup list is empty.
  20891. Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
  20892. // ForceSendFields is a list of field names (e.g. "NodeGroups") to
  20893. // unconditionally include in API requests. By default, fields with
  20894. // empty values are omitted from API requests. However, any non-pointer,
  20895. // non-interface field appearing in ForceSendFields will be sent to the
  20896. // server regardless of whether the field is empty or not. This may be
  20897. // used to include empty fields in Patch requests.
  20898. ForceSendFields []string `json:"-"`
  20899. // NullFields is a list of field names (e.g. "NodeGroups") to include in
  20900. // API requests with the JSON null value. By default, fields with empty
  20901. // values are omitted from API requests. However, any field with an
  20902. // empty value appearing in NullFields will be sent to the server as
  20903. // null. It is an error if a field in this list has a non-empty value.
  20904. // This may be used to include null fields in Patch requests.
  20905. NullFields []string `json:"-"`
  20906. }
  20907. func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
  20908. type NoMethod NodeGroupsScopedList
  20909. raw := NoMethod(*s)
  20910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20911. }
  20912. // NodeGroupsScopedListWarning: [Output Only] An informational warning
  20913. // that appears when the nodeGroup list is empty.
  20914. type NodeGroupsScopedListWarning struct {
  20915. // Code: [Output Only] A warning code, if applicable. For example,
  20916. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20917. // the response.
  20918. //
  20919. // Possible values:
  20920. // "CLEANUP_FAILED"
  20921. // "DEPRECATED_RESOURCE_USED"
  20922. // "DEPRECATED_TYPE_USED"
  20923. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20924. // "EXPERIMENTAL_TYPE_USED"
  20925. // "EXTERNAL_API_WARNING"
  20926. // "FIELD_VALUE_OVERRIDEN"
  20927. // "INJECTED_KERNELS_DEPRECATED"
  20928. // "MISSING_TYPE_DEPENDENCY"
  20929. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20930. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20931. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20932. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20933. // "NEXT_HOP_NOT_RUNNING"
  20934. // "NOT_CRITICAL_ERROR"
  20935. // "NO_RESULTS_ON_PAGE"
  20936. // "REQUIRED_TOS_AGREEMENT"
  20937. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20938. // "RESOURCE_NOT_DELETED"
  20939. // "SCHEMA_VALIDATION_IGNORED"
  20940. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20941. // "UNDECLARED_PROPERTIES"
  20942. // "UNREACHABLE"
  20943. Code string `json:"code,omitempty"`
  20944. // Data: [Output Only] Metadata about this warning in key: value format.
  20945. // For example:
  20946. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20947. Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
  20948. // Message: [Output Only] A human-readable description of the warning
  20949. // code.
  20950. Message string `json:"message,omitempty"`
  20951. // ForceSendFields is a list of field names (e.g. "Code") to
  20952. // unconditionally include in API requests. By default, fields with
  20953. // empty values are omitted from API requests. However, any non-pointer,
  20954. // non-interface field appearing in ForceSendFields will be sent to the
  20955. // server regardless of whether the field is empty or not. This may be
  20956. // used to include empty fields in Patch requests.
  20957. ForceSendFields []string `json:"-"`
  20958. // NullFields is a list of field names (e.g. "Code") to include in API
  20959. // requests with the JSON null value. By default, fields with empty
  20960. // values are omitted from API requests. However, any field with an
  20961. // empty value appearing in NullFields will be sent to the server as
  20962. // null. It is an error if a field in this list has a non-empty value.
  20963. // This may be used to include null fields in Patch requests.
  20964. NullFields []string `json:"-"`
  20965. }
  20966. func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  20967. type NoMethod NodeGroupsScopedListWarning
  20968. raw := NoMethod(*s)
  20969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20970. }
  20971. type NodeGroupsScopedListWarningData struct {
  20972. // Key: [Output Only] A key that provides more detail on the warning
  20973. // being returned. For example, for warnings where there are no results
  20974. // in a list request for a particular zone, this key might be scope and
  20975. // the key value might be the zone name. Other examples might be a key
  20976. // indicating a deprecated resource and a suggested replacement, or a
  20977. // warning about invalid network settings (for example, if an instance
  20978. // attempts to perform IP forwarding but is not enabled for IP
  20979. // forwarding).
  20980. Key string `json:"key,omitempty"`
  20981. // Value: [Output Only] A warning data value corresponding to the key.
  20982. Value string `json:"value,omitempty"`
  20983. // ForceSendFields is a list of field names (e.g. "Key") to
  20984. // unconditionally include in API requests. By default, fields with
  20985. // empty values are omitted from API requests. However, any non-pointer,
  20986. // non-interface field appearing in ForceSendFields will be sent to the
  20987. // server regardless of whether the field is empty or not. This may be
  20988. // used to include empty fields in Patch requests.
  20989. ForceSendFields []string `json:"-"`
  20990. // NullFields is a list of field names (e.g. "Key") to include in API
  20991. // requests with the JSON null value. By default, fields with empty
  20992. // values are omitted from API requests. However, any field with an
  20993. // empty value appearing in NullFields will be sent to the server as
  20994. // null. It is an error if a field in this list has a non-empty value.
  20995. // This may be used to include null fields in Patch requests.
  20996. NullFields []string `json:"-"`
  20997. }
  20998. func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  20999. type NoMethod NodeGroupsScopedListWarningData
  21000. raw := NoMethod(*s)
  21001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21002. }
  21003. type NodeGroupsSetAutoscalingPolicyRequest struct {
  21004. AutoscalingPolicy *NodeGroupAutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  21005. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  21006. // to unconditionally include in API requests. By default, fields with
  21007. // empty values are omitted from API requests. However, any non-pointer,
  21008. // non-interface field appearing in ForceSendFields will be sent to the
  21009. // server regardless of whether the field is empty or not. This may be
  21010. // used to include empty fields in Patch requests.
  21011. ForceSendFields []string `json:"-"`
  21012. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  21013. // include in API requests with the JSON null value. By default, fields
  21014. // with empty values are omitted from API requests. However, any field
  21015. // with an empty value appearing in NullFields will be sent to the
  21016. // server as null. It is an error if a field in this list has a
  21017. // non-empty value. This may be used to include null fields in Patch
  21018. // requests.
  21019. NullFields []string `json:"-"`
  21020. }
  21021. func (s *NodeGroupsSetAutoscalingPolicyRequest) MarshalJSON() ([]byte, error) {
  21022. type NoMethod NodeGroupsSetAutoscalingPolicyRequest
  21023. raw := NoMethod(*s)
  21024. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21025. }
  21026. type NodeGroupsSetNodeTemplateRequest struct {
  21027. // NodeTemplate: Full or partial URL of the node template resource to be
  21028. // updated for this node group.
  21029. NodeTemplate string `json:"nodeTemplate,omitempty"`
  21030. // ForceSendFields is a list of field names (e.g. "NodeTemplate") to
  21031. // unconditionally include in API requests. By default, fields with
  21032. // empty values are omitted from API requests. However, any non-pointer,
  21033. // non-interface field appearing in ForceSendFields will be sent to the
  21034. // server regardless of whether the field is empty or not. This may be
  21035. // used to include empty fields in Patch requests.
  21036. ForceSendFields []string `json:"-"`
  21037. // NullFields is a list of field names (e.g. "NodeTemplate") to include
  21038. // in API requests with the JSON null value. By default, fields with
  21039. // empty values are omitted from API requests. However, any field with
  21040. // an empty value appearing in NullFields will be sent to the server as
  21041. // null. It is an error if a field in this list has a non-empty value.
  21042. // This may be used to include null fields in Patch requests.
  21043. NullFields []string `json:"-"`
  21044. }
  21045. func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
  21046. type NoMethod NodeGroupsSetNodeTemplateRequest
  21047. raw := NoMethod(*s)
  21048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21049. }
  21050. // NodeTemplate: A Node Template resource. To learn more about node
  21051. // templates and sole-tenant nodes, read the Sole-tenant nodes
  21052. // documentation. (== resource_for beta.nodeTemplates ==) (==
  21053. // resource_for v1.nodeTemplates ==)
  21054. type NodeTemplate struct {
  21055. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21056. // format.
  21057. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21058. // Description: An optional description of this resource. Provide this
  21059. // property when you create the resource.
  21060. Description string `json:"description,omitempty"`
  21061. Disks []*LocalDisk `json:"disks,omitempty"`
  21062. // Id: [Output Only] The unique identifier for the resource. This
  21063. // identifier is defined by the server.
  21064. Id uint64 `json:"id,omitempty,string"`
  21065. // Kind: [Output Only] The type of the resource. Always
  21066. // compute#nodeTemplate for node templates.
  21067. Kind string `json:"kind,omitempty"`
  21068. // Name: The name of the resource, provided by the client when initially
  21069. // creating the resource. The resource name must be 1-63 characters
  21070. // long, and comply with RFC1035. Specifically, the name must be 1-63
  21071. // characters long and match the regular expression
  21072. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  21073. // a lowercase letter, and all following characters must be a dash,
  21074. // lowercase letter, or digit, except the last character, which cannot
  21075. // be a dash.
  21076. Name string `json:"name,omitempty"`
  21077. // NodeAffinityLabels: Labels to use for node affinity, which will be
  21078. // used in instance scheduling.
  21079. NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
  21080. // NodeType: The node type to use for nodes group that are created from
  21081. // this template.
  21082. NodeType string `json:"nodeType,omitempty"`
  21083. // NodeTypeFlexibility: The flexible properties of the desired node
  21084. // type. Node groups that use this node template will create nodes of a
  21085. // type that matches these properties.
  21086. //
  21087. // This field is mutually exclusive with the node_type property; you can
  21088. // only define one or the other, but not both.
  21089. NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
  21090. // Region: [Output Only] The name of the region where the node template
  21091. // resides, such as us-central1.
  21092. Region string `json:"region,omitempty"`
  21093. // SelfLink: [Output Only] Server-defined URL for the resource.
  21094. SelfLink string `json:"selfLink,omitempty"`
  21095. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  21096. // with the resource id.
  21097. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  21098. // ServerBinding: Binding properties for the physical server.
  21099. ServerBinding *ServerBinding `json:"serverBinding,omitempty"`
  21100. // Status: [Output Only] The status of the node template. One of the
  21101. // following values: CREATING, READY, and DELETING.
  21102. //
  21103. // Possible values:
  21104. // "CREATING"
  21105. // "DELETING"
  21106. // "INVALID"
  21107. // "READY"
  21108. Status string `json:"status,omitempty"`
  21109. // StatusMessage: [Output Only] An optional, human-readable explanation
  21110. // of the status.
  21111. StatusMessage string `json:"statusMessage,omitempty"`
  21112. // ServerResponse contains the HTTP response code and headers from the
  21113. // server.
  21114. googleapi.ServerResponse `json:"-"`
  21115. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21116. // to unconditionally include in API requests. By default, fields with
  21117. // empty values are omitted from API requests. However, any non-pointer,
  21118. // non-interface field appearing in ForceSendFields will be sent to the
  21119. // server regardless of whether the field is empty or not. This may be
  21120. // used to include empty fields in Patch requests.
  21121. ForceSendFields []string `json:"-"`
  21122. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21123. // include in API requests with the JSON null value. By default, fields
  21124. // with empty values are omitted from API requests. However, any field
  21125. // with an empty value appearing in NullFields will be sent to the
  21126. // server as null. It is an error if a field in this list has a
  21127. // non-empty value. This may be used to include null fields in Patch
  21128. // requests.
  21129. NullFields []string `json:"-"`
  21130. }
  21131. func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
  21132. type NoMethod NodeTemplate
  21133. raw := NoMethod(*s)
  21134. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21135. }
  21136. type NodeTemplateAggregatedList struct {
  21137. // Id: [Output Only] Unique identifier for the resource; defined by the
  21138. // server.
  21139. Id string `json:"id,omitempty"`
  21140. // Items: A list of NodeTemplatesScopedList resources.
  21141. Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
  21142. // Kind: [Output Only] Type of resource.Always
  21143. // compute#nodeTemplateAggregatedList for aggregated lists of node
  21144. // templates.
  21145. Kind string `json:"kind,omitempty"`
  21146. // NextPageToken: [Output Only] This token allows you to get the next
  21147. // page of results for list requests. If the number of results is larger
  21148. // than maxResults, use the nextPageToken as a value for the query
  21149. // parameter pageToken in the next list request. Subsequent list
  21150. // requests will have their own nextPageToken to continue paging through
  21151. // the results.
  21152. NextPageToken string `json:"nextPageToken,omitempty"`
  21153. // SelfLink: [Output Only] Server-defined URL for this resource.
  21154. SelfLink string `json:"selfLink,omitempty"`
  21155. // Warning: [Output Only] Informational warning message.
  21156. Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
  21157. // ServerResponse contains the HTTP response code and headers from the
  21158. // server.
  21159. googleapi.ServerResponse `json:"-"`
  21160. // ForceSendFields is a list of field names (e.g. "Id") to
  21161. // unconditionally include in API requests. By default, fields with
  21162. // empty values are omitted from API requests. However, any non-pointer,
  21163. // non-interface field appearing in ForceSendFields will be sent to the
  21164. // server regardless of whether the field is empty or not. This may be
  21165. // used to include empty fields in Patch requests.
  21166. ForceSendFields []string `json:"-"`
  21167. // NullFields is a list of field names (e.g. "Id") to include in API
  21168. // requests with the JSON null value. By default, fields with empty
  21169. // values are omitted from API requests. However, any field with an
  21170. // empty value appearing in NullFields will be sent to the server as
  21171. // null. It is an error if a field in this list has a non-empty value.
  21172. // This may be used to include null fields in Patch requests.
  21173. NullFields []string `json:"-"`
  21174. }
  21175. func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
  21176. type NoMethod NodeTemplateAggregatedList
  21177. raw := NoMethod(*s)
  21178. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21179. }
  21180. // NodeTemplateAggregatedListWarning: [Output Only] Informational
  21181. // warning message.
  21182. type NodeTemplateAggregatedListWarning struct {
  21183. // Code: [Output Only] A warning code, if applicable. For example,
  21184. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21185. // the response.
  21186. //
  21187. // Possible values:
  21188. // "CLEANUP_FAILED"
  21189. // "DEPRECATED_RESOURCE_USED"
  21190. // "DEPRECATED_TYPE_USED"
  21191. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21192. // "EXPERIMENTAL_TYPE_USED"
  21193. // "EXTERNAL_API_WARNING"
  21194. // "FIELD_VALUE_OVERRIDEN"
  21195. // "INJECTED_KERNELS_DEPRECATED"
  21196. // "MISSING_TYPE_DEPENDENCY"
  21197. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21198. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21199. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21200. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21201. // "NEXT_HOP_NOT_RUNNING"
  21202. // "NOT_CRITICAL_ERROR"
  21203. // "NO_RESULTS_ON_PAGE"
  21204. // "REQUIRED_TOS_AGREEMENT"
  21205. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21206. // "RESOURCE_NOT_DELETED"
  21207. // "SCHEMA_VALIDATION_IGNORED"
  21208. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21209. // "UNDECLARED_PROPERTIES"
  21210. // "UNREACHABLE"
  21211. Code string `json:"code,omitempty"`
  21212. // Data: [Output Only] Metadata about this warning in key: value format.
  21213. // For example:
  21214. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21215. Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
  21216. // Message: [Output Only] A human-readable description of the warning
  21217. // code.
  21218. Message string `json:"message,omitempty"`
  21219. // ForceSendFields is a list of field names (e.g. "Code") to
  21220. // unconditionally include in API requests. By default, fields with
  21221. // empty values are omitted from API requests. However, any non-pointer,
  21222. // non-interface field appearing in ForceSendFields will be sent to the
  21223. // server regardless of whether the field is empty or not. This may be
  21224. // used to include empty fields in Patch requests.
  21225. ForceSendFields []string `json:"-"`
  21226. // NullFields is a list of field names (e.g. "Code") to include in API
  21227. // requests with the JSON null value. By default, fields with empty
  21228. // values are omitted from API requests. However, any field with an
  21229. // empty value appearing in NullFields will be sent to the server as
  21230. // null. It is an error if a field in this list has a non-empty value.
  21231. // This may be used to include null fields in Patch requests.
  21232. NullFields []string `json:"-"`
  21233. }
  21234. func (s *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  21235. type NoMethod NodeTemplateAggregatedListWarning
  21236. raw := NoMethod(*s)
  21237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21238. }
  21239. type NodeTemplateAggregatedListWarningData struct {
  21240. // Key: [Output Only] A key that provides more detail on the warning
  21241. // being returned. For example, for warnings where there are no results
  21242. // in a list request for a particular zone, this key might be scope and
  21243. // the key value might be the zone name. Other examples might be a key
  21244. // indicating a deprecated resource and a suggested replacement, or a
  21245. // warning about invalid network settings (for example, if an instance
  21246. // attempts to perform IP forwarding but is not enabled for IP
  21247. // forwarding).
  21248. Key string `json:"key,omitempty"`
  21249. // Value: [Output Only] A warning data value corresponding to the key.
  21250. Value string `json:"value,omitempty"`
  21251. // ForceSendFields is a list of field names (e.g. "Key") to
  21252. // unconditionally include in API requests. By default, fields with
  21253. // empty values are omitted from API requests. However, any non-pointer,
  21254. // non-interface field appearing in ForceSendFields will be sent to the
  21255. // server regardless of whether the field is empty or not. This may be
  21256. // used to include empty fields in Patch requests.
  21257. ForceSendFields []string `json:"-"`
  21258. // NullFields is a list of field names (e.g. "Key") to include in API
  21259. // requests with the JSON null value. By default, fields with empty
  21260. // values are omitted from API requests. However, any field with an
  21261. // empty value appearing in NullFields will be sent to the server as
  21262. // null. It is an error if a field in this list has a non-empty value.
  21263. // This may be used to include null fields in Patch requests.
  21264. NullFields []string `json:"-"`
  21265. }
  21266. func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  21267. type NoMethod NodeTemplateAggregatedListWarningData
  21268. raw := NoMethod(*s)
  21269. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21270. }
  21271. // NodeTemplateList: Contains a list of node templates.
  21272. type NodeTemplateList struct {
  21273. // Id: [Output Only] Unique identifier for the resource; defined by the
  21274. // server.
  21275. Id string `json:"id,omitempty"`
  21276. // Items: A list of NodeTemplate resources.
  21277. Items []*NodeTemplate `json:"items,omitempty"`
  21278. // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
  21279. // for lists of node templates.
  21280. Kind string `json:"kind,omitempty"`
  21281. // NextPageToken: [Output Only] This token allows you to get the next
  21282. // page of results for list requests. If the number of results is larger
  21283. // than maxResults, use the nextPageToken as a value for the query
  21284. // parameter pageToken in the next list request. Subsequent list
  21285. // requests will have their own nextPageToken to continue paging through
  21286. // the results.
  21287. NextPageToken string `json:"nextPageToken,omitempty"`
  21288. // SelfLink: [Output Only] Server-defined URL for this resource.
  21289. SelfLink string `json:"selfLink,omitempty"`
  21290. // Warning: [Output Only] Informational warning message.
  21291. Warning *NodeTemplateListWarning `json:"warning,omitempty"`
  21292. // ServerResponse contains the HTTP response code and headers from the
  21293. // server.
  21294. googleapi.ServerResponse `json:"-"`
  21295. // ForceSendFields is a list of field names (e.g. "Id") to
  21296. // unconditionally include in API requests. By default, fields with
  21297. // empty values are omitted from API requests. However, any non-pointer,
  21298. // non-interface field appearing in ForceSendFields will be sent to the
  21299. // server regardless of whether the field is empty or not. This may be
  21300. // used to include empty fields in Patch requests.
  21301. ForceSendFields []string `json:"-"`
  21302. // NullFields is a list of field names (e.g. "Id") to include in API
  21303. // requests with the JSON null value. By default, fields with empty
  21304. // values are omitted from API requests. However, any field with an
  21305. // empty value appearing in NullFields will be sent to the server as
  21306. // null. It is an error if a field in this list has a non-empty value.
  21307. // This may be used to include null fields in Patch requests.
  21308. NullFields []string `json:"-"`
  21309. }
  21310. func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
  21311. type NoMethod NodeTemplateList
  21312. raw := NoMethod(*s)
  21313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21314. }
  21315. // NodeTemplateListWarning: [Output Only] Informational warning message.
  21316. type NodeTemplateListWarning struct {
  21317. // Code: [Output Only] A warning code, if applicable. For example,
  21318. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21319. // the response.
  21320. //
  21321. // Possible values:
  21322. // "CLEANUP_FAILED"
  21323. // "DEPRECATED_RESOURCE_USED"
  21324. // "DEPRECATED_TYPE_USED"
  21325. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21326. // "EXPERIMENTAL_TYPE_USED"
  21327. // "EXTERNAL_API_WARNING"
  21328. // "FIELD_VALUE_OVERRIDEN"
  21329. // "INJECTED_KERNELS_DEPRECATED"
  21330. // "MISSING_TYPE_DEPENDENCY"
  21331. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21332. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21333. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21334. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21335. // "NEXT_HOP_NOT_RUNNING"
  21336. // "NOT_CRITICAL_ERROR"
  21337. // "NO_RESULTS_ON_PAGE"
  21338. // "REQUIRED_TOS_AGREEMENT"
  21339. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21340. // "RESOURCE_NOT_DELETED"
  21341. // "SCHEMA_VALIDATION_IGNORED"
  21342. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21343. // "UNDECLARED_PROPERTIES"
  21344. // "UNREACHABLE"
  21345. Code string `json:"code,omitempty"`
  21346. // Data: [Output Only] Metadata about this warning in key: value format.
  21347. // For example:
  21348. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21349. Data []*NodeTemplateListWarningData `json:"data,omitempty"`
  21350. // Message: [Output Only] A human-readable description of the warning
  21351. // code.
  21352. Message string `json:"message,omitempty"`
  21353. // ForceSendFields is a list of field names (e.g. "Code") to
  21354. // unconditionally include in API requests. By default, fields with
  21355. // empty values are omitted from API requests. However, any non-pointer,
  21356. // non-interface field appearing in ForceSendFields will be sent to the
  21357. // server regardless of whether the field is empty or not. This may be
  21358. // used to include empty fields in Patch requests.
  21359. ForceSendFields []string `json:"-"`
  21360. // NullFields is a list of field names (e.g. "Code") to include in API
  21361. // requests with the JSON null value. By default, fields with empty
  21362. // values are omitted from API requests. However, any field with an
  21363. // empty value appearing in NullFields will be sent to the server as
  21364. // null. It is an error if a field in this list has a non-empty value.
  21365. // This may be used to include null fields in Patch requests.
  21366. NullFields []string `json:"-"`
  21367. }
  21368. func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
  21369. type NoMethod NodeTemplateListWarning
  21370. raw := NoMethod(*s)
  21371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21372. }
  21373. type NodeTemplateListWarningData struct {
  21374. // Key: [Output Only] A key that provides more detail on the warning
  21375. // being returned. For example, for warnings where there are no results
  21376. // in a list request for a particular zone, this key might be scope and
  21377. // the key value might be the zone name. Other examples might be a key
  21378. // indicating a deprecated resource and a suggested replacement, or a
  21379. // warning about invalid network settings (for example, if an instance
  21380. // attempts to perform IP forwarding but is not enabled for IP
  21381. // forwarding).
  21382. Key string `json:"key,omitempty"`
  21383. // Value: [Output Only] A warning data value corresponding to the key.
  21384. Value string `json:"value,omitempty"`
  21385. // ForceSendFields is a list of field names (e.g. "Key") to
  21386. // unconditionally include in API requests. By default, fields with
  21387. // empty values are omitted from API requests. However, any non-pointer,
  21388. // non-interface field appearing in ForceSendFields will be sent to the
  21389. // server regardless of whether the field is empty or not. This may be
  21390. // used to include empty fields in Patch requests.
  21391. ForceSendFields []string `json:"-"`
  21392. // NullFields is a list of field names (e.g. "Key") to include in API
  21393. // requests with the JSON null value. By default, fields with empty
  21394. // values are omitted from API requests. However, any field with an
  21395. // empty value appearing in NullFields will be sent to the server as
  21396. // null. It is an error if a field in this list has a non-empty value.
  21397. // This may be used to include null fields in Patch requests.
  21398. NullFields []string `json:"-"`
  21399. }
  21400. func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
  21401. type NoMethod NodeTemplateListWarningData
  21402. raw := NoMethod(*s)
  21403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21404. }
  21405. type NodeTemplateNodeTypeFlexibility struct {
  21406. Cpus string `json:"cpus,omitempty"`
  21407. LocalSsd string `json:"localSsd,omitempty"`
  21408. Memory string `json:"memory,omitempty"`
  21409. // ForceSendFields is a list of field names (e.g. "Cpus") to
  21410. // unconditionally include in API requests. By default, fields with
  21411. // empty values are omitted from API requests. However, any non-pointer,
  21412. // non-interface field appearing in ForceSendFields will be sent to the
  21413. // server regardless of whether the field is empty or not. This may be
  21414. // used to include empty fields in Patch requests.
  21415. ForceSendFields []string `json:"-"`
  21416. // NullFields is a list of field names (e.g. "Cpus") to include in API
  21417. // requests with the JSON null value. By default, fields with empty
  21418. // values are omitted from API requests. However, any field with an
  21419. // empty value appearing in NullFields will be sent to the server as
  21420. // null. It is an error if a field in this list has a non-empty value.
  21421. // This may be used to include null fields in Patch requests.
  21422. NullFields []string `json:"-"`
  21423. }
  21424. func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
  21425. type NoMethod NodeTemplateNodeTypeFlexibility
  21426. raw := NoMethod(*s)
  21427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21428. }
  21429. type NodeTemplatesScopedList struct {
  21430. // NodeTemplates: [Output Only] A list of node templates contained in
  21431. // this scope.
  21432. NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
  21433. // Warning: [Output Only] An informational warning that appears when the
  21434. // node templates list is empty.
  21435. Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
  21436. // ForceSendFields is a list of field names (e.g. "NodeTemplates") to
  21437. // unconditionally include in API requests. By default, fields with
  21438. // empty values are omitted from API requests. However, any non-pointer,
  21439. // non-interface field appearing in ForceSendFields will be sent to the
  21440. // server regardless of whether the field is empty or not. This may be
  21441. // used to include empty fields in Patch requests.
  21442. ForceSendFields []string `json:"-"`
  21443. // NullFields is a list of field names (e.g. "NodeTemplates") to include
  21444. // in API requests with the JSON null value. By default, fields with
  21445. // empty values are omitted from API requests. However, any field with
  21446. // an empty value appearing in NullFields will be sent to the server as
  21447. // null. It is an error if a field in this list has a non-empty value.
  21448. // This may be used to include null fields in Patch requests.
  21449. NullFields []string `json:"-"`
  21450. }
  21451. func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
  21452. type NoMethod NodeTemplatesScopedList
  21453. raw := NoMethod(*s)
  21454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21455. }
  21456. // NodeTemplatesScopedListWarning: [Output Only] An informational
  21457. // warning that appears when the node templates list is empty.
  21458. type NodeTemplatesScopedListWarning struct {
  21459. // Code: [Output Only] A warning code, if applicable. For example,
  21460. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21461. // the response.
  21462. //
  21463. // Possible values:
  21464. // "CLEANUP_FAILED"
  21465. // "DEPRECATED_RESOURCE_USED"
  21466. // "DEPRECATED_TYPE_USED"
  21467. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21468. // "EXPERIMENTAL_TYPE_USED"
  21469. // "EXTERNAL_API_WARNING"
  21470. // "FIELD_VALUE_OVERRIDEN"
  21471. // "INJECTED_KERNELS_DEPRECATED"
  21472. // "MISSING_TYPE_DEPENDENCY"
  21473. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21474. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21475. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21476. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21477. // "NEXT_HOP_NOT_RUNNING"
  21478. // "NOT_CRITICAL_ERROR"
  21479. // "NO_RESULTS_ON_PAGE"
  21480. // "REQUIRED_TOS_AGREEMENT"
  21481. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21482. // "RESOURCE_NOT_DELETED"
  21483. // "SCHEMA_VALIDATION_IGNORED"
  21484. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21485. // "UNDECLARED_PROPERTIES"
  21486. // "UNREACHABLE"
  21487. Code string `json:"code,omitempty"`
  21488. // Data: [Output Only] Metadata about this warning in key: value format.
  21489. // For example:
  21490. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21491. Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
  21492. // Message: [Output Only] A human-readable description of the warning
  21493. // code.
  21494. Message string `json:"message,omitempty"`
  21495. // ForceSendFields is a list of field names (e.g. "Code") to
  21496. // unconditionally include in API requests. By default, fields with
  21497. // empty values are omitted from API requests. However, any non-pointer,
  21498. // non-interface field appearing in ForceSendFields will be sent to the
  21499. // server regardless of whether the field is empty or not. This may be
  21500. // used to include empty fields in Patch requests.
  21501. ForceSendFields []string `json:"-"`
  21502. // NullFields is a list of field names (e.g. "Code") to include in API
  21503. // requests with the JSON null value. By default, fields with empty
  21504. // values are omitted from API requests. However, any field with an
  21505. // empty value appearing in NullFields will be sent to the server as
  21506. // null. It is an error if a field in this list has a non-empty value.
  21507. // This may be used to include null fields in Patch requests.
  21508. NullFields []string `json:"-"`
  21509. }
  21510. func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
  21511. type NoMethod NodeTemplatesScopedListWarning
  21512. raw := NoMethod(*s)
  21513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21514. }
  21515. type NodeTemplatesScopedListWarningData struct {
  21516. // Key: [Output Only] A key that provides more detail on the warning
  21517. // being returned. For example, for warnings where there are no results
  21518. // in a list request for a particular zone, this key might be scope and
  21519. // the key value might be the zone name. Other examples might be a key
  21520. // indicating a deprecated resource and a suggested replacement, or a
  21521. // warning about invalid network settings (for example, if an instance
  21522. // attempts to perform IP forwarding but is not enabled for IP
  21523. // forwarding).
  21524. Key string `json:"key,omitempty"`
  21525. // Value: [Output Only] A warning data value corresponding to the key.
  21526. Value string `json:"value,omitempty"`
  21527. // ForceSendFields is a list of field names (e.g. "Key") to
  21528. // unconditionally include in API requests. By default, fields with
  21529. // empty values are omitted from API requests. However, any non-pointer,
  21530. // non-interface field appearing in ForceSendFields will be sent to the
  21531. // server regardless of whether the field is empty or not. This may be
  21532. // used to include empty fields in Patch requests.
  21533. ForceSendFields []string `json:"-"`
  21534. // NullFields is a list of field names (e.g. "Key") to include in API
  21535. // requests with the JSON null value. By default, fields with empty
  21536. // values are omitted from API requests. However, any field with an
  21537. // empty value appearing in NullFields will be sent to the server as
  21538. // null. It is an error if a field in this list has a non-empty value.
  21539. // This may be used to include null fields in Patch requests.
  21540. NullFields []string `json:"-"`
  21541. }
  21542. func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  21543. type NoMethod NodeTemplatesScopedListWarningData
  21544. raw := NoMethod(*s)
  21545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21546. }
  21547. // NodeType: A Node Type resource.
  21548. type NodeType struct {
  21549. // CpuPlatform: [Output Only] The CPU platform used by this node type.
  21550. CpuPlatform string `json:"cpuPlatform,omitempty"`
  21551. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21552. // format.
  21553. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21554. // Deprecated: [Output Only] The deprecation status associated with this
  21555. // node type.
  21556. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  21557. // Description: [Output Only] An optional textual description of the
  21558. // resource.
  21559. Description string `json:"description,omitempty"`
  21560. // GuestCpus: [Output Only] The number of virtual CPUs that are
  21561. // available to the node type.
  21562. GuestCpus int64 `json:"guestCpus,omitempty"`
  21563. // Id: [Output Only] The unique identifier for the resource. This
  21564. // identifier is defined by the server.
  21565. Id uint64 `json:"id,omitempty,string"`
  21566. // Kind: [Output Only] The type of the resource. Always compute#nodeType
  21567. // for node types.
  21568. Kind string `json:"kind,omitempty"`
  21569. // LocalSsdGb: [Output Only] Local SSD available to the node type,
  21570. // defined in GB.
  21571. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  21572. // MemoryMb: [Output Only] The amount of physical memory available to
  21573. // the node type, defined in MB.
  21574. MemoryMb int64 `json:"memoryMb,omitempty"`
  21575. // Name: [Output Only] Name of the resource.
  21576. Name string `json:"name,omitempty"`
  21577. // SelfLink: [Output Only] Server-defined URL for the resource.
  21578. SelfLink string `json:"selfLink,omitempty"`
  21579. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  21580. // with the resource id.
  21581. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  21582. // Zone: [Output Only] The name of the zone where the node type resides,
  21583. // such as us-central1-a.
  21584. Zone string `json:"zone,omitempty"`
  21585. // ServerResponse contains the HTTP response code and headers from the
  21586. // server.
  21587. googleapi.ServerResponse `json:"-"`
  21588. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  21589. // unconditionally include in API requests. By default, fields with
  21590. // empty values are omitted from API requests. However, any non-pointer,
  21591. // non-interface field appearing in ForceSendFields will be sent to the
  21592. // server regardless of whether the field is empty or not. This may be
  21593. // used to include empty fields in Patch requests.
  21594. ForceSendFields []string `json:"-"`
  21595. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  21596. // in API requests with the JSON null value. By default, fields with
  21597. // empty values are omitted from API requests. However, any field with
  21598. // an empty value appearing in NullFields will be sent to the server as
  21599. // null. It is an error if a field in this list has a non-empty value.
  21600. // This may be used to include null fields in Patch requests.
  21601. NullFields []string `json:"-"`
  21602. }
  21603. func (s *NodeType) MarshalJSON() ([]byte, error) {
  21604. type NoMethod NodeType
  21605. raw := NoMethod(*s)
  21606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21607. }
  21608. type NodeTypeAggregatedList struct {
  21609. // Id: [Output Only] Unique identifier for the resource; defined by the
  21610. // server.
  21611. Id string `json:"id,omitempty"`
  21612. // Items: A list of NodeTypesScopedList resources.
  21613. Items map[string]NodeTypesScopedList `json:"items,omitempty"`
  21614. // Kind: [Output Only] Type of resource.Always
  21615. // compute#nodeTypeAggregatedList for aggregated lists of node types.
  21616. Kind string `json:"kind,omitempty"`
  21617. // NextPageToken: [Output Only] This token allows you to get the next
  21618. // page of results for list requests. If the number of results is larger
  21619. // than maxResults, use the nextPageToken as a value for the query
  21620. // parameter pageToken in the next list request. Subsequent list
  21621. // requests will have their own nextPageToken to continue paging through
  21622. // the results.
  21623. NextPageToken string `json:"nextPageToken,omitempty"`
  21624. // SelfLink: [Output Only] Server-defined URL for this resource.
  21625. SelfLink string `json:"selfLink,omitempty"`
  21626. // Warning: [Output Only] Informational warning message.
  21627. Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
  21628. // ServerResponse contains the HTTP response code and headers from the
  21629. // server.
  21630. googleapi.ServerResponse `json:"-"`
  21631. // ForceSendFields is a list of field names (e.g. "Id") to
  21632. // unconditionally include in API requests. By default, fields with
  21633. // empty values are omitted from API requests. However, any non-pointer,
  21634. // non-interface field appearing in ForceSendFields will be sent to the
  21635. // server regardless of whether the field is empty or not. This may be
  21636. // used to include empty fields in Patch requests.
  21637. ForceSendFields []string `json:"-"`
  21638. // NullFields is a list of field names (e.g. "Id") to include in API
  21639. // requests with the JSON null value. By default, fields with empty
  21640. // values are omitted from API requests. However, any field with an
  21641. // empty value appearing in NullFields will be sent to the server as
  21642. // null. It is an error if a field in this list has a non-empty value.
  21643. // This may be used to include null fields in Patch requests.
  21644. NullFields []string `json:"-"`
  21645. }
  21646. func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
  21647. type NoMethod NodeTypeAggregatedList
  21648. raw := NoMethod(*s)
  21649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21650. }
  21651. // NodeTypeAggregatedListWarning: [Output Only] Informational warning
  21652. // message.
  21653. type NodeTypeAggregatedListWarning struct {
  21654. // Code: [Output Only] A warning code, if applicable. For example,
  21655. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21656. // the response.
  21657. //
  21658. // Possible values:
  21659. // "CLEANUP_FAILED"
  21660. // "DEPRECATED_RESOURCE_USED"
  21661. // "DEPRECATED_TYPE_USED"
  21662. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21663. // "EXPERIMENTAL_TYPE_USED"
  21664. // "EXTERNAL_API_WARNING"
  21665. // "FIELD_VALUE_OVERRIDEN"
  21666. // "INJECTED_KERNELS_DEPRECATED"
  21667. // "MISSING_TYPE_DEPENDENCY"
  21668. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21669. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21670. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21671. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21672. // "NEXT_HOP_NOT_RUNNING"
  21673. // "NOT_CRITICAL_ERROR"
  21674. // "NO_RESULTS_ON_PAGE"
  21675. // "REQUIRED_TOS_AGREEMENT"
  21676. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21677. // "RESOURCE_NOT_DELETED"
  21678. // "SCHEMA_VALIDATION_IGNORED"
  21679. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21680. // "UNDECLARED_PROPERTIES"
  21681. // "UNREACHABLE"
  21682. Code string `json:"code,omitempty"`
  21683. // Data: [Output Only] Metadata about this warning in key: value format.
  21684. // For example:
  21685. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21686. Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
  21687. // Message: [Output Only] A human-readable description of the warning
  21688. // code.
  21689. Message string `json:"message,omitempty"`
  21690. // ForceSendFields is a list of field names (e.g. "Code") to
  21691. // unconditionally include in API requests. By default, fields with
  21692. // empty values are omitted from API requests. However, any non-pointer,
  21693. // non-interface field appearing in ForceSendFields will be sent to the
  21694. // server regardless of whether the field is empty or not. This may be
  21695. // used to include empty fields in Patch requests.
  21696. ForceSendFields []string `json:"-"`
  21697. // NullFields is a list of field names (e.g. "Code") to include in API
  21698. // requests with the JSON null value. By default, fields with empty
  21699. // values are omitted from API requests. However, any field with an
  21700. // empty value appearing in NullFields will be sent to the server as
  21701. // null. It is an error if a field in this list has a non-empty value.
  21702. // This may be used to include null fields in Patch requests.
  21703. NullFields []string `json:"-"`
  21704. }
  21705. func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  21706. type NoMethod NodeTypeAggregatedListWarning
  21707. raw := NoMethod(*s)
  21708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21709. }
  21710. type NodeTypeAggregatedListWarningData struct {
  21711. // Key: [Output Only] A key that provides more detail on the warning
  21712. // being returned. For example, for warnings where there are no results
  21713. // in a list request for a particular zone, this key might be scope and
  21714. // the key value might be the zone name. Other examples might be a key
  21715. // indicating a deprecated resource and a suggested replacement, or a
  21716. // warning about invalid network settings (for example, if an instance
  21717. // attempts to perform IP forwarding but is not enabled for IP
  21718. // forwarding).
  21719. Key string `json:"key,omitempty"`
  21720. // Value: [Output Only] A warning data value corresponding to the key.
  21721. Value string `json:"value,omitempty"`
  21722. // ForceSendFields is a list of field names (e.g. "Key") to
  21723. // unconditionally include in API requests. By default, fields with
  21724. // empty values are omitted from API requests. However, any non-pointer,
  21725. // non-interface field appearing in ForceSendFields will be sent to the
  21726. // server regardless of whether the field is empty or not. This may be
  21727. // used to include empty fields in Patch requests.
  21728. ForceSendFields []string `json:"-"`
  21729. // NullFields is a list of field names (e.g. "Key") to include in API
  21730. // requests with the JSON null value. By default, fields with empty
  21731. // values are omitted from API requests. However, any field with an
  21732. // empty value appearing in NullFields will be sent to the server as
  21733. // null. It is an error if a field in this list has a non-empty value.
  21734. // This may be used to include null fields in Patch requests.
  21735. NullFields []string `json:"-"`
  21736. }
  21737. func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  21738. type NoMethod NodeTypeAggregatedListWarningData
  21739. raw := NoMethod(*s)
  21740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21741. }
  21742. // NodeTypeList: Contains a list of node types.
  21743. type NodeTypeList struct {
  21744. // Id: [Output Only] Unique identifier for the resource; defined by the
  21745. // server.
  21746. Id string `json:"id,omitempty"`
  21747. // Items: A list of NodeType resources.
  21748. Items []*NodeType `json:"items,omitempty"`
  21749. // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
  21750. // lists of node types.
  21751. Kind string `json:"kind,omitempty"`
  21752. // NextPageToken: [Output Only] This token allows you to get the next
  21753. // page of results for list requests. If the number of results is larger
  21754. // than maxResults, use the nextPageToken as a value for the query
  21755. // parameter pageToken in the next list request. Subsequent list
  21756. // requests will have their own nextPageToken to continue paging through
  21757. // the results.
  21758. NextPageToken string `json:"nextPageToken,omitempty"`
  21759. // SelfLink: [Output Only] Server-defined URL for this resource.
  21760. SelfLink string `json:"selfLink,omitempty"`
  21761. // Warning: [Output Only] Informational warning message.
  21762. Warning *NodeTypeListWarning `json:"warning,omitempty"`
  21763. // ServerResponse contains the HTTP response code and headers from the
  21764. // server.
  21765. googleapi.ServerResponse `json:"-"`
  21766. // ForceSendFields is a list of field names (e.g. "Id") to
  21767. // unconditionally include in API requests. By default, fields with
  21768. // empty values are omitted from API requests. However, any non-pointer,
  21769. // non-interface field appearing in ForceSendFields will be sent to the
  21770. // server regardless of whether the field is empty or not. This may be
  21771. // used to include empty fields in Patch requests.
  21772. ForceSendFields []string `json:"-"`
  21773. // NullFields is a list of field names (e.g. "Id") to include in API
  21774. // requests with the JSON null value. By default, fields with empty
  21775. // values are omitted from API requests. However, any field with an
  21776. // empty value appearing in NullFields will be sent to the server as
  21777. // null. It is an error if a field in this list has a non-empty value.
  21778. // This may be used to include null fields in Patch requests.
  21779. NullFields []string `json:"-"`
  21780. }
  21781. func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
  21782. type NoMethod NodeTypeList
  21783. raw := NoMethod(*s)
  21784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21785. }
  21786. // NodeTypeListWarning: [Output Only] Informational warning message.
  21787. type NodeTypeListWarning struct {
  21788. // Code: [Output Only] A warning code, if applicable. For example,
  21789. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21790. // the response.
  21791. //
  21792. // Possible values:
  21793. // "CLEANUP_FAILED"
  21794. // "DEPRECATED_RESOURCE_USED"
  21795. // "DEPRECATED_TYPE_USED"
  21796. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21797. // "EXPERIMENTAL_TYPE_USED"
  21798. // "EXTERNAL_API_WARNING"
  21799. // "FIELD_VALUE_OVERRIDEN"
  21800. // "INJECTED_KERNELS_DEPRECATED"
  21801. // "MISSING_TYPE_DEPENDENCY"
  21802. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21803. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21804. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21805. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21806. // "NEXT_HOP_NOT_RUNNING"
  21807. // "NOT_CRITICAL_ERROR"
  21808. // "NO_RESULTS_ON_PAGE"
  21809. // "REQUIRED_TOS_AGREEMENT"
  21810. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21811. // "RESOURCE_NOT_DELETED"
  21812. // "SCHEMA_VALIDATION_IGNORED"
  21813. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21814. // "UNDECLARED_PROPERTIES"
  21815. // "UNREACHABLE"
  21816. Code string `json:"code,omitempty"`
  21817. // Data: [Output Only] Metadata about this warning in key: value format.
  21818. // For example:
  21819. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21820. Data []*NodeTypeListWarningData `json:"data,omitempty"`
  21821. // Message: [Output Only] A human-readable description of the warning
  21822. // code.
  21823. Message string `json:"message,omitempty"`
  21824. // ForceSendFields is a list of field names (e.g. "Code") to
  21825. // unconditionally include in API requests. By default, fields with
  21826. // empty values are omitted from API requests. However, any non-pointer,
  21827. // non-interface field appearing in ForceSendFields will be sent to the
  21828. // server regardless of whether the field is empty or not. This may be
  21829. // used to include empty fields in Patch requests.
  21830. ForceSendFields []string `json:"-"`
  21831. // NullFields is a list of field names (e.g. "Code") to include in API
  21832. // requests with the JSON null value. By default, fields with empty
  21833. // values are omitted from API requests. However, any field with an
  21834. // empty value appearing in NullFields will be sent to the server as
  21835. // null. It is an error if a field in this list has a non-empty value.
  21836. // This may be used to include null fields in Patch requests.
  21837. NullFields []string `json:"-"`
  21838. }
  21839. func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
  21840. type NoMethod NodeTypeListWarning
  21841. raw := NoMethod(*s)
  21842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21843. }
  21844. type NodeTypeListWarningData struct {
  21845. // Key: [Output Only] A key that provides more detail on the warning
  21846. // being returned. For example, for warnings where there are no results
  21847. // in a list request for a particular zone, this key might be scope and
  21848. // the key value might be the zone name. Other examples might be a key
  21849. // indicating a deprecated resource and a suggested replacement, or a
  21850. // warning about invalid network settings (for example, if an instance
  21851. // attempts to perform IP forwarding but is not enabled for IP
  21852. // forwarding).
  21853. Key string `json:"key,omitempty"`
  21854. // Value: [Output Only] A warning data value corresponding to the key.
  21855. Value string `json:"value,omitempty"`
  21856. // ForceSendFields is a list of field names (e.g. "Key") to
  21857. // unconditionally include in API requests. By default, fields with
  21858. // empty values are omitted from API requests. However, any non-pointer,
  21859. // non-interface field appearing in ForceSendFields will be sent to the
  21860. // server regardless of whether the field is empty or not. This may be
  21861. // used to include empty fields in Patch requests.
  21862. ForceSendFields []string `json:"-"`
  21863. // NullFields is a list of field names (e.g. "Key") to include in API
  21864. // requests with the JSON null value. By default, fields with empty
  21865. // values are omitted from API requests. However, any field with an
  21866. // empty value appearing in NullFields will be sent to the server as
  21867. // null. It is an error if a field in this list has a non-empty value.
  21868. // This may be used to include null fields in Patch requests.
  21869. NullFields []string `json:"-"`
  21870. }
  21871. func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
  21872. type NoMethod NodeTypeListWarningData
  21873. raw := NoMethod(*s)
  21874. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21875. }
  21876. type NodeTypesScopedList struct {
  21877. // NodeTypes: [Output Only] A list of node types contained in this
  21878. // scope.
  21879. NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
  21880. // Warning: [Output Only] An informational warning that appears when the
  21881. // node types list is empty.
  21882. Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
  21883. // ForceSendFields is a list of field names (e.g. "NodeTypes") to
  21884. // unconditionally include in API requests. By default, fields with
  21885. // empty values are omitted from API requests. However, any non-pointer,
  21886. // non-interface field appearing in ForceSendFields will be sent to the
  21887. // server regardless of whether the field is empty or not. This may be
  21888. // used to include empty fields in Patch requests.
  21889. ForceSendFields []string `json:"-"`
  21890. // NullFields is a list of field names (e.g. "NodeTypes") to include in
  21891. // API requests with the JSON null value. By default, fields with empty
  21892. // values are omitted from API requests. However, any field with an
  21893. // empty value appearing in NullFields will be sent to the server as
  21894. // null. It is an error if a field in this list has a non-empty value.
  21895. // This may be used to include null fields in Patch requests.
  21896. NullFields []string `json:"-"`
  21897. }
  21898. func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
  21899. type NoMethod NodeTypesScopedList
  21900. raw := NoMethod(*s)
  21901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21902. }
  21903. // NodeTypesScopedListWarning: [Output Only] An informational warning
  21904. // that appears when the node types list is empty.
  21905. type NodeTypesScopedListWarning struct {
  21906. // Code: [Output Only] A warning code, if applicable. For example,
  21907. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21908. // the response.
  21909. //
  21910. // Possible values:
  21911. // "CLEANUP_FAILED"
  21912. // "DEPRECATED_RESOURCE_USED"
  21913. // "DEPRECATED_TYPE_USED"
  21914. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21915. // "EXPERIMENTAL_TYPE_USED"
  21916. // "EXTERNAL_API_WARNING"
  21917. // "FIELD_VALUE_OVERRIDEN"
  21918. // "INJECTED_KERNELS_DEPRECATED"
  21919. // "MISSING_TYPE_DEPENDENCY"
  21920. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21921. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21922. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21923. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21924. // "NEXT_HOP_NOT_RUNNING"
  21925. // "NOT_CRITICAL_ERROR"
  21926. // "NO_RESULTS_ON_PAGE"
  21927. // "REQUIRED_TOS_AGREEMENT"
  21928. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21929. // "RESOURCE_NOT_DELETED"
  21930. // "SCHEMA_VALIDATION_IGNORED"
  21931. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21932. // "UNDECLARED_PROPERTIES"
  21933. // "UNREACHABLE"
  21934. Code string `json:"code,omitempty"`
  21935. // Data: [Output Only] Metadata about this warning in key: value format.
  21936. // For example:
  21937. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21938. Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
  21939. // Message: [Output Only] A human-readable description of the warning
  21940. // code.
  21941. Message string `json:"message,omitempty"`
  21942. // ForceSendFields is a list of field names (e.g. "Code") to
  21943. // unconditionally include in API requests. By default, fields with
  21944. // empty values are omitted from API requests. However, any non-pointer,
  21945. // non-interface field appearing in ForceSendFields will be sent to the
  21946. // server regardless of whether the field is empty or not. This may be
  21947. // used to include empty fields in Patch requests.
  21948. ForceSendFields []string `json:"-"`
  21949. // NullFields is a list of field names (e.g. "Code") to include in API
  21950. // requests with the JSON null value. By default, fields with empty
  21951. // values are omitted from API requests. However, any field with an
  21952. // empty value appearing in NullFields will be sent to the server as
  21953. // null. It is an error if a field in this list has a non-empty value.
  21954. // This may be used to include null fields in Patch requests.
  21955. NullFields []string `json:"-"`
  21956. }
  21957. func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  21958. type NoMethod NodeTypesScopedListWarning
  21959. raw := NoMethod(*s)
  21960. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21961. }
  21962. type NodeTypesScopedListWarningData struct {
  21963. // Key: [Output Only] A key that provides more detail on the warning
  21964. // being returned. For example, for warnings where there are no results
  21965. // in a list request for a particular zone, this key might be scope and
  21966. // the key value might be the zone name. Other examples might be a key
  21967. // indicating a deprecated resource and a suggested replacement, or a
  21968. // warning about invalid network settings (for example, if an instance
  21969. // attempts to perform IP forwarding but is not enabled for IP
  21970. // forwarding).
  21971. Key string `json:"key,omitempty"`
  21972. // Value: [Output Only] A warning data value corresponding to the key.
  21973. Value string `json:"value,omitempty"`
  21974. // ForceSendFields is a list of field names (e.g. "Key") to
  21975. // unconditionally include in API requests. By default, fields with
  21976. // empty values are omitted from API requests. However, any non-pointer,
  21977. // non-interface field appearing in ForceSendFields will be sent to the
  21978. // server regardless of whether the field is empty or not. This may be
  21979. // used to include empty fields in Patch requests.
  21980. ForceSendFields []string `json:"-"`
  21981. // NullFields is a list of field names (e.g. "Key") to include in API
  21982. // requests with the JSON null value. By default, fields with empty
  21983. // values are omitted from API requests. However, any field with an
  21984. // empty value appearing in NullFields will be sent to the server as
  21985. // null. It is an error if a field in this list has a non-empty value.
  21986. // This may be used to include null fields in Patch requests.
  21987. NullFields []string `json:"-"`
  21988. }
  21989. func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  21990. type NoMethod NodeTypesScopedListWarningData
  21991. raw := NoMethod(*s)
  21992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21993. }
  21994. // NotificationEndpoint: A notification endpoint resource defines an
  21995. // endpoint to receive notifications when there are status changes
  21996. // detected by the associated health check service.
  21997. type NotificationEndpoint struct {
  21998. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21999. // format.
  22000. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22001. // Description: An optional description of this resource. Provide this
  22002. // property when you create the resource.
  22003. Description string `json:"description,omitempty"`
  22004. // GrpcSettings: Settings of the gRPC notification endpoint including
  22005. // the endpoint URL and the retry duration.
  22006. GrpcSettings *NotificationEndpointGrpcSettings `json:"grpcSettings,omitempty"`
  22007. // Id: [Output Only] A unique identifier for this resource type. The
  22008. // server generates this identifier.
  22009. Id uint64 `json:"id,omitempty,string"`
  22010. // Kind: [Output Only] Type of the resource. Always
  22011. // compute#notificationEndpoint for notification endpoints.
  22012. Kind string `json:"kind,omitempty"`
  22013. // Name: Name of the resource. Provided by the client when the resource
  22014. // is created. The name must be 1-63 characters long, and comply with
  22015. // RFC1035. Specifically, the name must be 1-63 characters long and
  22016. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22017. // the first character must be a lowercase letter, and all following
  22018. // characters must be a dash, lowercase letter, or digit, except the
  22019. // last character, which cannot be a dash.
  22020. Name string `json:"name,omitempty"`
  22021. // Region: [Output Only] URL of the region where the notification
  22022. // endpoint resides. This field applies only to the regional resource.
  22023. // You must specify this field as part of the HTTP request URL. It is
  22024. // not settable as a field in the request body.
  22025. Region string `json:"region,omitempty"`
  22026. // SelfLink: [Output Only] Server-defined URL for the resource.
  22027. SelfLink string `json:"selfLink,omitempty"`
  22028. // ServerResponse contains the HTTP response code and headers from the
  22029. // server.
  22030. googleapi.ServerResponse `json:"-"`
  22031. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  22032. // to unconditionally include in API requests. By default, fields with
  22033. // empty values are omitted from API requests. However, any non-pointer,
  22034. // non-interface field appearing in ForceSendFields will be sent to the
  22035. // server regardless of whether the field is empty or not. This may be
  22036. // used to include empty fields in Patch requests.
  22037. ForceSendFields []string `json:"-"`
  22038. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  22039. // include in API requests with the JSON null value. By default, fields
  22040. // with empty values are omitted from API requests. However, any field
  22041. // with an empty value appearing in NullFields will be sent to the
  22042. // server as null. It is an error if a field in this list has a
  22043. // non-empty value. This may be used to include null fields in Patch
  22044. // requests.
  22045. NullFields []string `json:"-"`
  22046. }
  22047. func (s *NotificationEndpoint) MarshalJSON() ([]byte, error) {
  22048. type NoMethod NotificationEndpoint
  22049. raw := NoMethod(*s)
  22050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22051. }
  22052. // NotificationEndpointGrpcSettings: Represents a gRPC setting that
  22053. // describes one gRPC notification endpoint and the retry duration
  22054. // attempting to send notification to this endpoint.
  22055. type NotificationEndpointGrpcSettings struct {
  22056. // Authority: Optional. If specified, this field is used to set the
  22057. // authority header by the sender of notifications. See
  22058. // https://tools.ietf.org/html/rfc7540#section-8.1.2.3
  22059. Authority string `json:"authority,omitempty"`
  22060. // Endpoint: Endpoint to which gRPC notifications are sent. This must be
  22061. // a valid gRPCLB DNS name.
  22062. Endpoint string `json:"endpoint,omitempty"`
  22063. // PayloadName: Optional. If specified, this field is used to populate
  22064. // the ?name? field in gRPC requests.
  22065. PayloadName string `json:"payloadName,omitempty"`
  22066. // RetryDurationSec: How much time (in seconds) is spent attempting
  22067. // notification retries until a successful response is received. Default
  22068. // is 30s. Limit is 20m (1200s). Must be a positive number.
  22069. RetryDurationSec int64 `json:"retryDurationSec,omitempty"`
  22070. // ForceSendFields is a list of field names (e.g. "Authority") to
  22071. // unconditionally include in API requests. By default, fields with
  22072. // empty values are omitted from API requests. However, any non-pointer,
  22073. // non-interface field appearing in ForceSendFields will be sent to the
  22074. // server regardless of whether the field is empty or not. This may be
  22075. // used to include empty fields in Patch requests.
  22076. ForceSendFields []string `json:"-"`
  22077. // NullFields is a list of field names (e.g. "Authority") to include in
  22078. // API requests with the JSON null value. By default, fields with empty
  22079. // values are omitted from API requests. However, any field with an
  22080. // empty value appearing in NullFields will be sent to the server as
  22081. // null. It is an error if a field in this list has a non-empty value.
  22082. // This may be used to include null fields in Patch requests.
  22083. NullFields []string `json:"-"`
  22084. }
  22085. func (s *NotificationEndpointGrpcSettings) MarshalJSON() ([]byte, error) {
  22086. type NoMethod NotificationEndpointGrpcSettings
  22087. raw := NoMethod(*s)
  22088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22089. }
  22090. type NotificationEndpointList struct {
  22091. // Id: [Output Only] Unique identifier for the resource; defined by the
  22092. // server.
  22093. Id string `json:"id,omitempty"`
  22094. // Items: A list of NotificationEndpoint resources.
  22095. Items []*NotificationEndpoint `json:"items,omitempty"`
  22096. // Kind: [Output Only] Type of the resource. Always
  22097. // compute#notificationEndpoint for notification endpoints.
  22098. Kind string `json:"kind,omitempty"`
  22099. // NextPageToken: [Output Only] This token allows you to get the next
  22100. // page of results for list requests. If the number of results is larger
  22101. // than maxResults, use the nextPageToken as a value for the query
  22102. // parameter pageToken in the next list request. Subsequent list
  22103. // requests will have their own nextPageToken to continue paging through
  22104. // the results.
  22105. NextPageToken string `json:"nextPageToken,omitempty"`
  22106. // SelfLink: [Output Only] Server-defined URL for this resource.
  22107. SelfLink string `json:"selfLink,omitempty"`
  22108. // Warning: [Output Only] Informational warning message.
  22109. Warning *NotificationEndpointListWarning `json:"warning,omitempty"`
  22110. // ServerResponse contains the HTTP response code and headers from the
  22111. // server.
  22112. googleapi.ServerResponse `json:"-"`
  22113. // ForceSendFields is a list of field names (e.g. "Id") to
  22114. // unconditionally include in API requests. By default, fields with
  22115. // empty values are omitted from API requests. However, any non-pointer,
  22116. // non-interface field appearing in ForceSendFields will be sent to the
  22117. // server regardless of whether the field is empty or not. This may be
  22118. // used to include empty fields in Patch requests.
  22119. ForceSendFields []string `json:"-"`
  22120. // NullFields is a list of field names (e.g. "Id") to include in API
  22121. // requests with the JSON null value. By default, fields with empty
  22122. // values are omitted from API requests. However, any field with an
  22123. // empty value appearing in NullFields will be sent to the server as
  22124. // null. It is an error if a field in this list has a non-empty value.
  22125. // This may be used to include null fields in Patch requests.
  22126. NullFields []string `json:"-"`
  22127. }
  22128. func (s *NotificationEndpointList) MarshalJSON() ([]byte, error) {
  22129. type NoMethod NotificationEndpointList
  22130. raw := NoMethod(*s)
  22131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22132. }
  22133. // NotificationEndpointListWarning: [Output Only] Informational warning
  22134. // message.
  22135. type NotificationEndpointListWarning struct {
  22136. // Code: [Output Only] A warning code, if applicable. For example,
  22137. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22138. // the response.
  22139. //
  22140. // Possible values:
  22141. // "CLEANUP_FAILED"
  22142. // "DEPRECATED_RESOURCE_USED"
  22143. // "DEPRECATED_TYPE_USED"
  22144. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22145. // "EXPERIMENTAL_TYPE_USED"
  22146. // "EXTERNAL_API_WARNING"
  22147. // "FIELD_VALUE_OVERRIDEN"
  22148. // "INJECTED_KERNELS_DEPRECATED"
  22149. // "MISSING_TYPE_DEPENDENCY"
  22150. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22151. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22152. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22153. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22154. // "NEXT_HOP_NOT_RUNNING"
  22155. // "NOT_CRITICAL_ERROR"
  22156. // "NO_RESULTS_ON_PAGE"
  22157. // "REQUIRED_TOS_AGREEMENT"
  22158. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22159. // "RESOURCE_NOT_DELETED"
  22160. // "SCHEMA_VALIDATION_IGNORED"
  22161. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22162. // "UNDECLARED_PROPERTIES"
  22163. // "UNREACHABLE"
  22164. Code string `json:"code,omitempty"`
  22165. // Data: [Output Only] Metadata about this warning in key: value format.
  22166. // For example:
  22167. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22168. Data []*NotificationEndpointListWarningData `json:"data,omitempty"`
  22169. // Message: [Output Only] A human-readable description of the warning
  22170. // code.
  22171. Message string `json:"message,omitempty"`
  22172. // ForceSendFields is a list of field names (e.g. "Code") to
  22173. // unconditionally include in API requests. By default, fields with
  22174. // empty values are omitted from API requests. However, any non-pointer,
  22175. // non-interface field appearing in ForceSendFields will be sent to the
  22176. // server regardless of whether the field is empty or not. This may be
  22177. // used to include empty fields in Patch requests.
  22178. ForceSendFields []string `json:"-"`
  22179. // NullFields is a list of field names (e.g. "Code") to include in API
  22180. // requests with the JSON null value. By default, fields with empty
  22181. // values are omitted from API requests. However, any field with an
  22182. // empty value appearing in NullFields will be sent to the server as
  22183. // null. It is an error if a field in this list has a non-empty value.
  22184. // This may be used to include null fields in Patch requests.
  22185. NullFields []string `json:"-"`
  22186. }
  22187. func (s *NotificationEndpointListWarning) MarshalJSON() ([]byte, error) {
  22188. type NoMethod NotificationEndpointListWarning
  22189. raw := NoMethod(*s)
  22190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22191. }
  22192. type NotificationEndpointListWarningData struct {
  22193. // Key: [Output Only] A key that provides more detail on the warning
  22194. // being returned. For example, for warnings where there are no results
  22195. // in a list request for a particular zone, this key might be scope and
  22196. // the key value might be the zone name. Other examples might be a key
  22197. // indicating a deprecated resource and a suggested replacement, or a
  22198. // warning about invalid network settings (for example, if an instance
  22199. // attempts to perform IP forwarding but is not enabled for IP
  22200. // forwarding).
  22201. Key string `json:"key,omitempty"`
  22202. // Value: [Output Only] A warning data value corresponding to the key.
  22203. Value string `json:"value,omitempty"`
  22204. // ForceSendFields is a list of field names (e.g. "Key") to
  22205. // unconditionally include in API requests. By default, fields with
  22206. // empty values are omitted from API requests. However, any non-pointer,
  22207. // non-interface field appearing in ForceSendFields will be sent to the
  22208. // server regardless of whether the field is empty or not. This may be
  22209. // used to include empty fields in Patch requests.
  22210. ForceSendFields []string `json:"-"`
  22211. // NullFields is a list of field names (e.g. "Key") to include in API
  22212. // requests with the JSON null value. By default, fields with empty
  22213. // values are omitted from API requests. However, any field with an
  22214. // empty value appearing in NullFields will be sent to the server as
  22215. // null. It is an error if a field in this list has a non-empty value.
  22216. // This may be used to include null fields in Patch requests.
  22217. NullFields []string `json:"-"`
  22218. }
  22219. func (s *NotificationEndpointListWarningData) MarshalJSON() ([]byte, error) {
  22220. type NoMethod NotificationEndpointListWarningData
  22221. raw := NoMethod(*s)
  22222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22223. }
  22224. // Operation: An Operation resource, used to manage asynchronous API
  22225. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  22226. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  22227. // (== resource_for beta.regionOperations ==) (== resource_for
  22228. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  22229. type Operation struct {
  22230. // ClientOperationId: [Output Only] The value of `requestId` if you
  22231. // provided it in the request. Not present otherwise.
  22232. ClientOperationId string `json:"clientOperationId,omitempty"`
  22233. // CreationTimestamp: [Deprecated] This field is deprecated.
  22234. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22235. // Description: [Output Only] A textual description of the operation,
  22236. // which is set when the operation is created.
  22237. Description string `json:"description,omitempty"`
  22238. // EndTime: [Output Only] The time that this operation was completed.
  22239. // This value is in RFC3339 text format.
  22240. EndTime string `json:"endTime,omitempty"`
  22241. // Error: [Output Only] If errors are generated during processing of the
  22242. // operation, this field will be populated.
  22243. Error *OperationError `json:"error,omitempty"`
  22244. // HttpErrorMessage: [Output Only] If the operation fails, this field
  22245. // contains the HTTP error message that was returned, such as NOT FOUND.
  22246. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  22247. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  22248. // contains the HTTP error status code that was returned. For example, a
  22249. // 404 means the resource was not found.
  22250. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  22251. // Id: [Output Only] The unique identifier for the resource. This
  22252. // identifier is defined by the server.
  22253. Id uint64 `json:"id,omitempty,string"`
  22254. // InsertTime: [Output Only] The time that this operation was requested.
  22255. // This value is in RFC3339 text format.
  22256. InsertTime string `json:"insertTime,omitempty"`
  22257. // Kind: [Output Only] Type of the resource. Always compute#operation
  22258. // for Operation resources.
  22259. Kind string `json:"kind,omitempty"`
  22260. // Name: [Output Only] Name of the resource.
  22261. Name string `json:"name,omitempty"`
  22262. // OperationType: [Output Only] The type of operation, such as insert,
  22263. // update, or delete, and so on.
  22264. OperationType string `json:"operationType,omitempty"`
  22265. // Progress: [Output Only] An optional progress indicator that ranges
  22266. // from 0 to 100. There is no requirement that this be linear or support
  22267. // any granularity of operations. This should not be used to guess when
  22268. // the operation will be complete. This number should monotonically
  22269. // increase as the operation progresses.
  22270. Progress int64 `json:"progress,omitempty"`
  22271. // Region: [Output Only] The URL of the region where the operation
  22272. // resides. Only available when performing regional operations. You must
  22273. // specify this field as part of the HTTP request URL. It is not
  22274. // settable as a field in the request body.
  22275. Region string `json:"region,omitempty"`
  22276. // SelfLink: [Output Only] Server-defined URL for the resource.
  22277. SelfLink string `json:"selfLink,omitempty"`
  22278. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  22279. // with the resource id.
  22280. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  22281. // StartTime: [Output Only] The time that this operation was started by
  22282. // the server. This value is in RFC3339 text format.
  22283. StartTime string `json:"startTime,omitempty"`
  22284. // Status: [Output Only] The status of the operation, which can be one
  22285. // of the following: PENDING, RUNNING, or DONE.
  22286. //
  22287. // Possible values:
  22288. // "DONE"
  22289. // "PENDING"
  22290. // "RUNNING"
  22291. Status string `json:"status,omitempty"`
  22292. // StatusMessage: [Output Only] An optional textual description of the
  22293. // current status of the operation.
  22294. StatusMessage string `json:"statusMessage,omitempty"`
  22295. // TargetId: [Output Only] The unique target ID, which identifies a
  22296. // specific incarnation of the target resource.
  22297. TargetId uint64 `json:"targetId,omitempty,string"`
  22298. // TargetLink: [Output Only] The URL of the resource that the operation
  22299. // modifies. For operations related to creating a snapshot, this points
  22300. // to the persistent disk that the snapshot was created from.
  22301. TargetLink string `json:"targetLink,omitempty"`
  22302. // User: [Output Only] User who requested the operation, for example:
  22303. // user@example.com.
  22304. User string `json:"user,omitempty"`
  22305. // Warnings: [Output Only] If warning messages are generated during
  22306. // processing of the operation, this field will be populated.
  22307. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  22308. // Zone: [Output Only] The URL of the zone where the operation resides.
  22309. // Only available when performing per-zone operations. You must specify
  22310. // this field as part of the HTTP request URL. It is not settable as a
  22311. // field in the request body.
  22312. Zone string `json:"zone,omitempty"`
  22313. // ServerResponse contains the HTTP response code and headers from the
  22314. // server.
  22315. googleapi.ServerResponse `json:"-"`
  22316. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  22317. // to unconditionally include in API requests. By default, fields with
  22318. // empty values are omitted from API requests. However, any non-pointer,
  22319. // non-interface field appearing in ForceSendFields will be sent to the
  22320. // server regardless of whether the field is empty or not. This may be
  22321. // used to include empty fields in Patch requests.
  22322. ForceSendFields []string `json:"-"`
  22323. // NullFields is a list of field names (e.g. "ClientOperationId") to
  22324. // include in API requests with the JSON null value. By default, fields
  22325. // with empty values are omitted from API requests. However, any field
  22326. // with an empty value appearing in NullFields will be sent to the
  22327. // server as null. It is an error if a field in this list has a
  22328. // non-empty value. This may be used to include null fields in Patch
  22329. // requests.
  22330. NullFields []string `json:"-"`
  22331. }
  22332. func (s *Operation) MarshalJSON() ([]byte, error) {
  22333. type NoMethod Operation
  22334. raw := NoMethod(*s)
  22335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22336. }
  22337. // OperationError: [Output Only] If errors are generated during
  22338. // processing of the operation, this field will be populated.
  22339. type OperationError struct {
  22340. // Errors: [Output Only] The array of errors encountered while
  22341. // processing this operation.
  22342. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  22343. // ForceSendFields is a list of field names (e.g. "Errors") to
  22344. // unconditionally include in API requests. By default, fields with
  22345. // empty values are omitted from API requests. However, any non-pointer,
  22346. // non-interface field appearing in ForceSendFields will be sent to the
  22347. // server regardless of whether the field is empty or not. This may be
  22348. // used to include empty fields in Patch requests.
  22349. ForceSendFields []string `json:"-"`
  22350. // NullFields is a list of field names (e.g. "Errors") to include in API
  22351. // requests with the JSON null value. By default, fields with empty
  22352. // values are omitted from API requests. However, any field with an
  22353. // empty value appearing in NullFields will be sent to the server as
  22354. // null. It is an error if a field in this list has a non-empty value.
  22355. // This may be used to include null fields in Patch requests.
  22356. NullFields []string `json:"-"`
  22357. }
  22358. func (s *OperationError) MarshalJSON() ([]byte, error) {
  22359. type NoMethod OperationError
  22360. raw := NoMethod(*s)
  22361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22362. }
  22363. type OperationErrorErrors struct {
  22364. // Code: [Output Only] The error type identifier for this error.
  22365. Code string `json:"code,omitempty"`
  22366. // Location: [Output Only] Indicates the field in the request that
  22367. // caused the error. This property is optional.
  22368. Location string `json:"location,omitempty"`
  22369. // Message: [Output Only] An optional, human-readable error message.
  22370. Message string `json:"message,omitempty"`
  22371. // ForceSendFields is a list of field names (e.g. "Code") to
  22372. // unconditionally include in API requests. By default, fields with
  22373. // empty values are omitted from API requests. However, any non-pointer,
  22374. // non-interface field appearing in ForceSendFields will be sent to the
  22375. // server regardless of whether the field is empty or not. This may be
  22376. // used to include empty fields in Patch requests.
  22377. ForceSendFields []string `json:"-"`
  22378. // NullFields is a list of field names (e.g. "Code") to include in API
  22379. // requests with the JSON null value. By default, fields with empty
  22380. // values are omitted from API requests. However, any field with an
  22381. // empty value appearing in NullFields will be sent to the server as
  22382. // null. It is an error if a field in this list has a non-empty value.
  22383. // This may be used to include null fields in Patch requests.
  22384. NullFields []string `json:"-"`
  22385. }
  22386. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  22387. type NoMethod OperationErrorErrors
  22388. raw := NoMethod(*s)
  22389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22390. }
  22391. type OperationWarnings struct {
  22392. // Code: [Output Only] A warning code, if applicable. For example,
  22393. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22394. // the response.
  22395. //
  22396. // Possible values:
  22397. // "CLEANUP_FAILED"
  22398. // "DEPRECATED_RESOURCE_USED"
  22399. // "DEPRECATED_TYPE_USED"
  22400. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22401. // "EXPERIMENTAL_TYPE_USED"
  22402. // "EXTERNAL_API_WARNING"
  22403. // "FIELD_VALUE_OVERRIDEN"
  22404. // "INJECTED_KERNELS_DEPRECATED"
  22405. // "MISSING_TYPE_DEPENDENCY"
  22406. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22407. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22408. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22409. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22410. // "NEXT_HOP_NOT_RUNNING"
  22411. // "NOT_CRITICAL_ERROR"
  22412. // "NO_RESULTS_ON_PAGE"
  22413. // "REQUIRED_TOS_AGREEMENT"
  22414. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22415. // "RESOURCE_NOT_DELETED"
  22416. // "SCHEMA_VALIDATION_IGNORED"
  22417. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22418. // "UNDECLARED_PROPERTIES"
  22419. // "UNREACHABLE"
  22420. Code string `json:"code,omitempty"`
  22421. // Data: [Output Only] Metadata about this warning in key: value format.
  22422. // For example:
  22423. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22424. Data []*OperationWarningsData `json:"data,omitempty"`
  22425. // Message: [Output Only] A human-readable description of the warning
  22426. // code.
  22427. Message string `json:"message,omitempty"`
  22428. // ForceSendFields is a list of field names (e.g. "Code") to
  22429. // unconditionally include in API requests. By default, fields with
  22430. // empty values are omitted from API requests. However, any non-pointer,
  22431. // non-interface field appearing in ForceSendFields will be sent to the
  22432. // server regardless of whether the field is empty or not. This may be
  22433. // used to include empty fields in Patch requests.
  22434. ForceSendFields []string `json:"-"`
  22435. // NullFields is a list of field names (e.g. "Code") to include in API
  22436. // requests with the JSON null value. By default, fields with empty
  22437. // values are omitted from API requests. However, any field with an
  22438. // empty value appearing in NullFields will be sent to the server as
  22439. // null. It is an error if a field in this list has a non-empty value.
  22440. // This may be used to include null fields in Patch requests.
  22441. NullFields []string `json:"-"`
  22442. }
  22443. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  22444. type NoMethod OperationWarnings
  22445. raw := NoMethod(*s)
  22446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22447. }
  22448. type OperationWarningsData struct {
  22449. // Key: [Output Only] A key that provides more detail on the warning
  22450. // being returned. For example, for warnings where there are no results
  22451. // in a list request for a particular zone, this key might be scope and
  22452. // the key value might be the zone name. Other examples might be a key
  22453. // indicating a deprecated resource and a suggested replacement, or a
  22454. // warning about invalid network settings (for example, if an instance
  22455. // attempts to perform IP forwarding but is not enabled for IP
  22456. // forwarding).
  22457. Key string `json:"key,omitempty"`
  22458. // Value: [Output Only] A warning data value corresponding to the key.
  22459. Value string `json:"value,omitempty"`
  22460. // ForceSendFields is a list of field names (e.g. "Key") to
  22461. // unconditionally include in API requests. By default, fields with
  22462. // empty values are omitted from API requests. However, any non-pointer,
  22463. // non-interface field appearing in ForceSendFields will be sent to the
  22464. // server regardless of whether the field is empty or not. This may be
  22465. // used to include empty fields in Patch requests.
  22466. ForceSendFields []string `json:"-"`
  22467. // NullFields is a list of field names (e.g. "Key") to include in API
  22468. // requests with the JSON null value. By default, fields with empty
  22469. // values are omitted from API requests. However, any field with an
  22470. // empty value appearing in NullFields will be sent to the server as
  22471. // null. It is an error if a field in this list has a non-empty value.
  22472. // This may be used to include null fields in Patch requests.
  22473. NullFields []string `json:"-"`
  22474. }
  22475. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  22476. type NoMethod OperationWarningsData
  22477. raw := NoMethod(*s)
  22478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22479. }
  22480. type OperationAggregatedList struct {
  22481. // Id: [Output Only] The unique identifier for the resource. This
  22482. // identifier is defined by the server.
  22483. Id string `json:"id,omitempty"`
  22484. // Items: [Output Only] A map of scoped operation lists.
  22485. Items map[string]OperationsScopedList `json:"items,omitempty"`
  22486. // Kind: [Output Only] Type of resource. Always
  22487. // compute#operationAggregatedList for aggregated lists of operations.
  22488. Kind string `json:"kind,omitempty"`
  22489. // NextPageToken: [Output Only] This token allows you to get the next
  22490. // page of results for list requests. If the number of results is larger
  22491. // than maxResults, use the nextPageToken as a value for the query
  22492. // parameter pageToken in the next list request. Subsequent list
  22493. // requests will have their own nextPageToken to continue paging through
  22494. // the results.
  22495. NextPageToken string `json:"nextPageToken,omitempty"`
  22496. // SelfLink: [Output Only] Server-defined URL for this resource.
  22497. SelfLink string `json:"selfLink,omitempty"`
  22498. // Warning: [Output Only] Informational warning message.
  22499. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  22500. // ServerResponse contains the HTTP response code and headers from the
  22501. // server.
  22502. googleapi.ServerResponse `json:"-"`
  22503. // ForceSendFields is a list of field names (e.g. "Id") to
  22504. // unconditionally include in API requests. By default, fields with
  22505. // empty values are omitted from API requests. However, any non-pointer,
  22506. // non-interface field appearing in ForceSendFields will be sent to the
  22507. // server regardless of whether the field is empty or not. This may be
  22508. // used to include empty fields in Patch requests.
  22509. ForceSendFields []string `json:"-"`
  22510. // NullFields is a list of field names (e.g. "Id") to include in API
  22511. // requests with the JSON null value. By default, fields with empty
  22512. // values are omitted from API requests. However, any field with an
  22513. // empty value appearing in NullFields will be sent to the server as
  22514. // null. It is an error if a field in this list has a non-empty value.
  22515. // This may be used to include null fields in Patch requests.
  22516. NullFields []string `json:"-"`
  22517. }
  22518. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  22519. type NoMethod OperationAggregatedList
  22520. raw := NoMethod(*s)
  22521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22522. }
  22523. // OperationAggregatedListWarning: [Output Only] Informational warning
  22524. // message.
  22525. type OperationAggregatedListWarning struct {
  22526. // Code: [Output Only] A warning code, if applicable. For example,
  22527. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22528. // the response.
  22529. //
  22530. // Possible values:
  22531. // "CLEANUP_FAILED"
  22532. // "DEPRECATED_RESOURCE_USED"
  22533. // "DEPRECATED_TYPE_USED"
  22534. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22535. // "EXPERIMENTAL_TYPE_USED"
  22536. // "EXTERNAL_API_WARNING"
  22537. // "FIELD_VALUE_OVERRIDEN"
  22538. // "INJECTED_KERNELS_DEPRECATED"
  22539. // "MISSING_TYPE_DEPENDENCY"
  22540. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22541. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22542. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22543. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22544. // "NEXT_HOP_NOT_RUNNING"
  22545. // "NOT_CRITICAL_ERROR"
  22546. // "NO_RESULTS_ON_PAGE"
  22547. // "REQUIRED_TOS_AGREEMENT"
  22548. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22549. // "RESOURCE_NOT_DELETED"
  22550. // "SCHEMA_VALIDATION_IGNORED"
  22551. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22552. // "UNDECLARED_PROPERTIES"
  22553. // "UNREACHABLE"
  22554. Code string `json:"code,omitempty"`
  22555. // Data: [Output Only] Metadata about this warning in key: value format.
  22556. // For example:
  22557. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22558. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  22559. // Message: [Output Only] A human-readable description of the warning
  22560. // code.
  22561. Message string `json:"message,omitempty"`
  22562. // ForceSendFields is a list of field names (e.g. "Code") to
  22563. // unconditionally include in API requests. By default, fields with
  22564. // empty values are omitted from API requests. However, any non-pointer,
  22565. // non-interface field appearing in ForceSendFields will be sent to the
  22566. // server regardless of whether the field is empty or not. This may be
  22567. // used to include empty fields in Patch requests.
  22568. ForceSendFields []string `json:"-"`
  22569. // NullFields is a list of field names (e.g. "Code") to include in API
  22570. // requests with the JSON null value. By default, fields with empty
  22571. // values are omitted from API requests. However, any field with an
  22572. // empty value appearing in NullFields will be sent to the server as
  22573. // null. It is an error if a field in this list has a non-empty value.
  22574. // This may be used to include null fields in Patch requests.
  22575. NullFields []string `json:"-"`
  22576. }
  22577. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  22578. type NoMethod OperationAggregatedListWarning
  22579. raw := NoMethod(*s)
  22580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22581. }
  22582. type OperationAggregatedListWarningData struct {
  22583. // Key: [Output Only] A key that provides more detail on the warning
  22584. // being returned. For example, for warnings where there are no results
  22585. // in a list request for a particular zone, this key might be scope and
  22586. // the key value might be the zone name. Other examples might be a key
  22587. // indicating a deprecated resource and a suggested replacement, or a
  22588. // warning about invalid network settings (for example, if an instance
  22589. // attempts to perform IP forwarding but is not enabled for IP
  22590. // forwarding).
  22591. Key string `json:"key,omitempty"`
  22592. // Value: [Output Only] A warning data value corresponding to the key.
  22593. Value string `json:"value,omitempty"`
  22594. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  22602. // 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 *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  22610. type NoMethod OperationAggregatedListWarningData
  22611. raw := NoMethod(*s)
  22612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22613. }
  22614. // OperationList: Contains a list of Operation resources.
  22615. type OperationList struct {
  22616. // Id: [Output Only] The unique identifier for the resource. This
  22617. // identifier is defined by the server.
  22618. Id string `json:"id,omitempty"`
  22619. // Items: [Output Only] A list of Operation resources.
  22620. Items []*Operation `json:"items,omitempty"`
  22621. // Kind: [Output Only] Type of resource. Always compute#operations for
  22622. // Operations resource.
  22623. Kind string `json:"kind,omitempty"`
  22624. // NextPageToken: [Output Only] This token allows you to get the next
  22625. // page of results for list requests. If the number of results is larger
  22626. // than maxResults, use the nextPageToken as a value for the query
  22627. // parameter pageToken in the next list request. Subsequent list
  22628. // requests will have their own nextPageToken to continue paging through
  22629. // the results.
  22630. NextPageToken string `json:"nextPageToken,omitempty"`
  22631. // SelfLink: [Output Only] Server-defined URL for this resource.
  22632. SelfLink string `json:"selfLink,omitempty"`
  22633. // Warning: [Output Only] Informational warning message.
  22634. Warning *OperationListWarning `json:"warning,omitempty"`
  22635. // ServerResponse contains the HTTP response code and headers from the
  22636. // server.
  22637. googleapi.ServerResponse `json:"-"`
  22638. // ForceSendFields is a list of field names (e.g. "Id") to
  22639. // unconditionally include in API requests. By default, fields with
  22640. // empty values are omitted from API requests. However, any non-pointer,
  22641. // non-interface field appearing in ForceSendFields will be sent to the
  22642. // server regardless of whether the field is empty or not. This may be
  22643. // used to include empty fields in Patch requests.
  22644. ForceSendFields []string `json:"-"`
  22645. // NullFields is a list of field names (e.g. "Id") to include in API
  22646. // requests with the JSON null value. By default, fields with empty
  22647. // values are omitted from API requests. However, any field with an
  22648. // empty value appearing in NullFields will be sent to the server as
  22649. // null. It is an error if a field in this list has a non-empty value.
  22650. // This may be used to include null fields in Patch requests.
  22651. NullFields []string `json:"-"`
  22652. }
  22653. func (s *OperationList) MarshalJSON() ([]byte, error) {
  22654. type NoMethod OperationList
  22655. raw := NoMethod(*s)
  22656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22657. }
  22658. // OperationListWarning: [Output Only] Informational warning message.
  22659. type OperationListWarning struct {
  22660. // Code: [Output Only] A warning code, if applicable. For example,
  22661. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22662. // the response.
  22663. //
  22664. // Possible values:
  22665. // "CLEANUP_FAILED"
  22666. // "DEPRECATED_RESOURCE_USED"
  22667. // "DEPRECATED_TYPE_USED"
  22668. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22669. // "EXPERIMENTAL_TYPE_USED"
  22670. // "EXTERNAL_API_WARNING"
  22671. // "FIELD_VALUE_OVERRIDEN"
  22672. // "INJECTED_KERNELS_DEPRECATED"
  22673. // "MISSING_TYPE_DEPENDENCY"
  22674. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22675. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22676. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22677. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22678. // "NEXT_HOP_NOT_RUNNING"
  22679. // "NOT_CRITICAL_ERROR"
  22680. // "NO_RESULTS_ON_PAGE"
  22681. // "REQUIRED_TOS_AGREEMENT"
  22682. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22683. // "RESOURCE_NOT_DELETED"
  22684. // "SCHEMA_VALIDATION_IGNORED"
  22685. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22686. // "UNDECLARED_PROPERTIES"
  22687. // "UNREACHABLE"
  22688. Code string `json:"code,omitempty"`
  22689. // Data: [Output Only] Metadata about this warning in key: value format.
  22690. // For example:
  22691. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22692. Data []*OperationListWarningData `json:"data,omitempty"`
  22693. // Message: [Output Only] A human-readable description of the warning
  22694. // code.
  22695. Message string `json:"message,omitempty"`
  22696. // ForceSendFields is a list of field names (e.g. "Code") to
  22697. // unconditionally include in API requests. By default, fields with
  22698. // empty values are omitted from API requests. However, any non-pointer,
  22699. // non-interface field appearing in ForceSendFields will be sent to the
  22700. // server regardless of whether the field is empty or not. This may be
  22701. // used to include empty fields in Patch requests.
  22702. ForceSendFields []string `json:"-"`
  22703. // NullFields is a list of field names (e.g. "Code") to include in API
  22704. // requests with the JSON null value. By default, fields with empty
  22705. // values are omitted from API requests. However, any field with an
  22706. // empty value appearing in NullFields will be sent to the server as
  22707. // null. It is an error if a field in this list has a non-empty value.
  22708. // This may be used to include null fields in Patch requests.
  22709. NullFields []string `json:"-"`
  22710. }
  22711. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  22712. type NoMethod OperationListWarning
  22713. raw := NoMethod(*s)
  22714. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22715. }
  22716. type OperationListWarningData struct {
  22717. // Key: [Output Only] A key that provides more detail on the warning
  22718. // being returned. For example, for warnings where there are no results
  22719. // in a list request for a particular zone, this key might be scope and
  22720. // the key value might be the zone name. Other examples might be a key
  22721. // indicating a deprecated resource and a suggested replacement, or a
  22722. // warning about invalid network settings (for example, if an instance
  22723. // attempts to perform IP forwarding but is not enabled for IP
  22724. // forwarding).
  22725. Key string `json:"key,omitempty"`
  22726. // Value: [Output Only] A warning data value corresponding to the key.
  22727. Value string `json:"value,omitempty"`
  22728. // ForceSendFields is a list of field names (e.g. "Key") to
  22729. // unconditionally include in API requests. By default, fields with
  22730. // empty values are omitted from API requests. However, any non-pointer,
  22731. // non-interface field appearing in ForceSendFields will be sent to the
  22732. // server regardless of whether the field is empty or not. This may be
  22733. // used to include empty fields in Patch requests.
  22734. ForceSendFields []string `json:"-"`
  22735. // NullFields is a list of field names (e.g. "Key") to include in API
  22736. // requests with the JSON null value. By default, fields with empty
  22737. // values are omitted from API requests. However, any field with an
  22738. // empty value appearing in NullFields will be sent to the server as
  22739. // null. It is an error if a field in this list has a non-empty value.
  22740. // This may be used to include null fields in Patch requests.
  22741. NullFields []string `json:"-"`
  22742. }
  22743. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  22744. type NoMethod OperationListWarningData
  22745. raw := NoMethod(*s)
  22746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22747. }
  22748. type OperationsScopedList struct {
  22749. // Operations: [Output Only] A list of operations contained in this
  22750. // scope.
  22751. Operations []*Operation `json:"operations,omitempty"`
  22752. // Warning: [Output Only] Informational warning which replaces the list
  22753. // of operations when the list is empty.
  22754. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  22755. // ForceSendFields is a list of field names (e.g. "Operations") to
  22756. // unconditionally include in API requests. By default, fields with
  22757. // empty values are omitted from API requests. However, any non-pointer,
  22758. // non-interface field appearing in ForceSendFields will be sent to the
  22759. // server regardless of whether the field is empty or not. This may be
  22760. // used to include empty fields in Patch requests.
  22761. ForceSendFields []string `json:"-"`
  22762. // NullFields is a list of field names (e.g. "Operations") to include in
  22763. // API requests with the JSON null value. By default, fields with empty
  22764. // values are omitted from API requests. However, any field with an
  22765. // empty value appearing in NullFields will be sent to the server as
  22766. // null. It is an error if a field in this list has a non-empty value.
  22767. // This may be used to include null fields in Patch requests.
  22768. NullFields []string `json:"-"`
  22769. }
  22770. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  22771. type NoMethod OperationsScopedList
  22772. raw := NoMethod(*s)
  22773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22774. }
  22775. // OperationsScopedListWarning: [Output Only] Informational warning
  22776. // which replaces the list of operations when the list is empty.
  22777. type OperationsScopedListWarning struct {
  22778. // Code: [Output Only] A warning code, if applicable. For example,
  22779. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22780. // the response.
  22781. //
  22782. // Possible values:
  22783. // "CLEANUP_FAILED"
  22784. // "DEPRECATED_RESOURCE_USED"
  22785. // "DEPRECATED_TYPE_USED"
  22786. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22787. // "EXPERIMENTAL_TYPE_USED"
  22788. // "EXTERNAL_API_WARNING"
  22789. // "FIELD_VALUE_OVERRIDEN"
  22790. // "INJECTED_KERNELS_DEPRECATED"
  22791. // "MISSING_TYPE_DEPENDENCY"
  22792. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22793. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22794. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22795. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22796. // "NEXT_HOP_NOT_RUNNING"
  22797. // "NOT_CRITICAL_ERROR"
  22798. // "NO_RESULTS_ON_PAGE"
  22799. // "REQUIRED_TOS_AGREEMENT"
  22800. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22801. // "RESOURCE_NOT_DELETED"
  22802. // "SCHEMA_VALIDATION_IGNORED"
  22803. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22804. // "UNDECLARED_PROPERTIES"
  22805. // "UNREACHABLE"
  22806. Code string `json:"code,omitempty"`
  22807. // Data: [Output Only] Metadata about this warning in key: value format.
  22808. // For example:
  22809. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22810. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  22811. // Message: [Output Only] A human-readable description of the warning
  22812. // code.
  22813. Message string `json:"message,omitempty"`
  22814. // ForceSendFields is a list of field names (e.g. "Code") to
  22815. // unconditionally include in API requests. By default, fields with
  22816. // empty values are omitted from API requests. However, any non-pointer,
  22817. // non-interface field appearing in ForceSendFields will be sent to the
  22818. // server regardless of whether the field is empty or not. This may be
  22819. // used to include empty fields in Patch requests.
  22820. ForceSendFields []string `json:"-"`
  22821. // NullFields is a list of field names (e.g. "Code") to include in API
  22822. // requests with the JSON null value. By default, fields with empty
  22823. // values are omitted from API requests. However, any field with an
  22824. // empty value appearing in NullFields will be sent to the server as
  22825. // null. It is an error if a field in this list has a non-empty value.
  22826. // This may be used to include null fields in Patch requests.
  22827. NullFields []string `json:"-"`
  22828. }
  22829. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  22830. type NoMethod OperationsScopedListWarning
  22831. raw := NoMethod(*s)
  22832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22833. }
  22834. type OperationsScopedListWarningData struct {
  22835. // Key: [Output Only] A key that provides more detail on the warning
  22836. // being returned. For example, for warnings where there are no results
  22837. // in a list request for a particular zone, this key might be scope and
  22838. // the key value might be the zone name. Other examples might be a key
  22839. // indicating a deprecated resource and a suggested replacement, or a
  22840. // warning about invalid network settings (for example, if an instance
  22841. // attempts to perform IP forwarding but is not enabled for IP
  22842. // forwarding).
  22843. Key string `json:"key,omitempty"`
  22844. // Value: [Output Only] A warning data value corresponding to the key.
  22845. Value string `json:"value,omitempty"`
  22846. // ForceSendFields is a list of field names (e.g. "Key") to
  22847. // unconditionally include in API requests. By default, fields with
  22848. // empty values are omitted from API requests. However, any non-pointer,
  22849. // non-interface field appearing in ForceSendFields will be sent to the
  22850. // server regardless of whether the field is empty or not. This may be
  22851. // used to include empty fields in Patch requests.
  22852. ForceSendFields []string `json:"-"`
  22853. // NullFields is a list of field names (e.g. "Key") to include in API
  22854. // requests with the JSON null value. By default, fields with empty
  22855. // values are omitted from API requests. However, any field with an
  22856. // empty value appearing in NullFields will be sent to the server as
  22857. // null. It is an error if a field in this list has a non-empty value.
  22858. // This may be used to include null fields in Patch requests.
  22859. NullFields []string `json:"-"`
  22860. }
  22861. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  22862. type NoMethod OperationsScopedListWarningData
  22863. raw := NoMethod(*s)
  22864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22865. }
  22866. type OrganizationSecurityPoliciesListAssociationsResponse struct {
  22867. // Associations: A list of associations.
  22868. Associations []*SecurityPolicyAssociation `json:"associations,omitempty"`
  22869. // Kind: [Output Only] Type of securityPolicy associations. Always
  22870. // compute#organizationSecurityPoliciesListAssociations for lists of
  22871. // securityPolicy associations.
  22872. Kind string `json:"kind,omitempty"`
  22873. // ServerResponse contains the HTTP response code and headers from the
  22874. // server.
  22875. googleapi.ServerResponse `json:"-"`
  22876. // ForceSendFields is a list of field names (e.g. "Associations") to
  22877. // unconditionally include in API requests. By default, fields with
  22878. // empty values are omitted from API requests. However, any non-pointer,
  22879. // non-interface field appearing in ForceSendFields will be sent to the
  22880. // server regardless of whether the field is empty or not. This may be
  22881. // used to include empty fields in Patch requests.
  22882. ForceSendFields []string `json:"-"`
  22883. // NullFields is a list of field names (e.g. "Associations") to include
  22884. // in API requests with the JSON null value. By default, fields with
  22885. // empty values are omitted from API requests. However, any field with
  22886. // an empty value appearing in NullFields will be sent to the server as
  22887. // null. It is an error if a field in this list has a non-empty value.
  22888. // This may be used to include null fields in Patch requests.
  22889. NullFields []string `json:"-"`
  22890. }
  22891. func (s *OrganizationSecurityPoliciesListAssociationsResponse) MarshalJSON() ([]byte, error) {
  22892. type NoMethod OrganizationSecurityPoliciesListAssociationsResponse
  22893. raw := NoMethod(*s)
  22894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22895. }
  22896. // OriginAuthenticationMethod: Configuration for the origin
  22897. // authentication method.
  22898. type OriginAuthenticationMethod struct {
  22899. Jwt *Jwt `json:"jwt,omitempty"`
  22900. // ForceSendFields is a list of field names (e.g. "Jwt") to
  22901. // unconditionally include in API requests. By default, fields with
  22902. // empty values are omitted from API requests. However, any non-pointer,
  22903. // non-interface field appearing in ForceSendFields will be sent to the
  22904. // server regardless of whether the field is empty or not. This may be
  22905. // used to include empty fields in Patch requests.
  22906. ForceSendFields []string `json:"-"`
  22907. // NullFields is a list of field names (e.g. "Jwt") to include in API
  22908. // requests with the JSON null value. By default, fields with empty
  22909. // values are omitted from API requests. However, any field with an
  22910. // empty value appearing in NullFields will be sent to the server as
  22911. // null. It is an error if a field in this list has a non-empty value.
  22912. // This may be used to include null fields in Patch requests.
  22913. NullFields []string `json:"-"`
  22914. }
  22915. func (s *OriginAuthenticationMethod) MarshalJSON() ([]byte, error) {
  22916. type NoMethod OriginAuthenticationMethod
  22917. raw := NoMethod(*s)
  22918. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22919. }
  22920. // OutlierDetection: Settings controlling eviction of unhealthy hosts
  22921. // from the load balancing pool.
  22922. type OutlierDetection struct {
  22923. // BaseEjectionTime: The base time that a host is ejected for. The real
  22924. // time is equal to the base time multiplied by the number of times the
  22925. // host has been ejected. Defaults to 30000ms or 30s.
  22926. BaseEjectionTime *Duration `json:"baseEjectionTime,omitempty"`
  22927. // ConsecutiveErrors: Number of errors before a host is ejected from the
  22928. // connection pool. When the backend host is accessed over HTTP, a 5xx
  22929. // return code qualifies as an error. Defaults to 5.
  22930. ConsecutiveErrors int64 `json:"consecutiveErrors,omitempty"`
  22931. // ConsecutiveGatewayFailure: The number of consecutive gateway failures
  22932. // (502, 503, 504 status or connection errors that are mapped to one of
  22933. // those status codes) before a consecutive gateway failure ejection
  22934. // occurs. Defaults to 5.
  22935. ConsecutiveGatewayFailure int64 `json:"consecutiveGatewayFailure,omitempty"`
  22936. // EnforcingConsecutiveErrors: The percentage chance that a host will be
  22937. // actually ejected when an outlier status is detected through
  22938. // consecutive 5xx. This setting can be used to disable ejection or to
  22939. // ramp it up slowly. Defaults to 100.
  22940. EnforcingConsecutiveErrors int64 `json:"enforcingConsecutiveErrors,omitempty"`
  22941. // EnforcingConsecutiveGatewayFailure: The percentage chance that a host
  22942. // will be actually ejected when an outlier status is detected through
  22943. // consecutive gateway failures. This setting can be used to disable
  22944. // ejection or to ramp it up slowly. Defaults to 0.
  22945. EnforcingConsecutiveGatewayFailure int64 `json:"enforcingConsecutiveGatewayFailure,omitempty"`
  22946. // EnforcingSuccessRate: The percentage chance that a host will be
  22947. // actually ejected when an outlier status is detected through success
  22948. // rate statistics. This setting can be used to disable ejection or to
  22949. // ramp it up slowly. Defaults to 100.
  22950. EnforcingSuccessRate int64 `json:"enforcingSuccessRate,omitempty"`
  22951. // Interval: Time interval between ejection sweep analysis. This can
  22952. // result in both new ejections as well as hosts being returned to
  22953. // service. Defaults to 10 seconds.
  22954. Interval *Duration `json:"interval,omitempty"`
  22955. // MaxEjectionPercent: Maximum percentage of hosts in the load balancing
  22956. // pool for the backend service that can be ejected. Defaults to 10%.
  22957. MaxEjectionPercent int64 `json:"maxEjectionPercent,omitempty"`
  22958. // SuccessRateMinimumHosts: The number of hosts in a cluster that must
  22959. // have enough request volume to detect success rate outliers. If the
  22960. // number of hosts is less than this setting, outlier detection via
  22961. // success rate statistics is not performed for any host in the cluster.
  22962. // Defaults to 5.
  22963. SuccessRateMinimumHosts int64 `json:"successRateMinimumHosts,omitempty"`
  22964. // SuccessRateRequestVolume: The minimum number of total requests that
  22965. // must be collected in one interval (as defined by the interval
  22966. // duration above) to include this host in success rate based outlier
  22967. // detection. If the volume is lower than this setting, outlier
  22968. // detection via success rate statistics is not performed for that host.
  22969. // Defaults to 100.
  22970. SuccessRateRequestVolume int64 `json:"successRateRequestVolume,omitempty"`
  22971. // SuccessRateStdevFactor: This factor is used to determine the ejection
  22972. // threshold for success rate outlier ejection. The ejection threshold
  22973. // is the difference between the mean success rate, and the product of
  22974. // this factor and the standard deviation of the mean success rate: mean
  22975. // - (stdev * success_rate_stdev_factor). This factor is divided by a
  22976. // thousand to get a double. That is, if the desired factor is 1.9, the
  22977. // runtime value should be 1900. Defaults to 1900.
  22978. SuccessRateStdevFactor int64 `json:"successRateStdevFactor,omitempty"`
  22979. // ForceSendFields is a list of field names (e.g. "BaseEjectionTime") to
  22980. // unconditionally include in API requests. By default, fields with
  22981. // empty values are omitted from API requests. However, any non-pointer,
  22982. // non-interface field appearing in ForceSendFields will be sent to the
  22983. // server regardless of whether the field is empty or not. This may be
  22984. // used to include empty fields in Patch requests.
  22985. ForceSendFields []string `json:"-"`
  22986. // NullFields is a list of field names (e.g. "BaseEjectionTime") to
  22987. // include in API requests with the JSON null value. By default, fields
  22988. // with empty values are omitted from API requests. However, any field
  22989. // with an empty value appearing in NullFields will be sent to the
  22990. // server as null. It is an error if a field in this list has a
  22991. // non-empty value. This may be used to include null fields in Patch
  22992. // requests.
  22993. NullFields []string `json:"-"`
  22994. }
  22995. func (s *OutlierDetection) MarshalJSON() ([]byte, error) {
  22996. type NoMethod OutlierDetection
  22997. raw := NoMethod(*s)
  22998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22999. }
  23000. // PathMatcher: A matcher for the path portion of the URL. The
  23001. // BackendService from the longest-matched rule will serve the URL. If
  23002. // no rule was matched, the default service will be used.
  23003. type PathMatcher struct {
  23004. // DefaultRouteAction: defaultRouteAction takes effect when none of the
  23005. // pathRules or routeRules match. The load balancer performs advanced
  23006. // routing actions like URL rewrites, header transformations, etc. prior
  23007. // to forwarding the request to the selected backend. If
  23008. // defaultRouteAction specifies any weightedBackendServices,
  23009. // defaultService must not be set. Conversely if defaultService is set,
  23010. // defaultRouteAction cannot contain any weightedBackendServices.
  23011. // Only one of defaultRouteAction or defaultUrlRedirect must be set.
  23012. DefaultRouteAction *HttpRouteAction `json:"defaultRouteAction,omitempty"`
  23013. // DefaultService: The full or partial URL to the BackendService
  23014. // resource. This will be used if none of the pathRules or routeRules
  23015. // defined by this PathMatcher are matched. For example, the following
  23016. // are all valid URLs to a BackendService resource:
  23017. // -
  23018. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  23019. // - compute/v1/projects/project/global/backendServices/backendService
  23020. //
  23021. // - global/backendServices/backendService If defaultRouteAction is
  23022. // additionally specified, advanced routing actions like URL Rewrites,
  23023. // etc. take effect prior to sending the request to the backend.
  23024. // However, if defaultService is specified, defaultRouteAction cannot
  23025. // contain any weightedBackendServices. Conversely, if
  23026. // defaultRouteAction specifies any weightedBackendServices,
  23027. // defaultService must not be specified.
  23028. // Only one of defaultService, defaultUrlRedirect or
  23029. // defaultRouteAction.weightedBackendService must be set.
  23030. // Authorization requires one or more of the following Google IAM
  23031. // permissions on the specified resource default_service:
  23032. // - compute.backendBuckets.use
  23033. // - compute.backendServices.use
  23034. DefaultService string `json:"defaultService,omitempty"`
  23035. // DefaultUrlRedirect: When when none of the specified pathRules or
  23036. // routeRules match, the request is redirected to a URL specified by
  23037. // defaultUrlRedirect.
  23038. // If defaultUrlRedirect is specified, defaultService or
  23039. // defaultRouteAction must not be set.
  23040. DefaultUrlRedirect *HttpRedirectAction `json:"defaultUrlRedirect,omitempty"`
  23041. // Description: An optional description of this resource. Provide this
  23042. // property when you create the resource.
  23043. Description string `json:"description,omitempty"`
  23044. // HeaderAction: Specifies changes to request and response headers that
  23045. // need to take effect for the selected backendService.
  23046. // HeaderAction specified here are applied after the matching
  23047. // HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap
  23048. HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
  23049. // Name: The name to which this PathMatcher is referred by the HostRule.
  23050. Name string `json:"name,omitempty"`
  23051. // PathRules: The list of path rules. Use this list instead of
  23052. // routeRules when routing based on simple path matching is all that's
  23053. // required. The order by which path rules are specified does not
  23054. // matter. Matches are always done on the longest-path-first basis.
  23055. // For example: a pathRule with a path /a/b/c/* will match before /a/b/*
  23056. // irrespective of the order in which those paths appear in this
  23057. // list.
  23058. // Only one of pathRules or routeRules must be set.
  23059. PathRules []*PathRule `json:"pathRules,omitempty"`
  23060. // RouteRules: The list of ordered HTTP route rules. Use this list
  23061. // instead of pathRules when advanced route matching and routing actions
  23062. // are desired. The order of specifying routeRules matters: the first
  23063. // rule that matches will cause its specified routing action to take
  23064. // effect.
  23065. // Only one of pathRules or routeRules must be set.
  23066. RouteRules []*HttpRouteRule `json:"routeRules,omitempty"`
  23067. // ForceSendFields is a list of field names (e.g. "DefaultRouteAction")
  23068. // to unconditionally include in API requests. By default, fields with
  23069. // empty values are omitted from API requests. However, any non-pointer,
  23070. // non-interface field appearing in ForceSendFields will be sent to the
  23071. // server regardless of whether the field is empty or not. This may be
  23072. // used to include empty fields in Patch requests.
  23073. ForceSendFields []string `json:"-"`
  23074. // NullFields is a list of field names (e.g. "DefaultRouteAction") to
  23075. // include in API requests with the JSON null value. By default, fields
  23076. // with empty values are omitted from API requests. However, any field
  23077. // with an empty value appearing in NullFields will be sent to the
  23078. // server as null. It is an error if a field in this list has a
  23079. // non-empty value. This may be used to include null fields in Patch
  23080. // requests.
  23081. NullFields []string `json:"-"`
  23082. }
  23083. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  23084. type NoMethod PathMatcher
  23085. raw := NoMethod(*s)
  23086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23087. }
  23088. // PathRule: A path-matching rule for a URL. If matched, will use the
  23089. // specified BackendService to handle the traffic arriving at this URL.
  23090. type PathRule struct {
  23091. // Paths: The list of path patterns to match. Each must start with / and
  23092. // the only place a * is allowed is at the end following a /. The string
  23093. // fed to the path matcher does not include any text after the first ?
  23094. // or #, and those chars are not allowed here.
  23095. Paths []string `json:"paths,omitempty"`
  23096. // RouteAction: In response to a matching path, the load balancer
  23097. // performs advanced routing actions like URL rewrites, header
  23098. // transformations, etc. prior to forwarding the request to the selected
  23099. // backend. If routeAction specifies any weightedBackendServices,
  23100. // service must not be set. Conversely if service is set, routeAction
  23101. // cannot contain any weightedBackendServices.
  23102. // Only one of routeAction or urlRedirect must be set.
  23103. RouteAction *HttpRouteAction `json:"routeAction,omitempty"`
  23104. // Service: The full or partial URL of the backend service resource to
  23105. // which traffic is directed if this rule is matched. If routeAction is
  23106. // additionally specified, advanced routing actions like URL Rewrites,
  23107. // etc. take effect prior to sending the request to the backend.
  23108. // However, if service is specified, routeAction cannot contain any
  23109. // weightedBackendService s. Conversely, if routeAction specifies any
  23110. // weightedBackendServices, service must not be specified.
  23111. // Only one of urlRedirect, service or
  23112. // routeAction.weightedBackendService must be set.
  23113. Service string `json:"service,omitempty"`
  23114. // UrlRedirect: When a path pattern is matched, the request is
  23115. // redirected to a URL specified by urlRedirect.
  23116. // If urlRedirect is specified, service or routeAction must not be set.
  23117. UrlRedirect *HttpRedirectAction `json:"urlRedirect,omitempty"`
  23118. // ForceSendFields is a list of field names (e.g. "Paths") to
  23119. // unconditionally include in API requests. By default, fields with
  23120. // empty values are omitted from API requests. However, any non-pointer,
  23121. // non-interface field appearing in ForceSendFields will be sent to the
  23122. // server regardless of whether the field is empty or not. This may be
  23123. // used to include empty fields in Patch requests.
  23124. ForceSendFields []string `json:"-"`
  23125. // NullFields is a list of field names (e.g. "Paths") to include in API
  23126. // requests with the JSON null value. By default, fields with empty
  23127. // values are omitted from API requests. However, any field with an
  23128. // empty value appearing in NullFields will be sent to the server as
  23129. // null. It is an error if a field in this list has a non-empty value.
  23130. // This may be used to include null fields in Patch requests.
  23131. NullFields []string `json:"-"`
  23132. }
  23133. func (s *PathRule) MarshalJSON() ([]byte, error) {
  23134. type NoMethod PathRule
  23135. raw := NoMethod(*s)
  23136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23137. }
  23138. // PeerAuthenticationMethod: Configuration for the peer authentication
  23139. // method.
  23140. type PeerAuthenticationMethod struct {
  23141. // Mtls: Set if mTLS is used for peer authentication.
  23142. Mtls *MutualTls `json:"mtls,omitempty"`
  23143. // ForceSendFields is a list of field names (e.g. "Mtls") to
  23144. // unconditionally include in API requests. By default, fields with
  23145. // empty values are omitted from API requests. However, any non-pointer,
  23146. // non-interface field appearing in ForceSendFields will be sent to the
  23147. // server regardless of whether the field is empty or not. This may be
  23148. // used to include empty fields in Patch requests.
  23149. ForceSendFields []string `json:"-"`
  23150. // NullFields is a list of field names (e.g. "Mtls") to include in API
  23151. // requests with the JSON null value. By default, fields with empty
  23152. // values are omitted from API requests. However, any field with an
  23153. // empty value appearing in NullFields will be sent to the server as
  23154. // null. It is an error if a field in this list has a non-empty value.
  23155. // This may be used to include null fields in Patch requests.
  23156. NullFields []string `json:"-"`
  23157. }
  23158. func (s *PeerAuthenticationMethod) MarshalJSON() ([]byte, error) {
  23159. type NoMethod PeerAuthenticationMethod
  23160. raw := NoMethod(*s)
  23161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23162. }
  23163. type PerInstanceConfig struct {
  23164. // Fingerprint: Fingerprint of this per-instance config. This field may
  23165. // be used in optimistic locking. It will be ignored when inserting a
  23166. // per-instance config. An up-to-date fingerprint must be provided in
  23167. // order to update an existing per-instance config or the field needs to
  23168. // be unset.
  23169. Fingerprint string `json:"fingerprint,omitempty"`
  23170. // Instance: The URL of the instance. Serves as a merge key during
  23171. // UpdatePerInstanceConfigs operation, i.e. if per-instance config with
  23172. // the same instance URL exists then it will be updated, otherwise a new
  23173. // one will be created.
  23174. Instance string `json:"instance,omitempty"`
  23175. // Name: The name of the per-instance config and the corresponding
  23176. // instance. Serves as a merge key during UpdatePerInstanceConfigs
  23177. // operation, i.e. if per-instance config with the same name exists then
  23178. // it will be updated, otherwise a new one will be created for the VM
  23179. // instance with the same name. An attempt to create a per-instance
  23180. // config for a VM instance that either doesn't exist or is not part of
  23181. // the group will result in a failure.
  23182. Name string `json:"name,omitempty"`
  23183. Override *ManagedInstanceOverride `json:"override,omitempty"`
  23184. // PreservedState: Intended preserved state for the given instance. Does
  23185. // not contain state generated based on Stateful Policy.
  23186. PreservedState *PreservedState `json:"preservedState,omitempty"`
  23187. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  23188. // unconditionally include in API requests. By default, fields with
  23189. // empty values are omitted from API requests. However, any non-pointer,
  23190. // non-interface field appearing in ForceSendFields will be sent to the
  23191. // server regardless of whether the field is empty or not. This may be
  23192. // used to include empty fields in Patch requests.
  23193. ForceSendFields []string `json:"-"`
  23194. // NullFields is a list of field names (e.g. "Fingerprint") to include
  23195. // in API requests with the JSON null value. By default, fields with
  23196. // empty values are omitted from API requests. However, any field with
  23197. // an empty value appearing in NullFields will be sent to the server as
  23198. // null. It is an error if a field in this list has a non-empty value.
  23199. // This may be used to include null fields in Patch requests.
  23200. NullFields []string `json:"-"`
  23201. }
  23202. func (s *PerInstanceConfig) MarshalJSON() ([]byte, error) {
  23203. type NoMethod PerInstanceConfig
  23204. raw := NoMethod(*s)
  23205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23206. }
  23207. // Permission: All fields defined in a permission are ANDed.
  23208. type Permission struct {
  23209. // Constraints: Extra custom constraints. The constraints are ANDed
  23210. // together.
  23211. Constraints []*PermissionConstraint `json:"constraints,omitempty"`
  23212. // Hosts: Used in Ingress or Egress Gateway cases to specify hosts that
  23213. // the policy applies to. Exact match, prefix match, and suffix match
  23214. // are supported.
  23215. Hosts []string `json:"hosts,omitempty"`
  23216. // Methods: HTTP method.
  23217. Methods []string `json:"methods,omitempty"`
  23218. // NotHosts: Negate of hosts. Specifies exclusions.
  23219. NotHosts []string `json:"notHosts,omitempty"`
  23220. // NotMethods: Negate of methods. Specifies exclusions.
  23221. NotMethods []string `json:"notMethods,omitempty"`
  23222. // NotPaths: Negate of paths. Specifies exclusions.
  23223. NotPaths []string `json:"notPaths,omitempty"`
  23224. // NotPorts: Negate of ports. Specifies exclusions.
  23225. NotPorts []string `json:"notPorts,omitempty"`
  23226. // Paths: HTTP request paths or gRPC methods. Exact match, prefix match,
  23227. // and suffix match are supported.
  23228. Paths []string `json:"paths,omitempty"`
  23229. // Ports: Port names or numbers.
  23230. Ports []string `json:"ports,omitempty"`
  23231. // ForceSendFields is a list of field names (e.g. "Constraints") to
  23232. // unconditionally include in API requests. By default, fields with
  23233. // empty values are omitted from API requests. However, any non-pointer,
  23234. // non-interface field appearing in ForceSendFields will be sent to the
  23235. // server regardless of whether the field is empty or not. This may be
  23236. // used to include empty fields in Patch requests.
  23237. ForceSendFields []string `json:"-"`
  23238. // NullFields is a list of field names (e.g. "Constraints") to include
  23239. // in API requests with the JSON null value. By default, fields with
  23240. // empty values are omitted from API requests. However, any field with
  23241. // an empty value appearing in NullFields will be sent to the server as
  23242. // null. It is an error if a field in this list has a non-empty value.
  23243. // This may be used to include null fields in Patch requests.
  23244. NullFields []string `json:"-"`
  23245. }
  23246. func (s *Permission) MarshalJSON() ([]byte, error) {
  23247. type NoMethod Permission
  23248. raw := NoMethod(*s)
  23249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23250. }
  23251. // PermissionConstraint: Custom constraint that specifies a key and a
  23252. // list of allowed values for Istio attributes.
  23253. type PermissionConstraint struct {
  23254. // Key: Key of the constraint.
  23255. Key string `json:"key,omitempty"`
  23256. // Values: A list of allowed values.
  23257. Values []string `json:"values,omitempty"`
  23258. // ForceSendFields is a list of field names (e.g. "Key") to
  23259. // unconditionally include in API requests. By default, fields with
  23260. // empty values are omitted from API requests. However, any non-pointer,
  23261. // non-interface field appearing in ForceSendFields will be sent to the
  23262. // server regardless of whether the field is empty or not. This may be
  23263. // used to include empty fields in Patch requests.
  23264. ForceSendFields []string `json:"-"`
  23265. // NullFields is a list of field names (e.g. "Key") to include in API
  23266. // requests with the JSON null value. By default, fields with empty
  23267. // values are omitted from API requests. However, any field with an
  23268. // empty value appearing in NullFields will be sent to the server as
  23269. // null. It is an error if a field in this list has a non-empty value.
  23270. // This may be used to include null fields in Patch requests.
  23271. NullFields []string `json:"-"`
  23272. }
  23273. func (s *PermissionConstraint) MarshalJSON() ([]byte, error) {
  23274. type NoMethod PermissionConstraint
  23275. raw := NoMethod(*s)
  23276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23277. }
  23278. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  23279. // used to specify access control policies for Cloud Platform
  23280. // resources.
  23281. //
  23282. //
  23283. //
  23284. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  23285. // of `members` to a `role`, where the members can be user accounts,
  23286. // Google groups, Google domains, and service accounts. A `role` is a
  23287. // named list of permissions defined by IAM.
  23288. //
  23289. // **JSON Example**
  23290. //
  23291. // { "bindings": [ { "role": "roles/owner", "members": [
  23292. // "user:mike@example.com", "group:admins@example.com",
  23293. // "domain:google.com",
  23294. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  23295. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  23296. // }
  23297. //
  23298. // **YAML Example**
  23299. //
  23300. // bindings: - members: - user:mike@example.com -
  23301. // group:admins@example.com - domain:google.com -
  23302. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  23303. // roles/owner - members: - user:sean@example.com role:
  23304. // roles/viewer
  23305. //
  23306. //
  23307. //
  23308. // For a description of IAM and its features, see the [IAM developer's
  23309. // guide](https://cloud.google.com/iam/docs).
  23310. type Policy struct {
  23311. // AuditConfigs: Specifies cloud audit logging configuration for this
  23312. // policy.
  23313. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  23314. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  23315. // no members will result in an error.
  23316. Bindings []*Binding `json:"bindings,omitempty"`
  23317. // Etag: `etag` is used for optimistic concurrency control as a way to
  23318. // help prevent simultaneous updates of a policy from overwriting each
  23319. // other. It is strongly suggested that systems make use of the `etag`
  23320. // in the read-modify-write cycle to perform policy updates in order to
  23321. // avoid race conditions: An `etag` is returned in the response to
  23322. // `getIamPolicy`, and systems are expected to put that etag in the
  23323. // request to `setIamPolicy` to ensure that their change will be applied
  23324. // to the same version of the policy.
  23325. //
  23326. // If no `etag` is provided in the call to `setIamPolicy`, then the
  23327. // existing policy is overwritten blindly.
  23328. Etag string `json:"etag,omitempty"`
  23329. IamOwned bool `json:"iamOwned,omitempty"`
  23330. // Rules: If more than one rule is specified, the rules are applied in
  23331. // the following manner: - All matching LOG rules are always applied. -
  23332. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  23333. // will be applied if one or more matching rule requires logging. -
  23334. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  23335. // granted. Logging will be applied if one or more matching rule
  23336. // requires logging. - Otherwise, if no rule applies, permission is
  23337. // denied.
  23338. Rules []*Rule `json:"rules,omitempty"`
  23339. // Version: Deprecated.
  23340. Version int64 `json:"version,omitempty"`
  23341. // ServerResponse contains the HTTP response code and headers from the
  23342. // server.
  23343. googleapi.ServerResponse `json:"-"`
  23344. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  23345. // unconditionally include in API requests. By default, fields with
  23346. // empty values are omitted from API requests. However, any non-pointer,
  23347. // non-interface field appearing in ForceSendFields will be sent to the
  23348. // server regardless of whether the field is empty or not. This may be
  23349. // used to include empty fields in Patch requests.
  23350. ForceSendFields []string `json:"-"`
  23351. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  23352. // in API requests with the JSON null value. By default, fields with
  23353. // empty values are omitted from API requests. However, any field with
  23354. // an empty value appearing in NullFields will be sent to the server as
  23355. // null. It is an error if a field in this list has a non-empty value.
  23356. // This may be used to include null fields in Patch requests.
  23357. NullFields []string `json:"-"`
  23358. }
  23359. func (s *Policy) MarshalJSON() ([]byte, error) {
  23360. type NoMethod Policy
  23361. raw := NoMethod(*s)
  23362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23363. }
  23364. type PreconfiguredWafSet struct {
  23365. // ExpressionSets: List of entities that are currently supported for WAF
  23366. // rules.
  23367. ExpressionSets []*WafExpressionSet `json:"expressionSets,omitempty"`
  23368. // ForceSendFields is a list of field names (e.g. "ExpressionSets") to
  23369. // unconditionally include in API requests. By default, fields with
  23370. // empty values are omitted from API requests. However, any non-pointer,
  23371. // non-interface field appearing in ForceSendFields will be sent to the
  23372. // server regardless of whether the field is empty or not. This may be
  23373. // used to include empty fields in Patch requests.
  23374. ForceSendFields []string `json:"-"`
  23375. // NullFields is a list of field names (e.g. "ExpressionSets") to
  23376. // include in API requests with the JSON null value. By default, fields
  23377. // with empty values are omitted from API requests. However, any field
  23378. // with an empty value appearing in NullFields will be sent to the
  23379. // server as null. It is an error if a field in this list has a
  23380. // non-empty value. This may be used to include null fields in Patch
  23381. // requests.
  23382. NullFields []string `json:"-"`
  23383. }
  23384. func (s *PreconfiguredWafSet) MarshalJSON() ([]byte, error) {
  23385. type NoMethod PreconfiguredWafSet
  23386. raw := NoMethod(*s)
  23387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23388. }
  23389. // PreservedState: Preserved state for a given instance.
  23390. type PreservedState struct {
  23391. // Disks: Preserved disks defined for this instance. This map is keyed
  23392. // with the device names of the disks.
  23393. Disks map[string]PreservedStatePreservedDisk `json:"disks,omitempty"`
  23394. // Metadata: Preserved metadata defined for this instance.
  23395. Metadata map[string]string `json:"metadata,omitempty"`
  23396. // ForceSendFields is a list of field names (e.g. "Disks") to
  23397. // unconditionally include in API requests. By default, fields with
  23398. // empty values are omitted from API requests. However, any non-pointer,
  23399. // non-interface field appearing in ForceSendFields will be sent to the
  23400. // server regardless of whether the field is empty or not. This may be
  23401. // used to include empty fields in Patch requests.
  23402. ForceSendFields []string `json:"-"`
  23403. // NullFields is a list of field names (e.g. "Disks") to include in API
  23404. // requests with the JSON null value. By default, fields with empty
  23405. // values are omitted from API requests. However, any field with an
  23406. // empty value appearing in NullFields will be sent to the server as
  23407. // null. It is an error if a field in this list has a non-empty value.
  23408. // This may be used to include null fields in Patch requests.
  23409. NullFields []string `json:"-"`
  23410. }
  23411. func (s *PreservedState) MarshalJSON() ([]byte, error) {
  23412. type NoMethod PreservedState
  23413. raw := NoMethod(*s)
  23414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23415. }
  23416. type PreservedStatePreservedDisk struct {
  23417. // AutoDelete: These stateful disks will never be deleted during
  23418. // autohealing, update, instance recreate operations. This flag is used
  23419. // to configure if the disk should be deleted after it is no longer used
  23420. // by the group, e.g. when the given instance or the whole MIG is
  23421. // deleted. Note: disks attached in READ_ONLY mode cannot be
  23422. // auto-deleted.
  23423. //
  23424. // Possible values:
  23425. // "NEVER"
  23426. // "ON_PERMANENT_INSTANCE_DELETION"
  23427. // "WHEN_NOT_IN_USE"
  23428. AutoDelete string `json:"autoDelete,omitempty"`
  23429. // Mode: The mode in which to attach this disk, either READ_WRITE or
  23430. // READ_ONLY. If not specified, the default is to attach the disk in
  23431. // READ_WRITE mode.
  23432. //
  23433. // Possible values:
  23434. // "READ_ONLY"
  23435. // "READ_WRITE"
  23436. Mode string `json:"mode,omitempty"`
  23437. // Source: The URL of the disk resource that is stateful and should be
  23438. // attached to the VM instance.
  23439. Source string `json:"source,omitempty"`
  23440. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  23441. // unconditionally include in API requests. By default, fields with
  23442. // empty values are omitted from API requests. However, any non-pointer,
  23443. // non-interface field appearing in ForceSendFields will be sent to the
  23444. // server regardless of whether the field is empty or not. This may be
  23445. // used to include empty fields in Patch requests.
  23446. ForceSendFields []string `json:"-"`
  23447. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  23448. // API requests with the JSON null value. By default, fields with empty
  23449. // values are omitted from API requests. However, any field with an
  23450. // empty value appearing in NullFields will be sent to the server as
  23451. // null. It is an error if a field in this list has a non-empty value.
  23452. // This may be used to include null fields in Patch requests.
  23453. NullFields []string `json:"-"`
  23454. }
  23455. func (s *PreservedStatePreservedDisk) MarshalJSON() ([]byte, error) {
  23456. type NoMethod PreservedStatePreservedDisk
  23457. raw := NoMethod(*s)
  23458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23459. }
  23460. // Principal: All fields defined in a principal are ANDed.
  23461. type Principal struct {
  23462. // Condition: An expression to specify custom condition.
  23463. Condition string `json:"condition,omitempty"`
  23464. // Groups: The groups the principal belongs to. Exact match, prefix
  23465. // match, and suffix match are supported.
  23466. Groups []string `json:"groups,omitempty"`
  23467. // Ips: IPv4 or IPv6 address or range (In CIDR format)
  23468. Ips []string `json:"ips,omitempty"`
  23469. // Namespaces: The namespaces. Exact match, prefix match, and suffix
  23470. // match are supported.
  23471. Namespaces []string `json:"namespaces,omitempty"`
  23472. // NotGroups: Negate of groups. Specifies exclusions.
  23473. NotGroups []string `json:"notGroups,omitempty"`
  23474. // NotIps: Negate of IPs. Specifies exclusions.
  23475. NotIps []string `json:"notIps,omitempty"`
  23476. // NotNamespaces: Negate of namespaces. Specifies exclusions.
  23477. NotNamespaces []string `json:"notNamespaces,omitempty"`
  23478. // NotUsers: Negate of users. Specifies exclusions.
  23479. NotUsers []string `json:"notUsers,omitempty"`
  23480. // Properties: A map of Istio attribute to expected values. Exact match,
  23481. // prefix match, and suffix match are supported for values. For example,
  23482. // `request.headers[version]: ?v1?`. The properties are ANDed together.
  23483. Properties map[string]string `json:"properties,omitempty"`
  23484. // Users: The user names/IDs or service accounts. Exact match, prefix
  23485. // match, and suffix match are supported.
  23486. Users []string `json:"users,omitempty"`
  23487. // ForceSendFields is a list of field names (e.g. "Condition") to
  23488. // unconditionally include in API requests. By default, fields with
  23489. // empty values are omitted from API requests. However, any non-pointer,
  23490. // non-interface field appearing in ForceSendFields will be sent to the
  23491. // server regardless of whether the field is empty or not. This may be
  23492. // used to include empty fields in Patch requests.
  23493. ForceSendFields []string `json:"-"`
  23494. // NullFields is a list of field names (e.g. "Condition") to include in
  23495. // API requests with the JSON null value. By default, fields with empty
  23496. // values are omitted from API requests. However, any field with an
  23497. // empty value appearing in NullFields will be sent to the server as
  23498. // null. It is an error if a field in this list has a non-empty value.
  23499. // This may be used to include null fields in Patch requests.
  23500. NullFields []string `json:"-"`
  23501. }
  23502. func (s *Principal) MarshalJSON() ([]byte, error) {
  23503. type NoMethod Principal
  23504. raw := NoMethod(*s)
  23505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23506. }
  23507. // Project: A Project resource. For an overview of projects, see Cloud
  23508. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  23509. // resource_for beta.projects ==)
  23510. type Project struct {
  23511. // CommonInstanceMetadata: Metadata key/value pairs available to all
  23512. // instances contained in this project. See Custom metadata for more
  23513. // information.
  23514. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  23515. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23516. // format.
  23517. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23518. // DefaultNetworkTier: This signifies the default network tier used for
  23519. // configuring resources of the project and can only take the following
  23520. // values: PREMIUM, STANDARD. Initially the default network tier is
  23521. // PREMIUM.
  23522. //
  23523. // Possible values:
  23524. // "PREMIUM"
  23525. // "SELECT"
  23526. // "STANDARD"
  23527. DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
  23528. // DefaultServiceAccount: [Output Only] Default service account used by
  23529. // VMs running in this project.
  23530. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  23531. // Description: An optional textual description of the resource.
  23532. Description string `json:"description,omitempty"`
  23533. // EnabledFeatures: Restricted features enabled for use on this project.
  23534. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  23535. // Id: [Output Only] The unique identifier for the resource. This
  23536. // identifier is defined by the server. This is not the project ID, and
  23537. // is just a unique ID used by Compute Engine to identify resources.
  23538. Id uint64 `json:"id,omitempty,string"`
  23539. // Kind: [Output Only] Type of the resource. Always compute#project for
  23540. // projects.
  23541. Kind string `json:"kind,omitempty"`
  23542. // Name: The project ID. For example: my-example-project. Use the
  23543. // project ID to make requests to Compute Engine.
  23544. Name string `json:"name,omitempty"`
  23545. // Quotas: [Output Only] Quotas assigned to this project.
  23546. Quotas []*Quota `json:"quotas,omitempty"`
  23547. // SelfLink: [Output Only] Server-defined URL for the resource.
  23548. SelfLink string `json:"selfLink,omitempty"`
  23549. // UsageExportLocation: The naming prefix for daily usage reports and
  23550. // the Google Cloud Storage bucket where they are stored.
  23551. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  23552. // XpnProjectStatus: [Output Only] The role this project has in a shared
  23553. // VPC configuration. Currently only HOST projects are differentiated.
  23554. //
  23555. // Possible values:
  23556. // "HOST"
  23557. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  23558. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  23559. // ServerResponse contains the HTTP response code and headers from the
  23560. // server.
  23561. googleapi.ServerResponse `json:"-"`
  23562. // ForceSendFields is a list of field names (e.g.
  23563. // "CommonInstanceMetadata") to unconditionally include in API requests.
  23564. // By default, fields with empty values are omitted from API requests.
  23565. // However, any non-pointer, non-interface field appearing in
  23566. // ForceSendFields will be sent to the server regardless of whether the
  23567. // field is empty or not. This may be used to include empty fields in
  23568. // Patch requests.
  23569. ForceSendFields []string `json:"-"`
  23570. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  23571. // to include in API requests with the JSON null value. By default,
  23572. // fields with empty values are omitted from API requests. However, any
  23573. // field with an empty value appearing in NullFields will be sent to the
  23574. // server as null. It is an error if a field in this list has a
  23575. // non-empty value. This may be used to include null fields in Patch
  23576. // requests.
  23577. NullFields []string `json:"-"`
  23578. }
  23579. func (s *Project) MarshalJSON() ([]byte, error) {
  23580. type NoMethod Project
  23581. raw := NoMethod(*s)
  23582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23583. }
  23584. type ProjectsDisableXpnResourceRequest struct {
  23585. // XpnResource: Service resource (a.k.a service project) ID.
  23586. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  23587. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  23588. // unconditionally include in API requests. By default, fields with
  23589. // empty values are omitted from API requests. However, any non-pointer,
  23590. // non-interface field appearing in ForceSendFields will be sent to the
  23591. // server regardless of whether the field is empty or not. This may be
  23592. // used to include empty fields in Patch requests.
  23593. ForceSendFields []string `json:"-"`
  23594. // NullFields is a list of field names (e.g. "XpnResource") to include
  23595. // in API requests with the JSON null value. By default, fields with
  23596. // empty values are omitted from API requests. However, any field with
  23597. // an empty value appearing in NullFields will be sent to the server as
  23598. // null. It is an error if a field in this list has a non-empty value.
  23599. // This may be used to include null fields in Patch requests.
  23600. NullFields []string `json:"-"`
  23601. }
  23602. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  23603. type NoMethod ProjectsDisableXpnResourceRequest
  23604. raw := NoMethod(*s)
  23605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23606. }
  23607. type ProjectsEnableXpnResourceRequest struct {
  23608. // XpnResource: Service resource (a.k.a service project) ID.
  23609. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  23610. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  23611. // unconditionally include in API requests. By default, fields with
  23612. // empty values are omitted from API requests. However, any non-pointer,
  23613. // non-interface field appearing in ForceSendFields will be sent to the
  23614. // server regardless of whether the field is empty or not. This may be
  23615. // used to include empty fields in Patch requests.
  23616. ForceSendFields []string `json:"-"`
  23617. // NullFields is a list of field names (e.g. "XpnResource") to include
  23618. // in API requests with the JSON null value. By default, fields with
  23619. // empty values are omitted from API requests. However, any field with
  23620. // an empty value appearing in NullFields will be sent to the server as
  23621. // null. It is an error if a field in this list has a non-empty value.
  23622. // This may be used to include null fields in Patch requests.
  23623. NullFields []string `json:"-"`
  23624. }
  23625. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  23626. type NoMethod ProjectsEnableXpnResourceRequest
  23627. raw := NoMethod(*s)
  23628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23629. }
  23630. type ProjectsGetXpnResources struct {
  23631. // Kind: [Output Only] Type of resource. Always
  23632. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  23633. // service projects)
  23634. Kind string `json:"kind,omitempty"`
  23635. // NextPageToken: [Output Only] This token allows you to get the next
  23636. // page of results for list requests. If the number of results is larger
  23637. // than maxResults, use the nextPageToken as a value for the query
  23638. // parameter pageToken in the next list request. Subsequent list
  23639. // requests will have their own nextPageToken to continue paging through
  23640. // the results.
  23641. NextPageToken string `json:"nextPageToken,omitempty"`
  23642. // Resources: Service resources (a.k.a service projects) attached to
  23643. // this project as their shared VPC host.
  23644. Resources []*XpnResourceId `json:"resources,omitempty"`
  23645. // ServerResponse contains the HTTP response code and headers from the
  23646. // server.
  23647. googleapi.ServerResponse `json:"-"`
  23648. // ForceSendFields is a list of field names (e.g. "Kind") to
  23649. // unconditionally include in API requests. By default, fields with
  23650. // empty values are omitted from API requests. However, any non-pointer,
  23651. // non-interface field appearing in ForceSendFields will be sent to the
  23652. // server regardless of whether the field is empty or not. This may be
  23653. // used to include empty fields in Patch requests.
  23654. ForceSendFields []string `json:"-"`
  23655. // NullFields is a list of field names (e.g. "Kind") to include in API
  23656. // requests with the JSON null value. By default, fields with empty
  23657. // values are omitted from API requests. However, any field with an
  23658. // empty value appearing in NullFields will be sent to the server as
  23659. // null. It is an error if a field in this list has a non-empty value.
  23660. // This may be used to include null fields in Patch requests.
  23661. NullFields []string `json:"-"`
  23662. }
  23663. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  23664. type NoMethod ProjectsGetXpnResources
  23665. raw := NoMethod(*s)
  23666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23667. }
  23668. type ProjectsListXpnHostsRequest struct {
  23669. // Organization: Optional organization ID managed by Cloud Resource
  23670. // Manager, for which to list shared VPC host projects. If not
  23671. // specified, the organization will be inferred from the project.
  23672. Organization string `json:"organization,omitempty"`
  23673. // ForceSendFields is a list of field names (e.g. "Organization") to
  23674. // unconditionally include in API requests. By default, fields with
  23675. // empty values are omitted from API requests. However, any non-pointer,
  23676. // non-interface field appearing in ForceSendFields will be sent to the
  23677. // server regardless of whether the field is empty or not. This may be
  23678. // used to include empty fields in Patch requests.
  23679. ForceSendFields []string `json:"-"`
  23680. // NullFields is a list of field names (e.g. "Organization") to include
  23681. // in API requests with the JSON null value. By default, fields with
  23682. // empty values are omitted from API requests. However, any field with
  23683. // an empty value appearing in NullFields will be sent to the server as
  23684. // null. It is an error if a field in this list has a non-empty value.
  23685. // This may be used to include null fields in Patch requests.
  23686. NullFields []string `json:"-"`
  23687. }
  23688. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  23689. type NoMethod ProjectsListXpnHostsRequest
  23690. raw := NoMethod(*s)
  23691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23692. }
  23693. type ProjectsSetDefaultNetworkTierRequest struct {
  23694. // NetworkTier: Default network tier to be set.
  23695. //
  23696. // Possible values:
  23697. // "PREMIUM"
  23698. // "SELECT"
  23699. // "STANDARD"
  23700. NetworkTier string `json:"networkTier,omitempty"`
  23701. // ForceSendFields is a list of field names (e.g. "NetworkTier") to
  23702. // unconditionally include in API requests. By default, fields with
  23703. // empty values are omitted from API requests. However, any non-pointer,
  23704. // non-interface field appearing in ForceSendFields will be sent to the
  23705. // server regardless of whether the field is empty or not. This may be
  23706. // used to include empty fields in Patch requests.
  23707. ForceSendFields []string `json:"-"`
  23708. // NullFields is a list of field names (e.g. "NetworkTier") to include
  23709. // in API requests with the JSON null value. By default, fields with
  23710. // empty values are omitted from API requests. However, any field with
  23711. // an empty value appearing in NullFields will be sent to the server as
  23712. // null. It is an error if a field in this list has a non-empty value.
  23713. // This may be used to include null fields in Patch requests.
  23714. NullFields []string `json:"-"`
  23715. }
  23716. func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
  23717. type NoMethod ProjectsSetDefaultNetworkTierRequest
  23718. raw := NoMethod(*s)
  23719. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23720. }
  23721. type ProjectsSetDefaultServiceAccountRequest struct {
  23722. // Email: Email address of the service account.
  23723. Email string `json:"email,omitempty"`
  23724. // ForceSendFields is a list of field names (e.g. "Email") 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. "Email") 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 *ProjectsSetDefaultServiceAccountRequest) MarshalJSON() ([]byte, error) {
  23740. type NoMethod ProjectsSetDefaultServiceAccountRequest
  23741. raw := NoMethod(*s)
  23742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23743. }
  23744. // Quota: A quotas entry.
  23745. type Quota struct {
  23746. // Limit: [Output Only] Quota limit for this metric.
  23747. Limit float64 `json:"limit,omitempty"`
  23748. // Metric: [Output Only] Name of the quota metric.
  23749. //
  23750. // Possible values:
  23751. // "ALIASES_PER_NETWORK_GLOBAL"
  23752. // "AMD_S9300_GPUS"
  23753. // "AUTOSCALERS"
  23754. // "BACKEND_BUCKETS"
  23755. // "BACKEND_SERVICES"
  23756. // "COMMITMENTS"
  23757. // "CPUS"
  23758. // "CPUS_ALL_REGIONS"
  23759. // "DISKS_TOTAL_GB"
  23760. // "EXTERNAL_VPN_GATEWAYS"
  23761. // "FIREWALLS"
  23762. // "FORWARDING_RULES"
  23763. // "GLOBAL_INTERNAL_ADDRESSES"
  23764. // "GPUS_ALL_REGIONS"
  23765. // "HEALTH_CHECKS"
  23766. // "IMAGES"
  23767. // "INSTANCES"
  23768. // "INSTANCES_PER_NETWORK_GLOBAL"
  23769. // "INSTANCE_GROUPS"
  23770. // "INSTANCE_GROUP_MANAGERS"
  23771. // "INSTANCE_TEMPLATES"
  23772. // "INTERCONNECTS"
  23773. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  23774. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  23775. // "INTERNAL_ADDRESSES"
  23776. // "INTERNAL_FORWARDING_RULES_PER_NETWORK"
  23777. // "INTERNAL_FORWARDING_RULES_WITH_GLOBAL_ACCESS_PER_NETWORK"
  23778. // "INTERNAL_FORWARDING_RULES_WITH_TARGET_INSTANCE_PER_NETWORK"
  23779. // "INTERNAL_TARGET_INSTANCE_WITH_GLOBAL_ACCESS_PER_NETWORK"
  23780. // "IN_USE_ADDRESSES"
  23781. // "IN_USE_BACKUP_SCHEDULES"
  23782. // "IN_USE_MAINTENANCE_WINDOWS"
  23783. // "IN_USE_SNAPSHOT_SCHEDULES"
  23784. // "LOCAL_SSD_TOTAL_GB"
  23785. // "MACHINE_IMAGES"
  23786. // "NETWORKS"
  23787. // "NETWORK_ENDPOINT_GROUPS"
  23788. // "NVIDIA_K80_GPUS"
  23789. // "NVIDIA_P100_GPUS"
  23790. // "NVIDIA_P100_VWS_GPUS"
  23791. // "NVIDIA_P4_GPUS"
  23792. // "NVIDIA_P4_VWS_GPUS"
  23793. // "NVIDIA_T4_GPUS"
  23794. // "NVIDIA_T4_VWS_GPUS"
  23795. // "NVIDIA_V100_GPUS"
  23796. // "PREEMPTIBLE_CPUS"
  23797. // "PREEMPTIBLE_LOCAL_SSD_GB"
  23798. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  23799. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  23800. // "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS"
  23801. // "PREEMPTIBLE_NVIDIA_P4_GPUS"
  23802. // "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS"
  23803. // "PREEMPTIBLE_NVIDIA_T4_GPUS"
  23804. // "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS"
  23805. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  23806. // "PRIVATE_V6_ACCESS_SUBNETWORKS"
  23807. // "REGIONAL_AUTOSCALERS"
  23808. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  23809. // "RESOURCE_POLICIES"
  23810. // "ROUTERS"
  23811. // "ROUTES"
  23812. // "SECURITY_POLICIES"
  23813. // "SECURITY_POLICY_RULES"
  23814. // "SNAPSHOTS"
  23815. // "SSD_TOTAL_GB"
  23816. // "SSL_CERTIFICATES"
  23817. // "STATIC_ADDRESSES"
  23818. // "SUBNETWORKS"
  23819. // "TARGET_HTTPS_PROXIES"
  23820. // "TARGET_HTTP_PROXIES"
  23821. // "TARGET_INSTANCES"
  23822. // "TARGET_POOLS"
  23823. // "TARGET_SSL_PROXIES"
  23824. // "TARGET_TCP_PROXIES"
  23825. // "TARGET_VPN_GATEWAYS"
  23826. // "URL_MAPS"
  23827. // "VPN_GATEWAYS"
  23828. // "VPN_TUNNELS"
  23829. // "XPN_SERVICE_PROJECTS"
  23830. Metric string `json:"metric,omitempty"`
  23831. // Owner: [Output Only] Owning resource. This is the resource on which
  23832. // this quota is applied.
  23833. Owner string `json:"owner,omitempty"`
  23834. // Usage: [Output Only] Current usage of this metric.
  23835. Usage float64 `json:"usage,omitempty"`
  23836. // ForceSendFields is a list of field names (e.g. "Limit") to
  23837. // unconditionally include in API requests. By default, fields with
  23838. // empty values are omitted from API requests. However, any non-pointer,
  23839. // non-interface field appearing in ForceSendFields will be sent to the
  23840. // server regardless of whether the field is empty or not. This may be
  23841. // used to include empty fields in Patch requests.
  23842. ForceSendFields []string `json:"-"`
  23843. // NullFields is a list of field names (e.g. "Limit") to include in API
  23844. // requests with the JSON null value. By default, fields with empty
  23845. // values are omitted from API requests. However, any field with an
  23846. // empty value appearing in NullFields will be sent to the server as
  23847. // null. It is an error if a field in this list has a non-empty value.
  23848. // This may be used to include null fields in Patch requests.
  23849. NullFields []string `json:"-"`
  23850. }
  23851. func (s *Quota) MarshalJSON() ([]byte, error) {
  23852. type NoMethod Quota
  23853. raw := NoMethod(*s)
  23854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23855. }
  23856. func (s *Quota) UnmarshalJSON(data []byte) error {
  23857. type NoMethod Quota
  23858. var s1 struct {
  23859. Limit gensupport.JSONFloat64 `json:"limit"`
  23860. Usage gensupport.JSONFloat64 `json:"usage"`
  23861. *NoMethod
  23862. }
  23863. s1.NoMethod = (*NoMethod)(s)
  23864. if err := json.Unmarshal(data, &s1); err != nil {
  23865. return err
  23866. }
  23867. s.Limit = float64(s1.Limit)
  23868. s.Usage = float64(s1.Usage)
  23869. return nil
  23870. }
  23871. type RbacPolicy struct {
  23872. // Name: Name of the RbacPolicy.
  23873. Name string `json:"name,omitempty"`
  23874. // Permissions: The list of permissions.
  23875. Permissions []*Permission `json:"permissions,omitempty"`
  23876. // Principals: The list of principals.
  23877. Principals []*Principal `json:"principals,omitempty"`
  23878. // ForceSendFields is a list of field names (e.g. "Name") to
  23879. // unconditionally include in API requests. By default, fields with
  23880. // empty values are omitted from API requests. However, any non-pointer,
  23881. // non-interface field appearing in ForceSendFields will be sent to the
  23882. // server regardless of whether the field is empty or not. This may be
  23883. // used to include empty fields in Patch requests.
  23884. ForceSendFields []string `json:"-"`
  23885. // NullFields is a list of field names (e.g. "Name") to include in API
  23886. // requests with the JSON null value. By default, fields with empty
  23887. // values are omitted from API requests. However, any field with an
  23888. // empty value appearing in NullFields will be sent to the server as
  23889. // null. It is an error if a field in this list has a non-empty value.
  23890. // This may be used to include null fields in Patch requests.
  23891. NullFields []string `json:"-"`
  23892. }
  23893. func (s *RbacPolicy) MarshalJSON() ([]byte, error) {
  23894. type NoMethod RbacPolicy
  23895. raw := NoMethod(*s)
  23896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23897. }
  23898. // Reference: Represents a reference to a resource.
  23899. type Reference struct {
  23900. // Kind: [Output Only] Type of the resource. Always compute#reference
  23901. // for references.
  23902. Kind string `json:"kind,omitempty"`
  23903. // ReferenceType: A description of the reference type with no implied
  23904. // semantics. Possible values include:
  23905. // - MEMBER_OF
  23906. ReferenceType string `json:"referenceType,omitempty"`
  23907. // Referrer: URL of the resource which refers to the target.
  23908. Referrer string `json:"referrer,omitempty"`
  23909. // Target: URL of the resource to which this reference points.
  23910. Target string `json:"target,omitempty"`
  23911. // ForceSendFields is a list of field names (e.g. "Kind") to
  23912. // unconditionally include in API requests. By default, fields with
  23913. // empty values are omitted from API requests. However, any non-pointer,
  23914. // non-interface field appearing in ForceSendFields will be sent to the
  23915. // server regardless of whether the field is empty or not. This may be
  23916. // used to include empty fields in Patch requests.
  23917. ForceSendFields []string `json:"-"`
  23918. // NullFields is a list of field names (e.g. "Kind") to include in API
  23919. // requests with the JSON null value. By default, fields with empty
  23920. // values are omitted from API requests. However, any field with an
  23921. // empty value appearing in NullFields will be sent to the server as
  23922. // null. It is an error if a field in this list has a non-empty value.
  23923. // This may be used to include null fields in Patch requests.
  23924. NullFields []string `json:"-"`
  23925. }
  23926. func (s *Reference) MarshalJSON() ([]byte, error) {
  23927. type NoMethod Reference
  23928. raw := NoMethod(*s)
  23929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23930. }
  23931. // Region: Region resource. (== resource_for beta.regions ==) (==
  23932. // resource_for v1.regions ==)
  23933. type Region struct {
  23934. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23935. // format.
  23936. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23937. // Deprecated: [Output Only] The deprecation status associated with this
  23938. // region.
  23939. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  23940. // Description: [Output Only] Textual description of the resource.
  23941. Description string `json:"description,omitempty"`
  23942. // Id: [Output Only] The unique identifier for the resource. This
  23943. // identifier is defined by the server.
  23944. Id uint64 `json:"id,omitempty,string"`
  23945. // Kind: [Output Only] Type of the resource. Always compute#region for
  23946. // regions.
  23947. Kind string `json:"kind,omitempty"`
  23948. // Name: [Output Only] Name of the resource.
  23949. Name string `json:"name,omitempty"`
  23950. // Quotas: [Output Only] Quotas assigned to this region.
  23951. Quotas []*Quota `json:"quotas,omitempty"`
  23952. // SelfLink: [Output Only] Server-defined URL for the resource.
  23953. SelfLink string `json:"selfLink,omitempty"`
  23954. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  23955. // with the resource id.
  23956. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  23957. // Status: [Output Only] Status of the region, either UP or DOWN.
  23958. //
  23959. // Possible values:
  23960. // "DOWN"
  23961. // "UP"
  23962. Status string `json:"status,omitempty"`
  23963. // Zones: [Output Only] A list of zones available in this region, in the
  23964. // form of resource URLs.
  23965. Zones []string `json:"zones,omitempty"`
  23966. // ServerResponse contains the HTTP response code and headers from the
  23967. // server.
  23968. googleapi.ServerResponse `json:"-"`
  23969. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23970. // to unconditionally include in API requests. By default, fields with
  23971. // empty values are omitted from API requests. However, any non-pointer,
  23972. // non-interface field appearing in ForceSendFields will be sent to the
  23973. // server regardless of whether the field is empty or not. This may be
  23974. // used to include empty fields in Patch requests.
  23975. ForceSendFields []string `json:"-"`
  23976. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23977. // include in API requests with the JSON null value. By default, fields
  23978. // with empty values are omitted from API requests. However, any field
  23979. // with an empty value appearing in NullFields will be sent to the
  23980. // server as null. It is an error if a field in this list has a
  23981. // non-empty value. This may be used to include null fields in Patch
  23982. // requests.
  23983. NullFields []string `json:"-"`
  23984. }
  23985. func (s *Region) MarshalJSON() ([]byte, error) {
  23986. type NoMethod Region
  23987. raw := NoMethod(*s)
  23988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23989. }
  23990. // RegionAutoscalerList: Contains a list of autoscalers.
  23991. type RegionAutoscalerList struct {
  23992. // Id: [Output Only] Unique identifier for the resource; defined by the
  23993. // server.
  23994. Id string `json:"id,omitempty"`
  23995. // Items: A list of Autoscaler resources.
  23996. Items []*Autoscaler `json:"items,omitempty"`
  23997. // Kind: Type of resource.
  23998. Kind string `json:"kind,omitempty"`
  23999. // NextPageToken: [Output Only] This token allows you to get the next
  24000. // page of results for list requests. If the number of results is larger
  24001. // than maxResults, use the nextPageToken as a value for the query
  24002. // parameter pageToken in the next list request. Subsequent list
  24003. // requests will have their own nextPageToken to continue paging through
  24004. // the results.
  24005. NextPageToken string `json:"nextPageToken,omitempty"`
  24006. // SelfLink: [Output Only] Server-defined URL for this resource.
  24007. SelfLink string `json:"selfLink,omitempty"`
  24008. // Warning: [Output Only] Informational warning message.
  24009. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  24010. // ServerResponse contains the HTTP response code and headers from the
  24011. // server.
  24012. googleapi.ServerResponse `json:"-"`
  24013. // ForceSendFields is a list of field names (e.g. "Id") to
  24014. // unconditionally include in API requests. By default, fields with
  24015. // empty values are omitted from API requests. However, any non-pointer,
  24016. // non-interface field appearing in ForceSendFields will be sent to the
  24017. // server regardless of whether the field is empty or not. This may be
  24018. // used to include empty fields in Patch requests.
  24019. ForceSendFields []string `json:"-"`
  24020. // NullFields is a list of field names (e.g. "Id") to include in API
  24021. // requests with the JSON null value. By default, fields with empty
  24022. // values are omitted from API requests. However, any field with an
  24023. // empty value appearing in NullFields will be sent to the server as
  24024. // null. It is an error if a field in this list has a non-empty value.
  24025. // This may be used to include null fields in Patch requests.
  24026. NullFields []string `json:"-"`
  24027. }
  24028. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  24029. type NoMethod RegionAutoscalerList
  24030. raw := NoMethod(*s)
  24031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24032. }
  24033. // RegionAutoscalerListWarning: [Output Only] Informational warning
  24034. // message.
  24035. type RegionAutoscalerListWarning struct {
  24036. // Code: [Output Only] A warning code, if applicable. For example,
  24037. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24038. // the response.
  24039. //
  24040. // Possible values:
  24041. // "CLEANUP_FAILED"
  24042. // "DEPRECATED_RESOURCE_USED"
  24043. // "DEPRECATED_TYPE_USED"
  24044. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24045. // "EXPERIMENTAL_TYPE_USED"
  24046. // "EXTERNAL_API_WARNING"
  24047. // "FIELD_VALUE_OVERRIDEN"
  24048. // "INJECTED_KERNELS_DEPRECATED"
  24049. // "MISSING_TYPE_DEPENDENCY"
  24050. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24051. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24052. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24053. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24054. // "NEXT_HOP_NOT_RUNNING"
  24055. // "NOT_CRITICAL_ERROR"
  24056. // "NO_RESULTS_ON_PAGE"
  24057. // "REQUIRED_TOS_AGREEMENT"
  24058. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24059. // "RESOURCE_NOT_DELETED"
  24060. // "SCHEMA_VALIDATION_IGNORED"
  24061. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24062. // "UNDECLARED_PROPERTIES"
  24063. // "UNREACHABLE"
  24064. Code string `json:"code,omitempty"`
  24065. // Data: [Output Only] Metadata about this warning in key: value format.
  24066. // For example:
  24067. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24068. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  24069. // Message: [Output Only] A human-readable description of the warning
  24070. // code.
  24071. Message string `json:"message,omitempty"`
  24072. // ForceSendFields is a list of field names (e.g. "Code") to
  24073. // unconditionally include in API requests. By default, fields with
  24074. // empty values are omitted from API requests. However, any non-pointer,
  24075. // non-interface field appearing in ForceSendFields will be sent to the
  24076. // server regardless of whether the field is empty or not. This may be
  24077. // used to include empty fields in Patch requests.
  24078. ForceSendFields []string `json:"-"`
  24079. // NullFields is a list of field names (e.g. "Code") to include in API
  24080. // requests with the JSON null value. By default, fields with empty
  24081. // values are omitted from API requests. However, any field with an
  24082. // empty value appearing in NullFields will be sent to the server as
  24083. // null. It is an error if a field in this list has a non-empty value.
  24084. // This may be used to include null fields in Patch requests.
  24085. NullFields []string `json:"-"`
  24086. }
  24087. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  24088. type NoMethod RegionAutoscalerListWarning
  24089. raw := NoMethod(*s)
  24090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24091. }
  24092. type RegionAutoscalerListWarningData struct {
  24093. // Key: [Output Only] A key that provides more detail on the warning
  24094. // being returned. For example, for warnings where there are no results
  24095. // in a list request for a particular zone, this key might be scope and
  24096. // the key value might be the zone name. Other examples might be a key
  24097. // indicating a deprecated resource and a suggested replacement, or a
  24098. // warning about invalid network settings (for example, if an instance
  24099. // attempts to perform IP forwarding but is not enabled for IP
  24100. // forwarding).
  24101. Key string `json:"key,omitempty"`
  24102. // Value: [Output Only] A warning data value corresponding to the key.
  24103. Value string `json:"value,omitempty"`
  24104. // ForceSendFields is a list of field names (e.g. "Key") to
  24105. // unconditionally include in API requests. By default, fields with
  24106. // empty values are omitted from API requests. However, any non-pointer,
  24107. // non-interface field appearing in ForceSendFields will be sent to the
  24108. // server regardless of whether the field is empty or not. This may be
  24109. // used to include empty fields in Patch requests.
  24110. ForceSendFields []string `json:"-"`
  24111. // NullFields is a list of field names (e.g. "Key") to include in API
  24112. // requests with the JSON null value. By default, fields with empty
  24113. // values are omitted from API requests. However, any field with an
  24114. // empty value appearing in NullFields will be sent to the server as
  24115. // null. It is an error if a field in this list has a non-empty value.
  24116. // This may be used to include null fields in Patch requests.
  24117. NullFields []string `json:"-"`
  24118. }
  24119. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  24120. type NoMethod RegionAutoscalerListWarningData
  24121. raw := NoMethod(*s)
  24122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24123. }
  24124. type RegionCommitmentsUpdateReservationsRequest struct {
  24125. // Reservations: List of reservations for the capacity move of VMs with
  24126. // accelerators and local ssds.
  24127. Reservations []*Reservation `json:"reservations,omitempty"`
  24128. // ForceSendFields is a list of field names (e.g. "Reservations") to
  24129. // unconditionally include in API requests. By default, fields with
  24130. // empty values are omitted from API requests. However, any non-pointer,
  24131. // non-interface field appearing in ForceSendFields will be sent to the
  24132. // server regardless of whether the field is empty or not. This may be
  24133. // used to include empty fields in Patch requests.
  24134. ForceSendFields []string `json:"-"`
  24135. // NullFields is a list of field names (e.g. "Reservations") to include
  24136. // in API requests with the JSON null value. By default, fields with
  24137. // empty values are omitted from API requests. However, any field with
  24138. // an empty value appearing in NullFields will be sent to the server as
  24139. // null. It is an error if a field in this list has a non-empty value.
  24140. // This may be used to include null fields in Patch requests.
  24141. NullFields []string `json:"-"`
  24142. }
  24143. func (s *RegionCommitmentsUpdateReservationsRequest) MarshalJSON() ([]byte, error) {
  24144. type NoMethod RegionCommitmentsUpdateReservationsRequest
  24145. raw := NoMethod(*s)
  24146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24147. }
  24148. type RegionDiskTypeList struct {
  24149. // Id: [Output Only] Unique identifier for the resource; defined by the
  24150. // server.
  24151. Id string `json:"id,omitempty"`
  24152. // Items: A list of DiskType resources.
  24153. Items []*DiskType `json:"items,omitempty"`
  24154. // Kind: [Output Only] Type of resource. Always
  24155. // compute#regionDiskTypeList for region disk types.
  24156. Kind string `json:"kind,omitempty"`
  24157. // NextPageToken: [Output Only] This token allows you to get the next
  24158. // page of results for list requests. If the number of results is larger
  24159. // than maxResults, use the nextPageToken as a value for the query
  24160. // parameter pageToken in the next list request. Subsequent list
  24161. // requests will have their own nextPageToken to continue paging through
  24162. // the results.
  24163. NextPageToken string `json:"nextPageToken,omitempty"`
  24164. // SelfLink: [Output Only] Server-defined URL for this resource.
  24165. SelfLink string `json:"selfLink,omitempty"`
  24166. // Warning: [Output Only] Informational warning message.
  24167. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  24168. // ServerResponse contains the HTTP response code and headers from the
  24169. // server.
  24170. googleapi.ServerResponse `json:"-"`
  24171. // ForceSendFields is a list of field names (e.g. "Id") to
  24172. // unconditionally include in API requests. By default, fields with
  24173. // empty values are omitted from API requests. However, any non-pointer,
  24174. // non-interface field appearing in ForceSendFields will be sent to the
  24175. // server regardless of whether the field is empty or not. This may be
  24176. // used to include empty fields in Patch requests.
  24177. ForceSendFields []string `json:"-"`
  24178. // NullFields is a list of field names (e.g. "Id") to include in API
  24179. // requests with the JSON null value. By default, fields with empty
  24180. // values are omitted from API requests. However, any field with an
  24181. // empty value appearing in NullFields will be sent to the server as
  24182. // null. It is an error if a field in this list has a non-empty value.
  24183. // This may be used to include null fields in Patch requests.
  24184. NullFields []string `json:"-"`
  24185. }
  24186. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  24187. type NoMethod RegionDiskTypeList
  24188. raw := NoMethod(*s)
  24189. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24190. }
  24191. // RegionDiskTypeListWarning: [Output Only] Informational warning
  24192. // message.
  24193. type RegionDiskTypeListWarning struct {
  24194. // Code: [Output Only] A warning code, if applicable. For example,
  24195. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24196. // the response.
  24197. //
  24198. // Possible values:
  24199. // "CLEANUP_FAILED"
  24200. // "DEPRECATED_RESOURCE_USED"
  24201. // "DEPRECATED_TYPE_USED"
  24202. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24203. // "EXPERIMENTAL_TYPE_USED"
  24204. // "EXTERNAL_API_WARNING"
  24205. // "FIELD_VALUE_OVERRIDEN"
  24206. // "INJECTED_KERNELS_DEPRECATED"
  24207. // "MISSING_TYPE_DEPENDENCY"
  24208. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24209. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24210. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24211. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24212. // "NEXT_HOP_NOT_RUNNING"
  24213. // "NOT_CRITICAL_ERROR"
  24214. // "NO_RESULTS_ON_PAGE"
  24215. // "REQUIRED_TOS_AGREEMENT"
  24216. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24217. // "RESOURCE_NOT_DELETED"
  24218. // "SCHEMA_VALIDATION_IGNORED"
  24219. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24220. // "UNDECLARED_PROPERTIES"
  24221. // "UNREACHABLE"
  24222. Code string `json:"code,omitempty"`
  24223. // Data: [Output Only] Metadata about this warning in key: value format.
  24224. // For example:
  24225. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24226. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  24227. // Message: [Output Only] A human-readable description of the warning
  24228. // code.
  24229. Message string `json:"message,omitempty"`
  24230. // ForceSendFields is a list of field names (e.g. "Code") to
  24231. // unconditionally include in API requests. By default, fields with
  24232. // empty values are omitted from API requests. However, any non-pointer,
  24233. // non-interface field appearing in ForceSendFields will be sent to the
  24234. // server regardless of whether the field is empty or not. This may be
  24235. // used to include empty fields in Patch requests.
  24236. ForceSendFields []string `json:"-"`
  24237. // NullFields is a list of field names (e.g. "Code") to include in API
  24238. // requests with the JSON null value. By default, fields with empty
  24239. // values are omitted from API requests. However, any field with an
  24240. // empty value appearing in NullFields will be sent to the server as
  24241. // null. It is an error if a field in this list has a non-empty value.
  24242. // This may be used to include null fields in Patch requests.
  24243. NullFields []string `json:"-"`
  24244. }
  24245. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  24246. type NoMethod RegionDiskTypeListWarning
  24247. raw := NoMethod(*s)
  24248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24249. }
  24250. type RegionDiskTypeListWarningData struct {
  24251. // Key: [Output Only] A key that provides more detail on the warning
  24252. // being returned. For example, for warnings where there are no results
  24253. // in a list request for a particular zone, this key might be scope and
  24254. // the key value might be the zone name. Other examples might be a key
  24255. // indicating a deprecated resource and a suggested replacement, or a
  24256. // warning about invalid network settings (for example, if an instance
  24257. // attempts to perform IP forwarding but is not enabled for IP
  24258. // forwarding).
  24259. Key string `json:"key,omitempty"`
  24260. // Value: [Output Only] A warning data value corresponding to the key.
  24261. Value string `json:"value,omitempty"`
  24262. // ForceSendFields is a list of field names (e.g. "Key") to
  24263. // unconditionally include in API requests. By default, fields with
  24264. // empty values are omitted from API requests. However, any non-pointer,
  24265. // non-interface field appearing in ForceSendFields will be sent to the
  24266. // server regardless of whether the field is empty or not. This may be
  24267. // used to include empty fields in Patch requests.
  24268. ForceSendFields []string `json:"-"`
  24269. // NullFields is a list of field names (e.g. "Key") to include in API
  24270. // requests with the JSON null value. By default, fields with empty
  24271. // values are omitted from API requests. However, any field with an
  24272. // empty value appearing in NullFields will be sent to the server as
  24273. // null. It is an error if a field in this list has a non-empty value.
  24274. // This may be used to include null fields in Patch requests.
  24275. NullFields []string `json:"-"`
  24276. }
  24277. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  24278. type NoMethod RegionDiskTypeListWarningData
  24279. raw := NoMethod(*s)
  24280. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24281. }
  24282. type RegionDisksAddResourcePoliciesRequest struct {
  24283. // ResourcePolicies: Resource policies to be added to this disk.
  24284. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  24285. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  24286. // unconditionally include in API requests. By default, fields with
  24287. // empty values are omitted from API requests. However, any non-pointer,
  24288. // non-interface field appearing in ForceSendFields will be sent to the
  24289. // server regardless of whether the field is empty or not. This may be
  24290. // used to include empty fields in Patch requests.
  24291. ForceSendFields []string `json:"-"`
  24292. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  24293. // include in API requests with the JSON null value. By default, fields
  24294. // with empty values are omitted from API requests. However, any field
  24295. // with an empty value appearing in NullFields will be sent to the
  24296. // server as null. It is an error if a field in this list has a
  24297. // non-empty value. This may be used to include null fields in Patch
  24298. // requests.
  24299. NullFields []string `json:"-"`
  24300. }
  24301. func (s *RegionDisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  24302. type NoMethod RegionDisksAddResourcePoliciesRequest
  24303. raw := NoMethod(*s)
  24304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24305. }
  24306. type RegionDisksRemoveResourcePoliciesRequest struct {
  24307. // ResourcePolicies: Resource policies to be removed from this disk.
  24308. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  24309. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  24310. // unconditionally include in API requests. By default, fields with
  24311. // empty values are omitted from API requests. However, any non-pointer,
  24312. // non-interface field appearing in ForceSendFields will be sent to the
  24313. // server regardless of whether the field is empty or not. This may be
  24314. // used to include empty fields in Patch requests.
  24315. ForceSendFields []string `json:"-"`
  24316. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  24317. // include in API requests with the JSON null value. By default, fields
  24318. // with empty values are omitted from API requests. However, any field
  24319. // with an empty value appearing in NullFields will be sent to the
  24320. // server as null. It is an error if a field in this list has a
  24321. // non-empty value. This may be used to include null fields in Patch
  24322. // requests.
  24323. NullFields []string `json:"-"`
  24324. }
  24325. func (s *RegionDisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  24326. type NoMethod RegionDisksRemoveResourcePoliciesRequest
  24327. raw := NoMethod(*s)
  24328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24329. }
  24330. type RegionDisksResizeRequest struct {
  24331. // SizeGb: The new size of the regional persistent disk, which is
  24332. // specified in GB.
  24333. SizeGb int64 `json:"sizeGb,omitempty,string"`
  24334. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  24335. // unconditionally include in API requests. By default, fields with
  24336. // empty values are omitted from API requests. However, any non-pointer,
  24337. // non-interface field appearing in ForceSendFields will be sent to the
  24338. // server regardless of whether the field is empty or not. This may be
  24339. // used to include empty fields in Patch requests.
  24340. ForceSendFields []string `json:"-"`
  24341. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  24342. // requests with the JSON null value. By default, fields with empty
  24343. // values are omitted from API requests. However, any field with an
  24344. // empty value appearing in NullFields will be sent to the server as
  24345. // null. It is an error if a field in this list has a non-empty value.
  24346. // This may be used to include null fields in Patch requests.
  24347. NullFields []string `json:"-"`
  24348. }
  24349. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  24350. type NoMethod RegionDisksResizeRequest
  24351. raw := NoMethod(*s)
  24352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24353. }
  24354. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  24355. type RegionInstanceGroupList struct {
  24356. // Id: [Output Only] Unique identifier for the resource; defined by the
  24357. // server.
  24358. Id string `json:"id,omitempty"`
  24359. // Items: A list of InstanceGroup resources.
  24360. Items []*InstanceGroup `json:"items,omitempty"`
  24361. // Kind: The resource type.
  24362. Kind string `json:"kind,omitempty"`
  24363. // NextPageToken: [Output Only] This token allows you to get the next
  24364. // page of results for list requests. If the number of results is larger
  24365. // than maxResults, use the nextPageToken as a value for the query
  24366. // parameter pageToken in the next list request. Subsequent list
  24367. // requests will have their own nextPageToken to continue paging through
  24368. // the results.
  24369. NextPageToken string `json:"nextPageToken,omitempty"`
  24370. // SelfLink: [Output Only] Server-defined URL for this resource.
  24371. SelfLink string `json:"selfLink,omitempty"`
  24372. // Warning: [Output Only] Informational warning message.
  24373. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  24374. // ServerResponse contains the HTTP response code and headers from the
  24375. // server.
  24376. googleapi.ServerResponse `json:"-"`
  24377. // ForceSendFields is a list of field names (e.g. "Id") to
  24378. // unconditionally include in API requests. By default, fields with
  24379. // empty values are omitted from API requests. However, any non-pointer,
  24380. // non-interface field appearing in ForceSendFields will be sent to the
  24381. // server regardless of whether the field is empty or not. This may be
  24382. // used to include empty fields in Patch requests.
  24383. ForceSendFields []string `json:"-"`
  24384. // NullFields is a list of field names (e.g. "Id") to include in API
  24385. // requests with the JSON null value. By default, fields with empty
  24386. // values are omitted from API requests. However, any field with an
  24387. // empty value appearing in NullFields will be sent to the server as
  24388. // null. It is an error if a field in this list has a non-empty value.
  24389. // This may be used to include null fields in Patch requests.
  24390. NullFields []string `json:"-"`
  24391. }
  24392. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  24393. type NoMethod RegionInstanceGroupList
  24394. raw := NoMethod(*s)
  24395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24396. }
  24397. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  24398. // message.
  24399. type RegionInstanceGroupListWarning struct {
  24400. // Code: [Output Only] A warning code, if applicable. For example,
  24401. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24402. // the response.
  24403. //
  24404. // Possible values:
  24405. // "CLEANUP_FAILED"
  24406. // "DEPRECATED_RESOURCE_USED"
  24407. // "DEPRECATED_TYPE_USED"
  24408. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24409. // "EXPERIMENTAL_TYPE_USED"
  24410. // "EXTERNAL_API_WARNING"
  24411. // "FIELD_VALUE_OVERRIDEN"
  24412. // "INJECTED_KERNELS_DEPRECATED"
  24413. // "MISSING_TYPE_DEPENDENCY"
  24414. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24415. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24416. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24417. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24418. // "NEXT_HOP_NOT_RUNNING"
  24419. // "NOT_CRITICAL_ERROR"
  24420. // "NO_RESULTS_ON_PAGE"
  24421. // "REQUIRED_TOS_AGREEMENT"
  24422. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24423. // "RESOURCE_NOT_DELETED"
  24424. // "SCHEMA_VALIDATION_IGNORED"
  24425. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24426. // "UNDECLARED_PROPERTIES"
  24427. // "UNREACHABLE"
  24428. Code string `json:"code,omitempty"`
  24429. // Data: [Output Only] Metadata about this warning in key: value format.
  24430. // For example:
  24431. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24432. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  24433. // Message: [Output Only] A human-readable description of the warning
  24434. // code.
  24435. Message string `json:"message,omitempty"`
  24436. // ForceSendFields is a list of field names (e.g. "Code") to
  24437. // unconditionally include in API requests. By default, fields with
  24438. // empty values are omitted from API requests. However, any non-pointer,
  24439. // non-interface field appearing in ForceSendFields will be sent to the
  24440. // server regardless of whether the field is empty or not. This may be
  24441. // used to include empty fields in Patch requests.
  24442. ForceSendFields []string `json:"-"`
  24443. // NullFields is a list of field names (e.g. "Code") to include in API
  24444. // requests with the JSON null value. By default, fields with empty
  24445. // values are omitted from API requests. However, any field with an
  24446. // empty value appearing in NullFields will be sent to the server as
  24447. // null. It is an error if a field in this list has a non-empty value.
  24448. // This may be used to include null fields in Patch requests.
  24449. NullFields []string `json:"-"`
  24450. }
  24451. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  24452. type NoMethod RegionInstanceGroupListWarning
  24453. raw := NoMethod(*s)
  24454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24455. }
  24456. type RegionInstanceGroupListWarningData struct {
  24457. // Key: [Output Only] A key that provides more detail on the warning
  24458. // being returned. For example, for warnings where there are no results
  24459. // in a list request for a particular zone, this key might be scope and
  24460. // the key value might be the zone name. Other examples might be a key
  24461. // indicating a deprecated resource and a suggested replacement, or a
  24462. // warning about invalid network settings (for example, if an instance
  24463. // attempts to perform IP forwarding but is not enabled for IP
  24464. // forwarding).
  24465. Key string `json:"key,omitempty"`
  24466. // Value: [Output Only] A warning data value corresponding to the key.
  24467. Value string `json:"value,omitempty"`
  24468. // ForceSendFields is a list of field names (e.g. "Key") to
  24469. // unconditionally include in API requests. By default, fields with
  24470. // empty values are omitted from API requests. However, any non-pointer,
  24471. // non-interface field appearing in ForceSendFields will be sent to the
  24472. // server regardless of whether the field is empty or not. This may be
  24473. // used to include empty fields in Patch requests.
  24474. ForceSendFields []string `json:"-"`
  24475. // NullFields is a list of field names (e.g. "Key") to include in API
  24476. // requests with the JSON null value. By default, fields with empty
  24477. // values are omitted from API requests. However, any field with an
  24478. // empty value appearing in NullFields will be sent to the server as
  24479. // null. It is an error if a field in this list has a non-empty value.
  24480. // This may be used to include null fields in Patch requests.
  24481. NullFields []string `json:"-"`
  24482. }
  24483. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  24484. type NoMethod RegionInstanceGroupListWarningData
  24485. raw := NoMethod(*s)
  24486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24487. }
  24488. // RegionInstanceGroupManagerDeleteInstanceConfigReq:
  24489. // RegionInstanceGroupManagers.deletePerInstanceConfigs
  24490. type RegionInstanceGroupManagerDeleteInstanceConfigReq struct {
  24491. // Instances: The list of instances for which we want to delete
  24492. // per-instance configs on this managed instance group.
  24493. Instances []string `json:"instances,omitempty"`
  24494. // Names: The list of instance names for which we want to delete
  24495. // per-instance configs on this managed instance group.
  24496. Names []string `json:"names,omitempty"`
  24497. // ForceSendFields is a list of field names (e.g. "Instances") to
  24498. // unconditionally include in API requests. By default, fields with
  24499. // empty values are omitted from API requests. However, any non-pointer,
  24500. // non-interface field appearing in ForceSendFields will be sent to the
  24501. // server regardless of whether the field is empty or not. This may be
  24502. // used to include empty fields in Patch requests.
  24503. ForceSendFields []string `json:"-"`
  24504. // NullFields is a list of field names (e.g. "Instances") to include in
  24505. // API requests with the JSON null value. By default, fields with empty
  24506. // values are omitted from API requests. However, any field with an
  24507. // empty value appearing in NullFields will be sent to the server as
  24508. // null. It is an error if a field in this list has a non-empty value.
  24509. // This may be used to include null fields in Patch requests.
  24510. NullFields []string `json:"-"`
  24511. }
  24512. func (s *RegionInstanceGroupManagerDeleteInstanceConfigReq) MarshalJSON() ([]byte, error) {
  24513. type NoMethod RegionInstanceGroupManagerDeleteInstanceConfigReq
  24514. raw := NoMethod(*s)
  24515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24516. }
  24517. // RegionInstanceGroupManagerList: Contains a list of managed instance
  24518. // groups.
  24519. type RegionInstanceGroupManagerList struct {
  24520. // Id: [Output Only] Unique identifier for the resource; defined by the
  24521. // server.
  24522. Id string `json:"id,omitempty"`
  24523. // Items: A list of InstanceGroupManager resources.
  24524. Items []*InstanceGroupManager `json:"items,omitempty"`
  24525. // Kind: [Output Only] The resource type, which is always
  24526. // compute#instanceGroupManagerList for a list of managed instance
  24527. // groups that exist in th regional scope.
  24528. Kind string `json:"kind,omitempty"`
  24529. // NextPageToken: [Output Only] This token allows you to get the next
  24530. // page of results for list requests. If the number of results is larger
  24531. // than maxResults, use the nextPageToken as a value for the query
  24532. // parameter pageToken in the next list request. Subsequent list
  24533. // requests will have their own nextPageToken to continue paging through
  24534. // the results.
  24535. NextPageToken string `json:"nextPageToken,omitempty"`
  24536. // SelfLink: [Output Only] Server-defined URL for this resource.
  24537. SelfLink string `json:"selfLink,omitempty"`
  24538. // Warning: [Output Only] Informational warning message.
  24539. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  24540. // ServerResponse contains the HTTP response code and headers from the
  24541. // server.
  24542. googleapi.ServerResponse `json:"-"`
  24543. // ForceSendFields is a list of field names (e.g. "Id") to
  24544. // unconditionally include in API requests. By default, fields with
  24545. // empty values are omitted from API requests. However, any non-pointer,
  24546. // non-interface field appearing in ForceSendFields will be sent to the
  24547. // server regardless of whether the field is empty or not. This may be
  24548. // used to include empty fields in Patch requests.
  24549. ForceSendFields []string `json:"-"`
  24550. // NullFields is a list of field names (e.g. "Id") to include in API
  24551. // requests with the JSON null value. By default, fields with empty
  24552. // values are omitted from API requests. However, any field with an
  24553. // empty value appearing in NullFields will be sent to the server as
  24554. // null. It is an error if a field in this list has a non-empty value.
  24555. // This may be used to include null fields in Patch requests.
  24556. NullFields []string `json:"-"`
  24557. }
  24558. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  24559. type NoMethod RegionInstanceGroupManagerList
  24560. raw := NoMethod(*s)
  24561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24562. }
  24563. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  24564. // warning message.
  24565. type RegionInstanceGroupManagerListWarning struct {
  24566. // Code: [Output Only] A warning code, if applicable. For example,
  24567. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24568. // the response.
  24569. //
  24570. // Possible values:
  24571. // "CLEANUP_FAILED"
  24572. // "DEPRECATED_RESOURCE_USED"
  24573. // "DEPRECATED_TYPE_USED"
  24574. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24575. // "EXPERIMENTAL_TYPE_USED"
  24576. // "EXTERNAL_API_WARNING"
  24577. // "FIELD_VALUE_OVERRIDEN"
  24578. // "INJECTED_KERNELS_DEPRECATED"
  24579. // "MISSING_TYPE_DEPENDENCY"
  24580. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24581. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24582. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24583. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24584. // "NEXT_HOP_NOT_RUNNING"
  24585. // "NOT_CRITICAL_ERROR"
  24586. // "NO_RESULTS_ON_PAGE"
  24587. // "REQUIRED_TOS_AGREEMENT"
  24588. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24589. // "RESOURCE_NOT_DELETED"
  24590. // "SCHEMA_VALIDATION_IGNORED"
  24591. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24592. // "UNDECLARED_PROPERTIES"
  24593. // "UNREACHABLE"
  24594. Code string `json:"code,omitempty"`
  24595. // Data: [Output Only] Metadata about this warning in key: value format.
  24596. // For example:
  24597. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24598. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  24599. // Message: [Output Only] A human-readable description of the warning
  24600. // code.
  24601. Message string `json:"message,omitempty"`
  24602. // ForceSendFields is a list of field names (e.g. "Code") to
  24603. // unconditionally include in API requests. By default, fields with
  24604. // empty values are omitted from API requests. However, any non-pointer,
  24605. // non-interface field appearing in ForceSendFields will be sent to the
  24606. // server regardless of whether the field is empty or not. This may be
  24607. // used to include empty fields in Patch requests.
  24608. ForceSendFields []string `json:"-"`
  24609. // NullFields is a list of field names (e.g. "Code") to include in API
  24610. // requests with the JSON null value. By default, fields with empty
  24611. // values are omitted from API requests. However, any field with an
  24612. // empty value appearing in NullFields will be sent to the server as
  24613. // null. It is an error if a field in this list has a non-empty value.
  24614. // This may be used to include null fields in Patch requests.
  24615. NullFields []string `json:"-"`
  24616. }
  24617. func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  24618. type NoMethod RegionInstanceGroupManagerListWarning
  24619. raw := NoMethod(*s)
  24620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24621. }
  24622. type RegionInstanceGroupManagerListWarningData struct {
  24623. // Key: [Output Only] A key that provides more detail on the warning
  24624. // being returned. For example, for warnings where there are no results
  24625. // in a list request for a particular zone, this key might be scope and
  24626. // the key value might be the zone name. Other examples might be a key
  24627. // indicating a deprecated resource and a suggested replacement, or a
  24628. // warning about invalid network settings (for example, if an instance
  24629. // attempts to perform IP forwarding but is not enabled for IP
  24630. // forwarding).
  24631. Key string `json:"key,omitempty"`
  24632. // Value: [Output Only] A warning data value corresponding to the key.
  24633. Value string `json:"value,omitempty"`
  24634. // ForceSendFields is a list of field names (e.g. "Key") to
  24635. // unconditionally include in API requests. By default, fields with
  24636. // empty values are omitted from API requests. However, any non-pointer,
  24637. // non-interface field appearing in ForceSendFields will be sent to the
  24638. // server regardless of whether the field is empty or not. This may be
  24639. // used to include empty fields in Patch requests.
  24640. ForceSendFields []string `json:"-"`
  24641. // NullFields is a list of field names (e.g. "Key") to include in API
  24642. // requests with the JSON null value. By default, fields with empty
  24643. // values are omitted from API requests. However, any field with an
  24644. // empty value appearing in NullFields will be sent to the server as
  24645. // null. It is an error if a field in this list has a non-empty value.
  24646. // This may be used to include null fields in Patch requests.
  24647. NullFields []string `json:"-"`
  24648. }
  24649. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  24650. type NoMethod RegionInstanceGroupManagerListWarningData
  24651. raw := NoMethod(*s)
  24652. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24653. }
  24654. // RegionInstanceGroupManagerPatchInstanceConfigReq:
  24655. // RegionInstanceGroupManagers.patchPerInstanceConfigs
  24656. type RegionInstanceGroupManagerPatchInstanceConfigReq struct {
  24657. // PerInstanceConfigs: The list of per-instance configs to insert or
  24658. // patch on this managed instance group.
  24659. PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
  24660. // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
  24661. // to unconditionally include in API requests. By default, fields with
  24662. // empty values are omitted from API requests. However, any non-pointer,
  24663. // non-interface field appearing in ForceSendFields will be sent to the
  24664. // server regardless of whether the field is empty or not. This may be
  24665. // used to include empty fields in Patch requests.
  24666. ForceSendFields []string `json:"-"`
  24667. // NullFields is a list of field names (e.g. "PerInstanceConfigs") to
  24668. // include in API requests with the JSON null value. By default, fields
  24669. // with empty values are omitted from API requests. However, any field
  24670. // with an empty value appearing in NullFields will be sent to the
  24671. // server as null. It is an error if a field in this list has a
  24672. // non-empty value. This may be used to include null fields in Patch
  24673. // requests.
  24674. NullFields []string `json:"-"`
  24675. }
  24676. func (s *RegionInstanceGroupManagerPatchInstanceConfigReq) MarshalJSON() ([]byte, error) {
  24677. type NoMethod RegionInstanceGroupManagerPatchInstanceConfigReq
  24678. raw := NoMethod(*s)
  24679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24680. }
  24681. // RegionInstanceGroupManagerUpdateInstanceConfigReq:
  24682. // RegionInstanceGroupManagers.updatePerInstanceConfigs
  24683. type RegionInstanceGroupManagerUpdateInstanceConfigReq struct {
  24684. // PerInstanceConfigs: The list of per-instance configs to insert or
  24685. // patch on this managed instance group.
  24686. PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
  24687. // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
  24688. // to unconditionally include in API requests. By default, fields with
  24689. // empty values are omitted from API requests. However, any non-pointer,
  24690. // non-interface field appearing in ForceSendFields will be sent to the
  24691. // server regardless of whether the field is empty or not. This may be
  24692. // used to include empty fields in Patch requests.
  24693. ForceSendFields []string `json:"-"`
  24694. // NullFields is a list of field names (e.g. "PerInstanceConfigs") to
  24695. // include in API requests with the JSON null value. By default, fields
  24696. // with empty values are omitted from API requests. However, any field
  24697. // with an empty value appearing in NullFields will be sent to the
  24698. // server as null. It is an error if a field in this list has a
  24699. // non-empty value. This may be used to include null fields in Patch
  24700. // requests.
  24701. NullFields []string `json:"-"`
  24702. }
  24703. func (s *RegionInstanceGroupManagerUpdateInstanceConfigReq) MarshalJSON() ([]byte, error) {
  24704. type NoMethod RegionInstanceGroupManagerUpdateInstanceConfigReq
  24705. raw := NoMethod(*s)
  24706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24707. }
  24708. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  24709. // Instances: The URLs of one or more instances to abandon. This can be
  24710. // a full URL or a partial URL, such as
  24711. // zones/[ZONE]/instances/[INSTANCE_NAME].
  24712. Instances []string `json:"instances,omitempty"`
  24713. // ForceSendFields is a list of field names (e.g. "Instances") to
  24714. // unconditionally include in API requests. By default, fields with
  24715. // empty values are omitted from API requests. However, any non-pointer,
  24716. // non-interface field appearing in ForceSendFields will be sent to the
  24717. // server regardless of whether the field is empty or not. This may be
  24718. // used to include empty fields in Patch requests.
  24719. ForceSendFields []string `json:"-"`
  24720. // NullFields is a list of field names (e.g. "Instances") to include in
  24721. // API requests with the JSON null value. By default, fields with empty
  24722. // values are omitted from API requests. However, any field with an
  24723. // empty value appearing in NullFields will be sent to the server as
  24724. // null. It is an error if a field in this list has a non-empty value.
  24725. // This may be used to include null fields in Patch requests.
  24726. NullFields []string `json:"-"`
  24727. }
  24728. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  24729. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  24730. raw := NoMethod(*s)
  24731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24732. }
  24733. // RegionInstanceGroupManagersApplyUpdatesRequest:
  24734. // InstanceGroupManagers.applyUpdatesToInstances
  24735. type RegionInstanceGroupManagersApplyUpdatesRequest struct {
  24736. // Instances: The list of instances for which we want to apply changes
  24737. // on this managed instance group.
  24738. Instances []string `json:"instances,omitempty"`
  24739. // MaximalAction: The maximal action that should be performed on the
  24740. // instances. By default REPLACE. This field is deprecated, please use
  24741. // most_disruptive_allowed_action.
  24742. //
  24743. // Possible values:
  24744. // "NONE"
  24745. // "REFRESH"
  24746. // "REPLACE"
  24747. // "RESTART"
  24748. MaximalAction string `json:"maximalAction,omitempty"`
  24749. // MinimalAction: The minimal action that should be perfomed on the
  24750. // instances. By default NONE.
  24751. //
  24752. // Possible values:
  24753. // "NONE"
  24754. // "REFRESH"
  24755. // "REPLACE"
  24756. // "RESTART"
  24757. MinimalAction string `json:"minimalAction,omitempty"`
  24758. // MostDisruptiveAllowedAction: The most disruptive action that allowed
  24759. // to be performed on the instances. By default REPLACE.
  24760. //
  24761. // Possible values:
  24762. // "NONE"
  24763. // "REFRESH"
  24764. // "REPLACE"
  24765. // "RESTART"
  24766. MostDisruptiveAllowedAction string `json:"mostDisruptiveAllowedAction,omitempty"`
  24767. // ForceSendFields is a list of field names (e.g. "Instances") to
  24768. // unconditionally include in API requests. By default, fields with
  24769. // empty values are omitted from API requests. However, any non-pointer,
  24770. // non-interface field appearing in ForceSendFields will be sent to the
  24771. // server regardless of whether the field is empty or not. This may be
  24772. // used to include empty fields in Patch requests.
  24773. ForceSendFields []string `json:"-"`
  24774. // NullFields is a list of field names (e.g. "Instances") to include in
  24775. // API requests with the JSON null value. By default, fields with empty
  24776. // values are omitted from API requests. However, any field with an
  24777. // empty value appearing in NullFields will be sent to the server as
  24778. // null. It is an error if a field in this list has a non-empty value.
  24779. // This may be used to include null fields in Patch requests.
  24780. NullFields []string `json:"-"`
  24781. }
  24782. func (s *RegionInstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
  24783. type NoMethod RegionInstanceGroupManagersApplyUpdatesRequest
  24784. raw := NoMethod(*s)
  24785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24786. }
  24787. // RegionInstanceGroupManagersCreateInstancesRequest:
  24788. // RegionInstanceGroupManagers.createInstances
  24789. type RegionInstanceGroupManagersCreateInstancesRequest struct {
  24790. // Instances: [Required] List of specifications of per-instance configs.
  24791. Instances []*PerInstanceConfig `json:"instances,omitempty"`
  24792. // ForceSendFields is a list of field names (e.g. "Instances") to
  24793. // unconditionally include in API requests. By default, fields with
  24794. // empty values are omitted from API requests. However, any non-pointer,
  24795. // non-interface field appearing in ForceSendFields will be sent to the
  24796. // server regardless of whether the field is empty or not. This may be
  24797. // used to include empty fields in Patch requests.
  24798. ForceSendFields []string `json:"-"`
  24799. // NullFields is a list of field names (e.g. "Instances") to include in
  24800. // API requests with the JSON null value. By default, fields with empty
  24801. // values are omitted from API requests. However, any field with an
  24802. // empty value appearing in NullFields will be sent to the server as
  24803. // null. It is an error if a field in this list has a non-empty value.
  24804. // This may be used to include null fields in Patch requests.
  24805. NullFields []string `json:"-"`
  24806. }
  24807. func (s *RegionInstanceGroupManagersCreateInstancesRequest) MarshalJSON() ([]byte, error) {
  24808. type NoMethod RegionInstanceGroupManagersCreateInstancesRequest
  24809. raw := NoMethod(*s)
  24810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24811. }
  24812. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  24813. // Instances: The URLs of one or more instances to delete. This can be a
  24814. // full URL or a partial URL, such as
  24815. // zones/[ZONE]/instances/[INSTANCE_NAME].
  24816. Instances []string `json:"instances,omitempty"`
  24817. // ForceSendFields is a list of field names (e.g. "Instances") to
  24818. // unconditionally include in API requests. By default, fields with
  24819. // empty values are omitted from API requests. However, any non-pointer,
  24820. // non-interface field appearing in ForceSendFields will be sent to the
  24821. // server regardless of whether the field is empty or not. This may be
  24822. // used to include empty fields in Patch requests.
  24823. ForceSendFields []string `json:"-"`
  24824. // NullFields is a list of field names (e.g. "Instances") to include in
  24825. // API requests with the JSON null value. By default, fields with empty
  24826. // values are omitted from API requests. However, any field with an
  24827. // empty value appearing in NullFields will be sent to the server as
  24828. // null. It is an error if a field in this list has a non-empty value.
  24829. // This may be used to include null fields in Patch requests.
  24830. NullFields []string `json:"-"`
  24831. }
  24832. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  24833. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  24834. raw := NoMethod(*s)
  24835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24836. }
  24837. type RegionInstanceGroupManagersListInstanceConfigsResp struct {
  24838. // Items: [Output Only] The list of PerInstanceConfig.
  24839. Items []*PerInstanceConfig `json:"items,omitempty"`
  24840. // NextPageToken: [Output Only] This token allows you to get the next
  24841. // page of results for list requests. If the number of results is larger
  24842. // than maxResults, use the nextPageToken as a value for the query
  24843. // parameter pageToken in the next list request. Subsequent list
  24844. // requests will have their own nextPageToken to continue paging through
  24845. // the results.
  24846. NextPageToken string `json:"nextPageToken,omitempty"`
  24847. // Warning: [Output Only] Informational warning message.
  24848. Warning *RegionInstanceGroupManagersListInstanceConfigsRespWarning `json:"warning,omitempty"`
  24849. // ServerResponse contains the HTTP response code and headers from the
  24850. // server.
  24851. googleapi.ServerResponse `json:"-"`
  24852. // ForceSendFields is a list of field names (e.g. "Items") to
  24853. // unconditionally include in API requests. By default, fields with
  24854. // empty values are omitted from API requests. However, any non-pointer,
  24855. // non-interface field appearing in ForceSendFields will be sent to the
  24856. // server regardless of whether the field is empty or not. This may be
  24857. // used to include empty fields in Patch requests.
  24858. ForceSendFields []string `json:"-"`
  24859. // NullFields is a list of field names (e.g. "Items") to include in API
  24860. // requests with the JSON null value. By default, fields with empty
  24861. // values are omitted from API requests. However, any field with an
  24862. // empty value appearing in NullFields will be sent to the server as
  24863. // null. It is an error if a field in this list has a non-empty value.
  24864. // This may be used to include null fields in Patch requests.
  24865. NullFields []string `json:"-"`
  24866. }
  24867. func (s *RegionInstanceGroupManagersListInstanceConfigsResp) MarshalJSON() ([]byte, error) {
  24868. type NoMethod RegionInstanceGroupManagersListInstanceConfigsResp
  24869. raw := NoMethod(*s)
  24870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24871. }
  24872. // RegionInstanceGroupManagersListInstanceConfigsRespWarning: [Output
  24873. // Only] Informational warning message.
  24874. type RegionInstanceGroupManagersListInstanceConfigsRespWarning struct {
  24875. // Code: [Output Only] A warning code, if applicable. For example,
  24876. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24877. // the response.
  24878. //
  24879. // Possible values:
  24880. // "CLEANUP_FAILED"
  24881. // "DEPRECATED_RESOURCE_USED"
  24882. // "DEPRECATED_TYPE_USED"
  24883. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24884. // "EXPERIMENTAL_TYPE_USED"
  24885. // "EXTERNAL_API_WARNING"
  24886. // "FIELD_VALUE_OVERRIDEN"
  24887. // "INJECTED_KERNELS_DEPRECATED"
  24888. // "MISSING_TYPE_DEPENDENCY"
  24889. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24890. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24891. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24892. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24893. // "NEXT_HOP_NOT_RUNNING"
  24894. // "NOT_CRITICAL_ERROR"
  24895. // "NO_RESULTS_ON_PAGE"
  24896. // "REQUIRED_TOS_AGREEMENT"
  24897. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24898. // "RESOURCE_NOT_DELETED"
  24899. // "SCHEMA_VALIDATION_IGNORED"
  24900. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24901. // "UNDECLARED_PROPERTIES"
  24902. // "UNREACHABLE"
  24903. Code string `json:"code,omitempty"`
  24904. // Data: [Output Only] Metadata about this warning in key: value format.
  24905. // For example:
  24906. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24907. Data []*RegionInstanceGroupManagersListInstanceConfigsRespWarningData `json:"data,omitempty"`
  24908. // Message: [Output Only] A human-readable description of the warning
  24909. // code.
  24910. Message string `json:"message,omitempty"`
  24911. // ForceSendFields is a list of field names (e.g. "Code") to
  24912. // unconditionally include in API requests. By default, fields with
  24913. // empty values are omitted from API requests. However, any non-pointer,
  24914. // non-interface field appearing in ForceSendFields will be sent to the
  24915. // server regardless of whether the field is empty or not. This may be
  24916. // used to include empty fields in Patch requests.
  24917. ForceSendFields []string `json:"-"`
  24918. // NullFields is a list of field names (e.g. "Code") to include in API
  24919. // requests with the JSON null value. By default, fields with empty
  24920. // values are omitted from API requests. However, any field with an
  24921. // empty value appearing in NullFields will be sent to the server as
  24922. // null. It is an error if a field in this list has a non-empty value.
  24923. // This may be used to include null fields in Patch requests.
  24924. NullFields []string `json:"-"`
  24925. }
  24926. func (s *RegionInstanceGroupManagersListInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
  24927. type NoMethod RegionInstanceGroupManagersListInstanceConfigsRespWarning
  24928. raw := NoMethod(*s)
  24929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24930. }
  24931. type RegionInstanceGroupManagersListInstanceConfigsRespWarningData struct {
  24932. // Key: [Output Only] A key that provides more detail on the warning
  24933. // being returned. For example, for warnings where there are no results
  24934. // in a list request for a particular zone, this key might be scope and
  24935. // the key value might be the zone name. Other examples might be a key
  24936. // indicating a deprecated resource and a suggested replacement, or a
  24937. // warning about invalid network settings (for example, if an instance
  24938. // attempts to perform IP forwarding but is not enabled for IP
  24939. // forwarding).
  24940. Key string `json:"key,omitempty"`
  24941. // Value: [Output Only] A warning data value corresponding to the key.
  24942. Value string `json:"value,omitempty"`
  24943. // ForceSendFields is a list of field names (e.g. "Key") to
  24944. // unconditionally include in API requests. By default, fields with
  24945. // empty values are omitted from API requests. However, any non-pointer,
  24946. // non-interface field appearing in ForceSendFields will be sent to the
  24947. // server regardless of whether the field is empty or not. This may be
  24948. // used to include empty fields in Patch requests.
  24949. ForceSendFields []string `json:"-"`
  24950. // NullFields is a list of field names (e.g. "Key") to include in API
  24951. // requests with the JSON null value. By default, fields with empty
  24952. // values are omitted from API requests. However, any field with an
  24953. // empty value appearing in NullFields will be sent to the server as
  24954. // null. It is an error if a field in this list has a non-empty value.
  24955. // This may be used to include null fields in Patch requests.
  24956. NullFields []string `json:"-"`
  24957. }
  24958. func (s *RegionInstanceGroupManagersListInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
  24959. type NoMethod RegionInstanceGroupManagersListInstanceConfigsRespWarningData
  24960. raw := NoMethod(*s)
  24961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24962. }
  24963. type RegionInstanceGroupManagersListInstancesResponse struct {
  24964. // ManagedInstances: A list of managed instances.
  24965. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  24966. // NextPageToken: [Output Only] This token allows you to get the next
  24967. // page of results for list requests. If the number of results is larger
  24968. // than maxResults, use the nextPageToken as a value for the query
  24969. // parameter pageToken in the next list request. Subsequent list
  24970. // requests will have their own nextPageToken to continue paging through
  24971. // the results.
  24972. NextPageToken string `json:"nextPageToken,omitempty"`
  24973. // ServerResponse contains the HTTP response code and headers from the
  24974. // server.
  24975. googleapi.ServerResponse `json:"-"`
  24976. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  24977. // unconditionally include in API requests. By default, fields with
  24978. // empty values are omitted from API requests. However, any non-pointer,
  24979. // non-interface field appearing in ForceSendFields will be sent to the
  24980. // server regardless of whether the field is empty or not. This may be
  24981. // used to include empty fields in Patch requests.
  24982. ForceSendFields []string `json:"-"`
  24983. // NullFields is a list of field names (e.g. "ManagedInstances") to
  24984. // include in API requests with the JSON null value. By default, fields
  24985. // with empty values are omitted from API requests. However, any field
  24986. // with an empty value appearing in NullFields will be sent to the
  24987. // server as null. It is an error if a field in this list has a
  24988. // non-empty value. This may be used to include null fields in Patch
  24989. // requests.
  24990. NullFields []string `json:"-"`
  24991. }
  24992. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  24993. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  24994. raw := NoMethod(*s)
  24995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24996. }
  24997. type RegionInstanceGroupManagersRecreateRequest struct {
  24998. // Instances: The URLs of one or more instances to recreate. This can be
  24999. // a full URL or a partial URL, such as
  25000. // zones/[ZONE]/instances/[INSTANCE_NAME].
  25001. Instances []string `json:"instances,omitempty"`
  25002. // ForceSendFields is a list of field names (e.g. "Instances") to
  25003. // unconditionally include in API requests. By default, fields with
  25004. // empty values are omitted from API requests. However, any non-pointer,
  25005. // non-interface field appearing in ForceSendFields will be sent to the
  25006. // server regardless of whether the field is empty or not. This may be
  25007. // used to include empty fields in Patch requests.
  25008. ForceSendFields []string `json:"-"`
  25009. // NullFields is a list of field names (e.g. "Instances") to include in
  25010. // API requests with the JSON null value. By default, fields with empty
  25011. // values are omitted from API requests. However, any field with an
  25012. // empty value appearing in NullFields will be sent to the server as
  25013. // null. It is an error if a field in this list has a non-empty value.
  25014. // This may be used to include null fields in Patch requests.
  25015. NullFields []string `json:"-"`
  25016. }
  25017. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  25018. type NoMethod RegionInstanceGroupManagersRecreateRequest
  25019. raw := NoMethod(*s)
  25020. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25021. }
  25022. type RegionInstanceGroupManagersSetAutoHealingRequest struct {
  25023. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  25024. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  25025. // to unconditionally include in API requests. By default, fields with
  25026. // empty values are omitted from API requests. However, any non-pointer,
  25027. // non-interface field appearing in ForceSendFields will be sent to the
  25028. // server regardless of whether the field is empty or not. This may be
  25029. // used to include empty fields in Patch requests.
  25030. ForceSendFields []string `json:"-"`
  25031. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  25032. // include in API requests with the JSON null value. By default, fields
  25033. // with empty values are omitted from API requests. However, any field
  25034. // with an empty value appearing in NullFields will be sent to the
  25035. // server as null. It is an error if a field in this list has a
  25036. // non-empty value. This may be used to include null fields in Patch
  25037. // requests.
  25038. NullFields []string `json:"-"`
  25039. }
  25040. func (s *RegionInstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  25041. type NoMethod RegionInstanceGroupManagersSetAutoHealingRequest
  25042. raw := NoMethod(*s)
  25043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25044. }
  25045. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  25046. // Fingerprint: Fingerprint of the target pools information, which is a
  25047. // hash of the contents. This field is used for optimistic locking when
  25048. // you update the target pool entries. This field is optional.
  25049. Fingerprint string `json:"fingerprint,omitempty"`
  25050. // TargetPools: The URL of all TargetPool resources to which instances
  25051. // in the instanceGroup field are added. The target pools automatically
  25052. // apply to all of the instances in the managed instance group.
  25053. TargetPools []string `json:"targetPools,omitempty"`
  25054. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  25055. // unconditionally include in API requests. By default, fields with
  25056. // empty values are omitted from API requests. However, any non-pointer,
  25057. // non-interface field appearing in ForceSendFields will be sent to the
  25058. // server regardless of whether the field is empty or not. This may be
  25059. // used to include empty fields in Patch requests.
  25060. ForceSendFields []string `json:"-"`
  25061. // NullFields is a list of field names (e.g. "Fingerprint") to include
  25062. // in API requests with the JSON null value. By default, fields with
  25063. // empty values are omitted from API requests. However, any field with
  25064. // an empty value appearing in NullFields will be sent to the server as
  25065. // null. It is an error if a field in this list has a non-empty value.
  25066. // This may be used to include null fields in Patch requests.
  25067. NullFields []string `json:"-"`
  25068. }
  25069. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  25070. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  25071. raw := NoMethod(*s)
  25072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25073. }
  25074. type RegionInstanceGroupManagersSetTemplateRequest struct {
  25075. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  25076. // new instances will be created.
  25077. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  25078. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  25079. // unconditionally include in API requests. By default, fields with
  25080. // empty values are omitted from API requests. However, any non-pointer,
  25081. // non-interface field appearing in ForceSendFields will be sent to the
  25082. // server regardless of whether the field is empty or not. This may be
  25083. // used to include empty fields in Patch requests.
  25084. ForceSendFields []string `json:"-"`
  25085. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  25086. // include in API requests with the JSON null value. By default, fields
  25087. // with empty values are omitted from API requests. However, any field
  25088. // with an empty value appearing in NullFields will be sent to the
  25089. // server as null. It is an error if a field in this list has a
  25090. // non-empty value. This may be used to include null fields in Patch
  25091. // requests.
  25092. NullFields []string `json:"-"`
  25093. }
  25094. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  25095. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  25096. raw := NoMethod(*s)
  25097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25098. }
  25099. type RegionInstanceGroupsListInstances struct {
  25100. // Id: [Output Only] Unique identifier for the resource; defined by the
  25101. // server.
  25102. Id string `json:"id,omitempty"`
  25103. // Items: A list of InstanceWithNamedPorts resources.
  25104. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  25105. // Kind: The resource type.
  25106. Kind string `json:"kind,omitempty"`
  25107. // NextPageToken: [Output Only] This token allows you to get the next
  25108. // page of results for list requests. If the number of results is larger
  25109. // than maxResults, use the nextPageToken as a value for the query
  25110. // parameter pageToken in the next list request. Subsequent list
  25111. // requests will have their own nextPageToken to continue paging through
  25112. // the results.
  25113. NextPageToken string `json:"nextPageToken,omitempty"`
  25114. // SelfLink: [Output Only] Server-defined URL for this resource.
  25115. SelfLink string `json:"selfLink,omitempty"`
  25116. // Warning: [Output Only] Informational warning message.
  25117. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  25118. // ServerResponse contains the HTTP response code and headers from the
  25119. // server.
  25120. googleapi.ServerResponse `json:"-"`
  25121. // ForceSendFields is a list of field names (e.g. "Id") to
  25122. // unconditionally include in API requests. By default, fields with
  25123. // empty values are omitted from API requests. However, any non-pointer,
  25124. // non-interface field appearing in ForceSendFields will be sent to the
  25125. // server regardless of whether the field is empty or not. This may be
  25126. // used to include empty fields in Patch requests.
  25127. ForceSendFields []string `json:"-"`
  25128. // NullFields is a list of field names (e.g. "Id") to include in API
  25129. // requests with the JSON null value. By default, fields with empty
  25130. // values are omitted from API requests. However, any field with an
  25131. // empty value appearing in NullFields will be sent to the server as
  25132. // null. It is an error if a field in this list has a non-empty value.
  25133. // This may be used to include null fields in Patch requests.
  25134. NullFields []string `json:"-"`
  25135. }
  25136. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  25137. type NoMethod RegionInstanceGroupsListInstances
  25138. raw := NoMethod(*s)
  25139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25140. }
  25141. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  25142. // warning message.
  25143. type RegionInstanceGroupsListInstancesWarning struct {
  25144. // Code: [Output Only] A warning code, if applicable. For example,
  25145. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25146. // the response.
  25147. //
  25148. // Possible values:
  25149. // "CLEANUP_FAILED"
  25150. // "DEPRECATED_RESOURCE_USED"
  25151. // "DEPRECATED_TYPE_USED"
  25152. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25153. // "EXPERIMENTAL_TYPE_USED"
  25154. // "EXTERNAL_API_WARNING"
  25155. // "FIELD_VALUE_OVERRIDEN"
  25156. // "INJECTED_KERNELS_DEPRECATED"
  25157. // "MISSING_TYPE_DEPENDENCY"
  25158. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25159. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25160. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25161. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25162. // "NEXT_HOP_NOT_RUNNING"
  25163. // "NOT_CRITICAL_ERROR"
  25164. // "NO_RESULTS_ON_PAGE"
  25165. // "REQUIRED_TOS_AGREEMENT"
  25166. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25167. // "RESOURCE_NOT_DELETED"
  25168. // "SCHEMA_VALIDATION_IGNORED"
  25169. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25170. // "UNDECLARED_PROPERTIES"
  25171. // "UNREACHABLE"
  25172. Code string `json:"code,omitempty"`
  25173. // Data: [Output Only] Metadata about this warning in key: value format.
  25174. // For example:
  25175. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25176. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  25177. // Message: [Output Only] A human-readable description of the warning
  25178. // code.
  25179. Message string `json:"message,omitempty"`
  25180. // ForceSendFields is a list of field names (e.g. "Code") to
  25181. // unconditionally include in API requests. By default, fields with
  25182. // empty values are omitted from API requests. However, any non-pointer,
  25183. // non-interface field appearing in ForceSendFields will be sent to the
  25184. // server regardless of whether the field is empty or not. This may be
  25185. // used to include empty fields in Patch requests.
  25186. ForceSendFields []string `json:"-"`
  25187. // NullFields is a list of field names (e.g. "Code") to include in API
  25188. // requests with the JSON null value. By default, fields with empty
  25189. // values are omitted from API requests. However, any field with an
  25190. // empty value appearing in NullFields will be sent to the server as
  25191. // null. It is an error if a field in this list has a non-empty value.
  25192. // This may be used to include null fields in Patch requests.
  25193. NullFields []string `json:"-"`
  25194. }
  25195. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  25196. type NoMethod RegionInstanceGroupsListInstancesWarning
  25197. raw := NoMethod(*s)
  25198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25199. }
  25200. type RegionInstanceGroupsListInstancesWarningData struct {
  25201. // Key: [Output Only] A key that provides more detail on the warning
  25202. // being returned. For example, for warnings where there are no results
  25203. // in a list request for a particular zone, this key might be scope and
  25204. // the key value might be the zone name. Other examples might be a key
  25205. // indicating a deprecated resource and a suggested replacement, or a
  25206. // warning about invalid network settings (for example, if an instance
  25207. // attempts to perform IP forwarding but is not enabled for IP
  25208. // forwarding).
  25209. Key string `json:"key,omitempty"`
  25210. // Value: [Output Only] A warning data value corresponding to the key.
  25211. Value string `json:"value,omitempty"`
  25212. // ForceSendFields is a list of field names (e.g. "Key") to
  25213. // unconditionally include in API requests. By default, fields with
  25214. // empty values are omitted from API requests. However, any non-pointer,
  25215. // non-interface field appearing in ForceSendFields will be sent to the
  25216. // server regardless of whether the field is empty or not. This may be
  25217. // used to include empty fields in Patch requests.
  25218. ForceSendFields []string `json:"-"`
  25219. // NullFields is a list of field names (e.g. "Key") to include in API
  25220. // requests with the JSON null value. By default, fields with empty
  25221. // values are omitted from API requests. However, any field with an
  25222. // empty value appearing in NullFields will be sent to the server as
  25223. // null. It is an error if a field in this list has a non-empty value.
  25224. // This may be used to include null fields in Patch requests.
  25225. NullFields []string `json:"-"`
  25226. }
  25227. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  25228. type NoMethod RegionInstanceGroupsListInstancesWarningData
  25229. raw := NoMethod(*s)
  25230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25231. }
  25232. type RegionInstanceGroupsListInstancesRequest struct {
  25233. // InstanceState: Instances in which state should be returned. Valid
  25234. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  25235. //
  25236. // Possible values:
  25237. // "ALL"
  25238. // "RUNNING"
  25239. InstanceState string `json:"instanceState,omitempty"`
  25240. // PortName: Name of port user is interested in. It is optional. If it
  25241. // is set, only information about this ports will be returned. If it is
  25242. // not set, all the named ports will be returned. Always lists all
  25243. // instances.
  25244. PortName string `json:"portName,omitempty"`
  25245. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  25246. // unconditionally include in API requests. By default, fields with
  25247. // empty values are omitted from API requests. However, any non-pointer,
  25248. // non-interface field appearing in ForceSendFields will be sent to the
  25249. // server regardless of whether the field is empty or not. This may be
  25250. // used to include empty fields in Patch requests.
  25251. ForceSendFields []string `json:"-"`
  25252. // NullFields is a list of field names (e.g. "InstanceState") to include
  25253. // in API requests with the JSON null value. By default, fields with
  25254. // empty values are omitted from API requests. However, any field with
  25255. // an empty value appearing in NullFields will be sent to the server as
  25256. // null. It is an error if a field in this list has a non-empty value.
  25257. // This may be used to include null fields in Patch requests.
  25258. NullFields []string `json:"-"`
  25259. }
  25260. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  25261. type NoMethod RegionInstanceGroupsListInstancesRequest
  25262. raw := NoMethod(*s)
  25263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25264. }
  25265. type RegionInstanceGroupsSetNamedPortsRequest struct {
  25266. // Fingerprint: The fingerprint of the named ports information for this
  25267. // instance group. Use this optional property to prevent conflicts when
  25268. // multiple users change the named ports settings concurrently. Obtain
  25269. // the fingerprint with the instanceGroups.get method. Then, include the
  25270. // fingerprint in your request to ensure that you do not overwrite
  25271. // changes that were applied from another concurrent request.
  25272. Fingerprint string `json:"fingerprint,omitempty"`
  25273. // NamedPorts: The list of named ports to set for this instance group.
  25274. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  25275. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  25276. // unconditionally include in API requests. By default, fields with
  25277. // empty values are omitted from API requests. However, any non-pointer,
  25278. // non-interface field appearing in ForceSendFields will be sent to the
  25279. // server regardless of whether the field is empty or not. This may be
  25280. // used to include empty fields in Patch requests.
  25281. ForceSendFields []string `json:"-"`
  25282. // NullFields is a list of field names (e.g. "Fingerprint") to include
  25283. // in API requests with the JSON null value. By default, fields with
  25284. // empty values are omitted from API requests. However, any field with
  25285. // an empty value appearing in NullFields will be sent to the server as
  25286. // null. It is an error if a field in this list has a non-empty value.
  25287. // This may be used to include null fields in Patch requests.
  25288. NullFields []string `json:"-"`
  25289. }
  25290. func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  25291. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  25292. raw := NoMethod(*s)
  25293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25294. }
  25295. // RegionList: Contains a list of region resources.
  25296. type RegionList struct {
  25297. // Id: [Output Only] Unique identifier for the resource; defined by the
  25298. // server.
  25299. Id string `json:"id,omitempty"`
  25300. // Items: A list of Region resources.
  25301. Items []*Region `json:"items,omitempty"`
  25302. // Kind: [Output Only] Type of resource. Always compute#regionList for
  25303. // lists of regions.
  25304. Kind string `json:"kind,omitempty"`
  25305. // NextPageToken: [Output Only] This token allows you to get the next
  25306. // page of results for list requests. If the number of results is larger
  25307. // than maxResults, use the nextPageToken as a value for the query
  25308. // parameter pageToken in the next list request. Subsequent list
  25309. // requests will have their own nextPageToken to continue paging through
  25310. // the results.
  25311. NextPageToken string `json:"nextPageToken,omitempty"`
  25312. // SelfLink: [Output Only] Server-defined URL for this resource.
  25313. SelfLink string `json:"selfLink,omitempty"`
  25314. // Warning: [Output Only] Informational warning message.
  25315. Warning *RegionListWarning `json:"warning,omitempty"`
  25316. // ServerResponse contains the HTTP response code and headers from the
  25317. // server.
  25318. googleapi.ServerResponse `json:"-"`
  25319. // ForceSendFields is a list of field names (e.g. "Id") to
  25320. // unconditionally include in API requests. By default, fields with
  25321. // empty values are omitted from API requests. However, any non-pointer,
  25322. // non-interface field appearing in ForceSendFields will be sent to the
  25323. // server regardless of whether the field is empty or not. This may be
  25324. // used to include empty fields in Patch requests.
  25325. ForceSendFields []string `json:"-"`
  25326. // NullFields is a list of field names (e.g. "Id") to include in API
  25327. // requests with the JSON null value. By default, fields with empty
  25328. // values are omitted from API requests. However, any field with an
  25329. // empty value appearing in NullFields will be sent to the server as
  25330. // null. It is an error if a field in this list has a non-empty value.
  25331. // This may be used to include null fields in Patch requests.
  25332. NullFields []string `json:"-"`
  25333. }
  25334. func (s *RegionList) MarshalJSON() ([]byte, error) {
  25335. type NoMethod RegionList
  25336. raw := NoMethod(*s)
  25337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25338. }
  25339. // RegionListWarning: [Output Only] Informational warning message.
  25340. type RegionListWarning struct {
  25341. // Code: [Output Only] A warning code, if applicable. For example,
  25342. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25343. // the response.
  25344. //
  25345. // Possible values:
  25346. // "CLEANUP_FAILED"
  25347. // "DEPRECATED_RESOURCE_USED"
  25348. // "DEPRECATED_TYPE_USED"
  25349. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25350. // "EXPERIMENTAL_TYPE_USED"
  25351. // "EXTERNAL_API_WARNING"
  25352. // "FIELD_VALUE_OVERRIDEN"
  25353. // "INJECTED_KERNELS_DEPRECATED"
  25354. // "MISSING_TYPE_DEPENDENCY"
  25355. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25356. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25357. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25358. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25359. // "NEXT_HOP_NOT_RUNNING"
  25360. // "NOT_CRITICAL_ERROR"
  25361. // "NO_RESULTS_ON_PAGE"
  25362. // "REQUIRED_TOS_AGREEMENT"
  25363. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25364. // "RESOURCE_NOT_DELETED"
  25365. // "SCHEMA_VALIDATION_IGNORED"
  25366. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25367. // "UNDECLARED_PROPERTIES"
  25368. // "UNREACHABLE"
  25369. Code string `json:"code,omitempty"`
  25370. // Data: [Output Only] Metadata about this warning in key: value format.
  25371. // For example:
  25372. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25373. Data []*RegionListWarningData `json:"data,omitempty"`
  25374. // Message: [Output Only] A human-readable description of the warning
  25375. // code.
  25376. Message string `json:"message,omitempty"`
  25377. // ForceSendFields is a list of field names (e.g. "Code") to
  25378. // unconditionally include in API requests. By default, fields with
  25379. // empty values are omitted from API requests. However, any non-pointer,
  25380. // non-interface field appearing in ForceSendFields will be sent to the
  25381. // server regardless of whether the field is empty or not. This may be
  25382. // used to include empty fields in Patch requests.
  25383. ForceSendFields []string `json:"-"`
  25384. // NullFields is a list of field names (e.g. "Code") to include in API
  25385. // requests with the JSON null value. By default, fields with empty
  25386. // values are omitted from API requests. However, any field with an
  25387. // empty value appearing in NullFields will be sent to the server as
  25388. // null. It is an error if a field in this list has a non-empty value.
  25389. // This may be used to include null fields in Patch requests.
  25390. NullFields []string `json:"-"`
  25391. }
  25392. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  25393. type NoMethod RegionListWarning
  25394. raw := NoMethod(*s)
  25395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25396. }
  25397. type RegionListWarningData struct {
  25398. // Key: [Output Only] A key that provides more detail on the warning
  25399. // being returned. For example, for warnings where there are no results
  25400. // in a list request for a particular zone, this key might be scope and
  25401. // the key value might be the zone name. Other examples might be a key
  25402. // indicating a deprecated resource and a suggested replacement, or a
  25403. // warning about invalid network settings (for example, if an instance
  25404. // attempts to perform IP forwarding but is not enabled for IP
  25405. // forwarding).
  25406. Key string `json:"key,omitempty"`
  25407. // Value: [Output Only] A warning data value corresponding to the key.
  25408. Value string `json:"value,omitempty"`
  25409. // ForceSendFields is a list of field names (e.g. "Key") to
  25410. // unconditionally include in API requests. By default, fields with
  25411. // empty values are omitted from API requests. However, any non-pointer,
  25412. // non-interface field appearing in ForceSendFields will be sent to the
  25413. // server regardless of whether the field is empty or not. This may be
  25414. // used to include empty fields in Patch requests.
  25415. ForceSendFields []string `json:"-"`
  25416. // NullFields is a list of field names (e.g. "Key") to include in API
  25417. // requests with the JSON null value. By default, fields with empty
  25418. // values are omitted from API requests. However, any field with an
  25419. // empty value appearing in NullFields will be sent to the server as
  25420. // null. It is an error if a field in this list has a non-empty value.
  25421. // This may be used to include null fields in Patch requests.
  25422. NullFields []string `json:"-"`
  25423. }
  25424. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  25425. type NoMethod RegionListWarningData
  25426. raw := NoMethod(*s)
  25427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25428. }
  25429. type RegionSetLabelsRequest struct {
  25430. // LabelFingerprint: The fingerprint of the previous set of labels for
  25431. // this resource, used to detect conflicts. The fingerprint is initially
  25432. // generated by Compute Engine and changes after every request to modify
  25433. // or update labels. You must always provide an up-to-date fingerprint
  25434. // hash in order to update or change labels. Make a get() request to the
  25435. // resource to get the latest fingerprint.
  25436. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  25437. // Labels: The labels to set for this resource.
  25438. Labels map[string]string `json:"labels,omitempty"`
  25439. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  25440. // unconditionally include in API requests. By default, fields with
  25441. // empty values are omitted from API requests. However, any non-pointer,
  25442. // non-interface field appearing in ForceSendFields will be sent to the
  25443. // server regardless of whether the field is empty or not. This may be
  25444. // used to include empty fields in Patch requests.
  25445. ForceSendFields []string `json:"-"`
  25446. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  25447. // include in API requests with the JSON null value. By default, fields
  25448. // with empty values are omitted from API requests. However, any field
  25449. // with an empty value appearing in NullFields will be sent to the
  25450. // server as null. It is an error if a field in this list has a
  25451. // non-empty value. This may be used to include null fields in Patch
  25452. // requests.
  25453. NullFields []string `json:"-"`
  25454. }
  25455. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  25456. type NoMethod RegionSetLabelsRequest
  25457. raw := NoMethod(*s)
  25458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25459. }
  25460. type RegionSetPolicyRequest struct {
  25461. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  25462. // Deprecated. Use 'policy' to specify bindings.
  25463. Bindings []*Binding `json:"bindings,omitempty"`
  25464. // Etag: Flatten Policy to create a backward compatible wire-format.
  25465. // Deprecated. Use 'policy' to specify the etag.
  25466. Etag string `json:"etag,omitempty"`
  25467. // Policy: REQUIRED: The complete policy to be applied to the
  25468. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  25469. // empty policy is in general a valid policy but certain services (like
  25470. // Projects) might reject them.
  25471. Policy *Policy `json:"policy,omitempty"`
  25472. // ForceSendFields is a list of field names (e.g. "Bindings") to
  25473. // unconditionally include in API requests. By default, fields with
  25474. // empty values are omitted from API requests. However, any non-pointer,
  25475. // non-interface field appearing in ForceSendFields will be sent to the
  25476. // server regardless of whether the field is empty or not. This may be
  25477. // used to include empty fields in Patch requests.
  25478. ForceSendFields []string `json:"-"`
  25479. // NullFields is a list of field names (e.g. "Bindings") to include in
  25480. // API requests with the JSON null value. By default, fields with empty
  25481. // values are omitted from API requests. However, any field with an
  25482. // empty value appearing in NullFields will be sent to the server as
  25483. // null. It is an error if a field in this list has a non-empty value.
  25484. // This may be used to include null fields in Patch requests.
  25485. NullFields []string `json:"-"`
  25486. }
  25487. func (s *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
  25488. type NoMethod RegionSetPolicyRequest
  25489. raw := NoMethod(*s)
  25490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25491. }
  25492. type RegionTargetHttpsProxiesSetSslCertificatesRequest struct {
  25493. // SslCertificates: New set of SslCertificate resources to associate
  25494. // with this TargetHttpsProxy resource. Currently exactly one
  25495. // SslCertificate resource must be specified.
  25496. SslCertificates []string `json:"sslCertificates,omitempty"`
  25497. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  25498. // unconditionally include in API requests. By default, fields with
  25499. // empty values are omitted from API requests. However, any non-pointer,
  25500. // non-interface field appearing in ForceSendFields will be sent to the
  25501. // server regardless of whether the field is empty or not. This may be
  25502. // used to include empty fields in Patch requests.
  25503. ForceSendFields []string `json:"-"`
  25504. // NullFields is a list of field names (e.g. "SslCertificates") to
  25505. // include in API requests with the JSON null value. By default, fields
  25506. // with empty values are omitted from API requests. However, any field
  25507. // with an empty value appearing in NullFields will be sent to the
  25508. // server as null. It is an error if a field in this list has a
  25509. // non-empty value. This may be used to include null fields in Patch
  25510. // requests.
  25511. NullFields []string `json:"-"`
  25512. }
  25513. func (s *RegionTargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  25514. type NoMethod RegionTargetHttpsProxiesSetSslCertificatesRequest
  25515. raw := NoMethod(*s)
  25516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25517. }
  25518. type RegionUrlMapsValidateRequest struct {
  25519. // Resource: Content of the UrlMap to be validated.
  25520. Resource *UrlMap `json:"resource,omitempty"`
  25521. // ForceSendFields is a list of field names (e.g. "Resource") to
  25522. // unconditionally include in API requests. By default, fields with
  25523. // empty values are omitted from API requests. However, any non-pointer,
  25524. // non-interface field appearing in ForceSendFields will be sent to the
  25525. // server regardless of whether the field is empty or not. This may be
  25526. // used to include empty fields in Patch requests.
  25527. ForceSendFields []string `json:"-"`
  25528. // NullFields is a list of field names (e.g. "Resource") to include in
  25529. // API requests with the JSON null value. By default, fields with empty
  25530. // values are omitted from API requests. However, any field with an
  25531. // empty value appearing in NullFields will be sent to the server as
  25532. // null. It is an error if a field in this list has a non-empty value.
  25533. // This may be used to include null fields in Patch requests.
  25534. NullFields []string `json:"-"`
  25535. }
  25536. func (s *RegionUrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  25537. type NoMethod RegionUrlMapsValidateRequest
  25538. raw := NoMethod(*s)
  25539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25540. }
  25541. // RequestMirrorPolicy: A policy that specifies how requests intended
  25542. // for the route's backends are shadowed to a separate mirrored backend
  25543. // service. Loadbalancer does not wait for responses from the shadow
  25544. // service. Prior to sending traffic to the shadow service, the host /
  25545. // authority header is suffixed with -shadow.
  25546. type RequestMirrorPolicy struct {
  25547. // BackendService: The full or partial URL to the BackendService
  25548. // resource being mirrored to.
  25549. BackendService string `json:"backendService,omitempty"`
  25550. // ForceSendFields is a list of field names (e.g. "BackendService") to
  25551. // unconditionally include in API requests. By default, fields with
  25552. // empty values are omitted from API requests. However, any non-pointer,
  25553. // non-interface field appearing in ForceSendFields will be sent to the
  25554. // server regardless of whether the field is empty or not. This may be
  25555. // used to include empty fields in Patch requests.
  25556. ForceSendFields []string `json:"-"`
  25557. // NullFields is a list of field names (e.g. "BackendService") to
  25558. // include in API requests with the JSON null value. By default, fields
  25559. // with empty values are omitted from API requests. However, any field
  25560. // with an empty value appearing in NullFields will be sent to the
  25561. // server as null. It is an error if a field in this list has a
  25562. // non-empty value. This may be used to include null fields in Patch
  25563. // requests.
  25564. NullFields []string `json:"-"`
  25565. }
  25566. func (s *RequestMirrorPolicy) MarshalJSON() ([]byte, error) {
  25567. type NoMethod RequestMirrorPolicy
  25568. raw := NoMethod(*s)
  25569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25570. }
  25571. // Reservation: Reservation resource
  25572. type Reservation struct {
  25573. // Commitment: [OutputOnly] Full or partial url for parent commitment
  25574. // for reservations which are tied to a commitment.
  25575. Commitment string `json:"commitment,omitempty"`
  25576. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25577. // format.
  25578. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25579. // Description: An optional description of this resource. Provide this
  25580. // property when you create the resource.
  25581. Description string `json:"description,omitempty"`
  25582. // Id: [Output Only] The unique identifier for the resource. This
  25583. // identifier is defined by the server.
  25584. Id uint64 `json:"id,omitempty,string"`
  25585. // Kind: [Output Only] Type of the resource. Always compute#reservations
  25586. // for reservations.
  25587. Kind string `json:"kind,omitempty"`
  25588. // Name: The name of the resource, provided by the client when initially
  25589. // creating the resource. The resource name must be 1-63 characters
  25590. // long, and comply with RFC1035. Specifically, the name must be 1-63
  25591. // characters long and match the regular expression
  25592. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  25593. // a lowercase letter, and all following characters must be a dash,
  25594. // lowercase letter, or digit, except the last character, which cannot
  25595. // be a dash.
  25596. Name string `json:"name,omitempty"`
  25597. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  25598. // resource.
  25599. SelfLink string `json:"selfLink,omitempty"`
  25600. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  25601. // with the resource id.
  25602. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  25603. // SpecificReservation: Reservation for instances with specific machine
  25604. // shapes.
  25605. SpecificReservation *AllocationSpecificSKUReservation `json:"specificReservation,omitempty"`
  25606. // SpecificReservationRequired: Indicates whether the reservation can be
  25607. // consumed by VMs with "any reservation" defined. If the field is set,
  25608. // then only VMs that target the reservation by name using
  25609. // --reservation-affinity can consume this reservation.
  25610. SpecificReservationRequired bool `json:"specificReservationRequired,omitempty"`
  25611. // Zone: Zone in which the reservation resides, must be provided if
  25612. // reservation is created with commitment creation.
  25613. Zone string `json:"zone,omitempty"`
  25614. // ServerResponse contains the HTTP response code and headers from the
  25615. // server.
  25616. googleapi.ServerResponse `json:"-"`
  25617. // ForceSendFields is a list of field names (e.g. "Commitment") to
  25618. // unconditionally include in API requests. By default, fields with
  25619. // empty values are omitted from API requests. However, any non-pointer,
  25620. // non-interface field appearing in ForceSendFields will be sent to the
  25621. // server regardless of whether the field is empty or not. This may be
  25622. // used to include empty fields in Patch requests.
  25623. ForceSendFields []string `json:"-"`
  25624. // NullFields is a list of field names (e.g. "Commitment") to include in
  25625. // API requests with the JSON null value. By default, fields with empty
  25626. // values are omitted from API requests. However, any field with an
  25627. // empty value appearing in NullFields will be sent to the server as
  25628. // null. It is an error if a field in this list has a non-empty value.
  25629. // This may be used to include null fields in Patch requests.
  25630. NullFields []string `json:"-"`
  25631. }
  25632. func (s *Reservation) MarshalJSON() ([]byte, error) {
  25633. type NoMethod Reservation
  25634. raw := NoMethod(*s)
  25635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25636. }
  25637. // ReservationAffinity: AllocationAffinity is the configuration of
  25638. // desired allocation which this instance could take capacity from.
  25639. type ReservationAffinity struct {
  25640. // ConsumeReservationType: Specifies the type of reservation from which
  25641. // this instance can consume resources: ANY_RESERVATION (default),
  25642. // SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved
  25643. // instances for examples.
  25644. //
  25645. // Possible values:
  25646. // "ANY_RESERVATION"
  25647. // "NO_RESERVATION"
  25648. // "SPECIFIC_RESERVATION"
  25649. // "UNSPECIFIED"
  25650. ConsumeReservationType string `json:"consumeReservationType,omitempty"`
  25651. // Key: Corresponds to the label key of reservation resource.
  25652. Key string `json:"key,omitempty"`
  25653. // Values: Corresponds to the label values of reservation resource.
  25654. Values []string `json:"values,omitempty"`
  25655. // ForceSendFields is a list of field names (e.g.
  25656. // "ConsumeReservationType") to unconditionally include in API requests.
  25657. // By default, fields with empty values are omitted from API requests.
  25658. // However, any non-pointer, non-interface field appearing in
  25659. // ForceSendFields will be sent to the server regardless of whether the
  25660. // field is empty or not. This may be used to include empty fields in
  25661. // Patch requests.
  25662. ForceSendFields []string `json:"-"`
  25663. // NullFields is a list of field names (e.g. "ConsumeReservationType")
  25664. // to include in API requests with the JSON null value. By default,
  25665. // fields with empty values are omitted from API requests. However, any
  25666. // field with an empty value appearing in NullFields will be sent to the
  25667. // server as null. It is an error if a field in this list has a
  25668. // non-empty value. This may be used to include null fields in Patch
  25669. // requests.
  25670. NullFields []string `json:"-"`
  25671. }
  25672. func (s *ReservationAffinity) MarshalJSON() ([]byte, error) {
  25673. type NoMethod ReservationAffinity
  25674. raw := NoMethod(*s)
  25675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25676. }
  25677. // ReservationAggregatedList: Contains a list of reservations.
  25678. type ReservationAggregatedList struct {
  25679. // Id: [Output Only] Unique identifier for the resource; defined by the
  25680. // server.
  25681. Id string `json:"id,omitempty"`
  25682. // Items: A list of Allocation resources.
  25683. Items map[string]ReservationsScopedList `json:"items,omitempty"`
  25684. // Kind: Type of resource.
  25685. Kind string `json:"kind,omitempty"`
  25686. // NextPageToken: [Output Only] This token allows you to get the next
  25687. // page of results for list requests. If the number of results is larger
  25688. // than maxResults, use the nextPageToken as a value for the query
  25689. // parameter pageToken in the next list request. Subsequent list
  25690. // requests will have their own nextPageToken to continue paging through
  25691. // the results.
  25692. NextPageToken string `json:"nextPageToken,omitempty"`
  25693. // SelfLink: [Output Only] Server-defined URL for this resource.
  25694. SelfLink string `json:"selfLink,omitempty"`
  25695. // Warning: [Output Only] Informational warning message.
  25696. Warning *ReservationAggregatedListWarning `json:"warning,omitempty"`
  25697. // ServerResponse contains the HTTP response code and headers from the
  25698. // server.
  25699. googleapi.ServerResponse `json:"-"`
  25700. // ForceSendFields is a list of field names (e.g. "Id") to
  25701. // unconditionally include in API requests. By default, fields with
  25702. // empty values are omitted from API requests. However, any non-pointer,
  25703. // non-interface field appearing in ForceSendFields will be sent to the
  25704. // server regardless of whether the field is empty or not. This may be
  25705. // used to include empty fields in Patch requests.
  25706. ForceSendFields []string `json:"-"`
  25707. // NullFields is a list of field names (e.g. "Id") to include in API
  25708. // requests with the JSON null value. By default, fields with empty
  25709. // values are omitted from API requests. However, any field with an
  25710. // empty value appearing in NullFields will be sent to the server as
  25711. // null. It is an error if a field in this list has a non-empty value.
  25712. // This may be used to include null fields in Patch requests.
  25713. NullFields []string `json:"-"`
  25714. }
  25715. func (s *ReservationAggregatedList) MarshalJSON() ([]byte, error) {
  25716. type NoMethod ReservationAggregatedList
  25717. raw := NoMethod(*s)
  25718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25719. }
  25720. // ReservationAggregatedListWarning: [Output Only] Informational warning
  25721. // message.
  25722. type ReservationAggregatedListWarning struct {
  25723. // Code: [Output Only] A warning code, if applicable. For example,
  25724. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25725. // the response.
  25726. //
  25727. // Possible values:
  25728. // "CLEANUP_FAILED"
  25729. // "DEPRECATED_RESOURCE_USED"
  25730. // "DEPRECATED_TYPE_USED"
  25731. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25732. // "EXPERIMENTAL_TYPE_USED"
  25733. // "EXTERNAL_API_WARNING"
  25734. // "FIELD_VALUE_OVERRIDEN"
  25735. // "INJECTED_KERNELS_DEPRECATED"
  25736. // "MISSING_TYPE_DEPENDENCY"
  25737. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25738. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25739. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25740. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25741. // "NEXT_HOP_NOT_RUNNING"
  25742. // "NOT_CRITICAL_ERROR"
  25743. // "NO_RESULTS_ON_PAGE"
  25744. // "REQUIRED_TOS_AGREEMENT"
  25745. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25746. // "RESOURCE_NOT_DELETED"
  25747. // "SCHEMA_VALIDATION_IGNORED"
  25748. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25749. // "UNDECLARED_PROPERTIES"
  25750. // "UNREACHABLE"
  25751. Code string `json:"code,omitempty"`
  25752. // Data: [Output Only] Metadata about this warning in key: value format.
  25753. // For example:
  25754. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25755. Data []*ReservationAggregatedListWarningData `json:"data,omitempty"`
  25756. // Message: [Output Only] A human-readable description of the warning
  25757. // code.
  25758. Message string `json:"message,omitempty"`
  25759. // ForceSendFields is a list of field names (e.g. "Code") to
  25760. // unconditionally include in API requests. By default, fields with
  25761. // empty values are omitted from API requests. However, any non-pointer,
  25762. // non-interface field appearing in ForceSendFields will be sent to the
  25763. // server regardless of whether the field is empty or not. This may be
  25764. // used to include empty fields in Patch requests.
  25765. ForceSendFields []string `json:"-"`
  25766. // NullFields is a list of field names (e.g. "Code") to include in API
  25767. // requests with the JSON null value. By default, fields with empty
  25768. // values are omitted from API requests. However, any field with an
  25769. // empty value appearing in NullFields will be sent to the server as
  25770. // null. It is an error if a field in this list has a non-empty value.
  25771. // This may be used to include null fields in Patch requests.
  25772. NullFields []string `json:"-"`
  25773. }
  25774. func (s *ReservationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25775. type NoMethod ReservationAggregatedListWarning
  25776. raw := NoMethod(*s)
  25777. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25778. }
  25779. type ReservationAggregatedListWarningData struct {
  25780. // Key: [Output Only] A key that provides more detail on the warning
  25781. // being returned. For example, for warnings where there are no results
  25782. // in a list request for a particular zone, this key might be scope and
  25783. // the key value might be the zone name. Other examples might be a key
  25784. // indicating a deprecated resource and a suggested replacement, or a
  25785. // warning about invalid network settings (for example, if an instance
  25786. // attempts to perform IP forwarding but is not enabled for IP
  25787. // forwarding).
  25788. Key string `json:"key,omitempty"`
  25789. // Value: [Output Only] A warning data value corresponding to the key.
  25790. Value string `json:"value,omitempty"`
  25791. // ForceSendFields is a list of field names (e.g. "Key") to
  25792. // unconditionally include in API requests. By default, fields with
  25793. // empty values are omitted from API requests. However, any non-pointer,
  25794. // non-interface field appearing in ForceSendFields will be sent to the
  25795. // server regardless of whether the field is empty or not. This may be
  25796. // used to include empty fields in Patch requests.
  25797. ForceSendFields []string `json:"-"`
  25798. // NullFields is a list of field names (e.g. "Key") to include in API
  25799. // requests with the JSON null value. By default, fields with empty
  25800. // values are omitted from API requests. However, any field with an
  25801. // empty value appearing in NullFields will be sent to the server as
  25802. // null. It is an error if a field in this list has a non-empty value.
  25803. // This may be used to include null fields in Patch requests.
  25804. NullFields []string `json:"-"`
  25805. }
  25806. func (s *ReservationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25807. type NoMethod ReservationAggregatedListWarningData
  25808. raw := NoMethod(*s)
  25809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25810. }
  25811. type ReservationList struct {
  25812. // Id: [Output Only] The unique identifier for the resource. This
  25813. // identifier is defined by the server.
  25814. Id string `json:"id,omitempty"`
  25815. // Items: [Output Only] A list of Allocation resources.
  25816. Items []*Reservation `json:"items,omitempty"`
  25817. // Kind: [Output Only] Type of resource.Always compute#reservationsList
  25818. // for listsof reservations
  25819. Kind string `json:"kind,omitempty"`
  25820. // NextPageToken: [Output Only] This token allows you to get the next
  25821. // page of results for list requests. If the number of results is larger
  25822. // than maxResults, use the nextPageToken as a value for the query
  25823. // parameter pageToken in the next list request. Subsequent list
  25824. // requests will have their own nextPageToken to continue paging through
  25825. // the results.
  25826. NextPageToken string `json:"nextPageToken,omitempty"`
  25827. // SelfLink: [Output Only] Server-defined URL for this resource.
  25828. SelfLink string `json:"selfLink,omitempty"`
  25829. // Warning: [Output Only] Informational warning message.
  25830. Warning *ReservationListWarning `json:"warning,omitempty"`
  25831. // ServerResponse contains the HTTP response code and headers from the
  25832. // server.
  25833. googleapi.ServerResponse `json:"-"`
  25834. // ForceSendFields is a list of field names (e.g. "Id") to
  25835. // unconditionally include in API requests. By default, fields with
  25836. // empty values are omitted from API requests. However, any non-pointer,
  25837. // non-interface field appearing in ForceSendFields will be sent to the
  25838. // server regardless of whether the field is empty or not. This may be
  25839. // used to include empty fields in Patch requests.
  25840. ForceSendFields []string `json:"-"`
  25841. // NullFields is a list of field names (e.g. "Id") to include in API
  25842. // requests with the JSON null value. By default, fields with empty
  25843. // values are omitted from API requests. However, any field with an
  25844. // empty value appearing in NullFields will be sent to the server as
  25845. // null. It is an error if a field in this list has a non-empty value.
  25846. // This may be used to include null fields in Patch requests.
  25847. NullFields []string `json:"-"`
  25848. }
  25849. func (s *ReservationList) MarshalJSON() ([]byte, error) {
  25850. type NoMethod ReservationList
  25851. raw := NoMethod(*s)
  25852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25853. }
  25854. // ReservationListWarning: [Output Only] Informational warning message.
  25855. type ReservationListWarning struct {
  25856. // Code: [Output Only] A warning code, if applicable. For example,
  25857. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25858. // the response.
  25859. //
  25860. // Possible values:
  25861. // "CLEANUP_FAILED"
  25862. // "DEPRECATED_RESOURCE_USED"
  25863. // "DEPRECATED_TYPE_USED"
  25864. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25865. // "EXPERIMENTAL_TYPE_USED"
  25866. // "EXTERNAL_API_WARNING"
  25867. // "FIELD_VALUE_OVERRIDEN"
  25868. // "INJECTED_KERNELS_DEPRECATED"
  25869. // "MISSING_TYPE_DEPENDENCY"
  25870. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25871. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25872. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25873. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25874. // "NEXT_HOP_NOT_RUNNING"
  25875. // "NOT_CRITICAL_ERROR"
  25876. // "NO_RESULTS_ON_PAGE"
  25877. // "REQUIRED_TOS_AGREEMENT"
  25878. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25879. // "RESOURCE_NOT_DELETED"
  25880. // "SCHEMA_VALIDATION_IGNORED"
  25881. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25882. // "UNDECLARED_PROPERTIES"
  25883. // "UNREACHABLE"
  25884. Code string `json:"code,omitempty"`
  25885. // Data: [Output Only] Metadata about this warning in key: value format.
  25886. // For example:
  25887. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25888. Data []*ReservationListWarningData `json:"data,omitempty"`
  25889. // Message: [Output Only] A human-readable description of the warning
  25890. // code.
  25891. Message string `json:"message,omitempty"`
  25892. // ForceSendFields is a list of field names (e.g. "Code") to
  25893. // unconditionally include in API requests. By default, fields with
  25894. // empty values are omitted from API requests. However, any non-pointer,
  25895. // non-interface field appearing in ForceSendFields will be sent to the
  25896. // server regardless of whether the field is empty or not. This may be
  25897. // used to include empty fields in Patch requests.
  25898. ForceSendFields []string `json:"-"`
  25899. // NullFields is a list of field names (e.g. "Code") to include in API
  25900. // requests with the JSON null value. By default, fields with empty
  25901. // values are omitted from API requests. However, any field with an
  25902. // empty value appearing in NullFields will be sent to the server as
  25903. // null. It is an error if a field in this list has a non-empty value.
  25904. // This may be used to include null fields in Patch requests.
  25905. NullFields []string `json:"-"`
  25906. }
  25907. func (s *ReservationListWarning) MarshalJSON() ([]byte, error) {
  25908. type NoMethod ReservationListWarning
  25909. raw := NoMethod(*s)
  25910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25911. }
  25912. type ReservationListWarningData struct {
  25913. // Key: [Output Only] A key that provides more detail on the warning
  25914. // being returned. For example, for warnings where there are no results
  25915. // in a list request for a particular zone, this key might be scope and
  25916. // the key value might be the zone name. Other examples might be a key
  25917. // indicating a deprecated resource and a suggested replacement, or a
  25918. // warning about invalid network settings (for example, if an instance
  25919. // attempts to perform IP forwarding but is not enabled for IP
  25920. // forwarding).
  25921. Key string `json:"key,omitempty"`
  25922. // Value: [Output Only] A warning data value corresponding to the key.
  25923. Value string `json:"value,omitempty"`
  25924. // ForceSendFields is a list of field names (e.g. "Key") to
  25925. // unconditionally include in API requests. By default, fields with
  25926. // empty values are omitted from API requests. However, any non-pointer,
  25927. // non-interface field appearing in ForceSendFields will be sent to the
  25928. // server regardless of whether the field is empty or not. This may be
  25929. // used to include empty fields in Patch requests.
  25930. ForceSendFields []string `json:"-"`
  25931. // NullFields is a list of field names (e.g. "Key") to include in API
  25932. // requests with the JSON null value. By default, fields with empty
  25933. // values are omitted from API requests. However, any field with an
  25934. // empty value appearing in NullFields will be sent to the server as
  25935. // null. It is an error if a field in this list has a non-empty value.
  25936. // This may be used to include null fields in Patch requests.
  25937. NullFields []string `json:"-"`
  25938. }
  25939. func (s *ReservationListWarningData) MarshalJSON() ([]byte, error) {
  25940. type NoMethod ReservationListWarningData
  25941. raw := NoMethod(*s)
  25942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25943. }
  25944. type ReservationsResizeRequest struct {
  25945. // SpecificSkuCount: Number of allocated resources can be resized with
  25946. // minimum = 1 and maximum = 1000.
  25947. SpecificSkuCount int64 `json:"specificSkuCount,omitempty,string"`
  25948. // ForceSendFields is a list of field names (e.g. "SpecificSkuCount") to
  25949. // unconditionally include in API requests. By default, fields with
  25950. // empty values are omitted from API requests. However, any non-pointer,
  25951. // non-interface field appearing in ForceSendFields will be sent to the
  25952. // server regardless of whether the field is empty or not. This may be
  25953. // used to include empty fields in Patch requests.
  25954. ForceSendFields []string `json:"-"`
  25955. // NullFields is a list of field names (e.g. "SpecificSkuCount") to
  25956. // include in API requests with the JSON null value. By default, fields
  25957. // with empty values are omitted from API requests. However, any field
  25958. // with an empty value appearing in NullFields will be sent to the
  25959. // server as null. It is an error if a field in this list has a
  25960. // non-empty value. This may be used to include null fields in Patch
  25961. // requests.
  25962. NullFields []string `json:"-"`
  25963. }
  25964. func (s *ReservationsResizeRequest) MarshalJSON() ([]byte, error) {
  25965. type NoMethod ReservationsResizeRequest
  25966. raw := NoMethod(*s)
  25967. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25968. }
  25969. type ReservationsScopedList struct {
  25970. // Reservations: A list of reservations contained in this scope.
  25971. Reservations []*Reservation `json:"reservations,omitempty"`
  25972. // Warning: Informational warning which replaces the list of
  25973. // reservations when the list is empty.
  25974. Warning *ReservationsScopedListWarning `json:"warning,omitempty"`
  25975. // ForceSendFields is a list of field names (e.g. "Reservations") to
  25976. // unconditionally include in API requests. By default, fields with
  25977. // empty values are omitted from API requests. However, any non-pointer,
  25978. // non-interface field appearing in ForceSendFields will be sent to the
  25979. // server regardless of whether the field is empty or not. This may be
  25980. // used to include empty fields in Patch requests.
  25981. ForceSendFields []string `json:"-"`
  25982. // NullFields is a list of field names (e.g. "Reservations") to include
  25983. // in API requests with the JSON null value. By default, fields with
  25984. // empty values are omitted from API requests. However, any field with
  25985. // an empty value appearing in NullFields will be sent to the server as
  25986. // null. It is an error if a field in this list has a non-empty value.
  25987. // This may be used to include null fields in Patch requests.
  25988. NullFields []string `json:"-"`
  25989. }
  25990. func (s *ReservationsScopedList) MarshalJSON() ([]byte, error) {
  25991. type NoMethod ReservationsScopedList
  25992. raw := NoMethod(*s)
  25993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25994. }
  25995. // ReservationsScopedListWarning: Informational warning which replaces
  25996. // the list of reservations when the list is empty.
  25997. type ReservationsScopedListWarning struct {
  25998. // Code: [Output Only] A warning code, if applicable. For example,
  25999. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26000. // the response.
  26001. //
  26002. // Possible values:
  26003. // "CLEANUP_FAILED"
  26004. // "DEPRECATED_RESOURCE_USED"
  26005. // "DEPRECATED_TYPE_USED"
  26006. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26007. // "EXPERIMENTAL_TYPE_USED"
  26008. // "EXTERNAL_API_WARNING"
  26009. // "FIELD_VALUE_OVERRIDEN"
  26010. // "INJECTED_KERNELS_DEPRECATED"
  26011. // "MISSING_TYPE_DEPENDENCY"
  26012. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26013. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26014. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26015. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26016. // "NEXT_HOP_NOT_RUNNING"
  26017. // "NOT_CRITICAL_ERROR"
  26018. // "NO_RESULTS_ON_PAGE"
  26019. // "REQUIRED_TOS_AGREEMENT"
  26020. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26021. // "RESOURCE_NOT_DELETED"
  26022. // "SCHEMA_VALIDATION_IGNORED"
  26023. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26024. // "UNDECLARED_PROPERTIES"
  26025. // "UNREACHABLE"
  26026. Code string `json:"code,omitempty"`
  26027. // Data: [Output Only] Metadata about this warning in key: value format.
  26028. // For example:
  26029. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26030. Data []*ReservationsScopedListWarningData `json:"data,omitempty"`
  26031. // Message: [Output Only] A human-readable description of the warning
  26032. // code.
  26033. Message string `json:"message,omitempty"`
  26034. // ForceSendFields is a list of field names (e.g. "Code") to
  26035. // unconditionally include in API requests. By default, fields with
  26036. // empty values are omitted from API requests. However, any non-pointer,
  26037. // non-interface field appearing in ForceSendFields will be sent to the
  26038. // server regardless of whether the field is empty or not. This may be
  26039. // used to include empty fields in Patch requests.
  26040. ForceSendFields []string `json:"-"`
  26041. // NullFields is a list of field names (e.g. "Code") to include in API
  26042. // requests with the JSON null value. By default, fields with empty
  26043. // values are omitted from API requests. However, any field with an
  26044. // empty value appearing in NullFields will be sent to the server as
  26045. // null. It is an error if a field in this list has a non-empty value.
  26046. // This may be used to include null fields in Patch requests.
  26047. NullFields []string `json:"-"`
  26048. }
  26049. func (s *ReservationsScopedListWarning) MarshalJSON() ([]byte, error) {
  26050. type NoMethod ReservationsScopedListWarning
  26051. raw := NoMethod(*s)
  26052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26053. }
  26054. type ReservationsScopedListWarningData struct {
  26055. // Key: [Output Only] A key that provides more detail on the warning
  26056. // being returned. For example, for warnings where there are no results
  26057. // in a list request for a particular zone, this key might be scope and
  26058. // the key value might be the zone name. Other examples might be a key
  26059. // indicating a deprecated resource and a suggested replacement, or a
  26060. // warning about invalid network settings (for example, if an instance
  26061. // attempts to perform IP forwarding but is not enabled for IP
  26062. // forwarding).
  26063. Key string `json:"key,omitempty"`
  26064. // Value: [Output Only] A warning data value corresponding to the key.
  26065. Value string `json:"value,omitempty"`
  26066. // ForceSendFields is a list of field names (e.g. "Key") to
  26067. // unconditionally include in API requests. By default, fields with
  26068. // empty values are omitted from API requests. However, any non-pointer,
  26069. // non-interface field appearing in ForceSendFields will be sent to the
  26070. // server regardless of whether the field is empty or not. This may be
  26071. // used to include empty fields in Patch requests.
  26072. ForceSendFields []string `json:"-"`
  26073. // NullFields is a list of field names (e.g. "Key") to include in API
  26074. // requests with the JSON null value. By default, fields with empty
  26075. // values are omitted from API requests. However, any field with an
  26076. // empty value appearing in NullFields will be sent to the server as
  26077. // null. It is an error if a field in this list has a non-empty value.
  26078. // This may be used to include null fields in Patch requests.
  26079. NullFields []string `json:"-"`
  26080. }
  26081. func (s *ReservationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  26082. type NoMethod ReservationsScopedListWarningData
  26083. raw := NoMethod(*s)
  26084. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26085. }
  26086. // ResourceCommitment: Commitment for a particular resource (a
  26087. // Commitment is composed of one or more of these).
  26088. type ResourceCommitment struct {
  26089. // AcceleratorType: Name of the accelerator type resource. Applicable
  26090. // only when the type is ACCELERATOR.
  26091. AcceleratorType string `json:"acceleratorType,omitempty"`
  26092. // Amount: The amount of the resource purchased (in a type-dependent
  26093. // unit, such as bytes). For vCPUs, this can just be an integer. For
  26094. // memory, this must be provided in MB. Memory must be a multiple of 256
  26095. // MB, with up to 6.5GB of memory per every vCPU.
  26096. Amount int64 `json:"amount,omitempty,string"`
  26097. // Type: Type of resource for which this commitment applies. Possible
  26098. // values are VCPU and MEMORY
  26099. //
  26100. // Possible values:
  26101. // "ACCELERATOR"
  26102. // "LOCAL_SSD"
  26103. // "MEMORY"
  26104. // "UNSPECIFIED"
  26105. // "VCPU"
  26106. Type string `json:"type,omitempty"`
  26107. // ForceSendFields is a list of field names (e.g. "AcceleratorType") 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. "AcceleratorType") to
  26115. // include in API requests with the JSON null value. By default, fields
  26116. // with empty values are omitted from API requests. However, any field
  26117. // with an empty value appearing in NullFields will be sent to the
  26118. // server as null. It is an error if a field in this list has a
  26119. // non-empty value. This may be used to include null fields in Patch
  26120. // requests.
  26121. NullFields []string `json:"-"`
  26122. }
  26123. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  26124. type NoMethod ResourceCommitment
  26125. raw := NoMethod(*s)
  26126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26127. }
  26128. type ResourceGroupReference struct {
  26129. // Group: A URI referencing one of the instance groups or network
  26130. // endpoint groups listed in the backend service.
  26131. Group string `json:"group,omitempty"`
  26132. // ForceSendFields is a list of field names (e.g. "Group") to
  26133. // unconditionally include in API requests. By default, fields with
  26134. // empty values are omitted from API requests. However, any non-pointer,
  26135. // non-interface field appearing in ForceSendFields will be sent to the
  26136. // server regardless of whether the field is empty or not. This may be
  26137. // used to include empty fields in Patch requests.
  26138. ForceSendFields []string `json:"-"`
  26139. // NullFields is a list of field names (e.g. "Group") to include in API
  26140. // requests with the JSON null value. By default, fields with empty
  26141. // values are omitted from API requests. However, any field with an
  26142. // empty value appearing in NullFields will be sent to the server as
  26143. // null. It is an error if a field in this list has a non-empty value.
  26144. // This may be used to include null fields in Patch requests.
  26145. NullFields []string `json:"-"`
  26146. }
  26147. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  26148. type NoMethod ResourceGroupReference
  26149. raw := NoMethod(*s)
  26150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26151. }
  26152. type ResourcePoliciesScopedList struct {
  26153. // ResourcePolicies: A list of resourcePolicies contained in this scope.
  26154. ResourcePolicies []*ResourcePolicy `json:"resourcePolicies,omitempty"`
  26155. // Warning: Informational warning which replaces the list of
  26156. // resourcePolicies when the list is empty.
  26157. Warning *ResourcePoliciesScopedListWarning `json:"warning,omitempty"`
  26158. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  26159. // unconditionally include in API requests. By default, fields with
  26160. // empty values are omitted from API requests. However, any non-pointer,
  26161. // non-interface field appearing in ForceSendFields will be sent to the
  26162. // server regardless of whether the field is empty or not. This may be
  26163. // used to include empty fields in Patch requests.
  26164. ForceSendFields []string `json:"-"`
  26165. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  26166. // include in API requests with the JSON null value. By default, fields
  26167. // with empty values are omitted from API requests. However, any field
  26168. // with an empty value appearing in NullFields will be sent to the
  26169. // server as null. It is an error if a field in this list has a
  26170. // non-empty value. This may be used to include null fields in Patch
  26171. // requests.
  26172. NullFields []string `json:"-"`
  26173. }
  26174. func (s *ResourcePoliciesScopedList) MarshalJSON() ([]byte, error) {
  26175. type NoMethod ResourcePoliciesScopedList
  26176. raw := NoMethod(*s)
  26177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26178. }
  26179. // ResourcePoliciesScopedListWarning: Informational warning which
  26180. // replaces the list of resourcePolicies when the list is empty.
  26181. type ResourcePoliciesScopedListWarning struct {
  26182. // Code: [Output Only] A warning code, if applicable. For example,
  26183. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26184. // the response.
  26185. //
  26186. // Possible values:
  26187. // "CLEANUP_FAILED"
  26188. // "DEPRECATED_RESOURCE_USED"
  26189. // "DEPRECATED_TYPE_USED"
  26190. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26191. // "EXPERIMENTAL_TYPE_USED"
  26192. // "EXTERNAL_API_WARNING"
  26193. // "FIELD_VALUE_OVERRIDEN"
  26194. // "INJECTED_KERNELS_DEPRECATED"
  26195. // "MISSING_TYPE_DEPENDENCY"
  26196. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26197. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26198. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26199. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26200. // "NEXT_HOP_NOT_RUNNING"
  26201. // "NOT_CRITICAL_ERROR"
  26202. // "NO_RESULTS_ON_PAGE"
  26203. // "REQUIRED_TOS_AGREEMENT"
  26204. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26205. // "RESOURCE_NOT_DELETED"
  26206. // "SCHEMA_VALIDATION_IGNORED"
  26207. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26208. // "UNDECLARED_PROPERTIES"
  26209. // "UNREACHABLE"
  26210. Code string `json:"code,omitempty"`
  26211. // Data: [Output Only] Metadata about this warning in key: value format.
  26212. // For example:
  26213. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26214. Data []*ResourcePoliciesScopedListWarningData `json:"data,omitempty"`
  26215. // Message: [Output Only] A human-readable description of the warning
  26216. // code.
  26217. Message string `json:"message,omitempty"`
  26218. // ForceSendFields is a list of field names (e.g. "Code") to
  26219. // unconditionally include in API requests. By default, fields with
  26220. // empty values are omitted from API requests. However, any non-pointer,
  26221. // non-interface field appearing in ForceSendFields will be sent to the
  26222. // server regardless of whether the field is empty or not. This may be
  26223. // used to include empty fields in Patch requests.
  26224. ForceSendFields []string `json:"-"`
  26225. // NullFields is a list of field names (e.g. "Code") to include in API
  26226. // requests with the JSON null value. By default, fields with empty
  26227. // values are omitted from API requests. However, any field with an
  26228. // empty value appearing in NullFields will be sent to the server as
  26229. // null. It is an error if a field in this list has a non-empty value.
  26230. // This may be used to include null fields in Patch requests.
  26231. NullFields []string `json:"-"`
  26232. }
  26233. func (s *ResourcePoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
  26234. type NoMethod ResourcePoliciesScopedListWarning
  26235. raw := NoMethod(*s)
  26236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26237. }
  26238. type ResourcePoliciesScopedListWarningData struct {
  26239. // Key: [Output Only] A key that provides more detail on the warning
  26240. // being returned. For example, for warnings where there are no results
  26241. // in a list request for a particular zone, this key might be scope and
  26242. // the key value might be the zone name. Other examples might be a key
  26243. // indicating a deprecated resource and a suggested replacement, or a
  26244. // warning about invalid network settings (for example, if an instance
  26245. // attempts to perform IP forwarding but is not enabled for IP
  26246. // forwarding).
  26247. Key string `json:"key,omitempty"`
  26248. // Value: [Output Only] A warning data value corresponding to the key.
  26249. Value string `json:"value,omitempty"`
  26250. // ForceSendFields is a list of field names (e.g. "Key") to
  26251. // unconditionally include in API requests. By default, fields with
  26252. // empty values are omitted from API requests. However, any non-pointer,
  26253. // non-interface field appearing in ForceSendFields will be sent to the
  26254. // server regardless of whether the field is empty or not. This may be
  26255. // used to include empty fields in Patch requests.
  26256. ForceSendFields []string `json:"-"`
  26257. // NullFields is a list of field names (e.g. "Key") to include in API
  26258. // requests with the JSON null value. By default, fields with empty
  26259. // values are omitted from API requests. However, any field with an
  26260. // empty value appearing in NullFields will be sent to the server as
  26261. // null. It is an error if a field in this list has a non-empty value.
  26262. // This may be used to include null fields in Patch requests.
  26263. NullFields []string `json:"-"`
  26264. }
  26265. func (s *ResourcePoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
  26266. type NoMethod ResourcePoliciesScopedListWarningData
  26267. raw := NoMethod(*s)
  26268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26269. }
  26270. type ResourcePolicy struct {
  26271. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26272. // format.
  26273. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26274. Description string `json:"description,omitempty"`
  26275. // GroupPlacementPolicy: Resource policy for instacnes for placement
  26276. // configuration.
  26277. GroupPlacementPolicy *ResourcePolicyGroupPlacementPolicy `json:"groupPlacementPolicy,omitempty"`
  26278. // Id: [Output Only] The unique identifier for the resource. This
  26279. // identifier is defined by the server.
  26280. Id uint64 `json:"id,omitempty,string"`
  26281. // Kind: [Output Only] Type of the resource. Always
  26282. // compute#resource_policies for resource policies.
  26283. Kind string `json:"kind,omitempty"`
  26284. // Name: The name of the resource, provided by the client when initially
  26285. // creating the resource. The resource name must be 1-63 characters
  26286. // long, and comply with RFC1035. Specifically, the name must be 1-63
  26287. // characters long and match the regular expression
  26288. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  26289. // a lowercase letter, and all following characters must be a dash,
  26290. // lowercase letter, or digit, except the last character, which cannot
  26291. // be a dash.
  26292. Name string `json:"name,omitempty"`
  26293. Region string `json:"region,omitempty"`
  26294. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  26295. // resource.
  26296. SelfLink string `json:"selfLink,omitempty"`
  26297. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  26298. // with the resource id.
  26299. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  26300. // SnapshotSchedulePolicy: Resource policy for persistent disks for
  26301. // creating snapshots.
  26302. SnapshotSchedulePolicy *ResourcePolicySnapshotSchedulePolicy `json:"snapshotSchedulePolicy,omitempty"`
  26303. // Status: [Output Only] The status of resource policy creation.
  26304. //
  26305. // Possible values:
  26306. // "CREATING"
  26307. // "DELETING"
  26308. // "INVALID"
  26309. // "READY"
  26310. Status string `json:"status,omitempty"`
  26311. // VmMaintenancePolicy: Resource policy applicable to VMs for
  26312. // infrastructure maintenance.
  26313. VmMaintenancePolicy *ResourcePolicyVmMaintenancePolicy `json:"vmMaintenancePolicy,omitempty"`
  26314. // ServerResponse contains the HTTP response code and headers from the
  26315. // server.
  26316. googleapi.ServerResponse `json:"-"`
  26317. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26318. // to unconditionally include in API requests. By default, fields with
  26319. // empty values are omitted from API requests. However, any non-pointer,
  26320. // non-interface field appearing in ForceSendFields will be sent to the
  26321. // server regardless of whether the field is empty or not. This may be
  26322. // used to include empty fields in Patch requests.
  26323. ForceSendFields []string `json:"-"`
  26324. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  26325. // include in API requests with the JSON null value. By default, fields
  26326. // with empty values are omitted from API requests. However, any field
  26327. // with an empty value appearing in NullFields will be sent to the
  26328. // server as null. It is an error if a field in this list has a
  26329. // non-empty value. This may be used to include null fields in Patch
  26330. // requests.
  26331. NullFields []string `json:"-"`
  26332. }
  26333. func (s *ResourcePolicy) MarshalJSON() ([]byte, error) {
  26334. type NoMethod ResourcePolicy
  26335. raw := NoMethod(*s)
  26336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26337. }
  26338. // ResourcePolicyAggregatedList: Contains a list of resourcePolicies.
  26339. type ResourcePolicyAggregatedList struct {
  26340. Etag string `json:"etag,omitempty"`
  26341. // Id: [Output Only] Unique identifier for the resource; defined by the
  26342. // server.
  26343. Id string `json:"id,omitempty"`
  26344. // Items: A list of ResourcePolicy resources.
  26345. Items map[string]ResourcePoliciesScopedList `json:"items,omitempty"`
  26346. // Kind: Type of resource.
  26347. Kind string `json:"kind,omitempty"`
  26348. // NextPageToken: [Output Only] This token allows you to get the next
  26349. // page of results for list requests. If the number of results is larger
  26350. // than maxResults, use the nextPageToken as a value for the query
  26351. // parameter pageToken in the next list request. Subsequent list
  26352. // requests will have their own nextPageToken to continue paging through
  26353. // the results.
  26354. NextPageToken string `json:"nextPageToken,omitempty"`
  26355. // SelfLink: [Output Only] Server-defined URL for this resource.
  26356. SelfLink string `json:"selfLink,omitempty"`
  26357. // Warning: [Output Only] Informational warning message.
  26358. Warning *ResourcePolicyAggregatedListWarning `json:"warning,omitempty"`
  26359. // ServerResponse contains the HTTP response code and headers from the
  26360. // server.
  26361. googleapi.ServerResponse `json:"-"`
  26362. // ForceSendFields is a list of field names (e.g. "Etag") to
  26363. // unconditionally include in API requests. By default, fields with
  26364. // empty values are omitted from API requests. However, any non-pointer,
  26365. // non-interface field appearing in ForceSendFields will be sent to the
  26366. // server regardless of whether the field is empty or not. This may be
  26367. // used to include empty fields in Patch requests.
  26368. ForceSendFields []string `json:"-"`
  26369. // NullFields is a list of field names (e.g. "Etag") to include in API
  26370. // requests with the JSON null value. By default, fields with empty
  26371. // values are omitted from API requests. However, any field with an
  26372. // empty value appearing in NullFields will be sent to the server as
  26373. // null. It is an error if a field in this list has a non-empty value.
  26374. // This may be used to include null fields in Patch requests.
  26375. NullFields []string `json:"-"`
  26376. }
  26377. func (s *ResourcePolicyAggregatedList) MarshalJSON() ([]byte, error) {
  26378. type NoMethod ResourcePolicyAggregatedList
  26379. raw := NoMethod(*s)
  26380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26381. }
  26382. // ResourcePolicyAggregatedListWarning: [Output Only] Informational
  26383. // warning message.
  26384. type ResourcePolicyAggregatedListWarning struct {
  26385. // Code: [Output Only] A warning code, if applicable. For example,
  26386. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26387. // the response.
  26388. //
  26389. // Possible values:
  26390. // "CLEANUP_FAILED"
  26391. // "DEPRECATED_RESOURCE_USED"
  26392. // "DEPRECATED_TYPE_USED"
  26393. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26394. // "EXPERIMENTAL_TYPE_USED"
  26395. // "EXTERNAL_API_WARNING"
  26396. // "FIELD_VALUE_OVERRIDEN"
  26397. // "INJECTED_KERNELS_DEPRECATED"
  26398. // "MISSING_TYPE_DEPENDENCY"
  26399. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26400. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26401. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26402. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26403. // "NEXT_HOP_NOT_RUNNING"
  26404. // "NOT_CRITICAL_ERROR"
  26405. // "NO_RESULTS_ON_PAGE"
  26406. // "REQUIRED_TOS_AGREEMENT"
  26407. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26408. // "RESOURCE_NOT_DELETED"
  26409. // "SCHEMA_VALIDATION_IGNORED"
  26410. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26411. // "UNDECLARED_PROPERTIES"
  26412. // "UNREACHABLE"
  26413. Code string `json:"code,omitempty"`
  26414. // Data: [Output Only] Metadata about this warning in key: value format.
  26415. // For example:
  26416. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26417. Data []*ResourcePolicyAggregatedListWarningData `json:"data,omitempty"`
  26418. // Message: [Output Only] A human-readable description of the warning
  26419. // code.
  26420. Message string `json:"message,omitempty"`
  26421. // ForceSendFields is a list of field names (e.g. "Code") to
  26422. // unconditionally include in API requests. By default, fields with
  26423. // empty values are omitted from API requests. However, any non-pointer,
  26424. // non-interface field appearing in ForceSendFields will be sent to the
  26425. // server regardless of whether the field is empty or not. This may be
  26426. // used to include empty fields in Patch requests.
  26427. ForceSendFields []string `json:"-"`
  26428. // NullFields is a list of field names (e.g. "Code") to include in API
  26429. // requests with the JSON null value. By default, fields with empty
  26430. // values are omitted from API requests. However, any field with an
  26431. // empty value appearing in NullFields will be sent to the server as
  26432. // null. It is an error if a field in this list has a non-empty value.
  26433. // This may be used to include null fields in Patch requests.
  26434. NullFields []string `json:"-"`
  26435. }
  26436. func (s *ResourcePolicyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  26437. type NoMethod ResourcePolicyAggregatedListWarning
  26438. raw := NoMethod(*s)
  26439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26440. }
  26441. type ResourcePolicyAggregatedListWarningData struct {
  26442. // Key: [Output Only] A key that provides more detail on the warning
  26443. // being returned. For example, for warnings where there are no results
  26444. // in a list request for a particular zone, this key might be scope and
  26445. // the key value might be the zone name. Other examples might be a key
  26446. // indicating a deprecated resource and a suggested replacement, or a
  26447. // warning about invalid network settings (for example, if an instance
  26448. // attempts to perform IP forwarding but is not enabled for IP
  26449. // forwarding).
  26450. Key string `json:"key,omitempty"`
  26451. // Value: [Output Only] A warning data value corresponding to the key.
  26452. Value string `json:"value,omitempty"`
  26453. // ForceSendFields is a list of field names (e.g. "Key") to
  26454. // unconditionally include in API requests. By default, fields with
  26455. // empty values are omitted from API requests. However, any non-pointer,
  26456. // non-interface field appearing in ForceSendFields will be sent to the
  26457. // server regardless of whether the field is empty or not. This may be
  26458. // used to include empty fields in Patch requests.
  26459. ForceSendFields []string `json:"-"`
  26460. // NullFields is a list of field names (e.g. "Key") to include in API
  26461. // requests with the JSON null value. By default, fields with empty
  26462. // values are omitted from API requests. However, any field with an
  26463. // empty value appearing in NullFields will be sent to the server as
  26464. // null. It is an error if a field in this list has a non-empty value.
  26465. // This may be used to include null fields in Patch requests.
  26466. NullFields []string `json:"-"`
  26467. }
  26468. func (s *ResourcePolicyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  26469. type NoMethod ResourcePolicyAggregatedListWarningData
  26470. raw := NoMethod(*s)
  26471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26472. }
  26473. // ResourcePolicyDailyCycle: Time window specified for daily operations.
  26474. type ResourcePolicyDailyCycle struct {
  26475. // DaysInCycle: Defines a schedule that runs every nth day of the month.
  26476. DaysInCycle int64 `json:"daysInCycle,omitempty"`
  26477. // Duration: [Output only] A predetermined duration for the window,
  26478. // automatically chosen to be the smallest possible in the given
  26479. // scenario.
  26480. Duration string `json:"duration,omitempty"`
  26481. // StartTime: Start time of the window. This must be in UTC format that
  26482. // resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For
  26483. // example, both 13:00-5 and 08:00 are valid.
  26484. StartTime string `json:"startTime,omitempty"`
  26485. // ForceSendFields is a list of field names (e.g. "DaysInCycle") to
  26486. // unconditionally include in API requests. By default, fields with
  26487. // empty values are omitted from API requests. However, any non-pointer,
  26488. // non-interface field appearing in ForceSendFields will be sent to the
  26489. // server regardless of whether the field is empty or not. This may be
  26490. // used to include empty fields in Patch requests.
  26491. ForceSendFields []string `json:"-"`
  26492. // NullFields is a list of field names (e.g. "DaysInCycle") to include
  26493. // in API requests with the JSON null value. By default, fields with
  26494. // empty values are omitted from API requests. However, any field with
  26495. // an empty value appearing in NullFields will be sent to the server as
  26496. // null. It is an error if a field in this list has a non-empty value.
  26497. // This may be used to include null fields in Patch requests.
  26498. NullFields []string `json:"-"`
  26499. }
  26500. func (s *ResourcePolicyDailyCycle) MarshalJSON() ([]byte, error) {
  26501. type NoMethod ResourcePolicyDailyCycle
  26502. raw := NoMethod(*s)
  26503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26504. }
  26505. // ResourcePolicyGroupPlacementPolicy: A GroupPlacementPolicy specifies
  26506. // resource placement configuration. It specifies the failure bucket
  26507. // separation as well as network locality
  26508. type ResourcePolicyGroupPlacementPolicy struct {
  26509. // Locality: Specifies network locality
  26510. //
  26511. // Possible values:
  26512. // "BEST_EFFORT"
  26513. // "STRICT"
  26514. // "UNSPECIFIED_LOCALITY"
  26515. Locality string `json:"locality,omitempty"`
  26516. // Style: Specifies instances to hosts placement relationship
  26517. //
  26518. // Possible values:
  26519. // "COMPACT"
  26520. // "FULLY_SPREAD"
  26521. // "UNSPECIFIED_PLACEMENT_TYPE"
  26522. Style string `json:"style,omitempty"`
  26523. // VmCount: Number of vms in this placement group
  26524. VmCount int64 `json:"vmCount,omitempty"`
  26525. // ForceSendFields is a list of field names (e.g. "Locality") to
  26526. // unconditionally include in API requests. By default, fields with
  26527. // empty values are omitted from API requests. However, any non-pointer,
  26528. // non-interface field appearing in ForceSendFields will be sent to the
  26529. // server regardless of whether the field is empty or not. This may be
  26530. // used to include empty fields in Patch requests.
  26531. ForceSendFields []string `json:"-"`
  26532. // NullFields is a list of field names (e.g. "Locality") to include in
  26533. // API requests with the JSON null value. By default, fields with empty
  26534. // values are omitted from API requests. However, any field with an
  26535. // empty value appearing in NullFields will be sent to the server as
  26536. // null. It is an error if a field in this list has a non-empty value.
  26537. // This may be used to include null fields in Patch requests.
  26538. NullFields []string `json:"-"`
  26539. }
  26540. func (s *ResourcePolicyGroupPlacementPolicy) MarshalJSON() ([]byte, error) {
  26541. type NoMethod ResourcePolicyGroupPlacementPolicy
  26542. raw := NoMethod(*s)
  26543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26544. }
  26545. // ResourcePolicyHourlyCycle: Time window specified for hourly
  26546. // operations.
  26547. type ResourcePolicyHourlyCycle struct {
  26548. // Duration: [Output only] Duration of the time window, automatically
  26549. // chosen to be smallest possible in the given scenario.
  26550. Duration string `json:"duration,omitempty"`
  26551. // HoursInCycle: Allows to define schedule that runs every nth hour.
  26552. HoursInCycle int64 `json:"hoursInCycle,omitempty"`
  26553. // StartTime: Time within the window to start the operations. It must be
  26554. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  26555. StartTime string `json:"startTime,omitempty"`
  26556. // ForceSendFields is a list of field names (e.g. "Duration") to
  26557. // unconditionally include in API requests. By default, fields with
  26558. // empty values are omitted from API requests. However, any non-pointer,
  26559. // non-interface field appearing in ForceSendFields will be sent to the
  26560. // server regardless of whether the field is empty or not. This may be
  26561. // used to include empty fields in Patch requests.
  26562. ForceSendFields []string `json:"-"`
  26563. // NullFields is a list of field names (e.g. "Duration") to include in
  26564. // API requests with the JSON null value. By default, fields with empty
  26565. // values are omitted from API requests. However, any field with an
  26566. // empty value appearing in NullFields will be sent to the server as
  26567. // null. It is an error if a field in this list has a non-empty value.
  26568. // This may be used to include null fields in Patch requests.
  26569. NullFields []string `json:"-"`
  26570. }
  26571. func (s *ResourcePolicyHourlyCycle) MarshalJSON() ([]byte, error) {
  26572. type NoMethod ResourcePolicyHourlyCycle
  26573. raw := NoMethod(*s)
  26574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26575. }
  26576. type ResourcePolicyList struct {
  26577. Etag string `json:"etag,omitempty"`
  26578. // Id: [Output Only] The unique identifier for the resource. This
  26579. // identifier is defined by the server.
  26580. Id string `json:"id,omitempty"`
  26581. // Items: [Output Only] A list of ResourcePolicy resources.
  26582. Items []*ResourcePolicy `json:"items,omitempty"`
  26583. // Kind: [Output Only] Type of resource.Always
  26584. // compute#resourcePoliciesList for listsof resourcePolicies
  26585. Kind string `json:"kind,omitempty"`
  26586. // NextPageToken: [Output Only] This token allows you to get the next
  26587. // page of results for list requests. If the number of results is larger
  26588. // than maxResults, use the nextPageToken as a value for the query
  26589. // parameter pageToken in the next list request. Subsequent list
  26590. // requests will have their own nextPageToken to continue paging through
  26591. // the results.
  26592. NextPageToken string `json:"nextPageToken,omitempty"`
  26593. // SelfLink: [Output Only] Server-defined URL for this resource.
  26594. SelfLink string `json:"selfLink,omitempty"`
  26595. // Warning: [Output Only] Informational warning message.
  26596. Warning *ResourcePolicyListWarning `json:"warning,omitempty"`
  26597. // ServerResponse contains the HTTP response code and headers from the
  26598. // server.
  26599. googleapi.ServerResponse `json:"-"`
  26600. // ForceSendFields is a list of field names (e.g. "Etag") to
  26601. // unconditionally include in API requests. By default, fields with
  26602. // empty values are omitted from API requests. However, any non-pointer,
  26603. // non-interface field appearing in ForceSendFields will be sent to the
  26604. // server regardless of whether the field is empty or not. This may be
  26605. // used to include empty fields in Patch requests.
  26606. ForceSendFields []string `json:"-"`
  26607. // NullFields is a list of field names (e.g. "Etag") to include in API
  26608. // requests with the JSON null value. By default, fields with empty
  26609. // values are omitted from API requests. However, any field with an
  26610. // empty value appearing in NullFields will be sent to the server as
  26611. // null. It is an error if a field in this list has a non-empty value.
  26612. // This may be used to include null fields in Patch requests.
  26613. NullFields []string `json:"-"`
  26614. }
  26615. func (s *ResourcePolicyList) MarshalJSON() ([]byte, error) {
  26616. type NoMethod ResourcePolicyList
  26617. raw := NoMethod(*s)
  26618. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26619. }
  26620. // ResourcePolicyListWarning: [Output Only] Informational warning
  26621. // message.
  26622. type ResourcePolicyListWarning struct {
  26623. // Code: [Output Only] A warning code, if applicable. For example,
  26624. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26625. // the response.
  26626. //
  26627. // Possible values:
  26628. // "CLEANUP_FAILED"
  26629. // "DEPRECATED_RESOURCE_USED"
  26630. // "DEPRECATED_TYPE_USED"
  26631. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26632. // "EXPERIMENTAL_TYPE_USED"
  26633. // "EXTERNAL_API_WARNING"
  26634. // "FIELD_VALUE_OVERRIDEN"
  26635. // "INJECTED_KERNELS_DEPRECATED"
  26636. // "MISSING_TYPE_DEPENDENCY"
  26637. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26638. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26639. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26640. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26641. // "NEXT_HOP_NOT_RUNNING"
  26642. // "NOT_CRITICAL_ERROR"
  26643. // "NO_RESULTS_ON_PAGE"
  26644. // "REQUIRED_TOS_AGREEMENT"
  26645. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26646. // "RESOURCE_NOT_DELETED"
  26647. // "SCHEMA_VALIDATION_IGNORED"
  26648. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26649. // "UNDECLARED_PROPERTIES"
  26650. // "UNREACHABLE"
  26651. Code string `json:"code,omitempty"`
  26652. // Data: [Output Only] Metadata about this warning in key: value format.
  26653. // For example:
  26654. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26655. Data []*ResourcePolicyListWarningData `json:"data,omitempty"`
  26656. // Message: [Output Only] A human-readable description of the warning
  26657. // code.
  26658. Message string `json:"message,omitempty"`
  26659. // ForceSendFields is a list of field names (e.g. "Code") to
  26660. // unconditionally include in API requests. By default, fields with
  26661. // empty values are omitted from API requests. However, any non-pointer,
  26662. // non-interface field appearing in ForceSendFields will be sent to the
  26663. // server regardless of whether the field is empty or not. This may be
  26664. // used to include empty fields in Patch requests.
  26665. ForceSendFields []string `json:"-"`
  26666. // NullFields is a list of field names (e.g. "Code") to include in API
  26667. // requests with the JSON null value. By default, fields with empty
  26668. // values are omitted from API requests. However, any field with an
  26669. // empty value appearing in NullFields will be sent to the server as
  26670. // null. It is an error if a field in this list has a non-empty value.
  26671. // This may be used to include null fields in Patch requests.
  26672. NullFields []string `json:"-"`
  26673. }
  26674. func (s *ResourcePolicyListWarning) MarshalJSON() ([]byte, error) {
  26675. type NoMethod ResourcePolicyListWarning
  26676. raw := NoMethod(*s)
  26677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26678. }
  26679. type ResourcePolicyListWarningData struct {
  26680. // Key: [Output Only] A key that provides more detail on the warning
  26681. // being returned. For example, for warnings where there are no results
  26682. // in a list request for a particular zone, this key might be scope and
  26683. // the key value might be the zone name. Other examples might be a key
  26684. // indicating a deprecated resource and a suggested replacement, or a
  26685. // warning about invalid network settings (for example, if an instance
  26686. // attempts to perform IP forwarding but is not enabled for IP
  26687. // forwarding).
  26688. Key string `json:"key,omitempty"`
  26689. // Value: [Output Only] A warning data value corresponding to the key.
  26690. Value string `json:"value,omitempty"`
  26691. // ForceSendFields is a list of field names (e.g. "Key") to
  26692. // unconditionally include in API requests. By default, fields with
  26693. // empty values are omitted from API requests. However, any non-pointer,
  26694. // non-interface field appearing in ForceSendFields will be sent to the
  26695. // server regardless of whether the field is empty or not. This may be
  26696. // used to include empty fields in Patch requests.
  26697. ForceSendFields []string `json:"-"`
  26698. // NullFields is a list of field names (e.g. "Key") to include in API
  26699. // requests with the JSON null value. By default, fields with empty
  26700. // values are omitted from API requests. However, any field with an
  26701. // empty value appearing in NullFields will be sent to the server as
  26702. // null. It is an error if a field in this list has a non-empty value.
  26703. // This may be used to include null fields in Patch requests.
  26704. NullFields []string `json:"-"`
  26705. }
  26706. func (s *ResourcePolicyListWarningData) MarshalJSON() ([]byte, error) {
  26707. type NoMethod ResourcePolicyListWarningData
  26708. raw := NoMethod(*s)
  26709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26710. }
  26711. // ResourcePolicySnapshotSchedulePolicy: A snapshot schedule policy
  26712. // specifies when and how frequently snapshots are to be created for the
  26713. // target disk. Also specifies how many and how long these scheduled
  26714. // snapshots should be retained.
  26715. type ResourcePolicySnapshotSchedulePolicy struct {
  26716. // RetentionPolicy: Retention policy applied to snapshots created by
  26717. // this resource policy.
  26718. RetentionPolicy *ResourcePolicySnapshotSchedulePolicyRetentionPolicy `json:"retentionPolicy,omitempty"`
  26719. // Schedule: A Vm Maintenance Policy specifies what kind of
  26720. // infrastructure maintenance we are allowed to perform on this VM and
  26721. // when. Schedule that is applied to disks covered by this policy.
  26722. Schedule *ResourcePolicySnapshotSchedulePolicySchedule `json:"schedule,omitempty"`
  26723. // SnapshotProperties: Properties with which snapshots are created such
  26724. // as labels, encryption keys.
  26725. SnapshotProperties *ResourcePolicySnapshotSchedulePolicySnapshotProperties `json:"snapshotProperties,omitempty"`
  26726. // ForceSendFields is a list of field names (e.g. "RetentionPolicy") to
  26727. // unconditionally include in API requests. By default, fields with
  26728. // empty values are omitted from API requests. However, any non-pointer,
  26729. // non-interface field appearing in ForceSendFields will be sent to the
  26730. // server regardless of whether the field is empty or not. This may be
  26731. // used to include empty fields in Patch requests.
  26732. ForceSendFields []string `json:"-"`
  26733. // NullFields is a list of field names (e.g. "RetentionPolicy") to
  26734. // include in API requests with the JSON null value. By default, fields
  26735. // with empty values are omitted from API requests. However, any field
  26736. // with an empty value appearing in NullFields will be sent to the
  26737. // server as null. It is an error if a field in this list has a
  26738. // non-empty value. This may be used to include null fields in Patch
  26739. // requests.
  26740. NullFields []string `json:"-"`
  26741. }
  26742. func (s *ResourcePolicySnapshotSchedulePolicy) MarshalJSON() ([]byte, error) {
  26743. type NoMethod ResourcePolicySnapshotSchedulePolicy
  26744. raw := NoMethod(*s)
  26745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26746. }
  26747. // ResourcePolicySnapshotSchedulePolicyRetentionPolicy: Policy for
  26748. // retention of scheduled snapshots.
  26749. type ResourcePolicySnapshotSchedulePolicyRetentionPolicy struct {
  26750. // MaxRetentionDays: Maximum age of the snapshot that is allowed to be
  26751. // kept.
  26752. MaxRetentionDays int64 `json:"maxRetentionDays,omitempty"`
  26753. // OnPolicySwitch: Specifies the behavior to apply to existing,
  26754. // scheduled snapshots snapshots if the policy is changed.
  26755. //
  26756. // Possible values:
  26757. // "DO_NOT_RETROACTIVELY_APPLY"
  26758. // "RETROACTIVELY_APPLY"
  26759. // "UNSPECIFIED_ON_POLICY_SWITCH"
  26760. OnPolicySwitch string `json:"onPolicySwitch,omitempty"`
  26761. // OnSourceDiskDelete: Specifies the behavior to apply to scheduled
  26762. // snapshots when the source disk is deleted.
  26763. //
  26764. // Possible values:
  26765. // "APPLY_RETENTION_POLICY"
  26766. // "KEEP_AUTO_SNAPSHOTS"
  26767. // "UNSPECIFIED_ON_SOURCE_DISK_DELETE"
  26768. OnSourceDiskDelete string `json:"onSourceDiskDelete,omitempty"`
  26769. // ForceSendFields is a list of field names (e.g. "MaxRetentionDays") to
  26770. // unconditionally include in API requests. By default, fields with
  26771. // empty values are omitted from API requests. However, any non-pointer,
  26772. // non-interface field appearing in ForceSendFields will be sent to the
  26773. // server regardless of whether the field is empty or not. This may be
  26774. // used to include empty fields in Patch requests.
  26775. ForceSendFields []string `json:"-"`
  26776. // NullFields is a list of field names (e.g. "MaxRetentionDays") to
  26777. // include in API requests with the JSON null value. By default, fields
  26778. // with empty values are omitted from API requests. However, any field
  26779. // with an empty value appearing in NullFields will be sent to the
  26780. // server as null. It is an error if a field in this list has a
  26781. // non-empty value. This may be used to include null fields in Patch
  26782. // requests.
  26783. NullFields []string `json:"-"`
  26784. }
  26785. func (s *ResourcePolicySnapshotSchedulePolicyRetentionPolicy) MarshalJSON() ([]byte, error) {
  26786. type NoMethod ResourcePolicySnapshotSchedulePolicyRetentionPolicy
  26787. raw := NoMethod(*s)
  26788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26789. }
  26790. // ResourcePolicySnapshotSchedulePolicySchedule: A schedule for disks
  26791. // where the schedueled operations are performed.
  26792. type ResourcePolicySnapshotSchedulePolicySchedule struct {
  26793. DailySchedule *ResourcePolicyDailyCycle `json:"dailySchedule,omitempty"`
  26794. HourlySchedule *ResourcePolicyHourlyCycle `json:"hourlySchedule,omitempty"`
  26795. WeeklySchedule *ResourcePolicyWeeklyCycle `json:"weeklySchedule,omitempty"`
  26796. // ForceSendFields is a list of field names (e.g. "DailySchedule") to
  26797. // unconditionally include in API requests. By default, fields with
  26798. // empty values are omitted from API requests. However, any non-pointer,
  26799. // non-interface field appearing in ForceSendFields will be sent to the
  26800. // server regardless of whether the field is empty or not. This may be
  26801. // used to include empty fields in Patch requests.
  26802. ForceSendFields []string `json:"-"`
  26803. // NullFields is a list of field names (e.g. "DailySchedule") to include
  26804. // in API requests with the JSON null value. By default, fields with
  26805. // empty values are omitted from API requests. However, any field with
  26806. // an empty value appearing in NullFields will be sent to the server as
  26807. // null. It is an error if a field in this list has a non-empty value.
  26808. // This may be used to include null fields in Patch requests.
  26809. NullFields []string `json:"-"`
  26810. }
  26811. func (s *ResourcePolicySnapshotSchedulePolicySchedule) MarshalJSON() ([]byte, error) {
  26812. type NoMethod ResourcePolicySnapshotSchedulePolicySchedule
  26813. raw := NoMethod(*s)
  26814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26815. }
  26816. // ResourcePolicySnapshotSchedulePolicySnapshotProperties: Specified
  26817. // snapshot properties for scheduled snapshots created by this policy.
  26818. type ResourcePolicySnapshotSchedulePolicySnapshotProperties struct {
  26819. // GuestFlush: Indication to perform a ?guest aware? snapshot.
  26820. GuestFlush bool `json:"guestFlush,omitempty"`
  26821. // Labels: Labels to apply to scheduled snapshots. These can be later
  26822. // modified by the setLabels method. Label values may be empty.
  26823. Labels map[string]string `json:"labels,omitempty"`
  26824. // StorageLocations: GCS bucket storage location of the auto snapshot
  26825. // (regional or multi-regional).
  26826. StorageLocations []string `json:"storageLocations,omitempty"`
  26827. // ForceSendFields is a list of field names (e.g. "GuestFlush") to
  26828. // unconditionally include in API requests. By default, fields with
  26829. // empty values are omitted from API requests. However, any non-pointer,
  26830. // non-interface field appearing in ForceSendFields will be sent to the
  26831. // server regardless of whether the field is empty or not. This may be
  26832. // used to include empty fields in Patch requests.
  26833. ForceSendFields []string `json:"-"`
  26834. // NullFields is a list of field names (e.g. "GuestFlush") to include in
  26835. // API requests with the JSON null value. By default, fields with empty
  26836. // values are omitted from API requests. However, any field with an
  26837. // empty value appearing in NullFields will be sent to the server as
  26838. // null. It is an error if a field in this list has a non-empty value.
  26839. // This may be used to include null fields in Patch requests.
  26840. NullFields []string `json:"-"`
  26841. }
  26842. func (s *ResourcePolicySnapshotSchedulePolicySnapshotProperties) MarshalJSON() ([]byte, error) {
  26843. type NoMethod ResourcePolicySnapshotSchedulePolicySnapshotProperties
  26844. raw := NoMethod(*s)
  26845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26846. }
  26847. type ResourcePolicyVmMaintenancePolicy struct {
  26848. // MaintenanceWindow: Maintenance windows that are applied to VMs
  26849. // covered by this policy.
  26850. MaintenanceWindow *ResourcePolicyVmMaintenancePolicyMaintenanceWindow `json:"maintenanceWindow,omitempty"`
  26851. // ForceSendFields is a list of field names (e.g. "MaintenanceWindow")
  26852. // to unconditionally include in API requests. By default, fields with
  26853. // empty values are omitted from API requests. However, any non-pointer,
  26854. // non-interface field appearing in ForceSendFields will be sent to the
  26855. // server regardless of whether the field is empty or not. This may be
  26856. // used to include empty fields in Patch requests.
  26857. ForceSendFields []string `json:"-"`
  26858. // NullFields is a list of field names (e.g. "MaintenanceWindow") to
  26859. // include in API requests with the JSON null value. By default, fields
  26860. // with empty values are omitted from API requests. However, any field
  26861. // with an empty value appearing in NullFields will be sent to the
  26862. // server as null. It is an error if a field in this list has a
  26863. // non-empty value. This may be used to include null fields in Patch
  26864. // requests.
  26865. NullFields []string `json:"-"`
  26866. }
  26867. func (s *ResourcePolicyVmMaintenancePolicy) MarshalJSON() ([]byte, error) {
  26868. type NoMethod ResourcePolicyVmMaintenancePolicy
  26869. raw := NoMethod(*s)
  26870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26871. }
  26872. // ResourcePolicyVmMaintenancePolicyMaintenanceWindow: A maintenance
  26873. // window for VMs. When set, we restrict our maintenance operations to
  26874. // this window.
  26875. type ResourcePolicyVmMaintenancePolicyMaintenanceWindow struct {
  26876. DailyMaintenanceWindow *ResourcePolicyDailyCycle `json:"dailyMaintenanceWindow,omitempty"`
  26877. // ForceSendFields is a list of field names (e.g.
  26878. // "DailyMaintenanceWindow") to unconditionally include in API requests.
  26879. // By default, fields with empty values are omitted from API requests.
  26880. // However, any non-pointer, non-interface field appearing in
  26881. // ForceSendFields will be sent to the server regardless of whether the
  26882. // field is empty or not. This may be used to include empty fields in
  26883. // Patch requests.
  26884. ForceSendFields []string `json:"-"`
  26885. // NullFields is a list of field names (e.g. "DailyMaintenanceWindow")
  26886. // to include in API requests with the JSON null value. By default,
  26887. // fields with empty values are omitted from API requests. However, any
  26888. // field with an empty value appearing in NullFields will be sent to the
  26889. // server as null. It is an error if a field in this list has a
  26890. // non-empty value. This may be used to include null fields in Patch
  26891. // requests.
  26892. NullFields []string `json:"-"`
  26893. }
  26894. func (s *ResourcePolicyVmMaintenancePolicyMaintenanceWindow) MarshalJSON() ([]byte, error) {
  26895. type NoMethod ResourcePolicyVmMaintenancePolicyMaintenanceWindow
  26896. raw := NoMethod(*s)
  26897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26898. }
  26899. // ResourcePolicyWeeklyCycle: Time window specified for weekly
  26900. // operations.
  26901. type ResourcePolicyWeeklyCycle struct {
  26902. // DayOfWeeks: Up to 7 intervals/windows, one for each day of the week.
  26903. DayOfWeeks []*ResourcePolicyWeeklyCycleDayOfWeek `json:"dayOfWeeks,omitempty"`
  26904. // ForceSendFields is a list of field names (e.g. "DayOfWeeks") 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. "DayOfWeeks") 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 *ResourcePolicyWeeklyCycle) MarshalJSON() ([]byte, error) {
  26920. type NoMethod ResourcePolicyWeeklyCycle
  26921. raw := NoMethod(*s)
  26922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26923. }
  26924. type ResourcePolicyWeeklyCycleDayOfWeek struct {
  26925. // Day: Allows to define schedule that runs specified day of the week.
  26926. //
  26927. // Possible values:
  26928. // "FRIDAY"
  26929. // "INVALID"
  26930. // "MONDAY"
  26931. // "SATURDAY"
  26932. // "SUNDAY"
  26933. // "THURSDAY"
  26934. // "TUESDAY"
  26935. // "WEDNESDAY"
  26936. Day string `json:"day,omitempty"`
  26937. // Duration: [Output only] Duration of the time window, automatically
  26938. // chosen to be smallest possible in the given scenario.
  26939. Duration string `json:"duration,omitempty"`
  26940. // StartTime: Time within the window to start the operations. It must be
  26941. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  26942. StartTime string `json:"startTime,omitempty"`
  26943. // ForceSendFields is a list of field names (e.g. "Day") to
  26944. // unconditionally include in API requests. By default, fields with
  26945. // empty values are omitted from API requests. However, any non-pointer,
  26946. // non-interface field appearing in ForceSendFields will be sent to the
  26947. // server regardless of whether the field is empty or not. This may be
  26948. // used to include empty fields in Patch requests.
  26949. ForceSendFields []string `json:"-"`
  26950. // NullFields is a list of field names (e.g. "Day") to include in API
  26951. // requests with the JSON null value. By default, fields with empty
  26952. // values are omitted from API requests. However, any field with an
  26953. // empty value appearing in NullFields will be sent to the server as
  26954. // null. It is an error if a field in this list has a non-empty value.
  26955. // This may be used to include null fields in Patch requests.
  26956. NullFields []string `json:"-"`
  26957. }
  26958. func (s *ResourcePolicyWeeklyCycleDayOfWeek) MarshalJSON() ([]byte, error) {
  26959. type NoMethod ResourcePolicyWeeklyCycleDayOfWeek
  26960. raw := NoMethod(*s)
  26961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26962. }
  26963. // Route: Represents a Route resource. A route specifies how certain
  26964. // packets should be handled by the network. Routes are associated with
  26965. // instances by tags and the set of routes for a particular instance is
  26966. // called its routing table.
  26967. //
  26968. // For each packet leaving an instance, the system searches that
  26969. // instance's routing table for a single best matching route. Routes
  26970. // match packets by destination IP address, preferring smaller or more
  26971. // specific ranges over larger ones. If there is a tie, the system
  26972. // selects the route with the smallest priority value. If there is still
  26973. // a tie, it uses the layer three and four packet headers to select just
  26974. // one of the remaining matching routes. The packet is then forwarded as
  26975. // specified by the nextHop field of the winning route - either to
  26976. // another instance destination, an instance gateway, or a Google
  26977. // Compute Engine-operated gateway.
  26978. //
  26979. // Packets that do not match any route in the sending instance's routing
  26980. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  26981. // v1.routes ==)
  26982. type Route struct {
  26983. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26984. // format.
  26985. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26986. // Description: An optional description of this resource. Provide this
  26987. // property when you create the resource.
  26988. Description string `json:"description,omitempty"`
  26989. // DestRange: The destination range of outgoing packets that this route
  26990. // applies to. Only IPv4 is supported.
  26991. DestRange string `json:"destRange,omitempty"`
  26992. // Id: [Output Only] The unique identifier for the resource. This
  26993. // identifier is defined by the server.
  26994. Id uint64 `json:"id,omitempty,string"`
  26995. // Kind: [Output Only] Type of this resource. Always compute#routes for
  26996. // Route resources.
  26997. Kind string `json:"kind,omitempty"`
  26998. // Name: Name of the resource. Provided by the client when the resource
  26999. // is created. The name must be 1-63 characters long, and comply with
  27000. // RFC1035. Specifically, the name must be 1-63 characters long and
  27001. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  27002. // the first character must be a lowercase letter, and all following
  27003. // characters must be a dash, lowercase letter, or digit, except the
  27004. // last character, which cannot be a dash.
  27005. Name string `json:"name,omitempty"`
  27006. // Network: Fully-qualified URL of the network that this route applies
  27007. // to.
  27008. Network string `json:"network,omitempty"`
  27009. // NextHopGateway: The URL to a gateway that should handle matching
  27010. // packets. You can only specify the internet gateway using a full or
  27011. // partial valid URL:
  27012. // projects/<project-id>/global/gateways/default-internet-gateway
  27013. NextHopGateway string `json:"nextHopGateway,omitempty"`
  27014. // NextHopIlb: The URL to a forwarding rule of type
  27015. // loadBalancingScheme=INTERNAL that should handle matching packets. You
  27016. // can only specify the forwarding rule as a partial or full URL. For
  27017. // example, the following are all valid URLs:
  27018. // -
  27019. // https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule
  27020. // - regions/region/forwardingRules/forwardingRule Note that this can
  27021. // only be used when the destination_range is a public (non-RFC 1918) IP
  27022. // CIDR range.
  27023. NextHopIlb string `json:"nextHopIlb,omitempty"`
  27024. // NextHopInstance: The URL to an instance that should handle matching
  27025. // packets. You can specify this as a full or partial URL. For
  27026. // example:
  27027. // https://www.googleapis.com/compute/v1/projects/project/zones/
  27028. // zone/instances/
  27029. NextHopInstance string `json:"nextHopInstance,omitempty"`
  27030. // NextHopInterconnectAttachment: [Output Only] The URL to an
  27031. // InterconnectAttachment which is the next hop for the route. This
  27032. // field will only be populated for the dynamic routes generated by
  27033. // Cloud Router with a linked interconnectAttachment.
  27034. NextHopInterconnectAttachment string `json:"nextHopInterconnectAttachment,omitempty"`
  27035. // NextHopIp: The network IP address of an instance that should handle
  27036. // matching packets. Only IPv4 is supported.
  27037. NextHopIp string `json:"nextHopIp,omitempty"`
  27038. // NextHopNetwork: The URL of the local network if it should handle
  27039. // matching packets.
  27040. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  27041. // NextHopPeering: [Output Only] The network peering name that should
  27042. // handle matching packets, which should conform to RFC1035.
  27043. NextHopPeering string `json:"nextHopPeering,omitempty"`
  27044. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  27045. // packets.
  27046. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  27047. // Priority: The priority of this route. Priority is used to break ties
  27048. // in cases where there is more than one matching route of equal prefix
  27049. // length. In the case of two routes with equal prefix length, the one
  27050. // with the lowest-numbered priority value wins. Default value is 1000.
  27051. // Valid range is 0 through 65535.
  27052. Priority int64 `json:"priority,omitempty"`
  27053. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  27054. // resource.
  27055. SelfLink string `json:"selfLink,omitempty"`
  27056. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  27057. // with the resource id.
  27058. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  27059. // Tags: A list of instance tags to which this route applies.
  27060. Tags []string `json:"tags,omitempty"`
  27061. // Warnings: [Output Only] If potential misconfigurations are detected
  27062. // for this route, this field will be populated with warning messages.
  27063. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  27064. // ServerResponse contains the HTTP response code and headers from the
  27065. // server.
  27066. googleapi.ServerResponse `json:"-"`
  27067. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  27068. // to unconditionally include in API requests. By default, fields with
  27069. // empty values are omitted from API requests. However, any non-pointer,
  27070. // non-interface field appearing in ForceSendFields will be sent to the
  27071. // server regardless of whether the field is empty or not. This may be
  27072. // used to include empty fields in Patch requests.
  27073. ForceSendFields []string `json:"-"`
  27074. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  27075. // include in API requests with the JSON null value. By default, fields
  27076. // with empty values are omitted from API requests. However, any field
  27077. // with an empty value appearing in NullFields will be sent to the
  27078. // server as null. It is an error if a field in this list has a
  27079. // non-empty value. This may be used to include null fields in Patch
  27080. // requests.
  27081. NullFields []string `json:"-"`
  27082. }
  27083. func (s *Route) MarshalJSON() ([]byte, error) {
  27084. type NoMethod Route
  27085. raw := NoMethod(*s)
  27086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27087. }
  27088. type RouteWarnings struct {
  27089. // Code: [Output Only] A warning code, if applicable. For example,
  27090. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27091. // the response.
  27092. //
  27093. // Possible values:
  27094. // "CLEANUP_FAILED"
  27095. // "DEPRECATED_RESOURCE_USED"
  27096. // "DEPRECATED_TYPE_USED"
  27097. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27098. // "EXPERIMENTAL_TYPE_USED"
  27099. // "EXTERNAL_API_WARNING"
  27100. // "FIELD_VALUE_OVERRIDEN"
  27101. // "INJECTED_KERNELS_DEPRECATED"
  27102. // "MISSING_TYPE_DEPENDENCY"
  27103. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27104. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27105. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27106. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27107. // "NEXT_HOP_NOT_RUNNING"
  27108. // "NOT_CRITICAL_ERROR"
  27109. // "NO_RESULTS_ON_PAGE"
  27110. // "REQUIRED_TOS_AGREEMENT"
  27111. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27112. // "RESOURCE_NOT_DELETED"
  27113. // "SCHEMA_VALIDATION_IGNORED"
  27114. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27115. // "UNDECLARED_PROPERTIES"
  27116. // "UNREACHABLE"
  27117. Code string `json:"code,omitempty"`
  27118. // Data: [Output Only] Metadata about this warning in key: value format.
  27119. // For example:
  27120. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27121. Data []*RouteWarningsData `json:"data,omitempty"`
  27122. // Message: [Output Only] A human-readable description of the warning
  27123. // code.
  27124. Message string `json:"message,omitempty"`
  27125. // ForceSendFields is a list of field names (e.g. "Code") to
  27126. // unconditionally include in API requests. By default, fields with
  27127. // empty values are omitted from API requests. However, any non-pointer,
  27128. // non-interface field appearing in ForceSendFields will be sent to the
  27129. // server regardless of whether the field is empty or not. This may be
  27130. // used to include empty fields in Patch requests.
  27131. ForceSendFields []string `json:"-"`
  27132. // NullFields is a list of field names (e.g. "Code") to include in API
  27133. // requests with the JSON null value. By default, fields with empty
  27134. // values are omitted from API requests. However, any field with an
  27135. // empty value appearing in NullFields will be sent to the server as
  27136. // null. It is an error if a field in this list has a non-empty value.
  27137. // This may be used to include null fields in Patch requests.
  27138. NullFields []string `json:"-"`
  27139. }
  27140. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  27141. type NoMethod RouteWarnings
  27142. raw := NoMethod(*s)
  27143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27144. }
  27145. type RouteWarningsData struct {
  27146. // Key: [Output Only] A key that provides more detail on the warning
  27147. // being returned. For example, for warnings where there are no results
  27148. // in a list request for a particular zone, this key might be scope and
  27149. // the key value might be the zone name. Other examples might be a key
  27150. // indicating a deprecated resource and a suggested replacement, or a
  27151. // warning about invalid network settings (for example, if an instance
  27152. // attempts to perform IP forwarding but is not enabled for IP
  27153. // forwarding).
  27154. Key string `json:"key,omitempty"`
  27155. // Value: [Output Only] A warning data value corresponding to the key.
  27156. Value string `json:"value,omitempty"`
  27157. // ForceSendFields is a list of field names (e.g. "Key") to
  27158. // unconditionally include in API requests. By default, fields with
  27159. // empty values are omitted from API requests. However, any non-pointer,
  27160. // non-interface field appearing in ForceSendFields will be sent to the
  27161. // server regardless of whether the field is empty or not. This may be
  27162. // used to include empty fields in Patch requests.
  27163. ForceSendFields []string `json:"-"`
  27164. // NullFields is a list of field names (e.g. "Key") to include in API
  27165. // requests with the JSON null value. By default, fields with empty
  27166. // values are omitted from API requests. However, any field with an
  27167. // empty value appearing in NullFields will be sent to the server as
  27168. // null. It is an error if a field in this list has a non-empty value.
  27169. // This may be used to include null fields in Patch requests.
  27170. NullFields []string `json:"-"`
  27171. }
  27172. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  27173. type NoMethod RouteWarningsData
  27174. raw := NoMethod(*s)
  27175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27176. }
  27177. // RouteList: Contains a list of Route resources.
  27178. type RouteList struct {
  27179. // Id: [Output Only] Unique identifier for the resource; defined by the
  27180. // server.
  27181. Id string `json:"id,omitempty"`
  27182. // Items: A list of Route resources.
  27183. Items []*Route `json:"items,omitempty"`
  27184. // Kind: Type of resource.
  27185. Kind string `json:"kind,omitempty"`
  27186. // NextPageToken: [Output Only] This token allows you to get the next
  27187. // page of results for list requests. If the number of results is larger
  27188. // than maxResults, use the nextPageToken as a value for the query
  27189. // parameter pageToken in the next list request. Subsequent list
  27190. // requests will have their own nextPageToken to continue paging through
  27191. // the results.
  27192. NextPageToken string `json:"nextPageToken,omitempty"`
  27193. // SelfLink: [Output Only] Server-defined URL for this resource.
  27194. SelfLink string `json:"selfLink,omitempty"`
  27195. // Warning: [Output Only] Informational warning message.
  27196. Warning *RouteListWarning `json:"warning,omitempty"`
  27197. // ServerResponse contains the HTTP response code and headers from the
  27198. // server.
  27199. googleapi.ServerResponse `json:"-"`
  27200. // ForceSendFields is a list of field names (e.g. "Id") to
  27201. // unconditionally include in API requests. By default, fields with
  27202. // empty values are omitted from API requests. However, any non-pointer,
  27203. // non-interface field appearing in ForceSendFields will be sent to the
  27204. // server regardless of whether the field is empty or not. This may be
  27205. // used to include empty fields in Patch requests.
  27206. ForceSendFields []string `json:"-"`
  27207. // NullFields is a list of field names (e.g. "Id") to include in API
  27208. // requests with the JSON null value. By default, fields with empty
  27209. // values are omitted from API requests. However, any field with an
  27210. // empty value appearing in NullFields will be sent to the server as
  27211. // null. It is an error if a field in this list has a non-empty value.
  27212. // This may be used to include null fields in Patch requests.
  27213. NullFields []string `json:"-"`
  27214. }
  27215. func (s *RouteList) MarshalJSON() ([]byte, error) {
  27216. type NoMethod RouteList
  27217. raw := NoMethod(*s)
  27218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27219. }
  27220. // RouteListWarning: [Output Only] Informational warning message.
  27221. type RouteListWarning struct {
  27222. // Code: [Output Only] A warning code, if applicable. For example,
  27223. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27224. // the response.
  27225. //
  27226. // Possible values:
  27227. // "CLEANUP_FAILED"
  27228. // "DEPRECATED_RESOURCE_USED"
  27229. // "DEPRECATED_TYPE_USED"
  27230. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27231. // "EXPERIMENTAL_TYPE_USED"
  27232. // "EXTERNAL_API_WARNING"
  27233. // "FIELD_VALUE_OVERRIDEN"
  27234. // "INJECTED_KERNELS_DEPRECATED"
  27235. // "MISSING_TYPE_DEPENDENCY"
  27236. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27237. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27238. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27239. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27240. // "NEXT_HOP_NOT_RUNNING"
  27241. // "NOT_CRITICAL_ERROR"
  27242. // "NO_RESULTS_ON_PAGE"
  27243. // "REQUIRED_TOS_AGREEMENT"
  27244. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27245. // "RESOURCE_NOT_DELETED"
  27246. // "SCHEMA_VALIDATION_IGNORED"
  27247. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27248. // "UNDECLARED_PROPERTIES"
  27249. // "UNREACHABLE"
  27250. Code string `json:"code,omitempty"`
  27251. // Data: [Output Only] Metadata about this warning in key: value format.
  27252. // For example:
  27253. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27254. Data []*RouteListWarningData `json:"data,omitempty"`
  27255. // Message: [Output Only] A human-readable description of the warning
  27256. // code.
  27257. Message string `json:"message,omitempty"`
  27258. // ForceSendFields is a list of field names (e.g. "Code") to
  27259. // unconditionally include in API requests. By default, fields with
  27260. // empty values are omitted from API requests. However, any non-pointer,
  27261. // non-interface field appearing in ForceSendFields will be sent to the
  27262. // server regardless of whether the field is empty or not. This may be
  27263. // used to include empty fields in Patch requests.
  27264. ForceSendFields []string `json:"-"`
  27265. // NullFields is a list of field names (e.g. "Code") to include in API
  27266. // requests with the JSON null value. By default, fields with empty
  27267. // values are omitted from API requests. However, any field with an
  27268. // empty value appearing in NullFields will be sent to the server as
  27269. // null. It is an error if a field in this list has a non-empty value.
  27270. // This may be used to include null fields in Patch requests.
  27271. NullFields []string `json:"-"`
  27272. }
  27273. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  27274. type NoMethod RouteListWarning
  27275. raw := NoMethod(*s)
  27276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27277. }
  27278. type RouteListWarningData struct {
  27279. // Key: [Output Only] A key that provides more detail on the warning
  27280. // being returned. For example, for warnings where there are no results
  27281. // in a list request for a particular zone, this key might be scope and
  27282. // the key value might be the zone name. Other examples might be a key
  27283. // indicating a deprecated resource and a suggested replacement, or a
  27284. // warning about invalid network settings (for example, if an instance
  27285. // attempts to perform IP forwarding but is not enabled for IP
  27286. // forwarding).
  27287. Key string `json:"key,omitempty"`
  27288. // Value: [Output Only] A warning data value corresponding to the key.
  27289. Value string `json:"value,omitempty"`
  27290. // ForceSendFields is a list of field names (e.g. "Key") to
  27291. // unconditionally include in API requests. By default, fields with
  27292. // empty values are omitted from API requests. However, any non-pointer,
  27293. // non-interface field appearing in ForceSendFields will be sent to the
  27294. // server regardless of whether the field is empty or not. This may be
  27295. // used to include empty fields in Patch requests.
  27296. ForceSendFields []string `json:"-"`
  27297. // NullFields is a list of field names (e.g. "Key") to include in API
  27298. // requests with the JSON null value. By default, fields with empty
  27299. // values are omitted from API requests. However, any field with an
  27300. // empty value appearing in NullFields will be sent to the server as
  27301. // null. It is an error if a field in this list has a non-empty value.
  27302. // This may be used to include null fields in Patch requests.
  27303. NullFields []string `json:"-"`
  27304. }
  27305. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  27306. type NoMethod RouteListWarningData
  27307. raw := NoMethod(*s)
  27308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27309. }
  27310. // Router: Router resource.
  27311. type Router struct {
  27312. // Bgp: BGP information specific to this router.
  27313. Bgp *RouterBgp `json:"bgp,omitempty"`
  27314. // BgpPeers: BGP information that must be configured into the routing
  27315. // stack to establish BGP peering. This information must specify the
  27316. // peer ASN and either the interface name, IP address, or peer IP
  27317. // address. Please refer to RFC4273.
  27318. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  27319. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  27320. // format.
  27321. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  27322. // Description: An optional description of this resource. Provide this
  27323. // property when you create the resource.
  27324. Description string `json:"description,omitempty"`
  27325. // Id: [Output Only] The unique identifier for the resource. This
  27326. // identifier is defined by the server.
  27327. Id uint64 `json:"id,omitempty,string"`
  27328. // Interfaces: Router interfaces. Each interface requires either one
  27329. // linked resource, (for example, linkedVpnTunnel), or IP address and IP
  27330. // address range (for example, ipRange), or both.
  27331. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  27332. // Kind: [Output Only] Type of resource. Always compute#router for
  27333. // routers.
  27334. Kind string `json:"kind,omitempty"`
  27335. // Name: Name of the resource. Provided by the client when the resource
  27336. // is created. The name must be 1-63 characters long, and comply with
  27337. // RFC1035. Specifically, the name must be 1-63 characters long and
  27338. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  27339. // the first character must be a lowercase letter, and all following
  27340. // characters must be a dash, lowercase letter, or digit, except the
  27341. // last character, which cannot be a dash.
  27342. Name string `json:"name,omitempty"`
  27343. // Nats: A list of NAT services created in this router.
  27344. Nats []*RouterNat `json:"nats,omitempty"`
  27345. // Network: URI of the network to which this router belongs.
  27346. Network string `json:"network,omitempty"`
  27347. // Region: [Output Only] URI of the region where the router resides. You
  27348. // must specify this field as part of the HTTP request URL. It is not
  27349. // settable as a field in the request body.
  27350. Region string `json:"region,omitempty"`
  27351. // SelfLink: [Output Only] Server-defined URL for the resource.
  27352. SelfLink string `json:"selfLink,omitempty"`
  27353. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  27354. // with the resource id.
  27355. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  27356. // ServerResponse contains the HTTP response code and headers from the
  27357. // server.
  27358. googleapi.ServerResponse `json:"-"`
  27359. // ForceSendFields is a list of field names (e.g. "Bgp") to
  27360. // unconditionally include in API requests. By default, fields with
  27361. // empty values are omitted from API requests. However, any non-pointer,
  27362. // non-interface field appearing in ForceSendFields will be sent to the
  27363. // server regardless of whether the field is empty or not. This may be
  27364. // used to include empty fields in Patch requests.
  27365. ForceSendFields []string `json:"-"`
  27366. // NullFields is a list of field names (e.g. "Bgp") to include in API
  27367. // requests with the JSON null value. By default, fields with empty
  27368. // values are omitted from API requests. However, any field with an
  27369. // empty value appearing in NullFields will be sent to the server as
  27370. // null. It is an error if a field in this list has a non-empty value.
  27371. // This may be used to include null fields in Patch requests.
  27372. NullFields []string `json:"-"`
  27373. }
  27374. func (s *Router) MarshalJSON() ([]byte, error) {
  27375. type NoMethod Router
  27376. raw := NoMethod(*s)
  27377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27378. }
  27379. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  27380. // to advertise.
  27381. type RouterAdvertisedIpRange struct {
  27382. // Description: User-specified description for the IP range.
  27383. Description string `json:"description,omitempty"`
  27384. // Range: The IP range to advertise. The value must be a CIDR-formatted
  27385. // string.
  27386. Range string `json:"range,omitempty"`
  27387. // ForceSendFields is a list of field names (e.g. "Description") to
  27388. // unconditionally include in API requests. By default, fields with
  27389. // empty values are omitted from API requests. However, any non-pointer,
  27390. // non-interface field appearing in ForceSendFields will be sent to the
  27391. // server regardless of whether the field is empty or not. This may be
  27392. // used to include empty fields in Patch requests.
  27393. ForceSendFields []string `json:"-"`
  27394. // NullFields is a list of field names (e.g. "Description") to include
  27395. // in API requests with the JSON null value. By default, fields with
  27396. // empty values are omitted from API requests. However, any field with
  27397. // an empty value appearing in NullFields will be sent to the server as
  27398. // null. It is an error if a field in this list has a non-empty value.
  27399. // This may be used to include null fields in Patch requests.
  27400. NullFields []string `json:"-"`
  27401. }
  27402. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  27403. type NoMethod RouterAdvertisedIpRange
  27404. raw := NoMethod(*s)
  27405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27406. }
  27407. // RouterAggregatedList: Contains a list of routers.
  27408. type RouterAggregatedList struct {
  27409. // Id: [Output Only] Unique identifier for the resource; defined by the
  27410. // server.
  27411. Id string `json:"id,omitempty"`
  27412. // Items: A list of Router resources.
  27413. Items map[string]RoutersScopedList `json:"items,omitempty"`
  27414. // Kind: Type of resource.
  27415. Kind string `json:"kind,omitempty"`
  27416. // NextPageToken: [Output Only] This token allows you to get the next
  27417. // page of results for list requests. If the number of results is larger
  27418. // than maxResults, use the nextPageToken as a value for the query
  27419. // parameter pageToken in the next list request. Subsequent list
  27420. // requests will have their own nextPageToken to continue paging through
  27421. // the results.
  27422. NextPageToken string `json:"nextPageToken,omitempty"`
  27423. // SelfLink: [Output Only] Server-defined URL for this resource.
  27424. SelfLink string `json:"selfLink,omitempty"`
  27425. // Warning: [Output Only] Informational warning message.
  27426. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  27427. // ServerResponse contains the HTTP response code and headers from the
  27428. // server.
  27429. googleapi.ServerResponse `json:"-"`
  27430. // ForceSendFields is a list of field names (e.g. "Id") to
  27431. // unconditionally include in API requests. By default, fields with
  27432. // empty values are omitted from API requests. However, any non-pointer,
  27433. // non-interface field appearing in ForceSendFields will be sent to the
  27434. // server regardless of whether the field is empty or not. This may be
  27435. // used to include empty fields in Patch requests.
  27436. ForceSendFields []string `json:"-"`
  27437. // NullFields is a list of field names (e.g. "Id") to include in API
  27438. // requests with the JSON null value. By default, fields with empty
  27439. // values are omitted from API requests. However, any field with an
  27440. // empty value appearing in NullFields will be sent to the server as
  27441. // null. It is an error if a field in this list has a non-empty value.
  27442. // This may be used to include null fields in Patch requests.
  27443. NullFields []string `json:"-"`
  27444. }
  27445. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  27446. type NoMethod RouterAggregatedList
  27447. raw := NoMethod(*s)
  27448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27449. }
  27450. // RouterAggregatedListWarning: [Output Only] Informational warning
  27451. // message.
  27452. type RouterAggregatedListWarning struct {
  27453. // Code: [Output Only] A warning code, if applicable. For example,
  27454. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27455. // the response.
  27456. //
  27457. // Possible values:
  27458. // "CLEANUP_FAILED"
  27459. // "DEPRECATED_RESOURCE_USED"
  27460. // "DEPRECATED_TYPE_USED"
  27461. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27462. // "EXPERIMENTAL_TYPE_USED"
  27463. // "EXTERNAL_API_WARNING"
  27464. // "FIELD_VALUE_OVERRIDEN"
  27465. // "INJECTED_KERNELS_DEPRECATED"
  27466. // "MISSING_TYPE_DEPENDENCY"
  27467. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27468. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27469. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27470. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27471. // "NEXT_HOP_NOT_RUNNING"
  27472. // "NOT_CRITICAL_ERROR"
  27473. // "NO_RESULTS_ON_PAGE"
  27474. // "REQUIRED_TOS_AGREEMENT"
  27475. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27476. // "RESOURCE_NOT_DELETED"
  27477. // "SCHEMA_VALIDATION_IGNORED"
  27478. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27479. // "UNDECLARED_PROPERTIES"
  27480. // "UNREACHABLE"
  27481. Code string `json:"code,omitempty"`
  27482. // Data: [Output Only] Metadata about this warning in key: value format.
  27483. // For example:
  27484. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27485. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  27486. // Message: [Output Only] A human-readable description of the warning
  27487. // code.
  27488. Message string `json:"message,omitempty"`
  27489. // ForceSendFields is a list of field names (e.g. "Code") to
  27490. // unconditionally include in API requests. By default, fields with
  27491. // empty values are omitted from API requests. However, any non-pointer,
  27492. // non-interface field appearing in ForceSendFields will be sent to the
  27493. // server regardless of whether the field is empty or not. This may be
  27494. // used to include empty fields in Patch requests.
  27495. ForceSendFields []string `json:"-"`
  27496. // NullFields is a list of field names (e.g. "Code") to include in API
  27497. // requests with the JSON null value. By default, fields with empty
  27498. // values are omitted from API requests. However, any field with an
  27499. // empty value appearing in NullFields will be sent to the server as
  27500. // null. It is an error if a field in this list has a non-empty value.
  27501. // This may be used to include null fields in Patch requests.
  27502. NullFields []string `json:"-"`
  27503. }
  27504. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  27505. type NoMethod RouterAggregatedListWarning
  27506. raw := NoMethod(*s)
  27507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27508. }
  27509. type RouterAggregatedListWarningData struct {
  27510. // Key: [Output Only] A key that provides more detail on the warning
  27511. // being returned. For example, for warnings where there are no results
  27512. // in a list request for a particular zone, this key might be scope and
  27513. // the key value might be the zone name. Other examples might be a key
  27514. // indicating a deprecated resource and a suggested replacement, or a
  27515. // warning about invalid network settings (for example, if an instance
  27516. // attempts to perform IP forwarding but is not enabled for IP
  27517. // forwarding).
  27518. Key string `json:"key,omitempty"`
  27519. // Value: [Output Only] A warning data value corresponding to the key.
  27520. Value string `json:"value,omitempty"`
  27521. // ForceSendFields is a list of field names (e.g. "Key") to
  27522. // unconditionally include in API requests. By default, fields with
  27523. // empty values are omitted from API requests. However, any non-pointer,
  27524. // non-interface field appearing in ForceSendFields will be sent to the
  27525. // server regardless of whether the field is empty or not. This may be
  27526. // used to include empty fields in Patch requests.
  27527. ForceSendFields []string `json:"-"`
  27528. // NullFields is a list of field names (e.g. "Key") to include in API
  27529. // requests with the JSON null value. By default, fields with empty
  27530. // values are omitted from API requests. However, any field with an
  27531. // empty value appearing in NullFields will be sent to the server as
  27532. // null. It is an error if a field in this list has a non-empty value.
  27533. // This may be used to include null fields in Patch requests.
  27534. NullFields []string `json:"-"`
  27535. }
  27536. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  27537. type NoMethod RouterAggregatedListWarningData
  27538. raw := NoMethod(*s)
  27539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27540. }
  27541. type RouterBgp struct {
  27542. // AdvertiseMode: User-specified flag to indicate which mode to use for
  27543. // advertisement. The options are DEFAULT or CUSTOM.
  27544. //
  27545. // Possible values:
  27546. // "CUSTOM"
  27547. // "DEFAULT"
  27548. AdvertiseMode string `json:"advertiseMode,omitempty"`
  27549. // AdvertisedGroups: User-specified list of prefix groups to advertise
  27550. // in custom mode. This field can only be populated if advertise_mode is
  27551. // CUSTOM and is advertised to all peers of the router. These groups
  27552. // will be advertised in addition to any specified prefixes. Leave this
  27553. // field blank to advertise no custom groups.
  27554. //
  27555. // Possible values:
  27556. // "ALL_PEER_VPC_SUBNETS"
  27557. // "ALL_SUBNETS"
  27558. // "ALL_VPC_SUBNETS"
  27559. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  27560. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  27561. // advertise in custom mode. This field can only be populated if
  27562. // advertise_mode is CUSTOM and is advertised to all peers of the
  27563. // router. These IP ranges will be advertised in addition to any
  27564. // specified groups. Leave this field blank to advertise no custom IP
  27565. // ranges.
  27566. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  27567. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  27568. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  27569. // this router resource. All VPN tunnels that link to this router will
  27570. // have the same local ASN.
  27571. Asn int64 `json:"asn,omitempty"`
  27572. // KeepaliveInterval: The interval in seconds between BGP keepalive
  27573. // messages that are sent to the peer. Hold time is three times the
  27574. // interval at which keepalive messages are sent, and the hold time is
  27575. // the maximum number of seconds allowed to elapse between successive
  27576. // keepalive messages that BGP receives from a peer. BGP will use the
  27577. // smaller of either the local hold time value or the peer?s hold time
  27578. // value as the hold time for the BGP connection between the two peers.
  27579. // If set, this value must be between 1 and 120. The default is 20.
  27580. KeepaliveInterval int64 `json:"keepaliveInterval,omitempty"`
  27581. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  27582. // unconditionally include in API requests. By default, fields with
  27583. // empty values are omitted from API requests. However, any non-pointer,
  27584. // non-interface field appearing in ForceSendFields will be sent to the
  27585. // server regardless of whether the field is empty or not. This may be
  27586. // used to include empty fields in Patch requests.
  27587. ForceSendFields []string `json:"-"`
  27588. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  27589. // in API requests with the JSON null value. By default, fields with
  27590. // empty values are omitted from API requests. However, any field with
  27591. // an empty value appearing in NullFields will be sent to the server as
  27592. // null. It is an error if a field in this list has a non-empty value.
  27593. // This may be used to include null fields in Patch requests.
  27594. NullFields []string `json:"-"`
  27595. }
  27596. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  27597. type NoMethod RouterBgp
  27598. raw := NoMethod(*s)
  27599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27600. }
  27601. type RouterBgpPeer struct {
  27602. // AdvertiseMode: User-specified flag to indicate which mode to use for
  27603. // advertisement.
  27604. //
  27605. // Possible values:
  27606. // "CUSTOM"
  27607. // "DEFAULT"
  27608. AdvertiseMode string `json:"advertiseMode,omitempty"`
  27609. // AdvertisedGroups: User-specified list of prefix groups to advertise
  27610. // in custom mode, which can take one of the following options:
  27611. // - ALL_SUBNETS: Advertises all available subnets, including peer VPC
  27612. // subnets.
  27613. // - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets.
  27614. // - ALL_PEER_VPC_SUBNETS: Advertises peer subnets of the router's VPC
  27615. // network. Note that this field can only be populated if advertise_mode
  27616. // is CUSTOM and overrides the list defined for the router (in the "bgp"
  27617. // message). These groups are advertised in addition to any specified
  27618. // prefixes. Leave this field blank to advertise no custom groups.
  27619. //
  27620. // Possible values:
  27621. // "ALL_PEER_VPC_SUBNETS"
  27622. // "ALL_SUBNETS"
  27623. // "ALL_VPC_SUBNETS"
  27624. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  27625. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  27626. // advertise in custom mode. This field can only be populated if
  27627. // advertise_mode is CUSTOM and overrides the list defined for the
  27628. // router (in the "bgp" message). These IP ranges are advertised in
  27629. // addition to any specified groups. Leave this field blank to advertise
  27630. // no custom IP ranges.
  27631. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  27632. // AdvertisedRoutePriority: The priority of routes advertised to this
  27633. // BGP peer. Where there is more than one matching route of maximum
  27634. // length, the routes with the lowest priority value win.
  27635. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  27636. // Bfd: BFD configuration for the BGP peering.
  27637. Bfd *RouterBgpPeerBfd `json:"bfd,omitempty"`
  27638. // Enable: The status of the BGP peer connection. If set to FALSE, any
  27639. // active session with the peer is terminated and all associated routing
  27640. // information is removed. If set to TRUE, the peer connection can be
  27641. // established with routing information. The default is TRUE.
  27642. //
  27643. // Possible values:
  27644. // "FALSE"
  27645. // "TRUE"
  27646. Enable string `json:"enable,omitempty"`
  27647. // InterfaceName: Name of the interface the BGP peer is associated with.
  27648. InterfaceName string `json:"interfaceName,omitempty"`
  27649. // IpAddress: IP address of the interface inside Google Cloud Platform.
  27650. // Only IPv4 is supported.
  27651. IpAddress string `json:"ipAddress,omitempty"`
  27652. // ManagementType: [Output Only] The resource that configures and
  27653. // manages this BGP peer.
  27654. // - MANAGED_BY_USER is the default value and can be managed by you or
  27655. // other users
  27656. // - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed
  27657. // by Cloud Interconnect, specifically by an InterconnectAttachment of
  27658. // type PARTNER. Google automatically creates, updates, and deletes this
  27659. // type of BGP peer when the PARTNER InterconnectAttachment is created,
  27660. // updated, or deleted.
  27661. //
  27662. // Possible values:
  27663. // "MANAGED_BY_ATTACHMENT"
  27664. // "MANAGED_BY_USER"
  27665. ManagementType string `json:"managementType,omitempty"`
  27666. // Name: Name of this BGP peer. The name must be 1-63 characters long
  27667. // and comply with RFC1035.
  27668. Name string `json:"name,omitempty"`
  27669. // PeerAsn: Peer BGP Autonomous System Number (ASN). Each BGP interface
  27670. // may use a different value.
  27671. PeerAsn int64 `json:"peerAsn,omitempty"`
  27672. // PeerIpAddress: IP address of the BGP interface outside Google Cloud
  27673. // Platform. Only IPv4 is supported.
  27674. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  27675. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  27676. // unconditionally include in API requests. By default, fields with
  27677. // empty values are omitted from API requests. However, any non-pointer,
  27678. // non-interface field appearing in ForceSendFields will be sent to the
  27679. // server regardless of whether the field is empty or not. This may be
  27680. // used to include empty fields in Patch requests.
  27681. ForceSendFields []string `json:"-"`
  27682. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  27683. // in API requests with the JSON null value. By default, fields with
  27684. // empty values are omitted from API requests. However, any field with
  27685. // an empty value appearing in NullFields will be sent to the server as
  27686. // null. It is an error if a field in this list has a non-empty value.
  27687. // This may be used to include null fields in Patch requests.
  27688. NullFields []string `json:"-"`
  27689. }
  27690. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  27691. type NoMethod RouterBgpPeer
  27692. raw := NoMethod(*s)
  27693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27694. }
  27695. type RouterBgpPeerBfd struct {
  27696. // MinReceiveInterval: The minimum interval, in milliseconds, between
  27697. // BFD packets received from the peer router. The actual value is
  27698. // negotiated between the two routers and is equal to the greater of
  27699. // this value and the transmit interval of the other router. If BFD echo
  27700. // mode is enabled on this router and the peer router, this value is
  27701. // used to negotiate the interval between BFD echo packets transmitted
  27702. // by the peer router. Otherwise, it will be used to determine the
  27703. // interval between BFD control packets. If set, this value must be
  27704. // between 33 and 30000. The default is 300.
  27705. MinReceiveInterval int64 `json:"minReceiveInterval,omitempty"`
  27706. // MinTransmitInterval: The minimum interval, in milliseconds, between
  27707. // BFD packets transmitted to the peer router. The actual value is
  27708. // negotiated between the two routers and is equal to the greater of
  27709. // this value and the corresponding receive interval of the other
  27710. // router. If BFD echo mode is enabled on this router and the peer
  27711. // router, this value is used to negotiate the interval between BFD echo
  27712. // packets transmitted by this router. Otherwise, it will be used to
  27713. // determine the interval between BFD control packets. If set, this
  27714. // value must be between 33 and 30000. The default is 300.
  27715. MinTransmitInterval int64 `json:"minTransmitInterval,omitempty"`
  27716. // Mode: The BFD session initialization mode for this BGP peer. If set
  27717. // to ACTIVE, the Cloud Router will initiate the BFD session for this
  27718. // BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer
  27719. // router to initiate the BFD session for this BGP peer. If set to
  27720. // DISABLED, BFD is disabled for this BGP peer. The default is PASSIVE.
  27721. //
  27722. // Possible values:
  27723. // "ACTIVE"
  27724. // "DISABLED"
  27725. // "PASSIVE"
  27726. Mode string `json:"mode,omitempty"`
  27727. // Multiplier: The number of consecutive BFD packets that must be missed
  27728. // before BFD declares that a peer is unavailable. If set, the value
  27729. // must be a value between 2 and 16. The default is 3.
  27730. Multiplier int64 `json:"multiplier,omitempty"`
  27731. // PacketMode: The BFD packet mode for this BGP peer. If set to
  27732. // CONTROL_AND_ECHO, BFD echo mode is enabled for this BGP peer. In this
  27733. // mode, if the peer router also has BFD echo mode enabled, BFD echo
  27734. // packets will be sent to the other router. If the peer router does not
  27735. // have BFD echo mode enabled, only control packets will be sent. If set
  27736. // to CONTROL_ONLY, BFD echo mode is disabled for this BGP peer. If this
  27737. // router and the peer router have a multihop connection, this should be
  27738. // set to CONTROL_ONLY as BFD echo mode is only supported on singlehop
  27739. // connections. The default is CONTROL_AND_ECHO.
  27740. //
  27741. // Possible values:
  27742. // "CONTROL_AND_ECHO"
  27743. // "CONTROL_ONLY"
  27744. PacketMode string `json:"packetMode,omitempty"`
  27745. // SessionInitializationMode: The BFD session initialization mode for
  27746. // this BGP peer. If set to ACTIVE, the Cloud Router will initiate the
  27747. // BFD session for this BGP peer. If set to PASSIVE, the Cloud Router
  27748. // will wait for the peer router to initiate the BFD session for this
  27749. // BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. The
  27750. // default is PASSIVE.
  27751. //
  27752. // Possible values:
  27753. // "ACTIVE"
  27754. // "DISABLED"
  27755. // "PASSIVE"
  27756. SessionInitializationMode string `json:"sessionInitializationMode,omitempty"`
  27757. // SlowTimerInterval: The minimum interval, in milliseconds, between BFD
  27758. // control packets transmitted to and received from the peer router when
  27759. // BFD echo mode is enabled on both routers. The actual transmit and
  27760. // receive intervals are negotiated between the two routers and are
  27761. // equal to the greater of this value and the corresponding interval on
  27762. // the other router. If set, this value must be between 1000 and 30000.
  27763. // The default is 5000.
  27764. SlowTimerInterval int64 `json:"slowTimerInterval,omitempty"`
  27765. // ForceSendFields is a list of field names (e.g. "MinReceiveInterval")
  27766. // to unconditionally include in API requests. By default, fields with
  27767. // empty values are omitted from API requests. However, any non-pointer,
  27768. // non-interface field appearing in ForceSendFields will be sent to the
  27769. // server regardless of whether the field is empty or not. This may be
  27770. // used to include empty fields in Patch requests.
  27771. ForceSendFields []string `json:"-"`
  27772. // NullFields is a list of field names (e.g. "MinReceiveInterval") to
  27773. // include in API requests with the JSON null value. By default, fields
  27774. // with empty values are omitted from API requests. However, any field
  27775. // with an empty value appearing in NullFields will be sent to the
  27776. // server as null. It is an error if a field in this list has a
  27777. // non-empty value. This may be used to include null fields in Patch
  27778. // requests.
  27779. NullFields []string `json:"-"`
  27780. }
  27781. func (s *RouterBgpPeerBfd) MarshalJSON() ([]byte, error) {
  27782. type NoMethod RouterBgpPeerBfd
  27783. raw := NoMethod(*s)
  27784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27785. }
  27786. type RouterInterface struct {
  27787. // IpRange: IP address and range of the interface. The IP range must be
  27788. // in the RFC3927 link-local IP address space. The value must be a
  27789. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  27790. // truncate the address as it represents the IP address of the
  27791. // interface.
  27792. IpRange string `json:"ipRange,omitempty"`
  27793. // LinkedInterconnectAttachment: URI of the linked Interconnect
  27794. // attachment. It must be in the same region as the router. Each
  27795. // interface can have one linked resource, which can be either be a VPN
  27796. // tunnel or an Interconnect attachment.
  27797. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  27798. // LinkedVpnTunnel: URI of the linked VPN tunnel, which must be in the
  27799. // same region as the router. Each interface can have one linked
  27800. // resource, which can be either a VPN tunnel or an Interconnect
  27801. // attachment.
  27802. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  27803. // ManagementType: [Output Only] The resource that configures and
  27804. // manages this interface.
  27805. // - MANAGED_BY_USER is the default value and can be managed directly by
  27806. // users.
  27807. // - MANAGED_BY_ATTACHMENT is an interface that is configured and
  27808. // managed by Cloud Interconnect, specifically, by an
  27809. // InterconnectAttachment of type PARTNER. Google automatically creates,
  27810. // updates, and deletes this type of interface when the PARTNER
  27811. // InterconnectAttachment is created, updated, or deleted.
  27812. //
  27813. // Possible values:
  27814. // "MANAGED_BY_ATTACHMENT"
  27815. // "MANAGED_BY_USER"
  27816. ManagementType string `json:"managementType,omitempty"`
  27817. // Name: Name of this interface entry. The name must be 1-63 characters
  27818. // long and comply with RFC1035.
  27819. Name string `json:"name,omitempty"`
  27820. // ForceSendFields is a list of field names (e.g. "IpRange") to
  27821. // unconditionally include in API requests. By default, fields with
  27822. // empty values are omitted from API requests. However, any non-pointer,
  27823. // non-interface field appearing in ForceSendFields will be sent to the
  27824. // server regardless of whether the field is empty or not. This may be
  27825. // used to include empty fields in Patch requests.
  27826. ForceSendFields []string `json:"-"`
  27827. // NullFields is a list of field names (e.g. "IpRange") to include in
  27828. // API requests with the JSON null value. By default, fields with empty
  27829. // values are omitted from API requests. However, any field with an
  27830. // empty value appearing in NullFields will be sent to the server as
  27831. // null. It is an error if a field in this list has a non-empty value.
  27832. // This may be used to include null fields in Patch requests.
  27833. NullFields []string `json:"-"`
  27834. }
  27835. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  27836. type NoMethod RouterInterface
  27837. raw := NoMethod(*s)
  27838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27839. }
  27840. // RouterList: Contains a list of Router resources.
  27841. type RouterList struct {
  27842. // Id: [Output Only] Unique identifier for the resource; defined by the
  27843. // server.
  27844. Id string `json:"id,omitempty"`
  27845. // Items: A list of Router resources.
  27846. Items []*Router `json:"items,omitempty"`
  27847. // Kind: [Output Only] Type of resource. Always compute#router for
  27848. // routers.
  27849. Kind string `json:"kind,omitempty"`
  27850. // NextPageToken: [Output Only] This token allows you to get the next
  27851. // page of results for list requests. If the number of results is larger
  27852. // than maxResults, use the nextPageToken as a value for the query
  27853. // parameter pageToken in the next list request. Subsequent list
  27854. // requests will have their own nextPageToken to continue paging through
  27855. // the results.
  27856. NextPageToken string `json:"nextPageToken,omitempty"`
  27857. // SelfLink: [Output Only] Server-defined URL for this resource.
  27858. SelfLink string `json:"selfLink,omitempty"`
  27859. // Warning: [Output Only] Informational warning message.
  27860. Warning *RouterListWarning `json:"warning,omitempty"`
  27861. // ServerResponse contains the HTTP response code and headers from the
  27862. // server.
  27863. googleapi.ServerResponse `json:"-"`
  27864. // ForceSendFields is a list of field names (e.g. "Id") to
  27865. // unconditionally include in API requests. By default, fields with
  27866. // empty values are omitted from API requests. However, any non-pointer,
  27867. // non-interface field appearing in ForceSendFields will be sent to the
  27868. // server regardless of whether the field is empty or not. This may be
  27869. // used to include empty fields in Patch requests.
  27870. ForceSendFields []string `json:"-"`
  27871. // NullFields is a list of field names (e.g. "Id") to include in API
  27872. // requests with the JSON null value. By default, fields with empty
  27873. // values are omitted from API requests. However, any field with an
  27874. // empty value appearing in NullFields will be sent to the server as
  27875. // null. It is an error if a field in this list has a non-empty value.
  27876. // This may be used to include null fields in Patch requests.
  27877. NullFields []string `json:"-"`
  27878. }
  27879. func (s *RouterList) MarshalJSON() ([]byte, error) {
  27880. type NoMethod RouterList
  27881. raw := NoMethod(*s)
  27882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27883. }
  27884. // RouterListWarning: [Output Only] Informational warning message.
  27885. type RouterListWarning struct {
  27886. // Code: [Output Only] A warning code, if applicable. For example,
  27887. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27888. // the response.
  27889. //
  27890. // Possible values:
  27891. // "CLEANUP_FAILED"
  27892. // "DEPRECATED_RESOURCE_USED"
  27893. // "DEPRECATED_TYPE_USED"
  27894. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27895. // "EXPERIMENTAL_TYPE_USED"
  27896. // "EXTERNAL_API_WARNING"
  27897. // "FIELD_VALUE_OVERRIDEN"
  27898. // "INJECTED_KERNELS_DEPRECATED"
  27899. // "MISSING_TYPE_DEPENDENCY"
  27900. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27901. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27902. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27903. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27904. // "NEXT_HOP_NOT_RUNNING"
  27905. // "NOT_CRITICAL_ERROR"
  27906. // "NO_RESULTS_ON_PAGE"
  27907. // "REQUIRED_TOS_AGREEMENT"
  27908. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27909. // "RESOURCE_NOT_DELETED"
  27910. // "SCHEMA_VALIDATION_IGNORED"
  27911. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27912. // "UNDECLARED_PROPERTIES"
  27913. // "UNREACHABLE"
  27914. Code string `json:"code,omitempty"`
  27915. // Data: [Output Only] Metadata about this warning in key: value format.
  27916. // For example:
  27917. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27918. Data []*RouterListWarningData `json:"data,omitempty"`
  27919. // Message: [Output Only] A human-readable description of the warning
  27920. // code.
  27921. Message string `json:"message,omitempty"`
  27922. // ForceSendFields is a list of field names (e.g. "Code") to
  27923. // unconditionally include in API requests. By default, fields with
  27924. // empty values are omitted from API requests. However, any non-pointer,
  27925. // non-interface field appearing in ForceSendFields will be sent to the
  27926. // server regardless of whether the field is empty or not. This may be
  27927. // used to include empty fields in Patch requests.
  27928. ForceSendFields []string `json:"-"`
  27929. // NullFields is a list of field names (e.g. "Code") to include in API
  27930. // requests with the JSON null value. By default, fields with empty
  27931. // values are omitted from API requests. However, any field with an
  27932. // empty value appearing in NullFields will be sent to the server as
  27933. // null. It is an error if a field in this list has a non-empty value.
  27934. // This may be used to include null fields in Patch requests.
  27935. NullFields []string `json:"-"`
  27936. }
  27937. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  27938. type NoMethod RouterListWarning
  27939. raw := NoMethod(*s)
  27940. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27941. }
  27942. type RouterListWarningData struct {
  27943. // Key: [Output Only] A key that provides more detail on the warning
  27944. // being returned. For example, for warnings where there are no results
  27945. // in a list request for a particular zone, this key might be scope and
  27946. // the key value might be the zone name. Other examples might be a key
  27947. // indicating a deprecated resource and a suggested replacement, or a
  27948. // warning about invalid network settings (for example, if an instance
  27949. // attempts to perform IP forwarding but is not enabled for IP
  27950. // forwarding).
  27951. Key string `json:"key,omitempty"`
  27952. // Value: [Output Only] A warning data value corresponding to the key.
  27953. Value string `json:"value,omitempty"`
  27954. // ForceSendFields is a list of field names (e.g. "Key") to
  27955. // unconditionally include in API requests. By default, fields with
  27956. // empty values are omitted from API requests. However, any non-pointer,
  27957. // non-interface field appearing in ForceSendFields will be sent to the
  27958. // server regardless of whether the field is empty or not. This may be
  27959. // used to include empty fields in Patch requests.
  27960. ForceSendFields []string `json:"-"`
  27961. // NullFields is a list of field names (e.g. "Key") to include in API
  27962. // requests with the JSON null value. By default, fields with empty
  27963. // values are omitted from API requests. However, any field with an
  27964. // empty value appearing in NullFields will be sent to the server as
  27965. // null. It is an error if a field in this list has a non-empty value.
  27966. // This may be used to include null fields in Patch requests.
  27967. NullFields []string `json:"-"`
  27968. }
  27969. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  27970. type NoMethod RouterListWarningData
  27971. raw := NoMethod(*s)
  27972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27973. }
  27974. // RouterNat: Represents a Nat resource. It enables the VMs within the
  27975. // specified subnetworks to access Internet without external IP
  27976. // addresses. It specifies a list of subnetworks (and the ranges within)
  27977. // that want to use NAT. Customers can also provide the external IPs
  27978. // that would be used for NAT. GCP would auto-allocate ephemeral IPs if
  27979. // no external IPs are provided.
  27980. type RouterNat struct {
  27981. // DrainNatIps: A list of URLs of the IP resources to be drained. These
  27982. // IPs must be valid static external IPs that have been assigned to the
  27983. // NAT. These IPs should be used for updating/patching a NAT only.
  27984. DrainNatIps []string `json:"drainNatIps,omitempty"`
  27985. // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections.
  27986. // Defaults to 30s if not set.
  27987. IcmpIdleTimeoutSec int64 `json:"icmpIdleTimeoutSec,omitempty"`
  27988. // LogConfig: Configure logging on this NAT.
  27989. LogConfig *RouterNatLogConfig `json:"logConfig,omitempty"`
  27990. // MinPortsPerVm: Minimum number of ports allocated to a VM from this
  27991. // NAT config. If not set, a default number of ports is allocated to a
  27992. // VM. This is rounded up to the nearest power of 2. For example, if the
  27993. // value of this field is 50, at least 64 ports are allocated to a VM.
  27994. MinPortsPerVm int64 `json:"minPortsPerVm,omitempty"`
  27995. // Name: Unique name of this Nat service. The name must be 1-63
  27996. // characters long and comply with RFC1035.
  27997. Name string `json:"name,omitempty"`
  27998. // NatIpAllocateOption: Specify the NatIpAllocateOption, which can take
  27999. // one of the following values:
  28000. // - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When
  28001. // there are not enough specified Nat IPs, the Nat service fails for new
  28002. // VMs.
  28003. // - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform;
  28004. // customers can't specify any Nat IPs. When choosing AUTO_ONLY, then
  28005. // nat_ip should be empty.
  28006. //
  28007. // Possible values:
  28008. // "AUTO_ONLY"
  28009. // "MANUAL_ONLY"
  28010. NatIpAllocateOption string `json:"natIpAllocateOption,omitempty"`
  28011. // NatIps: A list of URLs of the IP resources used for this Nat service.
  28012. // These IP addresses must be valid static external IP addresses
  28013. // assigned to the project.
  28014. NatIps []string `json:"natIps,omitempty"`
  28015. // SourceSubnetworkIpRangesToNat: Specify the Nat option, which can take
  28016. // one of the following values:
  28017. // - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every
  28018. // Subnetwork are allowed to Nat.
  28019. // - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges
  28020. // in every Subnetwork are allowed to Nat.
  28021. // - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat
  28022. // (specified in the field subnetwork below) The default is
  28023. // SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this
  28024. // field contains ALL_SUBNETWORKS_ALL_IP_RANGES or
  28025. // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any
  28026. // other Router.Nat section in any Router for this network in this
  28027. // region.
  28028. //
  28029. // Possible values:
  28030. // "ALL_SUBNETWORKS_ALL_IP_RANGES"
  28031. // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES"
  28032. // "LIST_OF_SUBNETWORKS"
  28033. SourceSubnetworkIpRangesToNat string `json:"sourceSubnetworkIpRangesToNat,omitempty"`
  28034. // Subnetworks: A list of Subnetwork resources whose traffic should be
  28035. // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS
  28036. // is selected for the SubnetworkIpRangeToNatOption above.
  28037. Subnetworks []*RouterNatSubnetworkToNat `json:"subnetworks,omitempty"`
  28038. // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP
  28039. // established connections. Defaults to 1200s if not set.
  28040. TcpEstablishedIdleTimeoutSec int64 `json:"tcpEstablishedIdleTimeoutSec,omitempty"`
  28041. // TcpTransitoryIdleTimeoutSec: Timeout (in seconds) for TCP transitory
  28042. // connections. Defaults to 30s if not set.
  28043. TcpTransitoryIdleTimeoutSec int64 `json:"tcpTransitoryIdleTimeoutSec,omitempty"`
  28044. // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults
  28045. // to 30s if not set.
  28046. UdpIdleTimeoutSec int64 `json:"udpIdleTimeoutSec,omitempty"`
  28047. // ForceSendFields is a list of field names (e.g. "DrainNatIps") 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. "DrainNatIps") to include
  28055. // in API requests with the JSON null value. By default, fields with
  28056. // empty values are omitted from API requests. However, any field with
  28057. // an 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 *RouterNat) MarshalJSON() ([]byte, error) {
  28063. type NoMethod RouterNat
  28064. raw := NoMethod(*s)
  28065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28066. }
  28067. // RouterNatLogConfig: Configuration of logging on a NAT.
  28068. type RouterNatLogConfig struct {
  28069. // Enable: Indicates whether or not to export logs. This is false by
  28070. // default.
  28071. Enable bool `json:"enable,omitempty"`
  28072. // Filter: Specifies the desired filtering of logs on this NAT. If
  28073. // unspecified, logs are exported for all connections handled by this
  28074. // NAT.
  28075. //
  28076. // Possible values:
  28077. // "ALL"
  28078. // "ERRORS_ONLY"
  28079. // "TRANSLATIONS_ONLY"
  28080. Filter string `json:"filter,omitempty"`
  28081. // ForceSendFields is a list of field names (e.g. "Enable") 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. "Enable") to include in API
  28089. // requests with the JSON null value. By default, fields with empty
  28090. // values are omitted from API requests. However, any field with an
  28091. // 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 *RouterNatLogConfig) MarshalJSON() ([]byte, error) {
  28097. type NoMethod RouterNatLogConfig
  28098. raw := NoMethod(*s)
  28099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28100. }
  28101. // RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT
  28102. // for a subnetwork.
  28103. type RouterNatSubnetworkToNat struct {
  28104. // Name: URL for the subnetwork resource that will use NAT.
  28105. Name string `json:"name,omitempty"`
  28106. // SecondaryIpRangeNames: A list of the secondary ranges of the
  28107. // Subnetwork that are allowed to use NAT. This can be populated only if
  28108. // "LIST_OF_SECONDARY_IP_RANGES" is one of the values in
  28109. // source_ip_ranges_to_nat.
  28110. SecondaryIpRangeNames []string `json:"secondaryIpRangeNames,omitempty"`
  28111. // SourceIpRangesToNat: Specify the options for NAT ranges in the
  28112. // Subnetwork. All options of a single value are valid except
  28113. // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple
  28114. // values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"]
  28115. // Default: [ALL_IP_RANGES]
  28116. //
  28117. // Possible values:
  28118. // "ALL_IP_RANGES"
  28119. // "LIST_OF_SECONDARY_IP_RANGES"
  28120. // "PRIMARY_IP_RANGE"
  28121. SourceIpRangesToNat []string `json:"sourceIpRangesToNat,omitempty"`
  28122. // ForceSendFields is a list of field names (e.g. "Name") to
  28123. // unconditionally include in API requests. By default, fields with
  28124. // empty values are omitted from API requests. However, any non-pointer,
  28125. // non-interface field appearing in ForceSendFields will be sent to the
  28126. // server regardless of whether the field is empty or not. This may be
  28127. // used to include empty fields in Patch requests.
  28128. ForceSendFields []string `json:"-"`
  28129. // NullFields is a list of field names (e.g. "Name") to include in API
  28130. // requests with the JSON null value. By default, fields with empty
  28131. // values are omitted from API requests. However, any field with an
  28132. // empty value appearing in NullFields will be sent to the server as
  28133. // null. It is an error if a field in this list has a non-empty value.
  28134. // This may be used to include null fields in Patch requests.
  28135. NullFields []string `json:"-"`
  28136. }
  28137. func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
  28138. type NoMethod RouterNatSubnetworkToNat
  28139. raw := NoMethod(*s)
  28140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28141. }
  28142. type RouterStatus struct {
  28143. // BestRoutes: Best routes for this router's network.
  28144. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  28145. // BestRoutesForRouter: Best routes learned by this router.
  28146. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  28147. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  28148. NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
  28149. // Network: URI of the network to which this router belongs.
  28150. Network string `json:"network,omitempty"`
  28151. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  28152. // unconditionally include in API requests. By default, fields with
  28153. // empty values are omitted from API requests. However, any non-pointer,
  28154. // non-interface field appearing in ForceSendFields will be sent to the
  28155. // server regardless of whether the field is empty or not. This may be
  28156. // used to include empty fields in Patch requests.
  28157. ForceSendFields []string `json:"-"`
  28158. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  28159. // API requests with the JSON null value. By default, fields with empty
  28160. // values are omitted from API requests. However, any field with an
  28161. // empty value appearing in NullFields will be sent to the server as
  28162. // null. It is an error if a field in this list has a non-empty value.
  28163. // This may be used to include null fields in Patch requests.
  28164. NullFields []string `json:"-"`
  28165. }
  28166. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  28167. type NoMethod RouterStatus
  28168. raw := NoMethod(*s)
  28169. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28170. }
  28171. type RouterStatusBgpPeerStatus struct {
  28172. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  28173. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  28174. // IpAddress: IP address of the local BGP interface.
  28175. IpAddress string `json:"ipAddress,omitempty"`
  28176. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  28177. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  28178. // Name: Name of this BGP peer. Unique within the Routers resource.
  28179. Name string `json:"name,omitempty"`
  28180. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  28181. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  28182. // PeerIpAddress: IP address of the remote BGP interface.
  28183. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  28184. // State: BGP state as specified in RFC1771.
  28185. State string `json:"state,omitempty"`
  28186. // Status: Status of the BGP peer: {UP, DOWN}
  28187. //
  28188. // Possible values:
  28189. // "DOWN"
  28190. // "UNKNOWN"
  28191. // "UP"
  28192. Status string `json:"status,omitempty"`
  28193. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  28194. // days, 23 hours, 59 minutes, 59 seconds
  28195. Uptime string `json:"uptime,omitempty"`
  28196. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  28197. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  28198. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  28199. // unconditionally include in API requests. By default, fields with
  28200. // empty values are omitted from API requests. However, any non-pointer,
  28201. // non-interface field appearing in ForceSendFields will be sent to the
  28202. // server regardless of whether the field is empty or not. This may be
  28203. // used to include empty fields in Patch requests.
  28204. ForceSendFields []string `json:"-"`
  28205. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  28206. // include in API requests with the JSON null value. By default, fields
  28207. // with empty values are omitted from API requests. However, any field
  28208. // with an empty value appearing in NullFields will be sent to the
  28209. // server as null. It is an error if a field in this list has a
  28210. // non-empty value. This may be used to include null fields in Patch
  28211. // requests.
  28212. NullFields []string `json:"-"`
  28213. }
  28214. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  28215. type NoMethod RouterStatusBgpPeerStatus
  28216. raw := NoMethod(*s)
  28217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28218. }
  28219. // RouterStatusNatStatus: Status of a NAT contained in this router. Next
  28220. // tag: 9
  28221. type RouterStatusNatStatus struct {
  28222. // AutoAllocatedNatIps: A list of IPs auto-allocated for NAT. Example:
  28223. // ["1.1.1.1", "129.2.16.89"]
  28224. AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
  28225. // DrainAutoAllocatedNatIps: A list of IPs auto-allocated for NAT that
  28226. // are in drain mode. Example: ["1.1.1.1", ?179.12.26.133?].
  28227. DrainAutoAllocatedNatIps []string `json:"drainAutoAllocatedNatIps,omitempty"`
  28228. // DrainUserAllocatedNatIps: A list of IPs user-allocated for NAT that
  28229. // are in drain mode. Example: ["1.1.1.1", ?179.12.26.133?].
  28230. DrainUserAllocatedNatIps []string `json:"drainUserAllocatedNatIps,omitempty"`
  28231. // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will
  28232. // be greater than 0 only if user-specified IPs are NOT enough to allow
  28233. // all configured VMs to use NAT. This value is meaningful only when
  28234. // auto-allocation of NAT IPs is *not* used.
  28235. MinExtraNatIpsNeeded int64 `json:"minExtraNatIpsNeeded,omitempty"`
  28236. // Name: Unique name of this NAT.
  28237. Name string `json:"name,omitempty"`
  28238. // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics)
  28239. // that can use NAT.
  28240. NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
  28241. // UserAllocatedNatIpResources: A list of fully qualified URLs of
  28242. // reserved IP address resources.
  28243. UserAllocatedNatIpResources []string `json:"userAllocatedNatIpResources,omitempty"`
  28244. // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will
  28245. // be raw IP strings like "179.12.26.133".
  28246. UserAllocatedNatIps []string `json:"userAllocatedNatIps,omitempty"`
  28247. // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
  28248. // to unconditionally include in API requests. By default, fields with
  28249. // empty values are omitted from API requests. However, any non-pointer,
  28250. // non-interface field appearing in ForceSendFields will be sent to the
  28251. // server regardless of whether the field is empty or not. This may be
  28252. // used to include empty fields in Patch requests.
  28253. ForceSendFields []string `json:"-"`
  28254. // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") to
  28255. // include in API requests with the JSON null value. By default, fields
  28256. // with empty values are omitted from API requests. However, any field
  28257. // with an empty value appearing in NullFields will be sent to the
  28258. // server as null. It is an error if a field in this list has a
  28259. // non-empty value. This may be used to include null fields in Patch
  28260. // requests.
  28261. NullFields []string `json:"-"`
  28262. }
  28263. func (s *RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
  28264. type NoMethod RouterStatusNatStatus
  28265. raw := NoMethod(*s)
  28266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28267. }
  28268. type RouterStatusResponse struct {
  28269. // Kind: Type of resource.
  28270. Kind string `json:"kind,omitempty"`
  28271. Result *RouterStatus `json:"result,omitempty"`
  28272. // ServerResponse contains the HTTP response code and headers from the
  28273. // server.
  28274. googleapi.ServerResponse `json:"-"`
  28275. // ForceSendFields is a list of field names (e.g. "Kind") to
  28276. // unconditionally include in API requests. By default, fields with
  28277. // empty values are omitted from API requests. However, any non-pointer,
  28278. // non-interface field appearing in ForceSendFields will be sent to the
  28279. // server regardless of whether the field is empty or not. This may be
  28280. // used to include empty fields in Patch requests.
  28281. ForceSendFields []string `json:"-"`
  28282. // NullFields is a list of field names (e.g. "Kind") to include in API
  28283. // requests with the JSON null value. By default, fields with empty
  28284. // values are omitted from API requests. However, any field with an
  28285. // empty value appearing in NullFields will be sent to the server as
  28286. // null. It is an error if a field in this list has a non-empty value.
  28287. // This may be used to include null fields in Patch requests.
  28288. NullFields []string `json:"-"`
  28289. }
  28290. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  28291. type NoMethod RouterStatusResponse
  28292. raw := NoMethod(*s)
  28293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28294. }
  28295. type RoutersPreviewResponse struct {
  28296. // Resource: Preview of given router.
  28297. Resource *Router `json:"resource,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. "Resource") 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. "Resource") to include in
  28309. // API 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 *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  28317. type NoMethod RoutersPreviewResponse
  28318. raw := NoMethod(*s)
  28319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28320. }
  28321. type RoutersScopedList struct {
  28322. // Routers: A list of routers contained in this scope.
  28323. Routers []*Router `json:"routers,omitempty"`
  28324. // Warning: Informational warning which replaces the list of routers
  28325. // when the list is empty.
  28326. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  28327. // ForceSendFields is a list of field names (e.g. "Routers") to
  28328. // unconditionally include in API requests. By default, fields with
  28329. // empty values are omitted from API requests. However, any non-pointer,
  28330. // non-interface field appearing in ForceSendFields will be sent to the
  28331. // server regardless of whether the field is empty or not. This may be
  28332. // used to include empty fields in Patch requests.
  28333. ForceSendFields []string `json:"-"`
  28334. // NullFields is a list of field names (e.g. "Routers") to include in
  28335. // API requests with the JSON null value. By default, fields with empty
  28336. // values are omitted from API requests. However, any field with an
  28337. // empty value appearing in NullFields will be sent to the server as
  28338. // null. It is an error if a field in this list has a non-empty value.
  28339. // This may be used to include null fields in Patch requests.
  28340. NullFields []string `json:"-"`
  28341. }
  28342. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  28343. type NoMethod RoutersScopedList
  28344. raw := NoMethod(*s)
  28345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28346. }
  28347. // RoutersScopedListWarning: Informational warning which replaces the
  28348. // list of routers when the list is empty.
  28349. type RoutersScopedListWarning struct {
  28350. // Code: [Output Only] A warning code, if applicable. For example,
  28351. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28352. // the response.
  28353. //
  28354. // Possible values:
  28355. // "CLEANUP_FAILED"
  28356. // "DEPRECATED_RESOURCE_USED"
  28357. // "DEPRECATED_TYPE_USED"
  28358. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28359. // "EXPERIMENTAL_TYPE_USED"
  28360. // "EXTERNAL_API_WARNING"
  28361. // "FIELD_VALUE_OVERRIDEN"
  28362. // "INJECTED_KERNELS_DEPRECATED"
  28363. // "MISSING_TYPE_DEPENDENCY"
  28364. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28365. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28366. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28367. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28368. // "NEXT_HOP_NOT_RUNNING"
  28369. // "NOT_CRITICAL_ERROR"
  28370. // "NO_RESULTS_ON_PAGE"
  28371. // "REQUIRED_TOS_AGREEMENT"
  28372. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28373. // "RESOURCE_NOT_DELETED"
  28374. // "SCHEMA_VALIDATION_IGNORED"
  28375. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28376. // "UNDECLARED_PROPERTIES"
  28377. // "UNREACHABLE"
  28378. Code string `json:"code,omitempty"`
  28379. // Data: [Output Only] Metadata about this warning in key: value format.
  28380. // For example:
  28381. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28382. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  28383. // Message: [Output Only] A human-readable description of the warning
  28384. // code.
  28385. Message string `json:"message,omitempty"`
  28386. // ForceSendFields is a list of field names (e.g. "Code") to
  28387. // unconditionally include in API requests. By default, fields with
  28388. // empty values are omitted from API requests. However, any non-pointer,
  28389. // non-interface field appearing in ForceSendFields will be sent to the
  28390. // server regardless of whether the field is empty or not. This may be
  28391. // used to include empty fields in Patch requests.
  28392. ForceSendFields []string `json:"-"`
  28393. // NullFields is a list of field names (e.g. "Code") to include in API
  28394. // requests with the JSON null value. By default, fields with empty
  28395. // values are omitted from API requests. However, any field with an
  28396. // empty value appearing in NullFields will be sent to the server as
  28397. // null. It is an error if a field in this list has a non-empty value.
  28398. // This may be used to include null fields in Patch requests.
  28399. NullFields []string `json:"-"`
  28400. }
  28401. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  28402. type NoMethod RoutersScopedListWarning
  28403. raw := NoMethod(*s)
  28404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28405. }
  28406. type RoutersScopedListWarningData struct {
  28407. // Key: [Output Only] A key that provides more detail on the warning
  28408. // being returned. For example, for warnings where there are no results
  28409. // in a list request for a particular zone, this key might be scope and
  28410. // the key value might be the zone name. Other examples might be a key
  28411. // indicating a deprecated resource and a suggested replacement, or a
  28412. // warning about invalid network settings (for example, if an instance
  28413. // attempts to perform IP forwarding but is not enabled for IP
  28414. // forwarding).
  28415. Key string `json:"key,omitempty"`
  28416. // Value: [Output Only] A warning data value corresponding to the key.
  28417. Value string `json:"value,omitempty"`
  28418. // ForceSendFields is a list of field names (e.g. "Key") to
  28419. // unconditionally include in API requests. By default, fields with
  28420. // empty values are omitted from API requests. However, any non-pointer,
  28421. // non-interface field appearing in ForceSendFields will be sent to the
  28422. // server regardless of whether the field is empty or not. This may be
  28423. // used to include empty fields in Patch requests.
  28424. ForceSendFields []string `json:"-"`
  28425. // NullFields is a list of field names (e.g. "Key") to include in API
  28426. // requests with the JSON null value. By default, fields with empty
  28427. // values are omitted from API requests. However, any field with an
  28428. // empty value appearing in NullFields will be sent to the server as
  28429. // null. It is an error if a field in this list has a non-empty value.
  28430. // This may be used to include null fields in Patch requests.
  28431. NullFields []string `json:"-"`
  28432. }
  28433. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  28434. type NoMethod RoutersScopedListWarningData
  28435. raw := NoMethod(*s)
  28436. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28437. }
  28438. // Rule: A rule to be applied in a Policy.
  28439. type Rule struct {
  28440. // Action: Required
  28441. //
  28442. // Possible values:
  28443. // "ALLOW"
  28444. // "ALLOW_WITH_LOG"
  28445. // "DENY"
  28446. // "DENY_WITH_LOG"
  28447. // "LOG"
  28448. // "NO_ACTION"
  28449. Action string `json:"action,omitempty"`
  28450. // Conditions: Additional restrictions that must be met. All conditions
  28451. // must pass for the rule to match.
  28452. Conditions []*Condition `json:"conditions,omitempty"`
  28453. // Description: Human-readable description of the rule.
  28454. Description string `json:"description,omitempty"`
  28455. // Ins: If one or more 'in' clauses are specified, the rule matches if
  28456. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  28457. Ins []string `json:"ins,omitempty"`
  28458. // LogConfigs: The config returned to callers of
  28459. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  28460. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  28461. // NotIns: If one or more 'not_in' clauses are specified, the rule
  28462. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  28463. // entries.
  28464. NotIns []string `json:"notIns,omitempty"`
  28465. // Permissions: A permission is a string of form '..' (e.g.,
  28466. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  28467. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  28468. Permissions []string `json:"permissions,omitempty"`
  28469. // ForceSendFields is a list of field names (e.g. "Action") to
  28470. // unconditionally include in API requests. By default, fields with
  28471. // empty values are omitted from API requests. However, any non-pointer,
  28472. // non-interface field appearing in ForceSendFields will be sent to the
  28473. // server regardless of whether the field is empty or not. This may be
  28474. // used to include empty fields in Patch requests.
  28475. ForceSendFields []string `json:"-"`
  28476. // NullFields is a list of field names (e.g. "Action") to include in API
  28477. // requests with the JSON null value. By default, fields with empty
  28478. // values are omitted from API requests. However, any field with an
  28479. // empty value appearing in NullFields will be sent to the server as
  28480. // null. It is an error if a field in this list has a non-empty value.
  28481. // This may be used to include null fields in Patch requests.
  28482. NullFields []string `json:"-"`
  28483. }
  28484. func (s *Rule) MarshalJSON() ([]byte, error) {
  28485. type NoMethod Rule
  28486. raw := NoMethod(*s)
  28487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28488. }
  28489. type SSLHealthCheck struct {
  28490. // Port: The TCP port number for the health check request. The default
  28491. // value is 443. Valid values are 1 through 65535.
  28492. Port int64 `json:"port,omitempty"`
  28493. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  28494. // both port and port_name are defined, port takes precedence.
  28495. PortName string `json:"portName,omitempty"`
  28496. // PortSpecification: Specifies how port is selected for health
  28497. // checking, can be one of following values:
  28498. // USE_FIXED_PORT: The port number in
  28499. // port
  28500. // is used for health checking.
  28501. // USE_NAMED_PORT: The
  28502. // portName
  28503. // is used for health checking.
  28504. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  28505. // each network endpoint is used for health checking. For other
  28506. // backends, the port or named port specified in the Backend Service is
  28507. // used for health checking.
  28508. //
  28509. //
  28510. // If not specified, SSL health check follows behavior specified
  28511. // in
  28512. // port
  28513. // and
  28514. // portName
  28515. // fields.
  28516. //
  28517. // Possible values:
  28518. // "USE_FIXED_PORT"
  28519. // "USE_NAMED_PORT"
  28520. // "USE_SERVING_PORT"
  28521. PortSpecification string `json:"portSpecification,omitempty"`
  28522. // ProxyHeader: Specifies the type of proxy header to append before
  28523. // sending data to the backend, either NONE or PROXY_V1. The default is
  28524. // NONE.
  28525. //
  28526. // Possible values:
  28527. // "NONE"
  28528. // "PROXY_V1"
  28529. ProxyHeader string `json:"proxyHeader,omitempty"`
  28530. // Request: The application data to send once the SSL connection has
  28531. // been established (default value is empty). If both request and
  28532. // response are empty, the connection establishment alone will indicate
  28533. // health. The request data can only be ASCII.
  28534. Request string `json:"request,omitempty"`
  28535. // Response: The bytes to match against the beginning of the response
  28536. // data. If left empty (the default value), any response will indicate
  28537. // health. The response data can only be ASCII.
  28538. Response string `json:"response,omitempty"`
  28539. // ForceSendFields is a list of field names (e.g. "Port") to
  28540. // unconditionally include in API requests. By default, fields with
  28541. // empty values are omitted from API requests. However, any non-pointer,
  28542. // non-interface field appearing in ForceSendFields will be sent to the
  28543. // server regardless of whether the field is empty or not. This may be
  28544. // used to include empty fields in Patch requests.
  28545. ForceSendFields []string `json:"-"`
  28546. // NullFields is a list of field names (e.g. "Port") to include in API
  28547. // requests with the JSON null value. By default, fields with empty
  28548. // values are omitted from API requests. However, any field with an
  28549. // empty value appearing in NullFields will be sent to the server as
  28550. // null. It is an error if a field in this list has a non-empty value.
  28551. // This may be used to include null fields in Patch requests.
  28552. NullFields []string `json:"-"`
  28553. }
  28554. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  28555. type NoMethod SSLHealthCheck
  28556. raw := NoMethod(*s)
  28557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28558. }
  28559. // SavedAttachedDisk: An instance-attached disk resource.
  28560. type SavedAttachedDisk struct {
  28561. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  28562. // instance is deleted (but not when the disk is detached from the
  28563. // instance).
  28564. AutoDelete bool `json:"autoDelete,omitempty"`
  28565. // Boot: Indicates that this is a boot disk. The virtual machine will
  28566. // use the first partition of the disk for its root filesystem.
  28567. Boot bool `json:"boot,omitempty"`
  28568. // DeviceName: Specifies the name of the disk attached to the source
  28569. // instance.
  28570. DeviceName string `json:"deviceName,omitempty"`
  28571. // DiskEncryptionKey: The encryption key for the disk.
  28572. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  28573. // DiskSizeGb: The size of the disk in base-2 GB.
  28574. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  28575. // GuestOsFeatures: A list of features to enable on the guest operating
  28576. // system. Applicable only for bootable images. Read Enabling guest
  28577. // operating system features to see a list of available options.
  28578. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  28579. // Index: Specifies zero-based index of the disk that is attached to the
  28580. // source instance.
  28581. Index int64 `json:"index,omitempty"`
  28582. // Interface: Specifies the disk interface to use for attaching this
  28583. // disk, which is either SCSI or NVME.
  28584. //
  28585. // Possible values:
  28586. // "NVDIMM"
  28587. // "NVME"
  28588. // "SCSI"
  28589. Interface string `json:"interface,omitempty"`
  28590. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  28591. // for attached disks.
  28592. Kind string `json:"kind,omitempty"`
  28593. // Licenses: [Output Only] Any valid publicly visible licenses.
  28594. Licenses []string `json:"licenses,omitempty"`
  28595. // Mode: The mode in which this disk is attached to the source instance,
  28596. // either READ_WRITE or READ_ONLY.
  28597. //
  28598. // Possible values:
  28599. // "READ_ONLY"
  28600. // "READ_WRITE"
  28601. Mode string `json:"mode,omitempty"`
  28602. // Source: Specifies a URL of the disk attached to the source instance.
  28603. Source string `json:"source,omitempty"`
  28604. // StorageBytes: [Output Only] A size of the storage used by the disk's
  28605. // snapshot by this machine image.
  28606. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  28607. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  28608. // is in a stable state or it is being adjusted as a result of shared
  28609. // storage reallocation. This status can either be UPDATING, meaning the
  28610. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  28611. // size of the snapshot is up-to-date.
  28612. //
  28613. // Possible values:
  28614. // "UPDATING"
  28615. // "UP_TO_DATE"
  28616. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  28617. // Type: Specifies the type of the attached disk, either SCRATCH or
  28618. // PERSISTENT.
  28619. //
  28620. // Possible values:
  28621. // "PERSISTENT"
  28622. // "SCRATCH"
  28623. Type string `json:"type,omitempty"`
  28624. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  28625. // unconditionally include in API requests. By default, fields with
  28626. // empty values are omitted from API requests. However, any non-pointer,
  28627. // non-interface field appearing in ForceSendFields will be sent to the
  28628. // server regardless of whether the field is empty or not. This may be
  28629. // used to include empty fields in Patch requests.
  28630. ForceSendFields []string `json:"-"`
  28631. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  28632. // API requests with the JSON null value. By default, fields with empty
  28633. // values are omitted from API requests. However, any field with an
  28634. // empty value appearing in NullFields will be sent to the server as
  28635. // null. It is an error if a field in this list has a non-empty value.
  28636. // This may be used to include null fields in Patch requests.
  28637. NullFields []string `json:"-"`
  28638. }
  28639. func (s *SavedAttachedDisk) MarshalJSON() ([]byte, error) {
  28640. type NoMethod SavedAttachedDisk
  28641. raw := NoMethod(*s)
  28642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28643. }
  28644. // Scheduling: Sets the scheduling options for an Instance.
  28645. type Scheduling struct {
  28646. // AutomaticRestart: Specifies whether the instance should be
  28647. // automatically restarted if it is terminated by Compute Engine (not
  28648. // terminated by a user). You can only set the automatic restart option
  28649. // for standard instances. Preemptible instances cannot be automatically
  28650. // restarted.
  28651. //
  28652. // By default, this is set to true so an instance is automatically
  28653. // restarted if it is terminated by Compute Engine.
  28654. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  28655. // LatencyTolerant: Defines whether the instance is tolerant of higher
  28656. // cpu latency. This can only be set during instance creation, or when
  28657. // the instance is not currently running. It must not be set if the
  28658. // preemptible option is also set.
  28659. LatencyTolerant bool `json:"latencyTolerant,omitempty"`
  28660. // MinNodeCpus: The minimum number of virtual CPUs this instance will
  28661. // consume when running on a sole-tenant node.
  28662. MinNodeCpus int64 `json:"minNodeCpus,omitempty"`
  28663. // NodeAffinities: A set of node affinity and anti-affinity.
  28664. NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
  28665. // OnHostMaintenance: Defines the maintenance behavior for this
  28666. // instance. For standard instances, the default behavior is MIGRATE.
  28667. // For preemptible instances, the default and only possible behavior is
  28668. // TERMINATE. For more information, see Setting Instance Scheduling
  28669. // Options.
  28670. //
  28671. // Possible values:
  28672. // "MIGRATE"
  28673. // "TERMINATE"
  28674. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  28675. // Preemptible: Defines whether the instance is preemptible. This can
  28676. // only be set during instance creation, it cannot be set or changed
  28677. // after the instance has been created.
  28678. Preemptible bool `json:"preemptible,omitempty"`
  28679. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  28680. // unconditionally include in API requests. By default, fields with
  28681. // empty values are omitted from API requests. However, any non-pointer,
  28682. // non-interface field appearing in ForceSendFields will be sent to the
  28683. // server regardless of whether the field is empty or not. This may be
  28684. // used to include empty fields in Patch requests.
  28685. ForceSendFields []string `json:"-"`
  28686. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  28687. // include in API requests with the JSON null value. By default, fields
  28688. // with empty values are omitted from API requests. However, any field
  28689. // with an empty value appearing in NullFields will be sent to the
  28690. // server as null. It is an error if a field in this list has a
  28691. // non-empty value. This may be used to include null fields in Patch
  28692. // requests.
  28693. NullFields []string `json:"-"`
  28694. }
  28695. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  28696. type NoMethod Scheduling
  28697. raw := NoMethod(*s)
  28698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28699. }
  28700. // SchedulingNodeAffinity: Node Affinity: the configuration of desired
  28701. // nodes onto which this Instance could be scheduled.
  28702. type SchedulingNodeAffinity struct {
  28703. // Key: Corresponds to the label key of Node resource.
  28704. Key string `json:"key,omitempty"`
  28705. // Operator: Defines the operation of node selection.
  28706. //
  28707. // Possible values:
  28708. // "IN"
  28709. // "NOT_IN"
  28710. // "OPERATOR_UNSPECIFIED"
  28711. Operator string `json:"operator,omitempty"`
  28712. // Values: Corresponds to the label values of Node resource.
  28713. Values []string `json:"values,omitempty"`
  28714. // ForceSendFields is a list of field names (e.g. "Key") to
  28715. // unconditionally include in API requests. By default, fields with
  28716. // empty values are omitted from API requests. However, any non-pointer,
  28717. // non-interface field appearing in ForceSendFields will be sent to the
  28718. // server regardless of whether the field is empty or not. This may be
  28719. // used to include empty fields in Patch requests.
  28720. ForceSendFields []string `json:"-"`
  28721. // NullFields is a list of field names (e.g. "Key") to include in API
  28722. // requests with the JSON null value. By default, fields with empty
  28723. // values are omitted from API requests. However, any field with an
  28724. // empty value appearing in NullFields will be sent to the server as
  28725. // null. It is an error if a field in this list has a non-empty value.
  28726. // This may be used to include null fields in Patch requests.
  28727. NullFields []string `json:"-"`
  28728. }
  28729. func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
  28730. type NoMethod SchedulingNodeAffinity
  28731. raw := NoMethod(*s)
  28732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28733. }
  28734. // SdsConfig: The configuration to access the SDS server.
  28735. type SdsConfig struct {
  28736. // GrpcServiceConfig: The configuration to access the SDS server over
  28737. // GRPC.
  28738. GrpcServiceConfig *GrpcServiceConfig `json:"grpcServiceConfig,omitempty"`
  28739. // ForceSendFields is a list of field names (e.g. "GrpcServiceConfig")
  28740. // to unconditionally include in API requests. By default, fields with
  28741. // empty values are omitted from API requests. However, any non-pointer,
  28742. // non-interface field appearing in ForceSendFields will be sent to the
  28743. // server regardless of whether the field is empty or not. This may be
  28744. // used to include empty fields in Patch requests.
  28745. ForceSendFields []string `json:"-"`
  28746. // NullFields is a list of field names (e.g. "GrpcServiceConfig") to
  28747. // include in API requests with the JSON null value. By default, fields
  28748. // with empty values are omitted from API requests. However, any field
  28749. // with an empty value appearing in NullFields will be sent to the
  28750. // server as null. It is an error if a field in this list has a
  28751. // non-empty value. This may be used to include null fields in Patch
  28752. // requests.
  28753. NullFields []string `json:"-"`
  28754. }
  28755. func (s *SdsConfig) MarshalJSON() ([]byte, error) {
  28756. type NoMethod SdsConfig
  28757. raw := NoMethod(*s)
  28758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28759. }
  28760. type SecurityPoliciesListPreconfiguredExpressionSetsResponse struct {
  28761. PreconfiguredExpressionSets *SecurityPoliciesWafConfig `json:"preconfiguredExpressionSets,omitempty"`
  28762. // ServerResponse contains the HTTP response code and headers from the
  28763. // server.
  28764. googleapi.ServerResponse `json:"-"`
  28765. // ForceSendFields is a list of field names (e.g.
  28766. // "PreconfiguredExpressionSets") to unconditionally include in API
  28767. // requests. By default, fields with empty values are omitted from API
  28768. // requests. However, any non-pointer, non-interface field appearing in
  28769. // ForceSendFields will be sent to the server regardless of whether the
  28770. // field is empty or not. This may be used to include empty fields in
  28771. // Patch requests.
  28772. ForceSendFields []string `json:"-"`
  28773. // NullFields is a list of field names (e.g.
  28774. // "PreconfiguredExpressionSets") to include in API requests with the
  28775. // JSON null value. By default, fields with empty values are omitted
  28776. // from API requests. However, any field with an empty value appearing
  28777. // in NullFields will be sent to the server as null. It is an error if a
  28778. // field in this list has a non-empty value. This may be used to include
  28779. // null fields in Patch requests.
  28780. NullFields []string `json:"-"`
  28781. }
  28782. func (s *SecurityPoliciesListPreconfiguredExpressionSetsResponse) MarshalJSON() ([]byte, error) {
  28783. type NoMethod SecurityPoliciesListPreconfiguredExpressionSetsResponse
  28784. raw := NoMethod(*s)
  28785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28786. }
  28787. type SecurityPoliciesWafConfig struct {
  28788. WafRules *PreconfiguredWafSet `json:"wafRules,omitempty"`
  28789. // ForceSendFields is a list of field names (e.g. "WafRules") to
  28790. // unconditionally include in API requests. By default, fields with
  28791. // empty values are omitted from API requests. However, any non-pointer,
  28792. // non-interface field appearing in ForceSendFields will be sent to the
  28793. // server regardless of whether the field is empty or not. This may be
  28794. // used to include empty fields in Patch requests.
  28795. ForceSendFields []string `json:"-"`
  28796. // NullFields is a list of field names (e.g. "WafRules") to include in
  28797. // API requests with the JSON null value. By default, fields with empty
  28798. // values are omitted from API requests. However, any field with an
  28799. // empty value appearing in NullFields will be sent to the server as
  28800. // null. It is an error if a field in this list has a non-empty value.
  28801. // This may be used to include null fields in Patch requests.
  28802. NullFields []string `json:"-"`
  28803. }
  28804. func (s *SecurityPoliciesWafConfig) MarshalJSON() ([]byte, error) {
  28805. type NoMethod SecurityPoliciesWafConfig
  28806. raw := NoMethod(*s)
  28807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28808. }
  28809. // SecurityPolicy: A security policy is comprised of one or more rules.
  28810. // It can also be associated with one or more 'targets'. (==
  28811. // resource_for v1.securityPolicies ==) (== resource_for
  28812. // beta.securityPolicies ==)
  28813. type SecurityPolicy struct {
  28814. // Associations: A list of assocations that belong to this policy.
  28815. Associations []*SecurityPolicyAssociation `json:"associations,omitempty"`
  28816. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  28817. // format.
  28818. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  28819. // Description: An optional description of this resource. Provide this
  28820. // property when you create the resource.
  28821. Description string `json:"description,omitempty"`
  28822. // Fingerprint: Specifies a fingerprint for this resource, which is
  28823. // essentially a hash of the metadata's contents and used for optimistic
  28824. // locking. The fingerprint is initially generated by Compute Engine and
  28825. // changes after every request to modify or update metadata. You must
  28826. // always provide an up-to-date fingerprint hash in order to update or
  28827. // change metadata, otherwise the request will fail with error 412
  28828. // conditionNotMet.
  28829. //
  28830. // To see the latest fingerprint, make get() request to the security
  28831. // policy.
  28832. Fingerprint string `json:"fingerprint,omitempty"`
  28833. // Id: [Output Only] The unique identifier for the resource. This
  28834. // identifier is defined by the server.
  28835. Id uint64 `json:"id,omitempty,string"`
  28836. // Kind: [Output only] Type of the resource. Always
  28837. // compute#securityPolicyfor security policies
  28838. Kind string `json:"kind,omitempty"`
  28839. // LabelFingerprint: A fingerprint for the labels being applied to this
  28840. // security policy, which is essentially a hash of the labels set used
  28841. // for optimistic locking. The fingerprint is initially generated by
  28842. // Compute Engine and changes after every request to modify or update
  28843. // labels. You must always provide an up-to-date fingerprint hash in
  28844. // order to update or change labels.
  28845. //
  28846. // To see the latest fingerprint, make get() request to the security
  28847. // policy.
  28848. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  28849. // Labels: Labels to apply to this security policy resource. These can
  28850. // be later modified by the setLabels method. Each label key/value must
  28851. // comply with RFC1035. Label values may be empty.
  28852. Labels map[string]string `json:"labels,omitempty"`
  28853. // Name: Name of the resource. Provided by the client when the resource
  28854. // is created. The name must be 1-63 characters long, and comply with
  28855. // RFC1035. Specifically, the name must be 1-63 characters long and
  28856. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  28857. // the first character must be a lowercase letter, and all following
  28858. // characters must be a dash, lowercase letter, or digit, except the
  28859. // last character, which cannot be a dash.
  28860. Name string `json:"name,omitempty"`
  28861. // RuleTupleCount: [Output Only] Total count of all security policy rule
  28862. // tuples. A security policy can not exceed a set number of tuples.
  28863. RuleTupleCount int64 `json:"ruleTupleCount,omitempty"`
  28864. // Rules: A list of rules that belong to this policy. There must always
  28865. // be a default rule (rule with priority 2147483647 and match "*"). If
  28866. // no rules are provided when creating a security policy, a default rule
  28867. // with action "allow" will be added.
  28868. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  28869. // SelfLink: [Output Only] Server-defined URL for the resource.
  28870. SelfLink string `json:"selfLink,omitempty"`
  28871. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  28872. // with the resource id.
  28873. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  28874. // Type: The type indicates the intended use of the security policy.
  28875. // CLOUD_ARMOR policies apply to backend services. FIREWALL policies
  28876. // apply to organizations.
  28877. //
  28878. // Possible values:
  28879. // "CLOUD_ARMOR"
  28880. // "FIREWALL"
  28881. Type string `json:"type,omitempty"`
  28882. // ServerResponse contains the HTTP response code and headers from the
  28883. // server.
  28884. googleapi.ServerResponse `json:"-"`
  28885. // ForceSendFields is a list of field names (e.g. "Associations") to
  28886. // unconditionally include in API requests. By default, fields with
  28887. // empty values are omitted from API requests. However, any non-pointer,
  28888. // non-interface field appearing in ForceSendFields will be sent to the
  28889. // server regardless of whether the field is empty or not. This may be
  28890. // used to include empty fields in Patch requests.
  28891. ForceSendFields []string `json:"-"`
  28892. // NullFields is a list of field names (e.g. "Associations") to include
  28893. // in API requests with the JSON null value. By default, fields with
  28894. // empty values are omitted from API requests. However, any field with
  28895. // an empty value appearing in NullFields will be sent to the server as
  28896. // null. It is an error if a field in this list has a non-empty value.
  28897. // This may be used to include null fields in Patch requests.
  28898. NullFields []string `json:"-"`
  28899. }
  28900. func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
  28901. type NoMethod SecurityPolicy
  28902. raw := NoMethod(*s)
  28903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28904. }
  28905. type SecurityPolicyAssociation struct {
  28906. // AttachmentId: The resource that the security policy is attached to.
  28907. AttachmentId string `json:"attachmentId,omitempty"`
  28908. // Name: The name for an association.
  28909. Name string `json:"name,omitempty"`
  28910. // SecurityPolicyId: [Output Only] The security policy ID of the
  28911. // association.
  28912. SecurityPolicyId string `json:"securityPolicyId,omitempty"`
  28913. // ServerResponse contains the HTTP response code and headers from the
  28914. // server.
  28915. googleapi.ServerResponse `json:"-"`
  28916. // ForceSendFields is a list of field names (e.g. "AttachmentId") to
  28917. // unconditionally include in API requests. By default, fields with
  28918. // empty values are omitted from API requests. However, any non-pointer,
  28919. // non-interface field appearing in ForceSendFields will be sent to the
  28920. // server regardless of whether the field is empty or not. This may be
  28921. // used to include empty fields in Patch requests.
  28922. ForceSendFields []string `json:"-"`
  28923. // NullFields is a list of field names (e.g. "AttachmentId") to include
  28924. // in API requests with the JSON null value. By default, fields with
  28925. // empty values are omitted from API requests. However, any field with
  28926. // an empty value appearing in NullFields will be sent to the server as
  28927. // null. It is an error if a field in this list has a non-empty value.
  28928. // This may be used to include null fields in Patch requests.
  28929. NullFields []string `json:"-"`
  28930. }
  28931. func (s *SecurityPolicyAssociation) MarshalJSON() ([]byte, error) {
  28932. type NoMethod SecurityPolicyAssociation
  28933. raw := NoMethod(*s)
  28934. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28935. }
  28936. type SecurityPolicyList struct {
  28937. // Id: [Output Only] Unique identifier for the resource; defined by the
  28938. // server.
  28939. Id string `json:"id,omitempty"`
  28940. // Items: A list of SecurityPolicy resources.
  28941. Items []*SecurityPolicy `json:"items,omitempty"`
  28942. // Kind: [Output Only] Type of resource. Always
  28943. // compute#securityPolicyList for listsof securityPolicies
  28944. Kind string `json:"kind,omitempty"`
  28945. // NextPageToken: [Output Only] This token allows you to get the next
  28946. // page of results for list requests. If the number of results is larger
  28947. // than maxResults, use the nextPageToken as a value for the query
  28948. // parameter pageToken in the next list request. Subsequent list
  28949. // requests will have their own nextPageToken to continue paging through
  28950. // the results.
  28951. NextPageToken string `json:"nextPageToken,omitempty"`
  28952. // Warning: [Output Only] Informational warning message.
  28953. Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
  28954. // ServerResponse contains the HTTP response code and headers from the
  28955. // server.
  28956. googleapi.ServerResponse `json:"-"`
  28957. // ForceSendFields is a list of field names (e.g. "Id") to
  28958. // unconditionally include in API requests. By default, fields with
  28959. // empty values are omitted from API requests. However, any non-pointer,
  28960. // non-interface field appearing in ForceSendFields will be sent to the
  28961. // server regardless of whether the field is empty or not. This may be
  28962. // used to include empty fields in Patch requests.
  28963. ForceSendFields []string `json:"-"`
  28964. // NullFields is a list of field names (e.g. "Id") to include in API
  28965. // requests with the JSON null value. By default, fields with empty
  28966. // values are omitted from API requests. However, any field with an
  28967. // empty value appearing in NullFields will be sent to the server as
  28968. // null. It is an error if a field in this list has a non-empty value.
  28969. // This may be used to include null fields in Patch requests.
  28970. NullFields []string `json:"-"`
  28971. }
  28972. func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
  28973. type NoMethod SecurityPolicyList
  28974. raw := NoMethod(*s)
  28975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28976. }
  28977. // SecurityPolicyListWarning: [Output Only] Informational warning
  28978. // message.
  28979. type SecurityPolicyListWarning struct {
  28980. // Code: [Output Only] A warning code, if applicable. For example,
  28981. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28982. // the response.
  28983. //
  28984. // Possible values:
  28985. // "CLEANUP_FAILED"
  28986. // "DEPRECATED_RESOURCE_USED"
  28987. // "DEPRECATED_TYPE_USED"
  28988. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28989. // "EXPERIMENTAL_TYPE_USED"
  28990. // "EXTERNAL_API_WARNING"
  28991. // "FIELD_VALUE_OVERRIDEN"
  28992. // "INJECTED_KERNELS_DEPRECATED"
  28993. // "MISSING_TYPE_DEPENDENCY"
  28994. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28995. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28996. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28997. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28998. // "NEXT_HOP_NOT_RUNNING"
  28999. // "NOT_CRITICAL_ERROR"
  29000. // "NO_RESULTS_ON_PAGE"
  29001. // "REQUIRED_TOS_AGREEMENT"
  29002. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29003. // "RESOURCE_NOT_DELETED"
  29004. // "SCHEMA_VALIDATION_IGNORED"
  29005. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29006. // "UNDECLARED_PROPERTIES"
  29007. // "UNREACHABLE"
  29008. Code string `json:"code,omitempty"`
  29009. // Data: [Output Only] Metadata about this warning in key: value format.
  29010. // For example:
  29011. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29012. Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
  29013. // Message: [Output Only] A human-readable description of the warning
  29014. // code.
  29015. Message string `json:"message,omitempty"`
  29016. // ForceSendFields is a list of field names (e.g. "Code") to
  29017. // unconditionally include in API requests. By default, fields with
  29018. // empty values are omitted from API requests. However, any non-pointer,
  29019. // non-interface field appearing in ForceSendFields will be sent to the
  29020. // server regardless of whether the field is empty or not. This may be
  29021. // used to include empty fields in Patch requests.
  29022. ForceSendFields []string `json:"-"`
  29023. // NullFields is a list of field names (e.g. "Code") to include in API
  29024. // requests with the JSON null value. By default, fields with empty
  29025. // values are omitted from API requests. However, any field with an
  29026. // empty value appearing in NullFields will be sent to the server as
  29027. // null. It is an error if a field in this list has a non-empty value.
  29028. // This may be used to include null fields in Patch requests.
  29029. NullFields []string `json:"-"`
  29030. }
  29031. func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
  29032. type NoMethod SecurityPolicyListWarning
  29033. raw := NoMethod(*s)
  29034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29035. }
  29036. type SecurityPolicyListWarningData struct {
  29037. // Key: [Output Only] A key that provides more detail on the warning
  29038. // being returned. For example, for warnings where there are no results
  29039. // in a list request for a particular zone, this key might be scope and
  29040. // the key value might be the zone name. Other examples might be a key
  29041. // indicating a deprecated resource and a suggested replacement, or a
  29042. // warning about invalid network settings (for example, if an instance
  29043. // attempts to perform IP forwarding but is not enabled for IP
  29044. // forwarding).
  29045. Key string `json:"key,omitempty"`
  29046. // Value: [Output Only] A warning data value corresponding to the key.
  29047. Value string `json:"value,omitempty"`
  29048. // ForceSendFields is a list of field names (e.g. "Key") to
  29049. // unconditionally include in API requests. By default, fields with
  29050. // empty values are omitted from API requests. However, any non-pointer,
  29051. // non-interface field appearing in ForceSendFields will be sent to the
  29052. // server regardless of whether the field is empty or not. This may be
  29053. // used to include empty fields in Patch requests.
  29054. ForceSendFields []string `json:"-"`
  29055. // NullFields is a list of field names (e.g. "Key") to include in API
  29056. // requests with the JSON null value. By default, fields with empty
  29057. // values are omitted from API requests. However, any field with an
  29058. // empty value appearing in NullFields will be sent to the server as
  29059. // null. It is an error if a field in this list has a non-empty value.
  29060. // This may be used to include null fields in Patch requests.
  29061. NullFields []string `json:"-"`
  29062. }
  29063. func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
  29064. type NoMethod SecurityPolicyListWarningData
  29065. raw := NoMethod(*s)
  29066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29067. }
  29068. type SecurityPolicyReference struct {
  29069. SecurityPolicy string `json:"securityPolicy,omitempty"`
  29070. // ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
  29071. // unconditionally include in API requests. By default, fields with
  29072. // empty values are omitted from API requests. However, any non-pointer,
  29073. // non-interface field appearing in ForceSendFields will be sent to the
  29074. // server regardless of whether the field is empty or not. This may be
  29075. // used to include empty fields in Patch requests.
  29076. ForceSendFields []string `json:"-"`
  29077. // NullFields is a list of field names (e.g. "SecurityPolicy") to
  29078. // include in API requests with the JSON null value. By default, fields
  29079. // with empty values are omitted from API requests. However, any field
  29080. // with an empty value appearing in NullFields will be sent to the
  29081. // server as null. It is an error if a field in this list has a
  29082. // non-empty value. This may be used to include null fields in Patch
  29083. // requests.
  29084. NullFields []string `json:"-"`
  29085. }
  29086. func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
  29087. type NoMethod SecurityPolicyReference
  29088. raw := NoMethod(*s)
  29089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29090. }
  29091. // SecurityPolicyRule: Represents a rule that describes one or more
  29092. // match conditions along with the action to be taken when traffic
  29093. // matches this condition (allow or deny).
  29094. type SecurityPolicyRule struct {
  29095. // Action: The Action to preform when the client connection triggers the
  29096. // rule. Can currently be either "allow" or "deny()" where valid values
  29097. // for status are 403, 404, and 502.
  29098. Action string `json:"action,omitempty"`
  29099. // Description: An optional description of this resource. Provide this
  29100. // property when you create the resource.
  29101. Description string `json:"description,omitempty"`
  29102. // Direction: The direction in which this rule applies. This field may
  29103. // only be specified when versioned_expr is set to FIREWALL.
  29104. //
  29105. // Possible values:
  29106. // "EGRESS"
  29107. // "INGRESS"
  29108. Direction string `json:"direction,omitempty"`
  29109. // EnableLogging: Denotes whether to enable logging for a particular
  29110. // rule. If logging is enabled, logs will be exported to the configured
  29111. // export destination in Stackdriver. Logs may be exported to BigQuery
  29112. // or Pub/Sub. Note: you cannot enable logging on "goto_next"
  29113. // rules.
  29114. //
  29115. // This field may only be specified when the versioned_expr is set to
  29116. // FIREWALL.
  29117. EnableLogging bool `json:"enableLogging,omitempty"`
  29118. // Kind: [Output only] Type of the resource. Always
  29119. // compute#securityPolicyRule for security policy rules
  29120. Kind string `json:"kind,omitempty"`
  29121. // Match: A match condition that incoming traffic is evaluated against.
  29122. // If it evaluates to true, the corresponding ?action? is enforced.
  29123. Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
  29124. // Preview: If set to true, the specified action is not enforced.
  29125. Preview bool `json:"preview,omitempty"`
  29126. // Priority: An integer indicating the priority of a rule in the list.
  29127. // The priority must be a positive value between 0 and 2147483647. Rules
  29128. // are evaluated from highest to lowest priority where 0 is the highest
  29129. // priority and 2147483647 is the lowest prority.
  29130. Priority int64 `json:"priority,omitempty"`
  29131. // RateLimitOptions: Must be specified if the action is
  29132. // "rate_based_blacklist" or "throttle". Cannot be specified for any
  29133. // other actions.
  29134. RateLimitOptions *SecurityPolicyRuleRateLimitOptions `json:"rateLimitOptions,omitempty"`
  29135. // RuleTupleCount: [Output Only] Calculation of the complexity of a
  29136. // single firewall security policy rule.
  29137. RuleTupleCount int64 `json:"ruleTupleCount,omitempty"`
  29138. // TargetResources: A list of network resource URLs to which this rule
  29139. // applies. This field allows you to control which network?s VMs get
  29140. // this rule. If this field is left blank, all VMs within the
  29141. // organization will receive the rule.
  29142. //
  29143. // This field may only be specified when versioned_expr is set to
  29144. // FIREWALL.
  29145. TargetResources []string `json:"targetResources,omitempty"`
  29146. // ServerResponse contains the HTTP response code and headers from the
  29147. // server.
  29148. googleapi.ServerResponse `json:"-"`
  29149. // ForceSendFields is a list of field names (e.g. "Action") to
  29150. // unconditionally include in API requests. By default, fields with
  29151. // empty values are omitted from API requests. However, any non-pointer,
  29152. // non-interface field appearing in ForceSendFields will be sent to the
  29153. // server regardless of whether the field is empty or not. This may be
  29154. // used to include empty fields in Patch requests.
  29155. ForceSendFields []string `json:"-"`
  29156. // NullFields is a list of field names (e.g. "Action") to include in API
  29157. // requests with the JSON null value. By default, fields with empty
  29158. // values are omitted from API requests. However, any field with an
  29159. // empty value appearing in NullFields will be sent to the server as
  29160. // null. It is an error if a field in this list has a non-empty value.
  29161. // This may be used to include null fields in Patch requests.
  29162. NullFields []string `json:"-"`
  29163. }
  29164. func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
  29165. type NoMethod SecurityPolicyRule
  29166. raw := NoMethod(*s)
  29167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29168. }
  29169. // SecurityPolicyRuleMatcher: Represents a match condition that incoming
  29170. // traffic is evaluated against. Exactly one field must be specified.
  29171. type SecurityPolicyRuleMatcher struct {
  29172. // Config: The configuration options available when specifying
  29173. // versioned_expr. This field must be specified if versioned_expr is
  29174. // specified and cannot be specified if versioned_expr is not specified.
  29175. Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
  29176. // Expr: User defined CEVAL expression. A CEVAL expression is used to
  29177. // specify match criteria such as origin.ip, source.region_code and
  29178. // contents in the request header.
  29179. Expr *Expr `json:"expr,omitempty"`
  29180. // VersionedExpr: Preconfigured versioned expression. If this field is
  29181. // specified, config must also be specified. Available preconfigured
  29182. // expressions along with their requirements are: SRC_IPS_V1 - must
  29183. // specify the corresponding src_ip_range field in config.
  29184. //
  29185. // Possible values:
  29186. // "FIREWALL"
  29187. // "SRC_IPS_V1"
  29188. VersionedExpr string `json:"versionedExpr,omitempty"`
  29189. // ForceSendFields is a list of field names (e.g. "Config") to
  29190. // unconditionally include in API requests. By default, fields with
  29191. // empty values are omitted from API requests. However, any non-pointer,
  29192. // non-interface field appearing in ForceSendFields will be sent to the
  29193. // server regardless of whether the field is empty or not. This may be
  29194. // used to include empty fields in Patch requests.
  29195. ForceSendFields []string `json:"-"`
  29196. // NullFields is a list of field names (e.g. "Config") to include in API
  29197. // requests with the JSON null value. By default, fields with empty
  29198. // values are omitted from API requests. However, any field with an
  29199. // empty value appearing in NullFields will be sent to the server as
  29200. // null. It is an error if a field in this list has a non-empty value.
  29201. // This may be used to include null fields in Patch requests.
  29202. NullFields []string `json:"-"`
  29203. }
  29204. func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
  29205. type NoMethod SecurityPolicyRuleMatcher
  29206. raw := NoMethod(*s)
  29207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29208. }
  29209. type SecurityPolicyRuleMatcherConfig struct {
  29210. // DestIpRanges: CIDR IP address range.
  29211. //
  29212. // This field may only be specified when versioned_expr is set to
  29213. // FIREWALL.
  29214. DestIpRanges []string `json:"destIpRanges,omitempty"`
  29215. // DestPorts: Pairs of IP protocols and ports that the rule should
  29216. // match.
  29217. //
  29218. // This field may only be specified when versioned_expr is set to
  29219. // FIREWALL.
  29220. DestPorts []*SecurityPolicyRuleMatcherConfigDestinationPort `json:"destPorts,omitempty"`
  29221. // SrcIpRanges: CIDR IP address range.
  29222. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  29223. // ForceSendFields is a list of field names (e.g. "DestIpRanges") to
  29224. // unconditionally include in API requests. By default, fields with
  29225. // empty values are omitted from API requests. However, any non-pointer,
  29226. // non-interface field appearing in ForceSendFields will be sent to the
  29227. // server regardless of whether the field is empty or not. This may be
  29228. // used to include empty fields in Patch requests.
  29229. ForceSendFields []string `json:"-"`
  29230. // NullFields is a list of field names (e.g. "DestIpRanges") to include
  29231. // in API requests with the JSON null value. By default, fields with
  29232. // empty values are omitted from API requests. However, any field with
  29233. // an empty value appearing in NullFields will be sent to the server as
  29234. // null. It is an error if a field in this list has a non-empty value.
  29235. // This may be used to include null fields in Patch requests.
  29236. NullFields []string `json:"-"`
  29237. }
  29238. func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
  29239. type NoMethod SecurityPolicyRuleMatcherConfig
  29240. raw := NoMethod(*s)
  29241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29242. }
  29243. type SecurityPolicyRuleMatcherConfigDestinationPort struct {
  29244. // IpProtocol: The IP protocol to which this rule applies. The protocol
  29245. // type is required when creating a firewall rule. This value can either
  29246. // be one of the following well known protocol strings (tcp, udp, icmp,
  29247. // esp, ah, ipip, sctp), or the IP protocol number.
  29248. IpProtocol string `json:"ipProtocol,omitempty"`
  29249. // Ports: An optional list of ports to which this rule applies. This
  29250. // field is only applicable for UDP or TCP protocol. Each entry must be
  29251. // either an integer or a range. If not specified, this rule applies to
  29252. // connections through any port.
  29253. //
  29254. // Example inputs include: ["22"], ["80","443"], and
  29255. // ["12345-12349"].
  29256. //
  29257. // This field may only be specified when versioned_expr is set to
  29258. // FIREWALL.
  29259. Ports []string `json:"ports,omitempty"`
  29260. // ForceSendFields is a list of field names (e.g. "IpProtocol") to
  29261. // unconditionally include in API requests. By default, fields with
  29262. // empty values are omitted from API requests. However, any non-pointer,
  29263. // non-interface field appearing in ForceSendFields will be sent to the
  29264. // server regardless of whether the field is empty or not. This may be
  29265. // used to include empty fields in Patch requests.
  29266. ForceSendFields []string `json:"-"`
  29267. // NullFields is a list of field names (e.g. "IpProtocol") to include in
  29268. // API requests with the JSON null value. By default, fields with empty
  29269. // values are omitted from API requests. However, any field with an
  29270. // empty value appearing in NullFields will be sent to the server as
  29271. // null. It is an error if a field in this list has a non-empty value.
  29272. // This may be used to include null fields in Patch requests.
  29273. NullFields []string `json:"-"`
  29274. }
  29275. func (s *SecurityPolicyRuleMatcherConfigDestinationPort) MarshalJSON() ([]byte, error) {
  29276. type NoMethod SecurityPolicyRuleMatcherConfigDestinationPort
  29277. raw := NoMethod(*s)
  29278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29279. }
  29280. type SecurityPolicyRuleRateLimitOptions struct {
  29281. // BlockDuration: Can only be specifed if the action for the rule is
  29282. // "rate_based_blacklist" If specified, determines the time (in seconds)
  29283. // the traffic will continue to be blocked by the rate limit after the
  29284. // rate falls below the threshold. The default value is 0 seconds.
  29285. BlockDuration int64 `json:"blockDuration,omitempty"`
  29286. // ConformAction: Action to take when requests are under the given
  29287. // threshold. When requests are throttled, this is also the action for
  29288. // all requests which are not dropped. Valid options are "allow",
  29289. // "fairshare", and "drop_overload".
  29290. ConformAction string `json:"conformAction,omitempty"`
  29291. // EnforceOnKey: Determines the key to enforce the threshold_rps limit
  29292. // on. If key is "IP", each IP has this limit enforced separately,
  29293. // whereas "ALL_IPs" means a single limit is applied to all requests
  29294. // matching this rule.
  29295. //
  29296. // Possible values:
  29297. // "ALL_IPS"
  29298. // "IP"
  29299. EnforceOnKey string `json:"enforceOnKey,omitempty"`
  29300. // ExceedAction: When a request is denied, returns the HTTP response
  29301. // code specified. Valid options are "deny()" where valid values for
  29302. // status are 403, 404, 429, and 502.
  29303. ExceedAction string `json:"exceedAction,omitempty"`
  29304. // ThresholdRps: Rate in requests per second at which to begin
  29305. // ratelimiting.
  29306. ThresholdRps int64 `json:"thresholdRps,omitempty"`
  29307. // ForceSendFields is a list of field names (e.g. "BlockDuration") to
  29308. // unconditionally include in API requests. By default, fields with
  29309. // empty values are omitted from API requests. However, any non-pointer,
  29310. // non-interface field appearing in ForceSendFields will be sent to the
  29311. // server regardless of whether the field is empty or not. This may be
  29312. // used to include empty fields in Patch requests.
  29313. ForceSendFields []string `json:"-"`
  29314. // NullFields is a list of field names (e.g. "BlockDuration") to include
  29315. // in API requests with the JSON null value. By default, fields with
  29316. // empty values are omitted from API requests. However, any field with
  29317. // an empty value appearing in NullFields will be sent to the server as
  29318. // null. It is an error if a field in this list has a non-empty value.
  29319. // This may be used to include null fields in Patch requests.
  29320. NullFields []string `json:"-"`
  29321. }
  29322. func (s *SecurityPolicyRuleRateLimitOptions) MarshalJSON() ([]byte, error) {
  29323. type NoMethod SecurityPolicyRuleRateLimitOptions
  29324. raw := NoMethod(*s)
  29325. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29326. }
  29327. // SecuritySettings: The authentication and authorization settings for a
  29328. // BackendService.
  29329. type SecuritySettings struct {
  29330. // AuthenticationPolicy: Authentication policy defines what
  29331. // authentication methods can be accepted on backends, and if
  29332. // authenticated, which method/certificate will set the request
  29333. // principal.
  29334. AuthenticationPolicy *AuthenticationPolicy `json:"authenticationPolicy,omitempty"`
  29335. // AuthorizationConfig: Authorization config defines the Role Based
  29336. // Access Control (RBAC) config.
  29337. AuthorizationConfig *AuthorizationConfig `json:"authorizationConfig,omitempty"`
  29338. // ClientTlsSettings: TLS Settings for the backend service.
  29339. ClientTlsSettings *ClientTlsSettings `json:"clientTlsSettings,omitempty"`
  29340. // ServerSettingsSelector: The listener config of the XDS client is
  29341. // generated if the selector matches the client.
  29342. ServerSettingsSelector *ServerSecuritySettingsSelector `json:"serverSettingsSelector,omitempty"`
  29343. // ForceSendFields is a list of field names (e.g.
  29344. // "AuthenticationPolicy") to unconditionally include in API requests.
  29345. // By default, fields with empty values are omitted from API requests.
  29346. // However, any non-pointer, non-interface field appearing in
  29347. // ForceSendFields will be sent to the server regardless of whether the
  29348. // field is empty or not. This may be used to include empty fields in
  29349. // Patch requests.
  29350. ForceSendFields []string `json:"-"`
  29351. // NullFields is a list of field names (e.g. "AuthenticationPolicy") to
  29352. // include in API requests with the JSON null value. By default, fields
  29353. // with empty values are omitted from API requests. However, any field
  29354. // with an empty value appearing in NullFields will be sent to the
  29355. // server as null. It is an error if a field in this list has a
  29356. // non-empty value. This may be used to include null fields in Patch
  29357. // requests.
  29358. NullFields []string `json:"-"`
  29359. }
  29360. func (s *SecuritySettings) MarshalJSON() ([]byte, error) {
  29361. type NoMethod SecuritySettings
  29362. raw := NoMethod(*s)
  29363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29364. }
  29365. // SerialPortOutput: An instance's serial console output.
  29366. type SerialPortOutput struct {
  29367. // Contents: [Output Only] The contents of the console output.
  29368. Contents string `json:"contents,omitempty"`
  29369. // Kind: [Output Only] Type of the resource. Always
  29370. // compute#serialPortOutput for serial port output.
  29371. Kind string `json:"kind,omitempty"`
  29372. // Next: [Output Only] The position of the next byte of content from the
  29373. // serial console output. Use this value in the next request as the
  29374. // start parameter.
  29375. Next int64 `json:"next,omitempty,string"`
  29376. // SelfLink: [Output Only] Server-defined URL for this resource.
  29377. SelfLink string `json:"selfLink,omitempty"`
  29378. // Start: The starting byte position of the output that was returned.
  29379. // This should match the start parameter sent with the request. If the
  29380. // serial console output exceeds the size of the buffer, older output
  29381. // will be overwritten by newer content and the start values will be
  29382. // mismatched.
  29383. Start int64 `json:"start,omitempty,string"`
  29384. // ServerResponse contains the HTTP response code and headers from the
  29385. // server.
  29386. googleapi.ServerResponse `json:"-"`
  29387. // ForceSendFields is a list of field names (e.g. "Contents") to
  29388. // unconditionally include in API requests. By default, fields with
  29389. // empty values are omitted from API requests. However, any non-pointer,
  29390. // non-interface field appearing in ForceSendFields will be sent to the
  29391. // server regardless of whether the field is empty or not. This may be
  29392. // used to include empty fields in Patch requests.
  29393. ForceSendFields []string `json:"-"`
  29394. // NullFields is a list of field names (e.g. "Contents") to include in
  29395. // API requests with the JSON null value. By default, fields with empty
  29396. // values are omitted from API requests. However, any field with an
  29397. // empty value appearing in NullFields will be sent to the server as
  29398. // null. It is an error if a field in this list has a non-empty value.
  29399. // This may be used to include null fields in Patch requests.
  29400. NullFields []string `json:"-"`
  29401. }
  29402. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  29403. type NoMethod SerialPortOutput
  29404. raw := NoMethod(*s)
  29405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29406. }
  29407. type ServerBinding struct {
  29408. // Possible values:
  29409. // "RESTART_NODE_ON_ANY_SERVER"
  29410. // "RESTART_NODE_ON_MINIMAL_SERVERS"
  29411. // "SERVER_BINDING_TYPE_UNSPECIFIED"
  29412. Type string `json:"type,omitempty"`
  29413. // ForceSendFields is a list of field names (e.g. "Type") to
  29414. // unconditionally include in API requests. By default, fields with
  29415. // empty values are omitted from API requests. However, any non-pointer,
  29416. // non-interface field appearing in ForceSendFields will be sent to the
  29417. // server regardless of whether the field is empty or not. This may be
  29418. // used to include empty fields in Patch requests.
  29419. ForceSendFields []string `json:"-"`
  29420. // NullFields is a list of field names (e.g. "Type") to include in API
  29421. // requests with the JSON null value. By default, fields with empty
  29422. // values are omitted from API requests. However, any field with an
  29423. // empty value appearing in NullFields will be sent to the server as
  29424. // null. It is an error if a field in this list has a non-empty value.
  29425. // This may be used to include null fields in Patch requests.
  29426. NullFields []string `json:"-"`
  29427. }
  29428. func (s *ServerBinding) MarshalJSON() ([]byte, error) {
  29429. type NoMethod ServerBinding
  29430. raw := NoMethod(*s)
  29431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29432. }
  29433. // ServerSecuritySettingsSelector: A selector associated with the
  29434. // SecuritySettings. If the labels and port in this selector match the
  29435. // Envoy's label and port, the server side authentication and
  29436. // authorization settings are applied to the Envoy.
  29437. type ServerSecuritySettingsSelector struct {
  29438. // LabelMatches: The labels associated with the XDS client.
  29439. LabelMatches []*MetadataFilterLabelMatch `json:"labelMatches,omitempty"`
  29440. // Port: The listener port of the XDS client.
  29441. Port int64 `json:"port,omitempty"`
  29442. // ForceSendFields is a list of field names (e.g. "LabelMatches") to
  29443. // unconditionally include in API requests. By default, fields with
  29444. // empty values are omitted from API requests. However, any non-pointer,
  29445. // non-interface field appearing in ForceSendFields will be sent to the
  29446. // server regardless of whether the field is empty or not. This may be
  29447. // used to include empty fields in Patch requests.
  29448. ForceSendFields []string `json:"-"`
  29449. // NullFields is a list of field names (e.g. "LabelMatches") to include
  29450. // in API requests with the JSON null value. By default, fields with
  29451. // empty values are omitted from API requests. However, any field with
  29452. // an empty value appearing in NullFields will be sent to the server as
  29453. // null. It is an error if a field in this list has a non-empty value.
  29454. // This may be used to include null fields in Patch requests.
  29455. NullFields []string `json:"-"`
  29456. }
  29457. func (s *ServerSecuritySettingsSelector) MarshalJSON() ([]byte, error) {
  29458. type NoMethod ServerSecuritySettingsSelector
  29459. raw := NoMethod(*s)
  29460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29461. }
  29462. // ServerTlsSettings: The TLS settings for the server.
  29463. type ServerTlsSettings struct {
  29464. // ProxyTlsContext: Configures the mechanism to obtain security
  29465. // certificates and identity information.
  29466. ProxyTlsContext *TlsContext `json:"proxyTlsContext,omitempty"`
  29467. // SubjectAltNames: A list of alternate names to verify the subject
  29468. // identity in the certificate presented by the client.
  29469. SubjectAltNames []string `json:"subjectAltNames,omitempty"`
  29470. // TlsMode: Indicates whether connections should be secured using TLS.
  29471. // The value of this field determines how TLS is enforced. This field
  29472. // can be set to one of the following:
  29473. // - SIMPLE Secure connections with standard TLS semantics.
  29474. // - MUTUAL Secure connections to the backends using mutual TLS by
  29475. // presenting client certificates for authentication.
  29476. //
  29477. // Possible values:
  29478. // "INVALID"
  29479. // "MUTUAL"
  29480. // "SIMPLE"
  29481. TlsMode string `json:"tlsMode,omitempty"`
  29482. // ForceSendFields is a list of field names (e.g. "ProxyTlsContext") to
  29483. // unconditionally include in API requests. By default, fields with
  29484. // empty values are omitted from API requests. However, any non-pointer,
  29485. // non-interface field appearing in ForceSendFields will be sent to the
  29486. // server regardless of whether the field is empty or not. This may be
  29487. // used to include empty fields in Patch requests.
  29488. ForceSendFields []string `json:"-"`
  29489. // NullFields is a list of field names (e.g. "ProxyTlsContext") to
  29490. // include in API requests with the JSON null value. By default, fields
  29491. // with empty values are omitted from API requests. However, any field
  29492. // with an empty value appearing in NullFields will be sent to the
  29493. // server as null. It is an error if a field in this list has a
  29494. // non-empty value. This may be used to include null fields in Patch
  29495. // requests.
  29496. NullFields []string `json:"-"`
  29497. }
  29498. func (s *ServerTlsSettings) MarshalJSON() ([]byte, error) {
  29499. type NoMethod ServerTlsSettings
  29500. raw := NoMethod(*s)
  29501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29502. }
  29503. // ServiceAccount: A service account.
  29504. type ServiceAccount struct {
  29505. // Email: Email address of the service account.
  29506. Email string `json:"email,omitempty"`
  29507. // Scopes: The list of scopes to be made available for this service
  29508. // account.
  29509. Scopes []string `json:"scopes,omitempty"`
  29510. // ForceSendFields is a list of field names (e.g. "Email") 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. "Email") 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 *ServiceAccount) MarshalJSON() ([]byte, error) {
  29526. type NoMethod ServiceAccount
  29527. raw := NoMethod(*s)
  29528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29529. }
  29530. // ServiceAccountJwtAccessCredentials: JWT credentials for a service
  29531. // account.
  29532. type ServiceAccountJwtAccessCredentials struct {
  29533. // JsonKey: Service account key.
  29534. JsonKey string `json:"jsonKey,omitempty"`
  29535. // TokenLifetimeSeconds: The token lifetime seconds.
  29536. TokenLifetimeSeconds int64 `json:"tokenLifetimeSeconds,omitempty,string"`
  29537. // ForceSendFields is a list of field names (e.g. "JsonKey") to
  29538. // unconditionally include in API requests. By default, fields with
  29539. // empty values are omitted from API requests. However, any non-pointer,
  29540. // non-interface field appearing in ForceSendFields will be sent to the
  29541. // server regardless of whether the field is empty or not. This may be
  29542. // used to include empty fields in Patch requests.
  29543. ForceSendFields []string `json:"-"`
  29544. // NullFields is a list of field names (e.g. "JsonKey") to include in
  29545. // API requests with the JSON null value. By default, fields with empty
  29546. // values are omitted from API requests. However, any field with an
  29547. // empty value appearing in NullFields will be sent to the server as
  29548. // null. It is an error if a field in this list has a non-empty value.
  29549. // This may be used to include null fields in Patch requests.
  29550. NullFields []string `json:"-"`
  29551. }
  29552. func (s *ServiceAccountJwtAccessCredentials) MarshalJSON() ([]byte, error) {
  29553. type NoMethod ServiceAccountJwtAccessCredentials
  29554. raw := NoMethod(*s)
  29555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29556. }
  29557. // ShieldedInstanceConfig: A set of Shielded Instance options.
  29558. type ShieldedInstanceConfig struct {
  29559. // EnableIntegrityMonitoring: Defines whether the instance has integrity
  29560. // monitoring enabled.
  29561. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  29562. // EnableSecureBoot: Defines whether the instance has Secure Boot
  29563. // enabled.
  29564. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  29565. // EnableVtpm: Defines whether the instance has the vTPM enabled.
  29566. EnableVtpm bool `json:"enableVtpm,omitempty"`
  29567. // ForceSendFields is a list of field names (e.g.
  29568. // "EnableIntegrityMonitoring") to unconditionally include in API
  29569. // requests. By default, fields with empty values are omitted from API
  29570. // requests. However, any non-pointer, non-interface field appearing in
  29571. // ForceSendFields will be sent to the server regardless of whether the
  29572. // field is empty or not. This may be used to include empty fields in
  29573. // Patch requests.
  29574. ForceSendFields []string `json:"-"`
  29575. // NullFields is a list of field names (e.g.
  29576. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  29577. // null value. By default, fields with empty values are omitted from API
  29578. // requests. However, any field with an empty value appearing in
  29579. // NullFields will be sent to the server as null. It is an error if a
  29580. // field in this list has a non-empty value. This may be used to include
  29581. // null fields in Patch requests.
  29582. NullFields []string `json:"-"`
  29583. }
  29584. func (s *ShieldedInstanceConfig) MarshalJSON() ([]byte, error) {
  29585. type NoMethod ShieldedInstanceConfig
  29586. raw := NoMethod(*s)
  29587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29588. }
  29589. // ShieldedInstanceIdentity: A shielded Instance identity entry.
  29590. type ShieldedInstanceIdentity struct {
  29591. // EncryptionKey: An Endorsement Key (EK) issued to the Shielded
  29592. // Instance's vTPM.
  29593. EncryptionKey *ShieldedInstanceIdentityEntry `json:"encryptionKey,omitempty"`
  29594. // Kind: [Output Only] Type of the resource. Always
  29595. // compute#shieldedInstanceIdentity for shielded Instance identity
  29596. // entry.
  29597. Kind string `json:"kind,omitempty"`
  29598. // SigningKey: An Attestation Key (AK) issued to the Shielded Instance's
  29599. // vTPM.
  29600. SigningKey *ShieldedInstanceIdentityEntry `json:"signingKey,omitempty"`
  29601. // ServerResponse contains the HTTP response code and headers from the
  29602. // server.
  29603. googleapi.ServerResponse `json:"-"`
  29604. // ForceSendFields is a list of field names (e.g. "EncryptionKey") to
  29605. // unconditionally include in API requests. By default, fields with
  29606. // empty values are omitted from API requests. However, any non-pointer,
  29607. // non-interface field appearing in ForceSendFields will be sent to the
  29608. // server regardless of whether the field is empty or not. This may be
  29609. // used to include empty fields in Patch requests.
  29610. ForceSendFields []string `json:"-"`
  29611. // NullFields is a list of field names (e.g. "EncryptionKey") to include
  29612. // in API requests with the JSON null value. By default, fields with
  29613. // empty values are omitted from API requests. However, any field with
  29614. // an empty value appearing in NullFields will be sent to the server as
  29615. // null. It is an error if a field in this list has a non-empty value.
  29616. // This may be used to include null fields in Patch requests.
  29617. NullFields []string `json:"-"`
  29618. }
  29619. func (s *ShieldedInstanceIdentity) MarshalJSON() ([]byte, error) {
  29620. type NoMethod ShieldedInstanceIdentity
  29621. raw := NoMethod(*s)
  29622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29623. }
  29624. // ShieldedInstanceIdentityEntry: A Shielded Instance Identity Entry.
  29625. type ShieldedInstanceIdentityEntry struct {
  29626. // EkCert: A PEM-encoded X.509 certificate. This field can be empty.
  29627. EkCert string `json:"ekCert,omitempty"`
  29628. // EkPub: A PEM-encoded public key.
  29629. EkPub string `json:"ekPub,omitempty"`
  29630. // ForceSendFields is a list of field names (e.g. "EkCert") to
  29631. // unconditionally include in API requests. By default, fields with
  29632. // empty values are omitted from API requests. However, any non-pointer,
  29633. // non-interface field appearing in ForceSendFields will be sent to the
  29634. // server regardless of whether the field is empty or not. This may be
  29635. // used to include empty fields in Patch requests.
  29636. ForceSendFields []string `json:"-"`
  29637. // NullFields is a list of field names (e.g. "EkCert") to include in API
  29638. // requests with the JSON null value. By default, fields with empty
  29639. // values are omitted from API requests. However, any field with an
  29640. // empty value appearing in NullFields will be sent to the server as
  29641. // null. It is an error if a field in this list has a non-empty value.
  29642. // This may be used to include null fields in Patch requests.
  29643. NullFields []string `json:"-"`
  29644. }
  29645. func (s *ShieldedInstanceIdentityEntry) MarshalJSON() ([]byte, error) {
  29646. type NoMethod ShieldedInstanceIdentityEntry
  29647. raw := NoMethod(*s)
  29648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29649. }
  29650. // ShieldedInstanceIntegrityPolicy: The policy describes the baseline
  29651. // against which Instance boot integrity is measured.
  29652. type ShieldedInstanceIntegrityPolicy struct {
  29653. // UpdateAutoLearnPolicy: Updates the integrity policy baseline using
  29654. // the measurements from the VM instance's most recent boot.
  29655. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  29656. // ForceSendFields is a list of field names (e.g.
  29657. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  29658. // By default, fields with empty values are omitted from API requests.
  29659. // However, any non-pointer, non-interface field appearing in
  29660. // ForceSendFields will be sent to the server regardless of whether the
  29661. // field is empty or not. This may be used to include empty fields in
  29662. // Patch requests.
  29663. ForceSendFields []string `json:"-"`
  29664. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  29665. // include in API requests with the JSON null value. By default, fields
  29666. // with empty values are omitted from API requests. However, any field
  29667. // with an empty value appearing in NullFields will be sent to the
  29668. // server as null. It is an error if a field in this list has a
  29669. // non-empty value. This may be used to include null fields in Patch
  29670. // requests.
  29671. NullFields []string `json:"-"`
  29672. }
  29673. func (s *ShieldedInstanceIntegrityPolicy) MarshalJSON() ([]byte, error) {
  29674. type NoMethod ShieldedInstanceIntegrityPolicy
  29675. raw := NoMethod(*s)
  29676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29677. }
  29678. // ShieldedVmConfig: A set of Shielded VM options.
  29679. type ShieldedVmConfig struct {
  29680. // EnableIntegrityMonitoring: Defines whether the instance has integrity
  29681. // monitoring enabled.
  29682. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  29683. // EnableSecureBoot: Defines whether the instance has Secure Boot
  29684. // enabled.
  29685. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  29686. // EnableVtpm: Defines whether the instance has the vTPM enabled.
  29687. EnableVtpm bool `json:"enableVtpm,omitempty"`
  29688. // ForceSendFields is a list of field names (e.g.
  29689. // "EnableIntegrityMonitoring") to unconditionally include in API
  29690. // requests. By default, fields with empty values are omitted from API
  29691. // requests. However, any non-pointer, non-interface field appearing in
  29692. // ForceSendFields will be sent to the server regardless of whether the
  29693. // field is empty or not. This may be used to include empty fields in
  29694. // Patch requests.
  29695. ForceSendFields []string `json:"-"`
  29696. // NullFields is a list of field names (e.g.
  29697. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  29698. // null value. By default, fields with empty values are omitted from API
  29699. // requests. However, any field with an empty value appearing in
  29700. // NullFields will be sent to the server as null. It is an error if a
  29701. // field in this list has a non-empty value. This may be used to include
  29702. // null fields in Patch requests.
  29703. NullFields []string `json:"-"`
  29704. }
  29705. func (s *ShieldedVmConfig) MarshalJSON() ([]byte, error) {
  29706. type NoMethod ShieldedVmConfig
  29707. raw := NoMethod(*s)
  29708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29709. }
  29710. // ShieldedVmIdentity: A shielded VM identity entry.
  29711. type ShieldedVmIdentity struct {
  29712. // EncryptionKey: An Endorsement Key (EK) issued to the Shielded VM's
  29713. // vTPM.
  29714. EncryptionKey *ShieldedVmIdentityEntry `json:"encryptionKey,omitempty"`
  29715. // Kind: [Output Only] Type of the resource. Always
  29716. // compute#shieldedVmIdentity for shielded VM identity entry.
  29717. Kind string `json:"kind,omitempty"`
  29718. // SigningKey: An Attestation Key (AK) issued to the Shielded VM's vTPM.
  29719. SigningKey *ShieldedVmIdentityEntry `json:"signingKey,omitempty"`
  29720. // ServerResponse contains the HTTP response code and headers from the
  29721. // server.
  29722. googleapi.ServerResponse `json:"-"`
  29723. // ForceSendFields is a list of field names (e.g. "EncryptionKey") to
  29724. // unconditionally include in API requests. By default, fields with
  29725. // empty values are omitted from API requests. However, any non-pointer,
  29726. // non-interface field appearing in ForceSendFields will be sent to the
  29727. // server regardless of whether the field is empty or not. This may be
  29728. // used to include empty fields in Patch requests.
  29729. ForceSendFields []string `json:"-"`
  29730. // NullFields is a list of field names (e.g. "EncryptionKey") to include
  29731. // in API requests with the JSON null value. By default, fields with
  29732. // empty values are omitted from API requests. However, any field with
  29733. // an empty value appearing in NullFields will be sent to the server as
  29734. // null. It is an error if a field in this list has a non-empty value.
  29735. // This may be used to include null fields in Patch requests.
  29736. NullFields []string `json:"-"`
  29737. }
  29738. func (s *ShieldedVmIdentity) MarshalJSON() ([]byte, error) {
  29739. type NoMethod ShieldedVmIdentity
  29740. raw := NoMethod(*s)
  29741. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29742. }
  29743. // ShieldedVmIdentityEntry: A Shielded Instance Identity Entry.
  29744. type ShieldedVmIdentityEntry struct {
  29745. // EkCert: A PEM-encoded X.509 certificate. This field can be empty.
  29746. EkCert string `json:"ekCert,omitempty"`
  29747. // EkPub: A PEM-encoded public key.
  29748. EkPub string `json:"ekPub,omitempty"`
  29749. // ForceSendFields is a list of field names (e.g. "EkCert") to
  29750. // unconditionally include in API requests. By default, fields with
  29751. // empty values are omitted from API requests. However, any non-pointer,
  29752. // non-interface field appearing in ForceSendFields will be sent to the
  29753. // server regardless of whether the field is empty or not. This may be
  29754. // used to include empty fields in Patch requests.
  29755. ForceSendFields []string `json:"-"`
  29756. // NullFields is a list of field names (e.g. "EkCert") to include in API
  29757. // requests with the JSON null value. By default, fields with empty
  29758. // values are omitted from API requests. However, any field with an
  29759. // empty value appearing in NullFields will be sent to the server as
  29760. // null. It is an error if a field in this list has a non-empty value.
  29761. // This may be used to include null fields in Patch requests.
  29762. NullFields []string `json:"-"`
  29763. }
  29764. func (s *ShieldedVmIdentityEntry) MarshalJSON() ([]byte, error) {
  29765. type NoMethod ShieldedVmIdentityEntry
  29766. raw := NoMethod(*s)
  29767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29768. }
  29769. // ShieldedVmIntegrityPolicy: The policy describes the baseline against
  29770. // which VM instance boot integrity is measured.
  29771. type ShieldedVmIntegrityPolicy struct {
  29772. // UpdateAutoLearnPolicy: Updates the integrity policy baseline using
  29773. // the measurements from the VM instance's most recent boot.
  29774. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  29775. // ForceSendFields is a list of field names (e.g.
  29776. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  29777. // By default, fields with empty values are omitted from API requests.
  29778. // However, any non-pointer, non-interface field appearing in
  29779. // ForceSendFields will be sent to the server regardless of whether the
  29780. // field is empty or not. This may be used to include empty fields in
  29781. // Patch requests.
  29782. ForceSendFields []string `json:"-"`
  29783. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  29784. // include in API requests with the JSON null value. By default, fields
  29785. // with empty values are omitted from API requests. However, any field
  29786. // with an empty value appearing in NullFields will be sent to the
  29787. // server as null. It is an error if a field in this list has a
  29788. // non-empty value. This may be used to include null fields in Patch
  29789. // requests.
  29790. NullFields []string `json:"-"`
  29791. }
  29792. func (s *ShieldedVmIntegrityPolicy) MarshalJSON() ([]byte, error) {
  29793. type NoMethod ShieldedVmIntegrityPolicy
  29794. raw := NoMethod(*s)
  29795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29796. }
  29797. // SignedUrlKey: Represents a customer-supplied Signing Key used by
  29798. // Cloud CDN Signed URLs
  29799. type SignedUrlKey struct {
  29800. // KeyName: Name of the key. The name must be 1-63 characters long, and
  29801. // comply with RFC1035. Specifically, the name must be 1-63 characters
  29802. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  29803. // which means the first character must be a lowercase letter, and all
  29804. // following characters must be a dash, lowercase letter, or digit,
  29805. // except the last character, which cannot be a dash.
  29806. KeyName string `json:"keyName,omitempty"`
  29807. // KeyValue: 128-bit key value used for signing the URL. The key value
  29808. // must be a valid RFC 4648 Section 5 base64url encoded string.
  29809. KeyValue string `json:"keyValue,omitempty"`
  29810. // ForceSendFields is a list of field names (e.g. "KeyName") to
  29811. // unconditionally include in API requests. By default, fields with
  29812. // empty values are omitted from API requests. However, any non-pointer,
  29813. // non-interface field appearing in ForceSendFields will be sent to the
  29814. // server regardless of whether the field is empty or not. This may be
  29815. // used to include empty fields in Patch requests.
  29816. ForceSendFields []string `json:"-"`
  29817. // NullFields is a list of field names (e.g. "KeyName") to include in
  29818. // API requests with the JSON null value. By default, fields with empty
  29819. // values are omitted from API requests. However, any field with an
  29820. // empty value appearing in NullFields will be sent to the server as
  29821. // null. It is an error if a field in this list has a non-empty value.
  29822. // This may be used to include null fields in Patch requests.
  29823. NullFields []string `json:"-"`
  29824. }
  29825. func (s *SignedUrlKey) MarshalJSON() ([]byte, error) {
  29826. type NoMethod SignedUrlKey
  29827. raw := NoMethod(*s)
  29828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29829. }
  29830. // Snapshot: A persistent disk snapshot resource. (== resource_for
  29831. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  29832. type Snapshot struct {
  29833. // AutoCreated: [Output Only] Set to true if snapshots are automatically
  29834. // by applying resource policy on the target disk.
  29835. AutoCreated bool `json:"autoCreated,omitempty"`
  29836. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  29837. // format.
  29838. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  29839. // Description: An optional description of this resource. Provide this
  29840. // property when you create the resource.
  29841. Description string `json:"description,omitempty"`
  29842. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  29843. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  29844. // GuestOsFeatures: [Output Only] A list of features to enable on the
  29845. // guest operating system. Applicable only for bootable images. Read
  29846. // Enabling guest operating system features to see a list of available
  29847. // options.
  29848. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  29849. // Id: [Output Only] The unique identifier for the resource. This
  29850. // identifier is defined by the server.
  29851. Id uint64 `json:"id,omitempty,string"`
  29852. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  29853. // Snapshot resources.
  29854. Kind string `json:"kind,omitempty"`
  29855. // LabelFingerprint: A fingerprint for the labels being applied to this
  29856. // snapshot, which is essentially a hash of the labels set used for
  29857. // optimistic locking. The fingerprint is initially generated by Compute
  29858. // Engine and changes after every request to modify or update labels.
  29859. // You must always provide an up-to-date fingerprint hash in order to
  29860. // update or change labels, otherwise the request will fail with error
  29861. // 412 conditionNotMet.
  29862. //
  29863. // To see the latest fingerprint, make a get() request to retrieve a
  29864. // snapshot.
  29865. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  29866. // Labels: Labels to apply to this snapshot. These can be later modified
  29867. // by the setLabels method. Label values may be empty.
  29868. Labels map[string]string `json:"labels,omitempty"`
  29869. // LicenseCodes: [Output Only] Integer license codes indicating which
  29870. // licenses are attached to this snapshot.
  29871. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  29872. // Licenses: [Output Only] A list of public visible licenses that apply
  29873. // to this snapshot. This can be because the original image had licenses
  29874. // attached (such as a Windows image).
  29875. Licenses []string `json:"licenses,omitempty"`
  29876. // Name: Name of the resource; provided by the client when the resource
  29877. // is created. The name must be 1-63 characters long, and comply with
  29878. // RFC1035. Specifically, the name must be 1-63 characters long and
  29879. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  29880. // the first character must be a lowercase letter, and all following
  29881. // characters must be a dash, lowercase letter, or digit, except the
  29882. // last character, which cannot be a dash.
  29883. Name string `json:"name,omitempty"`
  29884. // SelfLink: [Output Only] Server-defined URL for the resource.
  29885. SelfLink string `json:"selfLink,omitempty"`
  29886. // SelfLinkWithId: [Output Only] Server-defined URL for this resource's
  29887. // resource id.
  29888. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  29889. // SnapshotEncryptionKey: Encrypts the snapshot using a
  29890. // customer-supplied encryption key.
  29891. //
  29892. // After you encrypt a snapshot using a customer-supplied key, you must
  29893. // provide the same key if you use the snapshot later. For example, you
  29894. // must provide the encryption key when you create a disk from the
  29895. // encrypted snapshot in a future request.
  29896. //
  29897. // Customer-supplied encryption keys do not protect access to metadata
  29898. // of the snapshot.
  29899. //
  29900. // If you do not provide an encryption key when creating the snapshot,
  29901. // then the snapshot will be encrypted using an automatically generated
  29902. // key and you do not need to provide a key to use the snapshot later.
  29903. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  29904. // SourceDisk: [Output Only] The source disk used to create this
  29905. // snapshot.
  29906. SourceDisk string `json:"sourceDisk,omitempty"`
  29907. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  29908. // source disk. Required if the source disk is protected by a
  29909. // customer-supplied encryption key.
  29910. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  29911. // SourceDiskId: [Output Only] The ID value of the disk used to create
  29912. // this snapshot. This value may be used to determine whether the
  29913. // snapshot was taken from the current or a previous instance of a given
  29914. // disk name.
  29915. SourceDiskId string `json:"sourceDiskId,omitempty"`
  29916. // Status: [Output Only] The status of the snapshot. This can be
  29917. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  29918. //
  29919. // Possible values:
  29920. // "CREATING"
  29921. // "DELETING"
  29922. // "FAILED"
  29923. // "READY"
  29924. // "UPLOADING"
  29925. Status string `json:"status,omitempty"`
  29926. // StorageBytes: [Output Only] A size of the storage used by the
  29927. // snapshot. As snapshots share storage, this number is expected to
  29928. // change with snapshot creation/deletion.
  29929. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  29930. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  29931. // is in a stable state or it is being adjusted as a result of shared
  29932. // storage reallocation. This status can either be UPDATING, meaning the
  29933. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  29934. // size of the snapshot is up-to-date.
  29935. //
  29936. // Possible values:
  29937. // "UPDATING"
  29938. // "UP_TO_DATE"
  29939. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  29940. // StorageLocations: GCS bucket storage location of the snapshot
  29941. // (regional or multi-regional).
  29942. StorageLocations []string `json:"storageLocations,omitempty"`
  29943. // ServerResponse contains the HTTP response code and headers from the
  29944. // server.
  29945. googleapi.ServerResponse `json:"-"`
  29946. // ForceSendFields is a list of field names (e.g. "AutoCreated") to
  29947. // unconditionally include in API requests. By default, fields with
  29948. // empty values are omitted from API requests. However, any non-pointer,
  29949. // non-interface field appearing in ForceSendFields will be sent to the
  29950. // server regardless of whether the field is empty or not. This may be
  29951. // used to include empty fields in Patch requests.
  29952. ForceSendFields []string `json:"-"`
  29953. // NullFields is a list of field names (e.g. "AutoCreated") to include
  29954. // in API requests with the JSON null value. By default, fields with
  29955. // empty values are omitted from API requests. However, any field with
  29956. // an empty value appearing in NullFields will be sent to the server as
  29957. // null. It is an error if a field in this list has a non-empty value.
  29958. // This may be used to include null fields in Patch requests.
  29959. NullFields []string `json:"-"`
  29960. }
  29961. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  29962. type NoMethod Snapshot
  29963. raw := NoMethod(*s)
  29964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29965. }
  29966. // SnapshotList: Contains a list of Snapshot resources.
  29967. type SnapshotList struct {
  29968. // Id: [Output Only] Unique identifier for the resource; defined by the
  29969. // server.
  29970. Id string `json:"id,omitempty"`
  29971. // Items: A list of Snapshot resources.
  29972. Items []*Snapshot `json:"items,omitempty"`
  29973. // Kind: Type of resource.
  29974. Kind string `json:"kind,omitempty"`
  29975. // NextPageToken: [Output Only] This token allows you to get the next
  29976. // page of results for list requests. If the number of results is larger
  29977. // than maxResults, use the nextPageToken as a value for the query
  29978. // parameter pageToken in the next list request. Subsequent list
  29979. // requests will have their own nextPageToken to continue paging through
  29980. // the results.
  29981. NextPageToken string `json:"nextPageToken,omitempty"`
  29982. // SelfLink: [Output Only] Server-defined URL for this resource.
  29983. SelfLink string `json:"selfLink,omitempty"`
  29984. // Warning: [Output Only] Informational warning message.
  29985. Warning *SnapshotListWarning `json:"warning,omitempty"`
  29986. // ServerResponse contains the HTTP response code and headers from the
  29987. // server.
  29988. googleapi.ServerResponse `json:"-"`
  29989. // ForceSendFields is a list of field names (e.g. "Id") to
  29990. // unconditionally include in API requests. By default, fields with
  29991. // empty values are omitted from API requests. However, any non-pointer,
  29992. // non-interface field appearing in ForceSendFields will be sent to the
  29993. // server regardless of whether the field is empty or not. This may be
  29994. // used to include empty fields in Patch requests.
  29995. ForceSendFields []string `json:"-"`
  29996. // NullFields is a list of field names (e.g. "Id") to include in API
  29997. // requests with the JSON null value. By default, fields with empty
  29998. // values are omitted from API requests. However, any field with an
  29999. // empty value appearing in NullFields will be sent to the server as
  30000. // null. It is an error if a field in this list has a non-empty value.
  30001. // This may be used to include null fields in Patch requests.
  30002. NullFields []string `json:"-"`
  30003. }
  30004. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  30005. type NoMethod SnapshotList
  30006. raw := NoMethod(*s)
  30007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30008. }
  30009. // SnapshotListWarning: [Output Only] Informational warning message.
  30010. type SnapshotListWarning struct {
  30011. // Code: [Output Only] A warning code, if applicable. For example,
  30012. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30013. // the response.
  30014. //
  30015. // Possible values:
  30016. // "CLEANUP_FAILED"
  30017. // "DEPRECATED_RESOURCE_USED"
  30018. // "DEPRECATED_TYPE_USED"
  30019. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30020. // "EXPERIMENTAL_TYPE_USED"
  30021. // "EXTERNAL_API_WARNING"
  30022. // "FIELD_VALUE_OVERRIDEN"
  30023. // "INJECTED_KERNELS_DEPRECATED"
  30024. // "MISSING_TYPE_DEPENDENCY"
  30025. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30026. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30027. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30028. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30029. // "NEXT_HOP_NOT_RUNNING"
  30030. // "NOT_CRITICAL_ERROR"
  30031. // "NO_RESULTS_ON_PAGE"
  30032. // "REQUIRED_TOS_AGREEMENT"
  30033. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30034. // "RESOURCE_NOT_DELETED"
  30035. // "SCHEMA_VALIDATION_IGNORED"
  30036. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30037. // "UNDECLARED_PROPERTIES"
  30038. // "UNREACHABLE"
  30039. Code string `json:"code,omitempty"`
  30040. // Data: [Output Only] Metadata about this warning in key: value format.
  30041. // For example:
  30042. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30043. Data []*SnapshotListWarningData `json:"data,omitempty"`
  30044. // Message: [Output Only] A human-readable description of the warning
  30045. // code.
  30046. Message string `json:"message,omitempty"`
  30047. // ForceSendFields is a list of field names (e.g. "Code") to
  30048. // unconditionally include in API requests. By default, fields with
  30049. // empty values are omitted from API requests. However, any non-pointer,
  30050. // non-interface field appearing in ForceSendFields will be sent to the
  30051. // server regardless of whether the field is empty or not. This may be
  30052. // used to include empty fields in Patch requests.
  30053. ForceSendFields []string `json:"-"`
  30054. // NullFields is a list of field names (e.g. "Code") to include in API
  30055. // requests with the JSON null value. By default, fields with empty
  30056. // values are omitted from API requests. However, any field with an
  30057. // empty value appearing in NullFields will be sent to the server as
  30058. // null. It is an error if a field in this list has a non-empty value.
  30059. // This may be used to include null fields in Patch requests.
  30060. NullFields []string `json:"-"`
  30061. }
  30062. func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  30063. type NoMethod SnapshotListWarning
  30064. raw := NoMethod(*s)
  30065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30066. }
  30067. type SnapshotListWarningData struct {
  30068. // Key: [Output Only] A key that provides more detail on the warning
  30069. // being returned. For example, for warnings where there are no results
  30070. // in a list request for a particular zone, this key might be scope and
  30071. // the key value might be the zone name. Other examples might be a key
  30072. // indicating a deprecated resource and a suggested replacement, or a
  30073. // warning about invalid network settings (for example, if an instance
  30074. // attempts to perform IP forwarding but is not enabled for IP
  30075. // forwarding).
  30076. Key string `json:"key,omitempty"`
  30077. // Value: [Output Only] A warning data value corresponding to the key.
  30078. Value string `json:"value,omitempty"`
  30079. // ForceSendFields is a list of field names (e.g. "Key") to
  30080. // unconditionally include in API requests. By default, fields with
  30081. // empty values are omitted from API requests. However, any non-pointer,
  30082. // non-interface field appearing in ForceSendFields will be sent to the
  30083. // server regardless of whether the field is empty or not. This may be
  30084. // used to include empty fields in Patch requests.
  30085. ForceSendFields []string `json:"-"`
  30086. // NullFields is a list of field names (e.g. "Key") to include in API
  30087. // requests with the JSON null value. By default, fields with empty
  30088. // values are omitted from API requests. However, any field with an
  30089. // empty value appearing in NullFields will be sent to the server as
  30090. // null. It is an error if a field in this list has a non-empty value.
  30091. // This may be used to include null fields in Patch requests.
  30092. NullFields []string `json:"-"`
  30093. }
  30094. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  30095. type NoMethod SnapshotListWarningData
  30096. raw := NoMethod(*s)
  30097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30098. }
  30099. // SourceInstanceParams: A specification of the parameters to use when
  30100. // creating the instance template from a source instance.
  30101. type SourceInstanceParams struct {
  30102. // DiskConfigs: Attached disks configuration. If not provided, defaults
  30103. // are applied: For boot disk and any other R/W disks, new custom images
  30104. // will be created from each disk. For read-only disks, they will be
  30105. // attached in read-only mode. Local SSD disks will be created as blank
  30106. // volumes.
  30107. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  30108. // ForceSendFields is a list of field names (e.g. "DiskConfigs") to
  30109. // unconditionally include in API requests. By default, fields with
  30110. // empty values are omitted from API requests. However, any non-pointer,
  30111. // non-interface field appearing in ForceSendFields will be sent to the
  30112. // server regardless of whether the field is empty or not. This may be
  30113. // used to include empty fields in Patch requests.
  30114. ForceSendFields []string `json:"-"`
  30115. // NullFields is a list of field names (e.g. "DiskConfigs") to include
  30116. // in API requests with the JSON null value. By default, fields with
  30117. // empty values are omitted from API requests. However, any field with
  30118. // an empty value appearing in NullFields will be sent to the server as
  30119. // null. It is an error if a field in this list has a non-empty value.
  30120. // This may be used to include null fields in Patch requests.
  30121. NullFields []string `json:"-"`
  30122. }
  30123. func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  30124. type NoMethod SourceInstanceParams
  30125. raw := NoMethod(*s)
  30126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30127. }
  30128. type SourceInstanceProperties struct {
  30129. // CanIpForward: Enables instances created based on this machine image
  30130. // to send packets with source IP addresses other than their own and
  30131. // receive packets with destination IP addresses other than their own.
  30132. // If these instances will be used as an IP gateway or it will be set as
  30133. // the next-hop in a Route resource, specify true. If unsure, leave this
  30134. // set to false. See the Enable IP forwarding documentation for more
  30135. // information.
  30136. CanIpForward bool `json:"canIpForward,omitempty"`
  30137. // DeletionProtection: Whether the instance created from this machine
  30138. // image should be protected against deletion.
  30139. DeletionProtection bool `json:"deletionProtection,omitempty"`
  30140. // Description: An optional text description for the instances that are
  30141. // created from this machine image.
  30142. Description string `json:"description,omitempty"`
  30143. // Disks: An array of disks that are associated with the instances that
  30144. // are created from this machine image.
  30145. Disks []*SavedAttachedDisk `json:"disks,omitempty"`
  30146. // GuestAccelerators: A list of guest accelerator cards' type and count
  30147. // to use for instances created from this machine image.
  30148. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  30149. // Labels: Labels to apply to instances that are created from this
  30150. // machine image.
  30151. Labels map[string]string `json:"labels,omitempty"`
  30152. // MachineType: The machine type to use for instances that are created
  30153. // from this machine image.
  30154. MachineType string `json:"machineType,omitempty"`
  30155. // Metadata: The metadata key/value pairs to assign to instances that
  30156. // are created from this machine image. These pairs can consist of
  30157. // custom metadata or predefined keys. See Project and instance metadata
  30158. // for more information.
  30159. Metadata *Metadata `json:"metadata,omitempty"`
  30160. // MinCpuPlatform: Minimum cpu/platform to be used by instances created
  30161. // from this machine image. The instance may be scheduled on the
  30162. // specified or newer cpu/platform. Applicable values are the friendly
  30163. // names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or
  30164. // minCpuPlatform: "Intel Sandy Bridge". For more information, read
  30165. // Specifying a Minimum CPU Platform.
  30166. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  30167. // NetworkInterfaces: An array of network access configurations for this
  30168. // interface.
  30169. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  30170. // Scheduling: Specifies the scheduling options for the instances that
  30171. // are created from this machine image.
  30172. Scheduling *Scheduling `json:"scheduling,omitempty"`
  30173. // ServiceAccounts: A list of service accounts with specified scopes.
  30174. // Access tokens for these service accounts are available to the
  30175. // instances that are created from this machine image. Use metadata
  30176. // queries to obtain the access tokens for these instances.
  30177. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  30178. // Tags: A list of tags to apply to the instances that are created from
  30179. // this machine image. The tags identify valid sources or targets for
  30180. // network firewalls. The setTags method can modify this list of tags.
  30181. // Each tag within the list must comply with RFC1035.
  30182. Tags *Tags `json:"tags,omitempty"`
  30183. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  30184. // unconditionally include in API requests. By default, fields with
  30185. // empty values are omitted from API requests. However, any non-pointer,
  30186. // non-interface field appearing in ForceSendFields will be sent to the
  30187. // server regardless of whether the field is empty or not. This may be
  30188. // used to include empty fields in Patch requests.
  30189. ForceSendFields []string `json:"-"`
  30190. // NullFields is a list of field names (e.g. "CanIpForward") to include
  30191. // in API requests with the JSON null value. By default, fields with
  30192. // empty values are omitted from API requests. However, any field with
  30193. // an empty value appearing in NullFields will be sent to the server as
  30194. // null. It is an error if a field in this list has a non-empty value.
  30195. // This may be used to include null fields in Patch requests.
  30196. NullFields []string `json:"-"`
  30197. }
  30198. func (s *SourceInstanceProperties) MarshalJSON() ([]byte, error) {
  30199. type NoMethod SourceInstanceProperties
  30200. raw := NoMethod(*s)
  30201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30202. }
  30203. // SslCertificate: An SslCertificate resource. This resource provides a
  30204. // mechanism to upload an SSL key and certificate to the load balancer
  30205. // to serve secure connections from the user. (== resource_for
  30206. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  30207. type SslCertificate struct {
  30208. // Certificate: A local certificate file. The certificate must be in PEM
  30209. // format. The certificate chain must be no greater than 5 certs long.
  30210. // The chain must include at least one intermediate cert.
  30211. Certificate string `json:"certificate,omitempty"`
  30212. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  30213. // format.
  30214. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  30215. // Description: An optional description of this resource. Provide this
  30216. // property when you create the resource.
  30217. Description string `json:"description,omitempty"`
  30218. // ExpireTime: [Output Only] Expire time of the certificate. RFC3339
  30219. ExpireTime string `json:"expireTime,omitempty"`
  30220. // Id: [Output Only] The unique identifier for the resource. This
  30221. // identifier is defined by the server.
  30222. Id uint64 `json:"id,omitempty,string"`
  30223. // Kind: [Output Only] Type of the resource. Always
  30224. // compute#sslCertificate for SSL certificates.
  30225. Kind string `json:"kind,omitempty"`
  30226. // Managed: Configuration and status of a managed SSL certificate.
  30227. Managed *SslCertificateManagedSslCertificate `json:"managed,omitempty"`
  30228. // Name: Name of the resource. Provided by the client when the resource
  30229. // is created. The name must be 1-63 characters long, and comply with
  30230. // RFC1035. Specifically, the name must be 1-63 characters long and
  30231. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  30232. // the first character must be a lowercase letter, and all following
  30233. // characters must be a dash, lowercase letter, or digit, except the
  30234. // last character, which cannot be a dash.
  30235. Name string `json:"name,omitempty"`
  30236. // PrivateKey: A write-only private key in PEM format. Only insert
  30237. // requests will include this field.
  30238. PrivateKey string `json:"privateKey,omitempty"`
  30239. // Region: [Output Only] URL of the region where the regional SSL
  30240. // Certificate resides. This field is not applicable to global SSL
  30241. // Certificate.
  30242. Region string `json:"region,omitempty"`
  30243. // SelfLink: [Output only] Server-defined URL for the resource.
  30244. SelfLink string `json:"selfLink,omitempty"`
  30245. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  30246. // with the resource id.
  30247. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  30248. // SelfManaged: Configuration and status of a self-managed SSL
  30249. // certificate.
  30250. SelfManaged *SslCertificateSelfManagedSslCertificate `json:"selfManaged,omitempty"`
  30251. // SubjectAlternativeNames: [Output Only] Domains associated with the
  30252. // certificate via Subject Alternative Name.
  30253. SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`
  30254. // Type: (Optional) Specifies the type of SSL certificate, either
  30255. // "SELF_MANAGED" or "MANAGED". If not specified, the certificate is
  30256. // self-managed and the fields certificate and private_key are used.
  30257. //
  30258. // Possible values:
  30259. // "MANAGED"
  30260. // "SELF_MANAGED"
  30261. // "TYPE_UNSPECIFIED"
  30262. Type string `json:"type,omitempty"`
  30263. // ServerResponse contains the HTTP response code and headers from the
  30264. // server.
  30265. googleapi.ServerResponse `json:"-"`
  30266. // ForceSendFields is a list of field names (e.g. "Certificate") to
  30267. // unconditionally include in API requests. By default, fields with
  30268. // empty values are omitted from API requests. However, any non-pointer,
  30269. // non-interface field appearing in ForceSendFields will be sent to the
  30270. // server regardless of whether the field is empty or not. This may be
  30271. // used to include empty fields in Patch requests.
  30272. ForceSendFields []string `json:"-"`
  30273. // NullFields is a list of field names (e.g. "Certificate") to include
  30274. // in API requests with the JSON null value. By default, fields with
  30275. // empty values are omitted from API requests. However, any field with
  30276. // an empty value appearing in NullFields will be sent to the server as
  30277. // null. It is an error if a field in this list has a non-empty value.
  30278. // This may be used to include null fields in Patch requests.
  30279. NullFields []string `json:"-"`
  30280. }
  30281. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  30282. type NoMethod SslCertificate
  30283. raw := NoMethod(*s)
  30284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30285. }
  30286. type SslCertificateAggregatedList struct {
  30287. // Id: [Output Only] Unique identifier for the resource; defined by the
  30288. // server.
  30289. Id string `json:"id,omitempty"`
  30290. // Items: A list of SslCertificatesScopedList resources.
  30291. Items map[string]SslCertificatesScopedList `json:"items,omitempty"`
  30292. // Kind: [Output Only] Type of resource. Always
  30293. // compute#sslCertificateAggregatedList for lists of SSL Certificates.
  30294. Kind string `json:"kind,omitempty"`
  30295. // NextPageToken: [Output Only] This token allows you to get the next
  30296. // page of results for list requests. If the number of results is larger
  30297. // than maxResults, use the nextPageToken as a value for the query
  30298. // parameter pageToken in the next list request. Subsequent list
  30299. // requests will have their own nextPageToken to continue paging through
  30300. // the results.
  30301. NextPageToken string `json:"nextPageToken,omitempty"`
  30302. // SelfLink: [Output Only] Server-defined URL for this resource.
  30303. SelfLink string `json:"selfLink,omitempty"`
  30304. // Warning: [Output Only] Informational warning message.
  30305. Warning *SslCertificateAggregatedListWarning `json:"warning,omitempty"`
  30306. // ServerResponse contains the HTTP response code and headers from the
  30307. // server.
  30308. googleapi.ServerResponse `json:"-"`
  30309. // ForceSendFields is a list of field names (e.g. "Id") to
  30310. // unconditionally include in API requests. By default, fields with
  30311. // empty values are omitted from API requests. However, any non-pointer,
  30312. // non-interface field appearing in ForceSendFields will be sent to the
  30313. // server regardless of whether the field is empty or not. This may be
  30314. // used to include empty fields in Patch requests.
  30315. ForceSendFields []string `json:"-"`
  30316. // NullFields is a list of field names (e.g. "Id") to include in API
  30317. // requests with the JSON null value. By default, fields with empty
  30318. // values are omitted from API requests. However, any field with an
  30319. // empty value appearing in NullFields will be sent to the server as
  30320. // null. It is an error if a field in this list has a non-empty value.
  30321. // This may be used to include null fields in Patch requests.
  30322. NullFields []string `json:"-"`
  30323. }
  30324. func (s *SslCertificateAggregatedList) MarshalJSON() ([]byte, error) {
  30325. type NoMethod SslCertificateAggregatedList
  30326. raw := NoMethod(*s)
  30327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30328. }
  30329. // SslCertificateAggregatedListWarning: [Output Only] Informational
  30330. // warning message.
  30331. type SslCertificateAggregatedListWarning struct {
  30332. // Code: [Output Only] A warning code, if applicable. For example,
  30333. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30334. // the response.
  30335. //
  30336. // Possible values:
  30337. // "CLEANUP_FAILED"
  30338. // "DEPRECATED_RESOURCE_USED"
  30339. // "DEPRECATED_TYPE_USED"
  30340. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30341. // "EXPERIMENTAL_TYPE_USED"
  30342. // "EXTERNAL_API_WARNING"
  30343. // "FIELD_VALUE_OVERRIDEN"
  30344. // "INJECTED_KERNELS_DEPRECATED"
  30345. // "MISSING_TYPE_DEPENDENCY"
  30346. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30347. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30348. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30349. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30350. // "NEXT_HOP_NOT_RUNNING"
  30351. // "NOT_CRITICAL_ERROR"
  30352. // "NO_RESULTS_ON_PAGE"
  30353. // "REQUIRED_TOS_AGREEMENT"
  30354. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30355. // "RESOURCE_NOT_DELETED"
  30356. // "SCHEMA_VALIDATION_IGNORED"
  30357. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30358. // "UNDECLARED_PROPERTIES"
  30359. // "UNREACHABLE"
  30360. Code string `json:"code,omitempty"`
  30361. // Data: [Output Only] Metadata about this warning in key: value format.
  30362. // For example:
  30363. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30364. Data []*SslCertificateAggregatedListWarningData `json:"data,omitempty"`
  30365. // Message: [Output Only] A human-readable description of the warning
  30366. // code.
  30367. Message string `json:"message,omitempty"`
  30368. // ForceSendFields is a list of field names (e.g. "Code") to
  30369. // unconditionally include in API requests. By default, fields with
  30370. // empty values are omitted from API requests. However, any non-pointer,
  30371. // non-interface field appearing in ForceSendFields will be sent to the
  30372. // server regardless of whether the field is empty or not. This may be
  30373. // used to include empty fields in Patch requests.
  30374. ForceSendFields []string `json:"-"`
  30375. // NullFields is a list of field names (e.g. "Code") to include in API
  30376. // requests with the JSON null value. By default, fields with empty
  30377. // values are omitted from API requests. However, any field with an
  30378. // empty value appearing in NullFields will be sent to the server as
  30379. // null. It is an error if a field in this list has a non-empty value.
  30380. // This may be used to include null fields in Patch requests.
  30381. NullFields []string `json:"-"`
  30382. }
  30383. func (s *SslCertificateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  30384. type NoMethod SslCertificateAggregatedListWarning
  30385. raw := NoMethod(*s)
  30386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30387. }
  30388. type SslCertificateAggregatedListWarningData struct {
  30389. // Key: [Output Only] A key that provides more detail on the warning
  30390. // being returned. For example, for warnings where there are no results
  30391. // in a list request for a particular zone, this key might be scope and
  30392. // the key value might be the zone name. Other examples might be a key
  30393. // indicating a deprecated resource and a suggested replacement, or a
  30394. // warning about invalid network settings (for example, if an instance
  30395. // attempts to perform IP forwarding but is not enabled for IP
  30396. // forwarding).
  30397. Key string `json:"key,omitempty"`
  30398. // Value: [Output Only] A warning data value corresponding to the key.
  30399. Value string `json:"value,omitempty"`
  30400. // ForceSendFields is a list of field names (e.g. "Key") to
  30401. // unconditionally include in API requests. By default, fields with
  30402. // empty values are omitted from API requests. However, any non-pointer,
  30403. // non-interface field appearing in ForceSendFields will be sent to the
  30404. // server regardless of whether the field is empty or not. This may be
  30405. // used to include empty fields in Patch requests.
  30406. ForceSendFields []string `json:"-"`
  30407. // NullFields is a list of field names (e.g. "Key") to include in API
  30408. // requests with the JSON null value. By default, fields with empty
  30409. // values are omitted from API requests. However, any field with an
  30410. // empty value appearing in NullFields will be sent to the server as
  30411. // null. It is an error if a field in this list has a non-empty value.
  30412. // This may be used to include null fields in Patch requests.
  30413. NullFields []string `json:"-"`
  30414. }
  30415. func (s *SslCertificateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  30416. type NoMethod SslCertificateAggregatedListWarningData
  30417. raw := NoMethod(*s)
  30418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30419. }
  30420. // SslCertificateList: Contains a list of SslCertificate resources.
  30421. type SslCertificateList struct {
  30422. // Id: [Output Only] Unique identifier for the resource; defined by the
  30423. // server.
  30424. Id string `json:"id,omitempty"`
  30425. // Items: A list of SslCertificate resources.
  30426. Items []*SslCertificate `json:"items,omitempty"`
  30427. // Kind: Type of resource.
  30428. Kind string `json:"kind,omitempty"`
  30429. // NextPageToken: [Output Only] This token allows you to get the next
  30430. // page of results for list requests. If the number of results is larger
  30431. // than maxResults, use the nextPageToken as a value for the query
  30432. // parameter pageToken in the next list request. Subsequent list
  30433. // requests will have their own nextPageToken to continue paging through
  30434. // the results.
  30435. NextPageToken string `json:"nextPageToken,omitempty"`
  30436. // SelfLink: [Output Only] Server-defined URL for this resource.
  30437. SelfLink string `json:"selfLink,omitempty"`
  30438. // Warning: [Output Only] Informational warning message.
  30439. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  30440. // ServerResponse contains the HTTP response code and headers from the
  30441. // server.
  30442. googleapi.ServerResponse `json:"-"`
  30443. // ForceSendFields is a list of field names (e.g. "Id") to
  30444. // unconditionally include in API requests. By default, fields with
  30445. // empty values are omitted from API requests. However, any non-pointer,
  30446. // non-interface field appearing in ForceSendFields will be sent to the
  30447. // server regardless of whether the field is empty or not. This may be
  30448. // used to include empty fields in Patch requests.
  30449. ForceSendFields []string `json:"-"`
  30450. // NullFields is a list of field names (e.g. "Id") to include in API
  30451. // requests with the JSON null value. By default, fields with empty
  30452. // values are omitted from API requests. However, any field with an
  30453. // empty value appearing in NullFields will be sent to the server as
  30454. // null. It is an error if a field in this list has a non-empty value.
  30455. // This may be used to include null fields in Patch requests.
  30456. NullFields []string `json:"-"`
  30457. }
  30458. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  30459. type NoMethod SslCertificateList
  30460. raw := NoMethod(*s)
  30461. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30462. }
  30463. // SslCertificateListWarning: [Output Only] Informational warning
  30464. // message.
  30465. type SslCertificateListWarning struct {
  30466. // Code: [Output Only] A warning code, if applicable. For example,
  30467. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30468. // the response.
  30469. //
  30470. // Possible values:
  30471. // "CLEANUP_FAILED"
  30472. // "DEPRECATED_RESOURCE_USED"
  30473. // "DEPRECATED_TYPE_USED"
  30474. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30475. // "EXPERIMENTAL_TYPE_USED"
  30476. // "EXTERNAL_API_WARNING"
  30477. // "FIELD_VALUE_OVERRIDEN"
  30478. // "INJECTED_KERNELS_DEPRECATED"
  30479. // "MISSING_TYPE_DEPENDENCY"
  30480. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30481. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30482. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30483. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30484. // "NEXT_HOP_NOT_RUNNING"
  30485. // "NOT_CRITICAL_ERROR"
  30486. // "NO_RESULTS_ON_PAGE"
  30487. // "REQUIRED_TOS_AGREEMENT"
  30488. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30489. // "RESOURCE_NOT_DELETED"
  30490. // "SCHEMA_VALIDATION_IGNORED"
  30491. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30492. // "UNDECLARED_PROPERTIES"
  30493. // "UNREACHABLE"
  30494. Code string `json:"code,omitempty"`
  30495. // Data: [Output Only] Metadata about this warning in key: value format.
  30496. // For example:
  30497. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30498. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  30499. // Message: [Output Only] A human-readable description of the warning
  30500. // code.
  30501. Message string `json:"message,omitempty"`
  30502. // ForceSendFields is a list of field names (e.g. "Code") to
  30503. // unconditionally include in API requests. By default, fields with
  30504. // empty values are omitted from API requests. However, any non-pointer,
  30505. // non-interface field appearing in ForceSendFields will be sent to the
  30506. // server regardless of whether the field is empty or not. This may be
  30507. // used to include empty fields in Patch requests.
  30508. ForceSendFields []string `json:"-"`
  30509. // NullFields is a list of field names (e.g. "Code") to include in API
  30510. // requests with the JSON null value. By default, fields with empty
  30511. // values are omitted from API requests. However, any field with an
  30512. // empty value appearing in NullFields will be sent to the server as
  30513. // null. It is an error if a field in this list has a non-empty value.
  30514. // This may be used to include null fields in Patch requests.
  30515. NullFields []string `json:"-"`
  30516. }
  30517. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  30518. type NoMethod SslCertificateListWarning
  30519. raw := NoMethod(*s)
  30520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30521. }
  30522. type SslCertificateListWarningData struct {
  30523. // Key: [Output Only] A key that provides more detail on the warning
  30524. // being returned. For example, for warnings where there are no results
  30525. // in a list request for a particular zone, this key might be scope and
  30526. // the key value might be the zone name. Other examples might be a key
  30527. // indicating a deprecated resource and a suggested replacement, or a
  30528. // warning about invalid network settings (for example, if an instance
  30529. // attempts to perform IP forwarding but is not enabled for IP
  30530. // forwarding).
  30531. Key string `json:"key,omitempty"`
  30532. // Value: [Output Only] A warning data value corresponding to the key.
  30533. Value string `json:"value,omitempty"`
  30534. // ForceSendFields is a list of field names (e.g. "Key") to
  30535. // unconditionally include in API requests. By default, fields with
  30536. // empty values are omitted from API requests. However, any non-pointer,
  30537. // non-interface field appearing in ForceSendFields will be sent to the
  30538. // server regardless of whether the field is empty or not. This may be
  30539. // used to include empty fields in Patch requests.
  30540. ForceSendFields []string `json:"-"`
  30541. // NullFields is a list of field names (e.g. "Key") to include in API
  30542. // requests with the JSON null value. By default, fields with empty
  30543. // values are omitted from API requests. However, any field with an
  30544. // empty value appearing in NullFields will be sent to the server as
  30545. // null. It is an error if a field in this list has a non-empty value.
  30546. // This may be used to include null fields in Patch requests.
  30547. NullFields []string `json:"-"`
  30548. }
  30549. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  30550. type NoMethod SslCertificateListWarningData
  30551. raw := NoMethod(*s)
  30552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30553. }
  30554. // SslCertificateManagedSslCertificate: Configuration and status of a
  30555. // managed SSL certificate.
  30556. type SslCertificateManagedSslCertificate struct {
  30557. // DomainStatus: [Output only] Detailed statuses of the domains
  30558. // specified for managed certificate resource.
  30559. DomainStatus map[string]string `json:"domainStatus,omitempty"`
  30560. // Domains: The domains for which a managed SSL certificate will be
  30561. // generated. Currently only single-domain certs are supported.
  30562. Domains []string `json:"domains,omitempty"`
  30563. // Status: [Output only] Status of the managed certificate resource.
  30564. //
  30565. // Possible values:
  30566. // "ACTIVE"
  30567. // "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED"
  30568. // "PROVISIONING"
  30569. // "PROVISIONING_FAILED"
  30570. // "PROVISIONING_FAILED_PERMANENTLY"
  30571. // "RENEWAL_FAILED"
  30572. Status string `json:"status,omitempty"`
  30573. // ForceSendFields is a list of field names (e.g. "DomainStatus") to
  30574. // unconditionally include in API requests. By default, fields with
  30575. // empty values are omitted from API requests. However, any non-pointer,
  30576. // non-interface field appearing in ForceSendFields will be sent to the
  30577. // server regardless of whether the field is empty or not. This may be
  30578. // used to include empty fields in Patch requests.
  30579. ForceSendFields []string `json:"-"`
  30580. // NullFields is a list of field names (e.g. "DomainStatus") to include
  30581. // in API requests with the JSON null value. By default, fields with
  30582. // empty values are omitted from API requests. However, any field with
  30583. // an empty value appearing in NullFields will be sent to the server as
  30584. // null. It is an error if a field in this list has a non-empty value.
  30585. // This may be used to include null fields in Patch requests.
  30586. NullFields []string `json:"-"`
  30587. }
  30588. func (s *SslCertificateManagedSslCertificate) MarshalJSON() ([]byte, error) {
  30589. type NoMethod SslCertificateManagedSslCertificate
  30590. raw := NoMethod(*s)
  30591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30592. }
  30593. // SslCertificateSelfManagedSslCertificate: Configuration and status of
  30594. // a self-managed SSL certificate.
  30595. type SslCertificateSelfManagedSslCertificate struct {
  30596. // Certificate: A local certificate file. The certificate must be in PEM
  30597. // format. The certificate chain must be no greater than 5 certs long.
  30598. // The chain must include at least one intermediate cert.
  30599. Certificate string `json:"certificate,omitempty"`
  30600. // PrivateKey: A write-only private key in PEM format. Only insert
  30601. // requests will include this field.
  30602. PrivateKey string `json:"privateKey,omitempty"`
  30603. // ForceSendFields is a list of field names (e.g. "Certificate") to
  30604. // unconditionally include in API requests. By default, fields with
  30605. // empty values are omitted from API requests. However, any non-pointer,
  30606. // non-interface field appearing in ForceSendFields will be sent to the
  30607. // server regardless of whether the field is empty or not. This may be
  30608. // used to include empty fields in Patch requests.
  30609. ForceSendFields []string `json:"-"`
  30610. // NullFields is a list of field names (e.g. "Certificate") to include
  30611. // in API requests with the JSON null value. By default, fields with
  30612. // empty values are omitted from API requests. However, any field with
  30613. // an empty value appearing in NullFields will be sent to the server as
  30614. // null. It is an error if a field in this list has a non-empty value.
  30615. // This may be used to include null fields in Patch requests.
  30616. NullFields []string `json:"-"`
  30617. }
  30618. func (s *SslCertificateSelfManagedSslCertificate) MarshalJSON() ([]byte, error) {
  30619. type NoMethod SslCertificateSelfManagedSslCertificate
  30620. raw := NoMethod(*s)
  30621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30622. }
  30623. type SslCertificatesScopedList struct {
  30624. // SslCertificates: List of SslCertificates contained in this scope.
  30625. SslCertificates []*SslCertificate `json:"sslCertificates,omitempty"`
  30626. // Warning: Informational warning which replaces the list of backend
  30627. // services when the list is empty.
  30628. Warning *SslCertificatesScopedListWarning `json:"warning,omitempty"`
  30629. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  30630. // unconditionally include in API requests. By default, fields with
  30631. // empty values are omitted from API requests. However, any non-pointer,
  30632. // non-interface field appearing in ForceSendFields will be sent to the
  30633. // server regardless of whether the field is empty or not. This may be
  30634. // used to include empty fields in Patch requests.
  30635. ForceSendFields []string `json:"-"`
  30636. // NullFields is a list of field names (e.g. "SslCertificates") to
  30637. // include in API requests with the JSON null value. By default, fields
  30638. // with empty values are omitted from API requests. However, any field
  30639. // with an empty value appearing in NullFields will be sent to the
  30640. // server as null. It is an error if a field in this list has a
  30641. // non-empty value. This may be used to include null fields in Patch
  30642. // requests.
  30643. NullFields []string `json:"-"`
  30644. }
  30645. func (s *SslCertificatesScopedList) MarshalJSON() ([]byte, error) {
  30646. type NoMethod SslCertificatesScopedList
  30647. raw := NoMethod(*s)
  30648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30649. }
  30650. // SslCertificatesScopedListWarning: Informational warning which
  30651. // replaces the list of backend services when the list is empty.
  30652. type SslCertificatesScopedListWarning struct {
  30653. // Code: [Output Only] A warning code, if applicable. For example,
  30654. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30655. // the response.
  30656. //
  30657. // Possible values:
  30658. // "CLEANUP_FAILED"
  30659. // "DEPRECATED_RESOURCE_USED"
  30660. // "DEPRECATED_TYPE_USED"
  30661. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30662. // "EXPERIMENTAL_TYPE_USED"
  30663. // "EXTERNAL_API_WARNING"
  30664. // "FIELD_VALUE_OVERRIDEN"
  30665. // "INJECTED_KERNELS_DEPRECATED"
  30666. // "MISSING_TYPE_DEPENDENCY"
  30667. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30668. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30669. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30670. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30671. // "NEXT_HOP_NOT_RUNNING"
  30672. // "NOT_CRITICAL_ERROR"
  30673. // "NO_RESULTS_ON_PAGE"
  30674. // "REQUIRED_TOS_AGREEMENT"
  30675. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30676. // "RESOURCE_NOT_DELETED"
  30677. // "SCHEMA_VALIDATION_IGNORED"
  30678. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30679. // "UNDECLARED_PROPERTIES"
  30680. // "UNREACHABLE"
  30681. Code string `json:"code,omitempty"`
  30682. // Data: [Output Only] Metadata about this warning in key: value format.
  30683. // For example:
  30684. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30685. Data []*SslCertificatesScopedListWarningData `json:"data,omitempty"`
  30686. // Message: [Output Only] A human-readable description of the warning
  30687. // code.
  30688. Message string `json:"message,omitempty"`
  30689. // ForceSendFields is a list of field names (e.g. "Code") to
  30690. // unconditionally include in API requests. By default, fields with
  30691. // empty values are omitted from API requests. However, any non-pointer,
  30692. // non-interface field appearing in ForceSendFields will be sent to the
  30693. // server regardless of whether the field is empty or not. This may be
  30694. // used to include empty fields in Patch requests.
  30695. ForceSendFields []string `json:"-"`
  30696. // NullFields is a list of field names (e.g. "Code") to include in API
  30697. // requests with the JSON null value. By default, fields with empty
  30698. // values are omitted from API requests. However, any field with an
  30699. // empty value appearing in NullFields will be sent to the server as
  30700. // null. It is an error if a field in this list has a non-empty value.
  30701. // This may be used to include null fields in Patch requests.
  30702. NullFields []string `json:"-"`
  30703. }
  30704. func (s *SslCertificatesScopedListWarning) MarshalJSON() ([]byte, error) {
  30705. type NoMethod SslCertificatesScopedListWarning
  30706. raw := NoMethod(*s)
  30707. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30708. }
  30709. type SslCertificatesScopedListWarningData struct {
  30710. // Key: [Output Only] A key that provides more detail on the warning
  30711. // being returned. For example, for warnings where there are no results
  30712. // in a list request for a particular zone, this key might be scope and
  30713. // the key value might be the zone name. Other examples might be a key
  30714. // indicating a deprecated resource and a suggested replacement, or a
  30715. // warning about invalid network settings (for example, if an instance
  30716. // attempts to perform IP forwarding but is not enabled for IP
  30717. // forwarding).
  30718. Key string `json:"key,omitempty"`
  30719. // Value: [Output Only] A warning data value corresponding to the key.
  30720. Value string `json:"value,omitempty"`
  30721. // ForceSendFields is a list of field names (e.g. "Key") to
  30722. // unconditionally include in API requests. By default, fields with
  30723. // empty values are omitted from API requests. However, any non-pointer,
  30724. // non-interface field appearing in ForceSendFields will be sent to the
  30725. // server regardless of whether the field is empty or not. This may be
  30726. // used to include empty fields in Patch requests.
  30727. ForceSendFields []string `json:"-"`
  30728. // NullFields is a list of field names (e.g. "Key") to include in API
  30729. // requests with the JSON null value. By default, fields with empty
  30730. // values are omitted from API requests. However, any field with an
  30731. // empty value appearing in NullFields will be sent to the server as
  30732. // null. It is an error if a field in this list has a non-empty value.
  30733. // This may be used to include null fields in Patch requests.
  30734. NullFields []string `json:"-"`
  30735. }
  30736. func (s *SslCertificatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  30737. type NoMethod SslCertificatesScopedListWarningData
  30738. raw := NoMethod(*s)
  30739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30740. }
  30741. type SslPoliciesList struct {
  30742. // Id: [Output Only] Unique identifier for the resource; defined by the
  30743. // server.
  30744. Id string `json:"id,omitempty"`
  30745. // Items: A list of SslPolicy resources.
  30746. Items []*SslPolicy `json:"items,omitempty"`
  30747. // Kind: [Output Only] Type of the resource. Always
  30748. // compute#sslPoliciesList for lists of sslPolicies.
  30749. Kind string `json:"kind,omitempty"`
  30750. // NextPageToken: [Output Only] This token allows you to get the next
  30751. // page of results for list requests. If the number of results is larger
  30752. // than maxResults, use the nextPageToken as a value for the query
  30753. // parameter pageToken in the next list request. Subsequent list
  30754. // requests will have their own nextPageToken to continue paging through
  30755. // the results.
  30756. NextPageToken string `json:"nextPageToken,omitempty"`
  30757. // SelfLink: [Output Only] Server-defined URL for this resource.
  30758. SelfLink string `json:"selfLink,omitempty"`
  30759. // Warning: [Output Only] Informational warning message.
  30760. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  30761. // ServerResponse contains the HTTP response code and headers from the
  30762. // server.
  30763. googleapi.ServerResponse `json:"-"`
  30764. // ForceSendFields is a list of field names (e.g. "Id") to
  30765. // unconditionally include in API requests. By default, fields with
  30766. // empty values are omitted from API requests. However, any non-pointer,
  30767. // non-interface field appearing in ForceSendFields will be sent to the
  30768. // server regardless of whether the field is empty or not. This may be
  30769. // used to include empty fields in Patch requests.
  30770. ForceSendFields []string `json:"-"`
  30771. // NullFields is a list of field names (e.g. "Id") to include in API
  30772. // requests with the JSON null value. By default, fields with empty
  30773. // values are omitted from API requests. However, any field with an
  30774. // empty value appearing in NullFields will be sent to the server as
  30775. // null. It is an error if a field in this list has a non-empty value.
  30776. // This may be used to include null fields in Patch requests.
  30777. NullFields []string `json:"-"`
  30778. }
  30779. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  30780. type NoMethod SslPoliciesList
  30781. raw := NoMethod(*s)
  30782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30783. }
  30784. // SslPoliciesListWarning: [Output Only] Informational warning message.
  30785. type SslPoliciesListWarning struct {
  30786. // Code: [Output Only] A warning code, if applicable. For example,
  30787. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30788. // the response.
  30789. //
  30790. // Possible values:
  30791. // "CLEANUP_FAILED"
  30792. // "DEPRECATED_RESOURCE_USED"
  30793. // "DEPRECATED_TYPE_USED"
  30794. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30795. // "EXPERIMENTAL_TYPE_USED"
  30796. // "EXTERNAL_API_WARNING"
  30797. // "FIELD_VALUE_OVERRIDEN"
  30798. // "INJECTED_KERNELS_DEPRECATED"
  30799. // "MISSING_TYPE_DEPENDENCY"
  30800. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30801. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30802. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30803. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30804. // "NEXT_HOP_NOT_RUNNING"
  30805. // "NOT_CRITICAL_ERROR"
  30806. // "NO_RESULTS_ON_PAGE"
  30807. // "REQUIRED_TOS_AGREEMENT"
  30808. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30809. // "RESOURCE_NOT_DELETED"
  30810. // "SCHEMA_VALIDATION_IGNORED"
  30811. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30812. // "UNDECLARED_PROPERTIES"
  30813. // "UNREACHABLE"
  30814. Code string `json:"code,omitempty"`
  30815. // Data: [Output Only] Metadata about this warning in key: value format.
  30816. // For example:
  30817. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30818. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  30819. // Message: [Output Only] A human-readable description of the warning
  30820. // code.
  30821. Message string `json:"message,omitempty"`
  30822. // ForceSendFields is a list of field names (e.g. "Code") to
  30823. // unconditionally include in API requests. By default, fields with
  30824. // empty values are omitted from API requests. However, any non-pointer,
  30825. // non-interface field appearing in ForceSendFields will be sent to the
  30826. // server regardless of whether the field is empty or not. This may be
  30827. // used to include empty fields in Patch requests.
  30828. ForceSendFields []string `json:"-"`
  30829. // NullFields is a list of field names (e.g. "Code") to include in API
  30830. // requests with the JSON null value. By default, fields with empty
  30831. // values are omitted from API requests. However, any field with an
  30832. // empty value appearing in NullFields will be sent to the server as
  30833. // null. It is an error if a field in this list has a non-empty value.
  30834. // This may be used to include null fields in Patch requests.
  30835. NullFields []string `json:"-"`
  30836. }
  30837. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  30838. type NoMethod SslPoliciesListWarning
  30839. raw := NoMethod(*s)
  30840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30841. }
  30842. type SslPoliciesListWarningData struct {
  30843. // Key: [Output Only] A key that provides more detail on the warning
  30844. // being returned. For example, for warnings where there are no results
  30845. // in a list request for a particular zone, this key might be scope and
  30846. // the key value might be the zone name. Other examples might be a key
  30847. // indicating a deprecated resource and a suggested replacement, or a
  30848. // warning about invalid network settings (for example, if an instance
  30849. // attempts to perform IP forwarding but is not enabled for IP
  30850. // forwarding).
  30851. Key string `json:"key,omitempty"`
  30852. // Value: [Output Only] A warning data value corresponding to the key.
  30853. Value string `json:"value,omitempty"`
  30854. // ForceSendFields is a list of field names (e.g. "Key") to
  30855. // unconditionally include in API requests. By default, fields with
  30856. // empty values are omitted from API requests. However, any non-pointer,
  30857. // non-interface field appearing in ForceSendFields will be sent to the
  30858. // server regardless of whether the field is empty or not. This may be
  30859. // used to include empty fields in Patch requests.
  30860. ForceSendFields []string `json:"-"`
  30861. // NullFields is a list of field names (e.g. "Key") to include in API
  30862. // requests with the JSON null value. By default, fields with empty
  30863. // values are omitted from API requests. However, any field with an
  30864. // empty value appearing in NullFields will be sent to the server as
  30865. // null. It is an error if a field in this list has a non-empty value.
  30866. // This may be used to include null fields in Patch requests.
  30867. NullFields []string `json:"-"`
  30868. }
  30869. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  30870. type NoMethod SslPoliciesListWarningData
  30871. raw := NoMethod(*s)
  30872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30873. }
  30874. type SslPoliciesListAvailableFeaturesResponse struct {
  30875. Features []string `json:"features,omitempty"`
  30876. // ServerResponse contains the HTTP response code and headers from the
  30877. // server.
  30878. googleapi.ServerResponse `json:"-"`
  30879. // ForceSendFields is a list of field names (e.g. "Features") to
  30880. // unconditionally include in API requests. By default, fields with
  30881. // empty values are omitted from API requests. However, any non-pointer,
  30882. // non-interface field appearing in ForceSendFields will be sent to the
  30883. // server regardless of whether the field is empty or not. This may be
  30884. // used to include empty fields in Patch requests.
  30885. ForceSendFields []string `json:"-"`
  30886. // NullFields is a list of field names (e.g. "Features") to include in
  30887. // API requests with the JSON null value. By default, fields with empty
  30888. // values are omitted from API requests. However, any field with an
  30889. // empty value appearing in NullFields will be sent to the server as
  30890. // null. It is an error if a field in this list has a non-empty value.
  30891. // This may be used to include null fields in Patch requests.
  30892. NullFields []string `json:"-"`
  30893. }
  30894. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  30895. type NoMethod SslPoliciesListAvailableFeaturesResponse
  30896. raw := NoMethod(*s)
  30897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30898. }
  30899. // SslPolicy: A SSL policy specifies the server-side support for SSL
  30900. // features. This can be attached to a TargetHttpsProxy or a
  30901. // TargetSslProxy. This affects connections between clients and the
  30902. // HTTPS or SSL proxy load balancer. They do not affect the connection
  30903. // between the load balancers and the backends.
  30904. type SslPolicy struct {
  30905. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  30906. // format.
  30907. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  30908. // CustomFeatures: A list of features enabled when the selected profile
  30909. // is CUSTOM. The
  30910. // - method returns the set of features that can be specified in this
  30911. // list. This field must be empty if the profile is not CUSTOM.
  30912. CustomFeatures []string `json:"customFeatures,omitempty"`
  30913. // Description: An optional description of this resource. Provide this
  30914. // property when you create the resource.
  30915. Description string `json:"description,omitempty"`
  30916. // EnabledFeatures: [Output Only] The list of features enabled in the
  30917. // SSL policy.
  30918. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  30919. // Fingerprint: Fingerprint of this resource. A hash of the contents
  30920. // stored in this object. This field is used in optimistic locking. This
  30921. // field will be ignored when inserting a SslPolicy. An up-to-date
  30922. // fingerprint must be provided in order to update the SslPolicy,
  30923. // otherwise the request will fail with error 412 conditionNotMet.
  30924. //
  30925. // To see the latest fingerprint, make a get() request to retrieve an
  30926. // SslPolicy.
  30927. Fingerprint string `json:"fingerprint,omitempty"`
  30928. // Id: [Output Only] The unique identifier for the resource. This
  30929. // identifier is defined by the server.
  30930. Id uint64 `json:"id,omitempty,string"`
  30931. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  30932. // SSL policies.
  30933. Kind string `json:"kind,omitempty"`
  30934. // MinTlsVersion: The minimum version of SSL protocol that can be used
  30935. // by the clients to establish a connection with the load balancer. This
  30936. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  30937. //
  30938. // Possible values:
  30939. // "TLS_1_0"
  30940. // "TLS_1_1"
  30941. // "TLS_1_2"
  30942. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  30943. // Name: Name of the resource. The name must be 1-63 characters long,
  30944. // and comply with RFC1035. Specifically, the name must be 1-63
  30945. // characters long and match the regular expression
  30946. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  30947. // a lowercase letter, and all following characters must be a dash,
  30948. // lowercase letter, or digit, except the last character, which cannot
  30949. // be a dash.
  30950. Name string `json:"name,omitempty"`
  30951. // Profile: Profile specifies the set of SSL features that can be used
  30952. // by the load balancer when negotiating SSL with clients. This can be
  30953. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  30954. // the set of SSL features to enable must be specified in the
  30955. // customFeatures field.
  30956. //
  30957. // Possible values:
  30958. // "COMPATIBLE"
  30959. // "CUSTOM"
  30960. // "MODERN"
  30961. // "RESTRICTED"
  30962. Profile string `json:"profile,omitempty"`
  30963. // SelfLink: [Output Only] Server-defined URL for the resource.
  30964. SelfLink string `json:"selfLink,omitempty"`
  30965. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  30966. // with the resource id.
  30967. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  30968. // TlsSettings: Security settings for the proxy. This field is only
  30969. // applicable to a global backend service with the loadBalancingScheme
  30970. // set to INTERNAL_SELF_MANAGED.
  30971. TlsSettings *ServerTlsSettings `json:"tlsSettings,omitempty"`
  30972. // Warnings: [Output Only] If potential misconfigurations are detected
  30973. // for this SSL policy, this field will be populated with warning
  30974. // messages.
  30975. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  30976. // ServerResponse contains the HTTP response code and headers from the
  30977. // server.
  30978. googleapi.ServerResponse `json:"-"`
  30979. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  30980. // to unconditionally include in API requests. By default, fields with
  30981. // empty values are omitted from API requests. However, any non-pointer,
  30982. // non-interface field appearing in ForceSendFields will be sent to the
  30983. // server regardless of whether the field is empty or not. This may be
  30984. // used to include empty fields in Patch requests.
  30985. ForceSendFields []string `json:"-"`
  30986. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  30987. // include in API requests with the JSON null value. By default, fields
  30988. // with empty values are omitted from API requests. However, any field
  30989. // with an empty value appearing in NullFields will be sent to the
  30990. // server as null. It is an error if a field in this list has a
  30991. // non-empty value. This may be used to include null fields in Patch
  30992. // requests.
  30993. NullFields []string `json:"-"`
  30994. }
  30995. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  30996. type NoMethod SslPolicy
  30997. raw := NoMethod(*s)
  30998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30999. }
  31000. type SslPolicyWarnings struct {
  31001. // Code: [Output Only] A warning code, if applicable. For example,
  31002. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31003. // the response.
  31004. //
  31005. // Possible values:
  31006. // "CLEANUP_FAILED"
  31007. // "DEPRECATED_RESOURCE_USED"
  31008. // "DEPRECATED_TYPE_USED"
  31009. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31010. // "EXPERIMENTAL_TYPE_USED"
  31011. // "EXTERNAL_API_WARNING"
  31012. // "FIELD_VALUE_OVERRIDEN"
  31013. // "INJECTED_KERNELS_DEPRECATED"
  31014. // "MISSING_TYPE_DEPENDENCY"
  31015. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31016. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31017. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31018. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31019. // "NEXT_HOP_NOT_RUNNING"
  31020. // "NOT_CRITICAL_ERROR"
  31021. // "NO_RESULTS_ON_PAGE"
  31022. // "REQUIRED_TOS_AGREEMENT"
  31023. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31024. // "RESOURCE_NOT_DELETED"
  31025. // "SCHEMA_VALIDATION_IGNORED"
  31026. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31027. // "UNDECLARED_PROPERTIES"
  31028. // "UNREACHABLE"
  31029. Code string `json:"code,omitempty"`
  31030. // Data: [Output Only] Metadata about this warning in key: value format.
  31031. // For example:
  31032. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31033. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  31034. // Message: [Output Only] A human-readable description of the warning
  31035. // code.
  31036. Message string `json:"message,omitempty"`
  31037. // ForceSendFields is a list of field names (e.g. "Code") to
  31038. // unconditionally include in API requests. By default, fields with
  31039. // empty values are omitted from API requests. However, any non-pointer,
  31040. // non-interface field appearing in ForceSendFields will be sent to the
  31041. // server regardless of whether the field is empty or not. This may be
  31042. // used to include empty fields in Patch requests.
  31043. ForceSendFields []string `json:"-"`
  31044. // NullFields is a list of field names (e.g. "Code") to include in API
  31045. // requests with the JSON null value. By default, fields with empty
  31046. // values are omitted from API requests. However, any field with an
  31047. // empty value appearing in NullFields will be sent to the server as
  31048. // null. It is an error if a field in this list has a non-empty value.
  31049. // This may be used to include null fields in Patch requests.
  31050. NullFields []string `json:"-"`
  31051. }
  31052. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  31053. type NoMethod SslPolicyWarnings
  31054. raw := NoMethod(*s)
  31055. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31056. }
  31057. type SslPolicyWarningsData struct {
  31058. // Key: [Output Only] A key that provides more detail on the warning
  31059. // being returned. For example, for warnings where there are no results
  31060. // in a list request for a particular zone, this key might be scope and
  31061. // the key value might be the zone name. Other examples might be a key
  31062. // indicating a deprecated resource and a suggested replacement, or a
  31063. // warning about invalid network settings (for example, if an instance
  31064. // attempts to perform IP forwarding but is not enabled for IP
  31065. // forwarding).
  31066. Key string `json:"key,omitempty"`
  31067. // Value: [Output Only] A warning data value corresponding to the key.
  31068. Value string `json:"value,omitempty"`
  31069. // ForceSendFields is a list of field names (e.g. "Key") to
  31070. // unconditionally include in API requests. By default, fields with
  31071. // empty values are omitted from API requests. However, any non-pointer,
  31072. // non-interface field appearing in ForceSendFields will be sent to the
  31073. // server regardless of whether the field is empty or not. This may be
  31074. // used to include empty fields in Patch requests.
  31075. ForceSendFields []string `json:"-"`
  31076. // NullFields is a list of field names (e.g. "Key") to include in API
  31077. // requests with the JSON null value. By default, fields with empty
  31078. // values are omitted from API requests. However, any field with an
  31079. // empty value appearing in NullFields will be sent to the server as
  31080. // null. It is an error if a field in this list has a non-empty value.
  31081. // This may be used to include null fields in Patch requests.
  31082. NullFields []string `json:"-"`
  31083. }
  31084. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  31085. type NoMethod SslPolicyWarningsData
  31086. raw := NoMethod(*s)
  31087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31088. }
  31089. type SslPolicyReference struct {
  31090. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  31091. // to clear any existing SSL policy associated with the target proxy
  31092. // resource.
  31093. SslPolicy string `json:"sslPolicy,omitempty"`
  31094. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  31095. // unconditionally include in API requests. By default, fields with
  31096. // empty values are omitted from API requests. However, any non-pointer,
  31097. // non-interface field appearing in ForceSendFields will be sent to the
  31098. // server regardless of whether the field is empty or not. This may be
  31099. // used to include empty fields in Patch requests.
  31100. ForceSendFields []string `json:"-"`
  31101. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  31102. // API requests with the JSON null value. By default, fields with empty
  31103. // values are omitted from API requests. However, any field with an
  31104. // empty value appearing in NullFields will be sent to the server as
  31105. // null. It is an error if a field in this list has a non-empty value.
  31106. // This may be used to include null fields in Patch requests.
  31107. NullFields []string `json:"-"`
  31108. }
  31109. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  31110. type NoMethod SslPolicyReference
  31111. raw := NoMethod(*s)
  31112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31113. }
  31114. type StatefulPolicy struct {
  31115. PreservedResources *StatefulPolicyPreservedResources `json:"preservedResources,omitempty"`
  31116. PreservedState *StatefulPolicyPreservedState `json:"preservedState,omitempty"`
  31117. // ForceSendFields is a list of field names (e.g. "PreservedResources")
  31118. // to unconditionally include in API requests. By default, fields with
  31119. // empty values are omitted from API requests. However, any non-pointer,
  31120. // non-interface field appearing in ForceSendFields will be sent to the
  31121. // server regardless of whether the field is empty or not. This may be
  31122. // used to include empty fields in Patch requests.
  31123. ForceSendFields []string `json:"-"`
  31124. // NullFields is a list of field names (e.g. "PreservedResources") to
  31125. // include in API requests with the JSON null value. By default, fields
  31126. // with empty values are omitted from API requests. However, any field
  31127. // with an empty value appearing in NullFields will be sent to the
  31128. // server as null. It is an error if a field in this list has a
  31129. // non-empty value. This may be used to include null fields in Patch
  31130. // requests.
  31131. NullFields []string `json:"-"`
  31132. }
  31133. func (s *StatefulPolicy) MarshalJSON() ([]byte, error) {
  31134. type NoMethod StatefulPolicy
  31135. raw := NoMethod(*s)
  31136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31137. }
  31138. type StatefulPolicyPreservedDisk struct {
  31139. // DeviceName: Device name of the disk to be preserved
  31140. DeviceName string `json:"deviceName,omitempty"`
  31141. // ForceSendFields is a list of field names (e.g. "DeviceName") to
  31142. // unconditionally include in API requests. By default, fields with
  31143. // empty values are omitted from API requests. However, any non-pointer,
  31144. // non-interface field appearing in ForceSendFields will be sent to the
  31145. // server regardless of whether the field is empty or not. This may be
  31146. // used to include empty fields in Patch requests.
  31147. ForceSendFields []string `json:"-"`
  31148. // NullFields is a list of field names (e.g. "DeviceName") to include in
  31149. // API requests with the JSON null value. By default, fields with empty
  31150. // values are omitted from API requests. However, any field with an
  31151. // empty value appearing in NullFields will be sent to the server as
  31152. // null. It is an error if a field in this list has a non-empty value.
  31153. // This may be used to include null fields in Patch requests.
  31154. NullFields []string `json:"-"`
  31155. }
  31156. func (s *StatefulPolicyPreservedDisk) MarshalJSON() ([]byte, error) {
  31157. type NoMethod StatefulPolicyPreservedDisk
  31158. raw := NoMethod(*s)
  31159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31160. }
  31161. // StatefulPolicyPreservedResources: Configuration of all preserved
  31162. // resources.
  31163. type StatefulPolicyPreservedResources struct {
  31164. // Disks: Disks created on the instances that will be preserved on
  31165. // instance delete, resize down, etc.
  31166. Disks []*StatefulPolicyPreservedDisk `json:"disks,omitempty"`
  31167. // ForceSendFields is a list of field names (e.g. "Disks") to
  31168. // unconditionally include in API requests. By default, fields with
  31169. // empty values are omitted from API requests. However, any non-pointer,
  31170. // non-interface field appearing in ForceSendFields will be sent to the
  31171. // server regardless of whether the field is empty or not. This may be
  31172. // used to include empty fields in Patch requests.
  31173. ForceSendFields []string `json:"-"`
  31174. // NullFields is a list of field names (e.g. "Disks") to include in API
  31175. // requests with the JSON null value. By default, fields with empty
  31176. // values are omitted from API requests. However, any field with an
  31177. // empty value appearing in NullFields will be sent to the server as
  31178. // null. It is an error if a field in this list has a non-empty value.
  31179. // This may be used to include null fields in Patch requests.
  31180. NullFields []string `json:"-"`
  31181. }
  31182. func (s *StatefulPolicyPreservedResources) MarshalJSON() ([]byte, error) {
  31183. type NoMethod StatefulPolicyPreservedResources
  31184. raw := NoMethod(*s)
  31185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31186. }
  31187. // StatefulPolicyPreservedState: Configuration of preserved resources.
  31188. type StatefulPolicyPreservedState struct {
  31189. // Disks: Disks created on the instances that will be preserved on
  31190. // instance delete, resize down, etc. This map is keyed with the device
  31191. // names of the disks.
  31192. Disks map[string]StatefulPolicyPreservedStateDiskDevice `json:"disks,omitempty"`
  31193. // ForceSendFields is a list of field names (e.g. "Disks") to
  31194. // unconditionally include in API requests. By default, fields with
  31195. // empty values are omitted from API requests. However, any non-pointer,
  31196. // non-interface field appearing in ForceSendFields will be sent to the
  31197. // server regardless of whether the field is empty or not. This may be
  31198. // used to include empty fields in Patch requests.
  31199. ForceSendFields []string `json:"-"`
  31200. // NullFields is a list of field names (e.g. "Disks") to include in API
  31201. // requests with the JSON null value. By default, fields with empty
  31202. // values are omitted from API requests. However, any field with an
  31203. // empty value appearing in NullFields will be sent to the server as
  31204. // null. It is an error if a field in this list has a non-empty value.
  31205. // This may be used to include null fields in Patch requests.
  31206. NullFields []string `json:"-"`
  31207. }
  31208. func (s *StatefulPolicyPreservedState) MarshalJSON() ([]byte, error) {
  31209. type NoMethod StatefulPolicyPreservedState
  31210. raw := NoMethod(*s)
  31211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31212. }
  31213. type StatefulPolicyPreservedStateDiskDevice struct {
  31214. // AutoDelete: These stateful disks will never be deleted during
  31215. // autohealing, update or VM instance recreate operations. This flag is
  31216. // used to configure if the disk should be deleted after it is no longer
  31217. // used by the group, e.g. when the given instance or the whole group is
  31218. // deleted. Note: disks attached in READ_ONLY mode cannot be
  31219. // auto-deleted.
  31220. //
  31221. // Possible values:
  31222. // "NEVER"
  31223. // "ON_PERMANENT_INSTANCE_DELETION"
  31224. // "WHEN_NOT_IN_USE"
  31225. AutoDelete string `json:"autoDelete,omitempty"`
  31226. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  31227. // unconditionally include in API requests. By default, fields with
  31228. // empty values are omitted from API requests. However, any non-pointer,
  31229. // non-interface field appearing in ForceSendFields will be sent to the
  31230. // server regardless of whether the field is empty or not. This may be
  31231. // used to include empty fields in Patch requests.
  31232. ForceSendFields []string `json:"-"`
  31233. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  31234. // API requests with the JSON null value. By default, fields with empty
  31235. // values are omitted from API requests. However, any field with an
  31236. // empty value appearing in NullFields will be sent to the server as
  31237. // null. It is an error if a field in this list has a non-empty value.
  31238. // This may be used to include null fields in Patch requests.
  31239. NullFields []string `json:"-"`
  31240. }
  31241. func (s *StatefulPolicyPreservedStateDiskDevice) MarshalJSON() ([]byte, error) {
  31242. type NoMethod StatefulPolicyPreservedStateDiskDevice
  31243. raw := NoMethod(*s)
  31244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31245. }
  31246. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  31247. // ==) (== resource_for v1.subnetworks ==)
  31248. type Subnetwork struct {
  31249. // AggregationInterval: Can only be specified if VPC flow logging for
  31250. // this subnetwork is enabled. Sets the aggregation interval for
  31251. // collecting flow logs. Increasing the interval time reduces the amount
  31252. // of generated flow logs for long-lasting connections. Default is an
  31253. // interval of 5 seconds per connection. Valid values: INTERVAL_5_SEC,
  31254. // INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN,
  31255. // INTERVAL_15_MIN.
  31256. //
  31257. // Possible values:
  31258. // "INTERVAL_10_MIN"
  31259. // "INTERVAL_15_MIN"
  31260. // "INTERVAL_1_MIN"
  31261. // "INTERVAL_30_SEC"
  31262. // "INTERVAL_5_MIN"
  31263. // "INTERVAL_5_SEC"
  31264. AggregationInterval string `json:"aggregationInterval,omitempty"`
  31265. // AllowSubnetCidrRoutesOverlap: Whether this subnetwork can conflict
  31266. // with static routes. Setting this to true allows this subnetwork's
  31267. // primary and secondary ranges to conflict with routes that have
  31268. // already been configured on the corresponding network. Static routes
  31269. // will take precedence over the subnetwork route if the route prefix
  31270. // length is at least as large as the subnetwork prefix length.
  31271. //
  31272. // Also, packets destined to IPs within subnetwork may contain
  31273. // private/sensitive data and are prevented from leaving the virtual
  31274. // network. Setting this field to true will disable this feature.
  31275. //
  31276. // The default value is false and applies to all existing subnetworks
  31277. // and automatically created subnetworks.
  31278. //
  31279. // This field cannot be set to true at resource creation time.
  31280. AllowSubnetCidrRoutesOverlap bool `json:"allowSubnetCidrRoutesOverlap,omitempty"`
  31281. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  31282. // format.
  31283. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  31284. // Description: An optional description of this resource. Provide this
  31285. // property when you create the resource. This field can be set only at
  31286. // resource creation time.
  31287. Description string `json:"description,omitempty"`
  31288. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  31289. // If this field is not explicitly set, it will not appear in get
  31290. // listings. If not set the default behavior is to disable flow logging.
  31291. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  31292. // EnablePrivateV6Access: Deprecated in favor of enable in
  31293. // PrivateIpv6GoogleAccess. Whether the VMs in this subnet can directly
  31294. // access Google services via internal IPv6 addresses. This field can be
  31295. // both set at resource creation time and updated using patch.
  31296. EnablePrivateV6Access bool `json:"enablePrivateV6Access,omitempty"`
  31297. // Fingerprint: Fingerprint of this resource. A hash of the contents
  31298. // stored in this object. This field is used in optimistic locking. This
  31299. // field will be ignored when inserting a Subnetwork. An up-to-date
  31300. // fingerprint must be provided in order to update the Subnetwork,
  31301. // otherwise the request will fail with error 412 conditionNotMet.
  31302. //
  31303. // To see the latest fingerprint, make a get() request to retrieve a
  31304. // Subnetwork.
  31305. Fingerprint string `json:"fingerprint,omitempty"`
  31306. // FlowSampling: Can only be specified if VPC flow logging for this
  31307. // subnetwork is enabled. The value of the field must be in [0, 1]. Set
  31308. // the sampling rate of VPC flow logs within the subnetwork where 1.0
  31309. // means all collected logs are reported and 0.0 means no logs are
  31310. // reported. Default is 0.5, which means half of all collected logs are
  31311. // reported.
  31312. FlowSampling float64 `json:"flowSampling,omitempty"`
  31313. // GatewayAddress: [Output Only] The gateway address for default routes
  31314. // to reach destination addresses outside this subnetwork.
  31315. GatewayAddress string `json:"gatewayAddress,omitempty"`
  31316. // Id: [Output Only] The unique identifier for the resource. This
  31317. // identifier is defined by the server.
  31318. Id uint64 `json:"id,omitempty,string"`
  31319. // IpCidrRange: The range of internal addresses that are owned by this
  31320. // subnetwork. Provide this property when you create the subnetwork. For
  31321. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  31322. // non-overlapping within a network. Only IPv4 is supported. This field
  31323. // can be set only at resource creation time.
  31324. IpCidrRange string `json:"ipCidrRange,omitempty"`
  31325. // Ipv6CidrRange: [Output Only] The range of internal IPv6 addresses
  31326. // that are owned by this subnetwork.
  31327. Ipv6CidrRange string `json:"ipv6CidrRange,omitempty"`
  31328. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  31329. // for Subnetwork resources.
  31330. Kind string `json:"kind,omitempty"`
  31331. // LogConfig: This field denotes the VPC flow logging options for this
  31332. // subnetwork. If logging is enabled, logs are exported to Stackdriver.
  31333. LogConfig *SubnetworkLogConfig `json:"logConfig,omitempty"`
  31334. // Metadata: Can only be specified if VPC flow logging for this
  31335. // subnetwork is enabled. Configures whether metadata fields should be
  31336. // added to the reported VPC flow logs. Default is INCLUDE_ALL_METADATA.
  31337. //
  31338. // Possible values:
  31339. // "EXCLUDE_ALL_METADATA"
  31340. // "INCLUDE_ALL_METADATA"
  31341. Metadata string `json:"metadata,omitempty"`
  31342. // Name: The name of the resource, provided by the client when initially
  31343. // creating the resource. The name must be 1-63 characters long, and
  31344. // comply with RFC1035. Specifically, the name must be 1-63 characters
  31345. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  31346. // which means the first character must be a lowercase letter, and all
  31347. // following characters must be a dash, lowercase letter, or digit,
  31348. // except the last character, which cannot be a dash.
  31349. Name string `json:"name,omitempty"`
  31350. // Network: The URL of the network to which this subnetwork belongs,
  31351. // provided by the client when initially creating the subnetwork. Only
  31352. // networks that are in the distributed mode can have subnetworks. This
  31353. // field can be set only at resource creation time.
  31354. Network string `json:"network,omitempty"`
  31355. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  31356. // Google services without assigned external IP addresses. This field
  31357. // can be both set at resource creation time and updated using
  31358. // setPrivateIpGoogleAccess.
  31359. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  31360. // PrivateIpv6GoogleAccess: The private IPv6 google access type for the
  31361. // VMs in this subnet. This is an expanded field of
  31362. // enablePrivateV6Access. If both fields are set,
  31363. // privateIpv6GoogleAccess will take priority.
  31364. //
  31365. // This field can be both set at resource creation time and updated
  31366. // using patch.
  31367. //
  31368. // Possible values:
  31369. // "DISABLE_GOOGLE_ACCESS"
  31370. // "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE"
  31371. // "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE"
  31372. PrivateIpv6GoogleAccess string `json:"privateIpv6GoogleAccess,omitempty"`
  31373. // Purpose: The purpose of the resource. This field can be either
  31374. // PRIVATE_RFC_1918 or INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with
  31375. // purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created
  31376. // subnetwork that is reserved for Internal HTTP(S) Load Balancing. If
  31377. // unspecified, the purpose defaults to PRIVATE_RFC_1918.
  31378. //
  31379. // Possible values:
  31380. // "INTERNAL_HTTPS_LOAD_BALANCER"
  31381. // "PRIVATE"
  31382. // "PRIVATE_RFC_1918"
  31383. Purpose string `json:"purpose,omitempty"`
  31384. // RangeType: The type of IP CIDR range to associate with this
  31385. // subnetwork. The default is RFC_1918. When creating a subnetwork in
  31386. // non-RFC 1918 range, this field must be set to NON_RFC_1918.
  31387. //
  31388. // Possible values:
  31389. // "NON_RFC_1918"
  31390. // "RFC_1918"
  31391. RangeType string `json:"rangeType,omitempty"`
  31392. // Region: URL of the region where the Subnetwork resides. This field
  31393. // can be set only at resource creation time.
  31394. Region string `json:"region,omitempty"`
  31395. // Role: The role of subnetwork. Currenly, this field is only used when
  31396. // purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to
  31397. // ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being
  31398. // used for Internal HTTP(S) Load Balancing. A BACKUP subnetwork is one
  31399. // that is ready to be promoted to ACTIVE or is currently draining. This
  31400. // field can be updated with a patch request.
  31401. //
  31402. // Possible values:
  31403. // "ACTIVE"
  31404. // "BACKUP"
  31405. Role string `json:"role,omitempty"`
  31406. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  31407. // for VM instances contained in this subnetwork. The primary IP of such
  31408. // VM must belong to the primary ipCidrRange of the subnetwork. The
  31409. // alias IPs may belong to either primary or secondary ranges. This
  31410. // field can be updated with a patch request.
  31411. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  31412. // SelfLink: [Output Only] Server-defined URL for the resource.
  31413. SelfLink string `json:"selfLink,omitempty"`
  31414. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  31415. // with the resource id.
  31416. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  31417. // State: [Output Only] The state of the subnetwork, which can be one of
  31418. // READY or DRAINING. A subnetwork that is READY is ready to be used.
  31419. // The state of DRAINING is only applicable to subnetworks that have the
  31420. // purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that
  31421. // connections to the load balancer are being drained. A subnetwork that
  31422. // is draining cannot be used or modified until it reaches a status of
  31423. // READY.
  31424. //
  31425. // Possible values:
  31426. // "DRAINING"
  31427. // "READY"
  31428. State string `json:"state,omitempty"`
  31429. // ServerResponse contains the HTTP response code and headers from the
  31430. // server.
  31431. googleapi.ServerResponse `json:"-"`
  31432. // ForceSendFields is a list of field names (e.g. "AggregationInterval")
  31433. // to unconditionally include in API requests. By default, fields with
  31434. // empty values are omitted from API requests. However, any non-pointer,
  31435. // non-interface field appearing in ForceSendFields will be sent to the
  31436. // server regardless of whether the field is empty or not. This may be
  31437. // used to include empty fields in Patch requests.
  31438. ForceSendFields []string `json:"-"`
  31439. // NullFields is a list of field names (e.g. "AggregationInterval") to
  31440. // include in API requests with the JSON null value. By default, fields
  31441. // with empty values are omitted from API requests. However, any field
  31442. // with an empty value appearing in NullFields will be sent to the
  31443. // server as null. It is an error if a field in this list has a
  31444. // non-empty value. This may be used to include null fields in Patch
  31445. // requests.
  31446. NullFields []string `json:"-"`
  31447. }
  31448. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  31449. type NoMethod Subnetwork
  31450. raw := NoMethod(*s)
  31451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31452. }
  31453. func (s *Subnetwork) UnmarshalJSON(data []byte) error {
  31454. type NoMethod Subnetwork
  31455. var s1 struct {
  31456. FlowSampling gensupport.JSONFloat64 `json:"flowSampling"`
  31457. *NoMethod
  31458. }
  31459. s1.NoMethod = (*NoMethod)(s)
  31460. if err := json.Unmarshal(data, &s1); err != nil {
  31461. return err
  31462. }
  31463. s.FlowSampling = float64(s1.FlowSampling)
  31464. return nil
  31465. }
  31466. type SubnetworkAggregatedList struct {
  31467. // Id: [Output Only] Unique identifier for the resource; defined by the
  31468. // server.
  31469. Id string `json:"id,omitempty"`
  31470. // Items: A list of SubnetworksScopedList resources.
  31471. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  31472. // Kind: [Output Only] Type of resource. Always
  31473. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  31474. Kind string `json:"kind,omitempty"`
  31475. // NextPageToken: [Output Only] This token allows you to get the next
  31476. // page of results for list requests. If the number of results is larger
  31477. // than maxResults, use the nextPageToken as a value for the query
  31478. // parameter pageToken in the next list request. Subsequent list
  31479. // requests will have their own nextPageToken to continue paging through
  31480. // the results.
  31481. NextPageToken string `json:"nextPageToken,omitempty"`
  31482. // SelfLink: [Output Only] Server-defined URL for this resource.
  31483. SelfLink string `json:"selfLink,omitempty"`
  31484. // Warning: [Output Only] Informational warning message.
  31485. Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
  31486. // ServerResponse contains the HTTP response code and headers from the
  31487. // server.
  31488. googleapi.ServerResponse `json:"-"`
  31489. // ForceSendFields is a list of field names (e.g. "Id") to
  31490. // unconditionally include in API requests. By default, fields with
  31491. // empty values are omitted from API requests. However, any non-pointer,
  31492. // non-interface field appearing in ForceSendFields will be sent to the
  31493. // server regardless of whether the field is empty or not. This may be
  31494. // used to include empty fields in Patch requests.
  31495. ForceSendFields []string `json:"-"`
  31496. // NullFields is a list of field names (e.g. "Id") to include in API
  31497. // requests with the JSON null value. By default, fields with empty
  31498. // values are omitted from API requests. However, any field with an
  31499. // empty value appearing in NullFields will be sent to the server as
  31500. // null. It is an error if a field in this list has a non-empty value.
  31501. // This may be used to include null fields in Patch requests.
  31502. NullFields []string `json:"-"`
  31503. }
  31504. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  31505. type NoMethod SubnetworkAggregatedList
  31506. raw := NoMethod(*s)
  31507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31508. }
  31509. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  31510. // message.
  31511. type SubnetworkAggregatedListWarning struct {
  31512. // Code: [Output Only] A warning code, if applicable. For example,
  31513. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31514. // the response.
  31515. //
  31516. // Possible values:
  31517. // "CLEANUP_FAILED"
  31518. // "DEPRECATED_RESOURCE_USED"
  31519. // "DEPRECATED_TYPE_USED"
  31520. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31521. // "EXPERIMENTAL_TYPE_USED"
  31522. // "EXTERNAL_API_WARNING"
  31523. // "FIELD_VALUE_OVERRIDEN"
  31524. // "INJECTED_KERNELS_DEPRECATED"
  31525. // "MISSING_TYPE_DEPENDENCY"
  31526. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31527. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31528. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31529. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31530. // "NEXT_HOP_NOT_RUNNING"
  31531. // "NOT_CRITICAL_ERROR"
  31532. // "NO_RESULTS_ON_PAGE"
  31533. // "REQUIRED_TOS_AGREEMENT"
  31534. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31535. // "RESOURCE_NOT_DELETED"
  31536. // "SCHEMA_VALIDATION_IGNORED"
  31537. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31538. // "UNDECLARED_PROPERTIES"
  31539. // "UNREACHABLE"
  31540. Code string `json:"code,omitempty"`
  31541. // Data: [Output Only] Metadata about this warning in key: value format.
  31542. // For example:
  31543. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31544. Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
  31545. // Message: [Output Only] A human-readable description of the warning
  31546. // code.
  31547. Message string `json:"message,omitempty"`
  31548. // ForceSendFields is a list of field names (e.g. "Code") to
  31549. // unconditionally include in API requests. By default, fields with
  31550. // empty values are omitted from API requests. However, any non-pointer,
  31551. // non-interface field appearing in ForceSendFields will be sent to the
  31552. // server regardless of whether the field is empty or not. This may be
  31553. // used to include empty fields in Patch requests.
  31554. ForceSendFields []string `json:"-"`
  31555. // NullFields is a list of field names (e.g. "Code") to include in API
  31556. // requests with the JSON null value. By default, fields with empty
  31557. // values are omitted from API requests. However, any field with an
  31558. // empty value appearing in NullFields will be sent to the server as
  31559. // null. It is an error if a field in this list has a non-empty value.
  31560. // This may be used to include null fields in Patch requests.
  31561. NullFields []string `json:"-"`
  31562. }
  31563. func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  31564. type NoMethod SubnetworkAggregatedListWarning
  31565. raw := NoMethod(*s)
  31566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31567. }
  31568. type SubnetworkAggregatedListWarningData struct {
  31569. // Key: [Output Only] A key that provides more detail on the warning
  31570. // being returned. For example, for warnings where there are no results
  31571. // in a list request for a particular zone, this key might be scope and
  31572. // the key value might be the zone name. Other examples might be a key
  31573. // indicating a deprecated resource and a suggested replacement, or a
  31574. // warning about invalid network settings (for example, if an instance
  31575. // attempts to perform IP forwarding but is not enabled for IP
  31576. // forwarding).
  31577. Key string `json:"key,omitempty"`
  31578. // Value: [Output Only] A warning data value corresponding to the key.
  31579. Value string `json:"value,omitempty"`
  31580. // ForceSendFields is a list of field names (e.g. "Key") to
  31581. // unconditionally include in API requests. By default, fields with
  31582. // empty values are omitted from API requests. However, any non-pointer,
  31583. // non-interface field appearing in ForceSendFields will be sent to the
  31584. // server regardless of whether the field is empty or not. This may be
  31585. // used to include empty fields in Patch requests.
  31586. ForceSendFields []string `json:"-"`
  31587. // NullFields is a list of field names (e.g. "Key") to include in API
  31588. // requests with the JSON null value. By default, fields with empty
  31589. // values are omitted from API requests. However, any field with an
  31590. // empty value appearing in NullFields will be sent to the server as
  31591. // null. It is an error if a field in this list has a non-empty value.
  31592. // This may be used to include null fields in Patch requests.
  31593. NullFields []string `json:"-"`
  31594. }
  31595. func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  31596. type NoMethod SubnetworkAggregatedListWarningData
  31597. raw := NoMethod(*s)
  31598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31599. }
  31600. // SubnetworkList: Contains a list of Subnetwork resources.
  31601. type SubnetworkList struct {
  31602. // Id: [Output Only] Unique identifier for the resource; defined by the
  31603. // server.
  31604. Id string `json:"id,omitempty"`
  31605. // Items: A list of Subnetwork resources.
  31606. Items []*Subnetwork `json:"items,omitempty"`
  31607. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  31608. // for lists of subnetworks.
  31609. Kind string `json:"kind,omitempty"`
  31610. // NextPageToken: [Output Only] This token allows you to get the next
  31611. // page of results for list requests. If the number of results is larger
  31612. // than maxResults, use the nextPageToken as a value for the query
  31613. // parameter pageToken in the next list request. Subsequent list
  31614. // requests will have their own nextPageToken to continue paging through
  31615. // the results.
  31616. NextPageToken string `json:"nextPageToken,omitempty"`
  31617. // SelfLink: [Output Only] Server-defined URL for this resource.
  31618. SelfLink string `json:"selfLink,omitempty"`
  31619. // Warning: [Output Only] Informational warning message.
  31620. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  31621. // ServerResponse contains the HTTP response code and headers from the
  31622. // server.
  31623. googleapi.ServerResponse `json:"-"`
  31624. // ForceSendFields is a list of field names (e.g. "Id") to
  31625. // unconditionally include in API requests. By default, fields with
  31626. // empty values are omitted from API requests. However, any non-pointer,
  31627. // non-interface field appearing in ForceSendFields will be sent to the
  31628. // server regardless of whether the field is empty or not. This may be
  31629. // used to include empty fields in Patch requests.
  31630. ForceSendFields []string `json:"-"`
  31631. // NullFields is a list of field names (e.g. "Id") to include in API
  31632. // requests with the JSON null value. By default, fields with empty
  31633. // values are omitted from API requests. However, any field with an
  31634. // empty value appearing in NullFields will be sent to the server as
  31635. // null. It is an error if a field in this list has a non-empty value.
  31636. // This may be used to include null fields in Patch requests.
  31637. NullFields []string `json:"-"`
  31638. }
  31639. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  31640. type NoMethod SubnetworkList
  31641. raw := NoMethod(*s)
  31642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31643. }
  31644. // SubnetworkListWarning: [Output Only] Informational warning message.
  31645. type SubnetworkListWarning struct {
  31646. // Code: [Output Only] A warning code, if applicable. For example,
  31647. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31648. // the response.
  31649. //
  31650. // Possible values:
  31651. // "CLEANUP_FAILED"
  31652. // "DEPRECATED_RESOURCE_USED"
  31653. // "DEPRECATED_TYPE_USED"
  31654. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31655. // "EXPERIMENTAL_TYPE_USED"
  31656. // "EXTERNAL_API_WARNING"
  31657. // "FIELD_VALUE_OVERRIDEN"
  31658. // "INJECTED_KERNELS_DEPRECATED"
  31659. // "MISSING_TYPE_DEPENDENCY"
  31660. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31661. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31662. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31663. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31664. // "NEXT_HOP_NOT_RUNNING"
  31665. // "NOT_CRITICAL_ERROR"
  31666. // "NO_RESULTS_ON_PAGE"
  31667. // "REQUIRED_TOS_AGREEMENT"
  31668. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31669. // "RESOURCE_NOT_DELETED"
  31670. // "SCHEMA_VALIDATION_IGNORED"
  31671. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31672. // "UNDECLARED_PROPERTIES"
  31673. // "UNREACHABLE"
  31674. Code string `json:"code,omitempty"`
  31675. // Data: [Output Only] Metadata about this warning in key: value format.
  31676. // For example:
  31677. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31678. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  31679. // Message: [Output Only] A human-readable description of the warning
  31680. // code.
  31681. Message string `json:"message,omitempty"`
  31682. // ForceSendFields is a list of field names (e.g. "Code") to
  31683. // unconditionally include in API requests. By default, fields with
  31684. // empty values are omitted from API requests. However, any non-pointer,
  31685. // non-interface field appearing in ForceSendFields will be sent to the
  31686. // server regardless of whether the field is empty or not. This may be
  31687. // used to include empty fields in Patch requests.
  31688. ForceSendFields []string `json:"-"`
  31689. // NullFields is a list of field names (e.g. "Code") to include in API
  31690. // requests with the JSON null value. By default, fields with empty
  31691. // values are omitted from API requests. However, any field with an
  31692. // empty value appearing in NullFields will be sent to the server as
  31693. // null. It is an error if a field in this list has a non-empty value.
  31694. // This may be used to include null fields in Patch requests.
  31695. NullFields []string `json:"-"`
  31696. }
  31697. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  31698. type NoMethod SubnetworkListWarning
  31699. raw := NoMethod(*s)
  31700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31701. }
  31702. type SubnetworkListWarningData struct {
  31703. // Key: [Output Only] A key that provides more detail on the warning
  31704. // being returned. For example, for warnings where there are no results
  31705. // in a list request for a particular zone, this key might be scope and
  31706. // the key value might be the zone name. Other examples might be a key
  31707. // indicating a deprecated resource and a suggested replacement, or a
  31708. // warning about invalid network settings (for example, if an instance
  31709. // attempts to perform IP forwarding but is not enabled for IP
  31710. // forwarding).
  31711. Key string `json:"key,omitempty"`
  31712. // Value: [Output Only] A warning data value corresponding to the key.
  31713. Value string `json:"value,omitempty"`
  31714. // ForceSendFields is a list of field names (e.g. "Key") to
  31715. // unconditionally include in API requests. By default, fields with
  31716. // empty values are omitted from API requests. However, any non-pointer,
  31717. // non-interface field appearing in ForceSendFields will be sent to the
  31718. // server regardless of whether the field is empty or not. This may be
  31719. // used to include empty fields in Patch requests.
  31720. ForceSendFields []string `json:"-"`
  31721. // NullFields is a list of field names (e.g. "Key") to include in API
  31722. // requests with the JSON null value. By default, fields with empty
  31723. // values are omitted from API requests. However, any field with an
  31724. // empty value appearing in NullFields will be sent to the server as
  31725. // null. It is an error if a field in this list has a non-empty value.
  31726. // This may be used to include null fields in Patch requests.
  31727. NullFields []string `json:"-"`
  31728. }
  31729. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  31730. type NoMethod SubnetworkListWarningData
  31731. raw := NoMethod(*s)
  31732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31733. }
  31734. // SubnetworkLogConfig: The available logging options for this
  31735. // subnetwork.
  31736. type SubnetworkLogConfig struct {
  31737. // AggregationInterval: Can only be specified if VPC flow logging for
  31738. // this subnetwork is enabled. Toggles the aggregation interval for
  31739. // collecting flow logs. Increasing the interval time will reduce the
  31740. // amount of generated flow logs for long lasting connections. Default
  31741. // is an interval of 5 seconds per connection.
  31742. //
  31743. // Possible values:
  31744. // "INTERVAL_10_MIN"
  31745. // "INTERVAL_15_MIN"
  31746. // "INTERVAL_1_MIN"
  31747. // "INTERVAL_30_SEC"
  31748. // "INTERVAL_5_MIN"
  31749. // "INTERVAL_5_SEC"
  31750. AggregationInterval string `json:"aggregationInterval,omitempty"`
  31751. // Enable: Whether to enable flow logging for this subnetwork. If this
  31752. // field is not explicitly set, it will not appear in get listings. If
  31753. // not set the default behavior is to disable flow logging.
  31754. Enable bool `json:"enable,omitempty"`
  31755. // FlowSampling: Can only be specified if VPC flow logging for this
  31756. // subnetwork is enabled. The value of the field must be in [0, 1]. Set
  31757. // the sampling rate of VPC flow logs within the subnetwork where 1.0
  31758. // means all collected logs are reported and 0.0 means no logs are
  31759. // reported. Default is 0.5, which means half of all collected logs are
  31760. // reported.
  31761. FlowSampling float64 `json:"flowSampling,omitempty"`
  31762. // Metadata: Can only be specified if VPC flow logging for this
  31763. // subnetwork is enabled. Configures whether metadata fields should be
  31764. // added to the reported VPC flow logs. Default is INCLUDE_ALL_METADATA.
  31765. //
  31766. // Possible values:
  31767. // "EXCLUDE_ALL_METADATA"
  31768. // "INCLUDE_ALL_METADATA"
  31769. Metadata string `json:"metadata,omitempty"`
  31770. // ForceSendFields is a list of field names (e.g. "AggregationInterval")
  31771. // to unconditionally include in API requests. By default, fields with
  31772. // empty values are omitted from API requests. However, any non-pointer,
  31773. // non-interface field appearing in ForceSendFields will be sent to the
  31774. // server regardless of whether the field is empty or not. This may be
  31775. // used to include empty fields in Patch requests.
  31776. ForceSendFields []string `json:"-"`
  31777. // NullFields is a list of field names (e.g. "AggregationInterval") to
  31778. // include in API requests with the JSON null value. By default, fields
  31779. // with empty values are omitted from API requests. However, any field
  31780. // with an empty value appearing in NullFields will be sent to the
  31781. // server as null. It is an error if a field in this list has a
  31782. // non-empty value. This may be used to include null fields in Patch
  31783. // requests.
  31784. NullFields []string `json:"-"`
  31785. }
  31786. func (s *SubnetworkLogConfig) MarshalJSON() ([]byte, error) {
  31787. type NoMethod SubnetworkLogConfig
  31788. raw := NoMethod(*s)
  31789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31790. }
  31791. func (s *SubnetworkLogConfig) UnmarshalJSON(data []byte) error {
  31792. type NoMethod SubnetworkLogConfig
  31793. var s1 struct {
  31794. FlowSampling gensupport.JSONFloat64 `json:"flowSampling"`
  31795. *NoMethod
  31796. }
  31797. s1.NoMethod = (*NoMethod)(s)
  31798. if err := json.Unmarshal(data, &s1); err != nil {
  31799. return err
  31800. }
  31801. s.FlowSampling = float64(s1.FlowSampling)
  31802. return nil
  31803. }
  31804. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  31805. // subnetwork.
  31806. type SubnetworkSecondaryRange struct {
  31807. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  31808. // secondary range. Provide this property when you create the
  31809. // subnetwork. Ranges must be unique and non-overlapping with all
  31810. // primary and secondary IP ranges within a network. Only IPv4 is
  31811. // supported.
  31812. IpCidrRange string `json:"ipCidrRange,omitempty"`
  31813. // RangeName: The name associated with this subnetwork secondary range,
  31814. // used when adding an alias IP range to a VM instance. The name must be
  31815. // 1-63 characters long, and comply with RFC1035. The name must be
  31816. // unique within the subnetwork.
  31817. RangeName string `json:"rangeName,omitempty"`
  31818. // RangeType: The type of IP CIDR range to associate with this
  31819. // subnetwork secondary range. The default is RFC_1918. When creating a
  31820. // subnetwork in non-RFC 1918 range, this field must be set to
  31821. // NON_RFC_1918.
  31822. //
  31823. // Possible values:
  31824. // "NON_RFC_1918"
  31825. // "RFC_1918"
  31826. RangeType string `json:"rangeType,omitempty"`
  31827. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  31828. // unconditionally include in API requests. By default, fields with
  31829. // empty values are omitted from API requests. However, any non-pointer,
  31830. // non-interface field appearing in ForceSendFields will be sent to the
  31831. // server regardless of whether the field is empty or not. This may be
  31832. // used to include empty fields in Patch requests.
  31833. ForceSendFields []string `json:"-"`
  31834. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  31835. // in API requests with the JSON null value. By default, fields with
  31836. // empty values are omitted from API requests. However, any field with
  31837. // an empty value appearing in NullFields will be sent to the server as
  31838. // null. It is an error if a field in this list has a non-empty value.
  31839. // This may be used to include null fields in Patch requests.
  31840. NullFields []string `json:"-"`
  31841. }
  31842. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  31843. type NoMethod SubnetworkSecondaryRange
  31844. raw := NoMethod(*s)
  31845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31846. }
  31847. type SubnetworksExpandIpCidrRangeRequest struct {
  31848. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  31849. // that are legal on this Subnetwork. This range should be disjoint from
  31850. // other subnetworks within this network. This range can only be larger
  31851. // than (i.e. a superset of) the range previously defined before the
  31852. // update.
  31853. IpCidrRange string `json:"ipCidrRange,omitempty"`
  31854. // RangeType: The type of IP CIDR range to associate with this
  31855. // subnetwork. The default is RFC_1918. When expanding to a non-RFC 1918
  31856. // range, this field must be be set to NON_RFC_1918.
  31857. //
  31858. // Possible values:
  31859. // "NON_RFC_1918"
  31860. // "RFC_1918"
  31861. RangeType string `json:"rangeType,omitempty"`
  31862. // ForceSendFields is a list of field names (e.g. "IpCidrRange") 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. "IpCidrRange") to include
  31870. // in API requests with the JSON null value. By default, fields with
  31871. // empty values are omitted from API requests. However, any field with
  31872. // an 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 *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  31878. type NoMethod SubnetworksExpandIpCidrRangeRequest
  31879. raw := NoMethod(*s)
  31880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31881. }
  31882. type SubnetworksScopedList struct {
  31883. // Subnetworks: A list of subnetworks contained in this scope.
  31884. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  31885. // Warning: An informational warning that appears when the list of
  31886. // addresses is empty.
  31887. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  31888. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  31889. // unconditionally include in API requests. By default, fields with
  31890. // empty values are omitted from API requests. However, any non-pointer,
  31891. // non-interface field appearing in ForceSendFields will be sent to the
  31892. // server regardless of whether the field is empty or not. This may be
  31893. // used to include empty fields in Patch requests.
  31894. ForceSendFields []string `json:"-"`
  31895. // NullFields is a list of field names (e.g. "Subnetworks") to include
  31896. // in API requests with the JSON null value. By default, fields with
  31897. // empty values are omitted from API requests. However, any field with
  31898. // an empty value appearing in NullFields will be sent to the server as
  31899. // null. It is an error if a field in this list has a non-empty value.
  31900. // This may be used to include null fields in Patch requests.
  31901. NullFields []string `json:"-"`
  31902. }
  31903. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  31904. type NoMethod SubnetworksScopedList
  31905. raw := NoMethod(*s)
  31906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31907. }
  31908. // SubnetworksScopedListWarning: An informational warning that appears
  31909. // when the list of addresses is empty.
  31910. type SubnetworksScopedListWarning struct {
  31911. // Code: [Output Only] A warning code, if applicable. For example,
  31912. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31913. // the response.
  31914. //
  31915. // Possible values:
  31916. // "CLEANUP_FAILED"
  31917. // "DEPRECATED_RESOURCE_USED"
  31918. // "DEPRECATED_TYPE_USED"
  31919. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31920. // "EXPERIMENTAL_TYPE_USED"
  31921. // "EXTERNAL_API_WARNING"
  31922. // "FIELD_VALUE_OVERRIDEN"
  31923. // "INJECTED_KERNELS_DEPRECATED"
  31924. // "MISSING_TYPE_DEPENDENCY"
  31925. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31926. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31927. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31928. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31929. // "NEXT_HOP_NOT_RUNNING"
  31930. // "NOT_CRITICAL_ERROR"
  31931. // "NO_RESULTS_ON_PAGE"
  31932. // "REQUIRED_TOS_AGREEMENT"
  31933. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31934. // "RESOURCE_NOT_DELETED"
  31935. // "SCHEMA_VALIDATION_IGNORED"
  31936. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31937. // "UNDECLARED_PROPERTIES"
  31938. // "UNREACHABLE"
  31939. Code string `json:"code,omitempty"`
  31940. // Data: [Output Only] Metadata about this warning in key: value format.
  31941. // For example:
  31942. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31943. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  31944. // Message: [Output Only] A human-readable description of the warning
  31945. // code.
  31946. Message string `json:"message,omitempty"`
  31947. // ForceSendFields is a list of field names (e.g. "Code") to
  31948. // unconditionally include in API requests. By default, fields with
  31949. // empty values are omitted from API requests. However, any non-pointer,
  31950. // non-interface field appearing in ForceSendFields will be sent to the
  31951. // server regardless of whether the field is empty or not. This may be
  31952. // used to include empty fields in Patch requests.
  31953. ForceSendFields []string `json:"-"`
  31954. // NullFields is a list of field names (e.g. "Code") to include in API
  31955. // requests with the JSON null value. By default, fields with empty
  31956. // values are omitted from API requests. However, any field with an
  31957. // empty value appearing in NullFields will be sent to the server as
  31958. // null. It is an error if a field in this list has a non-empty value.
  31959. // This may be used to include null fields in Patch requests.
  31960. NullFields []string `json:"-"`
  31961. }
  31962. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  31963. type NoMethod SubnetworksScopedListWarning
  31964. raw := NoMethod(*s)
  31965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31966. }
  31967. type SubnetworksScopedListWarningData struct {
  31968. // Key: [Output Only] A key that provides more detail on the warning
  31969. // being returned. For example, for warnings where there are no results
  31970. // in a list request for a particular zone, this key might be scope and
  31971. // the key value might be the zone name. Other examples might be a key
  31972. // indicating a deprecated resource and a suggested replacement, or a
  31973. // warning about invalid network settings (for example, if an instance
  31974. // attempts to perform IP forwarding but is not enabled for IP
  31975. // forwarding).
  31976. Key string `json:"key,omitempty"`
  31977. // Value: [Output Only] A warning data value corresponding to the key.
  31978. Value string `json:"value,omitempty"`
  31979. // ForceSendFields is a list of field names (e.g. "Key") to
  31980. // unconditionally include in API requests. By default, fields with
  31981. // empty values are omitted from API requests. However, any non-pointer,
  31982. // non-interface field appearing in ForceSendFields will be sent to the
  31983. // server regardless of whether the field is empty or not. This may be
  31984. // used to include empty fields in Patch requests.
  31985. ForceSendFields []string `json:"-"`
  31986. // NullFields is a list of field names (e.g. "Key") to include in API
  31987. // requests with the JSON null value. By default, fields with empty
  31988. // values are omitted from API requests. However, any field with an
  31989. // empty value appearing in NullFields will be sent to the server as
  31990. // null. It is an error if a field in this list has a non-empty value.
  31991. // This may be used to include null fields in Patch requests.
  31992. NullFields []string `json:"-"`
  31993. }
  31994. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  31995. type NoMethod SubnetworksScopedListWarningData
  31996. raw := NoMethod(*s)
  31997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31998. }
  31999. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  32000. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  32001. // ForceSendFields is a list of field names (e.g.
  32002. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  32003. // By default, fields with empty values are omitted from API requests.
  32004. // However, any non-pointer, non-interface field appearing in
  32005. // ForceSendFields will be sent to the server regardless of whether the
  32006. // field is empty or not. This may be used to include empty fields in
  32007. // Patch requests.
  32008. ForceSendFields []string `json:"-"`
  32009. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  32010. // include in API requests with the JSON null value. By default, fields
  32011. // with empty values are omitted from API requests. However, any field
  32012. // with an empty value appearing in NullFields will be sent to the
  32013. // server as null. It is an error if a field in this list has a
  32014. // non-empty value. This may be used to include null fields in Patch
  32015. // requests.
  32016. NullFields []string `json:"-"`
  32017. }
  32018. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  32019. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  32020. raw := NoMethod(*s)
  32021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32022. }
  32023. type TCPHealthCheck struct {
  32024. // Port: The TCP port number for the health check request. The default
  32025. // value is 80. Valid values are 1 through 65535.
  32026. Port int64 `json:"port,omitempty"`
  32027. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  32028. // both port and port_name are defined, port takes precedence.
  32029. PortName string `json:"portName,omitempty"`
  32030. // PortSpecification: Specifies how port is selected for health
  32031. // checking, can be one of following values:
  32032. // USE_FIXED_PORT: The port number in
  32033. // port
  32034. // is used for health checking.
  32035. // USE_NAMED_PORT: The
  32036. // portName
  32037. // is used for health checking.
  32038. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  32039. // each network endpoint is used for health checking. For other
  32040. // backends, the port or named port specified in the Backend Service is
  32041. // used for health checking.
  32042. //
  32043. //
  32044. // If not specified, TCP health check follows behavior specified
  32045. // in
  32046. // port
  32047. // and
  32048. // portName
  32049. // fields.
  32050. //
  32051. // Possible values:
  32052. // "USE_FIXED_PORT"
  32053. // "USE_NAMED_PORT"
  32054. // "USE_SERVING_PORT"
  32055. PortSpecification string `json:"portSpecification,omitempty"`
  32056. // ProxyHeader: Specifies the type of proxy header to append before
  32057. // sending data to the backend, either NONE or PROXY_V1. The default is
  32058. // NONE.
  32059. //
  32060. // Possible values:
  32061. // "NONE"
  32062. // "PROXY_V1"
  32063. ProxyHeader string `json:"proxyHeader,omitempty"`
  32064. // Request: The application data to send once the TCP connection has
  32065. // been established (default value is empty). If both request and
  32066. // response are empty, the connection establishment alone will indicate
  32067. // health. The request data can only be ASCII.
  32068. Request string `json:"request,omitempty"`
  32069. // Response: The bytes to match against the beginning of the response
  32070. // data. If left empty (the default value), any response will indicate
  32071. // health. The response data can only be ASCII.
  32072. Response string `json:"response,omitempty"`
  32073. // ForceSendFields is a list of field names (e.g. "Port") to
  32074. // unconditionally include in API requests. By default, fields with
  32075. // empty values are omitted from API requests. However, any non-pointer,
  32076. // non-interface field appearing in ForceSendFields will be sent to the
  32077. // server regardless of whether the field is empty or not. This may be
  32078. // used to include empty fields in Patch requests.
  32079. ForceSendFields []string `json:"-"`
  32080. // NullFields is a list of field names (e.g. "Port") to include in API
  32081. // requests with the JSON null value. By default, fields with empty
  32082. // values are omitted from API requests. However, any field with an
  32083. // empty value appearing in NullFields will be sent to the server as
  32084. // null. It is an error if a field in this list has a non-empty value.
  32085. // This may be used to include null fields in Patch requests.
  32086. NullFields []string `json:"-"`
  32087. }
  32088. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  32089. type NoMethod TCPHealthCheck
  32090. raw := NoMethod(*s)
  32091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32092. }
  32093. // Tags: A set of instance tags.
  32094. type Tags struct {
  32095. // Fingerprint: Specifies a fingerprint for this request, which is
  32096. // essentially a hash of the tags' contents and used for optimistic
  32097. // locking. The fingerprint is initially generated by Compute Engine and
  32098. // changes after every request to modify or update tags. You must always
  32099. // provide an up-to-date fingerprint hash in order to update or change
  32100. // tags.
  32101. //
  32102. // To see the latest fingerprint, make get() request to the instance.
  32103. Fingerprint string `json:"fingerprint,omitempty"`
  32104. // Items: An array of tags. Each tag must be 1-63 characters long, and
  32105. // comply with RFC1035.
  32106. Items []string `json:"items,omitempty"`
  32107. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  32108. // unconditionally include in API requests. By default, fields with
  32109. // empty values are omitted from API requests. However, any non-pointer,
  32110. // non-interface field appearing in ForceSendFields will be sent to the
  32111. // server regardless of whether the field is empty or not. This may be
  32112. // used to include empty fields in Patch requests.
  32113. ForceSendFields []string `json:"-"`
  32114. // NullFields is a list of field names (e.g. "Fingerprint") to include
  32115. // in API requests with the JSON null value. By default, fields with
  32116. // empty values are omitted from API requests. However, any field with
  32117. // an empty value appearing in NullFields will be sent to the server as
  32118. // null. It is an error if a field in this list has a non-empty value.
  32119. // This may be used to include null fields in Patch requests.
  32120. NullFields []string `json:"-"`
  32121. }
  32122. func (s *Tags) MarshalJSON() ([]byte, error) {
  32123. type NoMethod Tags
  32124. raw := NoMethod(*s)
  32125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32126. }
  32127. type TargetHttpProxiesScopedList struct {
  32128. // TargetHttpProxies: A list of TargetHttpProxies contained in this
  32129. // scope.
  32130. TargetHttpProxies []*TargetHttpProxy `json:"targetHttpProxies,omitempty"`
  32131. // Warning: Informational warning which replaces the list of backend
  32132. // services when the list is empty.
  32133. Warning *TargetHttpProxiesScopedListWarning `json:"warning,omitempty"`
  32134. // ForceSendFields is a list of field names (e.g. "TargetHttpProxies")
  32135. // to unconditionally include in API requests. By default, fields with
  32136. // empty values are omitted from API requests. However, any non-pointer,
  32137. // non-interface field appearing in ForceSendFields will be sent to the
  32138. // server regardless of whether the field is empty or not. This may be
  32139. // used to include empty fields in Patch requests.
  32140. ForceSendFields []string `json:"-"`
  32141. // NullFields is a list of field names (e.g. "TargetHttpProxies") to
  32142. // include in API requests with the JSON null value. By default, fields
  32143. // with empty values are omitted from API requests. However, any field
  32144. // with an empty value appearing in NullFields will be sent to the
  32145. // server as null. It is an error if a field in this list has a
  32146. // non-empty value. This may be used to include null fields in Patch
  32147. // requests.
  32148. NullFields []string `json:"-"`
  32149. }
  32150. func (s *TargetHttpProxiesScopedList) MarshalJSON() ([]byte, error) {
  32151. type NoMethod TargetHttpProxiesScopedList
  32152. raw := NoMethod(*s)
  32153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32154. }
  32155. // TargetHttpProxiesScopedListWarning: Informational warning which
  32156. // replaces the list of backend services when the list is empty.
  32157. type TargetHttpProxiesScopedListWarning struct {
  32158. // Code: [Output Only] A warning code, if applicable. For example,
  32159. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32160. // the response.
  32161. //
  32162. // Possible values:
  32163. // "CLEANUP_FAILED"
  32164. // "DEPRECATED_RESOURCE_USED"
  32165. // "DEPRECATED_TYPE_USED"
  32166. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32167. // "EXPERIMENTAL_TYPE_USED"
  32168. // "EXTERNAL_API_WARNING"
  32169. // "FIELD_VALUE_OVERRIDEN"
  32170. // "INJECTED_KERNELS_DEPRECATED"
  32171. // "MISSING_TYPE_DEPENDENCY"
  32172. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32173. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32174. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32175. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32176. // "NEXT_HOP_NOT_RUNNING"
  32177. // "NOT_CRITICAL_ERROR"
  32178. // "NO_RESULTS_ON_PAGE"
  32179. // "REQUIRED_TOS_AGREEMENT"
  32180. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32181. // "RESOURCE_NOT_DELETED"
  32182. // "SCHEMA_VALIDATION_IGNORED"
  32183. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32184. // "UNDECLARED_PROPERTIES"
  32185. // "UNREACHABLE"
  32186. Code string `json:"code,omitempty"`
  32187. // Data: [Output Only] Metadata about this warning in key: value format.
  32188. // For example:
  32189. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32190. Data []*TargetHttpProxiesScopedListWarningData `json:"data,omitempty"`
  32191. // Message: [Output Only] A human-readable description of the warning
  32192. // code.
  32193. Message string `json:"message,omitempty"`
  32194. // ForceSendFields is a list of field names (e.g. "Code") to
  32195. // unconditionally include in API requests. By default, fields with
  32196. // empty values are omitted from API requests. However, any non-pointer,
  32197. // non-interface field appearing in ForceSendFields will be sent to the
  32198. // server regardless of whether the field is empty or not. This may be
  32199. // used to include empty fields in Patch requests.
  32200. ForceSendFields []string `json:"-"`
  32201. // NullFields is a list of field names (e.g. "Code") to include in API
  32202. // requests with the JSON null value. By default, fields with empty
  32203. // values are omitted from API requests. However, any field with an
  32204. // empty value appearing in NullFields will be sent to the server as
  32205. // null. It is an error if a field in this list has a non-empty value.
  32206. // This may be used to include null fields in Patch requests.
  32207. NullFields []string `json:"-"`
  32208. }
  32209. func (s *TargetHttpProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
  32210. type NoMethod TargetHttpProxiesScopedListWarning
  32211. raw := NoMethod(*s)
  32212. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32213. }
  32214. type TargetHttpProxiesScopedListWarningData struct {
  32215. // Key: [Output Only] A key that provides more detail on the warning
  32216. // being returned. For example, for warnings where there are no results
  32217. // in a list request for a particular zone, this key might be scope and
  32218. // the key value might be the zone name. Other examples might be a key
  32219. // indicating a deprecated resource and a suggested replacement, or a
  32220. // warning about invalid network settings (for example, if an instance
  32221. // attempts to perform IP forwarding but is not enabled for IP
  32222. // forwarding).
  32223. Key string `json:"key,omitempty"`
  32224. // Value: [Output Only] A warning data value corresponding to the key.
  32225. Value string `json:"value,omitempty"`
  32226. // ForceSendFields is a list of field names (e.g. "Key") to
  32227. // unconditionally include in API requests. By default, fields with
  32228. // empty values are omitted from API requests. However, any non-pointer,
  32229. // non-interface field appearing in ForceSendFields will be sent to the
  32230. // server regardless of whether the field is empty or not. This may be
  32231. // used to include empty fields in Patch requests.
  32232. ForceSendFields []string `json:"-"`
  32233. // NullFields is a list of field names (e.g. "Key") to include in API
  32234. // requests with the JSON null value. By default, fields with empty
  32235. // values are omitted from API requests. However, any field with an
  32236. // empty value appearing in NullFields will be sent to the server as
  32237. // null. It is an error if a field in this list has a non-empty value.
  32238. // This may be used to include null fields in Patch requests.
  32239. NullFields []string `json:"-"`
  32240. }
  32241. func (s *TargetHttpProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
  32242. type NoMethod TargetHttpProxiesScopedListWarningData
  32243. raw := NoMethod(*s)
  32244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32245. }
  32246. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  32247. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  32248. // resource_for v1.targetHttpProxies ==)
  32249. type TargetHttpProxy struct {
  32250. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  32251. // format.
  32252. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  32253. // Description: An optional description of this resource. Provide this
  32254. // property when you create the resource.
  32255. Description string `json:"description,omitempty"`
  32256. // Id: [Output Only] The unique identifier for the resource. This
  32257. // identifier is defined by the server.
  32258. Id uint64 `json:"id,omitempty,string"`
  32259. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  32260. // for target HTTP proxies.
  32261. Kind string `json:"kind,omitempty"`
  32262. // Name: Name of the resource. Provided by the client when the resource
  32263. // is created. The name must be 1-63 characters long, and comply with
  32264. // RFC1035. Specifically, the name must be 1-63 characters long and
  32265. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  32266. // the first character must be a lowercase letter, and all following
  32267. // characters must be a dash, lowercase letter, or digit, except the
  32268. // last character, which cannot be a dash.
  32269. Name string `json:"name,omitempty"`
  32270. // ProxyBind: This field only applies when the loadBalancingScheme is
  32271. // INTERNAL_SELF_MANAGED. When set to true the Envoy binds on the IP
  32272. // address specified by the forwarding rule. Default is false.
  32273. ProxyBind bool `json:"proxyBind,omitempty"`
  32274. // Region: [Output Only] URL of the region where the regional Target
  32275. // HTTP Proxy resides. This field is not applicable to global Target
  32276. // HTTP Proxies.
  32277. Region string `json:"region,omitempty"`
  32278. // SelfLink: [Output Only] Server-defined URL for the resource.
  32279. SelfLink string `json:"selfLink,omitempty"`
  32280. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  32281. // with the resource id.
  32282. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  32283. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  32284. // to the BackendService.
  32285. UrlMap string `json:"urlMap,omitempty"`
  32286. // ServerResponse contains the HTTP response code and headers from the
  32287. // server.
  32288. googleapi.ServerResponse `json:"-"`
  32289. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  32290. // to unconditionally include in API requests. By default, fields with
  32291. // empty values are omitted from API requests. However, any non-pointer,
  32292. // non-interface field appearing in ForceSendFields will be sent to the
  32293. // server regardless of whether the field is empty or not. This may be
  32294. // used to include empty fields in Patch requests.
  32295. ForceSendFields []string `json:"-"`
  32296. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  32297. // include in API requests with the JSON null value. By default, fields
  32298. // with empty values are omitted from API requests. However, any field
  32299. // with an empty value appearing in NullFields will be sent to the
  32300. // server as null. It is an error if a field in this list has a
  32301. // non-empty value. This may be used to include null fields in Patch
  32302. // requests.
  32303. NullFields []string `json:"-"`
  32304. }
  32305. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  32306. type NoMethod TargetHttpProxy
  32307. raw := NoMethod(*s)
  32308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32309. }
  32310. type TargetHttpProxyAggregatedList struct {
  32311. // Id: [Output Only] Unique identifier for the resource; defined by the
  32312. // server.
  32313. Id string `json:"id,omitempty"`
  32314. // Items: A list of TargetHttpProxiesScopedList resources.
  32315. Items map[string]TargetHttpProxiesScopedList `json:"items,omitempty"`
  32316. // Kind: [Output Only] Type of resource. Always
  32317. // compute#targetHttpProxyAggregatedList for lists of Target HTTP
  32318. // Proxies.
  32319. Kind string `json:"kind,omitempty"`
  32320. // NextPageToken: [Output Only] This token allows you to get the next
  32321. // page of results for list requests. If the number of results is larger
  32322. // than maxResults, use the nextPageToken as a value for the query
  32323. // parameter pageToken in the next list request. Subsequent list
  32324. // requests will have their own nextPageToken to continue paging through
  32325. // the results.
  32326. NextPageToken string `json:"nextPageToken,omitempty"`
  32327. // SelfLink: [Output Only] Server-defined URL for this resource.
  32328. SelfLink string `json:"selfLink,omitempty"`
  32329. // Warning: [Output Only] Informational warning message.
  32330. Warning *TargetHttpProxyAggregatedListWarning `json:"warning,omitempty"`
  32331. // ServerResponse contains the HTTP response code and headers from the
  32332. // server.
  32333. googleapi.ServerResponse `json:"-"`
  32334. // ForceSendFields is a list of field names (e.g. "Id") to
  32335. // unconditionally include in API requests. By default, fields with
  32336. // empty values are omitted from API requests. However, any non-pointer,
  32337. // non-interface field appearing in ForceSendFields will be sent to the
  32338. // server regardless of whether the field is empty or not. This may be
  32339. // used to include empty fields in Patch requests.
  32340. ForceSendFields []string `json:"-"`
  32341. // NullFields is a list of field names (e.g. "Id") to include in API
  32342. // requests with the JSON null value. By default, fields with empty
  32343. // values are omitted from API requests. However, any field with an
  32344. // empty value appearing in NullFields will be sent to the server as
  32345. // null. It is an error if a field in this list has a non-empty value.
  32346. // This may be used to include null fields in Patch requests.
  32347. NullFields []string `json:"-"`
  32348. }
  32349. func (s *TargetHttpProxyAggregatedList) MarshalJSON() ([]byte, error) {
  32350. type NoMethod TargetHttpProxyAggregatedList
  32351. raw := NoMethod(*s)
  32352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32353. }
  32354. // TargetHttpProxyAggregatedListWarning: [Output Only] Informational
  32355. // warning message.
  32356. type TargetHttpProxyAggregatedListWarning struct {
  32357. // Code: [Output Only] A warning code, if applicable. For example,
  32358. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32359. // the response.
  32360. //
  32361. // Possible values:
  32362. // "CLEANUP_FAILED"
  32363. // "DEPRECATED_RESOURCE_USED"
  32364. // "DEPRECATED_TYPE_USED"
  32365. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32366. // "EXPERIMENTAL_TYPE_USED"
  32367. // "EXTERNAL_API_WARNING"
  32368. // "FIELD_VALUE_OVERRIDEN"
  32369. // "INJECTED_KERNELS_DEPRECATED"
  32370. // "MISSING_TYPE_DEPENDENCY"
  32371. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32372. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32373. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32374. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32375. // "NEXT_HOP_NOT_RUNNING"
  32376. // "NOT_CRITICAL_ERROR"
  32377. // "NO_RESULTS_ON_PAGE"
  32378. // "REQUIRED_TOS_AGREEMENT"
  32379. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32380. // "RESOURCE_NOT_DELETED"
  32381. // "SCHEMA_VALIDATION_IGNORED"
  32382. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32383. // "UNDECLARED_PROPERTIES"
  32384. // "UNREACHABLE"
  32385. Code string `json:"code,omitempty"`
  32386. // Data: [Output Only] Metadata about this warning in key: value format.
  32387. // For example:
  32388. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32389. Data []*TargetHttpProxyAggregatedListWarningData `json:"data,omitempty"`
  32390. // Message: [Output Only] A human-readable description of the warning
  32391. // code.
  32392. Message string `json:"message,omitempty"`
  32393. // ForceSendFields is a list of field names (e.g. "Code") to
  32394. // unconditionally include in API requests. By default, fields with
  32395. // empty values are omitted from API requests. However, any non-pointer,
  32396. // non-interface field appearing in ForceSendFields will be sent to the
  32397. // server regardless of whether the field is empty or not. This may be
  32398. // used to include empty fields in Patch requests.
  32399. ForceSendFields []string `json:"-"`
  32400. // NullFields is a list of field names (e.g. "Code") to include in API
  32401. // requests with the JSON null value. By default, fields with empty
  32402. // values are omitted from API requests. However, any field with an
  32403. // empty value appearing in NullFields will be sent to the server as
  32404. // null. It is an error if a field in this list has a non-empty value.
  32405. // This may be used to include null fields in Patch requests.
  32406. NullFields []string `json:"-"`
  32407. }
  32408. func (s *TargetHttpProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  32409. type NoMethod TargetHttpProxyAggregatedListWarning
  32410. raw := NoMethod(*s)
  32411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32412. }
  32413. type TargetHttpProxyAggregatedListWarningData struct {
  32414. // Key: [Output Only] A key that provides more detail on the warning
  32415. // being returned. For example, for warnings where there are no results
  32416. // in a list request for a particular zone, this key might be scope and
  32417. // the key value might be the zone name. Other examples might be a key
  32418. // indicating a deprecated resource and a suggested replacement, or a
  32419. // warning about invalid network settings (for example, if an instance
  32420. // attempts to perform IP forwarding but is not enabled for IP
  32421. // forwarding).
  32422. Key string `json:"key,omitempty"`
  32423. // Value: [Output Only] A warning data value corresponding to the key.
  32424. Value string `json:"value,omitempty"`
  32425. // ForceSendFields is a list of field names (e.g. "Key") to
  32426. // unconditionally include in API requests. By default, fields with
  32427. // empty values are omitted from API requests. However, any non-pointer,
  32428. // non-interface field appearing in ForceSendFields will be sent to the
  32429. // server regardless of whether the field is empty or not. This may be
  32430. // used to include empty fields in Patch requests.
  32431. ForceSendFields []string `json:"-"`
  32432. // NullFields is a list of field names (e.g. "Key") to include in API
  32433. // requests with the JSON null value. By default, fields with empty
  32434. // values are omitted from API requests. However, any field with an
  32435. // empty value appearing in NullFields will be sent to the server as
  32436. // null. It is an error if a field in this list has a non-empty value.
  32437. // This may be used to include null fields in Patch requests.
  32438. NullFields []string `json:"-"`
  32439. }
  32440. func (s *TargetHttpProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  32441. type NoMethod TargetHttpProxyAggregatedListWarningData
  32442. raw := NoMethod(*s)
  32443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32444. }
  32445. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  32446. type TargetHttpProxyList struct {
  32447. // Id: [Output Only] Unique identifier for the resource; defined by the
  32448. // server.
  32449. Id string `json:"id,omitempty"`
  32450. // Items: A list of TargetHttpProxy resources.
  32451. Items []*TargetHttpProxy `json:"items,omitempty"`
  32452. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  32453. // of target HTTP proxies.
  32454. Kind string `json:"kind,omitempty"`
  32455. // NextPageToken: [Output Only] This token allows you to get the next
  32456. // page of results for list requests. If the number of results is larger
  32457. // than maxResults, use the nextPageToken as a value for the query
  32458. // parameter pageToken in the next list request. Subsequent list
  32459. // requests will have their own nextPageToken to continue paging through
  32460. // the results.
  32461. NextPageToken string `json:"nextPageToken,omitempty"`
  32462. // SelfLink: [Output Only] Server-defined URL for this resource.
  32463. SelfLink string `json:"selfLink,omitempty"`
  32464. // Warning: [Output Only] Informational warning message.
  32465. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  32466. // ServerResponse contains the HTTP response code and headers from the
  32467. // server.
  32468. googleapi.ServerResponse `json:"-"`
  32469. // ForceSendFields is a list of field names (e.g. "Id") to
  32470. // unconditionally include in API requests. By default, fields with
  32471. // empty values are omitted from API requests. However, any non-pointer,
  32472. // non-interface field appearing in ForceSendFields will be sent to the
  32473. // server regardless of whether the field is empty or not. This may be
  32474. // used to include empty fields in Patch requests.
  32475. ForceSendFields []string `json:"-"`
  32476. // NullFields is a list of field names (e.g. "Id") to include in API
  32477. // requests with the JSON null value. By default, fields with empty
  32478. // values are omitted from API requests. However, any field with an
  32479. // empty value appearing in NullFields will be sent to the server as
  32480. // null. It is an error if a field in this list has a non-empty value.
  32481. // This may be used to include null fields in Patch requests.
  32482. NullFields []string `json:"-"`
  32483. }
  32484. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  32485. type NoMethod TargetHttpProxyList
  32486. raw := NoMethod(*s)
  32487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32488. }
  32489. // TargetHttpProxyListWarning: [Output Only] Informational warning
  32490. // message.
  32491. type TargetHttpProxyListWarning struct {
  32492. // Code: [Output Only] A warning code, if applicable. For example,
  32493. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32494. // the response.
  32495. //
  32496. // Possible values:
  32497. // "CLEANUP_FAILED"
  32498. // "DEPRECATED_RESOURCE_USED"
  32499. // "DEPRECATED_TYPE_USED"
  32500. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32501. // "EXPERIMENTAL_TYPE_USED"
  32502. // "EXTERNAL_API_WARNING"
  32503. // "FIELD_VALUE_OVERRIDEN"
  32504. // "INJECTED_KERNELS_DEPRECATED"
  32505. // "MISSING_TYPE_DEPENDENCY"
  32506. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32507. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32508. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32509. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32510. // "NEXT_HOP_NOT_RUNNING"
  32511. // "NOT_CRITICAL_ERROR"
  32512. // "NO_RESULTS_ON_PAGE"
  32513. // "REQUIRED_TOS_AGREEMENT"
  32514. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32515. // "RESOURCE_NOT_DELETED"
  32516. // "SCHEMA_VALIDATION_IGNORED"
  32517. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32518. // "UNDECLARED_PROPERTIES"
  32519. // "UNREACHABLE"
  32520. Code string `json:"code,omitempty"`
  32521. // Data: [Output Only] Metadata about this warning in key: value format.
  32522. // For example:
  32523. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32524. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  32525. // Message: [Output Only] A human-readable description of the warning
  32526. // code.
  32527. Message string `json:"message,omitempty"`
  32528. // ForceSendFields is a list of field names (e.g. "Code") to
  32529. // unconditionally include in API requests. By default, fields with
  32530. // empty values are omitted from API requests. However, any non-pointer,
  32531. // non-interface field appearing in ForceSendFields will be sent to the
  32532. // server regardless of whether the field is empty or not. This may be
  32533. // used to include empty fields in Patch requests.
  32534. ForceSendFields []string `json:"-"`
  32535. // NullFields is a list of field names (e.g. "Code") to include in API
  32536. // requests with the JSON null value. By default, fields with empty
  32537. // values are omitted from API requests. However, any field with an
  32538. // empty value appearing in NullFields will be sent to the server as
  32539. // null. It is an error if a field in this list has a non-empty value.
  32540. // This may be used to include null fields in Patch requests.
  32541. NullFields []string `json:"-"`
  32542. }
  32543. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  32544. type NoMethod TargetHttpProxyListWarning
  32545. raw := NoMethod(*s)
  32546. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32547. }
  32548. type TargetHttpProxyListWarningData struct {
  32549. // Key: [Output Only] A key that provides more detail on the warning
  32550. // being returned. For example, for warnings where there are no results
  32551. // in a list request for a particular zone, this key might be scope and
  32552. // the key value might be the zone name. Other examples might be a key
  32553. // indicating a deprecated resource and a suggested replacement, or a
  32554. // warning about invalid network settings (for example, if an instance
  32555. // attempts to perform IP forwarding but is not enabled for IP
  32556. // forwarding).
  32557. Key string `json:"key,omitempty"`
  32558. // Value: [Output Only] A warning data value corresponding to the key.
  32559. Value string `json:"value,omitempty"`
  32560. // ForceSendFields is a list of field names (e.g. "Key") to
  32561. // unconditionally include in API requests. By default, fields with
  32562. // empty values are omitted from API requests. However, any non-pointer,
  32563. // non-interface field appearing in ForceSendFields will be sent to the
  32564. // server regardless of whether the field is empty or not. This may be
  32565. // used to include empty fields in Patch requests.
  32566. ForceSendFields []string `json:"-"`
  32567. // NullFields is a list of field names (e.g. "Key") to include in API
  32568. // requests with the JSON null value. By default, fields with empty
  32569. // values are omitted from API requests. However, any field with an
  32570. // empty value appearing in NullFields will be sent to the server as
  32571. // null. It is an error if a field in this list has a non-empty value.
  32572. // This may be used to include null fields in Patch requests.
  32573. NullFields []string `json:"-"`
  32574. }
  32575. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  32576. type NoMethod TargetHttpProxyListWarningData
  32577. raw := NoMethod(*s)
  32578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32579. }
  32580. type TargetHttpsProxiesScopedList struct {
  32581. // TargetHttpsProxies: A list of TargetHttpsProxies contained in this
  32582. // scope.
  32583. TargetHttpsProxies []*TargetHttpsProxy `json:"targetHttpsProxies,omitempty"`
  32584. // Warning: Informational warning which replaces the list of backend
  32585. // services when the list is empty.
  32586. Warning *TargetHttpsProxiesScopedListWarning `json:"warning,omitempty"`
  32587. // ForceSendFields is a list of field names (e.g. "TargetHttpsProxies")
  32588. // to unconditionally include in API requests. By default, fields with
  32589. // empty values are omitted from API requests. However, any non-pointer,
  32590. // non-interface field appearing in ForceSendFields will be sent to the
  32591. // server regardless of whether the field is empty or not. This may be
  32592. // used to include empty fields in Patch requests.
  32593. ForceSendFields []string `json:"-"`
  32594. // NullFields is a list of field names (e.g. "TargetHttpsProxies") to
  32595. // include in API requests with the JSON null value. By default, fields
  32596. // with empty values are omitted from API requests. However, any field
  32597. // with an empty value appearing in NullFields will be sent to the
  32598. // server as null. It is an error if a field in this list has a
  32599. // non-empty value. This may be used to include null fields in Patch
  32600. // requests.
  32601. NullFields []string `json:"-"`
  32602. }
  32603. func (s *TargetHttpsProxiesScopedList) MarshalJSON() ([]byte, error) {
  32604. type NoMethod TargetHttpsProxiesScopedList
  32605. raw := NoMethod(*s)
  32606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32607. }
  32608. // TargetHttpsProxiesScopedListWarning: Informational warning which
  32609. // replaces the list of backend services when the list is empty.
  32610. type TargetHttpsProxiesScopedListWarning struct {
  32611. // Code: [Output Only] A warning code, if applicable. For example,
  32612. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32613. // the response.
  32614. //
  32615. // Possible values:
  32616. // "CLEANUP_FAILED"
  32617. // "DEPRECATED_RESOURCE_USED"
  32618. // "DEPRECATED_TYPE_USED"
  32619. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32620. // "EXPERIMENTAL_TYPE_USED"
  32621. // "EXTERNAL_API_WARNING"
  32622. // "FIELD_VALUE_OVERRIDEN"
  32623. // "INJECTED_KERNELS_DEPRECATED"
  32624. // "MISSING_TYPE_DEPENDENCY"
  32625. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32626. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32627. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32628. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32629. // "NEXT_HOP_NOT_RUNNING"
  32630. // "NOT_CRITICAL_ERROR"
  32631. // "NO_RESULTS_ON_PAGE"
  32632. // "REQUIRED_TOS_AGREEMENT"
  32633. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32634. // "RESOURCE_NOT_DELETED"
  32635. // "SCHEMA_VALIDATION_IGNORED"
  32636. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32637. // "UNDECLARED_PROPERTIES"
  32638. // "UNREACHABLE"
  32639. Code string `json:"code,omitempty"`
  32640. // Data: [Output Only] Metadata about this warning in key: value format.
  32641. // For example:
  32642. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32643. Data []*TargetHttpsProxiesScopedListWarningData `json:"data,omitempty"`
  32644. // Message: [Output Only] A human-readable description of the warning
  32645. // code.
  32646. Message string `json:"message,omitempty"`
  32647. // ForceSendFields is a list of field names (e.g. "Code") to
  32648. // unconditionally include in API requests. By default, fields with
  32649. // empty values are omitted from API requests. However, any non-pointer,
  32650. // non-interface field appearing in ForceSendFields will be sent to the
  32651. // server regardless of whether the field is empty or not. This may be
  32652. // used to include empty fields in Patch requests.
  32653. ForceSendFields []string `json:"-"`
  32654. // NullFields is a list of field names (e.g. "Code") to include in API
  32655. // requests with the JSON null value. By default, fields with empty
  32656. // values are omitted from API requests. However, any field with an
  32657. // empty value appearing in NullFields will be sent to the server as
  32658. // null. It is an error if a field in this list has a non-empty value.
  32659. // This may be used to include null fields in Patch requests.
  32660. NullFields []string `json:"-"`
  32661. }
  32662. func (s *TargetHttpsProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
  32663. type NoMethod TargetHttpsProxiesScopedListWarning
  32664. raw := NoMethod(*s)
  32665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32666. }
  32667. type TargetHttpsProxiesScopedListWarningData struct {
  32668. // Key: [Output Only] A key that provides more detail on the warning
  32669. // being returned. For example, for warnings where there are no results
  32670. // in a list request for a particular zone, this key might be scope and
  32671. // the key value might be the zone name. Other examples might be a key
  32672. // indicating a deprecated resource and a suggested replacement, or a
  32673. // warning about invalid network settings (for example, if an instance
  32674. // attempts to perform IP forwarding but is not enabled for IP
  32675. // forwarding).
  32676. Key string `json:"key,omitempty"`
  32677. // Value: [Output Only] A warning data value corresponding to the key.
  32678. Value string `json:"value,omitempty"`
  32679. // ForceSendFields is a list of field names (e.g. "Key") to
  32680. // unconditionally include in API requests. By default, fields with
  32681. // empty values are omitted from API requests. However, any non-pointer,
  32682. // non-interface field appearing in ForceSendFields will be sent to the
  32683. // server regardless of whether the field is empty or not. This may be
  32684. // used to include empty fields in Patch requests.
  32685. ForceSendFields []string `json:"-"`
  32686. // NullFields is a list of field names (e.g. "Key") to include in API
  32687. // requests with the JSON null value. By default, fields with empty
  32688. // values are omitted from API requests. However, any field with an
  32689. // empty value appearing in NullFields will be sent to the server as
  32690. // null. It is an error if a field in this list has a non-empty value.
  32691. // This may be used to include null fields in Patch requests.
  32692. NullFields []string `json:"-"`
  32693. }
  32694. func (s *TargetHttpsProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
  32695. type NoMethod TargetHttpsProxiesScopedListWarningData
  32696. raw := NoMethod(*s)
  32697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32698. }
  32699. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  32700. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  32701. //
  32702. // Possible values:
  32703. // "DISABLE"
  32704. // "ENABLE"
  32705. // "NONE"
  32706. QuicOverride string `json:"quicOverride,omitempty"`
  32707. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  32708. // unconditionally include in API requests. By default, fields with
  32709. // empty values are omitted from API requests. However, any non-pointer,
  32710. // non-interface field appearing in ForceSendFields will be sent to the
  32711. // server regardless of whether the field is empty or not. This may be
  32712. // used to include empty fields in Patch requests.
  32713. ForceSendFields []string `json:"-"`
  32714. // NullFields is a list of field names (e.g. "QuicOverride") to include
  32715. // in API requests with the JSON null value. By default, fields with
  32716. // empty values are omitted from API requests. However, any field with
  32717. // an empty value appearing in NullFields will be sent to the server as
  32718. // null. It is an error if a field in this list has a non-empty value.
  32719. // This may be used to include null fields in Patch requests.
  32720. NullFields []string `json:"-"`
  32721. }
  32722. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  32723. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  32724. raw := NoMethod(*s)
  32725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32726. }
  32727. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  32728. // SslCertificates: New set of SslCertificate resources to associate
  32729. // with this TargetHttpsProxy resource. Currently exactly one
  32730. // SslCertificate resource must be specified.
  32731. SslCertificates []string `json:"sslCertificates,omitempty"`
  32732. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  32733. // unconditionally include in API requests. By default, fields with
  32734. // empty values are omitted from API requests. However, any non-pointer,
  32735. // non-interface field appearing in ForceSendFields will be sent to the
  32736. // server regardless of whether the field is empty or not. This may be
  32737. // used to include empty fields in Patch requests.
  32738. ForceSendFields []string `json:"-"`
  32739. // NullFields is a list of field names (e.g. "SslCertificates") to
  32740. // include in API requests with the JSON null value. By default, fields
  32741. // with empty values are omitted from API requests. However, any field
  32742. // with an empty value appearing in NullFields will be sent to the
  32743. // server as null. It is an error if a field in this list has a
  32744. // non-empty value. This may be used to include null fields in Patch
  32745. // requests.
  32746. NullFields []string `json:"-"`
  32747. }
  32748. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  32749. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  32750. raw := NoMethod(*s)
  32751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32752. }
  32753. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  32754. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  32755. // resource_for v1.targetHttpsProxies ==)
  32756. type TargetHttpsProxy struct {
  32757. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  32758. // format.
  32759. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  32760. // Description: An optional description of this resource. Provide this
  32761. // property when you create the resource.
  32762. Description string `json:"description,omitempty"`
  32763. // Id: [Output Only] The unique identifier for the resource. This
  32764. // identifier is defined by the server.
  32765. Id uint64 `json:"id,omitempty,string"`
  32766. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  32767. // for target HTTPS proxies.
  32768. Kind string `json:"kind,omitempty"`
  32769. // Name: Name of the resource. Provided by the client when the resource
  32770. // is created. The name must be 1-63 characters long, and comply with
  32771. // RFC1035. Specifically, the name must be 1-63 characters long and
  32772. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  32773. // the first character must be a lowercase letter, and all following
  32774. // characters must be a dash, lowercase letter, or digit, except the
  32775. // last character, which cannot be a dash.
  32776. Name string `json:"name,omitempty"`
  32777. // ProxyBind: This field only applies when the loadBalancingScheme is
  32778. // INTERNAL_SELF_MANAGED. When set to true the Envoy binds on the IP
  32779. // address specified by the forwarding rule. Default is false.
  32780. ProxyBind bool `json:"proxyBind,omitempty"`
  32781. // QuicOverride: Specifies the QUIC override policy for this
  32782. // TargetHttpsProxy resource. This determines whether the load balancer
  32783. // will attempt to negotiate QUIC with clients or not. Can specify one
  32784. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  32785. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  32786. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  32787. // overrides, which is equivalent to DISABLE. Not specifying this field
  32788. // is equivalent to specifying NONE.
  32789. //
  32790. // Possible values:
  32791. // "DISABLE"
  32792. // "ENABLE"
  32793. // "NONE"
  32794. QuicOverride string `json:"quicOverride,omitempty"`
  32795. // Region: [Output Only] URL of the region where the regional
  32796. // TargetHttpsProxy resides. This field is not applicable to global
  32797. // TargetHttpsProxies.
  32798. Region string `json:"region,omitempty"`
  32799. // SelfLink: [Output Only] Server-defined URL for the resource.
  32800. SelfLink string `json:"selfLink,omitempty"`
  32801. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  32802. // with the resource id.
  32803. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  32804. // SslCertificates: URLs to SslCertificate resources that are used to
  32805. // authenticate connections between users and the load balancer. At
  32806. // least one SSL certificate must be specified. Currently, you may
  32807. // specify up to 15 SSL certificates.
  32808. SslCertificates []string `json:"sslCertificates,omitempty"`
  32809. // SslPolicy: URL of SslPolicy resource that will be associated with the
  32810. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  32811. // will not have any SSL policy configured.
  32812. SslPolicy string `json:"sslPolicy,omitempty"`
  32813. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  32814. // that defines the mapping from URL to the BackendService. For example,
  32815. // the following are all valid URLs for specifying a URL map:
  32816. // -
  32817. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  32818. // - projects/project/global/urlMaps/url-map
  32819. // - global/urlMaps/url-map
  32820. UrlMap string `json:"urlMap,omitempty"`
  32821. // ServerResponse contains the HTTP response code and headers from the
  32822. // server.
  32823. googleapi.ServerResponse `json:"-"`
  32824. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  32825. // to unconditionally include in API requests. By default, fields with
  32826. // empty values are omitted from API requests. However, any non-pointer,
  32827. // non-interface field appearing in ForceSendFields will be sent to the
  32828. // server regardless of whether the field is empty or not. This may be
  32829. // used to include empty fields in Patch requests.
  32830. ForceSendFields []string `json:"-"`
  32831. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  32832. // include in API requests with the JSON null value. By default, fields
  32833. // with empty values are omitted from API requests. However, any field
  32834. // with an empty value appearing in NullFields will be sent to the
  32835. // server as null. It is an error if a field in this list has a
  32836. // non-empty value. This may be used to include null fields in Patch
  32837. // requests.
  32838. NullFields []string `json:"-"`
  32839. }
  32840. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  32841. type NoMethod TargetHttpsProxy
  32842. raw := NoMethod(*s)
  32843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32844. }
  32845. type TargetHttpsProxyAggregatedList struct {
  32846. // Id: [Output Only] Unique identifier for the resource; defined by the
  32847. // server.
  32848. Id string `json:"id,omitempty"`
  32849. // Items: A list of TargetHttpsProxiesScopedList resources.
  32850. Items map[string]TargetHttpsProxiesScopedList `json:"items,omitempty"`
  32851. // Kind: [Output Only] Type of resource. Always
  32852. // compute#targetHttpsProxyAggregatedList for lists of Target HTTP
  32853. // Proxies.
  32854. Kind string `json:"kind,omitempty"`
  32855. // NextPageToken: [Output Only] This token allows you to get the next
  32856. // page of results for list requests. If the number of results is larger
  32857. // than maxResults, use the nextPageToken as a value for the query
  32858. // parameter pageToken in the next list request. Subsequent list
  32859. // requests will have their own nextPageToken to continue paging through
  32860. // the results.
  32861. NextPageToken string `json:"nextPageToken,omitempty"`
  32862. // SelfLink: [Output Only] Server-defined URL for this resource.
  32863. SelfLink string `json:"selfLink,omitempty"`
  32864. // Warning: [Output Only] Informational warning message.
  32865. Warning *TargetHttpsProxyAggregatedListWarning `json:"warning,omitempty"`
  32866. // ServerResponse contains the HTTP response code and headers from the
  32867. // server.
  32868. googleapi.ServerResponse `json:"-"`
  32869. // ForceSendFields is a list of field names (e.g. "Id") to
  32870. // unconditionally include in API requests. By default, fields with
  32871. // empty values are omitted from API requests. However, any non-pointer,
  32872. // non-interface field appearing in ForceSendFields will be sent to the
  32873. // server regardless of whether the field is empty or not. This may be
  32874. // used to include empty fields in Patch requests.
  32875. ForceSendFields []string `json:"-"`
  32876. // NullFields is a list of field names (e.g. "Id") to include in API
  32877. // requests with the JSON null value. By default, fields with empty
  32878. // values are omitted from API requests. However, any field with an
  32879. // empty value appearing in NullFields will be sent to the server as
  32880. // null. It is an error if a field in this list has a non-empty value.
  32881. // This may be used to include null fields in Patch requests.
  32882. NullFields []string `json:"-"`
  32883. }
  32884. func (s *TargetHttpsProxyAggregatedList) MarshalJSON() ([]byte, error) {
  32885. type NoMethod TargetHttpsProxyAggregatedList
  32886. raw := NoMethod(*s)
  32887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32888. }
  32889. // TargetHttpsProxyAggregatedListWarning: [Output Only] Informational
  32890. // warning message.
  32891. type TargetHttpsProxyAggregatedListWarning struct {
  32892. // Code: [Output Only] A warning code, if applicable. For example,
  32893. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32894. // the response.
  32895. //
  32896. // Possible values:
  32897. // "CLEANUP_FAILED"
  32898. // "DEPRECATED_RESOURCE_USED"
  32899. // "DEPRECATED_TYPE_USED"
  32900. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32901. // "EXPERIMENTAL_TYPE_USED"
  32902. // "EXTERNAL_API_WARNING"
  32903. // "FIELD_VALUE_OVERRIDEN"
  32904. // "INJECTED_KERNELS_DEPRECATED"
  32905. // "MISSING_TYPE_DEPENDENCY"
  32906. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32907. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32908. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32909. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32910. // "NEXT_HOP_NOT_RUNNING"
  32911. // "NOT_CRITICAL_ERROR"
  32912. // "NO_RESULTS_ON_PAGE"
  32913. // "REQUIRED_TOS_AGREEMENT"
  32914. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32915. // "RESOURCE_NOT_DELETED"
  32916. // "SCHEMA_VALIDATION_IGNORED"
  32917. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32918. // "UNDECLARED_PROPERTIES"
  32919. // "UNREACHABLE"
  32920. Code string `json:"code,omitempty"`
  32921. // Data: [Output Only] Metadata about this warning in key: value format.
  32922. // For example:
  32923. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32924. Data []*TargetHttpsProxyAggregatedListWarningData `json:"data,omitempty"`
  32925. // Message: [Output Only] A human-readable description of the warning
  32926. // code.
  32927. Message string `json:"message,omitempty"`
  32928. // ForceSendFields is a list of field names (e.g. "Code") to
  32929. // unconditionally include in API requests. By default, fields with
  32930. // empty values are omitted from API requests. However, any non-pointer,
  32931. // non-interface field appearing in ForceSendFields will be sent to the
  32932. // server regardless of whether the field is empty or not. This may be
  32933. // used to include empty fields in Patch requests.
  32934. ForceSendFields []string `json:"-"`
  32935. // NullFields is a list of field names (e.g. "Code") to include in API
  32936. // requests with the JSON null value. By default, fields with empty
  32937. // values are omitted from API requests. However, any field with an
  32938. // empty value appearing in NullFields will be sent to the server as
  32939. // null. It is an error if a field in this list has a non-empty value.
  32940. // This may be used to include null fields in Patch requests.
  32941. NullFields []string `json:"-"`
  32942. }
  32943. func (s *TargetHttpsProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  32944. type NoMethod TargetHttpsProxyAggregatedListWarning
  32945. raw := NoMethod(*s)
  32946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32947. }
  32948. type TargetHttpsProxyAggregatedListWarningData struct {
  32949. // Key: [Output Only] A key that provides more detail on the warning
  32950. // being returned. For example, for warnings where there are no results
  32951. // in a list request for a particular zone, this key might be scope and
  32952. // the key value might be the zone name. Other examples might be a key
  32953. // indicating a deprecated resource and a suggested replacement, or a
  32954. // warning about invalid network settings (for example, if an instance
  32955. // attempts to perform IP forwarding but is not enabled for IP
  32956. // forwarding).
  32957. Key string `json:"key,omitempty"`
  32958. // Value: [Output Only] A warning data value corresponding to the key.
  32959. Value string `json:"value,omitempty"`
  32960. // ForceSendFields is a list of field names (e.g. "Key") to
  32961. // unconditionally include in API requests. By default, fields with
  32962. // empty values are omitted from API requests. However, any non-pointer,
  32963. // non-interface field appearing in ForceSendFields will be sent to the
  32964. // server regardless of whether the field is empty or not. This may be
  32965. // used to include empty fields in Patch requests.
  32966. ForceSendFields []string `json:"-"`
  32967. // NullFields is a list of field names (e.g. "Key") to include in API
  32968. // requests with the JSON null value. By default, fields with empty
  32969. // values are omitted from API requests. However, any field with an
  32970. // empty value appearing in NullFields will be sent to the server as
  32971. // null. It is an error if a field in this list has a non-empty value.
  32972. // This may be used to include null fields in Patch requests.
  32973. NullFields []string `json:"-"`
  32974. }
  32975. func (s *TargetHttpsProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  32976. type NoMethod TargetHttpsProxyAggregatedListWarningData
  32977. raw := NoMethod(*s)
  32978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32979. }
  32980. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  32981. type TargetHttpsProxyList struct {
  32982. // Id: [Output Only] Unique identifier for the resource; defined by the
  32983. // server.
  32984. Id string `json:"id,omitempty"`
  32985. // Items: A list of TargetHttpsProxy resources.
  32986. Items []*TargetHttpsProxy `json:"items,omitempty"`
  32987. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  32988. // of target HTTPS proxies.
  32989. Kind string `json:"kind,omitempty"`
  32990. // NextPageToken: [Output Only] This token allows you to get the next
  32991. // page of results for list requests. If the number of results is larger
  32992. // than maxResults, use the nextPageToken as a value for the query
  32993. // parameter pageToken in the next list request. Subsequent list
  32994. // requests will have their own nextPageToken to continue paging through
  32995. // the results.
  32996. NextPageToken string `json:"nextPageToken,omitempty"`
  32997. // SelfLink: [Output Only] Server-defined URL for this resource.
  32998. SelfLink string `json:"selfLink,omitempty"`
  32999. // Warning: [Output Only] Informational warning message.
  33000. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  33001. // ServerResponse contains the HTTP response code and headers from the
  33002. // server.
  33003. googleapi.ServerResponse `json:"-"`
  33004. // ForceSendFields is a list of field names (e.g. "Id") to
  33005. // unconditionally include in API requests. By default, fields with
  33006. // empty values are omitted from API requests. However, any non-pointer,
  33007. // non-interface field appearing in ForceSendFields will be sent to the
  33008. // server regardless of whether the field is empty or not. This may be
  33009. // used to include empty fields in Patch requests.
  33010. ForceSendFields []string `json:"-"`
  33011. // NullFields is a list of field names (e.g. "Id") to include in API
  33012. // requests with the JSON null value. By default, fields with empty
  33013. // values are omitted from API requests. However, any field with an
  33014. // empty value appearing in NullFields will be sent to the server as
  33015. // null. It is an error if a field in this list has a non-empty value.
  33016. // This may be used to include null fields in Patch requests.
  33017. NullFields []string `json:"-"`
  33018. }
  33019. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  33020. type NoMethod TargetHttpsProxyList
  33021. raw := NoMethod(*s)
  33022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33023. }
  33024. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  33025. // message.
  33026. type TargetHttpsProxyListWarning struct {
  33027. // Code: [Output Only] A warning code, if applicable. For example,
  33028. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33029. // the response.
  33030. //
  33031. // Possible values:
  33032. // "CLEANUP_FAILED"
  33033. // "DEPRECATED_RESOURCE_USED"
  33034. // "DEPRECATED_TYPE_USED"
  33035. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33036. // "EXPERIMENTAL_TYPE_USED"
  33037. // "EXTERNAL_API_WARNING"
  33038. // "FIELD_VALUE_OVERRIDEN"
  33039. // "INJECTED_KERNELS_DEPRECATED"
  33040. // "MISSING_TYPE_DEPENDENCY"
  33041. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33042. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33043. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33044. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33045. // "NEXT_HOP_NOT_RUNNING"
  33046. // "NOT_CRITICAL_ERROR"
  33047. // "NO_RESULTS_ON_PAGE"
  33048. // "REQUIRED_TOS_AGREEMENT"
  33049. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33050. // "RESOURCE_NOT_DELETED"
  33051. // "SCHEMA_VALIDATION_IGNORED"
  33052. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33053. // "UNDECLARED_PROPERTIES"
  33054. // "UNREACHABLE"
  33055. Code string `json:"code,omitempty"`
  33056. // Data: [Output Only] Metadata about this warning in key: value format.
  33057. // For example:
  33058. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33059. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  33060. // Message: [Output Only] A human-readable description of the warning
  33061. // code.
  33062. Message string `json:"message,omitempty"`
  33063. // ForceSendFields is a list of field names (e.g. "Code") to
  33064. // unconditionally include in API requests. By default, fields with
  33065. // empty values are omitted from API requests. However, any non-pointer,
  33066. // non-interface field appearing in ForceSendFields will be sent to the
  33067. // server regardless of whether the field is empty or not. This may be
  33068. // used to include empty fields in Patch requests.
  33069. ForceSendFields []string `json:"-"`
  33070. // NullFields is a list of field names (e.g. "Code") to include in API
  33071. // requests with the JSON null value. By default, fields with empty
  33072. // values are omitted from API requests. However, any field with an
  33073. // empty value appearing in NullFields will be sent to the server as
  33074. // null. It is an error if a field in this list has a non-empty value.
  33075. // This may be used to include null fields in Patch requests.
  33076. NullFields []string `json:"-"`
  33077. }
  33078. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  33079. type NoMethod TargetHttpsProxyListWarning
  33080. raw := NoMethod(*s)
  33081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33082. }
  33083. type TargetHttpsProxyListWarningData struct {
  33084. // Key: [Output Only] A key that provides more detail on the warning
  33085. // being returned. For example, for warnings where there are no results
  33086. // in a list request for a particular zone, this key might be scope and
  33087. // the key value might be the zone name. Other examples might be a key
  33088. // indicating a deprecated resource and a suggested replacement, or a
  33089. // warning about invalid network settings (for example, if an instance
  33090. // attempts to perform IP forwarding but is not enabled for IP
  33091. // forwarding).
  33092. Key string `json:"key,omitempty"`
  33093. // Value: [Output Only] A warning data value corresponding to the key.
  33094. Value string `json:"value,omitempty"`
  33095. // ForceSendFields is a list of field names (e.g. "Key") to
  33096. // unconditionally include in API requests. By default, fields with
  33097. // empty values are omitted from API requests. However, any non-pointer,
  33098. // non-interface field appearing in ForceSendFields will be sent to the
  33099. // server regardless of whether the field is empty or not. This may be
  33100. // used to include empty fields in Patch requests.
  33101. ForceSendFields []string `json:"-"`
  33102. // NullFields is a list of field names (e.g. "Key") to include in API
  33103. // requests with the JSON null value. By default, fields with empty
  33104. // values are omitted from API requests. However, any field with an
  33105. // empty value appearing in NullFields will be sent to the server as
  33106. // null. It is an error if a field in this list has a non-empty value.
  33107. // This may be used to include null fields in Patch requests.
  33108. NullFields []string `json:"-"`
  33109. }
  33110. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  33111. type NoMethod TargetHttpsProxyListWarningData
  33112. raw := NoMethod(*s)
  33113. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33114. }
  33115. // TargetInstance: A TargetInstance resource. This resource defines an
  33116. // endpoint instance that terminates traffic of certain protocols. (==
  33117. // resource_for beta.targetInstances ==) (== resource_for
  33118. // v1.targetInstances ==)
  33119. type TargetInstance struct {
  33120. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  33121. // format.
  33122. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  33123. // Description: An optional description of this resource. Provide this
  33124. // property when you create the resource.
  33125. Description string `json:"description,omitempty"`
  33126. // Id: [Output Only] The unique identifier for the resource. This
  33127. // identifier is defined by the server.
  33128. Id uint64 `json:"id,omitempty,string"`
  33129. // Instance: A URL to the virtual machine instance that handles traffic
  33130. // for this target instance. When creating a target instance, you can
  33131. // provide the fully-qualified URL or a valid partial URL to the desired
  33132. // virtual machine. For example, the following are all valid URLs:
  33133. // -
  33134. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  33135. // - projects/project/zones/zone/instances/instance
  33136. // - zones/zone/instances/instance
  33137. Instance string `json:"instance,omitempty"`
  33138. // Kind: [Output Only] The type of the resource. Always
  33139. // compute#targetInstance for target instances.
  33140. Kind string `json:"kind,omitempty"`
  33141. // Name: Name of the resource. Provided by the client when the resource
  33142. // is created. The name must be 1-63 characters long, and comply with
  33143. // RFC1035. Specifically, the name must be 1-63 characters long and
  33144. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  33145. // the first character must be a lowercase letter, and all following
  33146. // characters must be a dash, lowercase letter, or digit, except the
  33147. // last character, which cannot be a dash.
  33148. Name string `json:"name,omitempty"`
  33149. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  33150. // Currently only NO_NAT (default value) is supported.
  33151. //
  33152. // Possible values:
  33153. // "NO_NAT"
  33154. NatPolicy string `json:"natPolicy,omitempty"`
  33155. // SelfLink: [Output Only] Server-defined URL for the resource.
  33156. SelfLink string `json:"selfLink,omitempty"`
  33157. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  33158. // with the resource id.
  33159. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  33160. // Zone: [Output Only] URL of the zone where the target instance
  33161. // resides. You must specify this field as part of the HTTP request URL.
  33162. // It is not settable as a field in the request body.
  33163. Zone string `json:"zone,omitempty"`
  33164. // ServerResponse contains the HTTP response code and headers from the
  33165. // server.
  33166. googleapi.ServerResponse `json:"-"`
  33167. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  33168. // to 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. "CreationTimestamp") to
  33175. // include in API requests with the JSON null value. By default, fields
  33176. // with empty values are omitted from API requests. However, any field
  33177. // with an empty value appearing in NullFields will be sent to the
  33178. // server as null. It is an error if a field in this list has a
  33179. // non-empty value. This may be used to include null fields in Patch
  33180. // requests.
  33181. NullFields []string `json:"-"`
  33182. }
  33183. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  33184. type NoMethod TargetInstance
  33185. raw := NoMethod(*s)
  33186. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33187. }
  33188. type TargetInstanceAggregatedList struct {
  33189. // Id: [Output Only] Unique identifier for the resource; defined by the
  33190. // server.
  33191. Id string `json:"id,omitempty"`
  33192. // Items: A list of TargetInstance resources.
  33193. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  33194. // Kind: Type of resource.
  33195. Kind string `json:"kind,omitempty"`
  33196. // NextPageToken: [Output Only] This token allows you to get the next
  33197. // page of results for list requests. If the number of results is larger
  33198. // than maxResults, use the nextPageToken as a value for the query
  33199. // parameter pageToken in the next list request. Subsequent list
  33200. // requests will have their own nextPageToken to continue paging through
  33201. // the results.
  33202. NextPageToken string `json:"nextPageToken,omitempty"`
  33203. // SelfLink: [Output Only] Server-defined URL for this resource.
  33204. SelfLink string `json:"selfLink,omitempty"`
  33205. // Warning: [Output Only] Informational warning message.
  33206. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  33207. // ServerResponse contains the HTTP response code and headers from the
  33208. // server.
  33209. googleapi.ServerResponse `json:"-"`
  33210. // ForceSendFields is a list of field names (e.g. "Id") to
  33211. // unconditionally include in API requests. By default, fields with
  33212. // empty values are omitted from API requests. However, any non-pointer,
  33213. // non-interface field appearing in ForceSendFields will be sent to the
  33214. // server regardless of whether the field is empty or not. This may be
  33215. // used to include empty fields in Patch requests.
  33216. ForceSendFields []string `json:"-"`
  33217. // NullFields is a list of field names (e.g. "Id") to include in API
  33218. // requests with the JSON null value. By default, fields with empty
  33219. // values are omitted from API requests. However, any field with an
  33220. // empty value appearing in NullFields will be sent to the server as
  33221. // null. It is an error if a field in this list has a non-empty value.
  33222. // This may be used to include null fields in Patch requests.
  33223. NullFields []string `json:"-"`
  33224. }
  33225. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  33226. type NoMethod TargetInstanceAggregatedList
  33227. raw := NoMethod(*s)
  33228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33229. }
  33230. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  33231. // warning message.
  33232. type TargetInstanceAggregatedListWarning struct {
  33233. // Code: [Output Only] A warning code, if applicable. For example,
  33234. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33235. // the response.
  33236. //
  33237. // Possible values:
  33238. // "CLEANUP_FAILED"
  33239. // "DEPRECATED_RESOURCE_USED"
  33240. // "DEPRECATED_TYPE_USED"
  33241. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33242. // "EXPERIMENTAL_TYPE_USED"
  33243. // "EXTERNAL_API_WARNING"
  33244. // "FIELD_VALUE_OVERRIDEN"
  33245. // "INJECTED_KERNELS_DEPRECATED"
  33246. // "MISSING_TYPE_DEPENDENCY"
  33247. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33248. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33249. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33250. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33251. // "NEXT_HOP_NOT_RUNNING"
  33252. // "NOT_CRITICAL_ERROR"
  33253. // "NO_RESULTS_ON_PAGE"
  33254. // "REQUIRED_TOS_AGREEMENT"
  33255. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33256. // "RESOURCE_NOT_DELETED"
  33257. // "SCHEMA_VALIDATION_IGNORED"
  33258. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33259. // "UNDECLARED_PROPERTIES"
  33260. // "UNREACHABLE"
  33261. Code string `json:"code,omitempty"`
  33262. // Data: [Output Only] Metadata about this warning in key: value format.
  33263. // For example:
  33264. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33265. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  33266. // Message: [Output Only] A human-readable description of the warning
  33267. // code.
  33268. Message string `json:"message,omitempty"`
  33269. // ForceSendFields is a list of field names (e.g. "Code") to
  33270. // unconditionally include in API requests. By default, fields with
  33271. // empty values are omitted from API requests. However, any non-pointer,
  33272. // non-interface field appearing in ForceSendFields will be sent to the
  33273. // server regardless of whether the field is empty or not. This may be
  33274. // used to include empty fields in Patch requests.
  33275. ForceSendFields []string `json:"-"`
  33276. // NullFields is a list of field names (e.g. "Code") to include in API
  33277. // requests with the JSON null value. By default, fields with empty
  33278. // values are omitted from API requests. However, any field with an
  33279. // empty value appearing in NullFields will be sent to the server as
  33280. // null. It is an error if a field in this list has a non-empty value.
  33281. // This may be used to include null fields in Patch requests.
  33282. NullFields []string `json:"-"`
  33283. }
  33284. func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  33285. type NoMethod TargetInstanceAggregatedListWarning
  33286. raw := NoMethod(*s)
  33287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33288. }
  33289. type TargetInstanceAggregatedListWarningData struct {
  33290. // Key: [Output Only] A key that provides more detail on the warning
  33291. // being returned. For example, for warnings where there are no results
  33292. // in a list request for a particular zone, this key might be scope and
  33293. // the key value might be the zone name. Other examples might be a key
  33294. // indicating a deprecated resource and a suggested replacement, or a
  33295. // warning about invalid network settings (for example, if an instance
  33296. // attempts to perform IP forwarding but is not enabled for IP
  33297. // forwarding).
  33298. Key string `json:"key,omitempty"`
  33299. // Value: [Output Only] A warning data value corresponding to the key.
  33300. Value string `json:"value,omitempty"`
  33301. // ForceSendFields is a list of field names (e.g. "Key") to
  33302. // unconditionally include in API requests. By default, fields with
  33303. // empty values are omitted from API requests. However, any non-pointer,
  33304. // non-interface field appearing in ForceSendFields will be sent to the
  33305. // server regardless of whether the field is empty or not. This may be
  33306. // used to include empty fields in Patch requests.
  33307. ForceSendFields []string `json:"-"`
  33308. // NullFields is a list of field names (e.g. "Key") to include in API
  33309. // requests with the JSON null value. By default, fields with empty
  33310. // values are omitted from API requests. However, any field with an
  33311. // empty value appearing in NullFields will be sent to the server as
  33312. // null. It is an error if a field in this list has a non-empty value.
  33313. // This may be used to include null fields in Patch requests.
  33314. NullFields []string `json:"-"`
  33315. }
  33316. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  33317. type NoMethod TargetInstanceAggregatedListWarningData
  33318. raw := NoMethod(*s)
  33319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33320. }
  33321. // TargetInstanceList: Contains a list of TargetInstance resources.
  33322. type TargetInstanceList struct {
  33323. // Id: [Output Only] Unique identifier for the resource; defined by the
  33324. // server.
  33325. Id string `json:"id,omitempty"`
  33326. // Items: A list of TargetInstance resources.
  33327. Items []*TargetInstance `json:"items,omitempty"`
  33328. // Kind: Type of resource.
  33329. Kind string `json:"kind,omitempty"`
  33330. // NextPageToken: [Output Only] This token allows you to get the next
  33331. // page of results for list requests. If the number of results is larger
  33332. // than maxResults, use the nextPageToken as a value for the query
  33333. // parameter pageToken in the next list request. Subsequent list
  33334. // requests will have their own nextPageToken to continue paging through
  33335. // the results.
  33336. NextPageToken string `json:"nextPageToken,omitempty"`
  33337. // SelfLink: [Output Only] Server-defined URL for this resource.
  33338. SelfLink string `json:"selfLink,omitempty"`
  33339. // Warning: [Output Only] Informational warning message.
  33340. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  33341. // ServerResponse contains the HTTP response code and headers from the
  33342. // server.
  33343. googleapi.ServerResponse `json:"-"`
  33344. // ForceSendFields is a list of field names (e.g. "Id") to
  33345. // unconditionally include in API requests. By default, fields with
  33346. // empty values are omitted from API requests. However, any non-pointer,
  33347. // non-interface field appearing in ForceSendFields will be sent to the
  33348. // server regardless of whether the field is empty or not. This may be
  33349. // used to include empty fields in Patch requests.
  33350. ForceSendFields []string `json:"-"`
  33351. // NullFields is a list of field names (e.g. "Id") to include in API
  33352. // requests with the JSON null value. By default, fields with empty
  33353. // values are omitted from API requests. However, any field with an
  33354. // empty value appearing in NullFields will be sent to the server as
  33355. // null. It is an error if a field in this list has a non-empty value.
  33356. // This may be used to include null fields in Patch requests.
  33357. NullFields []string `json:"-"`
  33358. }
  33359. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  33360. type NoMethod TargetInstanceList
  33361. raw := NoMethod(*s)
  33362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33363. }
  33364. // TargetInstanceListWarning: [Output Only] Informational warning
  33365. // message.
  33366. type TargetInstanceListWarning struct {
  33367. // Code: [Output Only] A warning code, if applicable. For example,
  33368. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33369. // the response.
  33370. //
  33371. // Possible values:
  33372. // "CLEANUP_FAILED"
  33373. // "DEPRECATED_RESOURCE_USED"
  33374. // "DEPRECATED_TYPE_USED"
  33375. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33376. // "EXPERIMENTAL_TYPE_USED"
  33377. // "EXTERNAL_API_WARNING"
  33378. // "FIELD_VALUE_OVERRIDEN"
  33379. // "INJECTED_KERNELS_DEPRECATED"
  33380. // "MISSING_TYPE_DEPENDENCY"
  33381. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33382. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33383. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33384. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33385. // "NEXT_HOP_NOT_RUNNING"
  33386. // "NOT_CRITICAL_ERROR"
  33387. // "NO_RESULTS_ON_PAGE"
  33388. // "REQUIRED_TOS_AGREEMENT"
  33389. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33390. // "RESOURCE_NOT_DELETED"
  33391. // "SCHEMA_VALIDATION_IGNORED"
  33392. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33393. // "UNDECLARED_PROPERTIES"
  33394. // "UNREACHABLE"
  33395. Code string `json:"code,omitempty"`
  33396. // Data: [Output Only] Metadata about this warning in key: value format.
  33397. // For example:
  33398. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33399. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  33400. // Message: [Output Only] A human-readable description of the warning
  33401. // code.
  33402. Message string `json:"message,omitempty"`
  33403. // ForceSendFields is a list of field names (e.g. "Code") to
  33404. // unconditionally include in API requests. By default, fields with
  33405. // empty values are omitted from API requests. However, any non-pointer,
  33406. // non-interface field appearing in ForceSendFields will be sent to the
  33407. // server regardless of whether the field is empty or not. This may be
  33408. // used to include empty fields in Patch requests.
  33409. ForceSendFields []string `json:"-"`
  33410. // NullFields is a list of field names (e.g. "Code") to include in API
  33411. // requests with the JSON null value. By default, fields with empty
  33412. // values are omitted from API requests. However, any field with an
  33413. // empty value appearing in NullFields will be sent to the server as
  33414. // null. It is an error if a field in this list has a non-empty value.
  33415. // This may be used to include null fields in Patch requests.
  33416. NullFields []string `json:"-"`
  33417. }
  33418. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  33419. type NoMethod TargetInstanceListWarning
  33420. raw := NoMethod(*s)
  33421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33422. }
  33423. type TargetInstanceListWarningData struct {
  33424. // Key: [Output Only] A key that provides more detail on the warning
  33425. // being returned. For example, for warnings where there are no results
  33426. // in a list request for a particular zone, this key might be scope and
  33427. // the key value might be the zone name. Other examples might be a key
  33428. // indicating a deprecated resource and a suggested replacement, or a
  33429. // warning about invalid network settings (for example, if an instance
  33430. // attempts to perform IP forwarding but is not enabled for IP
  33431. // forwarding).
  33432. Key string `json:"key,omitempty"`
  33433. // Value: [Output Only] A warning data value corresponding to the key.
  33434. Value string `json:"value,omitempty"`
  33435. // ForceSendFields is a list of field names (e.g. "Key") to
  33436. // unconditionally include in API requests. By default, fields with
  33437. // empty values are omitted from API requests. However, any non-pointer,
  33438. // non-interface field appearing in ForceSendFields will be sent to the
  33439. // server regardless of whether the field is empty or not. This may be
  33440. // used to include empty fields in Patch requests.
  33441. ForceSendFields []string `json:"-"`
  33442. // NullFields is a list of field names (e.g. "Key") to include in API
  33443. // requests with the JSON null value. By default, fields with empty
  33444. // values are omitted from API requests. However, any field with an
  33445. // empty value appearing in NullFields will be sent to the server as
  33446. // null. It is an error if a field in this list has a non-empty value.
  33447. // This may be used to include null fields in Patch requests.
  33448. NullFields []string `json:"-"`
  33449. }
  33450. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  33451. type NoMethod TargetInstanceListWarningData
  33452. raw := NoMethod(*s)
  33453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33454. }
  33455. type TargetInstancesScopedList struct {
  33456. // TargetInstances: A list of target instances contained in this scope.
  33457. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  33458. // Warning: Informational warning which replaces the list of addresses
  33459. // when the list is empty.
  33460. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  33461. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  33462. // unconditionally include in API requests. By default, fields with
  33463. // empty values are omitted from API requests. However, any non-pointer,
  33464. // non-interface field appearing in ForceSendFields will be sent to the
  33465. // server regardless of whether the field is empty or not. This may be
  33466. // used to include empty fields in Patch requests.
  33467. ForceSendFields []string `json:"-"`
  33468. // NullFields is a list of field names (e.g. "TargetInstances") to
  33469. // include in API requests with the JSON null value. By default, fields
  33470. // with empty values are omitted from API requests. However, any field
  33471. // with an empty value appearing in NullFields will be sent to the
  33472. // server as null. It is an error if a field in this list has a
  33473. // non-empty value. This may be used to include null fields in Patch
  33474. // requests.
  33475. NullFields []string `json:"-"`
  33476. }
  33477. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  33478. type NoMethod TargetInstancesScopedList
  33479. raw := NoMethod(*s)
  33480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33481. }
  33482. // TargetInstancesScopedListWarning: Informational warning which
  33483. // replaces the list of addresses when the list is empty.
  33484. type TargetInstancesScopedListWarning struct {
  33485. // Code: [Output Only] A warning code, if applicable. For example,
  33486. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33487. // the response.
  33488. //
  33489. // Possible values:
  33490. // "CLEANUP_FAILED"
  33491. // "DEPRECATED_RESOURCE_USED"
  33492. // "DEPRECATED_TYPE_USED"
  33493. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33494. // "EXPERIMENTAL_TYPE_USED"
  33495. // "EXTERNAL_API_WARNING"
  33496. // "FIELD_VALUE_OVERRIDEN"
  33497. // "INJECTED_KERNELS_DEPRECATED"
  33498. // "MISSING_TYPE_DEPENDENCY"
  33499. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33500. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33501. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33502. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33503. // "NEXT_HOP_NOT_RUNNING"
  33504. // "NOT_CRITICAL_ERROR"
  33505. // "NO_RESULTS_ON_PAGE"
  33506. // "REQUIRED_TOS_AGREEMENT"
  33507. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33508. // "RESOURCE_NOT_DELETED"
  33509. // "SCHEMA_VALIDATION_IGNORED"
  33510. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33511. // "UNDECLARED_PROPERTIES"
  33512. // "UNREACHABLE"
  33513. Code string `json:"code,omitempty"`
  33514. // Data: [Output Only] Metadata about this warning in key: value format.
  33515. // For example:
  33516. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33517. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  33518. // Message: [Output Only] A human-readable description of the warning
  33519. // code.
  33520. Message string `json:"message,omitempty"`
  33521. // ForceSendFields is a list of field names (e.g. "Code") to
  33522. // unconditionally include in API requests. By default, fields with
  33523. // empty values are omitted from API requests. However, any non-pointer,
  33524. // non-interface field appearing in ForceSendFields will be sent to the
  33525. // server regardless of whether the field is empty or not. This may be
  33526. // used to include empty fields in Patch requests.
  33527. ForceSendFields []string `json:"-"`
  33528. // NullFields is a list of field names (e.g. "Code") to include in API
  33529. // requests with the JSON null value. By default, fields with empty
  33530. // values are omitted from API requests. However, any field with an
  33531. // empty value appearing in NullFields will be sent to the server as
  33532. // null. It is an error if a field in this list has a non-empty value.
  33533. // This may be used to include null fields in Patch requests.
  33534. NullFields []string `json:"-"`
  33535. }
  33536. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  33537. type NoMethod TargetInstancesScopedListWarning
  33538. raw := NoMethod(*s)
  33539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33540. }
  33541. type TargetInstancesScopedListWarningData struct {
  33542. // Key: [Output Only] A key that provides more detail on the warning
  33543. // being returned. For example, for warnings where there are no results
  33544. // in a list request for a particular zone, this key might be scope and
  33545. // the key value might be the zone name. Other examples might be a key
  33546. // indicating a deprecated resource and a suggested replacement, or a
  33547. // warning about invalid network settings (for example, if an instance
  33548. // attempts to perform IP forwarding but is not enabled for IP
  33549. // forwarding).
  33550. Key string `json:"key,omitempty"`
  33551. // Value: [Output Only] A warning data value corresponding to the key.
  33552. Value string `json:"value,omitempty"`
  33553. // ForceSendFields is a list of field names (e.g. "Key") to
  33554. // unconditionally include in API requests. By default, fields with
  33555. // empty values are omitted from API requests. However, any non-pointer,
  33556. // non-interface field appearing in ForceSendFields will be sent to the
  33557. // server regardless of whether the field is empty or not. This may be
  33558. // used to include empty fields in Patch requests.
  33559. ForceSendFields []string `json:"-"`
  33560. // NullFields is a list of field names (e.g. "Key") to include in API
  33561. // requests with the JSON null value. By default, fields with empty
  33562. // values are omitted from API requests. However, any field with an
  33563. // empty value appearing in NullFields will be sent to the server as
  33564. // null. It is an error if a field in this list has a non-empty value.
  33565. // This may be used to include null fields in Patch requests.
  33566. NullFields []string `json:"-"`
  33567. }
  33568. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  33569. type NoMethod TargetInstancesScopedListWarningData
  33570. raw := NoMethod(*s)
  33571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33572. }
  33573. // TargetPool: A TargetPool resource. This resource defines a pool of
  33574. // instances, an associated HttpHealthCheck resource, and the fallback
  33575. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  33576. // v1.targetPools ==)
  33577. type TargetPool struct {
  33578. // BackupPool: This field is applicable only when the containing target
  33579. // pool is serving a forwarding rule as the primary pool, and its
  33580. // failoverRatio field is properly set to a value between [0,
  33581. // 1].
  33582. //
  33583. // backupPool and failoverRatio together define the fallback behavior of
  33584. // the primary target pool: if the ratio of the healthy instances in the
  33585. // primary pool is at or below failoverRatio, traffic arriving at the
  33586. // load-balanced IP will be directed to the backup pool.
  33587. //
  33588. // In case where failoverRatio and backupPool are not set, or all the
  33589. // instances in the backup pool are unhealthy, the traffic will be
  33590. // directed back to the primary pool in the "force" mode, where traffic
  33591. // will be spread to the healthy instances with the best effort, or to
  33592. // all instances when no instance is healthy.
  33593. BackupPool string `json:"backupPool,omitempty"`
  33594. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  33595. // format.
  33596. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  33597. // Description: An optional description of this resource. Provide this
  33598. // property when you create the resource.
  33599. Description string `json:"description,omitempty"`
  33600. // FailoverRatio: This field is applicable only when the containing
  33601. // target pool is serving a forwarding rule as the primary pool (i.e.,
  33602. // not as a backup pool to some other target pool). The value of the
  33603. // field must be in [0, 1].
  33604. //
  33605. // If set, backupPool must also be set. They together define the
  33606. // fallback behavior of the primary target pool: if the ratio of the
  33607. // healthy instances in the primary pool is at or below this number,
  33608. // traffic arriving at the load-balanced IP will be directed to the
  33609. // backup pool.
  33610. //
  33611. // In case where failoverRatio is not set or all the instances in the
  33612. // backup pool are unhealthy, the traffic will be directed back to the
  33613. // primary pool in the "force" mode, where traffic will be spread to the
  33614. // healthy instances with the best effort, or to all instances when no
  33615. // instance is healthy.
  33616. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  33617. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  33618. // instance in this pool is considered healthy if and only if the health
  33619. // checks pass. An empty list means all member instances will be
  33620. // considered healthy at all times. Only HttpHealthChecks are supported.
  33621. // Only one health check may be specified.
  33622. HealthChecks []string `json:"healthChecks,omitempty"`
  33623. // Id: [Output Only] The unique identifier for the resource. This
  33624. // identifier is defined by the server.
  33625. Id uint64 `json:"id,omitempty,string"`
  33626. // Instances: A list of resource URLs to the virtual machine instances
  33627. // serving this pool. They must live in zones contained in the same
  33628. // region as this pool.
  33629. Instances []string `json:"instances,omitempty"`
  33630. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  33631. // for target pools.
  33632. Kind string `json:"kind,omitempty"`
  33633. // Name: Name of the resource. Provided by the client when the resource
  33634. // is created. The name must be 1-63 characters long, and comply with
  33635. // RFC1035. Specifically, the name must be 1-63 characters long and
  33636. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  33637. // the first character must be a lowercase letter, and all following
  33638. // characters must be a dash, lowercase letter, or digit, except the
  33639. // last character, which cannot be a dash.
  33640. Name string `json:"name,omitempty"`
  33641. // Region: [Output Only] URL of the region where the target pool
  33642. // resides.
  33643. Region string `json:"region,omitempty"`
  33644. // SelfLink: [Output Only] Server-defined URL for the resource.
  33645. SelfLink string `json:"selfLink,omitempty"`
  33646. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  33647. // with the resource id.
  33648. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  33649. // SessionAffinity: Session affinity option, must be one of the
  33650. // following values:
  33651. // NONE: Connections from the same client IP may go to any instance in
  33652. // the pool.
  33653. // CLIENT_IP: Connections from the same client IP will go to the same
  33654. // instance in the pool while that instance remains
  33655. // healthy.
  33656. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  33657. // protocol will go to the same instance in the pool while that instance
  33658. // remains healthy.
  33659. //
  33660. // Possible values:
  33661. // "CLIENT_IP"
  33662. // "CLIENT_IP_PORT_PROTO"
  33663. // "CLIENT_IP_PROTO"
  33664. // "GENERATED_COOKIE"
  33665. // "HEADER_FIELD"
  33666. // "HTTP_COOKIE"
  33667. // "NONE"
  33668. SessionAffinity string `json:"sessionAffinity,omitempty"`
  33669. // ServerResponse contains the HTTP response code and headers from the
  33670. // server.
  33671. googleapi.ServerResponse `json:"-"`
  33672. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  33673. // unconditionally include in API requests. By default, fields with
  33674. // empty values are omitted from API requests. However, any non-pointer,
  33675. // non-interface field appearing in ForceSendFields will be sent to the
  33676. // server regardless of whether the field is empty or not. This may be
  33677. // used to include empty fields in Patch requests.
  33678. ForceSendFields []string `json:"-"`
  33679. // NullFields is a list of field names (e.g. "BackupPool") to include in
  33680. // API requests with the JSON null value. By default, fields with empty
  33681. // values are omitted from API requests. However, any field with an
  33682. // empty value appearing in NullFields will be sent to the server as
  33683. // null. It is an error if a field in this list has a non-empty value.
  33684. // This may be used to include null fields in Patch requests.
  33685. NullFields []string `json:"-"`
  33686. }
  33687. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  33688. type NoMethod TargetPool
  33689. raw := NoMethod(*s)
  33690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33691. }
  33692. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  33693. type NoMethod TargetPool
  33694. var s1 struct {
  33695. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  33696. *NoMethod
  33697. }
  33698. s1.NoMethod = (*NoMethod)(s)
  33699. if err := json.Unmarshal(data, &s1); err != nil {
  33700. return err
  33701. }
  33702. s.FailoverRatio = float64(s1.FailoverRatio)
  33703. return nil
  33704. }
  33705. type TargetPoolAggregatedList struct {
  33706. // Id: [Output Only] Unique identifier for the resource; defined by the
  33707. // server.
  33708. Id string `json:"id,omitempty"`
  33709. // Items: A list of TargetPool resources.
  33710. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  33711. // Kind: [Output Only] Type of resource. Always
  33712. // compute#targetPoolAggregatedList for aggregated lists of target
  33713. // pools.
  33714. Kind string `json:"kind,omitempty"`
  33715. // NextPageToken: [Output Only] This token allows you to get the next
  33716. // page of results for list requests. If the number of results is larger
  33717. // than maxResults, use the nextPageToken as a value for the query
  33718. // parameter pageToken in the next list request. Subsequent list
  33719. // requests will have their own nextPageToken to continue paging through
  33720. // the results.
  33721. NextPageToken string `json:"nextPageToken,omitempty"`
  33722. // SelfLink: [Output Only] Server-defined URL for this resource.
  33723. SelfLink string `json:"selfLink,omitempty"`
  33724. // Warning: [Output Only] Informational warning message.
  33725. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  33726. // ServerResponse contains the HTTP response code and headers from the
  33727. // server.
  33728. googleapi.ServerResponse `json:"-"`
  33729. // ForceSendFields is a list of field names (e.g. "Id") to
  33730. // unconditionally include in API requests. By default, fields with
  33731. // empty values are omitted from API requests. However, any non-pointer,
  33732. // non-interface field appearing in ForceSendFields will be sent to the
  33733. // server regardless of whether the field is empty or not. This may be
  33734. // used to include empty fields in Patch requests.
  33735. ForceSendFields []string `json:"-"`
  33736. // NullFields is a list of field names (e.g. "Id") to include in API
  33737. // requests with the JSON null value. By default, fields with empty
  33738. // values are omitted from API requests. However, any field with an
  33739. // empty value appearing in NullFields will be sent to the server as
  33740. // null. It is an error if a field in this list has a non-empty value.
  33741. // This may be used to include null fields in Patch requests.
  33742. NullFields []string `json:"-"`
  33743. }
  33744. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  33745. type NoMethod TargetPoolAggregatedList
  33746. raw := NoMethod(*s)
  33747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33748. }
  33749. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  33750. // message.
  33751. type TargetPoolAggregatedListWarning struct {
  33752. // Code: [Output Only] A warning code, if applicable. For example,
  33753. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33754. // the response.
  33755. //
  33756. // Possible values:
  33757. // "CLEANUP_FAILED"
  33758. // "DEPRECATED_RESOURCE_USED"
  33759. // "DEPRECATED_TYPE_USED"
  33760. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33761. // "EXPERIMENTAL_TYPE_USED"
  33762. // "EXTERNAL_API_WARNING"
  33763. // "FIELD_VALUE_OVERRIDEN"
  33764. // "INJECTED_KERNELS_DEPRECATED"
  33765. // "MISSING_TYPE_DEPENDENCY"
  33766. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33767. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33768. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33769. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33770. // "NEXT_HOP_NOT_RUNNING"
  33771. // "NOT_CRITICAL_ERROR"
  33772. // "NO_RESULTS_ON_PAGE"
  33773. // "REQUIRED_TOS_AGREEMENT"
  33774. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33775. // "RESOURCE_NOT_DELETED"
  33776. // "SCHEMA_VALIDATION_IGNORED"
  33777. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33778. // "UNDECLARED_PROPERTIES"
  33779. // "UNREACHABLE"
  33780. Code string `json:"code,omitempty"`
  33781. // Data: [Output Only] Metadata about this warning in key: value format.
  33782. // For example:
  33783. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33784. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  33785. // Message: [Output Only] A human-readable description of the warning
  33786. // code.
  33787. Message string `json:"message,omitempty"`
  33788. // ForceSendFields is a list of field names (e.g. "Code") to
  33789. // unconditionally include in API requests. By default, fields with
  33790. // empty values are omitted from API requests. However, any non-pointer,
  33791. // non-interface field appearing in ForceSendFields will be sent to the
  33792. // server regardless of whether the field is empty or not. This may be
  33793. // used to include empty fields in Patch requests.
  33794. ForceSendFields []string `json:"-"`
  33795. // NullFields is a list of field names (e.g. "Code") to include in API
  33796. // requests with the JSON null value. By default, fields with empty
  33797. // values are omitted from API requests. However, any field with an
  33798. // empty value appearing in NullFields will be sent to the server as
  33799. // null. It is an error if a field in this list has a non-empty value.
  33800. // This may be used to include null fields in Patch requests.
  33801. NullFields []string `json:"-"`
  33802. }
  33803. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  33804. type NoMethod TargetPoolAggregatedListWarning
  33805. raw := NoMethod(*s)
  33806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33807. }
  33808. type TargetPoolAggregatedListWarningData struct {
  33809. // Key: [Output Only] A key that provides more detail on the warning
  33810. // being returned. For example, for warnings where there are no results
  33811. // in a list request for a particular zone, this key might be scope and
  33812. // the key value might be the zone name. Other examples might be a key
  33813. // indicating a deprecated resource and a suggested replacement, or a
  33814. // warning about invalid network settings (for example, if an instance
  33815. // attempts to perform IP forwarding but is not enabled for IP
  33816. // forwarding).
  33817. Key string `json:"key,omitempty"`
  33818. // Value: [Output Only] A warning data value corresponding to the key.
  33819. Value string `json:"value,omitempty"`
  33820. // ForceSendFields is a list of field names (e.g. "Key") to
  33821. // unconditionally include in API requests. By default, fields with
  33822. // empty values are omitted from API requests. However, any non-pointer,
  33823. // non-interface field appearing in ForceSendFields will be sent to the
  33824. // server regardless of whether the field is empty or not. This may be
  33825. // used to include empty fields in Patch requests.
  33826. ForceSendFields []string `json:"-"`
  33827. // NullFields is a list of field names (e.g. "Key") to include in API
  33828. // requests with the JSON null value. By default, fields with empty
  33829. // values are omitted from API requests. However, any field with an
  33830. // empty value appearing in NullFields will be sent to the server as
  33831. // null. It is an error if a field in this list has a non-empty value.
  33832. // This may be used to include null fields in Patch requests.
  33833. NullFields []string `json:"-"`
  33834. }
  33835. func (s *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  33836. type NoMethod TargetPoolAggregatedListWarningData
  33837. raw := NoMethod(*s)
  33838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33839. }
  33840. type TargetPoolInstanceHealth struct {
  33841. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  33842. // Kind: [Output Only] Type of resource. Always
  33843. // compute#targetPoolInstanceHealth when checking the health of an
  33844. // instance.
  33845. Kind string `json:"kind,omitempty"`
  33846. // ServerResponse contains the HTTP response code and headers from the
  33847. // server.
  33848. googleapi.ServerResponse `json:"-"`
  33849. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  33850. // unconditionally include in API requests. By default, fields with
  33851. // empty values are omitted from API requests. However, any non-pointer,
  33852. // non-interface field appearing in ForceSendFields will be sent to the
  33853. // server regardless of whether the field is empty or not. This may be
  33854. // used to include empty fields in Patch requests.
  33855. ForceSendFields []string `json:"-"`
  33856. // NullFields is a list of field names (e.g. "HealthStatus") to include
  33857. // in API requests with the JSON null value. By default, fields with
  33858. // empty values are omitted from API requests. However, any field with
  33859. // an empty value appearing in NullFields will be sent to the server as
  33860. // null. It is an error if a field in this list has a non-empty value.
  33861. // This may be used to include null fields in Patch requests.
  33862. NullFields []string `json:"-"`
  33863. }
  33864. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  33865. type NoMethod TargetPoolInstanceHealth
  33866. raw := NoMethod(*s)
  33867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33868. }
  33869. // TargetPoolList: Contains a list of TargetPool resources.
  33870. type TargetPoolList struct {
  33871. // Id: [Output Only] Unique identifier for the resource; defined by the
  33872. // server.
  33873. Id string `json:"id,omitempty"`
  33874. // Items: A list of TargetPool resources.
  33875. Items []*TargetPool `json:"items,omitempty"`
  33876. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  33877. // for lists of target pools.
  33878. Kind string `json:"kind,omitempty"`
  33879. // NextPageToken: [Output Only] This token allows you to get the next
  33880. // page of results for list requests. If the number of results is larger
  33881. // than maxResults, use the nextPageToken as a value for the query
  33882. // parameter pageToken in the next list request. Subsequent list
  33883. // requests will have their own nextPageToken to continue paging through
  33884. // the results.
  33885. NextPageToken string `json:"nextPageToken,omitempty"`
  33886. // SelfLink: [Output Only] Server-defined URL for this resource.
  33887. SelfLink string `json:"selfLink,omitempty"`
  33888. // Warning: [Output Only] Informational warning message.
  33889. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  33890. // ServerResponse contains the HTTP response code and headers from the
  33891. // server.
  33892. googleapi.ServerResponse `json:"-"`
  33893. // ForceSendFields is a list of field names (e.g. "Id") to
  33894. // unconditionally include in API requests. By default, fields with
  33895. // empty values are omitted from API requests. However, any non-pointer,
  33896. // non-interface field appearing in ForceSendFields will be sent to the
  33897. // server regardless of whether the field is empty or not. This may be
  33898. // used to include empty fields in Patch requests.
  33899. ForceSendFields []string `json:"-"`
  33900. // NullFields is a list of field names (e.g. "Id") to include in API
  33901. // requests with the JSON null value. By default, fields with empty
  33902. // values are omitted from API requests. However, any field with an
  33903. // empty value appearing in NullFields will be sent to the server as
  33904. // null. It is an error if a field in this list has a non-empty value.
  33905. // This may be used to include null fields in Patch requests.
  33906. NullFields []string `json:"-"`
  33907. }
  33908. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  33909. type NoMethod TargetPoolList
  33910. raw := NoMethod(*s)
  33911. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33912. }
  33913. // TargetPoolListWarning: [Output Only] Informational warning message.
  33914. type TargetPoolListWarning struct {
  33915. // Code: [Output Only] A warning code, if applicable. For example,
  33916. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33917. // the response.
  33918. //
  33919. // Possible values:
  33920. // "CLEANUP_FAILED"
  33921. // "DEPRECATED_RESOURCE_USED"
  33922. // "DEPRECATED_TYPE_USED"
  33923. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33924. // "EXPERIMENTAL_TYPE_USED"
  33925. // "EXTERNAL_API_WARNING"
  33926. // "FIELD_VALUE_OVERRIDEN"
  33927. // "INJECTED_KERNELS_DEPRECATED"
  33928. // "MISSING_TYPE_DEPENDENCY"
  33929. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33930. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33931. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33932. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33933. // "NEXT_HOP_NOT_RUNNING"
  33934. // "NOT_CRITICAL_ERROR"
  33935. // "NO_RESULTS_ON_PAGE"
  33936. // "REQUIRED_TOS_AGREEMENT"
  33937. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33938. // "RESOURCE_NOT_DELETED"
  33939. // "SCHEMA_VALIDATION_IGNORED"
  33940. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33941. // "UNDECLARED_PROPERTIES"
  33942. // "UNREACHABLE"
  33943. Code string `json:"code,omitempty"`
  33944. // Data: [Output Only] Metadata about this warning in key: value format.
  33945. // For example:
  33946. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33947. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  33948. // Message: [Output Only] A human-readable description of the warning
  33949. // code.
  33950. Message string `json:"message,omitempty"`
  33951. // ForceSendFields is a list of field names (e.g. "Code") to
  33952. // unconditionally include in API requests. By default, fields with
  33953. // empty values are omitted from API requests. However, any non-pointer,
  33954. // non-interface field appearing in ForceSendFields will be sent to the
  33955. // server regardless of whether the field is empty or not. This may be
  33956. // used to include empty fields in Patch requests.
  33957. ForceSendFields []string `json:"-"`
  33958. // NullFields is a list of field names (e.g. "Code") to include in API
  33959. // requests with the JSON null value. By default, fields with empty
  33960. // values are omitted from API requests. However, any field with an
  33961. // empty value appearing in NullFields will be sent to the server as
  33962. // null. It is an error if a field in this list has a non-empty value.
  33963. // This may be used to include null fields in Patch requests.
  33964. NullFields []string `json:"-"`
  33965. }
  33966. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  33967. type NoMethod TargetPoolListWarning
  33968. raw := NoMethod(*s)
  33969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33970. }
  33971. type TargetPoolListWarningData struct {
  33972. // Key: [Output Only] A key that provides more detail on the warning
  33973. // being returned. For example, for warnings where there are no results
  33974. // in a list request for a particular zone, this key might be scope and
  33975. // the key value might be the zone name. Other examples might be a key
  33976. // indicating a deprecated resource and a suggested replacement, or a
  33977. // warning about invalid network settings (for example, if an instance
  33978. // attempts to perform IP forwarding but is not enabled for IP
  33979. // forwarding).
  33980. Key string `json:"key,omitempty"`
  33981. // Value: [Output Only] A warning data value corresponding to the key.
  33982. Value string `json:"value,omitempty"`
  33983. // ForceSendFields is a list of field names (e.g. "Key") to
  33984. // unconditionally include in API requests. By default, fields with
  33985. // empty values are omitted from API requests. However, any non-pointer,
  33986. // non-interface field appearing in ForceSendFields will be sent to the
  33987. // server regardless of whether the field is empty or not. This may be
  33988. // used to include empty fields in Patch requests.
  33989. ForceSendFields []string `json:"-"`
  33990. // NullFields is a list of field names (e.g. "Key") to include in API
  33991. // requests with the JSON null value. By default, fields with empty
  33992. // values are omitted from API requests. However, any field with an
  33993. // empty value appearing in NullFields will be sent to the server as
  33994. // null. It is an error if a field in this list has a non-empty value.
  33995. // This may be used to include null fields in Patch requests.
  33996. NullFields []string `json:"-"`
  33997. }
  33998. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  33999. type NoMethod TargetPoolListWarningData
  34000. raw := NoMethod(*s)
  34001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34002. }
  34003. type TargetPoolsAddHealthCheckRequest struct {
  34004. // HealthChecks: The HttpHealthCheck to add to the target pool.
  34005. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  34006. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  34007. // unconditionally include in API requests. By default, fields with
  34008. // empty values are omitted from API requests. However, any non-pointer,
  34009. // non-interface field appearing in ForceSendFields will be sent to the
  34010. // server regardless of whether the field is empty or not. This may be
  34011. // used to include empty fields in Patch requests.
  34012. ForceSendFields []string `json:"-"`
  34013. // NullFields is a list of field names (e.g. "HealthChecks") to include
  34014. // in API requests with the JSON null value. By default, fields with
  34015. // empty values are omitted from API requests. However, any field with
  34016. // an empty value appearing in NullFields will be sent to the server as
  34017. // null. It is an error if a field in this list has a non-empty value.
  34018. // This may be used to include null fields in Patch requests.
  34019. NullFields []string `json:"-"`
  34020. }
  34021. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  34022. type NoMethod TargetPoolsAddHealthCheckRequest
  34023. raw := NoMethod(*s)
  34024. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34025. }
  34026. type TargetPoolsAddInstanceRequest struct {
  34027. // Instances: A full or partial URL to an instance to add to this target
  34028. // pool. This can be a full or partial URL. For example, the following
  34029. // are valid URLs:
  34030. // -
  34031. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  34032. // - projects/project-id/zones/zone/instances/instance-name
  34033. // - zones/zone/instances/instance-name
  34034. Instances []*InstanceReference `json:"instances,omitempty"`
  34035. // ForceSendFields is a list of field names (e.g. "Instances") to
  34036. // unconditionally include in API requests. By default, fields with
  34037. // empty values are omitted from API requests. However, any non-pointer,
  34038. // non-interface field appearing in ForceSendFields will be sent to the
  34039. // server regardless of whether the field is empty or not. This may be
  34040. // used to include empty fields in Patch requests.
  34041. ForceSendFields []string `json:"-"`
  34042. // NullFields is a list of field names (e.g. "Instances") to include in
  34043. // API requests with the JSON null value. By default, fields with empty
  34044. // values are omitted from API requests. However, any field with an
  34045. // empty value appearing in NullFields will be sent to the server as
  34046. // null. It is an error if a field in this list has a non-empty value.
  34047. // This may be used to include null fields in Patch requests.
  34048. NullFields []string `json:"-"`
  34049. }
  34050. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  34051. type NoMethod TargetPoolsAddInstanceRequest
  34052. raw := NoMethod(*s)
  34053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34054. }
  34055. type TargetPoolsRemoveHealthCheckRequest struct {
  34056. // HealthChecks: Health check URL to be removed. This can be a full or
  34057. // valid partial URL. For example, the following are valid URLs:
  34058. // -
  34059. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  34060. // - projects/project/global/httpHealthChecks/health-check
  34061. // - global/httpHealthChecks/health-check
  34062. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  34063. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  34064. // unconditionally include in API requests. By default, fields with
  34065. // empty values are omitted from API requests. However, any non-pointer,
  34066. // non-interface field appearing in ForceSendFields will be sent to the
  34067. // server regardless of whether the field is empty or not. This may be
  34068. // used to include empty fields in Patch requests.
  34069. ForceSendFields []string `json:"-"`
  34070. // NullFields is a list of field names (e.g. "HealthChecks") to include
  34071. // in API requests with the JSON null value. By default, fields with
  34072. // empty values are omitted from API requests. However, any field with
  34073. // an empty value appearing in NullFields will be sent to the server as
  34074. // null. It is an error if a field in this list has a non-empty value.
  34075. // This may be used to include null fields in Patch requests.
  34076. NullFields []string `json:"-"`
  34077. }
  34078. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  34079. type NoMethod TargetPoolsRemoveHealthCheckRequest
  34080. raw := NoMethod(*s)
  34081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34082. }
  34083. type TargetPoolsRemoveInstanceRequest struct {
  34084. // Instances: URLs of the instances to be removed from target pool.
  34085. Instances []*InstanceReference `json:"instances,omitempty"`
  34086. // ForceSendFields is a list of field names (e.g. "Instances") to
  34087. // unconditionally include in API requests. By default, fields with
  34088. // empty values are omitted from API requests. However, any non-pointer,
  34089. // non-interface field appearing in ForceSendFields will be sent to the
  34090. // server regardless of whether the field is empty or not. This may be
  34091. // used to include empty fields in Patch requests.
  34092. ForceSendFields []string `json:"-"`
  34093. // NullFields is a list of field names (e.g. "Instances") to include in
  34094. // API requests with the JSON null value. By default, fields with empty
  34095. // values are omitted from API requests. However, any field with an
  34096. // empty value appearing in NullFields will be sent to the server as
  34097. // null. It is an error if a field in this list has a non-empty value.
  34098. // This may be used to include null fields in Patch requests.
  34099. NullFields []string `json:"-"`
  34100. }
  34101. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  34102. type NoMethod TargetPoolsRemoveInstanceRequest
  34103. raw := NoMethod(*s)
  34104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34105. }
  34106. type TargetPoolsScopedList struct {
  34107. // TargetPools: A list of target pools contained in this scope.
  34108. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  34109. // Warning: Informational warning which replaces the list of addresses
  34110. // when the list is empty.
  34111. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  34112. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  34113. // unconditionally include in API requests. By default, fields with
  34114. // empty values are omitted from API requests. However, any non-pointer,
  34115. // non-interface field appearing in ForceSendFields will be sent to the
  34116. // server regardless of whether the field is empty or not. This may be
  34117. // used to include empty fields in Patch requests.
  34118. ForceSendFields []string `json:"-"`
  34119. // NullFields is a list of field names (e.g. "TargetPools") to include
  34120. // in API requests with the JSON null value. By default, fields with
  34121. // empty values are omitted from API requests. However, any field with
  34122. // an empty value appearing in NullFields will be sent to the server as
  34123. // null. It is an error if a field in this list has a non-empty value.
  34124. // This may be used to include null fields in Patch requests.
  34125. NullFields []string `json:"-"`
  34126. }
  34127. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  34128. type NoMethod TargetPoolsScopedList
  34129. raw := NoMethod(*s)
  34130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34131. }
  34132. // TargetPoolsScopedListWarning: Informational warning which replaces
  34133. // the list of addresses when the list is empty.
  34134. type TargetPoolsScopedListWarning struct {
  34135. // Code: [Output Only] A warning code, if applicable. For example,
  34136. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  34137. // the response.
  34138. //
  34139. // Possible values:
  34140. // "CLEANUP_FAILED"
  34141. // "DEPRECATED_RESOURCE_USED"
  34142. // "DEPRECATED_TYPE_USED"
  34143. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  34144. // "EXPERIMENTAL_TYPE_USED"
  34145. // "EXTERNAL_API_WARNING"
  34146. // "FIELD_VALUE_OVERRIDEN"
  34147. // "INJECTED_KERNELS_DEPRECATED"
  34148. // "MISSING_TYPE_DEPENDENCY"
  34149. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  34150. // "NEXT_HOP_CANNOT_IP_FORWARD"
  34151. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  34152. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  34153. // "NEXT_HOP_NOT_RUNNING"
  34154. // "NOT_CRITICAL_ERROR"
  34155. // "NO_RESULTS_ON_PAGE"
  34156. // "REQUIRED_TOS_AGREEMENT"
  34157. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  34158. // "RESOURCE_NOT_DELETED"
  34159. // "SCHEMA_VALIDATION_IGNORED"
  34160. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  34161. // "UNDECLARED_PROPERTIES"
  34162. // "UNREACHABLE"
  34163. Code string `json:"code,omitempty"`
  34164. // Data: [Output Only] Metadata about this warning in key: value format.
  34165. // For example:
  34166. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  34167. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  34168. // Message: [Output Only] A human-readable description of the warning
  34169. // code.
  34170. Message string `json:"message,omitempty"`
  34171. // ForceSendFields is a list of field names (e.g. "Code") to
  34172. // unconditionally include in API requests. By default, fields with
  34173. // empty values are omitted from API requests. However, any non-pointer,
  34174. // non-interface field appearing in ForceSendFields will be sent to the
  34175. // server regardless of whether the field is empty or not. This may be
  34176. // used to include empty fields in Patch requests.
  34177. ForceSendFields []string `json:"-"`
  34178. // NullFields is a list of field names (e.g. "Code") to include in API
  34179. // requests with the JSON null value. By default, fields with empty
  34180. // values are omitted from API requests. However, any field with an
  34181. // empty value appearing in NullFields will be sent to the server as
  34182. // null. It is an error if a field in this list has a non-empty value.
  34183. // This may be used to include null fields in Patch requests.
  34184. NullFields []string `json:"-"`
  34185. }
  34186. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  34187. type NoMethod TargetPoolsScopedListWarning
  34188. raw := NoMethod(*s)
  34189. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34190. }
  34191. type TargetPoolsScopedListWarningData struct {
  34192. // Key: [Output Only] A key that provides more detail on the warning
  34193. // being returned. For example, for warnings where there are no results
  34194. // in a list request for a particular zone, this key might be scope and
  34195. // the key value might be the zone name. Other examples might be a key
  34196. // indicating a deprecated resource and a suggested replacement, or a
  34197. // warning about invalid network settings (for example, if an instance
  34198. // attempts to perform IP forwarding but is not enabled for IP
  34199. // forwarding).
  34200. Key string `json:"key,omitempty"`
  34201. // Value: [Output Only] A warning data value corresponding to the key.
  34202. Value string `json:"value,omitempty"`
  34203. // ForceSendFields is a list of field names (e.g. "Key") to
  34204. // unconditionally include in API requests. By default, fields with
  34205. // empty values are omitted from API requests. However, any non-pointer,
  34206. // non-interface field appearing in ForceSendFields will be sent to the
  34207. // server regardless of whether the field is empty or not. This may be
  34208. // used to include empty fields in Patch requests.
  34209. ForceSendFields []string `json:"-"`
  34210. // NullFields is a list of field names (e.g. "Key") to include in API
  34211. // requests with the JSON null value. By default, fields with empty
  34212. // values are omitted from API requests. However, any field with an
  34213. // empty value appearing in NullFields will be sent to the server as
  34214. // null. It is an error if a field in this list has a non-empty value.
  34215. // This may be used to include null fields in Patch requests.
  34216. NullFields []string `json:"-"`
  34217. }
  34218. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  34219. type NoMethod TargetPoolsScopedListWarningData
  34220. raw := NoMethod(*s)
  34221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34222. }
  34223. type TargetReference struct {
  34224. Target string `json:"target,omitempty"`
  34225. // ForceSendFields is a list of field names (e.g. "Target") to
  34226. // unconditionally include in API requests. By default, fields with
  34227. // empty values are omitted from API requests. However, any non-pointer,
  34228. // non-interface field appearing in ForceSendFields will be sent to the
  34229. // server regardless of whether the field is empty or not. This may be
  34230. // used to include empty fields in Patch requests.
  34231. ForceSendFields []string `json:"-"`
  34232. // NullFields is a list of field names (e.g. "Target") to include in API
  34233. // requests with the JSON null value. By default, fields with empty
  34234. // values are omitted from API requests. However, any field with an
  34235. // empty value appearing in NullFields will be sent to the server as
  34236. // null. It is an error if a field in this list has a non-empty value.
  34237. // This may be used to include null fields in Patch requests.
  34238. NullFields []string `json:"-"`
  34239. }
  34240. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  34241. type NoMethod TargetReference
  34242. raw := NoMethod(*s)
  34243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34244. }
  34245. type TargetSslProxiesSetBackendServiceRequest struct {
  34246. // Service: The URL of the new BackendService resource for the
  34247. // targetSslProxy.
  34248. Service string `json:"service,omitempty"`
  34249. // ForceSendFields is a list of field names (e.g. "Service") to
  34250. // unconditionally include in API requests. By default, fields with
  34251. // empty values are omitted from API requests. However, any non-pointer,
  34252. // non-interface field appearing in ForceSendFields will be sent to the
  34253. // server regardless of whether the field is empty or not. This may be
  34254. // used to include empty fields in Patch requests.
  34255. ForceSendFields []string `json:"-"`
  34256. // NullFields is a list of field names (e.g. "Service") to include in
  34257. // API requests with the JSON null value. By default, fields with empty
  34258. // values are omitted from API requests. However, any field with an
  34259. // empty value appearing in NullFields will be sent to the server as
  34260. // null. It is an error if a field in this list has a non-empty value.
  34261. // This may be used to include null fields in Patch requests.
  34262. NullFields []string `json:"-"`
  34263. }
  34264. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  34265. type NoMethod TargetSslProxiesSetBackendServiceRequest
  34266. raw := NoMethod(*s)
  34267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34268. }
  34269. type TargetSslProxiesSetProxyHeaderRequest struct {
  34270. // ProxyHeader: The new type of proxy header to append before sending
  34271. // data to the backend. NONE or PROXY_V1 are allowed.
  34272. //
  34273. // Possible values:
  34274. // "NONE"
  34275. // "PROXY_V1"
  34276. ProxyHeader string `json:"proxyHeader,omitempty"`
  34277. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  34278. // unconditionally include in API requests. By default, fields with
  34279. // empty values are omitted from API requests. However, any non-pointer,
  34280. // non-interface field appearing in ForceSendFields will be sent to the
  34281. // server regardless of whether the field is empty or not. This may be
  34282. // used to include empty fields in Patch requests.
  34283. ForceSendFields []string `json:"-"`
  34284. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  34285. // in API requests with the JSON null value. By default, fields with
  34286. // empty values are omitted from API requests. However, any field with
  34287. // an empty value appearing in NullFields will be sent to the server as
  34288. // null. It is an error if a field in this list has a non-empty value.
  34289. // This may be used to include null fields in Patch requests.
  34290. NullFields []string `json:"-"`
  34291. }
  34292. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  34293. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  34294. raw := NoMethod(*s)
  34295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34296. }
  34297. type TargetSslProxiesSetSslCertificatesRequest struct {
  34298. // SslCertificates: New set of URLs to SslCertificate resources to
  34299. // associate with this TargetSslProxy. Currently exactly one ssl
  34300. // certificate must be specified.
  34301. SslCertificates []string `json:"sslCertificates,omitempty"`
  34302. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  34303. // unconditionally include in API requests. By default, fields with
  34304. // empty values are omitted from API requests. However, any non-pointer,
  34305. // non-interface field appearing in ForceSendFields will be sent to the
  34306. // server regardless of whether the field is empty or not. This may be
  34307. // used to include empty fields in Patch requests.
  34308. ForceSendFields []string `json:"-"`
  34309. // NullFields is a list of field names (e.g. "SslCertificates") to
  34310. // include in API requests with the JSON null value. By default, fields
  34311. // with empty values are omitted from API requests. However, any field
  34312. // with an empty value appearing in NullFields will be sent to the
  34313. // server as null. It is an error if a field in this list has a
  34314. // non-empty value. This may be used to include null fields in Patch
  34315. // requests.
  34316. NullFields []string `json:"-"`
  34317. }
  34318. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  34319. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  34320. raw := NoMethod(*s)
  34321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34322. }
  34323. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  34324. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  34325. // resource_for v1.targetSslProxies ==)
  34326. type TargetSslProxy struct {
  34327. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  34328. // format.
  34329. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  34330. // Description: An optional description of this resource. Provide this
  34331. // property when you create the resource.
  34332. Description string `json:"description,omitempty"`
  34333. // Id: [Output Only] The unique identifier for the resource. This
  34334. // identifier is defined by the server.
  34335. Id uint64 `json:"id,omitempty,string"`
  34336. // Kind: [Output Only] Type of the resource. Always
  34337. // compute#targetSslProxy for target SSL proxies.
  34338. Kind string `json:"kind,omitempty"`
  34339. // Name: Name of the resource. Provided by the client when the resource
  34340. // is created. The name must be 1-63 characters long, and comply with
  34341. // RFC1035. Specifically, the name must be 1-63 characters long and
  34342. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  34343. // the first character must be a lowercase letter, and all following
  34344. // characters must be a dash, lowercase letter, or digit, except the
  34345. // last character, which cannot be a dash.
  34346. Name string `json:"name,omitempty"`
  34347. // ProxyHeader: Specifies the type of proxy header to append before
  34348. // sending data to the backend, either NONE or PROXY_V1. The default is
  34349. // NONE.
  34350. //
  34351. // Possible values:
  34352. // "NONE"
  34353. // "PROXY_V1"
  34354. ProxyHeader string `json:"proxyHeader,omitempty"`
  34355. // SelfLink: [Output Only] Server-defined URL for the resource.
  34356. SelfLink string `json:"selfLink,omitempty"`
  34357. // Service: URL to the BackendService resource.
  34358. Service string `json:"service,omitempty"`
  34359. // SslCertificates: URLs to SslCertificate resources that are used to
  34360. // authenticate connections to Backends. At least one SSL certificate
  34361. // must be specified. Currently, you may specify up to 15 SSL
  34362. // certificates.
  34363. SslCertificates []string `json:"sslCertificates,omitempty"`
  34364. // SslPolicy: URL of SslPolicy resource that will be associated with the
  34365. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  34366. // not have any SSL policy configured.
  34367. SslPolicy string `json:"sslPolicy,omitempty"`
  34368. // ServerResponse contains the HTTP response code and headers from the
  34369. // server.
  34370. googleapi.ServerResponse `json:"-"`
  34371. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  34372. // to unconditionally include in API requests. By default, fields with
  34373. // empty values are omitted from API requests. However, any non-pointer,
  34374. // non-interface field appearing in ForceSendFields will be sent to the
  34375. // server regardless of whether the field is empty or not. This may be
  34376. // used to include empty fields in Patch requests.
  34377. ForceSendFields []string `json:"-"`
  34378. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  34379. // include in API requests with the JSON null value. By default, fields
  34380. // with empty values are omitted from API requests. However, any field
  34381. // with an empty value appearing in NullFields will be sent to the
  34382. // server as null. It is an error if a field in this list has a
  34383. // non-empty value. This may be used to include null fields in Patch
  34384. // requests.
  34385. NullFields []string `json:"-"`
  34386. }
  34387. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  34388. type NoMethod TargetSslProxy
  34389. raw := NoMethod(*s)
  34390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34391. }
  34392. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  34393. type TargetSslProxyList struct {
  34394. // Id: [Output Only] Unique identifier for the resource; defined by the
  34395. // server.
  34396. Id string `json:"id,omitempty"`
  34397. // Items: A list of TargetSslProxy resources.
  34398. Items []*TargetSslProxy `json:"items,omitempty"`
  34399. // Kind: Type of resource.
  34400. Kind string `json:"kind,omitempty"`
  34401. // NextPageToken: [Output Only] This token allows you to get the next
  34402. // page of results for list requests. If the number of results is larger
  34403. // than maxResults, use the nextPageToken as a value for the query
  34404. // parameter pageToken in the next list request. Subsequent list
  34405. // requests will have their own nextPageToken to continue paging through
  34406. // the results.
  34407. NextPageToken string `json:"nextPageToken,omitempty"`
  34408. // SelfLink: [Output Only] Server-defined URL for this resource.
  34409. SelfLink string `json:"selfLink,omitempty"`
  34410. // Warning: [Output Only] Informational warning message.
  34411. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  34412. // ServerResponse contains the HTTP response code and headers from the
  34413. // server.
  34414. googleapi.ServerResponse `json:"-"`
  34415. // ForceSendFields is a list of field names (e.g. "Id") to
  34416. // unconditionally include in API requests. By default, fields with
  34417. // empty values are omitted from API requests. However, any non-pointer,
  34418. // non-interface field appearing in ForceSendFields will be sent to the
  34419. // server regardless of whether the field is empty or not. This may be
  34420. // used to include empty fields in Patch requests.
  34421. ForceSendFields []string `json:"-"`
  34422. // NullFields is a list of field names (e.g. "Id") to include in API
  34423. // requests with the JSON null value. By default, fields with empty
  34424. // values are omitted from API requests. However, any field with an
  34425. // empty value appearing in NullFields will be sent to the server as
  34426. // null. It is an error if a field in this list has a non-empty value.
  34427. // This may be used to include null fields in Patch requests.
  34428. NullFields []string `json:"-"`
  34429. }
  34430. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  34431. type NoMethod TargetSslProxyList
  34432. raw := NoMethod(*s)
  34433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34434. }
  34435. // TargetSslProxyListWarning: [Output Only] Informational warning
  34436. // message.
  34437. type TargetSslProxyListWarning struct {
  34438. // Code: [Output Only] A warning code, if applicable. For example,
  34439. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  34440. // the response.
  34441. //
  34442. // Possible values:
  34443. // "CLEANUP_FAILED"
  34444. // "DEPRECATED_RESOURCE_USED"
  34445. // "DEPRECATED_TYPE_USED"
  34446. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  34447. // "EXPERIMENTAL_TYPE_USED"
  34448. // "EXTERNAL_API_WARNING"
  34449. // "FIELD_VALUE_OVERRIDEN"
  34450. // "INJECTED_KERNELS_DEPRECATED"
  34451. // "MISSING_TYPE_DEPENDENCY"
  34452. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  34453. // "NEXT_HOP_CANNOT_IP_FORWARD"
  34454. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  34455. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  34456. // "NEXT_HOP_NOT_RUNNING"
  34457. // "NOT_CRITICAL_ERROR"
  34458. // "NO_RESULTS_ON_PAGE"
  34459. // "REQUIRED_TOS_AGREEMENT"
  34460. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  34461. // "RESOURCE_NOT_DELETED"
  34462. // "SCHEMA_VALIDATION_IGNORED"
  34463. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  34464. // "UNDECLARED_PROPERTIES"
  34465. // "UNREACHABLE"
  34466. Code string `json:"code,omitempty"`
  34467. // Data: [Output Only] Metadata about this warning in key: value format.
  34468. // For example:
  34469. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  34470. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  34471. // Message: [Output Only] A human-readable description of the warning
  34472. // code.
  34473. Message string `json:"message,omitempty"`
  34474. // ForceSendFields is a list of field names (e.g. "Code") to
  34475. // unconditionally include in API requests. By default, fields with
  34476. // empty values are omitted from API requests. However, any non-pointer,
  34477. // non-interface field appearing in ForceSendFields will be sent to the
  34478. // server regardless of whether the field is empty or not. This may be
  34479. // used to include empty fields in Patch requests.
  34480. ForceSendFields []string `json:"-"`
  34481. // NullFields is a list of field names (e.g. "Code") to include in API
  34482. // requests with the JSON null value. By default, fields with empty
  34483. // values are omitted from API requests. However, any field with an
  34484. // empty value appearing in NullFields will be sent to the server as
  34485. // null. It is an error if a field in this list has a non-empty value.
  34486. // This may be used to include null fields in Patch requests.
  34487. NullFields []string `json:"-"`
  34488. }
  34489. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  34490. type NoMethod TargetSslProxyListWarning
  34491. raw := NoMethod(*s)
  34492. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34493. }
  34494. type TargetSslProxyListWarningData struct {
  34495. // Key: [Output Only] A key that provides more detail on the warning
  34496. // being returned. For example, for warnings where there are no results
  34497. // in a list request for a particular zone, this key might be scope and
  34498. // the key value might be the zone name. Other examples might be a key
  34499. // indicating a deprecated resource and a suggested replacement, or a
  34500. // warning about invalid network settings (for example, if an instance
  34501. // attempts to perform IP forwarding but is not enabled for IP
  34502. // forwarding).
  34503. Key string `json:"key,omitempty"`
  34504. // Value: [Output Only] A warning data value corresponding to the key.
  34505. Value string `json:"value,omitempty"`
  34506. // ForceSendFields is a list of field names (e.g. "Key") to
  34507. // unconditionally include in API requests. By default, fields with
  34508. // empty values are omitted from API requests. However, any non-pointer,
  34509. // non-interface field appearing in ForceSendFields will be sent to the
  34510. // server regardless of whether the field is empty or not. This may be
  34511. // used to include empty fields in Patch requests.
  34512. ForceSendFields []string `json:"-"`
  34513. // NullFields is a list of field names (e.g. "Key") to include in API
  34514. // requests with the JSON null value. By default, fields with empty
  34515. // values are omitted from API requests. However, any field with an
  34516. // empty value appearing in NullFields will be sent to the server as
  34517. // null. It is an error if a field in this list has a non-empty value.
  34518. // This may be used to include null fields in Patch requests.
  34519. NullFields []string `json:"-"`
  34520. }
  34521. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  34522. type NoMethod TargetSslProxyListWarningData
  34523. raw := NoMethod(*s)
  34524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34525. }
  34526. type TargetTcpProxiesSetBackendServiceRequest struct {
  34527. // Service: The URL of the new BackendService resource for the
  34528. // targetTcpProxy.
  34529. Service string `json:"service,omitempty"`
  34530. // ForceSendFields is a list of field names (e.g. "Service") to
  34531. // unconditionally include in API requests. By default, fields with
  34532. // empty values are omitted from API requests. However, any non-pointer,
  34533. // non-interface field appearing in ForceSendFields will be sent to the
  34534. // server regardless of whether the field is empty or not. This may be
  34535. // used to include empty fields in Patch requests.
  34536. ForceSendFields []string `json:"-"`
  34537. // NullFields is a list of field names (e.g. "Service") to include in
  34538. // API requests with the JSON null value. By default, fields with empty
  34539. // values are omitted from API requests. However, any field with an
  34540. // empty value appearing in NullFields will be sent to the server as
  34541. // null. It is an error if a field in this list has a non-empty value.
  34542. // This may be used to include null fields in Patch requests.
  34543. NullFields []string `json:"-"`
  34544. }
  34545. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  34546. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  34547. raw := NoMethod(*s)
  34548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34549. }
  34550. type TargetTcpProxiesSetProxyHeaderRequest struct {
  34551. // ProxyHeader: The new type of proxy header to append before sending
  34552. // data to the backend. NONE or PROXY_V1 are allowed.
  34553. //
  34554. // Possible values:
  34555. // "NONE"
  34556. // "PROXY_V1"
  34557. ProxyHeader string `json:"proxyHeader,omitempty"`
  34558. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  34559. // unconditionally include in API requests. By default, fields with
  34560. // empty values are omitted from API requests. However, any non-pointer,
  34561. // non-interface field appearing in ForceSendFields will be sent to the
  34562. // server regardless of whether the field is empty or not. This may be
  34563. // used to include empty fields in Patch requests.
  34564. ForceSendFields []string `json:"-"`
  34565. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  34566. // in API requests with the JSON null value. By default, fields with
  34567. // empty values are omitted from API requests. However, any field with
  34568. // an empty value appearing in NullFields will be sent to the server as
  34569. // null. It is an error if a field in this list has a non-empty value.
  34570. // This may be used to include null fields in Patch requests.
  34571. NullFields []string `json:"-"`
  34572. }
  34573. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  34574. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  34575. raw := NoMethod(*s)
  34576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34577. }
  34578. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  34579. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  34580. // resource_for v1.targetTcpProxies ==)
  34581. type TargetTcpProxy struct {
  34582. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  34583. // format.
  34584. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  34585. // Description: An optional description of this resource. Provide this
  34586. // property when you create the resource.
  34587. Description string `json:"description,omitempty"`
  34588. // Id: [Output Only] The unique identifier for the resource. This
  34589. // identifier is defined by the server.
  34590. Id uint64 `json:"id,omitempty,string"`
  34591. // Kind: [Output Only] Type of the resource. Always
  34592. // compute#targetTcpProxy for target TCP proxies.
  34593. Kind string `json:"kind,omitempty"`
  34594. // Name: Name of the resource. Provided by the client when the resource
  34595. // is created. The name must be 1-63 characters long, and comply with
  34596. // RFC1035. Specifically, the name must be 1-63 characters long and
  34597. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  34598. // the first character must be a lowercase letter, and all following
  34599. // characters must be a dash, lowercase letter, or digit, except the
  34600. // last character, which cannot be a dash.
  34601. Name string `json:"name,omitempty"`
  34602. // ProxyHeader: Specifies the type of proxy header to append before
  34603. // sending data to the backend, either NONE or PROXY_V1. The default is
  34604. // NONE.
  34605. //
  34606. // Possible values:
  34607. // "NONE"
  34608. // "PROXY_V1"
  34609. ProxyHeader string `json:"proxyHeader,omitempty"`
  34610. // SelfLink: [Output Only] Server-defined URL for the resource.
  34611. SelfLink string `json:"selfLink,omitempty"`
  34612. // Service: URL to the BackendService resource.
  34613. Service string `json:"service,omitempty"`
  34614. // ServerResponse contains the HTTP response code and headers from the
  34615. // server.
  34616. googleapi.ServerResponse `json:"-"`
  34617. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  34618. // to unconditionally include in API requests. By default, fields with
  34619. // empty values are omitted from API requests. However, any non-pointer,
  34620. // non-interface field appearing in ForceSendFields will be sent to the
  34621. // server regardless of whether the field is empty or not. This may be
  34622. // used to include empty fields in Patch requests.
  34623. ForceSendFields []string `json:"-"`
  34624. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  34625. // include in API requests with the JSON null value. By default, fields
  34626. // with empty values are omitted from API requests. However, any field
  34627. // with an empty value appearing in NullFields will be sent to the
  34628. // server as null. It is an error if a field in this list has a
  34629. // non-empty value. This may be used to include null fields in Patch
  34630. // requests.
  34631. NullFields []string `json:"-"`
  34632. }
  34633. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  34634. type NoMethod TargetTcpProxy
  34635. raw := NoMethod(*s)
  34636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34637. }
  34638. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  34639. type TargetTcpProxyList struct {
  34640. // Id: [Output Only] Unique identifier for the resource; defined by the
  34641. // server.
  34642. Id string `json:"id,omitempty"`
  34643. // Items: A list of TargetTcpProxy resources.
  34644. Items []*TargetTcpProxy `json:"items,omitempty"`
  34645. // Kind: Type of resource.
  34646. Kind string `json:"kind,omitempty"`
  34647. // NextPageToken: [Output Only] This token allows you to get the next
  34648. // page of results for list requests. If the number of results is larger
  34649. // than maxResults, use the nextPageToken as a value for the query
  34650. // parameter pageToken in the next list request. Subsequent list
  34651. // requests will have their own nextPageToken to continue paging through
  34652. // the results.
  34653. NextPageToken string `json:"nextPageToken,omitempty"`
  34654. // SelfLink: [Output Only] Server-defined URL for this resource.
  34655. SelfLink string `json:"selfLink,omitempty"`
  34656. // Warning: [Output Only] Informational warning message.
  34657. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  34658. // ServerResponse contains the HTTP response code and headers from the
  34659. // server.
  34660. googleapi.ServerResponse `json:"-"`
  34661. // ForceSendFields is a list of field names (e.g. "Id") to
  34662. // unconditionally include in API requests. By default, fields with
  34663. // empty values are omitted from API requests. However, any non-pointer,
  34664. // non-interface field appearing in ForceSendFields will be sent to the
  34665. // server regardless of whether the field is empty or not. This may be
  34666. // used to include empty fields in Patch requests.
  34667. ForceSendFields []string `json:"-"`
  34668. // NullFields is a list of field names (e.g. "Id") to include in API
  34669. // requests with the JSON null value. By default, fields with empty
  34670. // values are omitted from API requests. However, any field with an
  34671. // empty value appearing in NullFields will be sent to the server as
  34672. // null. It is an error if a field in this list has a non-empty value.
  34673. // This may be used to include null fields in Patch requests.
  34674. NullFields []string `json:"-"`
  34675. }
  34676. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  34677. type NoMethod TargetTcpProxyList
  34678. raw := NoMethod(*s)
  34679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34680. }
  34681. // TargetTcpProxyListWarning: [Output Only] Informational warning
  34682. // message.
  34683. type TargetTcpProxyListWarning struct {
  34684. // Code: [Output Only] A warning code, if applicable. For example,
  34685. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  34686. // the response.
  34687. //
  34688. // Possible values:
  34689. // "CLEANUP_FAILED"
  34690. // "DEPRECATED_RESOURCE_USED"
  34691. // "DEPRECATED_TYPE_USED"
  34692. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  34693. // "EXPERIMENTAL_TYPE_USED"
  34694. // "EXTERNAL_API_WARNING"
  34695. // "FIELD_VALUE_OVERRIDEN"
  34696. // "INJECTED_KERNELS_DEPRECATED"
  34697. // "MISSING_TYPE_DEPENDENCY"
  34698. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  34699. // "NEXT_HOP_CANNOT_IP_FORWARD"
  34700. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  34701. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  34702. // "NEXT_HOP_NOT_RUNNING"
  34703. // "NOT_CRITICAL_ERROR"
  34704. // "NO_RESULTS_ON_PAGE"
  34705. // "REQUIRED_TOS_AGREEMENT"
  34706. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  34707. // "RESOURCE_NOT_DELETED"
  34708. // "SCHEMA_VALIDATION_IGNORED"
  34709. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  34710. // "UNDECLARED_PROPERTIES"
  34711. // "UNREACHABLE"
  34712. Code string `json:"code,omitempty"`
  34713. // Data: [Output Only] Metadata about this warning in key: value format.
  34714. // For example:
  34715. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  34716. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  34717. // Message: [Output Only] A human-readable description of the warning
  34718. // code.
  34719. Message string `json:"message,omitempty"`
  34720. // ForceSendFields is a list of field names (e.g. "Code") to
  34721. // unconditionally include in API requests. By default, fields with
  34722. // empty values are omitted from API requests. However, any non-pointer,
  34723. // non-interface field appearing in ForceSendFields will be sent to the
  34724. // server regardless of whether the field is empty or not. This may be
  34725. // used to include empty fields in Patch requests.
  34726. ForceSendFields []string `json:"-"`
  34727. // NullFields is a list of field names (e.g. "Code") to include in API
  34728. // requests with the JSON null value. By default, fields with empty
  34729. // values are omitted from API requests. However, any field with an
  34730. // empty value appearing in NullFields will be sent to the server as
  34731. // null. It is an error if a field in this list has a non-empty value.
  34732. // This may be used to include null fields in Patch requests.
  34733. NullFields []string `json:"-"`
  34734. }
  34735. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  34736. type NoMethod TargetTcpProxyListWarning
  34737. raw := NoMethod(*s)
  34738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34739. }
  34740. type TargetTcpProxyListWarningData struct {
  34741. // Key: [Output Only] A key that provides more detail on the warning
  34742. // being returned. For example, for warnings where there are no results
  34743. // in a list request for a particular zone, this key might be scope and
  34744. // the key value might be the zone name. Other examples might be a key
  34745. // indicating a deprecated resource and a suggested replacement, or a
  34746. // warning about invalid network settings (for example, if an instance
  34747. // attempts to perform IP forwarding but is not enabled for IP
  34748. // forwarding).
  34749. Key string `json:"key,omitempty"`
  34750. // Value: [Output Only] A warning data value corresponding to the key.
  34751. Value string `json:"value,omitempty"`
  34752. // ForceSendFields is a list of field names (e.g. "Key") to
  34753. // unconditionally include in API requests. By default, fields with
  34754. // empty values are omitted from API requests. However, any non-pointer,
  34755. // non-interface field appearing in ForceSendFields will be sent to the
  34756. // server regardless of whether the field is empty or not. This may be
  34757. // used to include empty fields in Patch requests.
  34758. ForceSendFields []string `json:"-"`
  34759. // NullFields is a list of field names (e.g. "Key") to include in API
  34760. // requests with the JSON null value. By default, fields with empty
  34761. // values are omitted from API requests. However, any field with an
  34762. // empty value appearing in NullFields will be sent to the server as
  34763. // null. It is an error if a field in this list has a non-empty value.
  34764. // This may be used to include null fields in Patch requests.
  34765. NullFields []string `json:"-"`
  34766. }
  34767. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  34768. type NoMethod TargetTcpProxyListWarningData
  34769. raw := NoMethod(*s)
  34770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34771. }
  34772. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  34773. // resource_for beta.targetVpnGateways ==) (== resource_for
  34774. // v1.targetVpnGateways ==)
  34775. type TargetVpnGateway struct {
  34776. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  34777. // format.
  34778. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  34779. // Description: An optional description of this resource. Provide this
  34780. // property when you create the resource.
  34781. Description string `json:"description,omitempty"`
  34782. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  34783. // resources. ForwardingRules are created using
  34784. // compute.forwardingRules.insert and associated with a VPN gateway.
  34785. ForwardingRules []string `json:"forwardingRules,omitempty"`
  34786. // Id: [Output Only] The unique identifier for the resource. This
  34787. // identifier is defined by the server.
  34788. Id uint64 `json:"id,omitempty,string"`
  34789. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  34790. // for target VPN gateways.
  34791. Kind string `json:"kind,omitempty"`
  34792. // LabelFingerprint: A fingerprint for the labels being applied to this
  34793. // TargetVpnGateway, which is essentially a hash of the labels set used
  34794. // for optimistic locking. The fingerprint is initially generated by
  34795. // Compute Engine and changes after every request to modify or update
  34796. // labels. You must always provide an up-to-date fingerprint hash in
  34797. // order to update or change labels, otherwise the request will fail
  34798. // with error 412 conditionNotMet.
  34799. //
  34800. // To see the latest fingerprint, make a get() request to retrieve a
  34801. // TargetVpnGateway.
  34802. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  34803. // Labels: Labels to apply to this TargetVpnGateway resource. These can
  34804. // be later modified by the setLabels method. Each label key/value must
  34805. // comply with RFC1035. Label values may be empty.
  34806. Labels map[string]string `json:"labels,omitempty"`
  34807. // Name: Name of the resource. Provided by the client when the resource
  34808. // is created. The name must be 1-63 characters long, and comply with
  34809. // RFC1035. Specifically, the name must be 1-63 characters long and
  34810. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  34811. // the first character must be a lowercase letter, and all following
  34812. // characters must be a dash, lowercase letter, or digit, except the
  34813. // last character, which cannot be a dash.
  34814. Name string `json:"name,omitempty"`
  34815. // Network: URL of the network to which this VPN gateway is attached.
  34816. // Provided by the client when the VPN gateway is created.
  34817. Network string `json:"network,omitempty"`
  34818. // Region: [Output Only] URL of the region where the target VPN gateway
  34819. // resides. You must specify this field as part of the HTTP request URL.
  34820. // It is not settable as a field in the request body.
  34821. Region string `json:"region,omitempty"`
  34822. // SelfLink: [Output Only] Server-defined URL for the resource.
  34823. SelfLink string `json:"selfLink,omitempty"`
  34824. // Status: [Output Only] The status of the VPN gateway, which can be one
  34825. // of the following: CREATING, READY, FAILED, or DELETING.
  34826. //
  34827. // Possible values:
  34828. // "CREATING"
  34829. // "DELETING"
  34830. // "FAILED"
  34831. // "READY"
  34832. Status string `json:"status,omitempty"`
  34833. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  34834. // VpnTunnels are created using the compute.vpntunnels.insert method and
  34835. // associated with a VPN gateway.
  34836. Tunnels []string `json:"tunnels,omitempty"`
  34837. // ServerResponse contains the HTTP response code and headers from the
  34838. // server.
  34839. googleapi.ServerResponse `json:"-"`
  34840. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  34841. // to unconditionally include in API requests. By default, fields with
  34842. // empty values are omitted from API requests. However, any non-pointer,
  34843. // non-interface field appearing in ForceSendFields will be sent to the
  34844. // server regardless of whether the field is empty or not. This may be
  34845. // used to include empty fields in Patch requests.
  34846. ForceSendFields []string `json:"-"`
  34847. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  34848. // include in API requests with the JSON null value. By default, fields
  34849. // with empty values are omitted from API requests. However, any field
  34850. // with an empty value appearing in NullFields will be sent to the
  34851. // server as null. It is an error if a field in this list has a
  34852. // non-empty value. This may be used to include null fields in Patch
  34853. // requests.
  34854. NullFields []string `json:"-"`
  34855. }
  34856. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  34857. type NoMethod TargetVpnGateway
  34858. raw := NoMethod(*s)
  34859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34860. }
  34861. type TargetVpnGatewayAggregatedList struct {
  34862. // Id: [Output Only] Unique identifier for the resource; defined by the
  34863. // server.
  34864. Id string `json:"id,omitempty"`
  34865. // Items: A list of TargetVpnGateway resources.
  34866. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  34867. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  34868. // for target VPN gateways.
  34869. Kind string `json:"kind,omitempty"`
  34870. // NextPageToken: [Output Only] This token allows you to get the next
  34871. // page of results for list requests. If the number of results is larger
  34872. // than maxResults, use the nextPageToken as a value for the query
  34873. // parameter pageToken in the next list request. Subsequent list
  34874. // requests will have their own nextPageToken to continue paging through
  34875. // the results.
  34876. NextPageToken string `json:"nextPageToken,omitempty"`
  34877. // SelfLink: [Output Only] Server-defined URL for this resource.
  34878. SelfLink string `json:"selfLink,omitempty"`
  34879. // Warning: [Output Only] Informational warning message.
  34880. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  34881. // ServerResponse contains the HTTP response code and headers from the
  34882. // server.
  34883. googleapi.ServerResponse `json:"-"`
  34884. // ForceSendFields is a list of field names (e.g. "Id") to
  34885. // unconditionally include in API requests. By default, fields with
  34886. // empty values are omitted from API requests. However, any non-pointer,
  34887. // non-interface field appearing in ForceSendFields will be sent to the
  34888. // server regardless of whether the field is empty or not. This may be
  34889. // used to include empty fields in Patch requests.
  34890. ForceSendFields []string `json:"-"`
  34891. // NullFields is a list of field names (e.g. "Id") to include in API
  34892. // requests with the JSON null value. By default, fields with empty
  34893. // values are omitted from API requests. However, any field with an
  34894. // empty value appearing in NullFields will be sent to the server as
  34895. // null. It is an error if a field in this list has a non-empty value.
  34896. // This may be used to include null fields in Patch requests.
  34897. NullFields []string `json:"-"`
  34898. }
  34899. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  34900. type NoMethod TargetVpnGatewayAggregatedList
  34901. raw := NoMethod(*s)
  34902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34903. }
  34904. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  34905. // warning message.
  34906. type TargetVpnGatewayAggregatedListWarning struct {
  34907. // Code: [Output Only] A warning code, if applicable. For example,
  34908. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  34909. // the response.
  34910. //
  34911. // Possible values:
  34912. // "CLEANUP_FAILED"
  34913. // "DEPRECATED_RESOURCE_USED"
  34914. // "DEPRECATED_TYPE_USED"
  34915. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  34916. // "EXPERIMENTAL_TYPE_USED"
  34917. // "EXTERNAL_API_WARNING"
  34918. // "FIELD_VALUE_OVERRIDEN"
  34919. // "INJECTED_KERNELS_DEPRECATED"
  34920. // "MISSING_TYPE_DEPENDENCY"
  34921. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  34922. // "NEXT_HOP_CANNOT_IP_FORWARD"
  34923. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  34924. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  34925. // "NEXT_HOP_NOT_RUNNING"
  34926. // "NOT_CRITICAL_ERROR"
  34927. // "NO_RESULTS_ON_PAGE"
  34928. // "REQUIRED_TOS_AGREEMENT"
  34929. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  34930. // "RESOURCE_NOT_DELETED"
  34931. // "SCHEMA_VALIDATION_IGNORED"
  34932. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  34933. // "UNDECLARED_PROPERTIES"
  34934. // "UNREACHABLE"
  34935. Code string `json:"code,omitempty"`
  34936. // Data: [Output Only] Metadata about this warning in key: value format.
  34937. // For example:
  34938. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  34939. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  34940. // Message: [Output Only] A human-readable description of the warning
  34941. // code.
  34942. Message string `json:"message,omitempty"`
  34943. // ForceSendFields is a list of field names (e.g. "Code") to
  34944. // unconditionally include in API requests. By default, fields with
  34945. // empty values are omitted from API requests. However, any non-pointer,
  34946. // non-interface field appearing in ForceSendFields will be sent to the
  34947. // server regardless of whether the field is empty or not. This may be
  34948. // used to include empty fields in Patch requests.
  34949. ForceSendFields []string `json:"-"`
  34950. // NullFields is a list of field names (e.g. "Code") to include in API
  34951. // requests with the JSON null value. By default, fields with empty
  34952. // values are omitted from API requests. However, any field with an
  34953. // empty value appearing in NullFields will be sent to the server as
  34954. // null. It is an error if a field in this list has a non-empty value.
  34955. // This may be used to include null fields in Patch requests.
  34956. NullFields []string `json:"-"`
  34957. }
  34958. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  34959. type NoMethod TargetVpnGatewayAggregatedListWarning
  34960. raw := NoMethod(*s)
  34961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34962. }
  34963. type TargetVpnGatewayAggregatedListWarningData struct {
  34964. // Key: [Output Only] A key that provides more detail on the warning
  34965. // being returned. For example, for warnings where there are no results
  34966. // in a list request for a particular zone, this key might be scope and
  34967. // the key value might be the zone name. Other examples might be a key
  34968. // indicating a deprecated resource and a suggested replacement, or a
  34969. // warning about invalid network settings (for example, if an instance
  34970. // attempts to perform IP forwarding but is not enabled for IP
  34971. // forwarding).
  34972. Key string `json:"key,omitempty"`
  34973. // Value: [Output Only] A warning data value corresponding to the key.
  34974. Value string `json:"value,omitempty"`
  34975. // ForceSendFields is a list of field names (e.g. "Key") to
  34976. // unconditionally include in API requests. By default, fields with
  34977. // empty values are omitted from API requests. However, any non-pointer,
  34978. // non-interface field appearing in ForceSendFields will be sent to the
  34979. // server regardless of whether the field is empty or not. This may be
  34980. // used to include empty fields in Patch requests.
  34981. ForceSendFields []string `json:"-"`
  34982. // NullFields is a list of field names (e.g. "Key") to include in API
  34983. // requests with the JSON null value. By default, fields with empty
  34984. // values are omitted from API requests. However, any field with an
  34985. // empty value appearing in NullFields will be sent to the server as
  34986. // null. It is an error if a field in this list has a non-empty value.
  34987. // This may be used to include null fields in Patch requests.
  34988. NullFields []string `json:"-"`
  34989. }
  34990. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  34991. type NoMethod TargetVpnGatewayAggregatedListWarningData
  34992. raw := NoMethod(*s)
  34993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34994. }
  34995. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  34996. type TargetVpnGatewayList struct {
  34997. // Id: [Output Only] Unique identifier for the resource; defined by the
  34998. // server.
  34999. Id string `json:"id,omitempty"`
  35000. // Items: A list of TargetVpnGateway resources.
  35001. Items []*TargetVpnGateway `json:"items,omitempty"`
  35002. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  35003. // for target VPN gateways.
  35004. Kind string `json:"kind,omitempty"`
  35005. // NextPageToken: [Output Only] This token allows you to get the next
  35006. // page of results for list requests. If the number of results is larger
  35007. // than maxResults, use the nextPageToken as a value for the query
  35008. // parameter pageToken in the next list request. Subsequent list
  35009. // requests will have their own nextPageToken to continue paging through
  35010. // the results.
  35011. NextPageToken string `json:"nextPageToken,omitempty"`
  35012. // SelfLink: [Output Only] Server-defined URL for this resource.
  35013. SelfLink string `json:"selfLink,omitempty"`
  35014. // Warning: [Output Only] Informational warning message.
  35015. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  35016. // ServerResponse contains the HTTP response code and headers from the
  35017. // server.
  35018. googleapi.ServerResponse `json:"-"`
  35019. // ForceSendFields is a list of field names (e.g. "Id") to
  35020. // unconditionally include in API requests. By default, fields with
  35021. // empty values are omitted from API requests. However, any non-pointer,
  35022. // non-interface field appearing in ForceSendFields will be sent to the
  35023. // server regardless of whether the field is empty or not. This may be
  35024. // used to include empty fields in Patch requests.
  35025. ForceSendFields []string `json:"-"`
  35026. // NullFields is a list of field names (e.g. "Id") to include in API
  35027. // requests with the JSON null value. By default, fields with empty
  35028. // values are omitted from API requests. However, any field with an
  35029. // empty value appearing in NullFields will be sent to the server as
  35030. // null. It is an error if a field in this list has a non-empty value.
  35031. // This may be used to include null fields in Patch requests.
  35032. NullFields []string `json:"-"`
  35033. }
  35034. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  35035. type NoMethod TargetVpnGatewayList
  35036. raw := NoMethod(*s)
  35037. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35038. }
  35039. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  35040. // message.
  35041. type TargetVpnGatewayListWarning struct {
  35042. // Code: [Output Only] A warning code, if applicable. For example,
  35043. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  35044. // the response.
  35045. //
  35046. // Possible values:
  35047. // "CLEANUP_FAILED"
  35048. // "DEPRECATED_RESOURCE_USED"
  35049. // "DEPRECATED_TYPE_USED"
  35050. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  35051. // "EXPERIMENTAL_TYPE_USED"
  35052. // "EXTERNAL_API_WARNING"
  35053. // "FIELD_VALUE_OVERRIDEN"
  35054. // "INJECTED_KERNELS_DEPRECATED"
  35055. // "MISSING_TYPE_DEPENDENCY"
  35056. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  35057. // "NEXT_HOP_CANNOT_IP_FORWARD"
  35058. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  35059. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  35060. // "NEXT_HOP_NOT_RUNNING"
  35061. // "NOT_CRITICAL_ERROR"
  35062. // "NO_RESULTS_ON_PAGE"
  35063. // "REQUIRED_TOS_AGREEMENT"
  35064. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  35065. // "RESOURCE_NOT_DELETED"
  35066. // "SCHEMA_VALIDATION_IGNORED"
  35067. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  35068. // "UNDECLARED_PROPERTIES"
  35069. // "UNREACHABLE"
  35070. Code string `json:"code,omitempty"`
  35071. // Data: [Output Only] Metadata about this warning in key: value format.
  35072. // For example:
  35073. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  35074. Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
  35075. // Message: [Output Only] A human-readable description of the warning
  35076. // code.
  35077. Message string `json:"message,omitempty"`
  35078. // ForceSendFields is a list of field names (e.g. "Code") to
  35079. // unconditionally include in API requests. By default, fields with
  35080. // empty values are omitted from API requests. However, any non-pointer,
  35081. // non-interface field appearing in ForceSendFields will be sent to the
  35082. // server regardless of whether the field is empty or not. This may be
  35083. // used to include empty fields in Patch requests.
  35084. ForceSendFields []string `json:"-"`
  35085. // NullFields is a list of field names (e.g. "Code") to include in API
  35086. // requests with the JSON null value. By default, fields with empty
  35087. // values are omitted from API requests. However, any field with an
  35088. // empty value appearing in NullFields will be sent to the server as
  35089. // null. It is an error if a field in this list has a non-empty value.
  35090. // This may be used to include null fields in Patch requests.
  35091. NullFields []string `json:"-"`
  35092. }
  35093. func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  35094. type NoMethod TargetVpnGatewayListWarning
  35095. raw := NoMethod(*s)
  35096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35097. }
  35098. type TargetVpnGatewayListWarningData struct {
  35099. // Key: [Output Only] A key that provides more detail on the warning
  35100. // being returned. For example, for warnings where there are no results
  35101. // in a list request for a particular zone, this key might be scope and
  35102. // the key value might be the zone name. Other examples might be a key
  35103. // indicating a deprecated resource and a suggested replacement, or a
  35104. // warning about invalid network settings (for example, if an instance
  35105. // attempts to perform IP forwarding but is not enabled for IP
  35106. // forwarding).
  35107. Key string `json:"key,omitempty"`
  35108. // Value: [Output Only] A warning data value corresponding to the key.
  35109. Value string `json:"value,omitempty"`
  35110. // ForceSendFields is a list of field names (e.g. "Key") to
  35111. // unconditionally include in API requests. By default, fields with
  35112. // empty values are omitted from API requests. However, any non-pointer,
  35113. // non-interface field appearing in ForceSendFields will be sent to the
  35114. // server regardless of whether the field is empty or not. This may be
  35115. // used to include empty fields in Patch requests.
  35116. ForceSendFields []string `json:"-"`
  35117. // NullFields is a list of field names (e.g. "Key") to include in API
  35118. // requests with the JSON null value. By default, fields with empty
  35119. // values are omitted from API requests. However, any field with an
  35120. // empty value appearing in NullFields will be sent to the server as
  35121. // null. It is an error if a field in this list has a non-empty value.
  35122. // This may be used to include null fields in Patch requests.
  35123. NullFields []string `json:"-"`
  35124. }
  35125. func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  35126. type NoMethod TargetVpnGatewayListWarningData
  35127. raw := NoMethod(*s)
  35128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35129. }
  35130. type TargetVpnGatewaysScopedList struct {
  35131. // TargetVpnGateways: [Output Only] A list of target VPN gateways
  35132. // contained in this scope.
  35133. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  35134. // Warning: [Output Only] Informational warning which replaces the list
  35135. // of addresses when the list is empty.
  35136. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  35137. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  35138. // to unconditionally include in API requests. By default, fields with
  35139. // empty values are omitted from API requests. However, any non-pointer,
  35140. // non-interface field appearing in ForceSendFields will be sent to the
  35141. // server regardless of whether the field is empty or not. This may be
  35142. // used to include empty fields in Patch requests.
  35143. ForceSendFields []string `json:"-"`
  35144. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  35145. // include in API requests with the JSON null value. By default, fields
  35146. // with empty values are omitted from API requests. However, any field
  35147. // with an empty value appearing in NullFields will be sent to the
  35148. // server as null. It is an error if a field in this list has a
  35149. // non-empty value. This may be used to include null fields in Patch
  35150. // requests.
  35151. NullFields []string `json:"-"`
  35152. }
  35153. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  35154. type NoMethod TargetVpnGatewaysScopedList
  35155. raw := NoMethod(*s)
  35156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35157. }
  35158. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  35159. // warning which replaces the list of addresses when the list is empty.
  35160. type TargetVpnGatewaysScopedListWarning struct {
  35161. // Code: [Output Only] A warning code, if applicable. For example,
  35162. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  35163. // the response.
  35164. //
  35165. // Possible values:
  35166. // "CLEANUP_FAILED"
  35167. // "DEPRECATED_RESOURCE_USED"
  35168. // "DEPRECATED_TYPE_USED"
  35169. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  35170. // "EXPERIMENTAL_TYPE_USED"
  35171. // "EXTERNAL_API_WARNING"
  35172. // "FIELD_VALUE_OVERRIDEN"
  35173. // "INJECTED_KERNELS_DEPRECATED"
  35174. // "MISSING_TYPE_DEPENDENCY"
  35175. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  35176. // "NEXT_HOP_CANNOT_IP_FORWARD"
  35177. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  35178. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  35179. // "NEXT_HOP_NOT_RUNNING"
  35180. // "NOT_CRITICAL_ERROR"
  35181. // "NO_RESULTS_ON_PAGE"
  35182. // "REQUIRED_TOS_AGREEMENT"
  35183. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  35184. // "RESOURCE_NOT_DELETED"
  35185. // "SCHEMA_VALIDATION_IGNORED"
  35186. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  35187. // "UNDECLARED_PROPERTIES"
  35188. // "UNREACHABLE"
  35189. Code string `json:"code,omitempty"`
  35190. // Data: [Output Only] Metadata about this warning in key: value format.
  35191. // For example:
  35192. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  35193. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  35194. // Message: [Output Only] A human-readable description of the warning
  35195. // code.
  35196. Message string `json:"message,omitempty"`
  35197. // ForceSendFields is a list of field names (e.g. "Code") to
  35198. // unconditionally include in API requests. By default, fields with
  35199. // empty values are omitted from API requests. However, any non-pointer,
  35200. // non-interface field appearing in ForceSendFields will be sent to the
  35201. // server regardless of whether the field is empty or not. This may be
  35202. // used to include empty fields in Patch requests.
  35203. ForceSendFields []string `json:"-"`
  35204. // NullFields is a list of field names (e.g. "Code") to include in API
  35205. // requests with the JSON null value. By default, fields with empty
  35206. // values are omitted from API requests. However, any field with an
  35207. // empty value appearing in NullFields will be sent to the server as
  35208. // null. It is an error if a field in this list has a non-empty value.
  35209. // This may be used to include null fields in Patch requests.
  35210. NullFields []string `json:"-"`
  35211. }
  35212. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  35213. type NoMethod TargetVpnGatewaysScopedListWarning
  35214. raw := NoMethod(*s)
  35215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35216. }
  35217. type TargetVpnGatewaysScopedListWarningData struct {
  35218. // Key: [Output Only] A key that provides more detail on the warning
  35219. // being returned. For example, for warnings where there are no results
  35220. // in a list request for a particular zone, this key might be scope and
  35221. // the key value might be the zone name. Other examples might be a key
  35222. // indicating a deprecated resource and a suggested replacement, or a
  35223. // warning about invalid network settings (for example, if an instance
  35224. // attempts to perform IP forwarding but is not enabled for IP
  35225. // forwarding).
  35226. Key string `json:"key,omitempty"`
  35227. // Value: [Output Only] A warning data value corresponding to the key.
  35228. Value string `json:"value,omitempty"`
  35229. // ForceSendFields is a list of field names (e.g. "Key") to
  35230. // unconditionally include in API requests. By default, fields with
  35231. // empty values are omitted from API requests. However, any non-pointer,
  35232. // non-interface field appearing in ForceSendFields will be sent to the
  35233. // server regardless of whether the field is empty or not. This may be
  35234. // used to include empty fields in Patch requests.
  35235. ForceSendFields []string `json:"-"`
  35236. // NullFields is a list of field names (e.g. "Key") to include in API
  35237. // requests with the JSON null value. By default, fields with empty
  35238. // values are omitted from API requests. However, any field with an
  35239. // empty value appearing in NullFields will be sent to the server as
  35240. // null. It is an error if a field in this list has a non-empty value.
  35241. // This may be used to include null fields in Patch requests.
  35242. NullFields []string `json:"-"`
  35243. }
  35244. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  35245. type NoMethod TargetVpnGatewaysScopedListWarningData
  35246. raw := NoMethod(*s)
  35247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35248. }
  35249. type TestFailure struct {
  35250. ActualService string `json:"actualService,omitempty"`
  35251. ExpectedService string `json:"expectedService,omitempty"`
  35252. Host string `json:"host,omitempty"`
  35253. Path string `json:"path,omitempty"`
  35254. // ForceSendFields is a list of field names (e.g. "ActualService") to
  35255. // unconditionally include in API requests. By default, fields with
  35256. // empty values are omitted from API requests. However, any non-pointer,
  35257. // non-interface field appearing in ForceSendFields will be sent to the
  35258. // server regardless of whether the field is empty or not. This may be
  35259. // used to include empty fields in Patch requests.
  35260. ForceSendFields []string `json:"-"`
  35261. // NullFields is a list of field names (e.g. "ActualService") to include
  35262. // in API requests with the JSON null value. By default, fields with
  35263. // empty values are omitted from API requests. However, any field with
  35264. // an empty value appearing in NullFields will be sent to the server as
  35265. // null. It is an error if a field in this list has a non-empty value.
  35266. // This may be used to include null fields in Patch requests.
  35267. NullFields []string `json:"-"`
  35268. }
  35269. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  35270. type NoMethod TestFailure
  35271. raw := NoMethod(*s)
  35272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35273. }
  35274. type TestPermissionsRequest struct {
  35275. // Permissions: The set of permissions to check for the 'resource'.
  35276. // Permissions with wildcards (such as '*' or 'storage.*') are not
  35277. // allowed.
  35278. Permissions []string `json:"permissions,omitempty"`
  35279. // ForceSendFields is a list of field names (e.g. "Permissions") to
  35280. // unconditionally include in API requests. By default, fields with
  35281. // empty values are omitted from API requests. However, any non-pointer,
  35282. // non-interface field appearing in ForceSendFields will be sent to the
  35283. // server regardless of whether the field is empty or not. This may be
  35284. // used to include empty fields in Patch requests.
  35285. ForceSendFields []string `json:"-"`
  35286. // NullFields is a list of field names (e.g. "Permissions") to include
  35287. // in API requests with the JSON null value. By default, fields with
  35288. // empty values are omitted from API requests. However, any field with
  35289. // an empty value appearing in NullFields will be sent to the server as
  35290. // null. It is an error if a field in this list has a non-empty value.
  35291. // This may be used to include null fields in Patch requests.
  35292. NullFields []string `json:"-"`
  35293. }
  35294. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  35295. type NoMethod TestPermissionsRequest
  35296. raw := NoMethod(*s)
  35297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35298. }
  35299. type TestPermissionsResponse struct {
  35300. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  35301. // the caller is allowed.
  35302. Permissions []string `json:"permissions,omitempty"`
  35303. // ServerResponse contains the HTTP response code and headers from the
  35304. // server.
  35305. googleapi.ServerResponse `json:"-"`
  35306. // ForceSendFields is a list of field names (e.g. "Permissions") to
  35307. // unconditionally include in API requests. By default, fields with
  35308. // empty values are omitted from API requests. However, any non-pointer,
  35309. // non-interface field appearing in ForceSendFields will be sent to the
  35310. // server regardless of whether the field is empty or not. This may be
  35311. // used to include empty fields in Patch requests.
  35312. ForceSendFields []string `json:"-"`
  35313. // NullFields is a list of field names (e.g. "Permissions") to include
  35314. // in API requests with the JSON null value. By default, fields with
  35315. // empty values are omitted from API requests. However, any field with
  35316. // an empty value appearing in NullFields will be sent to the server as
  35317. // null. It is an error if a field in this list has a non-empty value.
  35318. // This may be used to include null fields in Patch requests.
  35319. NullFields []string `json:"-"`
  35320. }
  35321. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  35322. type NoMethod TestPermissionsResponse
  35323. raw := NoMethod(*s)
  35324. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35325. }
  35326. // TlsCertificateContext: Defines the mechanism to obtain the client or
  35327. // server certificate.
  35328. type TlsCertificateContext struct {
  35329. // CertificatePaths: Specifies the certificate and private key paths.
  35330. // This field is applicable only if tlsCertificateSource is set to
  35331. // USE_PATH.
  35332. CertificatePaths *TlsCertificatePaths `json:"certificatePaths,omitempty"`
  35333. // CertificateSource: Defines how TLS certificates are obtained.
  35334. //
  35335. // Possible values:
  35336. // "INVALID"
  35337. // "USE_PATH"
  35338. // "USE_SDS"
  35339. CertificateSource string `json:"certificateSource,omitempty"`
  35340. // SdsConfig: Specifies the config to retrieve certificates through SDS.
  35341. // This field is applicable only if tlsCertificateSource is set to
  35342. // USE_SDS.
  35343. SdsConfig *SdsConfig `json:"sdsConfig,omitempty"`
  35344. // ForceSendFields is a list of field names (e.g. "CertificatePaths") to
  35345. // unconditionally include in API requests. By default, fields with
  35346. // empty values are omitted from API requests. However, any non-pointer,
  35347. // non-interface field appearing in ForceSendFields will be sent to the
  35348. // server regardless of whether the field is empty or not. This may be
  35349. // used to include empty fields in Patch requests.
  35350. ForceSendFields []string `json:"-"`
  35351. // NullFields is a list of field names (e.g. "CertificatePaths") to
  35352. // include in API requests with the JSON null value. By default, fields
  35353. // with empty values are omitted from API requests. However, any field
  35354. // with an empty value appearing in NullFields will be sent to the
  35355. // server as null. It is an error if a field in this list has a
  35356. // non-empty value. This may be used to include null fields in Patch
  35357. // requests.
  35358. NullFields []string `json:"-"`
  35359. }
  35360. func (s *TlsCertificateContext) MarshalJSON() ([]byte, error) {
  35361. type NoMethod TlsCertificateContext
  35362. raw := NoMethod(*s)
  35363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35364. }
  35365. // TlsCertificatePaths: The paths to the mounted TLS Certificates and
  35366. // private key.
  35367. type TlsCertificatePaths struct {
  35368. // CertificatePath: The path to the file holding the client or server
  35369. // TLS certificate to use.
  35370. CertificatePath string `json:"certificatePath,omitempty"`
  35371. // PrivateKeyPath: The path to the file holding the client or server
  35372. // private key.
  35373. PrivateKeyPath string `json:"privateKeyPath,omitempty"`
  35374. // ForceSendFields is a list of field names (e.g. "CertificatePath") to
  35375. // unconditionally include in API requests. By default, fields with
  35376. // empty values are omitted from API requests. However, any non-pointer,
  35377. // non-interface field appearing in ForceSendFields will be sent to the
  35378. // server regardless of whether the field is empty or not. This may be
  35379. // used to include empty fields in Patch requests.
  35380. ForceSendFields []string `json:"-"`
  35381. // NullFields is a list of field names (e.g. "CertificatePath") to
  35382. // include in API requests with the JSON null value. By default, fields
  35383. // with empty values are omitted from API requests. However, any field
  35384. // with an empty value appearing in NullFields will be sent to the
  35385. // server as null. It is an error if a field in this list has a
  35386. // non-empty value. This may be used to include null fields in Patch
  35387. // requests.
  35388. NullFields []string `json:"-"`
  35389. }
  35390. func (s *TlsCertificatePaths) MarshalJSON() ([]byte, error) {
  35391. type NoMethod TlsCertificatePaths
  35392. raw := NoMethod(*s)
  35393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35394. }
  35395. // TlsContext: The TLS settings for the client or server.
  35396. type TlsContext struct {
  35397. // CertificateContext: Defines the mechanism to obtain the client or
  35398. // server certificate.
  35399. CertificateContext *TlsCertificateContext `json:"certificateContext,omitempty"`
  35400. // ValidationContext: Defines the mechanism to obtain the Certificate
  35401. // Authority certificate to validate the client/server certificate. If
  35402. // omitted, the proxy will not validate the server or client
  35403. // certificate.
  35404. ValidationContext *TlsValidationContext `json:"validationContext,omitempty"`
  35405. // ForceSendFields is a list of field names (e.g. "CertificateContext")
  35406. // to unconditionally include in API requests. By default, fields with
  35407. // empty values are omitted from API requests. However, any non-pointer,
  35408. // non-interface field appearing in ForceSendFields will be sent to the
  35409. // server regardless of whether the field is empty or not. This may be
  35410. // used to include empty fields in Patch requests.
  35411. ForceSendFields []string `json:"-"`
  35412. // NullFields is a list of field names (e.g. "CertificateContext") to
  35413. // include in API requests with the JSON null value. By default, fields
  35414. // with empty values are omitted from API requests. However, any field
  35415. // with an empty value appearing in NullFields will be sent to the
  35416. // server as null. It is an error if a field in this list has a
  35417. // non-empty value. This may be used to include null fields in Patch
  35418. // requests.
  35419. NullFields []string `json:"-"`
  35420. }
  35421. func (s *TlsContext) MarshalJSON() ([]byte, error) {
  35422. type NoMethod TlsContext
  35423. raw := NoMethod(*s)
  35424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35425. }
  35426. // TlsValidationContext: Defines the mechanism to obtain the Certificate
  35427. // Authority certificate to validate the client/server certificate.
  35428. type TlsValidationContext struct {
  35429. // CertificatePath: The path to the file holding the CA certificate to
  35430. // validate the client or server certificate.
  35431. CertificatePath string `json:"certificatePath,omitempty"`
  35432. // SdsConfig: Specifies the config to retrieve certificates through SDS.
  35433. // This field is applicable only if tlsCertificateSource is set to
  35434. // USE_SDS.
  35435. SdsConfig *SdsConfig `json:"sdsConfig,omitempty"`
  35436. // ValidationSource: Defines how TLS certificates are obtained.
  35437. //
  35438. // Possible values:
  35439. // "INVALID"
  35440. // "USE_PATH"
  35441. // "USE_SDS"
  35442. ValidationSource string `json:"validationSource,omitempty"`
  35443. // ForceSendFields is a list of field names (e.g. "CertificatePath") to
  35444. // unconditionally include in API requests. By default, fields with
  35445. // empty values are omitted from API requests. However, any non-pointer,
  35446. // non-interface field appearing in ForceSendFields will be sent to the
  35447. // server regardless of whether the field is empty or not. This may be
  35448. // used to include empty fields in Patch requests.
  35449. ForceSendFields []string `json:"-"`
  35450. // NullFields is a list of field names (e.g. "CertificatePath") to
  35451. // include in API requests with the JSON null value. By default, fields
  35452. // with empty values are omitted from API requests. However, any field
  35453. // with an empty value appearing in NullFields will be sent to the
  35454. // server as null. It is an error if a field in this list has a
  35455. // non-empty value. This may be used to include null fields in Patch
  35456. // requests.
  35457. NullFields []string `json:"-"`
  35458. }
  35459. func (s *TlsValidationContext) MarshalJSON() ([]byte, error) {
  35460. type NoMethod TlsValidationContext
  35461. raw := NoMethod(*s)
  35462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35463. }
  35464. type UDPHealthCheck struct {
  35465. // Port: The UDP port number for the health check request. Valid values
  35466. // are 1 through 65535.
  35467. Port int64 `json:"port,omitempty"`
  35468. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  35469. // both port and port_name are defined, port takes precedence.
  35470. PortName string `json:"portName,omitempty"`
  35471. // Request: Raw data of request to send in payload of UDP packet. It is
  35472. // an error if this is empty. The request data can only be ASCII.
  35473. Request string `json:"request,omitempty"`
  35474. // Response: The bytes to match against the beginning of the response
  35475. // data. It is an error if this is empty. The response data can only be
  35476. // ASCII.
  35477. Response string `json:"response,omitempty"`
  35478. // ForceSendFields is a list of field names (e.g. "Port") to
  35479. // unconditionally include in API requests. By default, fields with
  35480. // empty values are omitted from API requests. However, any non-pointer,
  35481. // non-interface field appearing in ForceSendFields will be sent to the
  35482. // server regardless of whether the field is empty or not. This may be
  35483. // used to include empty fields in Patch requests.
  35484. ForceSendFields []string `json:"-"`
  35485. // NullFields is a list of field names (e.g. "Port") to include in API
  35486. // requests with the JSON null value. By default, fields with empty
  35487. // values are omitted from API requests. However, any field with an
  35488. // empty value appearing in NullFields will be sent to the server as
  35489. // null. It is an error if a field in this list has a non-empty value.
  35490. // This may be used to include null fields in Patch requests.
  35491. NullFields []string `json:"-"`
  35492. }
  35493. func (s *UDPHealthCheck) MarshalJSON() ([]byte, error) {
  35494. type NoMethod UDPHealthCheck
  35495. raw := NoMethod(*s)
  35496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35497. }
  35498. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  35499. // to the BackendService resource, based on the "longest-match" of the
  35500. // URL's host and path.
  35501. type UrlMap struct {
  35502. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  35503. // format.
  35504. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  35505. // DefaultRouteAction: defaultRouteAction takes effect when none of the
  35506. // hostRules match. The load balancer performs advanced routing actions
  35507. // like URL rewrites, header transformations, etc. prior to forwarding
  35508. // the request to the selected backend. If defaultRouteAction specifies
  35509. // any weightedBackendServices, defaultService must not be set.
  35510. // Conversely if defaultService is set, defaultRouteAction cannot
  35511. // contain any weightedBackendServices.
  35512. // Only one of defaultRouteAction or defaultUrlRedirect must be set.
  35513. DefaultRouteAction *HttpRouteAction `json:"defaultRouteAction,omitempty"`
  35514. // DefaultService: The full or partial URL of the defaultService
  35515. // resource to which traffic is directed if none of the hostRules match.
  35516. // If defaultRouteAction is additionally specified, advanced routing
  35517. // actions like URL Rewrites, etc. take effect prior to sending the
  35518. // request to the backend. However, if defaultService is specified,
  35519. // defaultRouteAction cannot contain any weightedBackendServices.
  35520. // Conversely, if routeAction specifies any weightedBackendServices,
  35521. // service must not be specified.
  35522. // Only one of defaultService, defaultUrlRedirect or
  35523. // defaultRouteAction.weightedBackendService must be set.
  35524. DefaultService string `json:"defaultService,omitempty"`
  35525. // DefaultUrlRedirect: When none of the specified hostRules match, the
  35526. // request is redirected to a URL specified by defaultUrlRedirect.
  35527. // If defaultUrlRedirect is specified, defaultService or
  35528. // defaultRouteAction must not be set.
  35529. DefaultUrlRedirect *HttpRedirectAction `json:"defaultUrlRedirect,omitempty"`
  35530. // Description: An optional description of this resource. Provide this
  35531. // property when you create the resource.
  35532. Description string `json:"description,omitempty"`
  35533. // Fingerprint: Fingerprint of this resource. A hash of the contents
  35534. // stored in this object. This field is used in optimistic locking. This
  35535. // field will be ignored when inserting a UrlMap. An up-to-date
  35536. // fingerprint must be provided in order to update the UrlMap, otherwise
  35537. // the request will fail with error 412 conditionNotMet.
  35538. //
  35539. // To see the latest fingerprint, make a get() request to retrieve a
  35540. // UrlMap.
  35541. Fingerprint string `json:"fingerprint,omitempty"`
  35542. // HeaderAction: Specifies changes to request and response headers that
  35543. // need to take effect for the selected backendService.
  35544. // The headerAction specified here take effect after headerAction
  35545. // specified under pathMatcher.
  35546. HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
  35547. // HostRules: The list of HostRules to use against the URL.
  35548. HostRules []*HostRule `json:"hostRules,omitempty"`
  35549. // Id: [Output Only] The unique identifier for the resource. This
  35550. // identifier is defined by the server.
  35551. Id uint64 `json:"id,omitempty,string"`
  35552. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  35553. // url maps.
  35554. Kind string `json:"kind,omitempty"`
  35555. // Name: Name of the resource. Provided by the client when the resource
  35556. // is created. The name must be 1-63 characters long, and comply with
  35557. // RFC1035. Specifically, the name must be 1-63 characters long and
  35558. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  35559. // the first character must be a lowercase letter, and all following
  35560. // characters must be a dash, lowercase letter, or digit, except the
  35561. // last character, which cannot be a dash.
  35562. Name string `json:"name,omitempty"`
  35563. // PathMatchers: The list of named PathMatchers to use against the URL.
  35564. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  35565. // Region: [Output Only] URL of the region where the regional URL map
  35566. // resides. This field is not applicable to global URL maps. You must
  35567. // specify this field as part of the HTTP request URL. It is not
  35568. // settable as a field in the request body.
  35569. Region string `json:"region,omitempty"`
  35570. // SelfLink: [Output Only] Server-defined URL for the resource.
  35571. SelfLink string `json:"selfLink,omitempty"`
  35572. // Tests: The list of expected URL mapping tests. Request to update this
  35573. // UrlMap will succeed only if all of the test cases pass. You can
  35574. // specify a maximum of 100 tests per UrlMap.
  35575. Tests []*UrlMapTest `json:"tests,omitempty"`
  35576. // ServerResponse contains the HTTP response code and headers from the
  35577. // server.
  35578. googleapi.ServerResponse `json:"-"`
  35579. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  35580. // to unconditionally include in API requests. By default, fields with
  35581. // empty values are omitted from API requests. However, any non-pointer,
  35582. // non-interface field appearing in ForceSendFields will be sent to the
  35583. // server regardless of whether the field is empty or not. This may be
  35584. // used to include empty fields in Patch requests.
  35585. ForceSendFields []string `json:"-"`
  35586. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  35587. // include in API requests with the JSON null value. By default, fields
  35588. // with empty values are omitted from API requests. However, any field
  35589. // with an empty value appearing in NullFields will be sent to the
  35590. // server as null. It is an error if a field in this list has a
  35591. // non-empty value. This may be used to include null fields in Patch
  35592. // requests.
  35593. NullFields []string `json:"-"`
  35594. }
  35595. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  35596. type NoMethod UrlMap
  35597. raw := NoMethod(*s)
  35598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35599. }
  35600. // UrlMapList: Contains a list of UrlMap resources.
  35601. type UrlMapList struct {
  35602. // Id: [Output Only] Unique identifier for the resource; defined by the
  35603. // server.
  35604. Id string `json:"id,omitempty"`
  35605. // Items: A list of UrlMap resources.
  35606. Items []*UrlMap `json:"items,omitempty"`
  35607. // Kind: Type of resource.
  35608. Kind string `json:"kind,omitempty"`
  35609. // NextPageToken: [Output Only] This token allows you to get the next
  35610. // page of results for list requests. If the number of results is larger
  35611. // than maxResults, use the nextPageToken as a value for the query
  35612. // parameter pageToken in the next list request. Subsequent list
  35613. // requests will have their own nextPageToken to continue paging through
  35614. // the results.
  35615. NextPageToken string `json:"nextPageToken,omitempty"`
  35616. // SelfLink: [Output Only] Server-defined URL for this resource.
  35617. SelfLink string `json:"selfLink,omitempty"`
  35618. // Warning: [Output Only] Informational warning message.
  35619. Warning *UrlMapListWarning `json:"warning,omitempty"`
  35620. // ServerResponse contains the HTTP response code and headers from the
  35621. // server.
  35622. googleapi.ServerResponse `json:"-"`
  35623. // ForceSendFields is a list of field names (e.g. "Id") to
  35624. // unconditionally include in API requests. By default, fields with
  35625. // empty values are omitted from API requests. However, any non-pointer,
  35626. // non-interface field appearing in ForceSendFields will be sent to the
  35627. // server regardless of whether the field is empty or not. This may be
  35628. // used to include empty fields in Patch requests.
  35629. ForceSendFields []string `json:"-"`
  35630. // NullFields is a list of field names (e.g. "Id") to include in API
  35631. // requests with the JSON null value. By default, fields with empty
  35632. // values are omitted from API requests. However, any field with an
  35633. // empty value appearing in NullFields will be sent to the server as
  35634. // null. It is an error if a field in this list has a non-empty value.
  35635. // This may be used to include null fields in Patch requests.
  35636. NullFields []string `json:"-"`
  35637. }
  35638. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  35639. type NoMethod UrlMapList
  35640. raw := NoMethod(*s)
  35641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35642. }
  35643. // UrlMapListWarning: [Output Only] Informational warning message.
  35644. type UrlMapListWarning struct {
  35645. // Code: [Output Only] A warning code, if applicable. For example,
  35646. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  35647. // the response.
  35648. //
  35649. // Possible values:
  35650. // "CLEANUP_FAILED"
  35651. // "DEPRECATED_RESOURCE_USED"
  35652. // "DEPRECATED_TYPE_USED"
  35653. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  35654. // "EXPERIMENTAL_TYPE_USED"
  35655. // "EXTERNAL_API_WARNING"
  35656. // "FIELD_VALUE_OVERRIDEN"
  35657. // "INJECTED_KERNELS_DEPRECATED"
  35658. // "MISSING_TYPE_DEPENDENCY"
  35659. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  35660. // "NEXT_HOP_CANNOT_IP_FORWARD"
  35661. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  35662. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  35663. // "NEXT_HOP_NOT_RUNNING"
  35664. // "NOT_CRITICAL_ERROR"
  35665. // "NO_RESULTS_ON_PAGE"
  35666. // "REQUIRED_TOS_AGREEMENT"
  35667. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  35668. // "RESOURCE_NOT_DELETED"
  35669. // "SCHEMA_VALIDATION_IGNORED"
  35670. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  35671. // "UNDECLARED_PROPERTIES"
  35672. // "UNREACHABLE"
  35673. Code string `json:"code,omitempty"`
  35674. // Data: [Output Only] Metadata about this warning in key: value format.
  35675. // For example:
  35676. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  35677. Data []*UrlMapListWarningData `json:"data,omitempty"`
  35678. // Message: [Output Only] A human-readable description of the warning
  35679. // code.
  35680. Message string `json:"message,omitempty"`
  35681. // ForceSendFields is a list of field names (e.g. "Code") to
  35682. // unconditionally include in API requests. By default, fields with
  35683. // empty values are omitted from API requests. However, any non-pointer,
  35684. // non-interface field appearing in ForceSendFields will be sent to the
  35685. // server regardless of whether the field is empty or not. This may be
  35686. // used to include empty fields in Patch requests.
  35687. ForceSendFields []string `json:"-"`
  35688. // NullFields is a list of field names (e.g. "Code") to include in API
  35689. // requests with the JSON null value. By default, fields with empty
  35690. // values are omitted from API requests. However, any field with an
  35691. // empty value appearing in NullFields will be sent to the server as
  35692. // null. It is an error if a field in this list has a non-empty value.
  35693. // This may be used to include null fields in Patch requests.
  35694. NullFields []string `json:"-"`
  35695. }
  35696. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  35697. type NoMethod UrlMapListWarning
  35698. raw := NoMethod(*s)
  35699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35700. }
  35701. type UrlMapListWarningData struct {
  35702. // Key: [Output Only] A key that provides more detail on the warning
  35703. // being returned. For example, for warnings where there are no results
  35704. // in a list request for a particular zone, this key might be scope and
  35705. // the key value might be the zone name. Other examples might be a key
  35706. // indicating a deprecated resource and a suggested replacement, or a
  35707. // warning about invalid network settings (for example, if an instance
  35708. // attempts to perform IP forwarding but is not enabled for IP
  35709. // forwarding).
  35710. Key string `json:"key,omitempty"`
  35711. // Value: [Output Only] A warning data value corresponding to the key.
  35712. Value string `json:"value,omitempty"`
  35713. // ForceSendFields is a list of field names (e.g. "Key") to
  35714. // unconditionally include in API requests. By default, fields with
  35715. // empty values are omitted from API requests. However, any non-pointer,
  35716. // non-interface field appearing in ForceSendFields will be sent to the
  35717. // server regardless of whether the field is empty or not. This may be
  35718. // used to include empty fields in Patch requests.
  35719. ForceSendFields []string `json:"-"`
  35720. // NullFields is a list of field names (e.g. "Key") to include in API
  35721. // requests with the JSON null value. By default, fields with empty
  35722. // values are omitted from API requests. However, any field with an
  35723. // empty value appearing in NullFields will be sent to the server as
  35724. // null. It is an error if a field in this list has a non-empty value.
  35725. // This may be used to include null fields in Patch requests.
  35726. NullFields []string `json:"-"`
  35727. }
  35728. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  35729. type NoMethod UrlMapListWarningData
  35730. raw := NoMethod(*s)
  35731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35732. }
  35733. type UrlMapReference struct {
  35734. UrlMap string `json:"urlMap,omitempty"`
  35735. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  35736. // unconditionally include in API requests. By default, fields with
  35737. // empty values are omitted from API requests. However, any non-pointer,
  35738. // non-interface field appearing in ForceSendFields will be sent to the
  35739. // server regardless of whether the field is empty or not. This may be
  35740. // used to include empty fields in Patch requests.
  35741. ForceSendFields []string `json:"-"`
  35742. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  35743. // requests with the JSON null value. By default, fields with empty
  35744. // values are omitted from API requests. However, any field with an
  35745. // empty value appearing in NullFields will be sent to the server as
  35746. // null. It is an error if a field in this list has a non-empty value.
  35747. // This may be used to include null fields in Patch requests.
  35748. NullFields []string `json:"-"`
  35749. }
  35750. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  35751. type NoMethod UrlMapReference
  35752. raw := NoMethod(*s)
  35753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35754. }
  35755. // UrlMapTest: Message for the expected URL mappings.
  35756. type UrlMapTest struct {
  35757. // BackendServiceWeight: The weight to use for the supplied host and
  35758. // path when using advanced routing rules that involve traffic
  35759. // splitting.
  35760. BackendServiceWeight int64 `json:"backendServiceWeight,omitempty"`
  35761. // Description: Description of this test case.
  35762. Description string `json:"description,omitempty"`
  35763. // ExpectedUrlRedirect: The expected URL that should be redirected to
  35764. // for the host and path being tested.
  35765. ExpectedUrlRedirect string `json:"expectedUrlRedirect,omitempty"`
  35766. // Host: Host portion of the URL.
  35767. Host string `json:"host,omitempty"`
  35768. // Path: Path portion of the URL.
  35769. Path string `json:"path,omitempty"`
  35770. // Service: Expected BackendService resource the given URL should be
  35771. // mapped to.
  35772. Service string `json:"service,omitempty"`
  35773. // ForceSendFields is a list of field names (e.g.
  35774. // "BackendServiceWeight") to unconditionally include in API requests.
  35775. // By default, fields with empty values are omitted from API requests.
  35776. // However, any non-pointer, non-interface field appearing in
  35777. // ForceSendFields will be sent to the server regardless of whether the
  35778. // field is empty or not. This may be used to include empty fields in
  35779. // Patch requests.
  35780. ForceSendFields []string `json:"-"`
  35781. // NullFields is a list of field names (e.g. "BackendServiceWeight") to
  35782. // include in API requests with the JSON null value. By default, fields
  35783. // with empty values are omitted from API requests. However, any field
  35784. // with an empty value appearing in NullFields will be sent to the
  35785. // server as null. It is an error if a field in this list has a
  35786. // non-empty value. This may be used to include null fields in Patch
  35787. // requests.
  35788. NullFields []string `json:"-"`
  35789. }
  35790. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  35791. type NoMethod UrlMapTest
  35792. raw := NoMethod(*s)
  35793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35794. }
  35795. // UrlMapValidationResult: Message representing the validation result
  35796. // for a UrlMap.
  35797. type UrlMapValidationResult struct {
  35798. LoadErrors []string `json:"loadErrors,omitempty"`
  35799. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  35800. // If false, 'loadErrors' indicates the reasons.
  35801. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  35802. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  35803. // TestPassed: If successfully loaded, this field indicates whether the
  35804. // test passed. If false, 'testFailures's indicate the reason of
  35805. // failure.
  35806. TestPassed bool `json:"testPassed,omitempty"`
  35807. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  35808. // unconditionally include in API requests. By default, fields with
  35809. // empty values are omitted from API requests. However, any non-pointer,
  35810. // non-interface field appearing in ForceSendFields will be sent to the
  35811. // server regardless of whether the field is empty or not. This may be
  35812. // used to include empty fields in Patch requests.
  35813. ForceSendFields []string `json:"-"`
  35814. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  35815. // API requests with the JSON null value. By default, fields with empty
  35816. // values are omitted from API requests. However, any field with an
  35817. // empty value appearing in NullFields will be sent to the server as
  35818. // null. It is an error if a field in this list has a non-empty value.
  35819. // This may be used to include null fields in Patch requests.
  35820. NullFields []string `json:"-"`
  35821. }
  35822. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  35823. type NoMethod UrlMapValidationResult
  35824. raw := NoMethod(*s)
  35825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35826. }
  35827. type UrlMapsAggregatedList struct {
  35828. // Id: [Output Only] Unique identifier for the resource; defined by the
  35829. // server.
  35830. Id string `json:"id,omitempty"`
  35831. // Items: A list of UrlMapsScopedList resources.
  35832. Items map[string]UrlMapsScopedList `json:"items,omitempty"`
  35833. // Kind: Type of resource.
  35834. Kind string `json:"kind,omitempty"`
  35835. // NextPageToken: [Output Only] This token allows you to get the next
  35836. // page of results for list requests. If the number of results is larger
  35837. // than maxResults, use the nextPageToken as a value for the query
  35838. // parameter pageToken in the next list request. Subsequent list
  35839. // requests will have their own nextPageToken to continue paging through
  35840. // the results.
  35841. NextPageToken string `json:"nextPageToken,omitempty"`
  35842. // SelfLink: [Output Only] Server-defined URL for this resource.
  35843. SelfLink string `json:"selfLink,omitempty"`
  35844. // Warning: [Output Only] Informational warning message.
  35845. Warning *UrlMapsAggregatedListWarning `json:"warning,omitempty"`
  35846. // ServerResponse contains the HTTP response code and headers from the
  35847. // server.
  35848. googleapi.ServerResponse `json:"-"`
  35849. // ForceSendFields is a list of field names (e.g. "Id") to
  35850. // unconditionally include in API requests. By default, fields with
  35851. // empty values are omitted from API requests. However, any non-pointer,
  35852. // non-interface field appearing in ForceSendFields will be sent to the
  35853. // server regardless of whether the field is empty or not. This may be
  35854. // used to include empty fields in Patch requests.
  35855. ForceSendFields []string `json:"-"`
  35856. // NullFields is a list of field names (e.g. "Id") to include in API
  35857. // requests with the JSON null value. By default, fields with empty
  35858. // values are omitted from API requests. However, any field with an
  35859. // empty value appearing in NullFields will be sent to the server as
  35860. // null. It is an error if a field in this list has a non-empty value.
  35861. // This may be used to include null fields in Patch requests.
  35862. NullFields []string `json:"-"`
  35863. }
  35864. func (s *UrlMapsAggregatedList) MarshalJSON() ([]byte, error) {
  35865. type NoMethod UrlMapsAggregatedList
  35866. raw := NoMethod(*s)
  35867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35868. }
  35869. // UrlMapsAggregatedListWarning: [Output Only] Informational warning
  35870. // message.
  35871. type UrlMapsAggregatedListWarning struct {
  35872. // Code: [Output Only] A warning code, if applicable. For example,
  35873. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  35874. // the response.
  35875. //
  35876. // Possible values:
  35877. // "CLEANUP_FAILED"
  35878. // "DEPRECATED_RESOURCE_USED"
  35879. // "DEPRECATED_TYPE_USED"
  35880. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  35881. // "EXPERIMENTAL_TYPE_USED"
  35882. // "EXTERNAL_API_WARNING"
  35883. // "FIELD_VALUE_OVERRIDEN"
  35884. // "INJECTED_KERNELS_DEPRECATED"
  35885. // "MISSING_TYPE_DEPENDENCY"
  35886. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  35887. // "NEXT_HOP_CANNOT_IP_FORWARD"
  35888. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  35889. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  35890. // "NEXT_HOP_NOT_RUNNING"
  35891. // "NOT_CRITICAL_ERROR"
  35892. // "NO_RESULTS_ON_PAGE"
  35893. // "REQUIRED_TOS_AGREEMENT"
  35894. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  35895. // "RESOURCE_NOT_DELETED"
  35896. // "SCHEMA_VALIDATION_IGNORED"
  35897. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  35898. // "UNDECLARED_PROPERTIES"
  35899. // "UNREACHABLE"
  35900. Code string `json:"code,omitempty"`
  35901. // Data: [Output Only] Metadata about this warning in key: value format.
  35902. // For example:
  35903. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  35904. Data []*UrlMapsAggregatedListWarningData `json:"data,omitempty"`
  35905. // Message: [Output Only] A human-readable description of the warning
  35906. // code.
  35907. Message string `json:"message,omitempty"`
  35908. // ForceSendFields is a list of field names (e.g. "Code") to
  35909. // unconditionally include in API requests. By default, fields with
  35910. // empty values are omitted from API requests. However, any non-pointer,
  35911. // non-interface field appearing in ForceSendFields will be sent to the
  35912. // server regardless of whether the field is empty or not. This may be
  35913. // used to include empty fields in Patch requests.
  35914. ForceSendFields []string `json:"-"`
  35915. // NullFields is a list of field names (e.g. "Code") to include in API
  35916. // requests with the JSON null value. By default, fields with empty
  35917. // values are omitted from API requests. However, any field with an
  35918. // empty value appearing in NullFields will be sent to the server as
  35919. // null. It is an error if a field in this list has a non-empty value.
  35920. // This may be used to include null fields in Patch requests.
  35921. NullFields []string `json:"-"`
  35922. }
  35923. func (s *UrlMapsAggregatedListWarning) MarshalJSON() ([]byte, error) {
  35924. type NoMethod UrlMapsAggregatedListWarning
  35925. raw := NoMethod(*s)
  35926. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35927. }
  35928. type UrlMapsAggregatedListWarningData struct {
  35929. // Key: [Output Only] A key that provides more detail on the warning
  35930. // being returned. For example, for warnings where there are no results
  35931. // in a list request for a particular zone, this key might be scope and
  35932. // the key value might be the zone name. Other examples might be a key
  35933. // indicating a deprecated resource and a suggested replacement, or a
  35934. // warning about invalid network settings (for example, if an instance
  35935. // attempts to perform IP forwarding but is not enabled for IP
  35936. // forwarding).
  35937. Key string `json:"key,omitempty"`
  35938. // Value: [Output Only] A warning data value corresponding to the key.
  35939. Value string `json:"value,omitempty"`
  35940. // ForceSendFields is a list of field names (e.g. "Key") to
  35941. // unconditionally include in API requests. By default, fields with
  35942. // empty values are omitted from API requests. However, any non-pointer,
  35943. // non-interface field appearing in ForceSendFields will be sent to the
  35944. // server regardless of whether the field is empty or not. This may be
  35945. // used to include empty fields in Patch requests.
  35946. ForceSendFields []string `json:"-"`
  35947. // NullFields is a list of field names (e.g. "Key") to include in API
  35948. // requests with the JSON null value. By default, fields with empty
  35949. // values are omitted from API requests. However, any field with an
  35950. // empty value appearing in NullFields will be sent to the server as
  35951. // null. It is an error if a field in this list has a non-empty value.
  35952. // This may be used to include null fields in Patch requests.
  35953. NullFields []string `json:"-"`
  35954. }
  35955. func (s *UrlMapsAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  35956. type NoMethod UrlMapsAggregatedListWarningData
  35957. raw := NoMethod(*s)
  35958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35959. }
  35960. type UrlMapsScopedList struct {
  35961. // UrlMaps: A list of UrlMaps contained in this scope.
  35962. UrlMaps []*UrlMap `json:"urlMaps,omitempty"`
  35963. // Warning: Informational warning which replaces the list of backend
  35964. // services when the list is empty.
  35965. Warning *UrlMapsScopedListWarning `json:"warning,omitempty"`
  35966. // ForceSendFields is a list of field names (e.g. "UrlMaps") to
  35967. // unconditionally include in API requests. By default, fields with
  35968. // empty values are omitted from API requests. However, any non-pointer,
  35969. // non-interface field appearing in ForceSendFields will be sent to the
  35970. // server regardless of whether the field is empty or not. This may be
  35971. // used to include empty fields in Patch requests.
  35972. ForceSendFields []string `json:"-"`
  35973. // NullFields is a list of field names (e.g. "UrlMaps") to include in
  35974. // API requests with the JSON null value. By default, fields with empty
  35975. // values are omitted from API requests. However, any field with an
  35976. // empty value appearing in NullFields will be sent to the server as
  35977. // null. It is an error if a field in this list has a non-empty value.
  35978. // This may be used to include null fields in Patch requests.
  35979. NullFields []string `json:"-"`
  35980. }
  35981. func (s *UrlMapsScopedList) MarshalJSON() ([]byte, error) {
  35982. type NoMethod UrlMapsScopedList
  35983. raw := NoMethod(*s)
  35984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35985. }
  35986. // UrlMapsScopedListWarning: Informational warning which replaces the
  35987. // list of backend services when the list is empty.
  35988. type UrlMapsScopedListWarning struct {
  35989. // Code: [Output Only] A warning code, if applicable. For example,
  35990. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  35991. // the response.
  35992. //
  35993. // Possible values:
  35994. // "CLEANUP_FAILED"
  35995. // "DEPRECATED_RESOURCE_USED"
  35996. // "DEPRECATED_TYPE_USED"
  35997. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  35998. // "EXPERIMENTAL_TYPE_USED"
  35999. // "EXTERNAL_API_WARNING"
  36000. // "FIELD_VALUE_OVERRIDEN"
  36001. // "INJECTED_KERNELS_DEPRECATED"
  36002. // "MISSING_TYPE_DEPENDENCY"
  36003. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36004. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36005. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36006. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36007. // "NEXT_HOP_NOT_RUNNING"
  36008. // "NOT_CRITICAL_ERROR"
  36009. // "NO_RESULTS_ON_PAGE"
  36010. // "REQUIRED_TOS_AGREEMENT"
  36011. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36012. // "RESOURCE_NOT_DELETED"
  36013. // "SCHEMA_VALIDATION_IGNORED"
  36014. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36015. // "UNDECLARED_PROPERTIES"
  36016. // "UNREACHABLE"
  36017. Code string `json:"code,omitempty"`
  36018. // Data: [Output Only] Metadata about this warning in key: value format.
  36019. // For example:
  36020. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36021. Data []*UrlMapsScopedListWarningData `json:"data,omitempty"`
  36022. // Message: [Output Only] A human-readable description of the warning
  36023. // code.
  36024. Message string `json:"message,omitempty"`
  36025. // ForceSendFields is a list of field names (e.g. "Code") to
  36026. // unconditionally include in API requests. By default, fields with
  36027. // empty values are omitted from API requests. However, any non-pointer,
  36028. // non-interface field appearing in ForceSendFields will be sent to the
  36029. // server regardless of whether the field is empty or not. This may be
  36030. // used to include empty fields in Patch requests.
  36031. ForceSendFields []string `json:"-"`
  36032. // NullFields is a list of field names (e.g. "Code") to include in API
  36033. // requests with the JSON null value. By default, fields with empty
  36034. // values are omitted from API requests. However, any field with an
  36035. // empty value appearing in NullFields will be sent to the server as
  36036. // null. It is an error if a field in this list has a non-empty value.
  36037. // This may be used to include null fields in Patch requests.
  36038. NullFields []string `json:"-"`
  36039. }
  36040. func (s *UrlMapsScopedListWarning) MarshalJSON() ([]byte, error) {
  36041. type NoMethod UrlMapsScopedListWarning
  36042. raw := NoMethod(*s)
  36043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36044. }
  36045. type UrlMapsScopedListWarningData struct {
  36046. // Key: [Output Only] A key that provides more detail on the warning
  36047. // being returned. For example, for warnings where there are no results
  36048. // in a list request for a particular zone, this key might be scope and
  36049. // the key value might be the zone name. Other examples might be a key
  36050. // indicating a deprecated resource and a suggested replacement, or a
  36051. // warning about invalid network settings (for example, if an instance
  36052. // attempts to perform IP forwarding but is not enabled for IP
  36053. // forwarding).
  36054. Key string `json:"key,omitempty"`
  36055. // Value: [Output Only] A warning data value corresponding to the key.
  36056. Value string `json:"value,omitempty"`
  36057. // ForceSendFields is a list of field names (e.g. "Key") to
  36058. // unconditionally include in API requests. By default, fields with
  36059. // empty values are omitted from API requests. However, any non-pointer,
  36060. // non-interface field appearing in ForceSendFields will be sent to the
  36061. // server regardless of whether the field is empty or not. This may be
  36062. // used to include empty fields in Patch requests.
  36063. ForceSendFields []string `json:"-"`
  36064. // NullFields is a list of field names (e.g. "Key") to include in API
  36065. // requests with the JSON null value. By default, fields with empty
  36066. // values are omitted from API requests. However, any field with an
  36067. // empty value appearing in NullFields will be sent to the server as
  36068. // null. It is an error if a field in this list has a non-empty value.
  36069. // This may be used to include null fields in Patch requests.
  36070. NullFields []string `json:"-"`
  36071. }
  36072. func (s *UrlMapsScopedListWarningData) MarshalJSON() ([]byte, error) {
  36073. type NoMethod UrlMapsScopedListWarningData
  36074. raw := NoMethod(*s)
  36075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36076. }
  36077. type UrlMapsValidateRequest struct {
  36078. // Resource: Content of the UrlMap to be validated.
  36079. Resource *UrlMap `json:"resource,omitempty"`
  36080. // ForceSendFields is a list of field names (e.g. "Resource") to
  36081. // unconditionally include in API requests. By default, fields with
  36082. // empty values are omitted from API requests. However, any non-pointer,
  36083. // non-interface field appearing in ForceSendFields will be sent to the
  36084. // server regardless of whether the field is empty or not. This may be
  36085. // used to include empty fields in Patch requests.
  36086. ForceSendFields []string `json:"-"`
  36087. // NullFields is a list of field names (e.g. "Resource") to include in
  36088. // API requests with the JSON null value. By default, fields with empty
  36089. // values are omitted from API requests. However, any field with an
  36090. // empty value appearing in NullFields will be sent to the server as
  36091. // null. It is an error if a field in this list has a non-empty value.
  36092. // This may be used to include null fields in Patch requests.
  36093. NullFields []string `json:"-"`
  36094. }
  36095. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  36096. type NoMethod UrlMapsValidateRequest
  36097. raw := NoMethod(*s)
  36098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36099. }
  36100. type UrlMapsValidateResponse struct {
  36101. Result *UrlMapValidationResult `json:"result,omitempty"`
  36102. // ServerResponse contains the HTTP response code and headers from the
  36103. // server.
  36104. googleapi.ServerResponse `json:"-"`
  36105. // ForceSendFields is a list of field names (e.g. "Result") to
  36106. // unconditionally include in API requests. By default, fields with
  36107. // empty values are omitted from API requests. However, any non-pointer,
  36108. // non-interface field appearing in ForceSendFields will be sent to the
  36109. // server regardless of whether the field is empty or not. This may be
  36110. // used to include empty fields in Patch requests.
  36111. ForceSendFields []string `json:"-"`
  36112. // NullFields is a list of field names (e.g. "Result") to include in API
  36113. // requests with the JSON null value. By default, fields with empty
  36114. // values are omitted from API requests. However, any field with an
  36115. // empty value appearing in NullFields will be sent to the server as
  36116. // null. It is an error if a field in this list has a non-empty value.
  36117. // This may be used to include null fields in Patch requests.
  36118. NullFields []string `json:"-"`
  36119. }
  36120. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  36121. type NoMethod UrlMapsValidateResponse
  36122. raw := NoMethod(*s)
  36123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36124. }
  36125. // UrlRewrite: The spec for modifying the path before sending the
  36126. // request to the matched backend service.
  36127. type UrlRewrite struct {
  36128. // HostRewrite: Prior to forwarding the request to the selected service,
  36129. // the request's host header is replaced with contents of
  36130. // hostRewrite.
  36131. // The value must be between 1 and 255 characters.
  36132. HostRewrite string `json:"hostRewrite,omitempty"`
  36133. // PathPrefixRewrite: Prior to forwarding the request to the selected
  36134. // backend service, the matching portion of the request's path is
  36135. // replaced by pathPrefixRewrite.
  36136. // The value must be between 1 and 1024 characters.
  36137. PathPrefixRewrite string `json:"pathPrefixRewrite,omitempty"`
  36138. // ForceSendFields is a list of field names (e.g. "HostRewrite") to
  36139. // unconditionally include in API requests. By default, fields with
  36140. // empty values are omitted from API requests. However, any non-pointer,
  36141. // non-interface field appearing in ForceSendFields will be sent to the
  36142. // server regardless of whether the field is empty or not. This may be
  36143. // used to include empty fields in Patch requests.
  36144. ForceSendFields []string `json:"-"`
  36145. // NullFields is a list of field names (e.g. "HostRewrite") to include
  36146. // in API requests with the JSON null value. By default, fields with
  36147. // empty values are omitted from API requests. However, any field with
  36148. // an empty value appearing in NullFields will be sent to the server as
  36149. // null. It is an error if a field in this list has a non-empty value.
  36150. // This may be used to include null fields in Patch requests.
  36151. NullFields []string `json:"-"`
  36152. }
  36153. func (s *UrlRewrite) MarshalJSON() ([]byte, error) {
  36154. type NoMethod UrlRewrite
  36155. raw := NoMethod(*s)
  36156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36157. }
  36158. // UsableSubnetwork: Subnetwork which the current user has
  36159. // compute.subnetworks.use permission on.
  36160. type UsableSubnetwork struct {
  36161. // IpCidrRange: The range of internal addresses that are owned by this
  36162. // subnetwork.
  36163. IpCidrRange string `json:"ipCidrRange,omitempty"`
  36164. // Network: Network URL.
  36165. Network string `json:"network,omitempty"`
  36166. // SecondaryIpRanges: Secondary IP ranges.
  36167. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  36168. // Subnetwork: Subnetwork URL.
  36169. Subnetwork string `json:"subnetwork,omitempty"`
  36170. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  36171. // unconditionally include in API requests. By default, fields with
  36172. // empty values are omitted from API requests. However, any non-pointer,
  36173. // non-interface field appearing in ForceSendFields will be sent to the
  36174. // server regardless of whether the field is empty or not. This may be
  36175. // used to include empty fields in Patch requests.
  36176. ForceSendFields []string `json:"-"`
  36177. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  36178. // in API requests with the JSON null value. By default, fields with
  36179. // empty values are omitted from API requests. However, any field with
  36180. // an empty value appearing in NullFields will be sent to the server as
  36181. // null. It is an error if a field in this list has a non-empty value.
  36182. // This may be used to include null fields in Patch requests.
  36183. NullFields []string `json:"-"`
  36184. }
  36185. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  36186. type NoMethod UsableSubnetwork
  36187. raw := NoMethod(*s)
  36188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36189. }
  36190. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  36191. // subnetwork.
  36192. type UsableSubnetworkSecondaryRange struct {
  36193. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  36194. // secondary range.
  36195. IpCidrRange string `json:"ipCidrRange,omitempty"`
  36196. // RangeName: The name associated with this subnetwork secondary range,
  36197. // used when adding an alias IP range to a VM instance. The name must be
  36198. // 1-63 characters long, and comply with RFC1035. The name must be
  36199. // unique within the subnetwork.
  36200. RangeName string `json:"rangeName,omitempty"`
  36201. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  36202. // unconditionally include in API requests. By default, fields with
  36203. // empty values are omitted from API requests. However, any non-pointer,
  36204. // non-interface field appearing in ForceSendFields will be sent to the
  36205. // server regardless of whether the field is empty or not. This may be
  36206. // used to include empty fields in Patch requests.
  36207. ForceSendFields []string `json:"-"`
  36208. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  36209. // in API requests with the JSON null value. By default, fields with
  36210. // empty values are omitted from API requests. However, any field with
  36211. // an empty value appearing in NullFields will be sent to the server as
  36212. // null. It is an error if a field in this list has a non-empty value.
  36213. // This may be used to include null fields in Patch requests.
  36214. NullFields []string `json:"-"`
  36215. }
  36216. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  36217. type NoMethod UsableSubnetworkSecondaryRange
  36218. raw := NoMethod(*s)
  36219. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36220. }
  36221. type UsableSubnetworksAggregatedList struct {
  36222. // Id: [Output Only] The unique identifier for the resource. This
  36223. // identifier is defined by the server.
  36224. Id string `json:"id,omitempty"`
  36225. // Items: [Output] A list of usable subnetwork URLs.
  36226. Items []*UsableSubnetwork `json:"items,omitempty"`
  36227. // Kind: [Output Only] Type of resource. Always
  36228. // compute#usableSubnetworksAggregatedList for aggregated lists of
  36229. // usable subnetworks.
  36230. Kind string `json:"kind,omitempty"`
  36231. // NextPageToken: [Output Only] This token allows you to get the next
  36232. // page of results for list requests. If the number of results is larger
  36233. // than maxResults, use the nextPageToken as a value for the query
  36234. // parameter pageToken in the next list request. Subsequent list
  36235. // requests will have their own nextPageToken to continue paging through
  36236. // the results.
  36237. NextPageToken string `json:"nextPageToken,omitempty"`
  36238. // SelfLink: [Output Only] Server-defined URL for this resource.
  36239. SelfLink string `json:"selfLink,omitempty"`
  36240. // Warning: [Output Only] Informational warning message.
  36241. Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
  36242. // ServerResponse contains the HTTP response code and headers from the
  36243. // server.
  36244. googleapi.ServerResponse `json:"-"`
  36245. // ForceSendFields is a list of field names (e.g. "Id") to
  36246. // unconditionally include in API requests. By default, fields with
  36247. // empty values are omitted from API requests. However, any non-pointer,
  36248. // non-interface field appearing in ForceSendFields will be sent to the
  36249. // server regardless of whether the field is empty or not. This may be
  36250. // used to include empty fields in Patch requests.
  36251. ForceSendFields []string `json:"-"`
  36252. // NullFields is a list of field names (e.g. "Id") to include in API
  36253. // requests with the JSON null value. By default, fields with empty
  36254. // values are omitted from API requests. However, any field with an
  36255. // empty value appearing in NullFields will be sent to the server as
  36256. // null. It is an error if a field in this list has a non-empty value.
  36257. // This may be used to include null fields in Patch requests.
  36258. NullFields []string `json:"-"`
  36259. }
  36260. func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
  36261. type NoMethod UsableSubnetworksAggregatedList
  36262. raw := NoMethod(*s)
  36263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36264. }
  36265. // UsableSubnetworksAggregatedListWarning: [Output Only] Informational
  36266. // warning message.
  36267. type UsableSubnetworksAggregatedListWarning struct {
  36268. // Code: [Output Only] A warning code, if applicable. For example,
  36269. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  36270. // the response.
  36271. //
  36272. // Possible values:
  36273. // "CLEANUP_FAILED"
  36274. // "DEPRECATED_RESOURCE_USED"
  36275. // "DEPRECATED_TYPE_USED"
  36276. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  36277. // "EXPERIMENTAL_TYPE_USED"
  36278. // "EXTERNAL_API_WARNING"
  36279. // "FIELD_VALUE_OVERRIDEN"
  36280. // "INJECTED_KERNELS_DEPRECATED"
  36281. // "MISSING_TYPE_DEPENDENCY"
  36282. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36283. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36284. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36285. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36286. // "NEXT_HOP_NOT_RUNNING"
  36287. // "NOT_CRITICAL_ERROR"
  36288. // "NO_RESULTS_ON_PAGE"
  36289. // "REQUIRED_TOS_AGREEMENT"
  36290. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36291. // "RESOURCE_NOT_DELETED"
  36292. // "SCHEMA_VALIDATION_IGNORED"
  36293. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36294. // "UNDECLARED_PROPERTIES"
  36295. // "UNREACHABLE"
  36296. Code string `json:"code,omitempty"`
  36297. // Data: [Output Only] Metadata about this warning in key: value format.
  36298. // For example:
  36299. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36300. Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
  36301. // Message: [Output Only] A human-readable description of the warning
  36302. // code.
  36303. Message string `json:"message,omitempty"`
  36304. // ForceSendFields is a list of field names (e.g. "Code") to
  36305. // unconditionally include in API requests. By default, fields with
  36306. // empty values are omitted from API requests. However, any non-pointer,
  36307. // non-interface field appearing in ForceSendFields will be sent to the
  36308. // server regardless of whether the field is empty or not. This may be
  36309. // used to include empty fields in Patch requests.
  36310. ForceSendFields []string `json:"-"`
  36311. // NullFields is a list of field names (e.g. "Code") to include in API
  36312. // requests with the JSON null value. By default, fields with empty
  36313. // values are omitted from API requests. However, any field with an
  36314. // empty value appearing in NullFields will be sent to the server as
  36315. // null. It is an error if a field in this list has a non-empty value.
  36316. // This may be used to include null fields in Patch requests.
  36317. NullFields []string `json:"-"`
  36318. }
  36319. func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  36320. type NoMethod UsableSubnetworksAggregatedListWarning
  36321. raw := NoMethod(*s)
  36322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36323. }
  36324. type UsableSubnetworksAggregatedListWarningData struct {
  36325. // Key: [Output Only] A key that provides more detail on the warning
  36326. // being returned. For example, for warnings where there are no results
  36327. // in a list request for a particular zone, this key might be scope and
  36328. // the key value might be the zone name. Other examples might be a key
  36329. // indicating a deprecated resource and a suggested replacement, or a
  36330. // warning about invalid network settings (for example, if an instance
  36331. // attempts to perform IP forwarding but is not enabled for IP
  36332. // forwarding).
  36333. Key string `json:"key,omitempty"`
  36334. // Value: [Output Only] A warning data value corresponding to the key.
  36335. Value string `json:"value,omitempty"`
  36336. // ForceSendFields is a list of field names (e.g. "Key") to
  36337. // unconditionally include in API requests. By default, fields with
  36338. // empty values are omitted from API requests. However, any non-pointer,
  36339. // non-interface field appearing in ForceSendFields will be sent to the
  36340. // server regardless of whether the field is empty or not. This may be
  36341. // used to include empty fields in Patch requests.
  36342. ForceSendFields []string `json:"-"`
  36343. // NullFields is a list of field names (e.g. "Key") to include in API
  36344. // requests with the JSON null value. By default, fields with empty
  36345. // values are omitted from API requests. However, any field with an
  36346. // empty value appearing in NullFields will be sent to the server as
  36347. // null. It is an error if a field in this list has a non-empty value.
  36348. // This may be used to include null fields in Patch requests.
  36349. NullFields []string `json:"-"`
  36350. }
  36351. func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  36352. type NoMethod UsableSubnetworksAggregatedListWarningData
  36353. raw := NoMethod(*s)
  36354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36355. }
  36356. // UsageExportLocation: The location in Cloud Storage and naming method
  36357. // of the daily usage report. Contains bucket_name and report_name
  36358. // prefix.
  36359. type UsageExportLocation struct {
  36360. // BucketName: The name of an existing bucket in Cloud Storage where the
  36361. // usage report object is stored. The Google Service Account is granted
  36362. // write access to this bucket. This can either be the bucket name by
  36363. // itself, such as example-bucket, or the bucket name with gs:// or
  36364. // https://storage.googleapis.com/ in front of it, such as
  36365. // gs://example-bucket.
  36366. BucketName string `json:"bucketName,omitempty"`
  36367. // ReportNamePrefix: An optional prefix for the name of the usage report
  36368. // object stored in bucketName. If not supplied, defaults to usage. The
  36369. // report is stored as a CSV file named
  36370. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  36371. // usage according to Pacific Time. If you supply a prefix, it should
  36372. // conform to Cloud Storage object naming conventions.
  36373. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  36374. // ForceSendFields is a list of field names (e.g. "BucketName") to
  36375. // unconditionally include in API requests. By default, fields with
  36376. // empty values are omitted from API requests. However, any non-pointer,
  36377. // non-interface field appearing in ForceSendFields will be sent to the
  36378. // server regardless of whether the field is empty or not. This may be
  36379. // used to include empty fields in Patch requests.
  36380. ForceSendFields []string `json:"-"`
  36381. // NullFields is a list of field names (e.g. "BucketName") to include in
  36382. // API requests with the JSON null value. By default, fields with empty
  36383. // values are omitted from API requests. However, any field with an
  36384. // empty value appearing in NullFields will be sent to the server as
  36385. // null. It is an error if a field in this list has a non-empty value.
  36386. // This may be used to include null fields in Patch requests.
  36387. NullFields []string `json:"-"`
  36388. }
  36389. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  36390. type NoMethod UsageExportLocation
  36391. raw := NoMethod(*s)
  36392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36393. }
  36394. // VmEndpointNatMappings: Contain information of Nat mapping for a VM
  36395. // endpoint (i.e., NIC).
  36396. type VmEndpointNatMappings struct {
  36397. // InstanceName: Name of the VM instance which the endpoint belongs to
  36398. InstanceName string `json:"instanceName,omitempty"`
  36399. InterfaceNatMappings []*VmEndpointNatMappingsInterfaceNatMappings `json:"interfaceNatMappings,omitempty"`
  36400. // ForceSendFields is a list of field names (e.g. "InstanceName") to
  36401. // unconditionally include in API requests. By default, fields with
  36402. // empty values are omitted from API requests. However, any non-pointer,
  36403. // non-interface field appearing in ForceSendFields will be sent to the
  36404. // server regardless of whether the field is empty or not. This may be
  36405. // used to include empty fields in Patch requests.
  36406. ForceSendFields []string `json:"-"`
  36407. // NullFields is a list of field names (e.g. "InstanceName") to include
  36408. // in API requests with the JSON null value. By default, fields with
  36409. // empty values are omitted from API requests. However, any field with
  36410. // an empty value appearing in NullFields will be sent to the server as
  36411. // null. It is an error if a field in this list has a non-empty value.
  36412. // This may be used to include null fields in Patch requests.
  36413. NullFields []string `json:"-"`
  36414. }
  36415. func (s *VmEndpointNatMappings) MarshalJSON() ([]byte, error) {
  36416. type NoMethod VmEndpointNatMappings
  36417. raw := NoMethod(*s)
  36418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36419. }
  36420. // VmEndpointNatMappingsInterfaceNatMappings: Contain information of Nat
  36421. // mapping for an interface of this endpoint.
  36422. type VmEndpointNatMappingsInterfaceNatMappings struct {
  36423. // DrainNatIpPortRanges: List of all drain IP:port-range mappings
  36424. // assigned to this interface. These ranges are inclusive, that is, both
  36425. // the first and the last ports can be used for NAT. Example:
  36426. // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
  36427. DrainNatIpPortRanges []string `json:"drainNatIpPortRanges,omitempty"`
  36428. // NatIpPortRanges: A list of all IP:port-range mappings assigned to
  36429. // this interface. These ranges are inclusive, that is, both the first
  36430. // and the last ports can be used for NAT. Example:
  36431. // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
  36432. NatIpPortRanges []string `json:"natIpPortRanges,omitempty"`
  36433. // NumTotalDrainNatPorts: Total number of drain ports across all NAT IPs
  36434. // allocated to this interface. It equals to the aggregated port number
  36435. // in the field drain_nat_ip_port_ranges.
  36436. NumTotalDrainNatPorts int64 `json:"numTotalDrainNatPorts,omitempty"`
  36437. // NumTotalNatPorts: Total number of ports across all NAT IPs allocated
  36438. // to this interface. It equals to the aggregated port number in the
  36439. // field nat_ip_port_ranges.
  36440. NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"`
  36441. // SourceAliasIpRange: Alias IP range for this interface endpoint. It
  36442. // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or
  36443. // "192.168.5.0/24".
  36444. SourceAliasIpRange string `json:"sourceAliasIpRange,omitempty"`
  36445. // SourceVirtualIp: Primary IP of the VM for this NIC.
  36446. SourceVirtualIp string `json:"sourceVirtualIp,omitempty"`
  36447. // ForceSendFields is a list of field names (e.g.
  36448. // "DrainNatIpPortRanges") to unconditionally include in API requests.
  36449. // By default, fields with empty values are omitted from API requests.
  36450. // However, any non-pointer, non-interface field appearing in
  36451. // ForceSendFields will be sent to the server regardless of whether the
  36452. // field is empty or not. This may be used to include empty fields in
  36453. // Patch requests.
  36454. ForceSendFields []string `json:"-"`
  36455. // NullFields is a list of field names (e.g. "DrainNatIpPortRanges") to
  36456. // include in API requests with the JSON null value. By default, fields
  36457. // with empty values are omitted from API requests. However, any field
  36458. // with an empty value appearing in NullFields will be sent to the
  36459. // server as null. It is an error if a field in this list has a
  36460. // non-empty value. This may be used to include null fields in Patch
  36461. // requests.
  36462. NullFields []string `json:"-"`
  36463. }
  36464. func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error) {
  36465. type NoMethod VmEndpointNatMappingsInterfaceNatMappings
  36466. raw := NoMethod(*s)
  36467. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36468. }
  36469. // VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings.
  36470. type VmEndpointNatMappingsList struct {
  36471. // Id: [Output Only] The unique identifier for the resource. This
  36472. // identifier is defined by the server.
  36473. Id string `json:"id,omitempty"`
  36474. // Kind: [Output Only] Type of resource. Always
  36475. // compute#vmEndpointNatMappingsList for lists of Nat mappings of VM
  36476. // endpoints.
  36477. Kind string `json:"kind,omitempty"`
  36478. // NextPageToken: [Output Only] This token allows you to get the next
  36479. // page of results for list requests. If the number of results is larger
  36480. // than maxResults, use the nextPageToken as a value for the query
  36481. // parameter pageToken in the next list request. Subsequent list
  36482. // requests will have their own nextPageToken to continue paging through
  36483. // the results.
  36484. NextPageToken string `json:"nextPageToken,omitempty"`
  36485. // Result: [Output Only] A list of Nat mapping information of VM
  36486. // endpoints.
  36487. Result []*VmEndpointNatMappings `json:"result,omitempty"`
  36488. // SelfLink: [Output Only] Server-defined URL for this resource.
  36489. SelfLink string `json:"selfLink,omitempty"`
  36490. // Warning: [Output Only] Informational warning message.
  36491. Warning *VmEndpointNatMappingsListWarning `json:"warning,omitempty"`
  36492. // ServerResponse contains the HTTP response code and headers from the
  36493. // server.
  36494. googleapi.ServerResponse `json:"-"`
  36495. // ForceSendFields is a list of field names (e.g. "Id") to
  36496. // unconditionally include in API requests. By default, fields with
  36497. // empty values are omitted from API requests. However, any non-pointer,
  36498. // non-interface field appearing in ForceSendFields will be sent to the
  36499. // server regardless of whether the field is empty or not. This may be
  36500. // used to include empty fields in Patch requests.
  36501. ForceSendFields []string `json:"-"`
  36502. // NullFields is a list of field names (e.g. "Id") to include in API
  36503. // requests with the JSON null value. By default, fields with empty
  36504. // values are omitted from API requests. However, any field with an
  36505. // empty value appearing in NullFields will be sent to the server as
  36506. // null. It is an error if a field in this list has a non-empty value.
  36507. // This may be used to include null fields in Patch requests.
  36508. NullFields []string `json:"-"`
  36509. }
  36510. func (s *VmEndpointNatMappingsList) MarshalJSON() ([]byte, error) {
  36511. type NoMethod VmEndpointNatMappingsList
  36512. raw := NoMethod(*s)
  36513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36514. }
  36515. // VmEndpointNatMappingsListWarning: [Output Only] Informational warning
  36516. // message.
  36517. type VmEndpointNatMappingsListWarning struct {
  36518. // Code: [Output Only] A warning code, if applicable. For example,
  36519. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  36520. // the response.
  36521. //
  36522. // Possible values:
  36523. // "CLEANUP_FAILED"
  36524. // "DEPRECATED_RESOURCE_USED"
  36525. // "DEPRECATED_TYPE_USED"
  36526. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  36527. // "EXPERIMENTAL_TYPE_USED"
  36528. // "EXTERNAL_API_WARNING"
  36529. // "FIELD_VALUE_OVERRIDEN"
  36530. // "INJECTED_KERNELS_DEPRECATED"
  36531. // "MISSING_TYPE_DEPENDENCY"
  36532. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36533. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36534. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36535. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36536. // "NEXT_HOP_NOT_RUNNING"
  36537. // "NOT_CRITICAL_ERROR"
  36538. // "NO_RESULTS_ON_PAGE"
  36539. // "REQUIRED_TOS_AGREEMENT"
  36540. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36541. // "RESOURCE_NOT_DELETED"
  36542. // "SCHEMA_VALIDATION_IGNORED"
  36543. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36544. // "UNDECLARED_PROPERTIES"
  36545. // "UNREACHABLE"
  36546. Code string `json:"code,omitempty"`
  36547. // Data: [Output Only] Metadata about this warning in key: value format.
  36548. // For example:
  36549. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36550. Data []*VmEndpointNatMappingsListWarningData `json:"data,omitempty"`
  36551. // Message: [Output Only] A human-readable description of the warning
  36552. // code.
  36553. Message string `json:"message,omitempty"`
  36554. // ForceSendFields is a list of field names (e.g. "Code") to
  36555. // unconditionally include in API requests. By default, fields with
  36556. // empty values are omitted from API requests. However, any non-pointer,
  36557. // non-interface field appearing in ForceSendFields will be sent to the
  36558. // server regardless of whether the field is empty or not. This may be
  36559. // used to include empty fields in Patch requests.
  36560. ForceSendFields []string `json:"-"`
  36561. // NullFields is a list of field names (e.g. "Code") to include in API
  36562. // requests with the JSON null value. By default, fields with empty
  36563. // values are omitted from API requests. However, any field with an
  36564. // empty value appearing in NullFields will be sent to the server as
  36565. // null. It is an error if a field in this list has a non-empty value.
  36566. // This may be used to include null fields in Patch requests.
  36567. NullFields []string `json:"-"`
  36568. }
  36569. func (s *VmEndpointNatMappingsListWarning) MarshalJSON() ([]byte, error) {
  36570. type NoMethod VmEndpointNatMappingsListWarning
  36571. raw := NoMethod(*s)
  36572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36573. }
  36574. type VmEndpointNatMappingsListWarningData struct {
  36575. // Key: [Output Only] A key that provides more detail on the warning
  36576. // being returned. For example, for warnings where there are no results
  36577. // in a list request for a particular zone, this key might be scope and
  36578. // the key value might be the zone name. Other examples might be a key
  36579. // indicating a deprecated resource and a suggested replacement, or a
  36580. // warning about invalid network settings (for example, if an instance
  36581. // attempts to perform IP forwarding but is not enabled for IP
  36582. // forwarding).
  36583. Key string `json:"key,omitempty"`
  36584. // Value: [Output Only] A warning data value corresponding to the key.
  36585. Value string `json:"value,omitempty"`
  36586. // ForceSendFields is a list of field names (e.g. "Key") to
  36587. // unconditionally include in API requests. By default, fields with
  36588. // empty values are omitted from API requests. However, any non-pointer,
  36589. // non-interface field appearing in ForceSendFields will be sent to the
  36590. // server regardless of whether the field is empty or not. This may be
  36591. // used to include empty fields in Patch requests.
  36592. ForceSendFields []string `json:"-"`
  36593. // NullFields is a list of field names (e.g. "Key") to include in API
  36594. // requests with the JSON null value. By default, fields with empty
  36595. // values are omitted from API requests. However, any field with an
  36596. // empty value appearing in NullFields will be sent to the server as
  36597. // null. It is an error if a field in this list has a non-empty value.
  36598. // This may be used to include null fields in Patch requests.
  36599. NullFields []string `json:"-"`
  36600. }
  36601. func (s *VmEndpointNatMappingsListWarningData) MarshalJSON() ([]byte, error) {
  36602. type NoMethod VmEndpointNatMappingsListWarningData
  36603. raw := NoMethod(*s)
  36604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36605. }
  36606. // VpnGateway: Represents a VPN gateway resource.
  36607. type VpnGateway struct {
  36608. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  36609. // format.
  36610. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  36611. // Description: An optional description of this resource. Provide this
  36612. // property when you create the resource.
  36613. Description string `json:"description,omitempty"`
  36614. // Id: [Output Only] The unique identifier for the resource. This
  36615. // identifier is defined by the server.
  36616. Id uint64 `json:"id,omitempty,string"`
  36617. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  36618. // VPN gateways.
  36619. Kind string `json:"kind,omitempty"`
  36620. // LabelFingerprint: A fingerprint for the labels being applied to this
  36621. // VpnGateway, which is essentially a hash of the labels set used for
  36622. // optimistic locking. The fingerprint is initially generated by Compute
  36623. // Engine and changes after every request to modify or update labels.
  36624. // You must always provide an up-to-date fingerprint hash in order to
  36625. // update or change labels, otherwise the request will fail with error
  36626. // 412 conditionNotMet.
  36627. //
  36628. // To see the latest fingerprint, make a get() request to retrieve an
  36629. // VpnGateway.
  36630. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  36631. // Labels: Labels to apply to this VpnGateway resource. These can be
  36632. // later modified by the setLabels method. Each label key/value must
  36633. // comply with RFC1035. Label values may be empty.
  36634. Labels map[string]string `json:"labels,omitempty"`
  36635. // Name: Name of the resource. Provided by the client when the resource
  36636. // is created. The name must be 1-63 characters long, and comply with
  36637. // RFC1035. Specifically, the name must be 1-63 characters long and
  36638. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  36639. // the first character must be a lowercase letter, and all following
  36640. // characters must be a dash, lowercase letter, or digit, except the
  36641. // last character, which cannot be a dash.
  36642. Name string `json:"name,omitempty"`
  36643. // Network: URL of the network to which this VPN gateway is attached.
  36644. // Provided by the client when the VPN gateway is created.
  36645. Network string `json:"network,omitempty"`
  36646. // Region: [Output Only] URL of the region where the VPN gateway
  36647. // resides.
  36648. Region string `json:"region,omitempty"`
  36649. // SelfLink: [Output Only] Server-defined URL for the resource.
  36650. SelfLink string `json:"selfLink,omitempty"`
  36651. // VpnInterfaces: [Output Only] A list of interfaces on this VPN
  36652. // gateway.
  36653. VpnInterfaces []*VpnGatewayVpnGatewayInterface `json:"vpnInterfaces,omitempty"`
  36654. // ServerResponse contains the HTTP response code and headers from the
  36655. // server.
  36656. googleapi.ServerResponse `json:"-"`
  36657. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  36658. // to unconditionally include in API requests. By default, fields with
  36659. // empty values are omitted from API requests. However, any non-pointer,
  36660. // non-interface field appearing in ForceSendFields will be sent to the
  36661. // server regardless of whether the field is empty or not. This may be
  36662. // used to include empty fields in Patch requests.
  36663. ForceSendFields []string `json:"-"`
  36664. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  36665. // include in API requests with the JSON null value. By default, fields
  36666. // with empty values are omitted from API requests. However, any field
  36667. // with an empty value appearing in NullFields will be sent to the
  36668. // server as null. It is an error if a field in this list has a
  36669. // non-empty value. This may be used to include null fields in Patch
  36670. // requests.
  36671. NullFields []string `json:"-"`
  36672. }
  36673. func (s *VpnGateway) MarshalJSON() ([]byte, error) {
  36674. type NoMethod VpnGateway
  36675. raw := NoMethod(*s)
  36676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36677. }
  36678. type VpnGatewayAggregatedList struct {
  36679. // Id: [Output Only] Unique identifier for the resource; defined by the
  36680. // server.
  36681. Id string `json:"id,omitempty"`
  36682. // Items: A list of VpnGateway resources.
  36683. Items map[string]VpnGatewaysScopedList `json:"items,omitempty"`
  36684. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  36685. // VPN gateways.
  36686. Kind string `json:"kind,omitempty"`
  36687. // NextPageToken: [Output Only] This token allows you to get the next
  36688. // page of results for list requests. If the number of results is larger
  36689. // than maxResults, use the nextPageToken as a value for the query
  36690. // parameter pageToken in the next list request. Subsequent list
  36691. // requests will have their own nextPageToken to continue paging through
  36692. // the results.
  36693. NextPageToken string `json:"nextPageToken,omitempty"`
  36694. // SelfLink: [Output Only] Server-defined URL for this resource.
  36695. SelfLink string `json:"selfLink,omitempty"`
  36696. // Warning: [Output Only] Informational warning message.
  36697. Warning *VpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  36698. // ServerResponse contains the HTTP response code and headers from the
  36699. // server.
  36700. googleapi.ServerResponse `json:"-"`
  36701. // ForceSendFields is a list of field names (e.g. "Id") to
  36702. // unconditionally include in API requests. By default, fields with
  36703. // empty values are omitted from API requests. However, any non-pointer,
  36704. // non-interface field appearing in ForceSendFields will be sent to the
  36705. // server regardless of whether the field is empty or not. This may be
  36706. // used to include empty fields in Patch requests.
  36707. ForceSendFields []string `json:"-"`
  36708. // NullFields is a list of field names (e.g. "Id") to include in API
  36709. // requests with the JSON null value. By default, fields with empty
  36710. // values are omitted from API requests. However, any field with an
  36711. // empty value appearing in NullFields will be sent to the server as
  36712. // null. It is an error if a field in this list has a non-empty value.
  36713. // This may be used to include null fields in Patch requests.
  36714. NullFields []string `json:"-"`
  36715. }
  36716. func (s *VpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  36717. type NoMethod VpnGatewayAggregatedList
  36718. raw := NoMethod(*s)
  36719. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36720. }
  36721. // VpnGatewayAggregatedListWarning: [Output Only] Informational warning
  36722. // message.
  36723. type VpnGatewayAggregatedListWarning struct {
  36724. // Code: [Output Only] A warning code, if applicable. For example,
  36725. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  36726. // the response.
  36727. //
  36728. // Possible values:
  36729. // "CLEANUP_FAILED"
  36730. // "DEPRECATED_RESOURCE_USED"
  36731. // "DEPRECATED_TYPE_USED"
  36732. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  36733. // "EXPERIMENTAL_TYPE_USED"
  36734. // "EXTERNAL_API_WARNING"
  36735. // "FIELD_VALUE_OVERRIDEN"
  36736. // "INJECTED_KERNELS_DEPRECATED"
  36737. // "MISSING_TYPE_DEPENDENCY"
  36738. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36739. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36740. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36741. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36742. // "NEXT_HOP_NOT_RUNNING"
  36743. // "NOT_CRITICAL_ERROR"
  36744. // "NO_RESULTS_ON_PAGE"
  36745. // "REQUIRED_TOS_AGREEMENT"
  36746. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36747. // "RESOURCE_NOT_DELETED"
  36748. // "SCHEMA_VALIDATION_IGNORED"
  36749. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36750. // "UNDECLARED_PROPERTIES"
  36751. // "UNREACHABLE"
  36752. Code string `json:"code,omitempty"`
  36753. // Data: [Output Only] Metadata about this warning in key: value format.
  36754. // For example:
  36755. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36756. Data []*VpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  36757. // Message: [Output Only] A human-readable description of the warning
  36758. // code.
  36759. Message string `json:"message,omitempty"`
  36760. // ForceSendFields is a list of field names (e.g. "Code") to
  36761. // unconditionally include in API requests. By default, fields with
  36762. // empty values are omitted from API requests. However, any non-pointer,
  36763. // non-interface field appearing in ForceSendFields will be sent to the
  36764. // server regardless of whether the field is empty or not. This may be
  36765. // used to include empty fields in Patch requests.
  36766. ForceSendFields []string `json:"-"`
  36767. // NullFields is a list of field names (e.g. "Code") to include in API
  36768. // requests with the JSON null value. By default, fields with empty
  36769. // values are omitted from API requests. However, any field with an
  36770. // empty value appearing in NullFields will be sent to the server as
  36771. // null. It is an error if a field in this list has a non-empty value.
  36772. // This may be used to include null fields in Patch requests.
  36773. NullFields []string `json:"-"`
  36774. }
  36775. func (s *VpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  36776. type NoMethod VpnGatewayAggregatedListWarning
  36777. raw := NoMethod(*s)
  36778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36779. }
  36780. type VpnGatewayAggregatedListWarningData struct {
  36781. // Key: [Output Only] A key that provides more detail on the warning
  36782. // being returned. For example, for warnings where there are no results
  36783. // in a list request for a particular zone, this key might be scope and
  36784. // the key value might be the zone name. Other examples might be a key
  36785. // indicating a deprecated resource and a suggested replacement, or a
  36786. // warning about invalid network settings (for example, if an instance
  36787. // attempts to perform IP forwarding but is not enabled for IP
  36788. // forwarding).
  36789. Key string `json:"key,omitempty"`
  36790. // Value: [Output Only] A warning data value corresponding to the key.
  36791. Value string `json:"value,omitempty"`
  36792. // ForceSendFields is a list of field names (e.g. "Key") to
  36793. // unconditionally include in API requests. By default, fields with
  36794. // empty values are omitted from API requests. However, any non-pointer,
  36795. // non-interface field appearing in ForceSendFields will be sent to the
  36796. // server regardless of whether the field is empty or not. This may be
  36797. // used to include empty fields in Patch requests.
  36798. ForceSendFields []string `json:"-"`
  36799. // NullFields is a list of field names (e.g. "Key") to include in API
  36800. // requests with the JSON null value. By default, fields with empty
  36801. // values are omitted from API requests. However, any field with an
  36802. // empty value appearing in NullFields will be sent to the server as
  36803. // null. It is an error if a field in this list has a non-empty value.
  36804. // This may be used to include null fields in Patch requests.
  36805. NullFields []string `json:"-"`
  36806. }
  36807. func (s *VpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  36808. type NoMethod VpnGatewayAggregatedListWarningData
  36809. raw := NoMethod(*s)
  36810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36811. }
  36812. // VpnGatewayList: Contains a list of VpnGateway resources.
  36813. type VpnGatewayList struct {
  36814. // Id: [Output Only] Unique identifier for the resource; defined by the
  36815. // server.
  36816. Id string `json:"id,omitempty"`
  36817. // Items: A list of VpnGateway resources.
  36818. Items []*VpnGateway `json:"items,omitempty"`
  36819. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  36820. // VPN gateways.
  36821. Kind string `json:"kind,omitempty"`
  36822. // NextPageToken: [Output Only] This token allows you to get the next
  36823. // page of results for list requests. If the number of results is larger
  36824. // than maxResults, use the nextPageToken as a value for the query
  36825. // parameter pageToken in the next list request. Subsequent list
  36826. // requests will have their own nextPageToken to continue paging through
  36827. // the results.
  36828. NextPageToken string `json:"nextPageToken,omitempty"`
  36829. // SelfLink: [Output Only] Server-defined URL for this resource.
  36830. SelfLink string `json:"selfLink,omitempty"`
  36831. // Warning: [Output Only] Informational warning message.
  36832. Warning *VpnGatewayListWarning `json:"warning,omitempty"`
  36833. // ServerResponse contains the HTTP response code and headers from the
  36834. // server.
  36835. googleapi.ServerResponse `json:"-"`
  36836. // ForceSendFields is a list of field names (e.g. "Id") to
  36837. // unconditionally include in API requests. By default, fields with
  36838. // empty values are omitted from API requests. However, any non-pointer,
  36839. // non-interface field appearing in ForceSendFields will be sent to the
  36840. // server regardless of whether the field is empty or not. This may be
  36841. // used to include empty fields in Patch requests.
  36842. ForceSendFields []string `json:"-"`
  36843. // NullFields is a list of field names (e.g. "Id") to include in API
  36844. // requests with the JSON null value. By default, fields with empty
  36845. // values are omitted from API requests. However, any field with an
  36846. // empty value appearing in NullFields will be sent to the server as
  36847. // null. It is an error if a field in this list has a non-empty value.
  36848. // This may be used to include null fields in Patch requests.
  36849. NullFields []string `json:"-"`
  36850. }
  36851. func (s *VpnGatewayList) MarshalJSON() ([]byte, error) {
  36852. type NoMethod VpnGatewayList
  36853. raw := NoMethod(*s)
  36854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36855. }
  36856. // VpnGatewayListWarning: [Output Only] Informational warning message.
  36857. type VpnGatewayListWarning struct {
  36858. // Code: [Output Only] A warning code, if applicable. For example,
  36859. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  36860. // the response.
  36861. //
  36862. // Possible values:
  36863. // "CLEANUP_FAILED"
  36864. // "DEPRECATED_RESOURCE_USED"
  36865. // "DEPRECATED_TYPE_USED"
  36866. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  36867. // "EXPERIMENTAL_TYPE_USED"
  36868. // "EXTERNAL_API_WARNING"
  36869. // "FIELD_VALUE_OVERRIDEN"
  36870. // "INJECTED_KERNELS_DEPRECATED"
  36871. // "MISSING_TYPE_DEPENDENCY"
  36872. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36873. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36874. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36875. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36876. // "NEXT_HOP_NOT_RUNNING"
  36877. // "NOT_CRITICAL_ERROR"
  36878. // "NO_RESULTS_ON_PAGE"
  36879. // "REQUIRED_TOS_AGREEMENT"
  36880. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36881. // "RESOURCE_NOT_DELETED"
  36882. // "SCHEMA_VALIDATION_IGNORED"
  36883. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36884. // "UNDECLARED_PROPERTIES"
  36885. // "UNREACHABLE"
  36886. Code string `json:"code,omitempty"`
  36887. // Data: [Output Only] Metadata about this warning in key: value format.
  36888. // For example:
  36889. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36890. Data []*VpnGatewayListWarningData `json:"data,omitempty"`
  36891. // Message: [Output Only] A human-readable description of the warning
  36892. // code.
  36893. Message string `json:"message,omitempty"`
  36894. // ForceSendFields is a list of field names (e.g. "Code") to
  36895. // unconditionally include in API requests. By default, fields with
  36896. // empty values are omitted from API requests. However, any non-pointer,
  36897. // non-interface field appearing in ForceSendFields will be sent to the
  36898. // server regardless of whether the field is empty or not. This may be
  36899. // used to include empty fields in Patch requests.
  36900. ForceSendFields []string `json:"-"`
  36901. // NullFields is a list of field names (e.g. "Code") to include in API
  36902. // requests with the JSON null value. By default, fields with empty
  36903. // values are omitted from API requests. However, any field with an
  36904. // empty value appearing in NullFields will be sent to the server as
  36905. // null. It is an error if a field in this list has a non-empty value.
  36906. // This may be used to include null fields in Patch requests.
  36907. NullFields []string `json:"-"`
  36908. }
  36909. func (s *VpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  36910. type NoMethod VpnGatewayListWarning
  36911. raw := NoMethod(*s)
  36912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36913. }
  36914. type VpnGatewayListWarningData struct {
  36915. // Key: [Output Only] A key that provides more detail on the warning
  36916. // being returned. For example, for warnings where there are no results
  36917. // in a list request for a particular zone, this key might be scope and
  36918. // the key value might be the zone name. Other examples might be a key
  36919. // indicating a deprecated resource and a suggested replacement, or a
  36920. // warning about invalid network settings (for example, if an instance
  36921. // attempts to perform IP forwarding but is not enabled for IP
  36922. // forwarding).
  36923. Key string `json:"key,omitempty"`
  36924. // Value: [Output Only] A warning data value corresponding to the key.
  36925. Value string `json:"value,omitempty"`
  36926. // ForceSendFields is a list of field names (e.g. "Key") to
  36927. // unconditionally include in API requests. By default, fields with
  36928. // empty values are omitted from API requests. However, any non-pointer,
  36929. // non-interface field appearing in ForceSendFields will be sent to the
  36930. // server regardless of whether the field is empty or not. This may be
  36931. // used to include empty fields in Patch requests.
  36932. ForceSendFields []string `json:"-"`
  36933. // NullFields is a list of field names (e.g. "Key") to include in API
  36934. // requests with the JSON null value. By default, fields with empty
  36935. // values are omitted from API requests. However, any field with an
  36936. // empty value appearing in NullFields will be sent to the server as
  36937. // null. It is an error if a field in this list has a non-empty value.
  36938. // This may be used to include null fields in Patch requests.
  36939. NullFields []string `json:"-"`
  36940. }
  36941. func (s *VpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  36942. type NoMethod VpnGatewayListWarningData
  36943. raw := NoMethod(*s)
  36944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36945. }
  36946. type VpnGatewayStatus struct {
  36947. // VpnConnections: List of VPN connection for this VpnGateway.
  36948. VpnConnections []*VpnGatewayStatusVpnConnection `json:"vpnConnections,omitempty"`
  36949. // ForceSendFields is a list of field names (e.g. "VpnConnections") to
  36950. // unconditionally include in API requests. By default, fields with
  36951. // empty values are omitted from API requests. However, any non-pointer,
  36952. // non-interface field appearing in ForceSendFields will be sent to the
  36953. // server regardless of whether the field is empty or not. This may be
  36954. // used to include empty fields in Patch requests.
  36955. ForceSendFields []string `json:"-"`
  36956. // NullFields is a list of field names (e.g. "VpnConnections") to
  36957. // include in API requests with the JSON null value. By default, fields
  36958. // with empty values are omitted from API requests. However, any field
  36959. // with an empty value appearing in NullFields will be sent to the
  36960. // server as null. It is an error if a field in this list has a
  36961. // non-empty value. This may be used to include null fields in Patch
  36962. // requests.
  36963. NullFields []string `json:"-"`
  36964. }
  36965. func (s *VpnGatewayStatus) MarshalJSON() ([]byte, error) {
  36966. type NoMethod VpnGatewayStatus
  36967. raw := NoMethod(*s)
  36968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36969. }
  36970. // VpnGatewayStatusHighAvailabilityRequirementState: Describes the high
  36971. // availability requirement state for the VPN connection between this
  36972. // Cloud VPN gateway and a peer gateway.
  36973. type VpnGatewayStatusHighAvailabilityRequirementState struct {
  36974. // State: Indicates the high availability requirement state for the VPN
  36975. // connection. Valid values are CONNECTION_REDUNDANCY_MET,
  36976. // CONNECTION_REDUNDANCY_NOT_MET.
  36977. //
  36978. // Possible values:
  36979. // "CONNECTION_REDUNDANCY_MET"
  36980. // "CONNECTION_REDUNDANCY_NOT_MET"
  36981. State string `json:"state,omitempty"`
  36982. // UnsatisfiedReason: Indicates the reason why the VPN connection does
  36983. // not meet the high availability redundancy criteria/requirement. Valid
  36984. // values is INCOMPLETE_TUNNELS_COVERAGE.
  36985. //
  36986. // Possible values:
  36987. // "INCOMPLETE_TUNNELS_COVERAGE"
  36988. UnsatisfiedReason string `json:"unsatisfiedReason,omitempty"`
  36989. // ForceSendFields is a list of field names (e.g. "State") to
  36990. // unconditionally include in API requests. By default, fields with
  36991. // empty values are omitted from API requests. However, any non-pointer,
  36992. // non-interface field appearing in ForceSendFields will be sent to the
  36993. // server regardless of whether the field is empty or not. This may be
  36994. // used to include empty fields in Patch requests.
  36995. ForceSendFields []string `json:"-"`
  36996. // NullFields is a list of field names (e.g. "State") to include in API
  36997. // requests with the JSON null value. By default, fields with empty
  36998. // values are omitted from API requests. However, any field with an
  36999. // empty value appearing in NullFields will be sent to the server as
  37000. // null. It is an error if a field in this list has a non-empty value.
  37001. // This may be used to include null fields in Patch requests.
  37002. NullFields []string `json:"-"`
  37003. }
  37004. func (s *VpnGatewayStatusHighAvailabilityRequirementState) MarshalJSON() ([]byte, error) {
  37005. type NoMethod VpnGatewayStatusHighAvailabilityRequirementState
  37006. raw := NoMethod(*s)
  37007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37008. }
  37009. // VpnGatewayStatusTunnel: Contains some information about a VPN tunnel.
  37010. type VpnGatewayStatusTunnel struct {
  37011. // LocalGatewayInterface: The VPN gateway interface this VPN tunnel is
  37012. // associated with.
  37013. LocalGatewayInterface int64 `json:"localGatewayInterface,omitempty"`
  37014. // PeerGatewayInterface: The peer gateway interface this VPN tunnel is
  37015. // connected to, the peer gateway could either be an external VPN
  37016. // gateway or GCP VPN gateway.
  37017. PeerGatewayInterface int64 `json:"peerGatewayInterface,omitempty"`
  37018. // TunnelUrl: URL reference to the VPN tunnel.
  37019. TunnelUrl string `json:"tunnelUrl,omitempty"`
  37020. // ForceSendFields is a list of field names (e.g.
  37021. // "LocalGatewayInterface") to unconditionally include in API requests.
  37022. // By default, fields with empty values are omitted from API requests.
  37023. // However, any non-pointer, non-interface field appearing in
  37024. // ForceSendFields will be sent to the server regardless of whether the
  37025. // field is empty or not. This may be used to include empty fields in
  37026. // Patch requests.
  37027. ForceSendFields []string `json:"-"`
  37028. // NullFields is a list of field names (e.g. "LocalGatewayInterface") to
  37029. // include in API requests with the JSON null value. By default, fields
  37030. // with empty values are omitted from API requests. However, any field
  37031. // with an empty value appearing in NullFields will be sent to the
  37032. // server as null. It is an error if a field in this list has a
  37033. // non-empty value. This may be used to include null fields in Patch
  37034. // requests.
  37035. NullFields []string `json:"-"`
  37036. }
  37037. func (s *VpnGatewayStatusTunnel) MarshalJSON() ([]byte, error) {
  37038. type NoMethod VpnGatewayStatusTunnel
  37039. raw := NoMethod(*s)
  37040. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37041. }
  37042. // VpnGatewayStatusVpnConnection: A VPN connection contains all VPN
  37043. // tunnels connected from this VpnGateway to the same peer gateway. The
  37044. // peer gateway could either be a external VPN gateway or GCP VPN
  37045. // gateway.
  37046. type VpnGatewayStatusVpnConnection struct {
  37047. // PeerExternalGateway: URL reference to the peer external VPN gateways
  37048. // to which the VPN tunnels in this VPN connection are connected. This
  37049. // field is mutually exclusive with peer_gcp_gateway.
  37050. PeerExternalGateway string `json:"peerExternalGateway,omitempty"`
  37051. // PeerGcpGateway: URL reference to the peer side VPN gateways to which
  37052. // the VPN tunnels in this VPN connection are connected. This field is
  37053. // mutually exclusive with peer_gcp_gateway.
  37054. PeerGcpGateway string `json:"peerGcpGateway,omitempty"`
  37055. // State: HighAvailabilityRequirementState for the VPN connection.
  37056. State *VpnGatewayStatusHighAvailabilityRequirementState `json:"state,omitempty"`
  37057. // Tunnels: List of VPN tunnels that are in this VPN connection.
  37058. Tunnels []*VpnGatewayStatusTunnel `json:"tunnels,omitempty"`
  37059. // ForceSendFields is a list of field names (e.g. "PeerExternalGateway")
  37060. // to unconditionally include in API requests. By default, fields with
  37061. // empty values are omitted from API requests. However, any non-pointer,
  37062. // non-interface field appearing in ForceSendFields will be sent to the
  37063. // server regardless of whether the field is empty or not. This may be
  37064. // used to include empty fields in Patch requests.
  37065. ForceSendFields []string `json:"-"`
  37066. // NullFields is a list of field names (e.g. "PeerExternalGateway") to
  37067. // include in API requests with the JSON null value. By default, fields
  37068. // with empty values are omitted from API requests. However, any field
  37069. // with an empty value appearing in NullFields will be sent to the
  37070. // server as null. It is an error if a field in this list has a
  37071. // non-empty value. This may be used to include null fields in Patch
  37072. // requests.
  37073. NullFields []string `json:"-"`
  37074. }
  37075. func (s *VpnGatewayStatusVpnConnection) MarshalJSON() ([]byte, error) {
  37076. type NoMethod VpnGatewayStatusVpnConnection
  37077. raw := NoMethod(*s)
  37078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37079. }
  37080. // VpnGatewayVpnGatewayInterface: A VPN gateway interface.
  37081. type VpnGatewayVpnGatewayInterface struct {
  37082. // Id: The numeric ID of this VPN gateway interface.
  37083. Id int64 `json:"id,omitempty"`
  37084. // IpAddress: The external IP address for this VPN gateway interface.
  37085. IpAddress string `json:"ipAddress,omitempty"`
  37086. // ForceSendFields is a list of field names (e.g. "Id") to
  37087. // unconditionally include in API requests. By default, fields with
  37088. // empty values are omitted from API requests. However, any non-pointer,
  37089. // non-interface field appearing in ForceSendFields will be sent to the
  37090. // server regardless of whether the field is empty or not. This may be
  37091. // used to include empty fields in Patch requests.
  37092. ForceSendFields []string `json:"-"`
  37093. // NullFields is a list of field names (e.g. "Id") to include in API
  37094. // requests with the JSON null value. By default, fields with empty
  37095. // values are omitted from API requests. However, any field with an
  37096. // empty value appearing in NullFields will be sent to the server as
  37097. // null. It is an error if a field in this list has a non-empty value.
  37098. // This may be used to include null fields in Patch requests.
  37099. NullFields []string `json:"-"`
  37100. }
  37101. func (s *VpnGatewayVpnGatewayInterface) MarshalJSON() ([]byte, error) {
  37102. type NoMethod VpnGatewayVpnGatewayInterface
  37103. raw := NoMethod(*s)
  37104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37105. }
  37106. type VpnGatewaysGetStatusResponse struct {
  37107. Result *VpnGatewayStatus `json:"result,omitempty"`
  37108. // ServerResponse contains the HTTP response code and headers from the
  37109. // server.
  37110. googleapi.ServerResponse `json:"-"`
  37111. // ForceSendFields is a list of field names (e.g. "Result") to
  37112. // unconditionally include in API requests. By default, fields with
  37113. // empty values are omitted from API requests. However, any non-pointer,
  37114. // non-interface field appearing in ForceSendFields will be sent to the
  37115. // server regardless of whether the field is empty or not. This may be
  37116. // used to include empty fields in Patch requests.
  37117. ForceSendFields []string `json:"-"`
  37118. // NullFields is a list of field names (e.g. "Result") to include in API
  37119. // requests with the JSON null value. By default, fields with empty
  37120. // values are omitted from API requests. However, any field with an
  37121. // empty value appearing in NullFields will be sent to the server as
  37122. // null. It is an error if a field in this list has a non-empty value.
  37123. // This may be used to include null fields in Patch requests.
  37124. NullFields []string `json:"-"`
  37125. }
  37126. func (s *VpnGatewaysGetStatusResponse) MarshalJSON() ([]byte, error) {
  37127. type NoMethod VpnGatewaysGetStatusResponse
  37128. raw := NoMethod(*s)
  37129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37130. }
  37131. type VpnGatewaysScopedList struct {
  37132. // VpnGateways: [Output Only] A list of VPN gateways contained in this
  37133. // scope.
  37134. VpnGateways []*VpnGateway `json:"vpnGateways,omitempty"`
  37135. // Warning: [Output Only] Informational warning which replaces the list
  37136. // of addresses when the list is empty.
  37137. Warning *VpnGatewaysScopedListWarning `json:"warning,omitempty"`
  37138. // ForceSendFields is a list of field names (e.g. "VpnGateways") to
  37139. // unconditionally include in API requests. By default, fields with
  37140. // empty values are omitted from API requests. However, any non-pointer,
  37141. // non-interface field appearing in ForceSendFields will be sent to the
  37142. // server regardless of whether the field is empty or not. This may be
  37143. // used to include empty fields in Patch requests.
  37144. ForceSendFields []string `json:"-"`
  37145. // NullFields is a list of field names (e.g. "VpnGateways") to include
  37146. // in API requests with the JSON null value. By default, fields with
  37147. // empty values are omitted from API requests. However, any field with
  37148. // an empty value appearing in NullFields will be sent to the server as
  37149. // null. It is an error if a field in this list has a non-empty value.
  37150. // This may be used to include null fields in Patch requests.
  37151. NullFields []string `json:"-"`
  37152. }
  37153. func (s *VpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  37154. type NoMethod VpnGatewaysScopedList
  37155. raw := NoMethod(*s)
  37156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37157. }
  37158. // VpnGatewaysScopedListWarning: [Output Only] Informational warning
  37159. // which replaces the list of addresses when the list is empty.
  37160. type VpnGatewaysScopedListWarning struct {
  37161. // Code: [Output Only] A warning code, if applicable. For example,
  37162. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  37163. // the response.
  37164. //
  37165. // Possible values:
  37166. // "CLEANUP_FAILED"
  37167. // "DEPRECATED_RESOURCE_USED"
  37168. // "DEPRECATED_TYPE_USED"
  37169. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  37170. // "EXPERIMENTAL_TYPE_USED"
  37171. // "EXTERNAL_API_WARNING"
  37172. // "FIELD_VALUE_OVERRIDEN"
  37173. // "INJECTED_KERNELS_DEPRECATED"
  37174. // "MISSING_TYPE_DEPENDENCY"
  37175. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  37176. // "NEXT_HOP_CANNOT_IP_FORWARD"
  37177. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  37178. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  37179. // "NEXT_HOP_NOT_RUNNING"
  37180. // "NOT_CRITICAL_ERROR"
  37181. // "NO_RESULTS_ON_PAGE"
  37182. // "REQUIRED_TOS_AGREEMENT"
  37183. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  37184. // "RESOURCE_NOT_DELETED"
  37185. // "SCHEMA_VALIDATION_IGNORED"
  37186. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  37187. // "UNDECLARED_PROPERTIES"
  37188. // "UNREACHABLE"
  37189. Code string `json:"code,omitempty"`
  37190. // Data: [Output Only] Metadata about this warning in key: value format.
  37191. // For example:
  37192. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  37193. Data []*VpnGatewaysScopedListWarningData `json:"data,omitempty"`
  37194. // Message: [Output Only] A human-readable description of the warning
  37195. // code.
  37196. Message string `json:"message,omitempty"`
  37197. // ForceSendFields is a list of field names (e.g. "Code") to
  37198. // unconditionally include in API requests. By default, fields with
  37199. // empty values are omitted from API requests. However, any non-pointer,
  37200. // non-interface field appearing in ForceSendFields will be sent to the
  37201. // server regardless of whether the field is empty or not. This may be
  37202. // used to include empty fields in Patch requests.
  37203. ForceSendFields []string `json:"-"`
  37204. // NullFields is a list of field names (e.g. "Code") to include in API
  37205. // requests with the JSON null value. By default, fields with empty
  37206. // values are omitted from API requests. However, any field with an
  37207. // empty value appearing in NullFields will be sent to the server as
  37208. // null. It is an error if a field in this list has a non-empty value.
  37209. // This may be used to include null fields in Patch requests.
  37210. NullFields []string `json:"-"`
  37211. }
  37212. func (s *VpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  37213. type NoMethod VpnGatewaysScopedListWarning
  37214. raw := NoMethod(*s)
  37215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37216. }
  37217. type VpnGatewaysScopedListWarningData struct {
  37218. // Key: [Output Only] A key that provides more detail on the warning
  37219. // being returned. For example, for warnings where there are no results
  37220. // in a list request for a particular zone, this key might be scope and
  37221. // the key value might be the zone name. Other examples might be a key
  37222. // indicating a deprecated resource and a suggested replacement, or a
  37223. // warning about invalid network settings (for example, if an instance
  37224. // attempts to perform IP forwarding but is not enabled for IP
  37225. // forwarding).
  37226. Key string `json:"key,omitempty"`
  37227. // Value: [Output Only] A warning data value corresponding to the key.
  37228. Value string `json:"value,omitempty"`
  37229. // ForceSendFields is a list of field names (e.g. "Key") to
  37230. // unconditionally include in API requests. By default, fields with
  37231. // empty values are omitted from API requests. However, any non-pointer,
  37232. // non-interface field appearing in ForceSendFields will be sent to the
  37233. // server regardless of whether the field is empty or not. This may be
  37234. // used to include empty fields in Patch requests.
  37235. ForceSendFields []string `json:"-"`
  37236. // NullFields is a list of field names (e.g. "Key") to include in API
  37237. // requests with the JSON null value. By default, fields with empty
  37238. // values are omitted from API requests. However, any field with an
  37239. // empty value appearing in NullFields will be sent to the server as
  37240. // null. It is an error if a field in this list has a non-empty value.
  37241. // This may be used to include null fields in Patch requests.
  37242. NullFields []string `json:"-"`
  37243. }
  37244. func (s *VpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  37245. type NoMethod VpnGatewaysScopedListWarningData
  37246. raw := NoMethod(*s)
  37247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37248. }
  37249. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  37250. // (== resource_for v1.vpnTunnels ==)
  37251. type VpnTunnel struct {
  37252. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  37253. // format.
  37254. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  37255. // Description: An optional description of this resource. Provide this
  37256. // property when you create the resource.
  37257. Description string `json:"description,omitempty"`
  37258. // DetailedStatus: [Output Only] Detailed status message for the VPN
  37259. // tunnel.
  37260. DetailedStatus string `json:"detailedStatus,omitempty"`
  37261. // Id: [Output Only] The unique identifier for the resource. This
  37262. // identifier is defined by the server.
  37263. Id uint64 `json:"id,omitempty,string"`
  37264. // IkeVersion: IKE protocol version to use when establishing the VPN
  37265. // tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2.
  37266. // The default version is 2.
  37267. IkeVersion int64 `json:"ikeVersion,omitempty"`
  37268. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  37269. // VPN tunnels.
  37270. Kind string `json:"kind,omitempty"`
  37271. // LabelFingerprint: A fingerprint for the labels being applied to this
  37272. // VpnTunnel, which is essentially a hash of the labels set used for
  37273. // optimistic locking. The fingerprint is initially generated by Compute
  37274. // Engine and changes after every request to modify or update labels.
  37275. // You must always provide an up-to-date fingerprint hash in order to
  37276. // update or change labels, otherwise the request will fail with error
  37277. // 412 conditionNotMet.
  37278. //
  37279. // To see the latest fingerprint, make a get() request to retrieve a
  37280. // VpnTunnel.
  37281. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  37282. // Labels: Labels to apply to this VpnTunnel. These can be later
  37283. // modified by the setLabels method. Each label key/value pair must
  37284. // comply with RFC1035. Label values may be empty.
  37285. Labels map[string]string `json:"labels,omitempty"`
  37286. // LocalTrafficSelector: Local traffic selector to use when establishing
  37287. // the VPN tunnel with the peer VPN gateway. The value should be a CIDR
  37288. // formatted string, for example: 192.168.0.0/16. The ranges must be
  37289. // disjoint. Only IPv4 is supported.
  37290. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  37291. // Name: Name of the resource. Provided by the client when the resource
  37292. // is created. The name must be 1-63 characters long, and comply with
  37293. // RFC1035. Specifically, the name must be 1-63 characters long and
  37294. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  37295. // the first character must be a lowercase letter, and all following
  37296. // characters must be a dash, lowercase letter, or digit, except the
  37297. // last character, which cannot be a dash.
  37298. Name string `json:"name,omitempty"`
  37299. // PeerExternalGateway: URL of the peer side external VPN gateway to
  37300. // which this VPN tunnel is connected. Provided by the client when the
  37301. // VPN tunnel is created. This field is exclusive with the field
  37302. // peerGcpGateway.
  37303. PeerExternalGateway string `json:"peerExternalGateway,omitempty"`
  37304. // PeerExternalGatewayInterface: The interface ID of the external VPN
  37305. // gateway to which this VPN tunnel is connected. Provided by the client
  37306. // when the VPN tunnel is created.
  37307. PeerExternalGatewayInterface int64 `json:"peerExternalGatewayInterface,omitempty"`
  37308. // PeerGcpGateway: URL of the peer side HA GCP VPN gateway to which this
  37309. // VPN tunnel is connected. Provided by the client when the VPN tunnel
  37310. // is created. This field can be used when creating highly available VPN
  37311. // from VPC network to VPC network, the field is exclusive with the
  37312. // field peerExternalGateway. If provided, the VPN tunnel will
  37313. // automatically use the same vpnGatewayInterface ID in the peer GCP VPN
  37314. // gateway.
  37315. PeerGcpGateway string `json:"peerGcpGateway,omitempty"`
  37316. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  37317. PeerIp string `json:"peerIp,omitempty"`
  37318. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  37319. // You must specify this field as part of the HTTP request URL. It is
  37320. // not settable as a field in the request body.
  37321. Region string `json:"region,omitempty"`
  37322. // RemoteTrafficSelector: Remote traffic selectors to use when
  37323. // establishing the VPN tunnel with the peer VPN gateway. The value
  37324. // should be a CIDR formatted string, for example: 192.168.0.0/16. The
  37325. // ranges should be disjoint. Only IPv4 is supported.
  37326. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  37327. // Router: URL of the router resource to be used for dynamic routing.
  37328. Router string `json:"router,omitempty"`
  37329. // SelfLink: [Output Only] Server-defined URL for the resource.
  37330. SelfLink string `json:"selfLink,omitempty"`
  37331. // SharedSecret: Shared secret used to set the secure session between
  37332. // the Cloud VPN gateway and the peer VPN gateway.
  37333. SharedSecret string `json:"sharedSecret,omitempty"`
  37334. // SharedSecretHash: Hash of the shared secret.
  37335. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  37336. // Status: [Output Only] The status of the VPN tunnel, which can be one
  37337. // of the following:
  37338. // - PROVISIONING: Resource is being allocated for the VPN tunnel.
  37339. // - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs
  37340. // from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule,
  37341. // and Route resources are needed to setup the VPN tunnel.
  37342. // - FIRST_HANDSHAKE: Successful first handshake with the peer VPN.
  37343. // - ESTABLISHED: Secure session is successfully established with the
  37344. // peer VPN.
  37345. // - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS
  37346. // - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret).
  37347. //
  37348. // - NEGOTIATION_FAILURE: Handshake failed.
  37349. // - DEPROVISIONING: Resources are being deallocated for the VPN tunnel.
  37350. //
  37351. // - FAILED: Tunnel creation has failed and the tunnel is not ready to
  37352. // be used.
  37353. //
  37354. // Possible values:
  37355. // "ALLOCATING_RESOURCES"
  37356. // "AUTHORIZATION_ERROR"
  37357. // "DEPROVISIONING"
  37358. // "ESTABLISHED"
  37359. // "FAILED"
  37360. // "FIRST_HANDSHAKE"
  37361. // "NEGOTIATION_FAILURE"
  37362. // "NETWORK_ERROR"
  37363. // "NO_INCOMING_PACKETS"
  37364. // "PROVISIONING"
  37365. // "REJECTED"
  37366. // "WAITING_FOR_FULL_CONFIG"
  37367. Status string `json:"status,omitempty"`
  37368. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  37369. // tunnel is associated. Provided by the client when the VPN tunnel is
  37370. // created.
  37371. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  37372. // VpnGateway: URL of the VPN gateway with which this VPN tunnel is
  37373. // associated. Provided by the client when the VPN tunnel is created.
  37374. // This must be used (instead of target_vpn_gateway) if a High
  37375. // Availability VPN gateway resource is created.
  37376. VpnGateway string `json:"vpnGateway,omitempty"`
  37377. // VpnGatewayInterface: The interface ID of the VPN gateway with which
  37378. // this VPN tunnel is associated.
  37379. VpnGatewayInterface int64 `json:"vpnGatewayInterface,omitempty"`
  37380. // ServerResponse contains the HTTP response code and headers from the
  37381. // server.
  37382. googleapi.ServerResponse `json:"-"`
  37383. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  37384. // to unconditionally include in API requests. By default, fields with
  37385. // empty values are omitted from API requests. However, any non-pointer,
  37386. // non-interface field appearing in ForceSendFields will be sent to the
  37387. // server regardless of whether the field is empty or not. This may be
  37388. // used to include empty fields in Patch requests.
  37389. ForceSendFields []string `json:"-"`
  37390. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  37391. // include in API requests with the JSON null value. By default, fields
  37392. // with empty values are omitted from API requests. However, any field
  37393. // with an empty value appearing in NullFields will be sent to the
  37394. // server as null. It is an error if a field in this list has a
  37395. // non-empty value. This may be used to include null fields in Patch
  37396. // requests.
  37397. NullFields []string `json:"-"`
  37398. }
  37399. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  37400. type NoMethod VpnTunnel
  37401. raw := NoMethod(*s)
  37402. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37403. }
  37404. type VpnTunnelAggregatedList struct {
  37405. // Id: [Output Only] Unique identifier for the resource; defined by the
  37406. // server.
  37407. Id string `json:"id,omitempty"`
  37408. // Items: A list of VpnTunnelsScopedList resources.
  37409. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  37410. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  37411. // VPN tunnels.
  37412. Kind string `json:"kind,omitempty"`
  37413. // NextPageToken: [Output Only] This token allows you to get the next
  37414. // page of results for list requests. If the number of results is larger
  37415. // than maxResults, use the nextPageToken as a value for the query
  37416. // parameter pageToken in the next list request. Subsequent list
  37417. // requests will have their own nextPageToken to continue paging through
  37418. // the results.
  37419. NextPageToken string `json:"nextPageToken,omitempty"`
  37420. // SelfLink: [Output Only] Server-defined URL for this resource.
  37421. SelfLink string `json:"selfLink,omitempty"`
  37422. // Warning: [Output Only] Informational warning message.
  37423. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  37424. // ServerResponse contains the HTTP response code and headers from the
  37425. // server.
  37426. googleapi.ServerResponse `json:"-"`
  37427. // ForceSendFields is a list of field names (e.g. "Id") to
  37428. // unconditionally include in API requests. By default, fields with
  37429. // empty values are omitted from API requests. However, any non-pointer,
  37430. // non-interface field appearing in ForceSendFields will be sent to the
  37431. // server regardless of whether the field is empty or not. This may be
  37432. // used to include empty fields in Patch requests.
  37433. ForceSendFields []string `json:"-"`
  37434. // NullFields is a list of field names (e.g. "Id") to include in API
  37435. // requests with the JSON null value. By default, fields with empty
  37436. // values are omitted from API requests. However, any field with an
  37437. // empty value appearing in NullFields will be sent to the server as
  37438. // null. It is an error if a field in this list has a non-empty value.
  37439. // This may be used to include null fields in Patch requests.
  37440. NullFields []string `json:"-"`
  37441. }
  37442. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  37443. type NoMethod VpnTunnelAggregatedList
  37444. raw := NoMethod(*s)
  37445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37446. }
  37447. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  37448. // message.
  37449. type VpnTunnelAggregatedListWarning struct {
  37450. // Code: [Output Only] A warning code, if applicable. For example,
  37451. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  37452. // the response.
  37453. //
  37454. // Possible values:
  37455. // "CLEANUP_FAILED"
  37456. // "DEPRECATED_RESOURCE_USED"
  37457. // "DEPRECATED_TYPE_USED"
  37458. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  37459. // "EXPERIMENTAL_TYPE_USED"
  37460. // "EXTERNAL_API_WARNING"
  37461. // "FIELD_VALUE_OVERRIDEN"
  37462. // "INJECTED_KERNELS_DEPRECATED"
  37463. // "MISSING_TYPE_DEPENDENCY"
  37464. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  37465. // "NEXT_HOP_CANNOT_IP_FORWARD"
  37466. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  37467. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  37468. // "NEXT_HOP_NOT_RUNNING"
  37469. // "NOT_CRITICAL_ERROR"
  37470. // "NO_RESULTS_ON_PAGE"
  37471. // "REQUIRED_TOS_AGREEMENT"
  37472. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  37473. // "RESOURCE_NOT_DELETED"
  37474. // "SCHEMA_VALIDATION_IGNORED"
  37475. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  37476. // "UNDECLARED_PROPERTIES"
  37477. // "UNREACHABLE"
  37478. Code string `json:"code,omitempty"`
  37479. // Data: [Output Only] Metadata about this warning in key: value format.
  37480. // For example:
  37481. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  37482. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  37483. // Message: [Output Only] A human-readable description of the warning
  37484. // code.
  37485. Message string `json:"message,omitempty"`
  37486. // ForceSendFields is a list of field names (e.g. "Code") to
  37487. // unconditionally include in API requests. By default, fields with
  37488. // empty values are omitted from API requests. However, any non-pointer,
  37489. // non-interface field appearing in ForceSendFields will be sent to the
  37490. // server regardless of whether the field is empty or not. This may be
  37491. // used to include empty fields in Patch requests.
  37492. ForceSendFields []string `json:"-"`
  37493. // NullFields is a list of field names (e.g. "Code") to include in API
  37494. // requests with the JSON null value. By default, fields with empty
  37495. // values are omitted from API requests. However, any field with an
  37496. // empty value appearing in NullFields will be sent to the server as
  37497. // null. It is an error if a field in this list has a non-empty value.
  37498. // This may be used to include null fields in Patch requests.
  37499. NullFields []string `json:"-"`
  37500. }
  37501. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  37502. type NoMethod VpnTunnelAggregatedListWarning
  37503. raw := NoMethod(*s)
  37504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37505. }
  37506. type VpnTunnelAggregatedListWarningData struct {
  37507. // Key: [Output Only] A key that provides more detail on the warning
  37508. // being returned. For example, for warnings where there are no results
  37509. // in a list request for a particular zone, this key might be scope and
  37510. // the key value might be the zone name. Other examples might be a key
  37511. // indicating a deprecated resource and a suggested replacement, or a
  37512. // warning about invalid network settings (for example, if an instance
  37513. // attempts to perform IP forwarding but is not enabled for IP
  37514. // forwarding).
  37515. Key string `json:"key,omitempty"`
  37516. // Value: [Output Only] A warning data value corresponding to the key.
  37517. Value string `json:"value,omitempty"`
  37518. // ForceSendFields is a list of field names (e.g. "Key") to
  37519. // unconditionally include in API requests. By default, fields with
  37520. // empty values are omitted from API requests. However, any non-pointer,
  37521. // non-interface field appearing in ForceSendFields will be sent to the
  37522. // server regardless of whether the field is empty or not. This may be
  37523. // used to include empty fields in Patch requests.
  37524. ForceSendFields []string `json:"-"`
  37525. // NullFields is a list of field names (e.g. "Key") to include in API
  37526. // requests with the JSON null value. By default, fields with empty
  37527. // values are omitted from API requests. However, any field with an
  37528. // empty value appearing in NullFields will be sent to the server as
  37529. // null. It is an error if a field in this list has a non-empty value.
  37530. // This may be used to include null fields in Patch requests.
  37531. NullFields []string `json:"-"`
  37532. }
  37533. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  37534. type NoMethod VpnTunnelAggregatedListWarningData
  37535. raw := NoMethod(*s)
  37536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37537. }
  37538. // VpnTunnelList: Contains a list of VpnTunnel resources.
  37539. type VpnTunnelList struct {
  37540. // Id: [Output Only] Unique identifier for the resource; defined by the
  37541. // server.
  37542. Id string `json:"id,omitempty"`
  37543. // Items: A list of VpnTunnel resources.
  37544. Items []*VpnTunnel `json:"items,omitempty"`
  37545. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  37546. // VPN tunnels.
  37547. Kind string `json:"kind,omitempty"`
  37548. // NextPageToken: [Output Only] This token allows you to get the next
  37549. // page of results for list requests. If the number of results is larger
  37550. // than maxResults, use the nextPageToken as a value for the query
  37551. // parameter pageToken in the next list request. Subsequent list
  37552. // requests will have their own nextPageToken to continue paging through
  37553. // the results.
  37554. NextPageToken string `json:"nextPageToken,omitempty"`
  37555. // SelfLink: [Output Only] Server-defined URL for this resource.
  37556. SelfLink string `json:"selfLink,omitempty"`
  37557. // Warning: [Output Only] Informational warning message.
  37558. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  37559. // ServerResponse contains the HTTP response code and headers from the
  37560. // server.
  37561. googleapi.ServerResponse `json:"-"`
  37562. // ForceSendFields is a list of field names (e.g. "Id") to
  37563. // unconditionally include in API requests. By default, fields with
  37564. // empty values are omitted from API requests. However, any non-pointer,
  37565. // non-interface field appearing in ForceSendFields will be sent to the
  37566. // server regardless of whether the field is empty or not. This may be
  37567. // used to include empty fields in Patch requests.
  37568. ForceSendFields []string `json:"-"`
  37569. // NullFields is a list of field names (e.g. "Id") to include in API
  37570. // requests with the JSON null value. By default, fields with empty
  37571. // values are omitted from API requests. However, any field with an
  37572. // empty value appearing in NullFields will be sent to the server as
  37573. // null. It is an error if a field in this list has a non-empty value.
  37574. // This may be used to include null fields in Patch requests.
  37575. NullFields []string `json:"-"`
  37576. }
  37577. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  37578. type NoMethod VpnTunnelList
  37579. raw := NoMethod(*s)
  37580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37581. }
  37582. // VpnTunnelListWarning: [Output Only] Informational warning message.
  37583. type VpnTunnelListWarning struct {
  37584. // Code: [Output Only] A warning code, if applicable. For example,
  37585. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  37586. // the response.
  37587. //
  37588. // Possible values:
  37589. // "CLEANUP_FAILED"
  37590. // "DEPRECATED_RESOURCE_USED"
  37591. // "DEPRECATED_TYPE_USED"
  37592. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  37593. // "EXPERIMENTAL_TYPE_USED"
  37594. // "EXTERNAL_API_WARNING"
  37595. // "FIELD_VALUE_OVERRIDEN"
  37596. // "INJECTED_KERNELS_DEPRECATED"
  37597. // "MISSING_TYPE_DEPENDENCY"
  37598. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  37599. // "NEXT_HOP_CANNOT_IP_FORWARD"
  37600. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  37601. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  37602. // "NEXT_HOP_NOT_RUNNING"
  37603. // "NOT_CRITICAL_ERROR"
  37604. // "NO_RESULTS_ON_PAGE"
  37605. // "REQUIRED_TOS_AGREEMENT"
  37606. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  37607. // "RESOURCE_NOT_DELETED"
  37608. // "SCHEMA_VALIDATION_IGNORED"
  37609. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  37610. // "UNDECLARED_PROPERTIES"
  37611. // "UNREACHABLE"
  37612. Code string `json:"code,omitempty"`
  37613. // Data: [Output Only] Metadata about this warning in key: value format.
  37614. // For example:
  37615. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  37616. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  37617. // Message: [Output Only] A human-readable description of the warning
  37618. // code.
  37619. Message string `json:"message,omitempty"`
  37620. // ForceSendFields is a list of field names (e.g. "Code") to
  37621. // unconditionally include in API requests. By default, fields with
  37622. // empty values are omitted from API requests. However, any non-pointer,
  37623. // non-interface field appearing in ForceSendFields will be sent to the
  37624. // server regardless of whether the field is empty or not. This may be
  37625. // used to include empty fields in Patch requests.
  37626. ForceSendFields []string `json:"-"`
  37627. // NullFields is a list of field names (e.g. "Code") to include in API
  37628. // requests with the JSON null value. By default, fields with empty
  37629. // values are omitted from API requests. However, any field with an
  37630. // empty value appearing in NullFields will be sent to the server as
  37631. // null. It is an error if a field in this list has a non-empty value.
  37632. // This may be used to include null fields in Patch requests.
  37633. NullFields []string `json:"-"`
  37634. }
  37635. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  37636. type NoMethod VpnTunnelListWarning
  37637. raw := NoMethod(*s)
  37638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37639. }
  37640. type VpnTunnelListWarningData struct {
  37641. // Key: [Output Only] A key that provides more detail on the warning
  37642. // being returned. For example, for warnings where there are no results
  37643. // in a list request for a particular zone, this key might be scope and
  37644. // the key value might be the zone name. Other examples might be a key
  37645. // indicating a deprecated resource and a suggested replacement, or a
  37646. // warning about invalid network settings (for example, if an instance
  37647. // attempts to perform IP forwarding but is not enabled for IP
  37648. // forwarding).
  37649. Key string `json:"key,omitempty"`
  37650. // Value: [Output Only] A warning data value corresponding to the key.
  37651. Value string `json:"value,omitempty"`
  37652. // ForceSendFields is a list of field names (e.g. "Key") to
  37653. // unconditionally include in API requests. By default, fields with
  37654. // empty values are omitted from API requests. However, any non-pointer,
  37655. // non-interface field appearing in ForceSendFields will be sent to the
  37656. // server regardless of whether the field is empty or not. This may be
  37657. // used to include empty fields in Patch requests.
  37658. ForceSendFields []string `json:"-"`
  37659. // NullFields is a list of field names (e.g. "Key") to include in API
  37660. // requests with the JSON null value. By default, fields with empty
  37661. // values are omitted from API requests. However, any field with an
  37662. // empty value appearing in NullFields will be sent to the server as
  37663. // null. It is an error if a field in this list has a non-empty value.
  37664. // This may be used to include null fields in Patch requests.
  37665. NullFields []string `json:"-"`
  37666. }
  37667. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  37668. type NoMethod VpnTunnelListWarningData
  37669. raw := NoMethod(*s)
  37670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37671. }
  37672. type VpnTunnelsScopedList struct {
  37673. // VpnTunnels: A list of VPN tunnels contained in this scope.
  37674. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  37675. // Warning: Informational warning which replaces the list of addresses
  37676. // when the list is empty.
  37677. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  37678. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  37679. // unconditionally include in API requests. By default, fields with
  37680. // empty values are omitted from API requests. However, any non-pointer,
  37681. // non-interface field appearing in ForceSendFields will be sent to the
  37682. // server regardless of whether the field is empty or not. This may be
  37683. // used to include empty fields in Patch requests.
  37684. ForceSendFields []string `json:"-"`
  37685. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  37686. // API requests with the JSON null value. By default, fields with empty
  37687. // values are omitted from API requests. However, any field with an
  37688. // empty value appearing in NullFields will be sent to the server as
  37689. // null. It is an error if a field in this list has a non-empty value.
  37690. // This may be used to include null fields in Patch requests.
  37691. NullFields []string `json:"-"`
  37692. }
  37693. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  37694. type NoMethod VpnTunnelsScopedList
  37695. raw := NoMethod(*s)
  37696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37697. }
  37698. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  37699. // list of addresses when the list is empty.
  37700. type VpnTunnelsScopedListWarning struct {
  37701. // Code: [Output Only] A warning code, if applicable. For example,
  37702. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  37703. // the response.
  37704. //
  37705. // Possible values:
  37706. // "CLEANUP_FAILED"
  37707. // "DEPRECATED_RESOURCE_USED"
  37708. // "DEPRECATED_TYPE_USED"
  37709. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  37710. // "EXPERIMENTAL_TYPE_USED"
  37711. // "EXTERNAL_API_WARNING"
  37712. // "FIELD_VALUE_OVERRIDEN"
  37713. // "INJECTED_KERNELS_DEPRECATED"
  37714. // "MISSING_TYPE_DEPENDENCY"
  37715. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  37716. // "NEXT_HOP_CANNOT_IP_FORWARD"
  37717. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  37718. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  37719. // "NEXT_HOP_NOT_RUNNING"
  37720. // "NOT_CRITICAL_ERROR"
  37721. // "NO_RESULTS_ON_PAGE"
  37722. // "REQUIRED_TOS_AGREEMENT"
  37723. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  37724. // "RESOURCE_NOT_DELETED"
  37725. // "SCHEMA_VALIDATION_IGNORED"
  37726. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  37727. // "UNDECLARED_PROPERTIES"
  37728. // "UNREACHABLE"
  37729. Code string `json:"code,omitempty"`
  37730. // Data: [Output Only] Metadata about this warning in key: value format.
  37731. // For example:
  37732. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  37733. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  37734. // Message: [Output Only] A human-readable description of the warning
  37735. // code.
  37736. Message string `json:"message,omitempty"`
  37737. // ForceSendFields is a list of field names (e.g. "Code") to
  37738. // unconditionally include in API requests. By default, fields with
  37739. // empty values are omitted from API requests. However, any non-pointer,
  37740. // non-interface field appearing in ForceSendFields will be sent to the
  37741. // server regardless of whether the field is empty or not. This may be
  37742. // used to include empty fields in Patch requests.
  37743. ForceSendFields []string `json:"-"`
  37744. // NullFields is a list of field names (e.g. "Code") to include in API
  37745. // requests with the JSON null value. By default, fields with empty
  37746. // values are omitted from API requests. However, any field with an
  37747. // empty value appearing in NullFields will be sent to the server as
  37748. // null. It is an error if a field in this list has a non-empty value.
  37749. // This may be used to include null fields in Patch requests.
  37750. NullFields []string `json:"-"`
  37751. }
  37752. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  37753. type NoMethod VpnTunnelsScopedListWarning
  37754. raw := NoMethod(*s)
  37755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37756. }
  37757. type VpnTunnelsScopedListWarningData struct {
  37758. // Key: [Output Only] A key that provides more detail on the warning
  37759. // being returned. For example, for warnings where there are no results
  37760. // in a list request for a particular zone, this key might be scope and
  37761. // the key value might be the zone name. Other examples might be a key
  37762. // indicating a deprecated resource and a suggested replacement, or a
  37763. // warning about invalid network settings (for example, if an instance
  37764. // attempts to perform IP forwarding but is not enabled for IP
  37765. // forwarding).
  37766. Key string `json:"key,omitempty"`
  37767. // Value: [Output Only] A warning data value corresponding to the key.
  37768. Value string `json:"value,omitempty"`
  37769. // ForceSendFields is a list of field names (e.g. "Key") to
  37770. // unconditionally include in API requests. By default, fields with
  37771. // empty values are omitted from API requests. However, any non-pointer,
  37772. // non-interface field appearing in ForceSendFields will be sent to the
  37773. // server regardless of whether the field is empty or not. This may be
  37774. // used to include empty fields in Patch requests.
  37775. ForceSendFields []string `json:"-"`
  37776. // NullFields is a list of field names (e.g. "Key") to include in API
  37777. // requests with the JSON null value. By default, fields with empty
  37778. // values are omitted from API requests. However, any field with an
  37779. // empty value appearing in NullFields will be sent to the server as
  37780. // null. It is an error if a field in this list has a non-empty value.
  37781. // This may be used to include null fields in Patch requests.
  37782. NullFields []string `json:"-"`
  37783. }
  37784. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  37785. type NoMethod VpnTunnelsScopedListWarningData
  37786. raw := NoMethod(*s)
  37787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37788. }
  37789. type WafExpressionSet struct {
  37790. // Aliases: A list of alternate IDs. The format should be: - E.g.
  37791. // XSS-stable Generic suffix like "stable" is particularly useful if a
  37792. // policy likes to avail newer set of expressions without having to
  37793. // change the policy. A given alias name can't be used for more than one
  37794. // entity set.
  37795. Aliases []string `json:"aliases,omitempty"`
  37796. // Expressions: List of available expressions.
  37797. Expressions []*WafExpressionSetExpression `json:"expressions,omitempty"`
  37798. // Id: Google specified expression set ID. The format should be: - E.g.
  37799. // XSS-20170329
  37800. Id string `json:"id,omitempty"`
  37801. // ForceSendFields is a list of field names (e.g. "Aliases") to
  37802. // unconditionally include in API requests. By default, fields with
  37803. // empty values are omitted from API requests. However, any non-pointer,
  37804. // non-interface field appearing in ForceSendFields will be sent to the
  37805. // server regardless of whether the field is empty or not. This may be
  37806. // used to include empty fields in Patch requests.
  37807. ForceSendFields []string `json:"-"`
  37808. // NullFields is a list of field names (e.g. "Aliases") to include in
  37809. // API requests with the JSON null value. By default, fields with empty
  37810. // values are omitted from API requests. However, any field with an
  37811. // empty value appearing in NullFields will be sent to the server as
  37812. // null. It is an error if a field in this list has a non-empty value.
  37813. // This may be used to include null fields in Patch requests.
  37814. NullFields []string `json:"-"`
  37815. }
  37816. func (s *WafExpressionSet) MarshalJSON() ([]byte, error) {
  37817. type NoMethod WafExpressionSet
  37818. raw := NoMethod(*s)
  37819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37820. }
  37821. type WafExpressionSetExpression struct {
  37822. // Id: Expression ID should uniquely identify the origin of the
  37823. // expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core
  37824. // rule set version 2.9.1 rule id 973337. The ID could be used to
  37825. // determine the individual attack definition that has been detected. It
  37826. // could also be used to exclude it from the policy in case of false
  37827. // positive.
  37828. Id string `json:"id,omitempty"`
  37829. // ForceSendFields is a list of field names (e.g. "Id") to
  37830. // unconditionally include in API requests. By default, fields with
  37831. // empty values are omitted from API requests. However, any non-pointer,
  37832. // non-interface field appearing in ForceSendFields will be sent to the
  37833. // server regardless of whether the field is empty or not. This may be
  37834. // used to include empty fields in Patch requests.
  37835. ForceSendFields []string `json:"-"`
  37836. // NullFields is a list of field names (e.g. "Id") to include in API
  37837. // requests with the JSON null value. By default, fields with empty
  37838. // values are omitted from API requests. However, any field with an
  37839. // empty value appearing in NullFields will be sent to the server as
  37840. // null. It is an error if a field in this list has a non-empty value.
  37841. // This may be used to include null fields in Patch requests.
  37842. NullFields []string `json:"-"`
  37843. }
  37844. func (s *WafExpressionSetExpression) MarshalJSON() ([]byte, error) {
  37845. type NoMethod WafExpressionSetExpression
  37846. raw := NoMethod(*s)
  37847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37848. }
  37849. // WeightedBackendService: In contrast to a single BackendService in
  37850. // HttpRouteAction to which all matching traffic is directed to,
  37851. // WeightedBackendService allows traffic to be split across multiple
  37852. // BackendServices. The volume of traffic for each BackendService is
  37853. // proportional to the weight specified in each WeightedBackendService
  37854. type WeightedBackendService struct {
  37855. // BackendService: The full or partial URL to the default BackendService
  37856. // resource. Before forwarding the request to backendService, the
  37857. // loadbalancer applies any relevant headerActions specified as part of
  37858. // this backendServiceWeight.
  37859. BackendService string `json:"backendService,omitempty"`
  37860. // HeaderAction: Specifies changes to request and response headers that
  37861. // need to take effect for the selected backendService.
  37862. // headerAction specified here take effect before headerAction in the
  37863. // enclosing HttpRouteRule, PathMatcher and UrlMap.
  37864. HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
  37865. // Weight: Specifies the fraction of traffic sent to backendService,
  37866. // computed as weight / (sum of all weightedBackendService weights in
  37867. // routeAction) .
  37868. // The selection of a backend service is determined only for new
  37869. // traffic. Once a user's request has been directed to a backendService,
  37870. // subsequent requests will be sent to the same backendService as
  37871. // determined by the BackendService's session affinity policy.
  37872. // The value must be between 0 and 1000
  37873. Weight int64 `json:"weight,omitempty"`
  37874. // ForceSendFields is a list of field names (e.g. "BackendService") to
  37875. // unconditionally include in API requests. By default, fields with
  37876. // empty values are omitted from API requests. However, any non-pointer,
  37877. // non-interface field appearing in ForceSendFields will be sent to the
  37878. // server regardless of whether the field is empty or not. This may be
  37879. // used to include empty fields in Patch requests.
  37880. ForceSendFields []string `json:"-"`
  37881. // NullFields is a list of field names (e.g. "BackendService") to
  37882. // include in API requests with the JSON null value. By default, fields
  37883. // with empty values are omitted from API requests. However, any field
  37884. // with an empty value appearing in NullFields will be sent to the
  37885. // server as null. It is an error if a field in this list has a
  37886. // non-empty value. This may be used to include null fields in Patch
  37887. // requests.
  37888. NullFields []string `json:"-"`
  37889. }
  37890. func (s *WeightedBackendService) MarshalJSON() ([]byte, error) {
  37891. type NoMethod WeightedBackendService
  37892. raw := NoMethod(*s)
  37893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37894. }
  37895. type XpnHostList struct {
  37896. // Id: [Output Only] Unique identifier for the resource; defined by the
  37897. // server.
  37898. Id string `json:"id,omitempty"`
  37899. // Items: [Output Only] A list of shared VPC host project URLs.
  37900. Items []*Project `json:"items,omitempty"`
  37901. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  37902. // lists of shared VPC hosts.
  37903. Kind string `json:"kind,omitempty"`
  37904. // NextPageToken: [Output Only] This token allows you to get the next
  37905. // page of results for list requests. If the number of results is larger
  37906. // than maxResults, use the nextPageToken as a value for the query
  37907. // parameter pageToken in the next list request. Subsequent list
  37908. // requests will have their own nextPageToken to continue paging through
  37909. // the results.
  37910. NextPageToken string `json:"nextPageToken,omitempty"`
  37911. // SelfLink: [Output Only] Server-defined URL for this resource.
  37912. SelfLink string `json:"selfLink,omitempty"`
  37913. // Warning: [Output Only] Informational warning message.
  37914. Warning *XpnHostListWarning `json:"warning,omitempty"`
  37915. // ServerResponse contains the HTTP response code and headers from the
  37916. // server.
  37917. googleapi.ServerResponse `json:"-"`
  37918. // ForceSendFields is a list of field names (e.g. "Id") to
  37919. // unconditionally include in API requests. By default, fields with
  37920. // empty values are omitted from API requests. However, any non-pointer,
  37921. // non-interface field appearing in ForceSendFields will be sent to the
  37922. // server regardless of whether the field is empty or not. This may be
  37923. // used to include empty fields in Patch requests.
  37924. ForceSendFields []string `json:"-"`
  37925. // NullFields is a list of field names (e.g. "Id") to include in API
  37926. // requests with the JSON null value. By default, fields with empty
  37927. // values are omitted from API requests. However, any field with an
  37928. // empty value appearing in NullFields will be sent to the server as
  37929. // null. It is an error if a field in this list has a non-empty value.
  37930. // This may be used to include null fields in Patch requests.
  37931. NullFields []string `json:"-"`
  37932. }
  37933. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  37934. type NoMethod XpnHostList
  37935. raw := NoMethod(*s)
  37936. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37937. }
  37938. // XpnHostListWarning: [Output Only] Informational warning message.
  37939. type XpnHostListWarning struct {
  37940. // Code: [Output Only] A warning code, if applicable. For example,
  37941. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  37942. // the response.
  37943. //
  37944. // Possible values:
  37945. // "CLEANUP_FAILED"
  37946. // "DEPRECATED_RESOURCE_USED"
  37947. // "DEPRECATED_TYPE_USED"
  37948. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  37949. // "EXPERIMENTAL_TYPE_USED"
  37950. // "EXTERNAL_API_WARNING"
  37951. // "FIELD_VALUE_OVERRIDEN"
  37952. // "INJECTED_KERNELS_DEPRECATED"
  37953. // "MISSING_TYPE_DEPENDENCY"
  37954. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  37955. // "NEXT_HOP_CANNOT_IP_FORWARD"
  37956. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  37957. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  37958. // "NEXT_HOP_NOT_RUNNING"
  37959. // "NOT_CRITICAL_ERROR"
  37960. // "NO_RESULTS_ON_PAGE"
  37961. // "REQUIRED_TOS_AGREEMENT"
  37962. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  37963. // "RESOURCE_NOT_DELETED"
  37964. // "SCHEMA_VALIDATION_IGNORED"
  37965. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  37966. // "UNDECLARED_PROPERTIES"
  37967. // "UNREACHABLE"
  37968. Code string `json:"code,omitempty"`
  37969. // Data: [Output Only] Metadata about this warning in key: value format.
  37970. // For example:
  37971. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  37972. Data []*XpnHostListWarningData `json:"data,omitempty"`
  37973. // Message: [Output Only] A human-readable description of the warning
  37974. // code.
  37975. Message string `json:"message,omitempty"`
  37976. // ForceSendFields is a list of field names (e.g. "Code") to
  37977. // unconditionally include in API requests. By default, fields with
  37978. // empty values are omitted from API requests. However, any non-pointer,
  37979. // non-interface field appearing in ForceSendFields will be sent to the
  37980. // server regardless of whether the field is empty or not. This may be
  37981. // used to include empty fields in Patch requests.
  37982. ForceSendFields []string `json:"-"`
  37983. // NullFields is a list of field names (e.g. "Code") to include in API
  37984. // requests with the JSON null value. By default, fields with empty
  37985. // values are omitted from API requests. However, any field with an
  37986. // empty value appearing in NullFields will be sent to the server as
  37987. // null. It is an error if a field in this list has a non-empty value.
  37988. // This may be used to include null fields in Patch requests.
  37989. NullFields []string `json:"-"`
  37990. }
  37991. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  37992. type NoMethod XpnHostListWarning
  37993. raw := NoMethod(*s)
  37994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37995. }
  37996. type XpnHostListWarningData struct {
  37997. // Key: [Output Only] A key that provides more detail on the warning
  37998. // being returned. For example, for warnings where there are no results
  37999. // in a list request for a particular zone, this key might be scope and
  38000. // the key value might be the zone name. Other examples might be a key
  38001. // indicating a deprecated resource and a suggested replacement, or a
  38002. // warning about invalid network settings (for example, if an instance
  38003. // attempts to perform IP forwarding but is not enabled for IP
  38004. // forwarding).
  38005. Key string `json:"key,omitempty"`
  38006. // Value: [Output Only] A warning data value corresponding to the key.
  38007. Value string `json:"value,omitempty"`
  38008. // ForceSendFields is a list of field names (e.g. "Key") to
  38009. // unconditionally include in API requests. By default, fields with
  38010. // empty values are omitted from API requests. However, any non-pointer,
  38011. // non-interface field appearing in ForceSendFields will be sent to the
  38012. // server regardless of whether the field is empty or not. This may be
  38013. // used to include empty fields in Patch requests.
  38014. ForceSendFields []string `json:"-"`
  38015. // NullFields is a list of field names (e.g. "Key") to include in API
  38016. // requests with the JSON null value. By default, fields with empty
  38017. // values are omitted from API requests. However, any field with an
  38018. // empty value appearing in NullFields will be sent to the server as
  38019. // null. It is an error if a field in this list has a non-empty value.
  38020. // This may be used to include null fields in Patch requests.
  38021. NullFields []string `json:"-"`
  38022. }
  38023. func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  38024. type NoMethod XpnHostListWarningData
  38025. raw := NoMethod(*s)
  38026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  38027. }
  38028. // XpnResourceId: Service resource (a.k.a service project) ID.
  38029. type XpnResourceId struct {
  38030. // Id: The ID of the service resource. In the case of projects, this
  38031. // field supports project id (e.g., my-project-123) and project number
  38032. // (e.g. 12345678).
  38033. Id string `json:"id,omitempty"`
  38034. // Type: The type of the service resource.
  38035. //
  38036. // Possible values:
  38037. // "PROJECT"
  38038. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  38039. Type string `json:"type,omitempty"`
  38040. // ForceSendFields is a list of field names (e.g. "Id") to
  38041. // unconditionally include in API requests. By default, fields with
  38042. // empty values are omitted from API requests. However, any non-pointer,
  38043. // non-interface field appearing in ForceSendFields will be sent to the
  38044. // server regardless of whether the field is empty or not. This may be
  38045. // used to include empty fields in Patch requests.
  38046. ForceSendFields []string `json:"-"`
  38047. // NullFields is a list of field names (e.g. "Id") to include in API
  38048. // requests with the JSON null value. By default, fields with empty
  38049. // values are omitted from API requests. However, any field with an
  38050. // empty value appearing in NullFields will be sent to the server as
  38051. // null. It is an error if a field in this list has a non-empty value.
  38052. // This may be used to include null fields in Patch requests.
  38053. NullFields []string `json:"-"`
  38054. }
  38055. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  38056. type NoMethod XpnResourceId
  38057. raw := NoMethod(*s)
  38058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  38059. }
  38060. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  38061. // resource_for v1.zones ==) Next ID: 17
  38062. type Zone struct {
  38063. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  38064. // selections for the zone.
  38065. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  38066. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  38067. // format.
  38068. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  38069. // Deprecated: [Output Only] The deprecation status associated with this
  38070. // zone.
  38071. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  38072. // Description: [Output Only] Textual description of the resource.
  38073. Description string `json:"description,omitempty"`
  38074. // Id: [Output Only] The unique identifier for the resource. This
  38075. // identifier is defined by the server.
  38076. Id uint64 `json:"id,omitempty,string"`
  38077. // Kind: [Output Only] Type of the resource. Always compute#zone for
  38078. // zones.
  38079. Kind string `json:"kind,omitempty"`
  38080. // Name: [Output Only] Name of the resource.
  38081. Name string `json:"name,omitempty"`
  38082. // Region: [Output Only] Full URL reference to the region which hosts
  38083. // the zone.
  38084. Region string `json:"region,omitempty"`
  38085. // SelfLink: [Output Only] Server-defined URL for the resource.
  38086. SelfLink string `json:"selfLink,omitempty"`
  38087. // Status: [Output Only] Status of the zone, either UP or DOWN.
  38088. //
  38089. // Possible values:
  38090. // "DOWN"
  38091. // "UP"
  38092. Status string `json:"status,omitempty"`
  38093. // ServerResponse contains the HTTP response code and headers from the
  38094. // server.
  38095. googleapi.ServerResponse `json:"-"`
  38096. // ForceSendFields is a list of field names (e.g.
  38097. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  38098. // By default, fields with empty values are omitted from API requests.
  38099. // However, any non-pointer, non-interface field appearing in
  38100. // ForceSendFields will be sent to the server regardless of whether the
  38101. // field is empty or not. This may be used to include empty fields in
  38102. // Patch requests.
  38103. ForceSendFields []string `json:"-"`
  38104. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  38105. // include in API requests with the JSON null value. By default, fields
  38106. // with empty values are omitted from API requests. However, any field
  38107. // with an empty value appearing in NullFields will be sent to the
  38108. // server as null. It is an error if a field in this list has a
  38109. // non-empty value. This may be used to include null fields in Patch
  38110. // requests.
  38111. NullFields []string `json:"-"`
  38112. }
  38113. func (s *Zone) MarshalJSON() ([]byte, error) {
  38114. type NoMethod Zone
  38115. raw := NoMethod(*s)
  38116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  38117. }
  38118. // ZoneList: Contains a list of zone resources.
  38119. type ZoneList struct {
  38120. // Id: [Output Only] Unique identifier for the resource; defined by the
  38121. // server.
  38122. Id string `json:"id,omitempty"`
  38123. // Items: A list of Zone resources.
  38124. Items []*Zone `json:"items,omitempty"`
  38125. // Kind: Type of resource.
  38126. Kind string `json:"kind,omitempty"`
  38127. // NextPageToken: [Output Only] This token allows you to get the next
  38128. // page of results for list requests. If the number of results is larger
  38129. // than maxResults, use the nextPageToken as a value for the query
  38130. // parameter pageToken in the next list request. Subsequent list
  38131. // requests will have their own nextPageToken to continue paging through
  38132. // the results.
  38133. NextPageToken string `json:"nextPageToken,omitempty"`
  38134. // SelfLink: [Output Only] Server-defined URL for this resource.
  38135. SelfLink string `json:"selfLink,omitempty"`
  38136. // Warning: [Output Only] Informational warning message.
  38137. Warning *ZoneListWarning `json:"warning,omitempty"`
  38138. // ServerResponse contains the HTTP response code and headers from the
  38139. // server.
  38140. googleapi.ServerResponse `json:"-"`
  38141. // ForceSendFields is a list of field names (e.g. "Id") to
  38142. // unconditionally include in API requests. By default, fields with
  38143. // empty values are omitted from API requests. However, any non-pointer,
  38144. // non-interface field appearing in ForceSendFields will be sent to the
  38145. // server regardless of whether the field is empty or not. This may be
  38146. // used to include empty fields in Patch requests.
  38147. ForceSendFields []string `json:"-"`
  38148. // NullFields is a list of field names (e.g. "Id") to include in API
  38149. // requests with the JSON null value. By default, fields with empty
  38150. // values are omitted from API requests. However, any field with an
  38151. // empty value appearing in NullFields will be sent to the server as
  38152. // null. It is an error if a field in this list has a non-empty value.
  38153. // This may be used to include null fields in Patch requests.
  38154. NullFields []string `json:"-"`
  38155. }
  38156. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  38157. type NoMethod ZoneList
  38158. raw := NoMethod(*s)
  38159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  38160. }
  38161. // ZoneListWarning: [Output Only] Informational warning message.
  38162. type ZoneListWarning struct {
  38163. // Code: [Output Only] A warning code, if applicable. For example,
  38164. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  38165. // the response.
  38166. //
  38167. // Possible values:
  38168. // "CLEANUP_FAILED"
  38169. // "DEPRECATED_RESOURCE_USED"
  38170. // "DEPRECATED_TYPE_USED"
  38171. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  38172. // "EXPERIMENTAL_TYPE_USED"
  38173. // "EXTERNAL_API_WARNING"
  38174. // "FIELD_VALUE_OVERRIDEN"
  38175. // "INJECTED_KERNELS_DEPRECATED"
  38176. // "MISSING_TYPE_DEPENDENCY"
  38177. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  38178. // "NEXT_HOP_CANNOT_IP_FORWARD"
  38179. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  38180. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  38181. // "NEXT_HOP_NOT_RUNNING"
  38182. // "NOT_CRITICAL_ERROR"
  38183. // "NO_RESULTS_ON_PAGE"
  38184. // "REQUIRED_TOS_AGREEMENT"
  38185. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  38186. // "RESOURCE_NOT_DELETED"
  38187. // "SCHEMA_VALIDATION_IGNORED"
  38188. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  38189. // "UNDECLARED_PROPERTIES"
  38190. // "UNREACHABLE"
  38191. Code string `json:"code,omitempty"`
  38192. // Data: [Output Only] Metadata about this warning in key: value format.
  38193. // For example:
  38194. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  38195. Data []*ZoneListWarningData `json:"data,omitempty"`
  38196. // Message: [Output Only] A human-readable description of the warning
  38197. // code.
  38198. Message string `json:"message,omitempty"`
  38199. // ForceSendFields is a list of field names (e.g. "Code") to
  38200. // unconditionally include in API requests. By default, fields with
  38201. // empty values are omitted from API requests. However, any non-pointer,
  38202. // non-interface field appearing in ForceSendFields will be sent to the
  38203. // server regardless of whether the field is empty or not. This may be
  38204. // used to include empty fields in Patch requests.
  38205. ForceSendFields []string `json:"-"`
  38206. // NullFields is a list of field names (e.g. "Code") to include in API
  38207. // requests with the JSON null value. By default, fields with empty
  38208. // values are omitted from API requests. However, any field with an
  38209. // empty value appearing in NullFields will be sent to the server as
  38210. // null. It is an error if a field in this list has a non-empty value.
  38211. // This may be used to include null fields in Patch requests.
  38212. NullFields []string `json:"-"`
  38213. }
  38214. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  38215. type NoMethod ZoneListWarning
  38216. raw := NoMethod(*s)
  38217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  38218. }
  38219. type ZoneListWarningData struct {
  38220. // Key: [Output Only] A key that provides more detail on the warning
  38221. // being returned. For example, for warnings where there are no results
  38222. // in a list request for a particular zone, this key might be scope and
  38223. // the key value might be the zone name. Other examples might be a key
  38224. // indicating a deprecated resource and a suggested replacement, or a
  38225. // warning about invalid network settings (for example, if an instance
  38226. // attempts to perform IP forwarding but is not enabled for IP
  38227. // forwarding).
  38228. Key string `json:"key,omitempty"`
  38229. // Value: [Output Only] A warning data value corresponding to the key.
  38230. Value string `json:"value,omitempty"`
  38231. // ForceSendFields is a list of field names (e.g. "Key") to
  38232. // unconditionally include in API requests. By default, fields with
  38233. // empty values are omitted from API requests. However, any non-pointer,
  38234. // non-interface field appearing in ForceSendFields will be sent to the
  38235. // server regardless of whether the field is empty or not. This may be
  38236. // used to include empty fields in Patch requests.
  38237. ForceSendFields []string `json:"-"`
  38238. // NullFields is a list of field names (e.g. "Key") to include in API
  38239. // requests with the JSON null value. By default, fields with empty
  38240. // values are omitted from API requests. However, any field with an
  38241. // empty value appearing in NullFields will be sent to the server as
  38242. // null. It is an error if a field in this list has a non-empty value.
  38243. // This may be used to include null fields in Patch requests.
  38244. NullFields []string `json:"-"`
  38245. }
  38246. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  38247. type NoMethod ZoneListWarningData
  38248. raw := NoMethod(*s)
  38249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  38250. }
  38251. type ZoneSetLabelsRequest struct {
  38252. // LabelFingerprint: The fingerprint of the previous set of labels for
  38253. // this resource, used to detect conflicts. The fingerprint is initially
  38254. // generated by Compute Engine and changes after every request to modify
  38255. // or update labels. You must always provide an up-to-date fingerprint
  38256. // hash in order to update or change labels. Make a get() request to the
  38257. // resource to get the latest fingerprint.
  38258. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  38259. // Labels: The labels to set for this resource.
  38260. Labels map[string]string `json:"labels,omitempty"`
  38261. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  38262. // unconditionally include in API requests. By default, fields with
  38263. // empty values are omitted from API requests. However, any non-pointer,
  38264. // non-interface field appearing in ForceSendFields will be sent to the
  38265. // server regardless of whether the field is empty or not. This may be
  38266. // used to include empty fields in Patch requests.
  38267. ForceSendFields []string `json:"-"`
  38268. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  38269. // include in API requests with the JSON null value. By default, fields
  38270. // with empty values are omitted from API requests. However, any field
  38271. // with an empty value appearing in NullFields will be sent to the
  38272. // server as null. It is an error if a field in this list has a
  38273. // non-empty value. This may be used to include null fields in Patch
  38274. // requests.
  38275. NullFields []string `json:"-"`
  38276. }
  38277. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  38278. type NoMethod ZoneSetLabelsRequest
  38279. raw := NoMethod(*s)
  38280. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  38281. }
  38282. type ZoneSetPolicyRequest struct {
  38283. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  38284. // Deprecated. Use 'policy' to specify bindings.
  38285. Bindings []*Binding `json:"bindings,omitempty"`
  38286. // Etag: Flatten Policy to create a backward compatible wire-format.
  38287. // Deprecated. Use 'policy' to specify the etag.
  38288. Etag string `json:"etag,omitempty"`
  38289. // Policy: REQUIRED: The complete policy to be applied to the
  38290. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  38291. // empty policy is in general a valid policy but certain services (like
  38292. // Projects) might reject them.
  38293. Policy *Policy `json:"policy,omitempty"`
  38294. // ForceSendFields is a list of field names (e.g. "Bindings") to
  38295. // unconditionally include in API requests. By default, fields with
  38296. // empty values are omitted from API requests. However, any non-pointer,
  38297. // non-interface field appearing in ForceSendFields will be sent to the
  38298. // server regardless of whether the field is empty or not. This may be
  38299. // used to include empty fields in Patch requests.
  38300. ForceSendFields []string `json:"-"`
  38301. // NullFields is a list of field names (e.g. "Bindings") to include in
  38302. // API requests with the JSON null value. By default, fields with empty
  38303. // values are omitted from API requests. However, any field with an
  38304. // empty value appearing in NullFields will be sent to the server as
  38305. // null. It is an error if a field in this list has a non-empty value.
  38306. // This may be used to include null fields in Patch requests.
  38307. NullFields []string `json:"-"`
  38308. }
  38309. func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
  38310. type NoMethod ZoneSetPolicyRequest
  38311. raw := NoMethod(*s)
  38312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  38313. }
  38314. // method id "compute.acceleratorTypes.aggregatedList":
  38315. type AcceleratorTypesAggregatedListCall struct {
  38316. s *Service
  38317. project string
  38318. urlParams_ gensupport.URLParams
  38319. ifNoneMatch_ string
  38320. ctx_ context.Context
  38321. header_ http.Header
  38322. }
  38323. // AggregatedList: Retrieves an aggregated list of accelerator types.
  38324. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  38325. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38326. c.project = project
  38327. return c
  38328. }
  38329. // Filter sets the optional parameter "filter": A filter expression that
  38330. // filters resources listed in the response. The expression must specify
  38331. // the field name, a comparison operator, and the value that you want to
  38332. // use for filtering. The value must be a string, a number, or a
  38333. // boolean. The comparison operator must be either =, !=, >, or <.
  38334. //
  38335. // For example, if you are filtering Compute Engine instances, you can
  38336. // exclude instances named example-instance by specifying name !=
  38337. // example-instance.
  38338. //
  38339. // You can also filter nested fields. For example, you could specify
  38340. // scheduling.automaticRestart = false to include instances only if they
  38341. // are not scheduled for automatic restarts. You can use filtering on
  38342. // nested fields to filter based on resource labels.
  38343. //
  38344. // To filter on multiple expressions, provide each separate expression
  38345. // within parentheses. For example, (scheduling.automaticRestart = true)
  38346. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38347. // AND expression. However, you can include AND and OR expressions
  38348. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38349. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38350. // true).
  38351. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  38352. c.urlParams_.Set("filter", filter)
  38353. return c
  38354. }
  38355. // MaxResults sets the optional parameter "maxResults": The maximum
  38356. // number of results per page that should be returned. If the number of
  38357. // available results is larger than maxResults, Compute Engine returns a
  38358. // nextPageToken that can be used to get the next page of results in
  38359. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38360. // (Default: 500)
  38361. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  38362. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38363. return c
  38364. }
  38365. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38366. // a certain order. By default, results are returned in alphanumerical
  38367. // order based on the resource name.
  38368. //
  38369. // You can also sort results in descending order based on the creation
  38370. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38371. // based on the creationTimestamp field in reverse chronological order
  38372. // (newest result first). Use this to sort resources like operations so
  38373. // that the newest operation is returned first.
  38374. //
  38375. // Currently, only sorting by name or creationTimestamp desc is
  38376. // supported.
  38377. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  38378. c.urlParams_.Set("orderBy", orderBy)
  38379. return c
  38380. }
  38381. // PageToken sets the optional parameter "pageToken": Specifies a page
  38382. // token to use. Set pageToken to the nextPageToken returned by a
  38383. // previous list request to get the next page of results.
  38384. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  38385. c.urlParams_.Set("pageToken", pageToken)
  38386. return c
  38387. }
  38388. // Fields allows partial responses to be retrieved. See
  38389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38390. // for more information.
  38391. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  38392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38393. return c
  38394. }
  38395. // IfNoneMatch sets the optional parameter which makes the operation
  38396. // fail if the object's ETag matches the given value. This is useful for
  38397. // getting updates only after the object has changed since the last
  38398. // request. Use googleapi.IsNotModified to check whether the response
  38399. // error from Do is the result of In-None-Match.
  38400. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  38401. c.ifNoneMatch_ = entityTag
  38402. return c
  38403. }
  38404. // Context sets the context to be used in this call's Do method. Any
  38405. // pending HTTP request will be aborted if the provided context is
  38406. // canceled.
  38407. func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  38408. c.ctx_ = ctx
  38409. return c
  38410. }
  38411. // Header returns an http.Header that can be modified by the caller to
  38412. // add HTTP headers to the request.
  38413. func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
  38414. if c.header_ == nil {
  38415. c.header_ = make(http.Header)
  38416. }
  38417. return c.header_
  38418. }
  38419. func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  38420. reqHeaders := make(http.Header)
  38421. for k, v := range c.header_ {
  38422. reqHeaders[k] = v
  38423. }
  38424. reqHeaders.Set("User-Agent", c.s.userAgent())
  38425. if c.ifNoneMatch_ != "" {
  38426. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38427. }
  38428. var body io.Reader = nil
  38429. c.urlParams_.Set("alt", alt)
  38430. c.urlParams_.Set("prettyPrint", "false")
  38431. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  38432. urls += "?" + c.urlParams_.Encode()
  38433. req, err := http.NewRequest("GET", urls, body)
  38434. if err != nil {
  38435. return nil, err
  38436. }
  38437. req.Header = reqHeaders
  38438. googleapi.Expand(req.URL, map[string]string{
  38439. "project": c.project,
  38440. })
  38441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38442. }
  38443. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  38444. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  38445. // non-nil. Any non-2xx status code is an error. Response headers are in
  38446. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  38447. // response was returned at all) in error.(*googleapi.Error).Header. Use
  38448. // googleapi.IsNotModified to check whether the returned error was
  38449. // because http.StatusNotModified was returned.
  38450. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  38451. gensupport.SetOptions(c.urlParams_, opts...)
  38452. res, err := c.doRequest("json")
  38453. if res != nil && res.StatusCode == http.StatusNotModified {
  38454. if res.Body != nil {
  38455. res.Body.Close()
  38456. }
  38457. return nil, &googleapi.Error{
  38458. Code: res.StatusCode,
  38459. Header: res.Header,
  38460. }
  38461. }
  38462. if err != nil {
  38463. return nil, err
  38464. }
  38465. defer googleapi.CloseBody(res)
  38466. if err := googleapi.CheckResponse(res); err != nil {
  38467. return nil, err
  38468. }
  38469. ret := &AcceleratorTypeAggregatedList{
  38470. ServerResponse: googleapi.ServerResponse{
  38471. Header: res.Header,
  38472. HTTPStatusCode: res.StatusCode,
  38473. },
  38474. }
  38475. target := &ret
  38476. if err := gensupport.DecodeResponse(target, res); err != nil {
  38477. return nil, err
  38478. }
  38479. return ret, nil
  38480. // {
  38481. // "description": "Retrieves an aggregated list of accelerator types.",
  38482. // "httpMethod": "GET",
  38483. // "id": "compute.acceleratorTypes.aggregatedList",
  38484. // "parameterOrder": [
  38485. // "project"
  38486. // ],
  38487. // "parameters": {
  38488. // "filter": {
  38489. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  38490. // "location": "query",
  38491. // "type": "string"
  38492. // },
  38493. // "maxResults": {
  38494. // "default": "500",
  38495. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  38496. // "format": "uint32",
  38497. // "location": "query",
  38498. // "minimum": "0",
  38499. // "type": "integer"
  38500. // },
  38501. // "orderBy": {
  38502. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  38503. // "location": "query",
  38504. // "type": "string"
  38505. // },
  38506. // "pageToken": {
  38507. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  38508. // "location": "query",
  38509. // "type": "string"
  38510. // },
  38511. // "project": {
  38512. // "description": "Project ID for this request.",
  38513. // "location": "path",
  38514. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38515. // "required": true,
  38516. // "type": "string"
  38517. // }
  38518. // },
  38519. // "path": "{project}/aggregated/acceleratorTypes",
  38520. // "response": {
  38521. // "$ref": "AcceleratorTypeAggregatedList"
  38522. // },
  38523. // "scopes": [
  38524. // "https://www.googleapis.com/auth/cloud-platform",
  38525. // "https://www.googleapis.com/auth/compute",
  38526. // "https://www.googleapis.com/auth/compute.readonly"
  38527. // ]
  38528. // }
  38529. }
  38530. // Pages invokes f for each page of results.
  38531. // A non-nil error returned from f will halt the iteration.
  38532. // The provided context supersedes any context provided to the Context method.
  38533. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  38534. c.ctx_ = ctx
  38535. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38536. for {
  38537. x, err := c.Do()
  38538. if err != nil {
  38539. return err
  38540. }
  38541. if err := f(x); err != nil {
  38542. return err
  38543. }
  38544. if x.NextPageToken == "" {
  38545. return nil
  38546. }
  38547. c.PageToken(x.NextPageToken)
  38548. }
  38549. }
  38550. // method id "compute.acceleratorTypes.get":
  38551. type AcceleratorTypesGetCall struct {
  38552. s *Service
  38553. project string
  38554. zone string
  38555. acceleratorType string
  38556. urlParams_ gensupport.URLParams
  38557. ifNoneMatch_ string
  38558. ctx_ context.Context
  38559. header_ http.Header
  38560. }
  38561. // Get: Returns the specified accelerator type.
  38562. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  38563. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38564. c.project = project
  38565. c.zone = zone
  38566. c.acceleratorType = acceleratorType
  38567. return c
  38568. }
  38569. // Fields allows partial responses to be retrieved. See
  38570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38571. // for more information.
  38572. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  38573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38574. return c
  38575. }
  38576. // IfNoneMatch sets the optional parameter which makes the operation
  38577. // fail if the object's ETag matches the given value. This is useful for
  38578. // getting updates only after the object has changed since the last
  38579. // request. Use googleapi.IsNotModified to check whether the response
  38580. // error from Do is the result of In-None-Match.
  38581. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  38582. c.ifNoneMatch_ = entityTag
  38583. return c
  38584. }
  38585. // Context sets the context to be used in this call's Do method. Any
  38586. // pending HTTP request will be aborted if the provided context is
  38587. // canceled.
  38588. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  38589. c.ctx_ = ctx
  38590. return c
  38591. }
  38592. // Header returns an http.Header that can be modified by the caller to
  38593. // add HTTP headers to the request.
  38594. func (c *AcceleratorTypesGetCall) Header() http.Header {
  38595. if c.header_ == nil {
  38596. c.header_ = make(http.Header)
  38597. }
  38598. return c.header_
  38599. }
  38600. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  38601. reqHeaders := make(http.Header)
  38602. for k, v := range c.header_ {
  38603. reqHeaders[k] = v
  38604. }
  38605. reqHeaders.Set("User-Agent", c.s.userAgent())
  38606. if c.ifNoneMatch_ != "" {
  38607. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38608. }
  38609. var body io.Reader = nil
  38610. c.urlParams_.Set("alt", alt)
  38611. c.urlParams_.Set("prettyPrint", "false")
  38612. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  38613. urls += "?" + c.urlParams_.Encode()
  38614. req, err := http.NewRequest("GET", urls, body)
  38615. if err != nil {
  38616. return nil, err
  38617. }
  38618. req.Header = reqHeaders
  38619. googleapi.Expand(req.URL, map[string]string{
  38620. "project": c.project,
  38621. "zone": c.zone,
  38622. "acceleratorType": c.acceleratorType,
  38623. })
  38624. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38625. }
  38626. // Do executes the "compute.acceleratorTypes.get" call.
  38627. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  38628. // status code is an error. Response headers are in either
  38629. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  38630. // at all) in error.(*googleapi.Error).Header. Use
  38631. // googleapi.IsNotModified to check whether the returned error was
  38632. // because http.StatusNotModified was returned.
  38633. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  38634. gensupport.SetOptions(c.urlParams_, opts...)
  38635. res, err := c.doRequest("json")
  38636. if res != nil && res.StatusCode == http.StatusNotModified {
  38637. if res.Body != nil {
  38638. res.Body.Close()
  38639. }
  38640. return nil, &googleapi.Error{
  38641. Code: res.StatusCode,
  38642. Header: res.Header,
  38643. }
  38644. }
  38645. if err != nil {
  38646. return nil, err
  38647. }
  38648. defer googleapi.CloseBody(res)
  38649. if err := googleapi.CheckResponse(res); err != nil {
  38650. return nil, err
  38651. }
  38652. ret := &AcceleratorType{
  38653. ServerResponse: googleapi.ServerResponse{
  38654. Header: res.Header,
  38655. HTTPStatusCode: res.StatusCode,
  38656. },
  38657. }
  38658. target := &ret
  38659. if err := gensupport.DecodeResponse(target, res); err != nil {
  38660. return nil, err
  38661. }
  38662. return ret, nil
  38663. // {
  38664. // "description": "Returns the specified accelerator type.",
  38665. // "httpMethod": "GET",
  38666. // "id": "compute.acceleratorTypes.get",
  38667. // "parameterOrder": [
  38668. // "project",
  38669. // "zone",
  38670. // "acceleratorType"
  38671. // ],
  38672. // "parameters": {
  38673. // "acceleratorType": {
  38674. // "description": "Name of the accelerator type to return.",
  38675. // "location": "path",
  38676. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38677. // "required": true,
  38678. // "type": "string"
  38679. // },
  38680. // "project": {
  38681. // "description": "Project ID for this request.",
  38682. // "location": "path",
  38683. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38684. // "required": true,
  38685. // "type": "string"
  38686. // },
  38687. // "zone": {
  38688. // "description": "The name of the zone for this request.",
  38689. // "location": "path",
  38690. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38691. // "required": true,
  38692. // "type": "string"
  38693. // }
  38694. // },
  38695. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  38696. // "response": {
  38697. // "$ref": "AcceleratorType"
  38698. // },
  38699. // "scopes": [
  38700. // "https://www.googleapis.com/auth/cloud-platform",
  38701. // "https://www.googleapis.com/auth/compute",
  38702. // "https://www.googleapis.com/auth/compute.readonly"
  38703. // ]
  38704. // }
  38705. }
  38706. // method id "compute.acceleratorTypes.list":
  38707. type AcceleratorTypesListCall struct {
  38708. s *Service
  38709. project string
  38710. zone string
  38711. urlParams_ gensupport.URLParams
  38712. ifNoneMatch_ string
  38713. ctx_ context.Context
  38714. header_ http.Header
  38715. }
  38716. // List: Retrieves a list of accelerator types available to the
  38717. // specified project.
  38718. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  38719. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38720. c.project = project
  38721. c.zone = zone
  38722. return c
  38723. }
  38724. // Filter sets the optional parameter "filter": A filter expression that
  38725. // filters resources listed in the response. The expression must specify
  38726. // the field name, a comparison operator, and the value that you want to
  38727. // use for filtering. The value must be a string, a number, or a
  38728. // boolean. The comparison operator must be either =, !=, >, or <.
  38729. //
  38730. // For example, if you are filtering Compute Engine instances, you can
  38731. // exclude instances named example-instance by specifying name !=
  38732. // example-instance.
  38733. //
  38734. // You can also filter nested fields. For example, you could specify
  38735. // scheduling.automaticRestart = false to include instances only if they
  38736. // are not scheduled for automatic restarts. You can use filtering on
  38737. // nested fields to filter based on resource labels.
  38738. //
  38739. // To filter on multiple expressions, provide each separate expression
  38740. // within parentheses. For example, (scheduling.automaticRestart = true)
  38741. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38742. // AND expression. However, you can include AND and OR expressions
  38743. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38744. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38745. // true).
  38746. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  38747. c.urlParams_.Set("filter", filter)
  38748. return c
  38749. }
  38750. // MaxResults sets the optional parameter "maxResults": The maximum
  38751. // number of results per page that should be returned. If the number of
  38752. // available results is larger than maxResults, Compute Engine returns a
  38753. // nextPageToken that can be used to get the next page of results in
  38754. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38755. // (Default: 500)
  38756. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  38757. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38758. return c
  38759. }
  38760. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38761. // a certain order. By default, results are returned in alphanumerical
  38762. // order based on the resource name.
  38763. //
  38764. // You can also sort results in descending order based on the creation
  38765. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38766. // based on the creationTimestamp field in reverse chronological order
  38767. // (newest result first). Use this to sort resources like operations so
  38768. // that the newest operation is returned first.
  38769. //
  38770. // Currently, only sorting by name or creationTimestamp desc is
  38771. // supported.
  38772. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  38773. c.urlParams_.Set("orderBy", orderBy)
  38774. return c
  38775. }
  38776. // PageToken sets the optional parameter "pageToken": Specifies a page
  38777. // token to use. Set pageToken to the nextPageToken returned by a
  38778. // previous list request to get the next page of results.
  38779. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  38780. c.urlParams_.Set("pageToken", pageToken)
  38781. return c
  38782. }
  38783. // Fields allows partial responses to be retrieved. See
  38784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38785. // for more information.
  38786. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  38787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38788. return c
  38789. }
  38790. // IfNoneMatch sets the optional parameter which makes the operation
  38791. // fail if the object's ETag matches the given value. This is useful for
  38792. // getting updates only after the object has changed since the last
  38793. // request. Use googleapi.IsNotModified to check whether the response
  38794. // error from Do is the result of In-None-Match.
  38795. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  38796. c.ifNoneMatch_ = entityTag
  38797. return c
  38798. }
  38799. // Context sets the context to be used in this call's Do method. Any
  38800. // pending HTTP request will be aborted if the provided context is
  38801. // canceled.
  38802. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  38803. c.ctx_ = ctx
  38804. return c
  38805. }
  38806. // Header returns an http.Header that can be modified by the caller to
  38807. // add HTTP headers to the request.
  38808. func (c *AcceleratorTypesListCall) Header() http.Header {
  38809. if c.header_ == nil {
  38810. c.header_ = make(http.Header)
  38811. }
  38812. return c.header_
  38813. }
  38814. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  38815. reqHeaders := make(http.Header)
  38816. for k, v := range c.header_ {
  38817. reqHeaders[k] = v
  38818. }
  38819. reqHeaders.Set("User-Agent", c.s.userAgent())
  38820. if c.ifNoneMatch_ != "" {
  38821. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38822. }
  38823. var body io.Reader = nil
  38824. c.urlParams_.Set("alt", alt)
  38825. c.urlParams_.Set("prettyPrint", "false")
  38826. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  38827. urls += "?" + c.urlParams_.Encode()
  38828. req, err := http.NewRequest("GET", urls, body)
  38829. if err != nil {
  38830. return nil, err
  38831. }
  38832. req.Header = reqHeaders
  38833. googleapi.Expand(req.URL, map[string]string{
  38834. "project": c.project,
  38835. "zone": c.zone,
  38836. })
  38837. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38838. }
  38839. // Do executes the "compute.acceleratorTypes.list" call.
  38840. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  38841. // non-2xx status code is an error. Response headers are in either
  38842. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  38843. // returned at all) in error.(*googleapi.Error).Header. Use
  38844. // googleapi.IsNotModified to check whether the returned error was
  38845. // because http.StatusNotModified was returned.
  38846. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  38847. gensupport.SetOptions(c.urlParams_, opts...)
  38848. res, err := c.doRequest("json")
  38849. if res != nil && res.StatusCode == http.StatusNotModified {
  38850. if res.Body != nil {
  38851. res.Body.Close()
  38852. }
  38853. return nil, &googleapi.Error{
  38854. Code: res.StatusCode,
  38855. Header: res.Header,
  38856. }
  38857. }
  38858. if err != nil {
  38859. return nil, err
  38860. }
  38861. defer googleapi.CloseBody(res)
  38862. if err := googleapi.CheckResponse(res); err != nil {
  38863. return nil, err
  38864. }
  38865. ret := &AcceleratorTypeList{
  38866. ServerResponse: googleapi.ServerResponse{
  38867. Header: res.Header,
  38868. HTTPStatusCode: res.StatusCode,
  38869. },
  38870. }
  38871. target := &ret
  38872. if err := gensupport.DecodeResponse(target, res); err != nil {
  38873. return nil, err
  38874. }
  38875. return ret, nil
  38876. // {
  38877. // "description": "Retrieves a list of accelerator types available to the specified project.",
  38878. // "httpMethod": "GET",
  38879. // "id": "compute.acceleratorTypes.list",
  38880. // "parameterOrder": [
  38881. // "project",
  38882. // "zone"
  38883. // ],
  38884. // "parameters": {
  38885. // "filter": {
  38886. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  38887. // "location": "query",
  38888. // "type": "string"
  38889. // },
  38890. // "maxResults": {
  38891. // "default": "500",
  38892. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  38893. // "format": "uint32",
  38894. // "location": "query",
  38895. // "minimum": "0",
  38896. // "type": "integer"
  38897. // },
  38898. // "orderBy": {
  38899. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  38900. // "location": "query",
  38901. // "type": "string"
  38902. // },
  38903. // "pageToken": {
  38904. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  38905. // "location": "query",
  38906. // "type": "string"
  38907. // },
  38908. // "project": {
  38909. // "description": "Project ID for this request.",
  38910. // "location": "path",
  38911. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38912. // "required": true,
  38913. // "type": "string"
  38914. // },
  38915. // "zone": {
  38916. // "description": "The name of the zone for this request.",
  38917. // "location": "path",
  38918. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38919. // "required": true,
  38920. // "type": "string"
  38921. // }
  38922. // },
  38923. // "path": "{project}/zones/{zone}/acceleratorTypes",
  38924. // "response": {
  38925. // "$ref": "AcceleratorTypeList"
  38926. // },
  38927. // "scopes": [
  38928. // "https://www.googleapis.com/auth/cloud-platform",
  38929. // "https://www.googleapis.com/auth/compute",
  38930. // "https://www.googleapis.com/auth/compute.readonly"
  38931. // ]
  38932. // }
  38933. }
  38934. // Pages invokes f for each page of results.
  38935. // A non-nil error returned from f will halt the iteration.
  38936. // The provided context supersedes any context provided to the Context method.
  38937. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  38938. c.ctx_ = ctx
  38939. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38940. for {
  38941. x, err := c.Do()
  38942. if err != nil {
  38943. return err
  38944. }
  38945. if err := f(x); err != nil {
  38946. return err
  38947. }
  38948. if x.NextPageToken == "" {
  38949. return nil
  38950. }
  38951. c.PageToken(x.NextPageToken)
  38952. }
  38953. }
  38954. // method id "compute.addresses.aggregatedList":
  38955. type AddressesAggregatedListCall struct {
  38956. s *Service
  38957. project string
  38958. urlParams_ gensupport.URLParams
  38959. ifNoneMatch_ string
  38960. ctx_ context.Context
  38961. header_ http.Header
  38962. }
  38963. // AggregatedList: Retrieves an aggregated list of addresses.
  38964. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  38965. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  38966. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38967. c.project = project
  38968. return c
  38969. }
  38970. // Filter sets the optional parameter "filter": A filter expression that
  38971. // filters resources listed in the response. The expression must specify
  38972. // the field name, a comparison operator, and the value that you want to
  38973. // use for filtering. The value must be a string, a number, or a
  38974. // boolean. The comparison operator must be either =, !=, >, or <.
  38975. //
  38976. // For example, if you are filtering Compute Engine instances, you can
  38977. // exclude instances named example-instance by specifying name !=
  38978. // example-instance.
  38979. //
  38980. // You can also filter nested fields. For example, you could specify
  38981. // scheduling.automaticRestart = false to include instances only if they
  38982. // are not scheduled for automatic restarts. You can use filtering on
  38983. // nested fields to filter based on resource labels.
  38984. //
  38985. // To filter on multiple expressions, provide each separate expression
  38986. // within parentheses. For example, (scheduling.automaticRestart = true)
  38987. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38988. // AND expression. However, you can include AND and OR expressions
  38989. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38990. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38991. // true).
  38992. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  38993. c.urlParams_.Set("filter", filter)
  38994. return c
  38995. }
  38996. // MaxResults sets the optional parameter "maxResults": The maximum
  38997. // number of results per page that should be returned. If the number of
  38998. // available results is larger than maxResults, Compute Engine returns a
  38999. // nextPageToken that can be used to get the next page of results in
  39000. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39001. // (Default: 500)
  39002. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  39003. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39004. return c
  39005. }
  39006. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39007. // a certain order. By default, results are returned in alphanumerical
  39008. // order based on the resource name.
  39009. //
  39010. // You can also sort results in descending order based on the creation
  39011. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39012. // based on the creationTimestamp field in reverse chronological order
  39013. // (newest result first). Use this to sort resources like operations so
  39014. // that the newest operation is returned first.
  39015. //
  39016. // Currently, only sorting by name or creationTimestamp desc is
  39017. // supported.
  39018. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  39019. c.urlParams_.Set("orderBy", orderBy)
  39020. return c
  39021. }
  39022. // PageToken sets the optional parameter "pageToken": Specifies a page
  39023. // token to use. Set pageToken to the nextPageToken returned by a
  39024. // previous list request to get the next page of results.
  39025. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  39026. c.urlParams_.Set("pageToken", pageToken)
  39027. return c
  39028. }
  39029. // Fields allows partial responses to be retrieved. See
  39030. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39031. // for more information.
  39032. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  39033. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39034. return c
  39035. }
  39036. // IfNoneMatch sets the optional parameter which makes the operation
  39037. // fail if the object's ETag matches the given value. This is useful for
  39038. // getting updates only after the object has changed since the last
  39039. // request. Use googleapi.IsNotModified to check whether the response
  39040. // error from Do is the result of In-None-Match.
  39041. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  39042. c.ifNoneMatch_ = entityTag
  39043. return c
  39044. }
  39045. // Context sets the context to be used in this call's Do method. Any
  39046. // pending HTTP request will be aborted if the provided context is
  39047. // canceled.
  39048. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  39049. c.ctx_ = ctx
  39050. return c
  39051. }
  39052. // Header returns an http.Header that can be modified by the caller to
  39053. // add HTTP headers to the request.
  39054. func (c *AddressesAggregatedListCall) Header() http.Header {
  39055. if c.header_ == nil {
  39056. c.header_ = make(http.Header)
  39057. }
  39058. return c.header_
  39059. }
  39060. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  39061. reqHeaders := make(http.Header)
  39062. for k, v := range c.header_ {
  39063. reqHeaders[k] = v
  39064. }
  39065. reqHeaders.Set("User-Agent", c.s.userAgent())
  39066. if c.ifNoneMatch_ != "" {
  39067. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39068. }
  39069. var body io.Reader = nil
  39070. c.urlParams_.Set("alt", alt)
  39071. c.urlParams_.Set("prettyPrint", "false")
  39072. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  39073. urls += "?" + c.urlParams_.Encode()
  39074. req, err := http.NewRequest("GET", urls, body)
  39075. if err != nil {
  39076. return nil, err
  39077. }
  39078. req.Header = reqHeaders
  39079. googleapi.Expand(req.URL, map[string]string{
  39080. "project": c.project,
  39081. })
  39082. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39083. }
  39084. // Do executes the "compute.addresses.aggregatedList" call.
  39085. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  39086. // non-2xx status code is an error. Response headers are in either
  39087. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  39088. // returned at all) in error.(*googleapi.Error).Header. Use
  39089. // googleapi.IsNotModified to check whether the returned error was
  39090. // because http.StatusNotModified was returned.
  39091. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  39092. gensupport.SetOptions(c.urlParams_, opts...)
  39093. res, err := c.doRequest("json")
  39094. if res != nil && res.StatusCode == http.StatusNotModified {
  39095. if res.Body != nil {
  39096. res.Body.Close()
  39097. }
  39098. return nil, &googleapi.Error{
  39099. Code: res.StatusCode,
  39100. Header: res.Header,
  39101. }
  39102. }
  39103. if err != nil {
  39104. return nil, err
  39105. }
  39106. defer googleapi.CloseBody(res)
  39107. if err := googleapi.CheckResponse(res); err != nil {
  39108. return nil, err
  39109. }
  39110. ret := &AddressAggregatedList{
  39111. ServerResponse: googleapi.ServerResponse{
  39112. Header: res.Header,
  39113. HTTPStatusCode: res.StatusCode,
  39114. },
  39115. }
  39116. target := &ret
  39117. if err := gensupport.DecodeResponse(target, res); err != nil {
  39118. return nil, err
  39119. }
  39120. return ret, nil
  39121. // {
  39122. // "description": "Retrieves an aggregated list of addresses.",
  39123. // "httpMethod": "GET",
  39124. // "id": "compute.addresses.aggregatedList",
  39125. // "parameterOrder": [
  39126. // "project"
  39127. // ],
  39128. // "parameters": {
  39129. // "filter": {
  39130. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  39131. // "location": "query",
  39132. // "type": "string"
  39133. // },
  39134. // "maxResults": {
  39135. // "default": "500",
  39136. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  39137. // "format": "uint32",
  39138. // "location": "query",
  39139. // "minimum": "0",
  39140. // "type": "integer"
  39141. // },
  39142. // "orderBy": {
  39143. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  39144. // "location": "query",
  39145. // "type": "string"
  39146. // },
  39147. // "pageToken": {
  39148. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  39149. // "location": "query",
  39150. // "type": "string"
  39151. // },
  39152. // "project": {
  39153. // "description": "Project ID for this request.",
  39154. // "location": "path",
  39155. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39156. // "required": true,
  39157. // "type": "string"
  39158. // }
  39159. // },
  39160. // "path": "{project}/aggregated/addresses",
  39161. // "response": {
  39162. // "$ref": "AddressAggregatedList"
  39163. // },
  39164. // "scopes": [
  39165. // "https://www.googleapis.com/auth/cloud-platform",
  39166. // "https://www.googleapis.com/auth/compute",
  39167. // "https://www.googleapis.com/auth/compute.readonly"
  39168. // ]
  39169. // }
  39170. }
  39171. // Pages invokes f for each page of results.
  39172. // A non-nil error returned from f will halt the iteration.
  39173. // The provided context supersedes any context provided to the Context method.
  39174. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  39175. c.ctx_ = ctx
  39176. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39177. for {
  39178. x, err := c.Do()
  39179. if err != nil {
  39180. return err
  39181. }
  39182. if err := f(x); err != nil {
  39183. return err
  39184. }
  39185. if x.NextPageToken == "" {
  39186. return nil
  39187. }
  39188. c.PageToken(x.NextPageToken)
  39189. }
  39190. }
  39191. // method id "compute.addresses.delete":
  39192. type AddressesDeleteCall struct {
  39193. s *Service
  39194. project string
  39195. region string
  39196. address string
  39197. urlParams_ gensupport.URLParams
  39198. ctx_ context.Context
  39199. header_ http.Header
  39200. }
  39201. // Delete: Deletes the specified address resource.
  39202. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  39203. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  39204. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39205. c.project = project
  39206. c.region = region
  39207. c.address = address
  39208. return c
  39209. }
  39210. // RequestId sets the optional parameter "requestId": An optional
  39211. // request ID to identify requests. Specify a unique request ID so that
  39212. // if you must retry your request, the server will know to ignore the
  39213. // request if it has already been completed.
  39214. //
  39215. // For example, consider a situation where you make an initial request
  39216. // and the request times out. If you make the request again with the
  39217. // same request ID, the server can check if original operation with the
  39218. // same request ID was received, and if so, will ignore the second
  39219. // request. This prevents clients from accidentally creating duplicate
  39220. // commitments.
  39221. //
  39222. // The request ID must be a valid UUID with the exception that zero UUID
  39223. // is not supported (00000000-0000-0000-0000-000000000000).
  39224. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  39225. c.urlParams_.Set("requestId", requestId)
  39226. return c
  39227. }
  39228. // Fields allows partial responses to be retrieved. See
  39229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39230. // for more information.
  39231. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  39232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39233. return c
  39234. }
  39235. // Context sets the context to be used in this call's Do method. Any
  39236. // pending HTTP request will be aborted if the provided context is
  39237. // canceled.
  39238. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  39239. c.ctx_ = ctx
  39240. return c
  39241. }
  39242. // Header returns an http.Header that can be modified by the caller to
  39243. // add HTTP headers to the request.
  39244. func (c *AddressesDeleteCall) Header() http.Header {
  39245. if c.header_ == nil {
  39246. c.header_ = make(http.Header)
  39247. }
  39248. return c.header_
  39249. }
  39250. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  39251. reqHeaders := make(http.Header)
  39252. for k, v := range c.header_ {
  39253. reqHeaders[k] = v
  39254. }
  39255. reqHeaders.Set("User-Agent", c.s.userAgent())
  39256. var body io.Reader = nil
  39257. c.urlParams_.Set("alt", alt)
  39258. c.urlParams_.Set("prettyPrint", "false")
  39259. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  39260. urls += "?" + c.urlParams_.Encode()
  39261. req, err := http.NewRequest("DELETE", urls, body)
  39262. if err != nil {
  39263. return nil, err
  39264. }
  39265. req.Header = reqHeaders
  39266. googleapi.Expand(req.URL, map[string]string{
  39267. "project": c.project,
  39268. "region": c.region,
  39269. "address": c.address,
  39270. })
  39271. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39272. }
  39273. // Do executes the "compute.addresses.delete" call.
  39274. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39275. // status code is an error. Response headers are in either
  39276. // *Operation.ServerResponse.Header or (if a response was returned at
  39277. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39278. // to check whether the returned error was because
  39279. // http.StatusNotModified was returned.
  39280. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39281. gensupport.SetOptions(c.urlParams_, opts...)
  39282. res, err := c.doRequest("json")
  39283. if res != nil && res.StatusCode == http.StatusNotModified {
  39284. if res.Body != nil {
  39285. res.Body.Close()
  39286. }
  39287. return nil, &googleapi.Error{
  39288. Code: res.StatusCode,
  39289. Header: res.Header,
  39290. }
  39291. }
  39292. if err != nil {
  39293. return nil, err
  39294. }
  39295. defer googleapi.CloseBody(res)
  39296. if err := googleapi.CheckResponse(res); err != nil {
  39297. return nil, err
  39298. }
  39299. ret := &Operation{
  39300. ServerResponse: googleapi.ServerResponse{
  39301. Header: res.Header,
  39302. HTTPStatusCode: res.StatusCode,
  39303. },
  39304. }
  39305. target := &ret
  39306. if err := gensupport.DecodeResponse(target, res); err != nil {
  39307. return nil, err
  39308. }
  39309. return ret, nil
  39310. // {
  39311. // "description": "Deletes the specified address resource.",
  39312. // "httpMethod": "DELETE",
  39313. // "id": "compute.addresses.delete",
  39314. // "parameterOrder": [
  39315. // "project",
  39316. // "region",
  39317. // "address"
  39318. // ],
  39319. // "parameters": {
  39320. // "address": {
  39321. // "description": "Name of the address resource to delete.",
  39322. // "location": "path",
  39323. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39324. // "required": true,
  39325. // "type": "string"
  39326. // },
  39327. // "project": {
  39328. // "description": "Project ID for this request.",
  39329. // "location": "path",
  39330. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39331. // "required": true,
  39332. // "type": "string"
  39333. // },
  39334. // "region": {
  39335. // "description": "Name of the region for this request.",
  39336. // "location": "path",
  39337. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39338. // "required": true,
  39339. // "type": "string"
  39340. // },
  39341. // "requestId": {
  39342. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39343. // "location": "query",
  39344. // "type": "string"
  39345. // }
  39346. // },
  39347. // "path": "{project}/regions/{region}/addresses/{address}",
  39348. // "response": {
  39349. // "$ref": "Operation"
  39350. // },
  39351. // "scopes": [
  39352. // "https://www.googleapis.com/auth/cloud-platform",
  39353. // "https://www.googleapis.com/auth/compute"
  39354. // ]
  39355. // }
  39356. }
  39357. // method id "compute.addresses.get":
  39358. type AddressesGetCall struct {
  39359. s *Service
  39360. project string
  39361. region string
  39362. address string
  39363. urlParams_ gensupport.URLParams
  39364. ifNoneMatch_ string
  39365. ctx_ context.Context
  39366. header_ http.Header
  39367. }
  39368. // Get: Returns the specified address resource.
  39369. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  39370. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  39371. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39372. c.project = project
  39373. c.region = region
  39374. c.address = address
  39375. return c
  39376. }
  39377. // Fields allows partial responses to be retrieved. See
  39378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39379. // for more information.
  39380. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  39381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39382. return c
  39383. }
  39384. // IfNoneMatch sets the optional parameter which makes the operation
  39385. // fail if the object's ETag matches the given value. This is useful for
  39386. // getting updates only after the object has changed since the last
  39387. // request. Use googleapi.IsNotModified to check whether the response
  39388. // error from Do is the result of In-None-Match.
  39389. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  39390. c.ifNoneMatch_ = entityTag
  39391. return c
  39392. }
  39393. // Context sets the context to be used in this call's Do method. Any
  39394. // pending HTTP request will be aborted if the provided context is
  39395. // canceled.
  39396. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  39397. c.ctx_ = ctx
  39398. return c
  39399. }
  39400. // Header returns an http.Header that can be modified by the caller to
  39401. // add HTTP headers to the request.
  39402. func (c *AddressesGetCall) Header() http.Header {
  39403. if c.header_ == nil {
  39404. c.header_ = make(http.Header)
  39405. }
  39406. return c.header_
  39407. }
  39408. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  39409. reqHeaders := make(http.Header)
  39410. for k, v := range c.header_ {
  39411. reqHeaders[k] = v
  39412. }
  39413. reqHeaders.Set("User-Agent", c.s.userAgent())
  39414. if c.ifNoneMatch_ != "" {
  39415. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39416. }
  39417. var body io.Reader = nil
  39418. c.urlParams_.Set("alt", alt)
  39419. c.urlParams_.Set("prettyPrint", "false")
  39420. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  39421. urls += "?" + c.urlParams_.Encode()
  39422. req, err := http.NewRequest("GET", urls, body)
  39423. if err != nil {
  39424. return nil, err
  39425. }
  39426. req.Header = reqHeaders
  39427. googleapi.Expand(req.URL, map[string]string{
  39428. "project": c.project,
  39429. "region": c.region,
  39430. "address": c.address,
  39431. })
  39432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39433. }
  39434. // Do executes the "compute.addresses.get" call.
  39435. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  39436. // code is an error. Response headers are in either
  39437. // *Address.ServerResponse.Header or (if a response was returned at all)
  39438. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39439. // check whether the returned error was because http.StatusNotModified
  39440. // was returned.
  39441. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  39442. gensupport.SetOptions(c.urlParams_, opts...)
  39443. res, err := c.doRequest("json")
  39444. if res != nil && res.StatusCode == http.StatusNotModified {
  39445. if res.Body != nil {
  39446. res.Body.Close()
  39447. }
  39448. return nil, &googleapi.Error{
  39449. Code: res.StatusCode,
  39450. Header: res.Header,
  39451. }
  39452. }
  39453. if err != nil {
  39454. return nil, err
  39455. }
  39456. defer googleapi.CloseBody(res)
  39457. if err := googleapi.CheckResponse(res); err != nil {
  39458. return nil, err
  39459. }
  39460. ret := &Address{
  39461. ServerResponse: googleapi.ServerResponse{
  39462. Header: res.Header,
  39463. HTTPStatusCode: res.StatusCode,
  39464. },
  39465. }
  39466. target := &ret
  39467. if err := gensupport.DecodeResponse(target, res); err != nil {
  39468. return nil, err
  39469. }
  39470. return ret, nil
  39471. // {
  39472. // "description": "Returns the specified address resource.",
  39473. // "httpMethod": "GET",
  39474. // "id": "compute.addresses.get",
  39475. // "parameterOrder": [
  39476. // "project",
  39477. // "region",
  39478. // "address"
  39479. // ],
  39480. // "parameters": {
  39481. // "address": {
  39482. // "description": "Name of the address resource to return.",
  39483. // "location": "path",
  39484. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39485. // "required": true,
  39486. // "type": "string"
  39487. // },
  39488. // "project": {
  39489. // "description": "Project ID for this request.",
  39490. // "location": "path",
  39491. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39492. // "required": true,
  39493. // "type": "string"
  39494. // },
  39495. // "region": {
  39496. // "description": "Name of the region for this request.",
  39497. // "location": "path",
  39498. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39499. // "required": true,
  39500. // "type": "string"
  39501. // }
  39502. // },
  39503. // "path": "{project}/regions/{region}/addresses/{address}",
  39504. // "response": {
  39505. // "$ref": "Address"
  39506. // },
  39507. // "scopes": [
  39508. // "https://www.googleapis.com/auth/cloud-platform",
  39509. // "https://www.googleapis.com/auth/compute",
  39510. // "https://www.googleapis.com/auth/compute.readonly"
  39511. // ]
  39512. // }
  39513. }
  39514. // method id "compute.addresses.insert":
  39515. type AddressesInsertCall struct {
  39516. s *Service
  39517. project string
  39518. region string
  39519. address *Address
  39520. urlParams_ gensupport.URLParams
  39521. ctx_ context.Context
  39522. header_ http.Header
  39523. }
  39524. // Insert: Creates an address resource in the specified project using
  39525. // the data included in the request.
  39526. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  39527. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  39528. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39529. c.project = project
  39530. c.region = region
  39531. c.address = address
  39532. return c
  39533. }
  39534. // RequestId sets the optional parameter "requestId": An optional
  39535. // request ID to identify requests. Specify a unique request ID so that
  39536. // if you must retry your request, the server will know to ignore the
  39537. // request if it has already been completed.
  39538. //
  39539. // For example, consider a situation where you make an initial request
  39540. // and the request times out. If you make the request again with the
  39541. // same request ID, the server can check if original operation with the
  39542. // same request ID was received, and if so, will ignore the second
  39543. // request. This prevents clients from accidentally creating duplicate
  39544. // commitments.
  39545. //
  39546. // The request ID must be a valid UUID with the exception that zero UUID
  39547. // is not supported (00000000-0000-0000-0000-000000000000).
  39548. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  39549. c.urlParams_.Set("requestId", requestId)
  39550. return c
  39551. }
  39552. // Fields allows partial responses to be retrieved. See
  39553. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39554. // for more information.
  39555. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  39556. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39557. return c
  39558. }
  39559. // Context sets the context to be used in this call's Do method. Any
  39560. // pending HTTP request will be aborted if the provided context is
  39561. // canceled.
  39562. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  39563. c.ctx_ = ctx
  39564. return c
  39565. }
  39566. // Header returns an http.Header that can be modified by the caller to
  39567. // add HTTP headers to the request.
  39568. func (c *AddressesInsertCall) Header() http.Header {
  39569. if c.header_ == nil {
  39570. c.header_ = make(http.Header)
  39571. }
  39572. return c.header_
  39573. }
  39574. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  39575. reqHeaders := make(http.Header)
  39576. for k, v := range c.header_ {
  39577. reqHeaders[k] = v
  39578. }
  39579. reqHeaders.Set("User-Agent", c.s.userAgent())
  39580. var body io.Reader = nil
  39581. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  39582. if err != nil {
  39583. return nil, err
  39584. }
  39585. reqHeaders.Set("Content-Type", "application/json")
  39586. c.urlParams_.Set("alt", alt)
  39587. c.urlParams_.Set("prettyPrint", "false")
  39588. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  39589. urls += "?" + c.urlParams_.Encode()
  39590. req, err := http.NewRequest("POST", urls, body)
  39591. if err != nil {
  39592. return nil, err
  39593. }
  39594. req.Header = reqHeaders
  39595. googleapi.Expand(req.URL, map[string]string{
  39596. "project": c.project,
  39597. "region": c.region,
  39598. })
  39599. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39600. }
  39601. // Do executes the "compute.addresses.insert" call.
  39602. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39603. // status code is an error. Response headers are in either
  39604. // *Operation.ServerResponse.Header or (if a response was returned at
  39605. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39606. // to check whether the returned error was because
  39607. // http.StatusNotModified was returned.
  39608. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39609. gensupport.SetOptions(c.urlParams_, opts...)
  39610. res, err := c.doRequest("json")
  39611. if res != nil && res.StatusCode == http.StatusNotModified {
  39612. if res.Body != nil {
  39613. res.Body.Close()
  39614. }
  39615. return nil, &googleapi.Error{
  39616. Code: res.StatusCode,
  39617. Header: res.Header,
  39618. }
  39619. }
  39620. if err != nil {
  39621. return nil, err
  39622. }
  39623. defer googleapi.CloseBody(res)
  39624. if err := googleapi.CheckResponse(res); err != nil {
  39625. return nil, err
  39626. }
  39627. ret := &Operation{
  39628. ServerResponse: googleapi.ServerResponse{
  39629. Header: res.Header,
  39630. HTTPStatusCode: res.StatusCode,
  39631. },
  39632. }
  39633. target := &ret
  39634. if err := gensupport.DecodeResponse(target, res); err != nil {
  39635. return nil, err
  39636. }
  39637. return ret, nil
  39638. // {
  39639. // "description": "Creates an address resource in the specified project using the data included in the request.",
  39640. // "httpMethod": "POST",
  39641. // "id": "compute.addresses.insert",
  39642. // "parameterOrder": [
  39643. // "project",
  39644. // "region"
  39645. // ],
  39646. // "parameters": {
  39647. // "project": {
  39648. // "description": "Project ID for this request.",
  39649. // "location": "path",
  39650. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39651. // "required": true,
  39652. // "type": "string"
  39653. // },
  39654. // "region": {
  39655. // "description": "Name of the region for this request.",
  39656. // "location": "path",
  39657. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39658. // "required": true,
  39659. // "type": "string"
  39660. // },
  39661. // "requestId": {
  39662. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39663. // "location": "query",
  39664. // "type": "string"
  39665. // }
  39666. // },
  39667. // "path": "{project}/regions/{region}/addresses",
  39668. // "request": {
  39669. // "$ref": "Address"
  39670. // },
  39671. // "response": {
  39672. // "$ref": "Operation"
  39673. // },
  39674. // "scopes": [
  39675. // "https://www.googleapis.com/auth/cloud-platform",
  39676. // "https://www.googleapis.com/auth/compute"
  39677. // ]
  39678. // }
  39679. }
  39680. // method id "compute.addresses.list":
  39681. type AddressesListCall struct {
  39682. s *Service
  39683. project string
  39684. region string
  39685. urlParams_ gensupport.URLParams
  39686. ifNoneMatch_ string
  39687. ctx_ context.Context
  39688. header_ http.Header
  39689. }
  39690. // List: Retrieves a list of addresses contained within the specified
  39691. // region.
  39692. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  39693. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  39694. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39695. c.project = project
  39696. c.region = region
  39697. return c
  39698. }
  39699. // Filter sets the optional parameter "filter": A filter expression that
  39700. // filters resources listed in the response. The expression must specify
  39701. // the field name, a comparison operator, and the value that you want to
  39702. // use for filtering. The value must be a string, a number, or a
  39703. // boolean. The comparison operator must be either =, !=, >, or <.
  39704. //
  39705. // For example, if you are filtering Compute Engine instances, you can
  39706. // exclude instances named example-instance by specifying name !=
  39707. // example-instance.
  39708. //
  39709. // You can also filter nested fields. For example, you could specify
  39710. // scheduling.automaticRestart = false to include instances only if they
  39711. // are not scheduled for automatic restarts. You can use filtering on
  39712. // nested fields to filter based on resource labels.
  39713. //
  39714. // To filter on multiple expressions, provide each separate expression
  39715. // within parentheses. For example, (scheduling.automaticRestart = true)
  39716. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39717. // AND expression. However, you can include AND and OR expressions
  39718. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39719. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39720. // true).
  39721. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  39722. c.urlParams_.Set("filter", filter)
  39723. return c
  39724. }
  39725. // MaxResults sets the optional parameter "maxResults": The maximum
  39726. // number of results per page that should be returned. If the number of
  39727. // available results is larger than maxResults, Compute Engine returns a
  39728. // nextPageToken that can be used to get the next page of results in
  39729. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39730. // (Default: 500)
  39731. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  39732. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39733. return c
  39734. }
  39735. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39736. // a certain order. By default, results are returned in alphanumerical
  39737. // order based on the resource name.
  39738. //
  39739. // You can also sort results in descending order based on the creation
  39740. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39741. // based on the creationTimestamp field in reverse chronological order
  39742. // (newest result first). Use this to sort resources like operations so
  39743. // that the newest operation is returned first.
  39744. //
  39745. // Currently, only sorting by name or creationTimestamp desc is
  39746. // supported.
  39747. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  39748. c.urlParams_.Set("orderBy", orderBy)
  39749. return c
  39750. }
  39751. // PageToken sets the optional parameter "pageToken": Specifies a page
  39752. // token to use. Set pageToken to the nextPageToken returned by a
  39753. // previous list request to get the next page of results.
  39754. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  39755. c.urlParams_.Set("pageToken", pageToken)
  39756. return c
  39757. }
  39758. // Fields allows partial responses to be retrieved. See
  39759. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39760. // for more information.
  39761. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  39762. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39763. return c
  39764. }
  39765. // IfNoneMatch sets the optional parameter which makes the operation
  39766. // fail if the object's ETag matches the given value. This is useful for
  39767. // getting updates only after the object has changed since the last
  39768. // request. Use googleapi.IsNotModified to check whether the response
  39769. // error from Do is the result of In-None-Match.
  39770. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  39771. c.ifNoneMatch_ = entityTag
  39772. return c
  39773. }
  39774. // Context sets the context to be used in this call's Do method. Any
  39775. // pending HTTP request will be aborted if the provided context is
  39776. // canceled.
  39777. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  39778. c.ctx_ = ctx
  39779. return c
  39780. }
  39781. // Header returns an http.Header that can be modified by the caller to
  39782. // add HTTP headers to the request.
  39783. func (c *AddressesListCall) Header() http.Header {
  39784. if c.header_ == nil {
  39785. c.header_ = make(http.Header)
  39786. }
  39787. return c.header_
  39788. }
  39789. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  39790. reqHeaders := make(http.Header)
  39791. for k, v := range c.header_ {
  39792. reqHeaders[k] = v
  39793. }
  39794. reqHeaders.Set("User-Agent", c.s.userAgent())
  39795. if c.ifNoneMatch_ != "" {
  39796. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39797. }
  39798. var body io.Reader = nil
  39799. c.urlParams_.Set("alt", alt)
  39800. c.urlParams_.Set("prettyPrint", "false")
  39801. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  39802. urls += "?" + c.urlParams_.Encode()
  39803. req, err := http.NewRequest("GET", urls, body)
  39804. if err != nil {
  39805. return nil, err
  39806. }
  39807. req.Header = reqHeaders
  39808. googleapi.Expand(req.URL, map[string]string{
  39809. "project": c.project,
  39810. "region": c.region,
  39811. })
  39812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39813. }
  39814. // Do executes the "compute.addresses.list" call.
  39815. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  39816. // status code is an error. Response headers are in either
  39817. // *AddressList.ServerResponse.Header or (if a response was returned at
  39818. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39819. // to check whether the returned error was because
  39820. // http.StatusNotModified was returned.
  39821. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  39822. gensupport.SetOptions(c.urlParams_, opts...)
  39823. res, err := c.doRequest("json")
  39824. if res != nil && res.StatusCode == http.StatusNotModified {
  39825. if res.Body != nil {
  39826. res.Body.Close()
  39827. }
  39828. return nil, &googleapi.Error{
  39829. Code: res.StatusCode,
  39830. Header: res.Header,
  39831. }
  39832. }
  39833. if err != nil {
  39834. return nil, err
  39835. }
  39836. defer googleapi.CloseBody(res)
  39837. if err := googleapi.CheckResponse(res); err != nil {
  39838. return nil, err
  39839. }
  39840. ret := &AddressList{
  39841. ServerResponse: googleapi.ServerResponse{
  39842. Header: res.Header,
  39843. HTTPStatusCode: res.StatusCode,
  39844. },
  39845. }
  39846. target := &ret
  39847. if err := gensupport.DecodeResponse(target, res); err != nil {
  39848. return nil, err
  39849. }
  39850. return ret, nil
  39851. // {
  39852. // "description": "Retrieves a list of addresses contained within the specified region.",
  39853. // "httpMethod": "GET",
  39854. // "id": "compute.addresses.list",
  39855. // "parameterOrder": [
  39856. // "project",
  39857. // "region"
  39858. // ],
  39859. // "parameters": {
  39860. // "filter": {
  39861. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  39862. // "location": "query",
  39863. // "type": "string"
  39864. // },
  39865. // "maxResults": {
  39866. // "default": "500",
  39867. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  39868. // "format": "uint32",
  39869. // "location": "query",
  39870. // "minimum": "0",
  39871. // "type": "integer"
  39872. // },
  39873. // "orderBy": {
  39874. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  39875. // "location": "query",
  39876. // "type": "string"
  39877. // },
  39878. // "pageToken": {
  39879. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  39880. // "location": "query",
  39881. // "type": "string"
  39882. // },
  39883. // "project": {
  39884. // "description": "Project ID for this request.",
  39885. // "location": "path",
  39886. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39887. // "required": true,
  39888. // "type": "string"
  39889. // },
  39890. // "region": {
  39891. // "description": "Name of the region for this request.",
  39892. // "location": "path",
  39893. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39894. // "required": true,
  39895. // "type": "string"
  39896. // }
  39897. // },
  39898. // "path": "{project}/regions/{region}/addresses",
  39899. // "response": {
  39900. // "$ref": "AddressList"
  39901. // },
  39902. // "scopes": [
  39903. // "https://www.googleapis.com/auth/cloud-platform",
  39904. // "https://www.googleapis.com/auth/compute",
  39905. // "https://www.googleapis.com/auth/compute.readonly"
  39906. // ]
  39907. // }
  39908. }
  39909. // Pages invokes f for each page of results.
  39910. // A non-nil error returned from f will halt the iteration.
  39911. // The provided context supersedes any context provided to the Context method.
  39912. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  39913. c.ctx_ = ctx
  39914. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39915. for {
  39916. x, err := c.Do()
  39917. if err != nil {
  39918. return err
  39919. }
  39920. if err := f(x); err != nil {
  39921. return err
  39922. }
  39923. if x.NextPageToken == "" {
  39924. return nil
  39925. }
  39926. c.PageToken(x.NextPageToken)
  39927. }
  39928. }
  39929. // method id "compute.addresses.setLabels":
  39930. type AddressesSetLabelsCall struct {
  39931. s *Service
  39932. project string
  39933. region string
  39934. resource string
  39935. regionsetlabelsrequest *RegionSetLabelsRequest
  39936. urlParams_ gensupport.URLParams
  39937. ctx_ context.Context
  39938. header_ http.Header
  39939. }
  39940. // SetLabels: Sets the labels on an Address. To learn more about labels,
  39941. // read the Labeling Resources documentation.
  39942. func (r *AddressesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *AddressesSetLabelsCall {
  39943. c := &AddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39944. c.project = project
  39945. c.region = region
  39946. c.resource = resource
  39947. c.regionsetlabelsrequest = regionsetlabelsrequest
  39948. return c
  39949. }
  39950. // RequestId sets the optional parameter "requestId": An optional
  39951. // request ID to identify requests. Specify a unique request ID so that
  39952. // if you must retry your request, the server will know to ignore the
  39953. // request if it has already been completed.
  39954. //
  39955. // For example, consider a situation where you make an initial request
  39956. // and the request times out. If you make the request again with the
  39957. // same request ID, the server can check if original operation with the
  39958. // same request ID was received, and if so, will ignore the second
  39959. // request. This prevents clients from accidentally creating duplicate
  39960. // commitments.
  39961. //
  39962. // The request ID must be a valid UUID with the exception that zero UUID
  39963. // is not supported (00000000-0000-0000-0000-000000000000).
  39964. func (c *AddressesSetLabelsCall) RequestId(requestId string) *AddressesSetLabelsCall {
  39965. c.urlParams_.Set("requestId", requestId)
  39966. return c
  39967. }
  39968. // Fields allows partial responses to be retrieved. See
  39969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39970. // for more information.
  39971. func (c *AddressesSetLabelsCall) Fields(s ...googleapi.Field) *AddressesSetLabelsCall {
  39972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39973. return c
  39974. }
  39975. // Context sets the context to be used in this call's Do method. Any
  39976. // pending HTTP request will be aborted if the provided context is
  39977. // canceled.
  39978. func (c *AddressesSetLabelsCall) Context(ctx context.Context) *AddressesSetLabelsCall {
  39979. c.ctx_ = ctx
  39980. return c
  39981. }
  39982. // Header returns an http.Header that can be modified by the caller to
  39983. // add HTTP headers to the request.
  39984. func (c *AddressesSetLabelsCall) Header() http.Header {
  39985. if c.header_ == nil {
  39986. c.header_ = make(http.Header)
  39987. }
  39988. return c.header_
  39989. }
  39990. func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  39991. reqHeaders := make(http.Header)
  39992. for k, v := range c.header_ {
  39993. reqHeaders[k] = v
  39994. }
  39995. reqHeaders.Set("User-Agent", c.s.userAgent())
  39996. var body io.Reader = nil
  39997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  39998. if err != nil {
  39999. return nil, err
  40000. }
  40001. reqHeaders.Set("Content-Type", "application/json")
  40002. c.urlParams_.Set("alt", alt)
  40003. c.urlParams_.Set("prettyPrint", "false")
  40004. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/setLabels")
  40005. urls += "?" + c.urlParams_.Encode()
  40006. req, err := http.NewRequest("POST", urls, body)
  40007. if err != nil {
  40008. return nil, err
  40009. }
  40010. req.Header = reqHeaders
  40011. googleapi.Expand(req.URL, map[string]string{
  40012. "project": c.project,
  40013. "region": c.region,
  40014. "resource": c.resource,
  40015. })
  40016. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40017. }
  40018. // Do executes the "compute.addresses.setLabels" call.
  40019. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40020. // status code is an error. Response headers are in either
  40021. // *Operation.ServerResponse.Header or (if a response was returned at
  40022. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40023. // to check whether the returned error was because
  40024. // http.StatusNotModified was returned.
  40025. func (c *AddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40026. gensupport.SetOptions(c.urlParams_, opts...)
  40027. res, err := c.doRequest("json")
  40028. if res != nil && res.StatusCode == http.StatusNotModified {
  40029. if res.Body != nil {
  40030. res.Body.Close()
  40031. }
  40032. return nil, &googleapi.Error{
  40033. Code: res.StatusCode,
  40034. Header: res.Header,
  40035. }
  40036. }
  40037. if err != nil {
  40038. return nil, err
  40039. }
  40040. defer googleapi.CloseBody(res)
  40041. if err := googleapi.CheckResponse(res); err != nil {
  40042. return nil, err
  40043. }
  40044. ret := &Operation{
  40045. ServerResponse: googleapi.ServerResponse{
  40046. Header: res.Header,
  40047. HTTPStatusCode: res.StatusCode,
  40048. },
  40049. }
  40050. target := &ret
  40051. if err := gensupport.DecodeResponse(target, res); err != nil {
  40052. return nil, err
  40053. }
  40054. return ret, nil
  40055. // {
  40056. // "description": "Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.",
  40057. // "httpMethod": "POST",
  40058. // "id": "compute.addresses.setLabels",
  40059. // "parameterOrder": [
  40060. // "project",
  40061. // "region",
  40062. // "resource"
  40063. // ],
  40064. // "parameters": {
  40065. // "project": {
  40066. // "description": "Project ID for this request.",
  40067. // "location": "path",
  40068. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40069. // "required": true,
  40070. // "type": "string"
  40071. // },
  40072. // "region": {
  40073. // "description": "The region for this request.",
  40074. // "location": "path",
  40075. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40076. // "required": true,
  40077. // "type": "string"
  40078. // },
  40079. // "requestId": {
  40080. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40081. // "location": "query",
  40082. // "type": "string"
  40083. // },
  40084. // "resource": {
  40085. // "description": "Name or id of the resource for this request.",
  40086. // "location": "path",
  40087. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40088. // "required": true,
  40089. // "type": "string"
  40090. // }
  40091. // },
  40092. // "path": "{project}/regions/{region}/addresses/{resource}/setLabels",
  40093. // "request": {
  40094. // "$ref": "RegionSetLabelsRequest"
  40095. // },
  40096. // "response": {
  40097. // "$ref": "Operation"
  40098. // },
  40099. // "scopes": [
  40100. // "https://www.googleapis.com/auth/cloud-platform",
  40101. // "https://www.googleapis.com/auth/compute"
  40102. // ]
  40103. // }
  40104. }
  40105. // method id "compute.addresses.testIamPermissions":
  40106. type AddressesTestIamPermissionsCall struct {
  40107. s *Service
  40108. project string
  40109. region string
  40110. resource string
  40111. testpermissionsrequest *TestPermissionsRequest
  40112. urlParams_ gensupport.URLParams
  40113. ctx_ context.Context
  40114. header_ http.Header
  40115. }
  40116. // TestIamPermissions: Returns permissions that a caller has on the
  40117. // specified resource.
  40118. func (r *AddressesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *AddressesTestIamPermissionsCall {
  40119. c := &AddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40120. c.project = project
  40121. c.region = region
  40122. c.resource = resource
  40123. c.testpermissionsrequest = testpermissionsrequest
  40124. return c
  40125. }
  40126. // Fields allows partial responses to be retrieved. See
  40127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40128. // for more information.
  40129. func (c *AddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *AddressesTestIamPermissionsCall {
  40130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40131. return c
  40132. }
  40133. // Context sets the context to be used in this call's Do method. Any
  40134. // pending HTTP request will be aborted if the provided context is
  40135. // canceled.
  40136. func (c *AddressesTestIamPermissionsCall) Context(ctx context.Context) *AddressesTestIamPermissionsCall {
  40137. c.ctx_ = ctx
  40138. return c
  40139. }
  40140. // Header returns an http.Header that can be modified by the caller to
  40141. // add HTTP headers to the request.
  40142. func (c *AddressesTestIamPermissionsCall) Header() http.Header {
  40143. if c.header_ == nil {
  40144. c.header_ = make(http.Header)
  40145. }
  40146. return c.header_
  40147. }
  40148. func (c *AddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  40149. reqHeaders := make(http.Header)
  40150. for k, v := range c.header_ {
  40151. reqHeaders[k] = v
  40152. }
  40153. reqHeaders.Set("User-Agent", c.s.userAgent())
  40154. var body io.Reader = nil
  40155. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  40156. if err != nil {
  40157. return nil, err
  40158. }
  40159. reqHeaders.Set("Content-Type", "application/json")
  40160. c.urlParams_.Set("alt", alt)
  40161. c.urlParams_.Set("prettyPrint", "false")
  40162. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/testIamPermissions")
  40163. urls += "?" + c.urlParams_.Encode()
  40164. req, err := http.NewRequest("POST", urls, body)
  40165. if err != nil {
  40166. return nil, err
  40167. }
  40168. req.Header = reqHeaders
  40169. googleapi.Expand(req.URL, map[string]string{
  40170. "project": c.project,
  40171. "region": c.region,
  40172. "resource": c.resource,
  40173. })
  40174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40175. }
  40176. // Do executes the "compute.addresses.testIamPermissions" call.
  40177. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  40178. // non-2xx status code is an error. Response headers are in either
  40179. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  40180. // returned at all) in error.(*googleapi.Error).Header. Use
  40181. // googleapi.IsNotModified to check whether the returned error was
  40182. // because http.StatusNotModified was returned.
  40183. func (c *AddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  40184. gensupport.SetOptions(c.urlParams_, opts...)
  40185. res, err := c.doRequest("json")
  40186. if res != nil && res.StatusCode == http.StatusNotModified {
  40187. if res.Body != nil {
  40188. res.Body.Close()
  40189. }
  40190. return nil, &googleapi.Error{
  40191. Code: res.StatusCode,
  40192. Header: res.Header,
  40193. }
  40194. }
  40195. if err != nil {
  40196. return nil, err
  40197. }
  40198. defer googleapi.CloseBody(res)
  40199. if err := googleapi.CheckResponse(res); err != nil {
  40200. return nil, err
  40201. }
  40202. ret := &TestPermissionsResponse{
  40203. ServerResponse: googleapi.ServerResponse{
  40204. Header: res.Header,
  40205. HTTPStatusCode: res.StatusCode,
  40206. },
  40207. }
  40208. target := &ret
  40209. if err := gensupport.DecodeResponse(target, res); err != nil {
  40210. return nil, err
  40211. }
  40212. return ret, nil
  40213. // {
  40214. // "description": "Returns permissions that a caller has on the specified resource.",
  40215. // "httpMethod": "POST",
  40216. // "id": "compute.addresses.testIamPermissions",
  40217. // "parameterOrder": [
  40218. // "project",
  40219. // "region",
  40220. // "resource"
  40221. // ],
  40222. // "parameters": {
  40223. // "project": {
  40224. // "description": "Project ID for this request.",
  40225. // "location": "path",
  40226. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40227. // "required": true,
  40228. // "type": "string"
  40229. // },
  40230. // "region": {
  40231. // "description": "The name of the region for this request.",
  40232. // "location": "path",
  40233. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40234. // "required": true,
  40235. // "type": "string"
  40236. // },
  40237. // "resource": {
  40238. // "description": "Name or id of the resource for this request.",
  40239. // "location": "path",
  40240. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40241. // "required": true,
  40242. // "type": "string"
  40243. // }
  40244. // },
  40245. // "path": "{project}/regions/{region}/addresses/{resource}/testIamPermissions",
  40246. // "request": {
  40247. // "$ref": "TestPermissionsRequest"
  40248. // },
  40249. // "response": {
  40250. // "$ref": "TestPermissionsResponse"
  40251. // },
  40252. // "scopes": [
  40253. // "https://www.googleapis.com/auth/cloud-platform",
  40254. // "https://www.googleapis.com/auth/compute",
  40255. // "https://www.googleapis.com/auth/compute.readonly"
  40256. // ]
  40257. // }
  40258. }
  40259. // method id "compute.autoscalers.aggregatedList":
  40260. type AutoscalersAggregatedListCall struct {
  40261. s *Service
  40262. project string
  40263. urlParams_ gensupport.URLParams
  40264. ifNoneMatch_ string
  40265. ctx_ context.Context
  40266. header_ http.Header
  40267. }
  40268. // AggregatedList: Retrieves an aggregated list of autoscalers.
  40269. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  40270. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40271. c.project = project
  40272. return c
  40273. }
  40274. // Filter sets the optional parameter "filter": A filter expression that
  40275. // filters resources listed in the response. The expression must specify
  40276. // the field name, a comparison operator, and the value that you want to
  40277. // use for filtering. The value must be a string, a number, or a
  40278. // boolean. The comparison operator must be either =, !=, >, or <.
  40279. //
  40280. // For example, if you are filtering Compute Engine instances, you can
  40281. // exclude instances named example-instance by specifying name !=
  40282. // example-instance.
  40283. //
  40284. // You can also filter nested fields. For example, you could specify
  40285. // scheduling.automaticRestart = false to include instances only if they
  40286. // are not scheduled for automatic restarts. You can use filtering on
  40287. // nested fields to filter based on resource labels.
  40288. //
  40289. // To filter on multiple expressions, provide each separate expression
  40290. // within parentheses. For example, (scheduling.automaticRestart = true)
  40291. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40292. // AND expression. However, you can include AND and OR expressions
  40293. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40294. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40295. // true).
  40296. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  40297. c.urlParams_.Set("filter", filter)
  40298. return c
  40299. }
  40300. // MaxResults sets the optional parameter "maxResults": The maximum
  40301. // number of results per page that should be returned. If the number of
  40302. // available results is larger than maxResults, Compute Engine returns a
  40303. // nextPageToken that can be used to get the next page of results in
  40304. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40305. // (Default: 500)
  40306. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  40307. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40308. return c
  40309. }
  40310. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40311. // a certain order. By default, results are returned in alphanumerical
  40312. // order based on the resource name.
  40313. //
  40314. // You can also sort results in descending order based on the creation
  40315. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40316. // based on the creationTimestamp field in reverse chronological order
  40317. // (newest result first). Use this to sort resources like operations so
  40318. // that the newest operation is returned first.
  40319. //
  40320. // Currently, only sorting by name or creationTimestamp desc is
  40321. // supported.
  40322. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  40323. c.urlParams_.Set("orderBy", orderBy)
  40324. return c
  40325. }
  40326. // PageToken sets the optional parameter "pageToken": Specifies a page
  40327. // token to use. Set pageToken to the nextPageToken returned by a
  40328. // previous list request to get the next page of results.
  40329. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  40330. c.urlParams_.Set("pageToken", pageToken)
  40331. return c
  40332. }
  40333. // Fields allows partial responses to be retrieved. See
  40334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40335. // for more information.
  40336. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  40337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40338. return c
  40339. }
  40340. // IfNoneMatch sets the optional parameter which makes the operation
  40341. // fail if the object's ETag matches the given value. This is useful for
  40342. // getting updates only after the object has changed since the last
  40343. // request. Use googleapi.IsNotModified to check whether the response
  40344. // error from Do is the result of In-None-Match.
  40345. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  40346. c.ifNoneMatch_ = entityTag
  40347. return c
  40348. }
  40349. // Context sets the context to be used in this call's Do method. Any
  40350. // pending HTTP request will be aborted if the provided context is
  40351. // canceled.
  40352. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  40353. c.ctx_ = ctx
  40354. return c
  40355. }
  40356. // Header returns an http.Header that can be modified by the caller to
  40357. // add HTTP headers to the request.
  40358. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  40359. if c.header_ == nil {
  40360. c.header_ = make(http.Header)
  40361. }
  40362. return c.header_
  40363. }
  40364. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  40365. reqHeaders := make(http.Header)
  40366. for k, v := range c.header_ {
  40367. reqHeaders[k] = v
  40368. }
  40369. reqHeaders.Set("User-Agent", c.s.userAgent())
  40370. if c.ifNoneMatch_ != "" {
  40371. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40372. }
  40373. var body io.Reader = nil
  40374. c.urlParams_.Set("alt", alt)
  40375. c.urlParams_.Set("prettyPrint", "false")
  40376. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  40377. urls += "?" + c.urlParams_.Encode()
  40378. req, err := http.NewRequest("GET", urls, body)
  40379. if err != nil {
  40380. return nil, err
  40381. }
  40382. req.Header = reqHeaders
  40383. googleapi.Expand(req.URL, map[string]string{
  40384. "project": c.project,
  40385. })
  40386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40387. }
  40388. // Do executes the "compute.autoscalers.aggregatedList" call.
  40389. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  40390. // Any non-2xx status code is an error. Response headers are in either
  40391. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  40392. // returned at all) in error.(*googleapi.Error).Header. Use
  40393. // googleapi.IsNotModified to check whether the returned error was
  40394. // because http.StatusNotModified was returned.
  40395. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  40396. gensupport.SetOptions(c.urlParams_, opts...)
  40397. res, err := c.doRequest("json")
  40398. if res != nil && res.StatusCode == http.StatusNotModified {
  40399. if res.Body != nil {
  40400. res.Body.Close()
  40401. }
  40402. return nil, &googleapi.Error{
  40403. Code: res.StatusCode,
  40404. Header: res.Header,
  40405. }
  40406. }
  40407. if err != nil {
  40408. return nil, err
  40409. }
  40410. defer googleapi.CloseBody(res)
  40411. if err := googleapi.CheckResponse(res); err != nil {
  40412. return nil, err
  40413. }
  40414. ret := &AutoscalerAggregatedList{
  40415. ServerResponse: googleapi.ServerResponse{
  40416. Header: res.Header,
  40417. HTTPStatusCode: res.StatusCode,
  40418. },
  40419. }
  40420. target := &ret
  40421. if err := gensupport.DecodeResponse(target, res); err != nil {
  40422. return nil, err
  40423. }
  40424. return ret, nil
  40425. // {
  40426. // "description": "Retrieves an aggregated list of autoscalers.",
  40427. // "httpMethod": "GET",
  40428. // "id": "compute.autoscalers.aggregatedList",
  40429. // "parameterOrder": [
  40430. // "project"
  40431. // ],
  40432. // "parameters": {
  40433. // "filter": {
  40434. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  40435. // "location": "query",
  40436. // "type": "string"
  40437. // },
  40438. // "maxResults": {
  40439. // "default": "500",
  40440. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  40441. // "format": "uint32",
  40442. // "location": "query",
  40443. // "minimum": "0",
  40444. // "type": "integer"
  40445. // },
  40446. // "orderBy": {
  40447. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  40448. // "location": "query",
  40449. // "type": "string"
  40450. // },
  40451. // "pageToken": {
  40452. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  40453. // "location": "query",
  40454. // "type": "string"
  40455. // },
  40456. // "project": {
  40457. // "description": "Project ID for this request.",
  40458. // "location": "path",
  40459. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40460. // "required": true,
  40461. // "type": "string"
  40462. // }
  40463. // },
  40464. // "path": "{project}/aggregated/autoscalers",
  40465. // "response": {
  40466. // "$ref": "AutoscalerAggregatedList"
  40467. // },
  40468. // "scopes": [
  40469. // "https://www.googleapis.com/auth/cloud-platform",
  40470. // "https://www.googleapis.com/auth/compute",
  40471. // "https://www.googleapis.com/auth/compute.readonly"
  40472. // ]
  40473. // }
  40474. }
  40475. // Pages invokes f for each page of results.
  40476. // A non-nil error returned from f will halt the iteration.
  40477. // The provided context supersedes any context provided to the Context method.
  40478. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  40479. c.ctx_ = ctx
  40480. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40481. for {
  40482. x, err := c.Do()
  40483. if err != nil {
  40484. return err
  40485. }
  40486. if err := f(x); err != nil {
  40487. return err
  40488. }
  40489. if x.NextPageToken == "" {
  40490. return nil
  40491. }
  40492. c.PageToken(x.NextPageToken)
  40493. }
  40494. }
  40495. // method id "compute.autoscalers.delete":
  40496. type AutoscalersDeleteCall struct {
  40497. s *Service
  40498. project string
  40499. zone string
  40500. autoscaler string
  40501. urlParams_ gensupport.URLParams
  40502. ctx_ context.Context
  40503. header_ http.Header
  40504. }
  40505. // Delete: Deletes the specified autoscaler.
  40506. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  40507. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40508. c.project = project
  40509. c.zone = zone
  40510. c.autoscaler = autoscaler
  40511. return c
  40512. }
  40513. // RequestId sets the optional parameter "requestId": An optional
  40514. // request ID to identify requests. Specify a unique request ID so that
  40515. // if you must retry your request, the server will know to ignore the
  40516. // request if it has already been completed.
  40517. //
  40518. // For example, consider a situation where you make an initial request
  40519. // and the request times out. If you make the request again with the
  40520. // same request ID, the server can check if original operation with the
  40521. // same request ID was received, and if so, will ignore the second
  40522. // request. This prevents clients from accidentally creating duplicate
  40523. // commitments.
  40524. //
  40525. // The request ID must be a valid UUID with the exception that zero UUID
  40526. // is not supported (00000000-0000-0000-0000-000000000000).
  40527. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  40528. c.urlParams_.Set("requestId", requestId)
  40529. return c
  40530. }
  40531. // Fields allows partial responses to be retrieved. See
  40532. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40533. // for more information.
  40534. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  40535. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40536. return c
  40537. }
  40538. // Context sets the context to be used in this call's Do method. Any
  40539. // pending HTTP request will be aborted if the provided context is
  40540. // canceled.
  40541. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  40542. c.ctx_ = ctx
  40543. return c
  40544. }
  40545. // Header returns an http.Header that can be modified by the caller to
  40546. // add HTTP headers to the request.
  40547. func (c *AutoscalersDeleteCall) Header() http.Header {
  40548. if c.header_ == nil {
  40549. c.header_ = make(http.Header)
  40550. }
  40551. return c.header_
  40552. }
  40553. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  40554. reqHeaders := make(http.Header)
  40555. for k, v := range c.header_ {
  40556. reqHeaders[k] = v
  40557. }
  40558. reqHeaders.Set("User-Agent", c.s.userAgent())
  40559. var body io.Reader = nil
  40560. c.urlParams_.Set("alt", alt)
  40561. c.urlParams_.Set("prettyPrint", "false")
  40562. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  40563. urls += "?" + c.urlParams_.Encode()
  40564. req, err := http.NewRequest("DELETE", urls, body)
  40565. if err != nil {
  40566. return nil, err
  40567. }
  40568. req.Header = reqHeaders
  40569. googleapi.Expand(req.URL, map[string]string{
  40570. "project": c.project,
  40571. "zone": c.zone,
  40572. "autoscaler": c.autoscaler,
  40573. })
  40574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40575. }
  40576. // Do executes the "compute.autoscalers.delete" call.
  40577. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40578. // status code is an error. Response headers are in either
  40579. // *Operation.ServerResponse.Header or (if a response was returned at
  40580. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40581. // to check whether the returned error was because
  40582. // http.StatusNotModified was returned.
  40583. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40584. gensupport.SetOptions(c.urlParams_, opts...)
  40585. res, err := c.doRequest("json")
  40586. if res != nil && res.StatusCode == http.StatusNotModified {
  40587. if res.Body != nil {
  40588. res.Body.Close()
  40589. }
  40590. return nil, &googleapi.Error{
  40591. Code: res.StatusCode,
  40592. Header: res.Header,
  40593. }
  40594. }
  40595. if err != nil {
  40596. return nil, err
  40597. }
  40598. defer googleapi.CloseBody(res)
  40599. if err := googleapi.CheckResponse(res); err != nil {
  40600. return nil, err
  40601. }
  40602. ret := &Operation{
  40603. ServerResponse: googleapi.ServerResponse{
  40604. Header: res.Header,
  40605. HTTPStatusCode: res.StatusCode,
  40606. },
  40607. }
  40608. target := &ret
  40609. if err := gensupport.DecodeResponse(target, res); err != nil {
  40610. return nil, err
  40611. }
  40612. return ret, nil
  40613. // {
  40614. // "description": "Deletes the specified autoscaler.",
  40615. // "httpMethod": "DELETE",
  40616. // "id": "compute.autoscalers.delete",
  40617. // "parameterOrder": [
  40618. // "project",
  40619. // "zone",
  40620. // "autoscaler"
  40621. // ],
  40622. // "parameters": {
  40623. // "autoscaler": {
  40624. // "description": "Name of the autoscaler to delete.",
  40625. // "location": "path",
  40626. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40627. // "required": true,
  40628. // "type": "string"
  40629. // },
  40630. // "project": {
  40631. // "description": "Project ID for this request.",
  40632. // "location": "path",
  40633. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40634. // "required": true,
  40635. // "type": "string"
  40636. // },
  40637. // "requestId": {
  40638. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40639. // "location": "query",
  40640. // "type": "string"
  40641. // },
  40642. // "zone": {
  40643. // "description": "Name of the zone for this request.",
  40644. // "location": "path",
  40645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40646. // "required": true,
  40647. // "type": "string"
  40648. // }
  40649. // },
  40650. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  40651. // "response": {
  40652. // "$ref": "Operation"
  40653. // },
  40654. // "scopes": [
  40655. // "https://www.googleapis.com/auth/cloud-platform",
  40656. // "https://www.googleapis.com/auth/compute"
  40657. // ]
  40658. // }
  40659. }
  40660. // method id "compute.autoscalers.get":
  40661. type AutoscalersGetCall struct {
  40662. s *Service
  40663. project string
  40664. zone string
  40665. autoscaler string
  40666. urlParams_ gensupport.URLParams
  40667. ifNoneMatch_ string
  40668. ctx_ context.Context
  40669. header_ http.Header
  40670. }
  40671. // Get: Returns the specified autoscaler resource. Gets a list of
  40672. // available autoscalers by making a list() request.
  40673. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  40674. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40675. c.project = project
  40676. c.zone = zone
  40677. c.autoscaler = autoscaler
  40678. return c
  40679. }
  40680. // Fields allows partial responses to be retrieved. See
  40681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40682. // for more information.
  40683. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  40684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40685. return c
  40686. }
  40687. // IfNoneMatch sets the optional parameter which makes the operation
  40688. // fail if the object's ETag matches the given value. This is useful for
  40689. // getting updates only after the object has changed since the last
  40690. // request. Use googleapi.IsNotModified to check whether the response
  40691. // error from Do is the result of In-None-Match.
  40692. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  40693. c.ifNoneMatch_ = entityTag
  40694. return c
  40695. }
  40696. // Context sets the context to be used in this call's Do method. Any
  40697. // pending HTTP request will be aborted if the provided context is
  40698. // canceled.
  40699. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  40700. c.ctx_ = ctx
  40701. return c
  40702. }
  40703. // Header returns an http.Header that can be modified by the caller to
  40704. // add HTTP headers to the request.
  40705. func (c *AutoscalersGetCall) Header() http.Header {
  40706. if c.header_ == nil {
  40707. c.header_ = make(http.Header)
  40708. }
  40709. return c.header_
  40710. }
  40711. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  40712. reqHeaders := make(http.Header)
  40713. for k, v := range c.header_ {
  40714. reqHeaders[k] = v
  40715. }
  40716. reqHeaders.Set("User-Agent", c.s.userAgent())
  40717. if c.ifNoneMatch_ != "" {
  40718. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40719. }
  40720. var body io.Reader = nil
  40721. c.urlParams_.Set("alt", alt)
  40722. c.urlParams_.Set("prettyPrint", "false")
  40723. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  40724. urls += "?" + c.urlParams_.Encode()
  40725. req, err := http.NewRequest("GET", urls, body)
  40726. if err != nil {
  40727. return nil, err
  40728. }
  40729. req.Header = reqHeaders
  40730. googleapi.Expand(req.URL, map[string]string{
  40731. "project": c.project,
  40732. "zone": c.zone,
  40733. "autoscaler": c.autoscaler,
  40734. })
  40735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40736. }
  40737. // Do executes the "compute.autoscalers.get" call.
  40738. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  40739. // status code is an error. Response headers are in either
  40740. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  40741. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40742. // to check whether the returned error was because
  40743. // http.StatusNotModified was returned.
  40744. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  40745. gensupport.SetOptions(c.urlParams_, opts...)
  40746. res, err := c.doRequest("json")
  40747. if res != nil && res.StatusCode == http.StatusNotModified {
  40748. if res.Body != nil {
  40749. res.Body.Close()
  40750. }
  40751. return nil, &googleapi.Error{
  40752. Code: res.StatusCode,
  40753. Header: res.Header,
  40754. }
  40755. }
  40756. if err != nil {
  40757. return nil, err
  40758. }
  40759. defer googleapi.CloseBody(res)
  40760. if err := googleapi.CheckResponse(res); err != nil {
  40761. return nil, err
  40762. }
  40763. ret := &Autoscaler{
  40764. ServerResponse: googleapi.ServerResponse{
  40765. Header: res.Header,
  40766. HTTPStatusCode: res.StatusCode,
  40767. },
  40768. }
  40769. target := &ret
  40770. if err := gensupport.DecodeResponse(target, res); err != nil {
  40771. return nil, err
  40772. }
  40773. return ret, nil
  40774. // {
  40775. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  40776. // "httpMethod": "GET",
  40777. // "id": "compute.autoscalers.get",
  40778. // "parameterOrder": [
  40779. // "project",
  40780. // "zone",
  40781. // "autoscaler"
  40782. // ],
  40783. // "parameters": {
  40784. // "autoscaler": {
  40785. // "description": "Name of the autoscaler to return.",
  40786. // "location": "path",
  40787. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40788. // "required": true,
  40789. // "type": "string"
  40790. // },
  40791. // "project": {
  40792. // "description": "Project ID for this request.",
  40793. // "location": "path",
  40794. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40795. // "required": true,
  40796. // "type": "string"
  40797. // },
  40798. // "zone": {
  40799. // "description": "Name of the zone for this request.",
  40800. // "location": "path",
  40801. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40802. // "required": true,
  40803. // "type": "string"
  40804. // }
  40805. // },
  40806. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  40807. // "response": {
  40808. // "$ref": "Autoscaler"
  40809. // },
  40810. // "scopes": [
  40811. // "https://www.googleapis.com/auth/cloud-platform",
  40812. // "https://www.googleapis.com/auth/compute",
  40813. // "https://www.googleapis.com/auth/compute.readonly"
  40814. // ]
  40815. // }
  40816. }
  40817. // method id "compute.autoscalers.insert":
  40818. type AutoscalersInsertCall struct {
  40819. s *Service
  40820. project string
  40821. zone string
  40822. autoscaler *Autoscaler
  40823. urlParams_ gensupport.URLParams
  40824. ctx_ context.Context
  40825. header_ http.Header
  40826. }
  40827. // Insert: Creates an autoscaler in the specified project using the data
  40828. // included in the request.
  40829. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  40830. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40831. c.project = project
  40832. c.zone = zone
  40833. c.autoscaler = autoscaler
  40834. return c
  40835. }
  40836. // RequestId sets the optional parameter "requestId": An optional
  40837. // request ID to identify requests. Specify a unique request ID so that
  40838. // if you must retry your request, the server will know to ignore the
  40839. // request if it has already been completed.
  40840. //
  40841. // For example, consider a situation where you make an initial request
  40842. // and the request times out. If you make the request again with the
  40843. // same request ID, the server can check if original operation with the
  40844. // same request ID was received, and if so, will ignore the second
  40845. // request. This prevents clients from accidentally creating duplicate
  40846. // commitments.
  40847. //
  40848. // The request ID must be a valid UUID with the exception that zero UUID
  40849. // is not supported (00000000-0000-0000-0000-000000000000).
  40850. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  40851. c.urlParams_.Set("requestId", requestId)
  40852. return c
  40853. }
  40854. // Fields allows partial responses to be retrieved. See
  40855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40856. // for more information.
  40857. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  40858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40859. return c
  40860. }
  40861. // Context sets the context to be used in this call's Do method. Any
  40862. // pending HTTP request will be aborted if the provided context is
  40863. // canceled.
  40864. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  40865. c.ctx_ = ctx
  40866. return c
  40867. }
  40868. // Header returns an http.Header that can be modified by the caller to
  40869. // add HTTP headers to the request.
  40870. func (c *AutoscalersInsertCall) Header() http.Header {
  40871. if c.header_ == nil {
  40872. c.header_ = make(http.Header)
  40873. }
  40874. return c.header_
  40875. }
  40876. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  40877. reqHeaders := make(http.Header)
  40878. for k, v := range c.header_ {
  40879. reqHeaders[k] = v
  40880. }
  40881. reqHeaders.Set("User-Agent", c.s.userAgent())
  40882. var body io.Reader = nil
  40883. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  40884. if err != nil {
  40885. return nil, err
  40886. }
  40887. reqHeaders.Set("Content-Type", "application/json")
  40888. c.urlParams_.Set("alt", alt)
  40889. c.urlParams_.Set("prettyPrint", "false")
  40890. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  40891. urls += "?" + c.urlParams_.Encode()
  40892. req, err := http.NewRequest("POST", urls, body)
  40893. if err != nil {
  40894. return nil, err
  40895. }
  40896. req.Header = reqHeaders
  40897. googleapi.Expand(req.URL, map[string]string{
  40898. "project": c.project,
  40899. "zone": c.zone,
  40900. })
  40901. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40902. }
  40903. // Do executes the "compute.autoscalers.insert" call.
  40904. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40905. // status code is an error. Response headers are in either
  40906. // *Operation.ServerResponse.Header or (if a response was returned at
  40907. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40908. // to check whether the returned error was because
  40909. // http.StatusNotModified was returned.
  40910. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40911. gensupport.SetOptions(c.urlParams_, opts...)
  40912. res, err := c.doRequest("json")
  40913. if res != nil && res.StatusCode == http.StatusNotModified {
  40914. if res.Body != nil {
  40915. res.Body.Close()
  40916. }
  40917. return nil, &googleapi.Error{
  40918. Code: res.StatusCode,
  40919. Header: res.Header,
  40920. }
  40921. }
  40922. if err != nil {
  40923. return nil, err
  40924. }
  40925. defer googleapi.CloseBody(res)
  40926. if err := googleapi.CheckResponse(res); err != nil {
  40927. return nil, err
  40928. }
  40929. ret := &Operation{
  40930. ServerResponse: googleapi.ServerResponse{
  40931. Header: res.Header,
  40932. HTTPStatusCode: res.StatusCode,
  40933. },
  40934. }
  40935. target := &ret
  40936. if err := gensupport.DecodeResponse(target, res); err != nil {
  40937. return nil, err
  40938. }
  40939. return ret, nil
  40940. // {
  40941. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  40942. // "httpMethod": "POST",
  40943. // "id": "compute.autoscalers.insert",
  40944. // "parameterOrder": [
  40945. // "project",
  40946. // "zone"
  40947. // ],
  40948. // "parameters": {
  40949. // "project": {
  40950. // "description": "Project ID for this request.",
  40951. // "location": "path",
  40952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40953. // "required": true,
  40954. // "type": "string"
  40955. // },
  40956. // "requestId": {
  40957. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40958. // "location": "query",
  40959. // "type": "string"
  40960. // },
  40961. // "zone": {
  40962. // "description": "Name of the zone for this request.",
  40963. // "location": "path",
  40964. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40965. // "required": true,
  40966. // "type": "string"
  40967. // }
  40968. // },
  40969. // "path": "{project}/zones/{zone}/autoscalers",
  40970. // "request": {
  40971. // "$ref": "Autoscaler"
  40972. // },
  40973. // "response": {
  40974. // "$ref": "Operation"
  40975. // },
  40976. // "scopes": [
  40977. // "https://www.googleapis.com/auth/cloud-platform",
  40978. // "https://www.googleapis.com/auth/compute"
  40979. // ]
  40980. // }
  40981. }
  40982. // method id "compute.autoscalers.list":
  40983. type AutoscalersListCall struct {
  40984. s *Service
  40985. project string
  40986. zone string
  40987. urlParams_ gensupport.URLParams
  40988. ifNoneMatch_ string
  40989. ctx_ context.Context
  40990. header_ http.Header
  40991. }
  40992. // List: Retrieves a list of autoscalers contained within the specified
  40993. // zone.
  40994. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  40995. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40996. c.project = project
  40997. c.zone = zone
  40998. return c
  40999. }
  41000. // Filter sets the optional parameter "filter": A filter expression that
  41001. // filters resources listed in the response. The expression must specify
  41002. // the field name, a comparison operator, and the value that you want to
  41003. // use for filtering. The value must be a string, a number, or a
  41004. // boolean. The comparison operator must be either =, !=, >, or <.
  41005. //
  41006. // For example, if you are filtering Compute Engine instances, you can
  41007. // exclude instances named example-instance by specifying name !=
  41008. // example-instance.
  41009. //
  41010. // You can also filter nested fields. For example, you could specify
  41011. // scheduling.automaticRestart = false to include instances only if they
  41012. // are not scheduled for automatic restarts. You can use filtering on
  41013. // nested fields to filter based on resource labels.
  41014. //
  41015. // To filter on multiple expressions, provide each separate expression
  41016. // within parentheses. For example, (scheduling.automaticRestart = true)
  41017. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41018. // AND expression. However, you can include AND and OR expressions
  41019. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41020. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41021. // true).
  41022. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  41023. c.urlParams_.Set("filter", filter)
  41024. return c
  41025. }
  41026. // MaxResults sets the optional parameter "maxResults": The maximum
  41027. // number of results per page that should be returned. If the number of
  41028. // available results is larger than maxResults, Compute Engine returns a
  41029. // nextPageToken that can be used to get the next page of results in
  41030. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41031. // (Default: 500)
  41032. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  41033. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41034. return c
  41035. }
  41036. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41037. // a certain order. By default, results are returned in alphanumerical
  41038. // order based on the resource name.
  41039. //
  41040. // You can also sort results in descending order based on the creation
  41041. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41042. // based on the creationTimestamp field in reverse chronological order
  41043. // (newest result first). Use this to sort resources like operations so
  41044. // that the newest operation is returned first.
  41045. //
  41046. // Currently, only sorting by name or creationTimestamp desc is
  41047. // supported.
  41048. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  41049. c.urlParams_.Set("orderBy", orderBy)
  41050. return c
  41051. }
  41052. // PageToken sets the optional parameter "pageToken": Specifies a page
  41053. // token to use. Set pageToken to the nextPageToken returned by a
  41054. // previous list request to get the next page of results.
  41055. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  41056. c.urlParams_.Set("pageToken", pageToken)
  41057. return c
  41058. }
  41059. // Fields allows partial responses to be retrieved. See
  41060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41061. // for more information.
  41062. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  41063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41064. return c
  41065. }
  41066. // IfNoneMatch sets the optional parameter which makes the operation
  41067. // fail if the object's ETag matches the given value. This is useful for
  41068. // getting updates only after the object has changed since the last
  41069. // request. Use googleapi.IsNotModified to check whether the response
  41070. // error from Do is the result of In-None-Match.
  41071. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  41072. c.ifNoneMatch_ = entityTag
  41073. return c
  41074. }
  41075. // Context sets the context to be used in this call's Do method. Any
  41076. // pending HTTP request will be aborted if the provided context is
  41077. // canceled.
  41078. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  41079. c.ctx_ = ctx
  41080. return c
  41081. }
  41082. // Header returns an http.Header that can be modified by the caller to
  41083. // add HTTP headers to the request.
  41084. func (c *AutoscalersListCall) Header() http.Header {
  41085. if c.header_ == nil {
  41086. c.header_ = make(http.Header)
  41087. }
  41088. return c.header_
  41089. }
  41090. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  41091. reqHeaders := make(http.Header)
  41092. for k, v := range c.header_ {
  41093. reqHeaders[k] = v
  41094. }
  41095. reqHeaders.Set("User-Agent", c.s.userAgent())
  41096. if c.ifNoneMatch_ != "" {
  41097. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41098. }
  41099. var body io.Reader = nil
  41100. c.urlParams_.Set("alt", alt)
  41101. c.urlParams_.Set("prettyPrint", "false")
  41102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  41103. urls += "?" + c.urlParams_.Encode()
  41104. req, err := http.NewRequest("GET", urls, body)
  41105. if err != nil {
  41106. return nil, err
  41107. }
  41108. req.Header = reqHeaders
  41109. googleapi.Expand(req.URL, map[string]string{
  41110. "project": c.project,
  41111. "zone": c.zone,
  41112. })
  41113. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41114. }
  41115. // Do executes the "compute.autoscalers.list" call.
  41116. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  41117. // status code is an error. Response headers are in either
  41118. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  41119. // at all) in error.(*googleapi.Error).Header. Use
  41120. // googleapi.IsNotModified to check whether the returned error was
  41121. // because http.StatusNotModified was returned.
  41122. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  41123. gensupport.SetOptions(c.urlParams_, opts...)
  41124. res, err := c.doRequest("json")
  41125. if res != nil && res.StatusCode == http.StatusNotModified {
  41126. if res.Body != nil {
  41127. res.Body.Close()
  41128. }
  41129. return nil, &googleapi.Error{
  41130. Code: res.StatusCode,
  41131. Header: res.Header,
  41132. }
  41133. }
  41134. if err != nil {
  41135. return nil, err
  41136. }
  41137. defer googleapi.CloseBody(res)
  41138. if err := googleapi.CheckResponse(res); err != nil {
  41139. return nil, err
  41140. }
  41141. ret := &AutoscalerList{
  41142. ServerResponse: googleapi.ServerResponse{
  41143. Header: res.Header,
  41144. HTTPStatusCode: res.StatusCode,
  41145. },
  41146. }
  41147. target := &ret
  41148. if err := gensupport.DecodeResponse(target, res); err != nil {
  41149. return nil, err
  41150. }
  41151. return ret, nil
  41152. // {
  41153. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  41154. // "httpMethod": "GET",
  41155. // "id": "compute.autoscalers.list",
  41156. // "parameterOrder": [
  41157. // "project",
  41158. // "zone"
  41159. // ],
  41160. // "parameters": {
  41161. // "filter": {
  41162. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  41163. // "location": "query",
  41164. // "type": "string"
  41165. // },
  41166. // "maxResults": {
  41167. // "default": "500",
  41168. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  41169. // "format": "uint32",
  41170. // "location": "query",
  41171. // "minimum": "0",
  41172. // "type": "integer"
  41173. // },
  41174. // "orderBy": {
  41175. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  41176. // "location": "query",
  41177. // "type": "string"
  41178. // },
  41179. // "pageToken": {
  41180. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  41181. // "location": "query",
  41182. // "type": "string"
  41183. // },
  41184. // "project": {
  41185. // "description": "Project ID for this request.",
  41186. // "location": "path",
  41187. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41188. // "required": true,
  41189. // "type": "string"
  41190. // },
  41191. // "zone": {
  41192. // "description": "Name of the zone for this request.",
  41193. // "location": "path",
  41194. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41195. // "required": true,
  41196. // "type": "string"
  41197. // }
  41198. // },
  41199. // "path": "{project}/zones/{zone}/autoscalers",
  41200. // "response": {
  41201. // "$ref": "AutoscalerList"
  41202. // },
  41203. // "scopes": [
  41204. // "https://www.googleapis.com/auth/cloud-platform",
  41205. // "https://www.googleapis.com/auth/compute",
  41206. // "https://www.googleapis.com/auth/compute.readonly"
  41207. // ]
  41208. // }
  41209. }
  41210. // Pages invokes f for each page of results.
  41211. // A non-nil error returned from f will halt the iteration.
  41212. // The provided context supersedes any context provided to the Context method.
  41213. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  41214. c.ctx_ = ctx
  41215. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41216. for {
  41217. x, err := c.Do()
  41218. if err != nil {
  41219. return err
  41220. }
  41221. if err := f(x); err != nil {
  41222. return err
  41223. }
  41224. if x.NextPageToken == "" {
  41225. return nil
  41226. }
  41227. c.PageToken(x.NextPageToken)
  41228. }
  41229. }
  41230. // method id "compute.autoscalers.patch":
  41231. type AutoscalersPatchCall struct {
  41232. s *Service
  41233. project string
  41234. zone string
  41235. autoscaler *Autoscaler
  41236. urlParams_ gensupport.URLParams
  41237. ctx_ context.Context
  41238. header_ http.Header
  41239. }
  41240. // Patch: Updates an autoscaler in the specified project using the data
  41241. // included in the request. This method supports PATCH semantics and
  41242. // uses the JSON merge patch format and processing rules.
  41243. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  41244. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41245. c.project = project
  41246. c.zone = zone
  41247. c.autoscaler = autoscaler
  41248. return c
  41249. }
  41250. // Autoscaler sets the optional parameter "autoscaler": Name of the
  41251. // autoscaler to patch.
  41252. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  41253. c.urlParams_.Set("autoscaler", autoscaler)
  41254. return c
  41255. }
  41256. // RequestId sets the optional parameter "requestId": An optional
  41257. // request ID to identify requests. Specify a unique request ID so that
  41258. // if you must retry your request, the server will know to ignore the
  41259. // request if it has already been completed.
  41260. //
  41261. // For example, consider a situation where you make an initial request
  41262. // and the request times out. If you make the request again with the
  41263. // same request ID, the server can check if original operation with the
  41264. // same request ID was received, and if so, will ignore the second
  41265. // request. This prevents clients from accidentally creating duplicate
  41266. // commitments.
  41267. //
  41268. // The request ID must be a valid UUID with the exception that zero UUID
  41269. // is not supported (00000000-0000-0000-0000-000000000000).
  41270. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  41271. c.urlParams_.Set("requestId", requestId)
  41272. return c
  41273. }
  41274. // Fields allows partial responses to be retrieved. See
  41275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41276. // for more information.
  41277. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  41278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41279. return c
  41280. }
  41281. // Context sets the context to be used in this call's Do method. Any
  41282. // pending HTTP request will be aborted if the provided context is
  41283. // canceled.
  41284. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  41285. c.ctx_ = ctx
  41286. return c
  41287. }
  41288. // Header returns an http.Header that can be modified by the caller to
  41289. // add HTTP headers to the request.
  41290. func (c *AutoscalersPatchCall) Header() http.Header {
  41291. if c.header_ == nil {
  41292. c.header_ = make(http.Header)
  41293. }
  41294. return c.header_
  41295. }
  41296. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  41297. reqHeaders := make(http.Header)
  41298. for k, v := range c.header_ {
  41299. reqHeaders[k] = v
  41300. }
  41301. reqHeaders.Set("User-Agent", c.s.userAgent())
  41302. var body io.Reader = nil
  41303. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  41304. if err != nil {
  41305. return nil, err
  41306. }
  41307. reqHeaders.Set("Content-Type", "application/json")
  41308. c.urlParams_.Set("alt", alt)
  41309. c.urlParams_.Set("prettyPrint", "false")
  41310. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  41311. urls += "?" + c.urlParams_.Encode()
  41312. req, err := http.NewRequest("PATCH", urls, body)
  41313. if err != nil {
  41314. return nil, err
  41315. }
  41316. req.Header = reqHeaders
  41317. googleapi.Expand(req.URL, map[string]string{
  41318. "project": c.project,
  41319. "zone": c.zone,
  41320. })
  41321. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41322. }
  41323. // Do executes the "compute.autoscalers.patch" call.
  41324. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41325. // status code is an error. Response headers are in either
  41326. // *Operation.ServerResponse.Header or (if a response was returned at
  41327. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41328. // to check whether the returned error was because
  41329. // http.StatusNotModified was returned.
  41330. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41331. gensupport.SetOptions(c.urlParams_, opts...)
  41332. res, err := c.doRequest("json")
  41333. if res != nil && res.StatusCode == http.StatusNotModified {
  41334. if res.Body != nil {
  41335. res.Body.Close()
  41336. }
  41337. return nil, &googleapi.Error{
  41338. Code: res.StatusCode,
  41339. Header: res.Header,
  41340. }
  41341. }
  41342. if err != nil {
  41343. return nil, err
  41344. }
  41345. defer googleapi.CloseBody(res)
  41346. if err := googleapi.CheckResponse(res); err != nil {
  41347. return nil, err
  41348. }
  41349. ret := &Operation{
  41350. ServerResponse: googleapi.ServerResponse{
  41351. Header: res.Header,
  41352. HTTPStatusCode: res.StatusCode,
  41353. },
  41354. }
  41355. target := &ret
  41356. if err := gensupport.DecodeResponse(target, res); err != nil {
  41357. return nil, err
  41358. }
  41359. return ret, nil
  41360. // {
  41361. // "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.",
  41362. // "httpMethod": "PATCH",
  41363. // "id": "compute.autoscalers.patch",
  41364. // "parameterOrder": [
  41365. // "project",
  41366. // "zone"
  41367. // ],
  41368. // "parameters": {
  41369. // "autoscaler": {
  41370. // "description": "Name of the autoscaler to patch.",
  41371. // "location": "query",
  41372. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41373. // "type": "string"
  41374. // },
  41375. // "project": {
  41376. // "description": "Project ID for this request.",
  41377. // "location": "path",
  41378. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41379. // "required": true,
  41380. // "type": "string"
  41381. // },
  41382. // "requestId": {
  41383. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41384. // "location": "query",
  41385. // "type": "string"
  41386. // },
  41387. // "zone": {
  41388. // "description": "Name of the zone for this request.",
  41389. // "location": "path",
  41390. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41391. // "required": true,
  41392. // "type": "string"
  41393. // }
  41394. // },
  41395. // "path": "{project}/zones/{zone}/autoscalers",
  41396. // "request": {
  41397. // "$ref": "Autoscaler"
  41398. // },
  41399. // "response": {
  41400. // "$ref": "Operation"
  41401. // },
  41402. // "scopes": [
  41403. // "https://www.googleapis.com/auth/cloud-platform",
  41404. // "https://www.googleapis.com/auth/compute"
  41405. // ]
  41406. // }
  41407. }
  41408. // method id "compute.autoscalers.testIamPermissions":
  41409. type AutoscalersTestIamPermissionsCall struct {
  41410. s *Service
  41411. project string
  41412. zone string
  41413. resource string
  41414. testpermissionsrequest *TestPermissionsRequest
  41415. urlParams_ gensupport.URLParams
  41416. ctx_ context.Context
  41417. header_ http.Header
  41418. }
  41419. // TestIamPermissions: Returns permissions that a caller has on the
  41420. // specified resource.
  41421. func (r *AutoscalersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AutoscalersTestIamPermissionsCall {
  41422. c := &AutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41423. c.project = project
  41424. c.zone = zone
  41425. c.resource = resource
  41426. c.testpermissionsrequest = testpermissionsrequest
  41427. return c
  41428. }
  41429. // Fields allows partial responses to be retrieved. See
  41430. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41431. // for more information.
  41432. func (c *AutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *AutoscalersTestIamPermissionsCall {
  41433. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41434. return c
  41435. }
  41436. // Context sets the context to be used in this call's Do method. Any
  41437. // pending HTTP request will be aborted if the provided context is
  41438. // canceled.
  41439. func (c *AutoscalersTestIamPermissionsCall) Context(ctx context.Context) *AutoscalersTestIamPermissionsCall {
  41440. c.ctx_ = ctx
  41441. return c
  41442. }
  41443. // Header returns an http.Header that can be modified by the caller to
  41444. // add HTTP headers to the request.
  41445. func (c *AutoscalersTestIamPermissionsCall) Header() http.Header {
  41446. if c.header_ == nil {
  41447. c.header_ = make(http.Header)
  41448. }
  41449. return c.header_
  41450. }
  41451. func (c *AutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  41452. reqHeaders := make(http.Header)
  41453. for k, v := range c.header_ {
  41454. reqHeaders[k] = v
  41455. }
  41456. reqHeaders.Set("User-Agent", c.s.userAgent())
  41457. var body io.Reader = nil
  41458. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  41459. if err != nil {
  41460. return nil, err
  41461. }
  41462. reqHeaders.Set("Content-Type", "application/json")
  41463. c.urlParams_.Set("alt", alt)
  41464. c.urlParams_.Set("prettyPrint", "false")
  41465. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions")
  41466. urls += "?" + c.urlParams_.Encode()
  41467. req, err := http.NewRequest("POST", urls, body)
  41468. if err != nil {
  41469. return nil, err
  41470. }
  41471. req.Header = reqHeaders
  41472. googleapi.Expand(req.URL, map[string]string{
  41473. "project": c.project,
  41474. "zone": c.zone,
  41475. "resource": c.resource,
  41476. })
  41477. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41478. }
  41479. // Do executes the "compute.autoscalers.testIamPermissions" call.
  41480. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  41481. // non-2xx status code is an error. Response headers are in either
  41482. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  41483. // returned at all) in error.(*googleapi.Error).Header. Use
  41484. // googleapi.IsNotModified to check whether the returned error was
  41485. // because http.StatusNotModified was returned.
  41486. func (c *AutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  41487. gensupport.SetOptions(c.urlParams_, opts...)
  41488. res, err := c.doRequest("json")
  41489. if res != nil && res.StatusCode == http.StatusNotModified {
  41490. if res.Body != nil {
  41491. res.Body.Close()
  41492. }
  41493. return nil, &googleapi.Error{
  41494. Code: res.StatusCode,
  41495. Header: res.Header,
  41496. }
  41497. }
  41498. if err != nil {
  41499. return nil, err
  41500. }
  41501. defer googleapi.CloseBody(res)
  41502. if err := googleapi.CheckResponse(res); err != nil {
  41503. return nil, err
  41504. }
  41505. ret := &TestPermissionsResponse{
  41506. ServerResponse: googleapi.ServerResponse{
  41507. Header: res.Header,
  41508. HTTPStatusCode: res.StatusCode,
  41509. },
  41510. }
  41511. target := &ret
  41512. if err := gensupport.DecodeResponse(target, res); err != nil {
  41513. return nil, err
  41514. }
  41515. return ret, nil
  41516. // {
  41517. // "description": "Returns permissions that a caller has on the specified resource.",
  41518. // "httpMethod": "POST",
  41519. // "id": "compute.autoscalers.testIamPermissions",
  41520. // "parameterOrder": [
  41521. // "project",
  41522. // "zone",
  41523. // "resource"
  41524. // ],
  41525. // "parameters": {
  41526. // "project": {
  41527. // "description": "Project ID for this request.",
  41528. // "location": "path",
  41529. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41530. // "required": true,
  41531. // "type": "string"
  41532. // },
  41533. // "resource": {
  41534. // "description": "Name or id of the resource for this request.",
  41535. // "location": "path",
  41536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41537. // "required": true,
  41538. // "type": "string"
  41539. // },
  41540. // "zone": {
  41541. // "description": "The name of the zone for this request.",
  41542. // "location": "path",
  41543. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41544. // "required": true,
  41545. // "type": "string"
  41546. // }
  41547. // },
  41548. // "path": "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions",
  41549. // "request": {
  41550. // "$ref": "TestPermissionsRequest"
  41551. // },
  41552. // "response": {
  41553. // "$ref": "TestPermissionsResponse"
  41554. // },
  41555. // "scopes": [
  41556. // "https://www.googleapis.com/auth/cloud-platform",
  41557. // "https://www.googleapis.com/auth/compute",
  41558. // "https://www.googleapis.com/auth/compute.readonly"
  41559. // ]
  41560. // }
  41561. }
  41562. // method id "compute.autoscalers.update":
  41563. type AutoscalersUpdateCall struct {
  41564. s *Service
  41565. project string
  41566. zone string
  41567. autoscaler *Autoscaler
  41568. urlParams_ gensupport.URLParams
  41569. ctx_ context.Context
  41570. header_ http.Header
  41571. }
  41572. // Update: Updates an autoscaler in the specified project using the data
  41573. // included in the request.
  41574. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  41575. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41576. c.project = project
  41577. c.zone = zone
  41578. c.autoscaler = autoscaler
  41579. return c
  41580. }
  41581. // Autoscaler sets the optional parameter "autoscaler": Name of the
  41582. // autoscaler to update.
  41583. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  41584. c.urlParams_.Set("autoscaler", autoscaler)
  41585. return c
  41586. }
  41587. // RequestId sets the optional parameter "requestId": An optional
  41588. // request ID to identify requests. Specify a unique request ID so that
  41589. // if you must retry your request, the server will know to ignore the
  41590. // request if it has already been completed.
  41591. //
  41592. // For example, consider a situation where you make an initial request
  41593. // and the request times out. If you make the request again with the
  41594. // same request ID, the server can check if original operation with the
  41595. // same request ID was received, and if so, will ignore the second
  41596. // request. This prevents clients from accidentally creating duplicate
  41597. // commitments.
  41598. //
  41599. // The request ID must be a valid UUID with the exception that zero UUID
  41600. // is not supported (00000000-0000-0000-0000-000000000000).
  41601. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  41602. c.urlParams_.Set("requestId", requestId)
  41603. return c
  41604. }
  41605. // Fields allows partial responses to be retrieved. See
  41606. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41607. // for more information.
  41608. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  41609. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41610. return c
  41611. }
  41612. // Context sets the context to be used in this call's Do method. Any
  41613. // pending HTTP request will be aborted if the provided context is
  41614. // canceled.
  41615. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  41616. c.ctx_ = ctx
  41617. return c
  41618. }
  41619. // Header returns an http.Header that can be modified by the caller to
  41620. // add HTTP headers to the request.
  41621. func (c *AutoscalersUpdateCall) Header() http.Header {
  41622. if c.header_ == nil {
  41623. c.header_ = make(http.Header)
  41624. }
  41625. return c.header_
  41626. }
  41627. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  41628. reqHeaders := make(http.Header)
  41629. for k, v := range c.header_ {
  41630. reqHeaders[k] = v
  41631. }
  41632. reqHeaders.Set("User-Agent", c.s.userAgent())
  41633. var body io.Reader = nil
  41634. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  41635. if err != nil {
  41636. return nil, err
  41637. }
  41638. reqHeaders.Set("Content-Type", "application/json")
  41639. c.urlParams_.Set("alt", alt)
  41640. c.urlParams_.Set("prettyPrint", "false")
  41641. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  41642. urls += "?" + c.urlParams_.Encode()
  41643. req, err := http.NewRequest("PUT", urls, body)
  41644. if err != nil {
  41645. return nil, err
  41646. }
  41647. req.Header = reqHeaders
  41648. googleapi.Expand(req.URL, map[string]string{
  41649. "project": c.project,
  41650. "zone": c.zone,
  41651. })
  41652. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41653. }
  41654. // Do executes the "compute.autoscalers.update" call.
  41655. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41656. // status code is an error. Response headers are in either
  41657. // *Operation.ServerResponse.Header or (if a response was returned at
  41658. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41659. // to check whether the returned error was because
  41660. // http.StatusNotModified was returned.
  41661. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41662. gensupport.SetOptions(c.urlParams_, opts...)
  41663. res, err := c.doRequest("json")
  41664. if res != nil && res.StatusCode == http.StatusNotModified {
  41665. if res.Body != nil {
  41666. res.Body.Close()
  41667. }
  41668. return nil, &googleapi.Error{
  41669. Code: res.StatusCode,
  41670. Header: res.Header,
  41671. }
  41672. }
  41673. if err != nil {
  41674. return nil, err
  41675. }
  41676. defer googleapi.CloseBody(res)
  41677. if err := googleapi.CheckResponse(res); err != nil {
  41678. return nil, err
  41679. }
  41680. ret := &Operation{
  41681. ServerResponse: googleapi.ServerResponse{
  41682. Header: res.Header,
  41683. HTTPStatusCode: res.StatusCode,
  41684. },
  41685. }
  41686. target := &ret
  41687. if err := gensupport.DecodeResponse(target, res); err != nil {
  41688. return nil, err
  41689. }
  41690. return ret, nil
  41691. // {
  41692. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  41693. // "httpMethod": "PUT",
  41694. // "id": "compute.autoscalers.update",
  41695. // "parameterOrder": [
  41696. // "project",
  41697. // "zone"
  41698. // ],
  41699. // "parameters": {
  41700. // "autoscaler": {
  41701. // "description": "Name of the autoscaler to update.",
  41702. // "location": "query",
  41703. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41704. // "type": "string"
  41705. // },
  41706. // "project": {
  41707. // "description": "Project ID for this request.",
  41708. // "location": "path",
  41709. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41710. // "required": true,
  41711. // "type": "string"
  41712. // },
  41713. // "requestId": {
  41714. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41715. // "location": "query",
  41716. // "type": "string"
  41717. // },
  41718. // "zone": {
  41719. // "description": "Name of the zone for this request.",
  41720. // "location": "path",
  41721. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41722. // "required": true,
  41723. // "type": "string"
  41724. // }
  41725. // },
  41726. // "path": "{project}/zones/{zone}/autoscalers",
  41727. // "request": {
  41728. // "$ref": "Autoscaler"
  41729. // },
  41730. // "response": {
  41731. // "$ref": "Operation"
  41732. // },
  41733. // "scopes": [
  41734. // "https://www.googleapis.com/auth/cloud-platform",
  41735. // "https://www.googleapis.com/auth/compute"
  41736. // ]
  41737. // }
  41738. }
  41739. // method id "compute.backendBuckets.addSignedUrlKey":
  41740. type BackendBucketsAddSignedUrlKeyCall struct {
  41741. s *Service
  41742. project string
  41743. backendBucket string
  41744. signedurlkey *SignedUrlKey
  41745. urlParams_ gensupport.URLParams
  41746. ctx_ context.Context
  41747. header_ http.Header
  41748. }
  41749. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  41750. // for this backend bucket.
  41751. func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
  41752. c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41753. c.project = project
  41754. c.backendBucket = backendBucket
  41755. c.signedurlkey = signedurlkey
  41756. return c
  41757. }
  41758. // RequestId sets the optional parameter "requestId": An optional
  41759. // request ID to identify requests. Specify a unique request ID so that
  41760. // if you must retry your request, the server will know to ignore the
  41761. // request if it has already been completed.
  41762. //
  41763. // For example, consider a situation where you make an initial request
  41764. // and the request times out. If you make the request again with the
  41765. // same request ID, the server can check if original operation with the
  41766. // same request ID was received, and if so, will ignore the second
  41767. // request. This prevents clients from accidentally creating duplicate
  41768. // commitments.
  41769. //
  41770. // The request ID must be a valid UUID with the exception that zero UUID
  41771. // is not supported (00000000-0000-0000-0000-000000000000).
  41772. func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
  41773. c.urlParams_.Set("requestId", requestId)
  41774. return c
  41775. }
  41776. // Fields allows partial responses to be retrieved. See
  41777. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41778. // for more information.
  41779. func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
  41780. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41781. return c
  41782. }
  41783. // Context sets the context to be used in this call's Do method. Any
  41784. // pending HTTP request will be aborted if the provided context is
  41785. // canceled.
  41786. func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
  41787. c.ctx_ = ctx
  41788. return c
  41789. }
  41790. // Header returns an http.Header that can be modified by the caller to
  41791. // add HTTP headers to the request.
  41792. func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
  41793. if c.header_ == nil {
  41794. c.header_ = make(http.Header)
  41795. }
  41796. return c.header_
  41797. }
  41798. func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  41799. reqHeaders := make(http.Header)
  41800. for k, v := range c.header_ {
  41801. reqHeaders[k] = v
  41802. }
  41803. reqHeaders.Set("User-Agent", c.s.userAgent())
  41804. var body io.Reader = nil
  41805. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  41806. if err != nil {
  41807. return nil, err
  41808. }
  41809. reqHeaders.Set("Content-Type", "application/json")
  41810. c.urlParams_.Set("alt", alt)
  41811. c.urlParams_.Set("prettyPrint", "false")
  41812. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
  41813. urls += "?" + c.urlParams_.Encode()
  41814. req, err := http.NewRequest("POST", urls, body)
  41815. if err != nil {
  41816. return nil, err
  41817. }
  41818. req.Header = reqHeaders
  41819. googleapi.Expand(req.URL, map[string]string{
  41820. "project": c.project,
  41821. "backendBucket": c.backendBucket,
  41822. })
  41823. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41824. }
  41825. // Do executes the "compute.backendBuckets.addSignedUrlKey" call.
  41826. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41827. // status code is an error. Response headers are in either
  41828. // *Operation.ServerResponse.Header or (if a response was returned at
  41829. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41830. // to check whether the returned error was because
  41831. // http.StatusNotModified was returned.
  41832. func (c *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41833. gensupport.SetOptions(c.urlParams_, opts...)
  41834. res, err := c.doRequest("json")
  41835. if res != nil && res.StatusCode == http.StatusNotModified {
  41836. if res.Body != nil {
  41837. res.Body.Close()
  41838. }
  41839. return nil, &googleapi.Error{
  41840. Code: res.StatusCode,
  41841. Header: res.Header,
  41842. }
  41843. }
  41844. if err != nil {
  41845. return nil, err
  41846. }
  41847. defer googleapi.CloseBody(res)
  41848. if err := googleapi.CheckResponse(res); err != nil {
  41849. return nil, err
  41850. }
  41851. ret := &Operation{
  41852. ServerResponse: googleapi.ServerResponse{
  41853. Header: res.Header,
  41854. HTTPStatusCode: res.StatusCode,
  41855. },
  41856. }
  41857. target := &ret
  41858. if err := gensupport.DecodeResponse(target, res); err != nil {
  41859. return nil, err
  41860. }
  41861. return ret, nil
  41862. // {
  41863. // "description": "Adds a key for validating requests with signed URLs for this backend bucket.",
  41864. // "httpMethod": "POST",
  41865. // "id": "compute.backendBuckets.addSignedUrlKey",
  41866. // "parameterOrder": [
  41867. // "project",
  41868. // "backendBucket"
  41869. // ],
  41870. // "parameters": {
  41871. // "backendBucket": {
  41872. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  41873. // "location": "path",
  41874. // "required": true,
  41875. // "type": "string"
  41876. // },
  41877. // "project": {
  41878. // "description": "Project ID for this request.",
  41879. // "location": "path",
  41880. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41881. // "required": true,
  41882. // "type": "string"
  41883. // },
  41884. // "requestId": {
  41885. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41886. // "location": "query",
  41887. // "type": "string"
  41888. // }
  41889. // },
  41890. // "path": "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
  41891. // "request": {
  41892. // "$ref": "SignedUrlKey"
  41893. // },
  41894. // "response": {
  41895. // "$ref": "Operation"
  41896. // },
  41897. // "scopes": [
  41898. // "https://www.googleapis.com/auth/cloud-platform",
  41899. // "https://www.googleapis.com/auth/compute"
  41900. // ]
  41901. // }
  41902. }
  41903. // method id "compute.backendBuckets.delete":
  41904. type BackendBucketsDeleteCall struct {
  41905. s *Service
  41906. project string
  41907. backendBucket string
  41908. urlParams_ gensupport.URLParams
  41909. ctx_ context.Context
  41910. header_ http.Header
  41911. }
  41912. // Delete: Deletes the specified BackendBucket resource.
  41913. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  41914. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41915. c.project = project
  41916. c.backendBucket = backendBucket
  41917. return c
  41918. }
  41919. // RequestId sets the optional parameter "requestId": An optional
  41920. // request ID to identify requests. Specify a unique request ID so that
  41921. // if you must retry your request, the server will know to ignore the
  41922. // request if it has already been completed.
  41923. //
  41924. // For example, consider a situation where you make an initial request
  41925. // and the request times out. If you make the request again with the
  41926. // same request ID, the server can check if original operation with the
  41927. // same request ID was received, and if so, will ignore the second
  41928. // request. This prevents clients from accidentally creating duplicate
  41929. // commitments.
  41930. //
  41931. // The request ID must be a valid UUID with the exception that zero UUID
  41932. // is not supported (00000000-0000-0000-0000-000000000000).
  41933. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  41934. c.urlParams_.Set("requestId", requestId)
  41935. return c
  41936. }
  41937. // Fields allows partial responses to be retrieved. See
  41938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41939. // for more information.
  41940. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  41941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41942. return c
  41943. }
  41944. // Context sets the context to be used in this call's Do method. Any
  41945. // pending HTTP request will be aborted if the provided context is
  41946. // canceled.
  41947. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  41948. c.ctx_ = ctx
  41949. return c
  41950. }
  41951. // Header returns an http.Header that can be modified by the caller to
  41952. // add HTTP headers to the request.
  41953. func (c *BackendBucketsDeleteCall) Header() http.Header {
  41954. if c.header_ == nil {
  41955. c.header_ = make(http.Header)
  41956. }
  41957. return c.header_
  41958. }
  41959. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  41960. reqHeaders := make(http.Header)
  41961. for k, v := range c.header_ {
  41962. reqHeaders[k] = v
  41963. }
  41964. reqHeaders.Set("User-Agent", c.s.userAgent())
  41965. var body io.Reader = nil
  41966. c.urlParams_.Set("alt", alt)
  41967. c.urlParams_.Set("prettyPrint", "false")
  41968. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  41969. urls += "?" + c.urlParams_.Encode()
  41970. req, err := http.NewRequest("DELETE", urls, body)
  41971. if err != nil {
  41972. return nil, err
  41973. }
  41974. req.Header = reqHeaders
  41975. googleapi.Expand(req.URL, map[string]string{
  41976. "project": c.project,
  41977. "backendBucket": c.backendBucket,
  41978. })
  41979. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41980. }
  41981. // Do executes the "compute.backendBuckets.delete" call.
  41982. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41983. // status code is an error. Response headers are in either
  41984. // *Operation.ServerResponse.Header or (if a response was returned at
  41985. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41986. // to check whether the returned error was because
  41987. // http.StatusNotModified was returned.
  41988. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41989. gensupport.SetOptions(c.urlParams_, opts...)
  41990. res, err := c.doRequest("json")
  41991. if res != nil && res.StatusCode == http.StatusNotModified {
  41992. if res.Body != nil {
  41993. res.Body.Close()
  41994. }
  41995. return nil, &googleapi.Error{
  41996. Code: res.StatusCode,
  41997. Header: res.Header,
  41998. }
  41999. }
  42000. if err != nil {
  42001. return nil, err
  42002. }
  42003. defer googleapi.CloseBody(res)
  42004. if err := googleapi.CheckResponse(res); err != nil {
  42005. return nil, err
  42006. }
  42007. ret := &Operation{
  42008. ServerResponse: googleapi.ServerResponse{
  42009. Header: res.Header,
  42010. HTTPStatusCode: res.StatusCode,
  42011. },
  42012. }
  42013. target := &ret
  42014. if err := gensupport.DecodeResponse(target, res); err != nil {
  42015. return nil, err
  42016. }
  42017. return ret, nil
  42018. // {
  42019. // "description": "Deletes the specified BackendBucket resource.",
  42020. // "httpMethod": "DELETE",
  42021. // "id": "compute.backendBuckets.delete",
  42022. // "parameterOrder": [
  42023. // "project",
  42024. // "backendBucket"
  42025. // ],
  42026. // "parameters": {
  42027. // "backendBucket": {
  42028. // "description": "Name of the BackendBucket resource to delete.",
  42029. // "location": "path",
  42030. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42031. // "required": true,
  42032. // "type": "string"
  42033. // },
  42034. // "project": {
  42035. // "description": "Project ID for this request.",
  42036. // "location": "path",
  42037. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42038. // "required": true,
  42039. // "type": "string"
  42040. // },
  42041. // "requestId": {
  42042. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42043. // "location": "query",
  42044. // "type": "string"
  42045. // }
  42046. // },
  42047. // "path": "{project}/global/backendBuckets/{backendBucket}",
  42048. // "response": {
  42049. // "$ref": "Operation"
  42050. // },
  42051. // "scopes": [
  42052. // "https://www.googleapis.com/auth/cloud-platform",
  42053. // "https://www.googleapis.com/auth/compute"
  42054. // ]
  42055. // }
  42056. }
  42057. // method id "compute.backendBuckets.deleteSignedUrlKey":
  42058. type BackendBucketsDeleteSignedUrlKeyCall struct {
  42059. s *Service
  42060. project string
  42061. backendBucket string
  42062. urlParams_ gensupport.URLParams
  42063. ctx_ context.Context
  42064. header_ http.Header
  42065. }
  42066. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  42067. // URLs for this backend bucket.
  42068. func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
  42069. c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42070. c.project = project
  42071. c.backendBucket = backendBucket
  42072. c.urlParams_.Set("keyName", keyName)
  42073. return c
  42074. }
  42075. // RequestId sets the optional parameter "requestId": An optional
  42076. // request ID to identify requests. Specify a unique request ID so that
  42077. // if you must retry your request, the server will know to ignore the
  42078. // request if it has already been completed.
  42079. //
  42080. // For example, consider a situation where you make an initial request
  42081. // and the request times out. If you make the request again with the
  42082. // same request ID, the server can check if original operation with the
  42083. // same request ID was received, and if so, will ignore the second
  42084. // request. This prevents clients from accidentally creating duplicate
  42085. // commitments.
  42086. //
  42087. // The request ID must be a valid UUID with the exception that zero UUID
  42088. // is not supported (00000000-0000-0000-0000-000000000000).
  42089. func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
  42090. c.urlParams_.Set("requestId", requestId)
  42091. return c
  42092. }
  42093. // Fields allows partial responses to be retrieved. See
  42094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42095. // for more information.
  42096. func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
  42097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42098. return c
  42099. }
  42100. // Context sets the context to be used in this call's Do method. Any
  42101. // pending HTTP request will be aborted if the provided context is
  42102. // canceled.
  42103. func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
  42104. c.ctx_ = ctx
  42105. return c
  42106. }
  42107. // Header returns an http.Header that can be modified by the caller to
  42108. // add HTTP headers to the request.
  42109. func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
  42110. if c.header_ == nil {
  42111. c.header_ = make(http.Header)
  42112. }
  42113. return c.header_
  42114. }
  42115. func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  42116. reqHeaders := make(http.Header)
  42117. for k, v := range c.header_ {
  42118. reqHeaders[k] = v
  42119. }
  42120. reqHeaders.Set("User-Agent", c.s.userAgent())
  42121. var body io.Reader = nil
  42122. c.urlParams_.Set("alt", alt)
  42123. c.urlParams_.Set("prettyPrint", "false")
  42124. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
  42125. urls += "?" + c.urlParams_.Encode()
  42126. req, err := http.NewRequest("POST", urls, body)
  42127. if err != nil {
  42128. return nil, err
  42129. }
  42130. req.Header = reqHeaders
  42131. googleapi.Expand(req.URL, map[string]string{
  42132. "project": c.project,
  42133. "backendBucket": c.backendBucket,
  42134. })
  42135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42136. }
  42137. // Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
  42138. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42139. // status code is an error. Response headers are in either
  42140. // *Operation.ServerResponse.Header or (if a response was returned at
  42141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42142. // to check whether the returned error was because
  42143. // http.StatusNotModified was returned.
  42144. func (c *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42145. gensupport.SetOptions(c.urlParams_, opts...)
  42146. res, err := c.doRequest("json")
  42147. if res != nil && res.StatusCode == http.StatusNotModified {
  42148. if res.Body != nil {
  42149. res.Body.Close()
  42150. }
  42151. return nil, &googleapi.Error{
  42152. Code: res.StatusCode,
  42153. Header: res.Header,
  42154. }
  42155. }
  42156. if err != nil {
  42157. return nil, err
  42158. }
  42159. defer googleapi.CloseBody(res)
  42160. if err := googleapi.CheckResponse(res); err != nil {
  42161. return nil, err
  42162. }
  42163. ret := &Operation{
  42164. ServerResponse: googleapi.ServerResponse{
  42165. Header: res.Header,
  42166. HTTPStatusCode: res.StatusCode,
  42167. },
  42168. }
  42169. target := &ret
  42170. if err := gensupport.DecodeResponse(target, res); err != nil {
  42171. return nil, err
  42172. }
  42173. return ret, nil
  42174. // {
  42175. // "description": "Deletes a key for validating requests with signed URLs for this backend bucket.",
  42176. // "httpMethod": "POST",
  42177. // "id": "compute.backendBuckets.deleteSignedUrlKey",
  42178. // "parameterOrder": [
  42179. // "project",
  42180. // "backendBucket",
  42181. // "keyName"
  42182. // ],
  42183. // "parameters": {
  42184. // "backendBucket": {
  42185. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  42186. // "location": "path",
  42187. // "required": true,
  42188. // "type": "string"
  42189. // },
  42190. // "keyName": {
  42191. // "description": "The name of the Signed URL Key to delete.",
  42192. // "location": "query",
  42193. // "required": true,
  42194. // "type": "string"
  42195. // },
  42196. // "project": {
  42197. // "description": "Project ID for this request.",
  42198. // "location": "path",
  42199. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42200. // "required": true,
  42201. // "type": "string"
  42202. // },
  42203. // "requestId": {
  42204. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42205. // "location": "query",
  42206. // "type": "string"
  42207. // }
  42208. // },
  42209. // "path": "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
  42210. // "response": {
  42211. // "$ref": "Operation"
  42212. // },
  42213. // "scopes": [
  42214. // "https://www.googleapis.com/auth/cloud-platform",
  42215. // "https://www.googleapis.com/auth/compute"
  42216. // ]
  42217. // }
  42218. }
  42219. // method id "compute.backendBuckets.get":
  42220. type BackendBucketsGetCall struct {
  42221. s *Service
  42222. project string
  42223. backendBucket string
  42224. urlParams_ gensupport.URLParams
  42225. ifNoneMatch_ string
  42226. ctx_ context.Context
  42227. header_ http.Header
  42228. }
  42229. // Get: Returns the specified BackendBucket resource. Gets a list of
  42230. // available backend buckets by making a list() request.
  42231. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  42232. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42233. c.project = project
  42234. c.backendBucket = backendBucket
  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 *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  42241. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42242. return c
  42243. }
  42244. // IfNoneMatch sets the optional parameter which makes the operation
  42245. // fail if the object's ETag matches the given value. This is useful for
  42246. // getting updates only after the object has changed since the last
  42247. // request. Use googleapi.IsNotModified to check whether the response
  42248. // error from Do is the result of In-None-Match.
  42249. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  42250. c.ifNoneMatch_ = entityTag
  42251. return c
  42252. }
  42253. // Context sets the context to be used in this call's Do method. Any
  42254. // pending HTTP request will be aborted if the provided context is
  42255. // canceled.
  42256. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  42257. c.ctx_ = ctx
  42258. return c
  42259. }
  42260. // Header returns an http.Header that can be modified by the caller to
  42261. // add HTTP headers to the request.
  42262. func (c *BackendBucketsGetCall) Header() http.Header {
  42263. if c.header_ == nil {
  42264. c.header_ = make(http.Header)
  42265. }
  42266. return c.header_
  42267. }
  42268. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  42269. reqHeaders := make(http.Header)
  42270. for k, v := range c.header_ {
  42271. reqHeaders[k] = v
  42272. }
  42273. reqHeaders.Set("User-Agent", c.s.userAgent())
  42274. if c.ifNoneMatch_ != "" {
  42275. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42276. }
  42277. var body io.Reader = nil
  42278. c.urlParams_.Set("alt", alt)
  42279. c.urlParams_.Set("prettyPrint", "false")
  42280. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  42281. urls += "?" + c.urlParams_.Encode()
  42282. req, err := http.NewRequest("GET", urls, body)
  42283. if err != nil {
  42284. return nil, err
  42285. }
  42286. req.Header = reqHeaders
  42287. googleapi.Expand(req.URL, map[string]string{
  42288. "project": c.project,
  42289. "backendBucket": c.backendBucket,
  42290. })
  42291. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42292. }
  42293. // Do executes the "compute.backendBuckets.get" call.
  42294. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  42295. // status code is an error. Response headers are in either
  42296. // *BackendBucket.ServerResponse.Header or (if a response was returned
  42297. // at all) in error.(*googleapi.Error).Header. Use
  42298. // googleapi.IsNotModified to check whether the returned error was
  42299. // because http.StatusNotModified was returned.
  42300. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  42301. gensupport.SetOptions(c.urlParams_, opts...)
  42302. res, err := c.doRequest("json")
  42303. if res != nil && res.StatusCode == http.StatusNotModified {
  42304. if res.Body != nil {
  42305. res.Body.Close()
  42306. }
  42307. return nil, &googleapi.Error{
  42308. Code: res.StatusCode,
  42309. Header: res.Header,
  42310. }
  42311. }
  42312. if err != nil {
  42313. return nil, err
  42314. }
  42315. defer googleapi.CloseBody(res)
  42316. if err := googleapi.CheckResponse(res); err != nil {
  42317. return nil, err
  42318. }
  42319. ret := &BackendBucket{
  42320. ServerResponse: googleapi.ServerResponse{
  42321. Header: res.Header,
  42322. HTTPStatusCode: res.StatusCode,
  42323. },
  42324. }
  42325. target := &ret
  42326. if err := gensupport.DecodeResponse(target, res); err != nil {
  42327. return nil, err
  42328. }
  42329. return ret, nil
  42330. // {
  42331. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  42332. // "httpMethod": "GET",
  42333. // "id": "compute.backendBuckets.get",
  42334. // "parameterOrder": [
  42335. // "project",
  42336. // "backendBucket"
  42337. // ],
  42338. // "parameters": {
  42339. // "backendBucket": {
  42340. // "description": "Name of the BackendBucket resource to return.",
  42341. // "location": "path",
  42342. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42343. // "required": true,
  42344. // "type": "string"
  42345. // },
  42346. // "project": {
  42347. // "description": "Project ID for this request.",
  42348. // "location": "path",
  42349. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42350. // "required": true,
  42351. // "type": "string"
  42352. // }
  42353. // },
  42354. // "path": "{project}/global/backendBuckets/{backendBucket}",
  42355. // "response": {
  42356. // "$ref": "BackendBucket"
  42357. // },
  42358. // "scopes": [
  42359. // "https://www.googleapis.com/auth/cloud-platform",
  42360. // "https://www.googleapis.com/auth/compute",
  42361. // "https://www.googleapis.com/auth/compute.readonly"
  42362. // ]
  42363. // }
  42364. }
  42365. // method id "compute.backendBuckets.getIamPolicy":
  42366. type BackendBucketsGetIamPolicyCall struct {
  42367. s *Service
  42368. project string
  42369. resource string
  42370. urlParams_ gensupport.URLParams
  42371. ifNoneMatch_ string
  42372. ctx_ context.Context
  42373. header_ http.Header
  42374. }
  42375. // GetIamPolicy: Gets the access control policy for a resource. May be
  42376. // empty if no such policy or resource exists.
  42377. func (r *BackendBucketsService) GetIamPolicy(project string, resource string) *BackendBucketsGetIamPolicyCall {
  42378. c := &BackendBucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42379. c.project = project
  42380. c.resource = resource
  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 *BackendBucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsGetIamPolicyCall {
  42387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42388. return c
  42389. }
  42390. // IfNoneMatch sets the optional parameter which makes the operation
  42391. // fail if the object's ETag matches the given value. This is useful for
  42392. // getting updates only after the object has changed since the last
  42393. // request. Use googleapi.IsNotModified to check whether the response
  42394. // error from Do is the result of In-None-Match.
  42395. func (c *BackendBucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BackendBucketsGetIamPolicyCall {
  42396. c.ifNoneMatch_ = entityTag
  42397. return c
  42398. }
  42399. // Context sets the context to be used in this call's Do method. Any
  42400. // pending HTTP request will be aborted if the provided context is
  42401. // canceled.
  42402. func (c *BackendBucketsGetIamPolicyCall) Context(ctx context.Context) *BackendBucketsGetIamPolicyCall {
  42403. c.ctx_ = ctx
  42404. return c
  42405. }
  42406. // Header returns an http.Header that can be modified by the caller to
  42407. // add HTTP headers to the request.
  42408. func (c *BackendBucketsGetIamPolicyCall) Header() http.Header {
  42409. if c.header_ == nil {
  42410. c.header_ = make(http.Header)
  42411. }
  42412. return c.header_
  42413. }
  42414. func (c *BackendBucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  42415. reqHeaders := make(http.Header)
  42416. for k, v := range c.header_ {
  42417. reqHeaders[k] = v
  42418. }
  42419. reqHeaders.Set("User-Agent", c.s.userAgent())
  42420. if c.ifNoneMatch_ != "" {
  42421. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42422. }
  42423. var body io.Reader = nil
  42424. c.urlParams_.Set("alt", alt)
  42425. c.urlParams_.Set("prettyPrint", "false")
  42426. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/getIamPolicy")
  42427. urls += "?" + c.urlParams_.Encode()
  42428. req, err := http.NewRequest("GET", urls, body)
  42429. if err != nil {
  42430. return nil, err
  42431. }
  42432. req.Header = reqHeaders
  42433. googleapi.Expand(req.URL, map[string]string{
  42434. "project": c.project,
  42435. "resource": c.resource,
  42436. })
  42437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42438. }
  42439. // Do executes the "compute.backendBuckets.getIamPolicy" call.
  42440. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  42441. // code is an error. Response headers are in either
  42442. // *Policy.ServerResponse.Header or (if a response was returned at all)
  42443. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  42444. // check whether the returned error was because http.StatusNotModified
  42445. // was returned.
  42446. func (c *BackendBucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  42447. gensupport.SetOptions(c.urlParams_, opts...)
  42448. res, err := c.doRequest("json")
  42449. if res != nil && res.StatusCode == http.StatusNotModified {
  42450. if res.Body != nil {
  42451. res.Body.Close()
  42452. }
  42453. return nil, &googleapi.Error{
  42454. Code: res.StatusCode,
  42455. Header: res.Header,
  42456. }
  42457. }
  42458. if err != nil {
  42459. return nil, err
  42460. }
  42461. defer googleapi.CloseBody(res)
  42462. if err := googleapi.CheckResponse(res); err != nil {
  42463. return nil, err
  42464. }
  42465. ret := &Policy{
  42466. ServerResponse: googleapi.ServerResponse{
  42467. Header: res.Header,
  42468. HTTPStatusCode: res.StatusCode,
  42469. },
  42470. }
  42471. target := &ret
  42472. if err := gensupport.DecodeResponse(target, res); err != nil {
  42473. return nil, err
  42474. }
  42475. return ret, nil
  42476. // {
  42477. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  42478. // "httpMethod": "GET",
  42479. // "id": "compute.backendBuckets.getIamPolicy",
  42480. // "parameterOrder": [
  42481. // "project",
  42482. // "resource"
  42483. // ],
  42484. // "parameters": {
  42485. // "project": {
  42486. // "description": "Project ID for this request.",
  42487. // "location": "path",
  42488. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42489. // "required": true,
  42490. // "type": "string"
  42491. // },
  42492. // "resource": {
  42493. // "description": "Name or id of the resource for this request.",
  42494. // "location": "path",
  42495. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42496. // "required": true,
  42497. // "type": "string"
  42498. // }
  42499. // },
  42500. // "path": "{project}/global/backendBuckets/{resource}/getIamPolicy",
  42501. // "response": {
  42502. // "$ref": "Policy"
  42503. // },
  42504. // "scopes": [
  42505. // "https://www.googleapis.com/auth/cloud-platform",
  42506. // "https://www.googleapis.com/auth/compute",
  42507. // "https://www.googleapis.com/auth/compute.readonly"
  42508. // ]
  42509. // }
  42510. }
  42511. // method id "compute.backendBuckets.insert":
  42512. type BackendBucketsInsertCall struct {
  42513. s *Service
  42514. project string
  42515. backendbucket *BackendBucket
  42516. urlParams_ gensupport.URLParams
  42517. ctx_ context.Context
  42518. header_ http.Header
  42519. }
  42520. // Insert: Creates a BackendBucket resource in the specified project
  42521. // using the data included in the request.
  42522. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  42523. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42524. c.project = project
  42525. c.backendbucket = backendbucket
  42526. return c
  42527. }
  42528. // RequestId sets the optional parameter "requestId": An optional
  42529. // request ID to identify requests. Specify a unique request ID so that
  42530. // if you must retry your request, the server will know to ignore the
  42531. // request if it has already been completed.
  42532. //
  42533. // For example, consider a situation where you make an initial request
  42534. // and the request times out. If you make the request again with the
  42535. // same request ID, the server can check if original operation with the
  42536. // same request ID was received, and if so, will ignore the second
  42537. // request. This prevents clients from accidentally creating duplicate
  42538. // commitments.
  42539. //
  42540. // The request ID must be a valid UUID with the exception that zero UUID
  42541. // is not supported (00000000-0000-0000-0000-000000000000).
  42542. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  42543. c.urlParams_.Set("requestId", requestId)
  42544. return c
  42545. }
  42546. // Fields allows partial responses to be retrieved. See
  42547. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42548. // for more information.
  42549. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  42550. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42551. return c
  42552. }
  42553. // Context sets the context to be used in this call's Do method. Any
  42554. // pending HTTP request will be aborted if the provided context is
  42555. // canceled.
  42556. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  42557. c.ctx_ = ctx
  42558. return c
  42559. }
  42560. // Header returns an http.Header that can be modified by the caller to
  42561. // add HTTP headers to the request.
  42562. func (c *BackendBucketsInsertCall) Header() http.Header {
  42563. if c.header_ == nil {
  42564. c.header_ = make(http.Header)
  42565. }
  42566. return c.header_
  42567. }
  42568. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  42569. reqHeaders := make(http.Header)
  42570. for k, v := range c.header_ {
  42571. reqHeaders[k] = v
  42572. }
  42573. reqHeaders.Set("User-Agent", c.s.userAgent())
  42574. var body io.Reader = nil
  42575. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  42576. if err != nil {
  42577. return nil, err
  42578. }
  42579. reqHeaders.Set("Content-Type", "application/json")
  42580. c.urlParams_.Set("alt", alt)
  42581. c.urlParams_.Set("prettyPrint", "false")
  42582. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  42583. urls += "?" + c.urlParams_.Encode()
  42584. req, err := http.NewRequest("POST", urls, body)
  42585. if err != nil {
  42586. return nil, err
  42587. }
  42588. req.Header = reqHeaders
  42589. googleapi.Expand(req.URL, map[string]string{
  42590. "project": c.project,
  42591. })
  42592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42593. }
  42594. // Do executes the "compute.backendBuckets.insert" call.
  42595. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42596. // status code is an error. Response headers are in either
  42597. // *Operation.ServerResponse.Header or (if a response was returned at
  42598. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42599. // to check whether the returned error was because
  42600. // http.StatusNotModified was returned.
  42601. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42602. gensupport.SetOptions(c.urlParams_, opts...)
  42603. res, err := c.doRequest("json")
  42604. if res != nil && res.StatusCode == http.StatusNotModified {
  42605. if res.Body != nil {
  42606. res.Body.Close()
  42607. }
  42608. return nil, &googleapi.Error{
  42609. Code: res.StatusCode,
  42610. Header: res.Header,
  42611. }
  42612. }
  42613. if err != nil {
  42614. return nil, err
  42615. }
  42616. defer googleapi.CloseBody(res)
  42617. if err := googleapi.CheckResponse(res); err != nil {
  42618. return nil, err
  42619. }
  42620. ret := &Operation{
  42621. ServerResponse: googleapi.ServerResponse{
  42622. Header: res.Header,
  42623. HTTPStatusCode: res.StatusCode,
  42624. },
  42625. }
  42626. target := &ret
  42627. if err := gensupport.DecodeResponse(target, res); err != nil {
  42628. return nil, err
  42629. }
  42630. return ret, nil
  42631. // {
  42632. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  42633. // "httpMethod": "POST",
  42634. // "id": "compute.backendBuckets.insert",
  42635. // "parameterOrder": [
  42636. // "project"
  42637. // ],
  42638. // "parameters": {
  42639. // "project": {
  42640. // "description": "Project ID for this request.",
  42641. // "location": "path",
  42642. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42643. // "required": true,
  42644. // "type": "string"
  42645. // },
  42646. // "requestId": {
  42647. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42648. // "location": "query",
  42649. // "type": "string"
  42650. // }
  42651. // },
  42652. // "path": "{project}/global/backendBuckets",
  42653. // "request": {
  42654. // "$ref": "BackendBucket"
  42655. // },
  42656. // "response": {
  42657. // "$ref": "Operation"
  42658. // },
  42659. // "scopes": [
  42660. // "https://www.googleapis.com/auth/cloud-platform",
  42661. // "https://www.googleapis.com/auth/compute"
  42662. // ]
  42663. // }
  42664. }
  42665. // method id "compute.backendBuckets.list":
  42666. type BackendBucketsListCall struct {
  42667. s *Service
  42668. project string
  42669. urlParams_ gensupport.URLParams
  42670. ifNoneMatch_ string
  42671. ctx_ context.Context
  42672. header_ http.Header
  42673. }
  42674. // List: Retrieves the list of BackendBucket resources available to the
  42675. // specified project.
  42676. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  42677. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42678. c.project = project
  42679. return c
  42680. }
  42681. // Filter sets the optional parameter "filter": A filter expression that
  42682. // filters resources listed in the response. The expression must specify
  42683. // the field name, a comparison operator, and the value that you want to
  42684. // use for filtering. The value must be a string, a number, or a
  42685. // boolean. The comparison operator must be either =, !=, >, or <.
  42686. //
  42687. // For example, if you are filtering Compute Engine instances, you can
  42688. // exclude instances named example-instance by specifying name !=
  42689. // example-instance.
  42690. //
  42691. // You can also filter nested fields. For example, you could specify
  42692. // scheduling.automaticRestart = false to include instances only if they
  42693. // are not scheduled for automatic restarts. You can use filtering on
  42694. // nested fields to filter based on resource labels.
  42695. //
  42696. // To filter on multiple expressions, provide each separate expression
  42697. // within parentheses. For example, (scheduling.automaticRestart = true)
  42698. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  42699. // AND expression. However, you can include AND and OR expressions
  42700. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  42701. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  42702. // true).
  42703. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  42704. c.urlParams_.Set("filter", filter)
  42705. return c
  42706. }
  42707. // MaxResults sets the optional parameter "maxResults": The maximum
  42708. // number of results per page that should be returned. If the number of
  42709. // available results is larger than maxResults, Compute Engine returns a
  42710. // nextPageToken that can be used to get the next page of results in
  42711. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42712. // (Default: 500)
  42713. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  42714. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42715. return c
  42716. }
  42717. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42718. // a certain order. By default, results are returned in alphanumerical
  42719. // order based on the resource name.
  42720. //
  42721. // You can also sort results in descending order based on the creation
  42722. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42723. // based on the creationTimestamp field in reverse chronological order
  42724. // (newest result first). Use this to sort resources like operations so
  42725. // that the newest operation is returned first.
  42726. //
  42727. // Currently, only sorting by name or creationTimestamp desc is
  42728. // supported.
  42729. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  42730. c.urlParams_.Set("orderBy", orderBy)
  42731. return c
  42732. }
  42733. // PageToken sets the optional parameter "pageToken": Specifies a page
  42734. // token to use. Set pageToken to the nextPageToken returned by a
  42735. // previous list request to get the next page of results.
  42736. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  42737. c.urlParams_.Set("pageToken", pageToken)
  42738. return c
  42739. }
  42740. // Fields allows partial responses to be retrieved. See
  42741. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42742. // for more information.
  42743. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  42744. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42745. return c
  42746. }
  42747. // IfNoneMatch sets the optional parameter which makes the operation
  42748. // fail if the object's ETag matches the given value. This is useful for
  42749. // getting updates only after the object has changed since the last
  42750. // request. Use googleapi.IsNotModified to check whether the response
  42751. // error from Do is the result of In-None-Match.
  42752. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  42753. c.ifNoneMatch_ = entityTag
  42754. return c
  42755. }
  42756. // Context sets the context to be used in this call's Do method. Any
  42757. // pending HTTP request will be aborted if the provided context is
  42758. // canceled.
  42759. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  42760. c.ctx_ = ctx
  42761. return c
  42762. }
  42763. // Header returns an http.Header that can be modified by the caller to
  42764. // add HTTP headers to the request.
  42765. func (c *BackendBucketsListCall) Header() http.Header {
  42766. if c.header_ == nil {
  42767. c.header_ = make(http.Header)
  42768. }
  42769. return c.header_
  42770. }
  42771. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  42772. reqHeaders := make(http.Header)
  42773. for k, v := range c.header_ {
  42774. reqHeaders[k] = v
  42775. }
  42776. reqHeaders.Set("User-Agent", c.s.userAgent())
  42777. if c.ifNoneMatch_ != "" {
  42778. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42779. }
  42780. var body io.Reader = nil
  42781. c.urlParams_.Set("alt", alt)
  42782. c.urlParams_.Set("prettyPrint", "false")
  42783. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  42784. urls += "?" + c.urlParams_.Encode()
  42785. req, err := http.NewRequest("GET", urls, body)
  42786. if err != nil {
  42787. return nil, err
  42788. }
  42789. req.Header = reqHeaders
  42790. googleapi.Expand(req.URL, map[string]string{
  42791. "project": c.project,
  42792. })
  42793. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42794. }
  42795. // Do executes the "compute.backendBuckets.list" call.
  42796. // Exactly one of *BackendBucketList or error will be non-nil. Any
  42797. // non-2xx status code is an error. Response headers are in either
  42798. // *BackendBucketList.ServerResponse.Header or (if a response was
  42799. // returned at all) in error.(*googleapi.Error).Header. Use
  42800. // googleapi.IsNotModified to check whether the returned error was
  42801. // because http.StatusNotModified was returned.
  42802. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  42803. gensupport.SetOptions(c.urlParams_, opts...)
  42804. res, err := c.doRequest("json")
  42805. if res != nil && res.StatusCode == http.StatusNotModified {
  42806. if res.Body != nil {
  42807. res.Body.Close()
  42808. }
  42809. return nil, &googleapi.Error{
  42810. Code: res.StatusCode,
  42811. Header: res.Header,
  42812. }
  42813. }
  42814. if err != nil {
  42815. return nil, err
  42816. }
  42817. defer googleapi.CloseBody(res)
  42818. if err := googleapi.CheckResponse(res); err != nil {
  42819. return nil, err
  42820. }
  42821. ret := &BackendBucketList{
  42822. ServerResponse: googleapi.ServerResponse{
  42823. Header: res.Header,
  42824. HTTPStatusCode: res.StatusCode,
  42825. },
  42826. }
  42827. target := &ret
  42828. if err := gensupport.DecodeResponse(target, res); err != nil {
  42829. return nil, err
  42830. }
  42831. return ret, nil
  42832. // {
  42833. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  42834. // "httpMethod": "GET",
  42835. // "id": "compute.backendBuckets.list",
  42836. // "parameterOrder": [
  42837. // "project"
  42838. // ],
  42839. // "parameters": {
  42840. // "filter": {
  42841. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  42842. // "location": "query",
  42843. // "type": "string"
  42844. // },
  42845. // "maxResults": {
  42846. // "default": "500",
  42847. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  42848. // "format": "uint32",
  42849. // "location": "query",
  42850. // "minimum": "0",
  42851. // "type": "integer"
  42852. // },
  42853. // "orderBy": {
  42854. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  42855. // "location": "query",
  42856. // "type": "string"
  42857. // },
  42858. // "pageToken": {
  42859. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  42860. // "location": "query",
  42861. // "type": "string"
  42862. // },
  42863. // "project": {
  42864. // "description": "Project ID for this request.",
  42865. // "location": "path",
  42866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42867. // "required": true,
  42868. // "type": "string"
  42869. // }
  42870. // },
  42871. // "path": "{project}/global/backendBuckets",
  42872. // "response": {
  42873. // "$ref": "BackendBucketList"
  42874. // },
  42875. // "scopes": [
  42876. // "https://www.googleapis.com/auth/cloud-platform",
  42877. // "https://www.googleapis.com/auth/compute",
  42878. // "https://www.googleapis.com/auth/compute.readonly"
  42879. // ]
  42880. // }
  42881. }
  42882. // Pages invokes f for each page of results.
  42883. // A non-nil error returned from f will halt the iteration.
  42884. // The provided context supersedes any context provided to the Context method.
  42885. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  42886. c.ctx_ = ctx
  42887. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42888. for {
  42889. x, err := c.Do()
  42890. if err != nil {
  42891. return err
  42892. }
  42893. if err := f(x); err != nil {
  42894. return err
  42895. }
  42896. if x.NextPageToken == "" {
  42897. return nil
  42898. }
  42899. c.PageToken(x.NextPageToken)
  42900. }
  42901. }
  42902. // method id "compute.backendBuckets.patch":
  42903. type BackendBucketsPatchCall struct {
  42904. s *Service
  42905. project string
  42906. backendBucket string
  42907. backendbucket *BackendBucket
  42908. urlParams_ gensupport.URLParams
  42909. ctx_ context.Context
  42910. header_ http.Header
  42911. }
  42912. // Patch: Updates the specified BackendBucket resource with the data
  42913. // included in the request. This method supports PATCH semantics and
  42914. // uses the JSON merge patch format and processing rules.
  42915. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  42916. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42917. c.project = project
  42918. c.backendBucket = backendBucket
  42919. c.backendbucket = backendbucket
  42920. return c
  42921. }
  42922. // RequestId sets the optional parameter "requestId": An optional
  42923. // request ID to identify requests. Specify a unique request ID so that
  42924. // if you must retry your request, the server will know to ignore the
  42925. // request if it has already been completed.
  42926. //
  42927. // For example, consider a situation where you make an initial request
  42928. // and the request times out. If you make the request again with the
  42929. // same request ID, the server can check if original operation with the
  42930. // same request ID was received, and if so, will ignore the second
  42931. // request. This prevents clients from accidentally creating duplicate
  42932. // commitments.
  42933. //
  42934. // The request ID must be a valid UUID with the exception that zero UUID
  42935. // is not supported (00000000-0000-0000-0000-000000000000).
  42936. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  42937. c.urlParams_.Set("requestId", requestId)
  42938. return c
  42939. }
  42940. // Fields allows partial responses to be retrieved. See
  42941. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42942. // for more information.
  42943. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  42944. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42945. return c
  42946. }
  42947. // Context sets the context to be used in this call's Do method. Any
  42948. // pending HTTP request will be aborted if the provided context is
  42949. // canceled.
  42950. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  42951. c.ctx_ = ctx
  42952. return c
  42953. }
  42954. // Header returns an http.Header that can be modified by the caller to
  42955. // add HTTP headers to the request.
  42956. func (c *BackendBucketsPatchCall) Header() http.Header {
  42957. if c.header_ == nil {
  42958. c.header_ = make(http.Header)
  42959. }
  42960. return c.header_
  42961. }
  42962. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  42963. reqHeaders := make(http.Header)
  42964. for k, v := range c.header_ {
  42965. reqHeaders[k] = v
  42966. }
  42967. reqHeaders.Set("User-Agent", c.s.userAgent())
  42968. var body io.Reader = nil
  42969. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  42970. if err != nil {
  42971. return nil, err
  42972. }
  42973. reqHeaders.Set("Content-Type", "application/json")
  42974. c.urlParams_.Set("alt", alt)
  42975. c.urlParams_.Set("prettyPrint", "false")
  42976. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  42977. urls += "?" + c.urlParams_.Encode()
  42978. req, err := http.NewRequest("PATCH", 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. "backendBucket": c.backendBucket,
  42986. })
  42987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42988. }
  42989. // Do executes the "compute.backendBuckets.patch" call.
  42990. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42991. // status code is an error. Response headers are in either
  42992. // *Operation.ServerResponse.Header or (if a response was returned at
  42993. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42994. // to check whether the returned error was because
  42995. // http.StatusNotModified was returned.
  42996. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42997. gensupport.SetOptions(c.urlParams_, opts...)
  42998. res, err := c.doRequest("json")
  42999. if res != nil && res.StatusCode == http.StatusNotModified {
  43000. if res.Body != nil {
  43001. res.Body.Close()
  43002. }
  43003. return nil, &googleapi.Error{
  43004. Code: res.StatusCode,
  43005. Header: res.Header,
  43006. }
  43007. }
  43008. if err != nil {
  43009. return nil, err
  43010. }
  43011. defer googleapi.CloseBody(res)
  43012. if err := googleapi.CheckResponse(res); err != nil {
  43013. return nil, err
  43014. }
  43015. ret := &Operation{
  43016. ServerResponse: googleapi.ServerResponse{
  43017. Header: res.Header,
  43018. HTTPStatusCode: res.StatusCode,
  43019. },
  43020. }
  43021. target := &ret
  43022. if err := gensupport.DecodeResponse(target, res); err != nil {
  43023. return nil, err
  43024. }
  43025. return ret, nil
  43026. // {
  43027. // "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.",
  43028. // "httpMethod": "PATCH",
  43029. // "id": "compute.backendBuckets.patch",
  43030. // "parameterOrder": [
  43031. // "project",
  43032. // "backendBucket"
  43033. // ],
  43034. // "parameters": {
  43035. // "backendBucket": {
  43036. // "description": "Name of the BackendBucket resource to patch.",
  43037. // "location": "path",
  43038. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43039. // "required": true,
  43040. // "type": "string"
  43041. // },
  43042. // "project": {
  43043. // "description": "Project ID for this request.",
  43044. // "location": "path",
  43045. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43046. // "required": true,
  43047. // "type": "string"
  43048. // },
  43049. // "requestId": {
  43050. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43051. // "location": "query",
  43052. // "type": "string"
  43053. // }
  43054. // },
  43055. // "path": "{project}/global/backendBuckets/{backendBucket}",
  43056. // "request": {
  43057. // "$ref": "BackendBucket"
  43058. // },
  43059. // "response": {
  43060. // "$ref": "Operation"
  43061. // },
  43062. // "scopes": [
  43063. // "https://www.googleapis.com/auth/cloud-platform",
  43064. // "https://www.googleapis.com/auth/compute"
  43065. // ]
  43066. // }
  43067. }
  43068. // method id "compute.backendBuckets.setIamPolicy":
  43069. type BackendBucketsSetIamPolicyCall struct {
  43070. s *Service
  43071. project string
  43072. resource string
  43073. globalsetpolicyrequest *GlobalSetPolicyRequest
  43074. urlParams_ gensupport.URLParams
  43075. ctx_ context.Context
  43076. header_ http.Header
  43077. }
  43078. // SetIamPolicy: Sets the access control policy on the specified
  43079. // resource. Replaces any existing policy.
  43080. func (r *BackendBucketsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *BackendBucketsSetIamPolicyCall {
  43081. c := &BackendBucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43082. c.project = project
  43083. c.resource = resource
  43084. c.globalsetpolicyrequest = globalsetpolicyrequest
  43085. return c
  43086. }
  43087. // Fields allows partial responses to be retrieved. See
  43088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43089. // for more information.
  43090. func (c *BackendBucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsSetIamPolicyCall {
  43091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43092. return c
  43093. }
  43094. // Context sets the context to be used in this call's Do method. Any
  43095. // pending HTTP request will be aborted if the provided context is
  43096. // canceled.
  43097. func (c *BackendBucketsSetIamPolicyCall) Context(ctx context.Context) *BackendBucketsSetIamPolicyCall {
  43098. c.ctx_ = ctx
  43099. return c
  43100. }
  43101. // Header returns an http.Header that can be modified by the caller to
  43102. // add HTTP headers to the request.
  43103. func (c *BackendBucketsSetIamPolicyCall) Header() http.Header {
  43104. if c.header_ == nil {
  43105. c.header_ = make(http.Header)
  43106. }
  43107. return c.header_
  43108. }
  43109. func (c *BackendBucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  43110. reqHeaders := make(http.Header)
  43111. for k, v := range c.header_ {
  43112. reqHeaders[k] = v
  43113. }
  43114. reqHeaders.Set("User-Agent", c.s.userAgent())
  43115. var body io.Reader = nil
  43116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  43117. if err != nil {
  43118. return nil, err
  43119. }
  43120. reqHeaders.Set("Content-Type", "application/json")
  43121. c.urlParams_.Set("alt", alt)
  43122. c.urlParams_.Set("prettyPrint", "false")
  43123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/setIamPolicy")
  43124. urls += "?" + c.urlParams_.Encode()
  43125. req, err := http.NewRequest("POST", urls, body)
  43126. if err != nil {
  43127. return nil, err
  43128. }
  43129. req.Header = reqHeaders
  43130. googleapi.Expand(req.URL, map[string]string{
  43131. "project": c.project,
  43132. "resource": c.resource,
  43133. })
  43134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43135. }
  43136. // Do executes the "compute.backendBuckets.setIamPolicy" call.
  43137. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  43138. // code is an error. Response headers are in either
  43139. // *Policy.ServerResponse.Header or (if a response was returned at all)
  43140. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  43141. // check whether the returned error was because http.StatusNotModified
  43142. // was returned.
  43143. func (c *BackendBucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  43144. gensupport.SetOptions(c.urlParams_, opts...)
  43145. res, err := c.doRequest("json")
  43146. if res != nil && res.StatusCode == http.StatusNotModified {
  43147. if res.Body != nil {
  43148. res.Body.Close()
  43149. }
  43150. return nil, &googleapi.Error{
  43151. Code: res.StatusCode,
  43152. Header: res.Header,
  43153. }
  43154. }
  43155. if err != nil {
  43156. return nil, err
  43157. }
  43158. defer googleapi.CloseBody(res)
  43159. if err := googleapi.CheckResponse(res); err != nil {
  43160. return nil, err
  43161. }
  43162. ret := &Policy{
  43163. ServerResponse: googleapi.ServerResponse{
  43164. Header: res.Header,
  43165. HTTPStatusCode: res.StatusCode,
  43166. },
  43167. }
  43168. target := &ret
  43169. if err := gensupport.DecodeResponse(target, res); err != nil {
  43170. return nil, err
  43171. }
  43172. return ret, nil
  43173. // {
  43174. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  43175. // "httpMethod": "POST",
  43176. // "id": "compute.backendBuckets.setIamPolicy",
  43177. // "parameterOrder": [
  43178. // "project",
  43179. // "resource"
  43180. // ],
  43181. // "parameters": {
  43182. // "project": {
  43183. // "description": "Project ID for this request.",
  43184. // "location": "path",
  43185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43186. // "required": true,
  43187. // "type": "string"
  43188. // },
  43189. // "resource": {
  43190. // "description": "Name or id of the resource for this request.",
  43191. // "location": "path",
  43192. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43193. // "required": true,
  43194. // "type": "string"
  43195. // }
  43196. // },
  43197. // "path": "{project}/global/backendBuckets/{resource}/setIamPolicy",
  43198. // "request": {
  43199. // "$ref": "GlobalSetPolicyRequest"
  43200. // },
  43201. // "response": {
  43202. // "$ref": "Policy"
  43203. // },
  43204. // "scopes": [
  43205. // "https://www.googleapis.com/auth/cloud-platform",
  43206. // "https://www.googleapis.com/auth/compute"
  43207. // ]
  43208. // }
  43209. }
  43210. // method id "compute.backendBuckets.testIamPermissions":
  43211. type BackendBucketsTestIamPermissionsCall struct {
  43212. s *Service
  43213. project string
  43214. resource string
  43215. testpermissionsrequest *TestPermissionsRequest
  43216. urlParams_ gensupport.URLParams
  43217. ctx_ context.Context
  43218. header_ http.Header
  43219. }
  43220. // TestIamPermissions: Returns permissions that a caller has on the
  43221. // specified resource.
  43222. func (r *BackendBucketsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendBucketsTestIamPermissionsCall {
  43223. c := &BackendBucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43224. c.project = project
  43225. c.resource = resource
  43226. c.testpermissionsrequest = testpermissionsrequest
  43227. return c
  43228. }
  43229. // Fields allows partial responses to be retrieved. See
  43230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43231. // for more information.
  43232. func (c *BackendBucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendBucketsTestIamPermissionsCall {
  43233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43234. return c
  43235. }
  43236. // Context sets the context to be used in this call's Do method. Any
  43237. // pending HTTP request will be aborted if the provided context is
  43238. // canceled.
  43239. func (c *BackendBucketsTestIamPermissionsCall) Context(ctx context.Context) *BackendBucketsTestIamPermissionsCall {
  43240. c.ctx_ = ctx
  43241. return c
  43242. }
  43243. // Header returns an http.Header that can be modified by the caller to
  43244. // add HTTP headers to the request.
  43245. func (c *BackendBucketsTestIamPermissionsCall) Header() http.Header {
  43246. if c.header_ == nil {
  43247. c.header_ = make(http.Header)
  43248. }
  43249. return c.header_
  43250. }
  43251. func (c *BackendBucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  43252. reqHeaders := make(http.Header)
  43253. for k, v := range c.header_ {
  43254. reqHeaders[k] = v
  43255. }
  43256. reqHeaders.Set("User-Agent", c.s.userAgent())
  43257. var body io.Reader = nil
  43258. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  43259. if err != nil {
  43260. return nil, err
  43261. }
  43262. reqHeaders.Set("Content-Type", "application/json")
  43263. c.urlParams_.Set("alt", alt)
  43264. c.urlParams_.Set("prettyPrint", "false")
  43265. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/testIamPermissions")
  43266. urls += "?" + c.urlParams_.Encode()
  43267. req, err := http.NewRequest("POST", urls, body)
  43268. if err != nil {
  43269. return nil, err
  43270. }
  43271. req.Header = reqHeaders
  43272. googleapi.Expand(req.URL, map[string]string{
  43273. "project": c.project,
  43274. "resource": c.resource,
  43275. })
  43276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43277. }
  43278. // Do executes the "compute.backendBuckets.testIamPermissions" call.
  43279. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  43280. // non-2xx status code is an error. Response headers are in either
  43281. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  43282. // returned at all) in error.(*googleapi.Error).Header. Use
  43283. // googleapi.IsNotModified to check whether the returned error was
  43284. // because http.StatusNotModified was returned.
  43285. func (c *BackendBucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  43286. gensupport.SetOptions(c.urlParams_, opts...)
  43287. res, err := c.doRequest("json")
  43288. if res != nil && res.StatusCode == http.StatusNotModified {
  43289. if res.Body != nil {
  43290. res.Body.Close()
  43291. }
  43292. return nil, &googleapi.Error{
  43293. Code: res.StatusCode,
  43294. Header: res.Header,
  43295. }
  43296. }
  43297. if err != nil {
  43298. return nil, err
  43299. }
  43300. defer googleapi.CloseBody(res)
  43301. if err := googleapi.CheckResponse(res); err != nil {
  43302. return nil, err
  43303. }
  43304. ret := &TestPermissionsResponse{
  43305. ServerResponse: googleapi.ServerResponse{
  43306. Header: res.Header,
  43307. HTTPStatusCode: res.StatusCode,
  43308. },
  43309. }
  43310. target := &ret
  43311. if err := gensupport.DecodeResponse(target, res); err != nil {
  43312. return nil, err
  43313. }
  43314. return ret, nil
  43315. // {
  43316. // "description": "Returns permissions that a caller has on the specified resource.",
  43317. // "httpMethod": "POST",
  43318. // "id": "compute.backendBuckets.testIamPermissions",
  43319. // "parameterOrder": [
  43320. // "project",
  43321. // "resource"
  43322. // ],
  43323. // "parameters": {
  43324. // "project": {
  43325. // "description": "Project ID for this request.",
  43326. // "location": "path",
  43327. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43328. // "required": true,
  43329. // "type": "string"
  43330. // },
  43331. // "resource": {
  43332. // "description": "Name or id of the resource for this request.",
  43333. // "location": "path",
  43334. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43335. // "required": true,
  43336. // "type": "string"
  43337. // }
  43338. // },
  43339. // "path": "{project}/global/backendBuckets/{resource}/testIamPermissions",
  43340. // "request": {
  43341. // "$ref": "TestPermissionsRequest"
  43342. // },
  43343. // "response": {
  43344. // "$ref": "TestPermissionsResponse"
  43345. // },
  43346. // "scopes": [
  43347. // "https://www.googleapis.com/auth/cloud-platform",
  43348. // "https://www.googleapis.com/auth/compute",
  43349. // "https://www.googleapis.com/auth/compute.readonly"
  43350. // ]
  43351. // }
  43352. }
  43353. // method id "compute.backendBuckets.update":
  43354. type BackendBucketsUpdateCall struct {
  43355. s *Service
  43356. project string
  43357. backendBucket string
  43358. backendbucket *BackendBucket
  43359. urlParams_ gensupport.URLParams
  43360. ctx_ context.Context
  43361. header_ http.Header
  43362. }
  43363. // Update: Updates the specified BackendBucket resource with the data
  43364. // included in the request.
  43365. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  43366. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43367. c.project = project
  43368. c.backendBucket = backendBucket
  43369. c.backendbucket = backendbucket
  43370. return c
  43371. }
  43372. // RequestId sets the optional parameter "requestId": An optional
  43373. // request ID to identify requests. Specify a unique request ID so that
  43374. // if you must retry your request, the server will know to ignore the
  43375. // request if it has already been completed.
  43376. //
  43377. // For example, consider a situation where you make an initial request
  43378. // and the request times out. If you make the request again with the
  43379. // same request ID, the server can check if original operation with the
  43380. // same request ID was received, and if so, will ignore the second
  43381. // request. This prevents clients from accidentally creating duplicate
  43382. // commitments.
  43383. //
  43384. // The request ID must be a valid UUID with the exception that zero UUID
  43385. // is not supported (00000000-0000-0000-0000-000000000000).
  43386. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  43387. c.urlParams_.Set("requestId", requestId)
  43388. return c
  43389. }
  43390. // Fields allows partial responses to be retrieved. See
  43391. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43392. // for more information.
  43393. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  43394. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43395. return c
  43396. }
  43397. // Context sets the context to be used in this call's Do method. Any
  43398. // pending HTTP request will be aborted if the provided context is
  43399. // canceled.
  43400. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  43401. c.ctx_ = ctx
  43402. return c
  43403. }
  43404. // Header returns an http.Header that can be modified by the caller to
  43405. // add HTTP headers to the request.
  43406. func (c *BackendBucketsUpdateCall) Header() http.Header {
  43407. if c.header_ == nil {
  43408. c.header_ = make(http.Header)
  43409. }
  43410. return c.header_
  43411. }
  43412. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  43413. reqHeaders := make(http.Header)
  43414. for k, v := range c.header_ {
  43415. reqHeaders[k] = v
  43416. }
  43417. reqHeaders.Set("User-Agent", c.s.userAgent())
  43418. var body io.Reader = nil
  43419. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  43420. if err != nil {
  43421. return nil, err
  43422. }
  43423. reqHeaders.Set("Content-Type", "application/json")
  43424. c.urlParams_.Set("alt", alt)
  43425. c.urlParams_.Set("prettyPrint", "false")
  43426. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  43427. urls += "?" + c.urlParams_.Encode()
  43428. req, err := http.NewRequest("PUT", urls, body)
  43429. if err != nil {
  43430. return nil, err
  43431. }
  43432. req.Header = reqHeaders
  43433. googleapi.Expand(req.URL, map[string]string{
  43434. "project": c.project,
  43435. "backendBucket": c.backendBucket,
  43436. })
  43437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43438. }
  43439. // Do executes the "compute.backendBuckets.update" call.
  43440. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43441. // status code is an error. Response headers are in either
  43442. // *Operation.ServerResponse.Header or (if a response was returned at
  43443. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43444. // to check whether the returned error was because
  43445. // http.StatusNotModified was returned.
  43446. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43447. gensupport.SetOptions(c.urlParams_, opts...)
  43448. res, err := c.doRequest("json")
  43449. if res != nil && res.StatusCode == http.StatusNotModified {
  43450. if res.Body != nil {
  43451. res.Body.Close()
  43452. }
  43453. return nil, &googleapi.Error{
  43454. Code: res.StatusCode,
  43455. Header: res.Header,
  43456. }
  43457. }
  43458. if err != nil {
  43459. return nil, err
  43460. }
  43461. defer googleapi.CloseBody(res)
  43462. if err := googleapi.CheckResponse(res); err != nil {
  43463. return nil, err
  43464. }
  43465. ret := &Operation{
  43466. ServerResponse: googleapi.ServerResponse{
  43467. Header: res.Header,
  43468. HTTPStatusCode: res.StatusCode,
  43469. },
  43470. }
  43471. target := &ret
  43472. if err := gensupport.DecodeResponse(target, res); err != nil {
  43473. return nil, err
  43474. }
  43475. return ret, nil
  43476. // {
  43477. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  43478. // "httpMethod": "PUT",
  43479. // "id": "compute.backendBuckets.update",
  43480. // "parameterOrder": [
  43481. // "project",
  43482. // "backendBucket"
  43483. // ],
  43484. // "parameters": {
  43485. // "backendBucket": {
  43486. // "description": "Name of the BackendBucket resource to update.",
  43487. // "location": "path",
  43488. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43489. // "required": true,
  43490. // "type": "string"
  43491. // },
  43492. // "project": {
  43493. // "description": "Project ID for this request.",
  43494. // "location": "path",
  43495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43496. // "required": true,
  43497. // "type": "string"
  43498. // },
  43499. // "requestId": {
  43500. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43501. // "location": "query",
  43502. // "type": "string"
  43503. // }
  43504. // },
  43505. // "path": "{project}/global/backendBuckets/{backendBucket}",
  43506. // "request": {
  43507. // "$ref": "BackendBucket"
  43508. // },
  43509. // "response": {
  43510. // "$ref": "Operation"
  43511. // },
  43512. // "scopes": [
  43513. // "https://www.googleapis.com/auth/cloud-platform",
  43514. // "https://www.googleapis.com/auth/compute"
  43515. // ]
  43516. // }
  43517. }
  43518. // method id "compute.backendServices.addSignedUrlKey":
  43519. type BackendServicesAddSignedUrlKeyCall struct {
  43520. s *Service
  43521. project string
  43522. backendService string
  43523. signedurlkey *SignedUrlKey
  43524. urlParams_ gensupport.URLParams
  43525. ctx_ context.Context
  43526. header_ http.Header
  43527. }
  43528. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  43529. // for this backend service.
  43530. func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
  43531. c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43532. c.project = project
  43533. c.backendService = backendService
  43534. c.signedurlkey = signedurlkey
  43535. return c
  43536. }
  43537. // RequestId sets the optional parameter "requestId": An optional
  43538. // request ID to identify requests. Specify a unique request ID so that
  43539. // if you must retry your request, the server will know to ignore the
  43540. // request if it has already been completed.
  43541. //
  43542. // For example, consider a situation where you make an initial request
  43543. // and the request times out. If you make the request again with the
  43544. // same request ID, the server can check if original operation with the
  43545. // same request ID was received, and if so, will ignore the second
  43546. // request. This prevents clients from accidentally creating duplicate
  43547. // commitments.
  43548. //
  43549. // The request ID must be a valid UUID with the exception that zero UUID
  43550. // is not supported (00000000-0000-0000-0000-000000000000).
  43551. func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
  43552. c.urlParams_.Set("requestId", requestId)
  43553. return c
  43554. }
  43555. // Fields allows partial responses to be retrieved. See
  43556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43557. // for more information.
  43558. func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
  43559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43560. return c
  43561. }
  43562. // Context sets the context to be used in this call's Do method. Any
  43563. // pending HTTP request will be aborted if the provided context is
  43564. // canceled.
  43565. func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
  43566. c.ctx_ = ctx
  43567. return c
  43568. }
  43569. // Header returns an http.Header that can be modified by the caller to
  43570. // add HTTP headers to the request.
  43571. func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
  43572. if c.header_ == nil {
  43573. c.header_ = make(http.Header)
  43574. }
  43575. return c.header_
  43576. }
  43577. func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  43578. reqHeaders := make(http.Header)
  43579. for k, v := range c.header_ {
  43580. reqHeaders[k] = v
  43581. }
  43582. reqHeaders.Set("User-Agent", c.s.userAgent())
  43583. var body io.Reader = nil
  43584. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  43585. if err != nil {
  43586. return nil, err
  43587. }
  43588. reqHeaders.Set("Content-Type", "application/json")
  43589. c.urlParams_.Set("alt", alt)
  43590. c.urlParams_.Set("prettyPrint", "false")
  43591. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/addSignedUrlKey")
  43592. urls += "?" + c.urlParams_.Encode()
  43593. req, err := http.NewRequest("POST", urls, body)
  43594. if err != nil {
  43595. return nil, err
  43596. }
  43597. req.Header = reqHeaders
  43598. googleapi.Expand(req.URL, map[string]string{
  43599. "project": c.project,
  43600. "backendService": c.backendService,
  43601. })
  43602. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43603. }
  43604. // Do executes the "compute.backendServices.addSignedUrlKey" call.
  43605. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43606. // status code is an error. Response headers are in either
  43607. // *Operation.ServerResponse.Header or (if a response was returned at
  43608. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43609. // to check whether the returned error was because
  43610. // http.StatusNotModified was returned.
  43611. func (c *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43612. gensupport.SetOptions(c.urlParams_, opts...)
  43613. res, err := c.doRequest("json")
  43614. if res != nil && res.StatusCode == http.StatusNotModified {
  43615. if res.Body != nil {
  43616. res.Body.Close()
  43617. }
  43618. return nil, &googleapi.Error{
  43619. Code: res.StatusCode,
  43620. Header: res.Header,
  43621. }
  43622. }
  43623. if err != nil {
  43624. return nil, err
  43625. }
  43626. defer googleapi.CloseBody(res)
  43627. if err := googleapi.CheckResponse(res); err != nil {
  43628. return nil, err
  43629. }
  43630. ret := &Operation{
  43631. ServerResponse: googleapi.ServerResponse{
  43632. Header: res.Header,
  43633. HTTPStatusCode: res.StatusCode,
  43634. },
  43635. }
  43636. target := &ret
  43637. if err := gensupport.DecodeResponse(target, res); err != nil {
  43638. return nil, err
  43639. }
  43640. return ret, nil
  43641. // {
  43642. // "description": "Adds a key for validating requests with signed URLs for this backend service.",
  43643. // "httpMethod": "POST",
  43644. // "id": "compute.backendServices.addSignedUrlKey",
  43645. // "parameterOrder": [
  43646. // "project",
  43647. // "backendService"
  43648. // ],
  43649. // "parameters": {
  43650. // "backendService": {
  43651. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  43652. // "location": "path",
  43653. // "required": true,
  43654. // "type": "string"
  43655. // },
  43656. // "project": {
  43657. // "description": "Project ID for this request.",
  43658. // "location": "path",
  43659. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43660. // "required": true,
  43661. // "type": "string"
  43662. // },
  43663. // "requestId": {
  43664. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43665. // "location": "query",
  43666. // "type": "string"
  43667. // }
  43668. // },
  43669. // "path": "{project}/global/backendServices/{backendService}/addSignedUrlKey",
  43670. // "request": {
  43671. // "$ref": "SignedUrlKey"
  43672. // },
  43673. // "response": {
  43674. // "$ref": "Operation"
  43675. // },
  43676. // "scopes": [
  43677. // "https://www.googleapis.com/auth/cloud-platform",
  43678. // "https://www.googleapis.com/auth/compute"
  43679. // ]
  43680. // }
  43681. }
  43682. // method id "compute.backendServices.aggregatedList":
  43683. type BackendServicesAggregatedListCall struct {
  43684. s *Service
  43685. project string
  43686. urlParams_ gensupport.URLParams
  43687. ifNoneMatch_ string
  43688. ctx_ context.Context
  43689. header_ http.Header
  43690. }
  43691. // AggregatedList: Retrieves the list of all BackendService resources,
  43692. // regional and global, available to the specified project.
  43693. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  43694. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43695. c.project = project
  43696. return c
  43697. }
  43698. // Filter sets the optional parameter "filter": A filter expression that
  43699. // filters resources listed in the response. The expression must specify
  43700. // the field name, a comparison operator, and the value that you want to
  43701. // use for filtering. The value must be a string, a number, or a
  43702. // boolean. The comparison operator must be either =, !=, >, or <.
  43703. //
  43704. // For example, if you are filtering Compute Engine instances, you can
  43705. // exclude instances named example-instance by specifying name !=
  43706. // example-instance.
  43707. //
  43708. // You can also filter nested fields. For example, you could specify
  43709. // scheduling.automaticRestart = false to include instances only if they
  43710. // are not scheduled for automatic restarts. You can use filtering on
  43711. // nested fields to filter based on resource labels.
  43712. //
  43713. // To filter on multiple expressions, provide each separate expression
  43714. // within parentheses. For example, (scheduling.automaticRestart = true)
  43715. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43716. // AND expression. However, you can include AND and OR expressions
  43717. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43718. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43719. // true).
  43720. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  43721. c.urlParams_.Set("filter", filter)
  43722. return c
  43723. }
  43724. // MaxResults sets the optional parameter "maxResults": The maximum
  43725. // number of results per page that should be returned. If the number of
  43726. // available results is larger than maxResults, Compute Engine returns a
  43727. // nextPageToken that can be used to get the next page of results in
  43728. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43729. // (Default: 500)
  43730. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  43731. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43732. return c
  43733. }
  43734. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43735. // a certain order. By default, results are returned in alphanumerical
  43736. // order based on the resource name.
  43737. //
  43738. // You can also sort results in descending order based on the creation
  43739. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43740. // based on the creationTimestamp field in reverse chronological order
  43741. // (newest result first). Use this to sort resources like operations so
  43742. // that the newest operation is returned first.
  43743. //
  43744. // Currently, only sorting by name or creationTimestamp desc is
  43745. // supported.
  43746. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  43747. c.urlParams_.Set("orderBy", orderBy)
  43748. return c
  43749. }
  43750. // PageToken sets the optional parameter "pageToken": Specifies a page
  43751. // token to use. Set pageToken to the nextPageToken returned by a
  43752. // previous list request to get the next page of results.
  43753. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  43754. c.urlParams_.Set("pageToken", pageToken)
  43755. return c
  43756. }
  43757. // Fields allows partial responses to be retrieved. See
  43758. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43759. // for more information.
  43760. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  43761. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43762. return c
  43763. }
  43764. // IfNoneMatch sets the optional parameter which makes the operation
  43765. // fail if the object's ETag matches the given value. This is useful for
  43766. // getting updates only after the object has changed since the last
  43767. // request. Use googleapi.IsNotModified to check whether the response
  43768. // error from Do is the result of In-None-Match.
  43769. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  43770. c.ifNoneMatch_ = entityTag
  43771. return c
  43772. }
  43773. // Context sets the context to be used in this call's Do method. Any
  43774. // pending HTTP request will be aborted if the provided context is
  43775. // canceled.
  43776. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  43777. c.ctx_ = ctx
  43778. return c
  43779. }
  43780. // Header returns an http.Header that can be modified by the caller to
  43781. // add HTTP headers to the request.
  43782. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  43783. if c.header_ == nil {
  43784. c.header_ = make(http.Header)
  43785. }
  43786. return c.header_
  43787. }
  43788. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  43789. reqHeaders := make(http.Header)
  43790. for k, v := range c.header_ {
  43791. reqHeaders[k] = v
  43792. }
  43793. reqHeaders.Set("User-Agent", c.s.userAgent())
  43794. if c.ifNoneMatch_ != "" {
  43795. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43796. }
  43797. var body io.Reader = nil
  43798. c.urlParams_.Set("alt", alt)
  43799. c.urlParams_.Set("prettyPrint", "false")
  43800. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  43801. urls += "?" + c.urlParams_.Encode()
  43802. req, err := http.NewRequest("GET", urls, body)
  43803. if err != nil {
  43804. return nil, err
  43805. }
  43806. req.Header = reqHeaders
  43807. googleapi.Expand(req.URL, map[string]string{
  43808. "project": c.project,
  43809. })
  43810. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43811. }
  43812. // Do executes the "compute.backendServices.aggregatedList" call.
  43813. // Exactly one of *BackendServiceAggregatedList or error will be
  43814. // non-nil. Any non-2xx status code is an error. Response headers are in
  43815. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  43816. // response was returned at all) in error.(*googleapi.Error).Header. Use
  43817. // googleapi.IsNotModified to check whether the returned error was
  43818. // because http.StatusNotModified was returned.
  43819. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  43820. gensupport.SetOptions(c.urlParams_, opts...)
  43821. res, err := c.doRequest("json")
  43822. if res != nil && res.StatusCode == http.StatusNotModified {
  43823. if res.Body != nil {
  43824. res.Body.Close()
  43825. }
  43826. return nil, &googleapi.Error{
  43827. Code: res.StatusCode,
  43828. Header: res.Header,
  43829. }
  43830. }
  43831. if err != nil {
  43832. return nil, err
  43833. }
  43834. defer googleapi.CloseBody(res)
  43835. if err := googleapi.CheckResponse(res); err != nil {
  43836. return nil, err
  43837. }
  43838. ret := &BackendServiceAggregatedList{
  43839. ServerResponse: googleapi.ServerResponse{
  43840. Header: res.Header,
  43841. HTTPStatusCode: res.StatusCode,
  43842. },
  43843. }
  43844. target := &ret
  43845. if err := gensupport.DecodeResponse(target, res); err != nil {
  43846. return nil, err
  43847. }
  43848. return ret, nil
  43849. // {
  43850. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  43851. // "httpMethod": "GET",
  43852. // "id": "compute.backendServices.aggregatedList",
  43853. // "parameterOrder": [
  43854. // "project"
  43855. // ],
  43856. // "parameters": {
  43857. // "filter": {
  43858. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  43859. // "location": "query",
  43860. // "type": "string"
  43861. // },
  43862. // "maxResults": {
  43863. // "default": "500",
  43864. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  43865. // "format": "uint32",
  43866. // "location": "query",
  43867. // "minimum": "0",
  43868. // "type": "integer"
  43869. // },
  43870. // "orderBy": {
  43871. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  43872. // "location": "query",
  43873. // "type": "string"
  43874. // },
  43875. // "pageToken": {
  43876. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  43877. // "location": "query",
  43878. // "type": "string"
  43879. // },
  43880. // "project": {
  43881. // "description": "Name of the project scoping this request.",
  43882. // "location": "path",
  43883. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43884. // "required": true,
  43885. // "type": "string"
  43886. // }
  43887. // },
  43888. // "path": "{project}/aggregated/backendServices",
  43889. // "response": {
  43890. // "$ref": "BackendServiceAggregatedList"
  43891. // },
  43892. // "scopes": [
  43893. // "https://www.googleapis.com/auth/cloud-platform",
  43894. // "https://www.googleapis.com/auth/compute",
  43895. // "https://www.googleapis.com/auth/compute.readonly"
  43896. // ]
  43897. // }
  43898. }
  43899. // Pages invokes f for each page of results.
  43900. // A non-nil error returned from f will halt the iteration.
  43901. // The provided context supersedes any context provided to the Context method.
  43902. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  43903. c.ctx_ = ctx
  43904. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43905. for {
  43906. x, err := c.Do()
  43907. if err != nil {
  43908. return err
  43909. }
  43910. if err := f(x); err != nil {
  43911. return err
  43912. }
  43913. if x.NextPageToken == "" {
  43914. return nil
  43915. }
  43916. c.PageToken(x.NextPageToken)
  43917. }
  43918. }
  43919. // method id "compute.backendServices.delete":
  43920. type BackendServicesDeleteCall struct {
  43921. s *Service
  43922. project string
  43923. backendService string
  43924. urlParams_ gensupport.URLParams
  43925. ctx_ context.Context
  43926. header_ http.Header
  43927. }
  43928. // Delete: Deletes the specified BackendService resource.
  43929. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  43930. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  43931. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43932. c.project = project
  43933. c.backendService = backendService
  43934. return c
  43935. }
  43936. // RequestId sets the optional parameter "requestId": An optional
  43937. // request ID to identify requests. Specify a unique request ID so that
  43938. // if you must retry your request, the server will know to ignore the
  43939. // request if it has already been completed.
  43940. //
  43941. // For example, consider a situation where you make an initial request
  43942. // and the request times out. If you make the request again with the
  43943. // same request ID, the server can check if original operation with the
  43944. // same request ID was received, and if so, will ignore the second
  43945. // request. This prevents clients from accidentally creating duplicate
  43946. // commitments.
  43947. //
  43948. // The request ID must be a valid UUID with the exception that zero UUID
  43949. // is not supported (00000000-0000-0000-0000-000000000000).
  43950. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  43951. c.urlParams_.Set("requestId", requestId)
  43952. return c
  43953. }
  43954. // Fields allows partial responses to be retrieved. See
  43955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43956. // for more information.
  43957. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  43958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43959. return c
  43960. }
  43961. // Context sets the context to be used in this call's Do method. Any
  43962. // pending HTTP request will be aborted if the provided context is
  43963. // canceled.
  43964. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  43965. c.ctx_ = ctx
  43966. return c
  43967. }
  43968. // Header returns an http.Header that can be modified by the caller to
  43969. // add HTTP headers to the request.
  43970. func (c *BackendServicesDeleteCall) Header() http.Header {
  43971. if c.header_ == nil {
  43972. c.header_ = make(http.Header)
  43973. }
  43974. return c.header_
  43975. }
  43976. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  43977. reqHeaders := make(http.Header)
  43978. for k, v := range c.header_ {
  43979. reqHeaders[k] = v
  43980. }
  43981. reqHeaders.Set("User-Agent", c.s.userAgent())
  43982. var body io.Reader = nil
  43983. c.urlParams_.Set("alt", alt)
  43984. c.urlParams_.Set("prettyPrint", "false")
  43985. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  43986. urls += "?" + c.urlParams_.Encode()
  43987. req, err := http.NewRequest("DELETE", urls, body)
  43988. if err != nil {
  43989. return nil, err
  43990. }
  43991. req.Header = reqHeaders
  43992. googleapi.Expand(req.URL, map[string]string{
  43993. "project": c.project,
  43994. "backendService": c.backendService,
  43995. })
  43996. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43997. }
  43998. // Do executes the "compute.backendServices.delete" call.
  43999. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44000. // status code is an error. Response headers are in either
  44001. // *Operation.ServerResponse.Header or (if a response was returned at
  44002. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44003. // to check whether the returned error was because
  44004. // http.StatusNotModified was returned.
  44005. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44006. gensupport.SetOptions(c.urlParams_, opts...)
  44007. res, err := c.doRequest("json")
  44008. if res != nil && res.StatusCode == http.StatusNotModified {
  44009. if res.Body != nil {
  44010. res.Body.Close()
  44011. }
  44012. return nil, &googleapi.Error{
  44013. Code: res.StatusCode,
  44014. Header: res.Header,
  44015. }
  44016. }
  44017. if err != nil {
  44018. return nil, err
  44019. }
  44020. defer googleapi.CloseBody(res)
  44021. if err := googleapi.CheckResponse(res); err != nil {
  44022. return nil, err
  44023. }
  44024. ret := &Operation{
  44025. ServerResponse: googleapi.ServerResponse{
  44026. Header: res.Header,
  44027. HTTPStatusCode: res.StatusCode,
  44028. },
  44029. }
  44030. target := &ret
  44031. if err := gensupport.DecodeResponse(target, res); err != nil {
  44032. return nil, err
  44033. }
  44034. return ret, nil
  44035. // {
  44036. // "description": "Deletes the specified BackendService resource.",
  44037. // "httpMethod": "DELETE",
  44038. // "id": "compute.backendServices.delete",
  44039. // "parameterOrder": [
  44040. // "project",
  44041. // "backendService"
  44042. // ],
  44043. // "parameters": {
  44044. // "backendService": {
  44045. // "description": "Name of the BackendService resource to delete.",
  44046. // "location": "path",
  44047. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44048. // "required": true,
  44049. // "type": "string"
  44050. // },
  44051. // "project": {
  44052. // "description": "Project ID for this request.",
  44053. // "location": "path",
  44054. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44055. // "required": true,
  44056. // "type": "string"
  44057. // },
  44058. // "requestId": {
  44059. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44060. // "location": "query",
  44061. // "type": "string"
  44062. // }
  44063. // },
  44064. // "path": "{project}/global/backendServices/{backendService}",
  44065. // "response": {
  44066. // "$ref": "Operation"
  44067. // },
  44068. // "scopes": [
  44069. // "https://www.googleapis.com/auth/cloud-platform",
  44070. // "https://www.googleapis.com/auth/compute"
  44071. // ]
  44072. // }
  44073. }
  44074. // method id "compute.backendServices.deleteSignedUrlKey":
  44075. type BackendServicesDeleteSignedUrlKeyCall struct {
  44076. s *Service
  44077. project string
  44078. backendService string
  44079. urlParams_ gensupport.URLParams
  44080. ctx_ context.Context
  44081. header_ http.Header
  44082. }
  44083. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  44084. // URLs for this backend service.
  44085. func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
  44086. c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44087. c.project = project
  44088. c.backendService = backendService
  44089. c.urlParams_.Set("keyName", keyName)
  44090. return c
  44091. }
  44092. // RequestId sets the optional parameter "requestId": An optional
  44093. // request ID to identify requests. Specify a unique request ID so that
  44094. // if you must retry your request, the server will know to ignore the
  44095. // request if it has already been completed.
  44096. //
  44097. // For example, consider a situation where you make an initial request
  44098. // and the request times out. If you make the request again with the
  44099. // same request ID, the server can check if original operation with the
  44100. // same request ID was received, and if so, will ignore the second
  44101. // request. This prevents clients from accidentally creating duplicate
  44102. // commitments.
  44103. //
  44104. // The request ID must be a valid UUID with the exception that zero UUID
  44105. // is not supported (00000000-0000-0000-0000-000000000000).
  44106. func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
  44107. c.urlParams_.Set("requestId", requestId)
  44108. return c
  44109. }
  44110. // Fields allows partial responses to be retrieved. See
  44111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44112. // for more information.
  44113. func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
  44114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44115. return c
  44116. }
  44117. // Context sets the context to be used in this call's Do method. Any
  44118. // pending HTTP request will be aborted if the provided context is
  44119. // canceled.
  44120. func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
  44121. c.ctx_ = ctx
  44122. return c
  44123. }
  44124. // Header returns an http.Header that can be modified by the caller to
  44125. // add HTTP headers to the request.
  44126. func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
  44127. if c.header_ == nil {
  44128. c.header_ = make(http.Header)
  44129. }
  44130. return c.header_
  44131. }
  44132. func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  44133. reqHeaders := make(http.Header)
  44134. for k, v := range c.header_ {
  44135. reqHeaders[k] = v
  44136. }
  44137. reqHeaders.Set("User-Agent", c.s.userAgent())
  44138. var body io.Reader = nil
  44139. c.urlParams_.Set("alt", alt)
  44140. c.urlParams_.Set("prettyPrint", "false")
  44141. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
  44142. urls += "?" + c.urlParams_.Encode()
  44143. req, err := http.NewRequest("POST", urls, body)
  44144. if err != nil {
  44145. return nil, err
  44146. }
  44147. req.Header = reqHeaders
  44148. googleapi.Expand(req.URL, map[string]string{
  44149. "project": c.project,
  44150. "backendService": c.backendService,
  44151. })
  44152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44153. }
  44154. // Do executes the "compute.backendServices.deleteSignedUrlKey" call.
  44155. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44156. // status code is an error. Response headers are in either
  44157. // *Operation.ServerResponse.Header or (if a response was returned at
  44158. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44159. // to check whether the returned error was because
  44160. // http.StatusNotModified was returned.
  44161. func (c *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44162. gensupport.SetOptions(c.urlParams_, opts...)
  44163. res, err := c.doRequest("json")
  44164. if res != nil && res.StatusCode == http.StatusNotModified {
  44165. if res.Body != nil {
  44166. res.Body.Close()
  44167. }
  44168. return nil, &googleapi.Error{
  44169. Code: res.StatusCode,
  44170. Header: res.Header,
  44171. }
  44172. }
  44173. if err != nil {
  44174. return nil, err
  44175. }
  44176. defer googleapi.CloseBody(res)
  44177. if err := googleapi.CheckResponse(res); err != nil {
  44178. return nil, err
  44179. }
  44180. ret := &Operation{
  44181. ServerResponse: googleapi.ServerResponse{
  44182. Header: res.Header,
  44183. HTTPStatusCode: res.StatusCode,
  44184. },
  44185. }
  44186. target := &ret
  44187. if err := gensupport.DecodeResponse(target, res); err != nil {
  44188. return nil, err
  44189. }
  44190. return ret, nil
  44191. // {
  44192. // "description": "Deletes a key for validating requests with signed URLs for this backend service.",
  44193. // "httpMethod": "POST",
  44194. // "id": "compute.backendServices.deleteSignedUrlKey",
  44195. // "parameterOrder": [
  44196. // "project",
  44197. // "backendService",
  44198. // "keyName"
  44199. // ],
  44200. // "parameters": {
  44201. // "backendService": {
  44202. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  44203. // "location": "path",
  44204. // "required": true,
  44205. // "type": "string"
  44206. // },
  44207. // "keyName": {
  44208. // "description": "The name of the Signed URL Key to delete.",
  44209. // "location": "query",
  44210. // "required": true,
  44211. // "type": "string"
  44212. // },
  44213. // "project": {
  44214. // "description": "Project ID for this request.",
  44215. // "location": "path",
  44216. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44217. // "required": true,
  44218. // "type": "string"
  44219. // },
  44220. // "requestId": {
  44221. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44222. // "location": "query",
  44223. // "type": "string"
  44224. // }
  44225. // },
  44226. // "path": "{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
  44227. // "response": {
  44228. // "$ref": "Operation"
  44229. // },
  44230. // "scopes": [
  44231. // "https://www.googleapis.com/auth/cloud-platform",
  44232. // "https://www.googleapis.com/auth/compute"
  44233. // ]
  44234. // }
  44235. }
  44236. // method id "compute.backendServices.get":
  44237. type BackendServicesGetCall struct {
  44238. s *Service
  44239. project string
  44240. backendService string
  44241. urlParams_ gensupport.URLParams
  44242. ifNoneMatch_ string
  44243. ctx_ context.Context
  44244. header_ http.Header
  44245. }
  44246. // Get: Returns the specified BackendService resource. Gets a list of
  44247. // available backend services.
  44248. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  44249. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  44250. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44251. c.project = project
  44252. c.backendService = backendService
  44253. return c
  44254. }
  44255. // Fields allows partial responses to be retrieved. See
  44256. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44257. // for more information.
  44258. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  44259. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44260. return c
  44261. }
  44262. // IfNoneMatch sets the optional parameter which makes the operation
  44263. // fail if the object's ETag matches the given value. This is useful for
  44264. // getting updates only after the object has changed since the last
  44265. // request. Use googleapi.IsNotModified to check whether the response
  44266. // error from Do is the result of In-None-Match.
  44267. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  44268. c.ifNoneMatch_ = entityTag
  44269. return c
  44270. }
  44271. // Context sets the context to be used in this call's Do method. Any
  44272. // pending HTTP request will be aborted if the provided context is
  44273. // canceled.
  44274. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  44275. c.ctx_ = ctx
  44276. return c
  44277. }
  44278. // Header returns an http.Header that can be modified by the caller to
  44279. // add HTTP headers to the request.
  44280. func (c *BackendServicesGetCall) Header() http.Header {
  44281. if c.header_ == nil {
  44282. c.header_ = make(http.Header)
  44283. }
  44284. return c.header_
  44285. }
  44286. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  44287. reqHeaders := make(http.Header)
  44288. for k, v := range c.header_ {
  44289. reqHeaders[k] = v
  44290. }
  44291. reqHeaders.Set("User-Agent", c.s.userAgent())
  44292. if c.ifNoneMatch_ != "" {
  44293. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44294. }
  44295. var body io.Reader = nil
  44296. c.urlParams_.Set("alt", alt)
  44297. c.urlParams_.Set("prettyPrint", "false")
  44298. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  44299. urls += "?" + c.urlParams_.Encode()
  44300. req, err := http.NewRequest("GET", urls, body)
  44301. if err != nil {
  44302. return nil, err
  44303. }
  44304. req.Header = reqHeaders
  44305. googleapi.Expand(req.URL, map[string]string{
  44306. "project": c.project,
  44307. "backendService": c.backendService,
  44308. })
  44309. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44310. }
  44311. // Do executes the "compute.backendServices.get" call.
  44312. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  44313. // status code is an error. Response headers are in either
  44314. // *BackendService.ServerResponse.Header or (if a response was returned
  44315. // at all) in error.(*googleapi.Error).Header. Use
  44316. // googleapi.IsNotModified to check whether the returned error was
  44317. // because http.StatusNotModified was returned.
  44318. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  44319. gensupport.SetOptions(c.urlParams_, opts...)
  44320. res, err := c.doRequest("json")
  44321. if res != nil && res.StatusCode == http.StatusNotModified {
  44322. if res.Body != nil {
  44323. res.Body.Close()
  44324. }
  44325. return nil, &googleapi.Error{
  44326. Code: res.StatusCode,
  44327. Header: res.Header,
  44328. }
  44329. }
  44330. if err != nil {
  44331. return nil, err
  44332. }
  44333. defer googleapi.CloseBody(res)
  44334. if err := googleapi.CheckResponse(res); err != nil {
  44335. return nil, err
  44336. }
  44337. ret := &BackendService{
  44338. ServerResponse: googleapi.ServerResponse{
  44339. Header: res.Header,
  44340. HTTPStatusCode: res.StatusCode,
  44341. },
  44342. }
  44343. target := &ret
  44344. if err := gensupport.DecodeResponse(target, res); err != nil {
  44345. return nil, err
  44346. }
  44347. return ret, nil
  44348. // {
  44349. // "description": "Returns the specified BackendService resource. Gets a list of available backend services.",
  44350. // "httpMethod": "GET",
  44351. // "id": "compute.backendServices.get",
  44352. // "parameterOrder": [
  44353. // "project",
  44354. // "backendService"
  44355. // ],
  44356. // "parameters": {
  44357. // "backendService": {
  44358. // "description": "Name of the BackendService resource to return.",
  44359. // "location": "path",
  44360. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44361. // "required": true,
  44362. // "type": "string"
  44363. // },
  44364. // "project": {
  44365. // "description": "Project ID for this request.",
  44366. // "location": "path",
  44367. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44368. // "required": true,
  44369. // "type": "string"
  44370. // }
  44371. // },
  44372. // "path": "{project}/global/backendServices/{backendService}",
  44373. // "response": {
  44374. // "$ref": "BackendService"
  44375. // },
  44376. // "scopes": [
  44377. // "https://www.googleapis.com/auth/cloud-platform",
  44378. // "https://www.googleapis.com/auth/compute",
  44379. // "https://www.googleapis.com/auth/compute.readonly"
  44380. // ]
  44381. // }
  44382. }
  44383. // method id "compute.backendServices.getHealth":
  44384. type BackendServicesGetHealthCall struct {
  44385. s *Service
  44386. project string
  44387. backendService string
  44388. resourcegroupreference *ResourceGroupReference
  44389. urlParams_ gensupport.URLParams
  44390. ctx_ context.Context
  44391. header_ http.Header
  44392. }
  44393. // GetHealth: Gets the most recent health check results for this
  44394. // BackendService.
  44395. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  44396. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  44397. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44398. c.project = project
  44399. c.backendService = backendService
  44400. c.resourcegroupreference = resourcegroupreference
  44401. return c
  44402. }
  44403. // Fields allows partial responses to be retrieved. See
  44404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44405. // for more information.
  44406. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  44407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44408. return c
  44409. }
  44410. // Context sets the context to be used in this call's Do method. Any
  44411. // pending HTTP request will be aborted if the provided context is
  44412. // canceled.
  44413. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  44414. c.ctx_ = ctx
  44415. return c
  44416. }
  44417. // Header returns an http.Header that can be modified by the caller to
  44418. // add HTTP headers to the request.
  44419. func (c *BackendServicesGetHealthCall) Header() http.Header {
  44420. if c.header_ == nil {
  44421. c.header_ = make(http.Header)
  44422. }
  44423. return c.header_
  44424. }
  44425. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  44426. reqHeaders := make(http.Header)
  44427. for k, v := range c.header_ {
  44428. reqHeaders[k] = v
  44429. }
  44430. reqHeaders.Set("User-Agent", c.s.userAgent())
  44431. var body io.Reader = nil
  44432. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  44433. if err != nil {
  44434. return nil, err
  44435. }
  44436. reqHeaders.Set("Content-Type", "application/json")
  44437. c.urlParams_.Set("alt", alt)
  44438. c.urlParams_.Set("prettyPrint", "false")
  44439. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  44440. urls += "?" + c.urlParams_.Encode()
  44441. req, err := http.NewRequest("POST", urls, body)
  44442. if err != nil {
  44443. return nil, err
  44444. }
  44445. req.Header = reqHeaders
  44446. googleapi.Expand(req.URL, map[string]string{
  44447. "project": c.project,
  44448. "backendService": c.backendService,
  44449. })
  44450. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44451. }
  44452. // Do executes the "compute.backendServices.getHealth" call.
  44453. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  44454. // Any non-2xx status code is an error. Response headers are in either
  44455. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  44456. // was returned at all) in error.(*googleapi.Error).Header. Use
  44457. // googleapi.IsNotModified to check whether the returned error was
  44458. // because http.StatusNotModified was returned.
  44459. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  44460. gensupport.SetOptions(c.urlParams_, opts...)
  44461. res, err := c.doRequest("json")
  44462. if res != nil && res.StatusCode == http.StatusNotModified {
  44463. if res.Body != nil {
  44464. res.Body.Close()
  44465. }
  44466. return nil, &googleapi.Error{
  44467. Code: res.StatusCode,
  44468. Header: res.Header,
  44469. }
  44470. }
  44471. if err != nil {
  44472. return nil, err
  44473. }
  44474. defer googleapi.CloseBody(res)
  44475. if err := googleapi.CheckResponse(res); err != nil {
  44476. return nil, err
  44477. }
  44478. ret := &BackendServiceGroupHealth{
  44479. ServerResponse: googleapi.ServerResponse{
  44480. Header: res.Header,
  44481. HTTPStatusCode: res.StatusCode,
  44482. },
  44483. }
  44484. target := &ret
  44485. if err := gensupport.DecodeResponse(target, res); err != nil {
  44486. return nil, err
  44487. }
  44488. return ret, nil
  44489. // {
  44490. // "description": "Gets the most recent health check results for this BackendService.",
  44491. // "httpMethod": "POST",
  44492. // "id": "compute.backendServices.getHealth",
  44493. // "parameterOrder": [
  44494. // "project",
  44495. // "backendService"
  44496. // ],
  44497. // "parameters": {
  44498. // "backendService": {
  44499. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  44500. // "location": "path",
  44501. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44502. // "required": true,
  44503. // "type": "string"
  44504. // },
  44505. // "project": {
  44506. // "location": "path",
  44507. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44508. // "required": true,
  44509. // "type": "string"
  44510. // }
  44511. // },
  44512. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  44513. // "request": {
  44514. // "$ref": "ResourceGroupReference"
  44515. // },
  44516. // "response": {
  44517. // "$ref": "BackendServiceGroupHealth"
  44518. // },
  44519. // "scopes": [
  44520. // "https://www.googleapis.com/auth/cloud-platform",
  44521. // "https://www.googleapis.com/auth/compute",
  44522. // "https://www.googleapis.com/auth/compute.readonly"
  44523. // ]
  44524. // }
  44525. }
  44526. // method id "compute.backendServices.insert":
  44527. type BackendServicesInsertCall struct {
  44528. s *Service
  44529. project string
  44530. backendservice *BackendService
  44531. urlParams_ gensupport.URLParams
  44532. ctx_ context.Context
  44533. header_ http.Header
  44534. }
  44535. // Insert: Creates a BackendService resource in the specified project
  44536. // using the data included in the request. There are several
  44537. // restrictions and guidelines to keep in mind when creating a backend
  44538. // service. Read Restrictions and Guidelines for more information.
  44539. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  44540. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  44541. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44542. c.project = project
  44543. c.backendservice = backendservice
  44544. return c
  44545. }
  44546. // RequestId sets the optional parameter "requestId": An optional
  44547. // request ID to identify requests. Specify a unique request ID so that
  44548. // if you must retry your request, the server will know to ignore the
  44549. // request if it has already been completed.
  44550. //
  44551. // For example, consider a situation where you make an initial request
  44552. // and the request times out. If you make the request again with the
  44553. // same request ID, the server can check if original operation with the
  44554. // same request ID was received, and if so, will ignore the second
  44555. // request. This prevents clients from accidentally creating duplicate
  44556. // commitments.
  44557. //
  44558. // The request ID must be a valid UUID with the exception that zero UUID
  44559. // is not supported (00000000-0000-0000-0000-000000000000).
  44560. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  44561. c.urlParams_.Set("requestId", requestId)
  44562. return c
  44563. }
  44564. // Fields allows partial responses to be retrieved. See
  44565. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44566. // for more information.
  44567. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  44568. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44569. return c
  44570. }
  44571. // Context sets the context to be used in this call's Do method. Any
  44572. // pending HTTP request will be aborted if the provided context is
  44573. // canceled.
  44574. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  44575. c.ctx_ = ctx
  44576. return c
  44577. }
  44578. // Header returns an http.Header that can be modified by the caller to
  44579. // add HTTP headers to the request.
  44580. func (c *BackendServicesInsertCall) Header() http.Header {
  44581. if c.header_ == nil {
  44582. c.header_ = make(http.Header)
  44583. }
  44584. return c.header_
  44585. }
  44586. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  44587. reqHeaders := make(http.Header)
  44588. for k, v := range c.header_ {
  44589. reqHeaders[k] = v
  44590. }
  44591. reqHeaders.Set("User-Agent", c.s.userAgent())
  44592. var body io.Reader = nil
  44593. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  44594. if err != nil {
  44595. return nil, err
  44596. }
  44597. reqHeaders.Set("Content-Type", "application/json")
  44598. c.urlParams_.Set("alt", alt)
  44599. c.urlParams_.Set("prettyPrint", "false")
  44600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  44601. urls += "?" + c.urlParams_.Encode()
  44602. req, err := http.NewRequest("POST", urls, body)
  44603. if err != nil {
  44604. return nil, err
  44605. }
  44606. req.Header = reqHeaders
  44607. googleapi.Expand(req.URL, map[string]string{
  44608. "project": c.project,
  44609. })
  44610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44611. }
  44612. // Do executes the "compute.backendServices.insert" call.
  44613. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44614. // status code is an error. Response headers are in either
  44615. // *Operation.ServerResponse.Header or (if a response was returned at
  44616. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44617. // to check whether the returned error was because
  44618. // http.StatusNotModified was returned.
  44619. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44620. gensupport.SetOptions(c.urlParams_, opts...)
  44621. res, err := c.doRequest("json")
  44622. if res != nil && res.StatusCode == http.StatusNotModified {
  44623. if res.Body != nil {
  44624. res.Body.Close()
  44625. }
  44626. return nil, &googleapi.Error{
  44627. Code: res.StatusCode,
  44628. Header: res.Header,
  44629. }
  44630. }
  44631. if err != nil {
  44632. return nil, err
  44633. }
  44634. defer googleapi.CloseBody(res)
  44635. if err := googleapi.CheckResponse(res); err != nil {
  44636. return nil, err
  44637. }
  44638. ret := &Operation{
  44639. ServerResponse: googleapi.ServerResponse{
  44640. Header: res.Header,
  44641. HTTPStatusCode: res.StatusCode,
  44642. },
  44643. }
  44644. target := &ret
  44645. if err := gensupport.DecodeResponse(target, res); err != nil {
  44646. return nil, err
  44647. }
  44648. return ret, nil
  44649. // {
  44650. // "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.",
  44651. // "httpMethod": "POST",
  44652. // "id": "compute.backendServices.insert",
  44653. // "parameterOrder": [
  44654. // "project"
  44655. // ],
  44656. // "parameters": {
  44657. // "project": {
  44658. // "description": "Project ID for this request.",
  44659. // "location": "path",
  44660. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44661. // "required": true,
  44662. // "type": "string"
  44663. // },
  44664. // "requestId": {
  44665. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44666. // "location": "query",
  44667. // "type": "string"
  44668. // }
  44669. // },
  44670. // "path": "{project}/global/backendServices",
  44671. // "request": {
  44672. // "$ref": "BackendService"
  44673. // },
  44674. // "response": {
  44675. // "$ref": "Operation"
  44676. // },
  44677. // "scopes": [
  44678. // "https://www.googleapis.com/auth/cloud-platform",
  44679. // "https://www.googleapis.com/auth/compute"
  44680. // ]
  44681. // }
  44682. }
  44683. // method id "compute.backendServices.list":
  44684. type BackendServicesListCall struct {
  44685. s *Service
  44686. project string
  44687. urlParams_ gensupport.URLParams
  44688. ifNoneMatch_ string
  44689. ctx_ context.Context
  44690. header_ http.Header
  44691. }
  44692. // List: Retrieves the list of BackendService resources available to the
  44693. // specified project.
  44694. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  44695. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  44696. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44697. c.project = project
  44698. return c
  44699. }
  44700. // Filter sets the optional parameter "filter": A filter expression that
  44701. // filters resources listed in the response. The expression must specify
  44702. // the field name, a comparison operator, and the value that you want to
  44703. // use for filtering. The value must be a string, a number, or a
  44704. // boolean. The comparison operator must be either =, !=, >, or <.
  44705. //
  44706. // For example, if you are filtering Compute Engine instances, you can
  44707. // exclude instances named example-instance by specifying name !=
  44708. // example-instance.
  44709. //
  44710. // You can also filter nested fields. For example, you could specify
  44711. // scheduling.automaticRestart = false to include instances only if they
  44712. // are not scheduled for automatic restarts. You can use filtering on
  44713. // nested fields to filter based on resource labels.
  44714. //
  44715. // To filter on multiple expressions, provide each separate expression
  44716. // within parentheses. For example, (scheduling.automaticRestart = true)
  44717. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44718. // AND expression. However, you can include AND and OR expressions
  44719. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44720. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44721. // true).
  44722. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  44723. c.urlParams_.Set("filter", filter)
  44724. return c
  44725. }
  44726. // MaxResults sets the optional parameter "maxResults": The maximum
  44727. // number of results per page that should be returned. If the number of
  44728. // available results is larger than maxResults, Compute Engine returns a
  44729. // nextPageToken that can be used to get the next page of results in
  44730. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44731. // (Default: 500)
  44732. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  44733. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44734. return c
  44735. }
  44736. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44737. // a certain order. By default, results are returned in alphanumerical
  44738. // order based on the resource name.
  44739. //
  44740. // You can also sort results in descending order based on the creation
  44741. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44742. // based on the creationTimestamp field in reverse chronological order
  44743. // (newest result first). Use this to sort resources like operations so
  44744. // that the newest operation is returned first.
  44745. //
  44746. // Currently, only sorting by name or creationTimestamp desc is
  44747. // supported.
  44748. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  44749. c.urlParams_.Set("orderBy", orderBy)
  44750. return c
  44751. }
  44752. // PageToken sets the optional parameter "pageToken": Specifies a page
  44753. // token to use. Set pageToken to the nextPageToken returned by a
  44754. // previous list request to get the next page of results.
  44755. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  44756. c.urlParams_.Set("pageToken", pageToken)
  44757. return c
  44758. }
  44759. // Fields allows partial responses to be retrieved. See
  44760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44761. // for more information.
  44762. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  44763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44764. return c
  44765. }
  44766. // IfNoneMatch sets the optional parameter which makes the operation
  44767. // fail if the object's ETag matches the given value. This is useful for
  44768. // getting updates only after the object has changed since the last
  44769. // request. Use googleapi.IsNotModified to check whether the response
  44770. // error from Do is the result of In-None-Match.
  44771. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  44772. c.ifNoneMatch_ = entityTag
  44773. return c
  44774. }
  44775. // Context sets the context to be used in this call's Do method. Any
  44776. // pending HTTP request will be aborted if the provided context is
  44777. // canceled.
  44778. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  44779. c.ctx_ = ctx
  44780. return c
  44781. }
  44782. // Header returns an http.Header that can be modified by the caller to
  44783. // add HTTP headers to the request.
  44784. func (c *BackendServicesListCall) Header() http.Header {
  44785. if c.header_ == nil {
  44786. c.header_ = make(http.Header)
  44787. }
  44788. return c.header_
  44789. }
  44790. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  44791. reqHeaders := make(http.Header)
  44792. for k, v := range c.header_ {
  44793. reqHeaders[k] = v
  44794. }
  44795. reqHeaders.Set("User-Agent", c.s.userAgent())
  44796. if c.ifNoneMatch_ != "" {
  44797. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44798. }
  44799. var body io.Reader = nil
  44800. c.urlParams_.Set("alt", alt)
  44801. c.urlParams_.Set("prettyPrint", "false")
  44802. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  44803. urls += "?" + c.urlParams_.Encode()
  44804. req, err := http.NewRequest("GET", urls, body)
  44805. if err != nil {
  44806. return nil, err
  44807. }
  44808. req.Header = reqHeaders
  44809. googleapi.Expand(req.URL, map[string]string{
  44810. "project": c.project,
  44811. })
  44812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44813. }
  44814. // Do executes the "compute.backendServices.list" call.
  44815. // Exactly one of *BackendServiceList or error will be non-nil. Any
  44816. // non-2xx status code is an error. Response headers are in either
  44817. // *BackendServiceList.ServerResponse.Header or (if a response was
  44818. // returned at all) in error.(*googleapi.Error).Header. Use
  44819. // googleapi.IsNotModified to check whether the returned error was
  44820. // because http.StatusNotModified was returned.
  44821. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  44822. gensupport.SetOptions(c.urlParams_, opts...)
  44823. res, err := c.doRequest("json")
  44824. if res != nil && res.StatusCode == http.StatusNotModified {
  44825. if res.Body != nil {
  44826. res.Body.Close()
  44827. }
  44828. return nil, &googleapi.Error{
  44829. Code: res.StatusCode,
  44830. Header: res.Header,
  44831. }
  44832. }
  44833. if err != nil {
  44834. return nil, err
  44835. }
  44836. defer googleapi.CloseBody(res)
  44837. if err := googleapi.CheckResponse(res); err != nil {
  44838. return nil, err
  44839. }
  44840. ret := &BackendServiceList{
  44841. ServerResponse: googleapi.ServerResponse{
  44842. Header: res.Header,
  44843. HTTPStatusCode: res.StatusCode,
  44844. },
  44845. }
  44846. target := &ret
  44847. if err := gensupport.DecodeResponse(target, res); err != nil {
  44848. return nil, err
  44849. }
  44850. return ret, nil
  44851. // {
  44852. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  44853. // "httpMethod": "GET",
  44854. // "id": "compute.backendServices.list",
  44855. // "parameterOrder": [
  44856. // "project"
  44857. // ],
  44858. // "parameters": {
  44859. // "filter": {
  44860. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  44861. // "location": "query",
  44862. // "type": "string"
  44863. // },
  44864. // "maxResults": {
  44865. // "default": "500",
  44866. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  44867. // "format": "uint32",
  44868. // "location": "query",
  44869. // "minimum": "0",
  44870. // "type": "integer"
  44871. // },
  44872. // "orderBy": {
  44873. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  44874. // "location": "query",
  44875. // "type": "string"
  44876. // },
  44877. // "pageToken": {
  44878. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  44879. // "location": "query",
  44880. // "type": "string"
  44881. // },
  44882. // "project": {
  44883. // "description": "Project ID for this request.",
  44884. // "location": "path",
  44885. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44886. // "required": true,
  44887. // "type": "string"
  44888. // }
  44889. // },
  44890. // "path": "{project}/global/backendServices",
  44891. // "response": {
  44892. // "$ref": "BackendServiceList"
  44893. // },
  44894. // "scopes": [
  44895. // "https://www.googleapis.com/auth/cloud-platform",
  44896. // "https://www.googleapis.com/auth/compute",
  44897. // "https://www.googleapis.com/auth/compute.readonly"
  44898. // ]
  44899. // }
  44900. }
  44901. // Pages invokes f for each page of results.
  44902. // A non-nil error returned from f will halt the iteration.
  44903. // The provided context supersedes any context provided to the Context method.
  44904. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  44905. c.ctx_ = ctx
  44906. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44907. for {
  44908. x, err := c.Do()
  44909. if err != nil {
  44910. return err
  44911. }
  44912. if err := f(x); err != nil {
  44913. return err
  44914. }
  44915. if x.NextPageToken == "" {
  44916. return nil
  44917. }
  44918. c.PageToken(x.NextPageToken)
  44919. }
  44920. }
  44921. // method id "compute.backendServices.patch":
  44922. type BackendServicesPatchCall struct {
  44923. s *Service
  44924. project string
  44925. backendService string
  44926. backendservice *BackendService
  44927. urlParams_ gensupport.URLParams
  44928. ctx_ context.Context
  44929. header_ http.Header
  44930. }
  44931. // Patch: Patches the specified BackendService resource with the data
  44932. // included in the request. There are several restrictions and
  44933. // guidelines to keep in mind when updating a backend service. Read
  44934. // Restrictions and Guidelines for more information. This method
  44935. // supports PATCH semantics and uses the JSON merge patch format and
  44936. // processing rules.
  44937. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  44938. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  44939. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44940. c.project = project
  44941. c.backendService = backendService
  44942. c.backendservice = backendservice
  44943. return c
  44944. }
  44945. // RequestId sets the optional parameter "requestId": An optional
  44946. // request ID to identify requests. Specify a unique request ID so that
  44947. // if you must retry your request, the server will know to ignore the
  44948. // request if it has already been completed.
  44949. //
  44950. // For example, consider a situation where you make an initial request
  44951. // and the request times out. If you make the request again with the
  44952. // same request ID, the server can check if original operation with the
  44953. // same request ID was received, and if so, will ignore the second
  44954. // request. This prevents clients from accidentally creating duplicate
  44955. // commitments.
  44956. //
  44957. // The request ID must be a valid UUID with the exception that zero UUID
  44958. // is not supported (00000000-0000-0000-0000-000000000000).
  44959. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  44960. c.urlParams_.Set("requestId", requestId)
  44961. return c
  44962. }
  44963. // Fields allows partial responses to be retrieved. See
  44964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44965. // for more information.
  44966. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  44967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44968. return c
  44969. }
  44970. // Context sets the context to be used in this call's Do method. Any
  44971. // pending HTTP request will be aborted if the provided context is
  44972. // canceled.
  44973. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  44974. c.ctx_ = ctx
  44975. return c
  44976. }
  44977. // Header returns an http.Header that can be modified by the caller to
  44978. // add HTTP headers to the request.
  44979. func (c *BackendServicesPatchCall) Header() http.Header {
  44980. if c.header_ == nil {
  44981. c.header_ = make(http.Header)
  44982. }
  44983. return c.header_
  44984. }
  44985. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  44986. reqHeaders := make(http.Header)
  44987. for k, v := range c.header_ {
  44988. reqHeaders[k] = v
  44989. }
  44990. reqHeaders.Set("User-Agent", c.s.userAgent())
  44991. var body io.Reader = nil
  44992. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  44993. if err != nil {
  44994. return nil, err
  44995. }
  44996. reqHeaders.Set("Content-Type", "application/json")
  44997. c.urlParams_.Set("alt", alt)
  44998. c.urlParams_.Set("prettyPrint", "false")
  44999. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  45000. urls += "?" + c.urlParams_.Encode()
  45001. req, err := http.NewRequest("PATCH", urls, body)
  45002. if err != nil {
  45003. return nil, err
  45004. }
  45005. req.Header = reqHeaders
  45006. googleapi.Expand(req.URL, map[string]string{
  45007. "project": c.project,
  45008. "backendService": c.backendService,
  45009. })
  45010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45011. }
  45012. // Do executes the "compute.backendServices.patch" call.
  45013. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45014. // status code is an error. Response headers are in either
  45015. // *Operation.ServerResponse.Header or (if a response was returned at
  45016. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45017. // to check whether the returned error was because
  45018. // http.StatusNotModified was returned.
  45019. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45020. gensupport.SetOptions(c.urlParams_, opts...)
  45021. res, err := c.doRequest("json")
  45022. if res != nil && res.StatusCode == http.StatusNotModified {
  45023. if res.Body != nil {
  45024. res.Body.Close()
  45025. }
  45026. return nil, &googleapi.Error{
  45027. Code: res.StatusCode,
  45028. Header: res.Header,
  45029. }
  45030. }
  45031. if err != nil {
  45032. return nil, err
  45033. }
  45034. defer googleapi.CloseBody(res)
  45035. if err := googleapi.CheckResponse(res); err != nil {
  45036. return nil, err
  45037. }
  45038. ret := &Operation{
  45039. ServerResponse: googleapi.ServerResponse{
  45040. Header: res.Header,
  45041. HTTPStatusCode: res.StatusCode,
  45042. },
  45043. }
  45044. target := &ret
  45045. if err := gensupport.DecodeResponse(target, res); err != nil {
  45046. return nil, err
  45047. }
  45048. return ret, nil
  45049. // {
  45050. // "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.",
  45051. // "httpMethod": "PATCH",
  45052. // "id": "compute.backendServices.patch",
  45053. // "parameterOrder": [
  45054. // "project",
  45055. // "backendService"
  45056. // ],
  45057. // "parameters": {
  45058. // "backendService": {
  45059. // "description": "Name of the BackendService resource to patch.",
  45060. // "location": "path",
  45061. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45062. // "required": true,
  45063. // "type": "string"
  45064. // },
  45065. // "project": {
  45066. // "description": "Project ID for this request.",
  45067. // "location": "path",
  45068. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45069. // "required": true,
  45070. // "type": "string"
  45071. // },
  45072. // "requestId": {
  45073. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45074. // "location": "query",
  45075. // "type": "string"
  45076. // }
  45077. // },
  45078. // "path": "{project}/global/backendServices/{backendService}",
  45079. // "request": {
  45080. // "$ref": "BackendService"
  45081. // },
  45082. // "response": {
  45083. // "$ref": "Operation"
  45084. // },
  45085. // "scopes": [
  45086. // "https://www.googleapis.com/auth/cloud-platform",
  45087. // "https://www.googleapis.com/auth/compute"
  45088. // ]
  45089. // }
  45090. }
  45091. // method id "compute.backendServices.setSecurityPolicy":
  45092. type BackendServicesSetSecurityPolicyCall struct {
  45093. s *Service
  45094. project string
  45095. backendService string
  45096. securitypolicyreference *SecurityPolicyReference
  45097. urlParams_ gensupport.URLParams
  45098. ctx_ context.Context
  45099. header_ http.Header
  45100. }
  45101. // SetSecurityPolicy: Sets the security policy for the specified backend
  45102. // service.
  45103. func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
  45104. c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45105. c.project = project
  45106. c.backendService = backendService
  45107. c.securitypolicyreference = securitypolicyreference
  45108. return c
  45109. }
  45110. // RequestId sets the optional parameter "requestId": An optional
  45111. // request ID to identify requests. Specify a unique request ID so that
  45112. // if you must retry your request, the server will know to ignore the
  45113. // request if it has already been completed.
  45114. //
  45115. // For example, consider a situation where you make an initial request
  45116. // and the request times out. If you make the request again with the
  45117. // same request ID, the server can check if original operation with the
  45118. // same request ID was received, and if so, will ignore the second
  45119. // request. This prevents clients from accidentally creating duplicate
  45120. // commitments.
  45121. //
  45122. // The request ID must be a valid UUID with the exception that zero UUID
  45123. // is not supported (00000000-0000-0000-0000-000000000000).
  45124. func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
  45125. c.urlParams_.Set("requestId", requestId)
  45126. return c
  45127. }
  45128. // Fields allows partial responses to be retrieved. See
  45129. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45130. // for more information.
  45131. func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
  45132. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45133. return c
  45134. }
  45135. // Context sets the context to be used in this call's Do method. Any
  45136. // pending HTTP request will be aborted if the provided context is
  45137. // canceled.
  45138. func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
  45139. c.ctx_ = ctx
  45140. return c
  45141. }
  45142. // Header returns an http.Header that can be modified by the caller to
  45143. // add HTTP headers to the request.
  45144. func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
  45145. if c.header_ == nil {
  45146. c.header_ = make(http.Header)
  45147. }
  45148. return c.header_
  45149. }
  45150. func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
  45151. reqHeaders := make(http.Header)
  45152. for k, v := range c.header_ {
  45153. reqHeaders[k] = v
  45154. }
  45155. reqHeaders.Set("User-Agent", c.s.userAgent())
  45156. var body io.Reader = nil
  45157. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
  45158. if err != nil {
  45159. return nil, err
  45160. }
  45161. reqHeaders.Set("Content-Type", "application/json")
  45162. c.urlParams_.Set("alt", alt)
  45163. c.urlParams_.Set("prettyPrint", "false")
  45164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/setSecurityPolicy")
  45165. urls += "?" + c.urlParams_.Encode()
  45166. req, err := http.NewRequest("POST", urls, body)
  45167. if err != nil {
  45168. return nil, err
  45169. }
  45170. req.Header = reqHeaders
  45171. googleapi.Expand(req.URL, map[string]string{
  45172. "project": c.project,
  45173. "backendService": c.backendService,
  45174. })
  45175. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45176. }
  45177. // Do executes the "compute.backendServices.setSecurityPolicy" call.
  45178. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45179. // status code is an error. Response headers are in either
  45180. // *Operation.ServerResponse.Header or (if a response was returned at
  45181. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45182. // to check whether the returned error was because
  45183. // http.StatusNotModified was returned.
  45184. func (c *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45185. gensupport.SetOptions(c.urlParams_, opts...)
  45186. res, err := c.doRequest("json")
  45187. if res != nil && res.StatusCode == http.StatusNotModified {
  45188. if res.Body != nil {
  45189. res.Body.Close()
  45190. }
  45191. return nil, &googleapi.Error{
  45192. Code: res.StatusCode,
  45193. Header: res.Header,
  45194. }
  45195. }
  45196. if err != nil {
  45197. return nil, err
  45198. }
  45199. defer googleapi.CloseBody(res)
  45200. if err := googleapi.CheckResponse(res); err != nil {
  45201. return nil, err
  45202. }
  45203. ret := &Operation{
  45204. ServerResponse: googleapi.ServerResponse{
  45205. Header: res.Header,
  45206. HTTPStatusCode: res.StatusCode,
  45207. },
  45208. }
  45209. target := &ret
  45210. if err := gensupport.DecodeResponse(target, res); err != nil {
  45211. return nil, err
  45212. }
  45213. return ret, nil
  45214. // {
  45215. // "description": "Sets the security policy for the specified backend service.",
  45216. // "httpMethod": "POST",
  45217. // "id": "compute.backendServices.setSecurityPolicy",
  45218. // "parameterOrder": [
  45219. // "project",
  45220. // "backendService"
  45221. // ],
  45222. // "parameters": {
  45223. // "backendService": {
  45224. // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
  45225. // "location": "path",
  45226. // "required": true,
  45227. // "type": "string"
  45228. // },
  45229. // "project": {
  45230. // "description": "Project ID for this request.",
  45231. // "location": "path",
  45232. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45233. // "required": true,
  45234. // "type": "string"
  45235. // },
  45236. // "requestId": {
  45237. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45238. // "location": "query",
  45239. // "type": "string"
  45240. // }
  45241. // },
  45242. // "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy",
  45243. // "request": {
  45244. // "$ref": "SecurityPolicyReference"
  45245. // },
  45246. // "response": {
  45247. // "$ref": "Operation"
  45248. // },
  45249. // "scopes": [
  45250. // "https://www.googleapis.com/auth/cloud-platform",
  45251. // "https://www.googleapis.com/auth/compute"
  45252. // ]
  45253. // }
  45254. }
  45255. // method id "compute.backendServices.testIamPermissions":
  45256. type BackendServicesTestIamPermissionsCall struct {
  45257. s *Service
  45258. project string
  45259. resource string
  45260. testpermissionsrequest *TestPermissionsRequest
  45261. urlParams_ gensupport.URLParams
  45262. ctx_ context.Context
  45263. header_ http.Header
  45264. }
  45265. // TestIamPermissions: Returns permissions that a caller has on the
  45266. // specified resource.
  45267. func (r *BackendServicesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendServicesTestIamPermissionsCall {
  45268. c := &BackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45269. c.project = project
  45270. c.resource = resource
  45271. c.testpermissionsrequest = testpermissionsrequest
  45272. return c
  45273. }
  45274. // Fields allows partial responses to be retrieved. See
  45275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45276. // for more information.
  45277. func (c *BackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendServicesTestIamPermissionsCall {
  45278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45279. return c
  45280. }
  45281. // Context sets the context to be used in this call's Do method. Any
  45282. // pending HTTP request will be aborted if the provided context is
  45283. // canceled.
  45284. func (c *BackendServicesTestIamPermissionsCall) Context(ctx context.Context) *BackendServicesTestIamPermissionsCall {
  45285. c.ctx_ = ctx
  45286. return c
  45287. }
  45288. // Header returns an http.Header that can be modified by the caller to
  45289. // add HTTP headers to the request.
  45290. func (c *BackendServicesTestIamPermissionsCall) Header() http.Header {
  45291. if c.header_ == nil {
  45292. c.header_ = make(http.Header)
  45293. }
  45294. return c.header_
  45295. }
  45296. func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  45297. reqHeaders := make(http.Header)
  45298. for k, v := range c.header_ {
  45299. reqHeaders[k] = v
  45300. }
  45301. reqHeaders.Set("User-Agent", c.s.userAgent())
  45302. var body io.Reader = nil
  45303. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  45304. if err != nil {
  45305. return nil, err
  45306. }
  45307. reqHeaders.Set("Content-Type", "application/json")
  45308. c.urlParams_.Set("alt", alt)
  45309. c.urlParams_.Set("prettyPrint", "false")
  45310. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{resource}/testIamPermissions")
  45311. urls += "?" + c.urlParams_.Encode()
  45312. req, err := http.NewRequest("POST", urls, body)
  45313. if err != nil {
  45314. return nil, err
  45315. }
  45316. req.Header = reqHeaders
  45317. googleapi.Expand(req.URL, map[string]string{
  45318. "project": c.project,
  45319. "resource": c.resource,
  45320. })
  45321. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45322. }
  45323. // Do executes the "compute.backendServices.testIamPermissions" call.
  45324. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  45325. // non-2xx status code is an error. Response headers are in either
  45326. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  45327. // returned at all) in error.(*googleapi.Error).Header. Use
  45328. // googleapi.IsNotModified to check whether the returned error was
  45329. // because http.StatusNotModified was returned.
  45330. func (c *BackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  45331. gensupport.SetOptions(c.urlParams_, opts...)
  45332. res, err := c.doRequest("json")
  45333. if res != nil && res.StatusCode == http.StatusNotModified {
  45334. if res.Body != nil {
  45335. res.Body.Close()
  45336. }
  45337. return nil, &googleapi.Error{
  45338. Code: res.StatusCode,
  45339. Header: res.Header,
  45340. }
  45341. }
  45342. if err != nil {
  45343. return nil, err
  45344. }
  45345. defer googleapi.CloseBody(res)
  45346. if err := googleapi.CheckResponse(res); err != nil {
  45347. return nil, err
  45348. }
  45349. ret := &TestPermissionsResponse{
  45350. ServerResponse: googleapi.ServerResponse{
  45351. Header: res.Header,
  45352. HTTPStatusCode: res.StatusCode,
  45353. },
  45354. }
  45355. target := &ret
  45356. if err := gensupport.DecodeResponse(target, res); err != nil {
  45357. return nil, err
  45358. }
  45359. return ret, nil
  45360. // {
  45361. // "description": "Returns permissions that a caller has on the specified resource.",
  45362. // "httpMethod": "POST",
  45363. // "id": "compute.backendServices.testIamPermissions",
  45364. // "parameterOrder": [
  45365. // "project",
  45366. // "resource"
  45367. // ],
  45368. // "parameters": {
  45369. // "project": {
  45370. // "description": "Project ID for this request.",
  45371. // "location": "path",
  45372. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45373. // "required": true,
  45374. // "type": "string"
  45375. // },
  45376. // "resource": {
  45377. // "description": "Name or id of the resource for this request.",
  45378. // "location": "path",
  45379. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45380. // "required": true,
  45381. // "type": "string"
  45382. // }
  45383. // },
  45384. // "path": "{project}/global/backendServices/{resource}/testIamPermissions",
  45385. // "request": {
  45386. // "$ref": "TestPermissionsRequest"
  45387. // },
  45388. // "response": {
  45389. // "$ref": "TestPermissionsResponse"
  45390. // },
  45391. // "scopes": [
  45392. // "https://www.googleapis.com/auth/cloud-platform",
  45393. // "https://www.googleapis.com/auth/compute",
  45394. // "https://www.googleapis.com/auth/compute.readonly"
  45395. // ]
  45396. // }
  45397. }
  45398. // method id "compute.backendServices.update":
  45399. type BackendServicesUpdateCall struct {
  45400. s *Service
  45401. project string
  45402. backendService string
  45403. backendservice *BackendService
  45404. urlParams_ gensupport.URLParams
  45405. ctx_ context.Context
  45406. header_ http.Header
  45407. }
  45408. // Update: Updates the specified BackendService resource with the data
  45409. // included in the request. There are several restrictions and
  45410. // guidelines to keep in mind when updating a backend service. Read
  45411. // Restrictions and Guidelines for more information.
  45412. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  45413. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  45414. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45415. c.project = project
  45416. c.backendService = backendService
  45417. c.backendservice = backendservice
  45418. return c
  45419. }
  45420. // RequestId sets the optional parameter "requestId": An optional
  45421. // request ID to identify requests. Specify a unique request ID so that
  45422. // if you must retry your request, the server will know to ignore the
  45423. // request if it has already been completed.
  45424. //
  45425. // For example, consider a situation where you make an initial request
  45426. // and the request times out. If you make the request again with the
  45427. // same request ID, the server can check if original operation with the
  45428. // same request ID was received, and if so, will ignore the second
  45429. // request. This prevents clients from accidentally creating duplicate
  45430. // commitments.
  45431. //
  45432. // The request ID must be a valid UUID with the exception that zero UUID
  45433. // is not supported (00000000-0000-0000-0000-000000000000).
  45434. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  45435. c.urlParams_.Set("requestId", requestId)
  45436. return c
  45437. }
  45438. // Fields allows partial responses to be retrieved. See
  45439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45440. // for more information.
  45441. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  45442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45443. return c
  45444. }
  45445. // Context sets the context to be used in this call's Do method. Any
  45446. // pending HTTP request will be aborted if the provided context is
  45447. // canceled.
  45448. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  45449. c.ctx_ = ctx
  45450. return c
  45451. }
  45452. // Header returns an http.Header that can be modified by the caller to
  45453. // add HTTP headers to the request.
  45454. func (c *BackendServicesUpdateCall) Header() http.Header {
  45455. if c.header_ == nil {
  45456. c.header_ = make(http.Header)
  45457. }
  45458. return c.header_
  45459. }
  45460. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  45461. reqHeaders := make(http.Header)
  45462. for k, v := range c.header_ {
  45463. reqHeaders[k] = v
  45464. }
  45465. reqHeaders.Set("User-Agent", c.s.userAgent())
  45466. var body io.Reader = nil
  45467. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  45468. if err != nil {
  45469. return nil, err
  45470. }
  45471. reqHeaders.Set("Content-Type", "application/json")
  45472. c.urlParams_.Set("alt", alt)
  45473. c.urlParams_.Set("prettyPrint", "false")
  45474. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  45475. urls += "?" + c.urlParams_.Encode()
  45476. req, err := http.NewRequest("PUT", urls, body)
  45477. if err != nil {
  45478. return nil, err
  45479. }
  45480. req.Header = reqHeaders
  45481. googleapi.Expand(req.URL, map[string]string{
  45482. "project": c.project,
  45483. "backendService": c.backendService,
  45484. })
  45485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45486. }
  45487. // Do executes the "compute.backendServices.update" call.
  45488. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45489. // status code is an error. Response headers are in either
  45490. // *Operation.ServerResponse.Header or (if a response was returned at
  45491. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45492. // to check whether the returned error was because
  45493. // http.StatusNotModified was returned.
  45494. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45495. gensupport.SetOptions(c.urlParams_, opts...)
  45496. res, err := c.doRequest("json")
  45497. if res != nil && res.StatusCode == http.StatusNotModified {
  45498. if res.Body != nil {
  45499. res.Body.Close()
  45500. }
  45501. return nil, &googleapi.Error{
  45502. Code: res.StatusCode,
  45503. Header: res.Header,
  45504. }
  45505. }
  45506. if err != nil {
  45507. return nil, err
  45508. }
  45509. defer googleapi.CloseBody(res)
  45510. if err := googleapi.CheckResponse(res); err != nil {
  45511. return nil, err
  45512. }
  45513. ret := &Operation{
  45514. ServerResponse: googleapi.ServerResponse{
  45515. Header: res.Header,
  45516. HTTPStatusCode: res.StatusCode,
  45517. },
  45518. }
  45519. target := &ret
  45520. if err := gensupport.DecodeResponse(target, res); err != nil {
  45521. return nil, err
  45522. }
  45523. return ret, nil
  45524. // {
  45525. // "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.",
  45526. // "httpMethod": "PUT",
  45527. // "id": "compute.backendServices.update",
  45528. // "parameterOrder": [
  45529. // "project",
  45530. // "backendService"
  45531. // ],
  45532. // "parameters": {
  45533. // "backendService": {
  45534. // "description": "Name of the BackendService resource to update.",
  45535. // "location": "path",
  45536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45537. // "required": true,
  45538. // "type": "string"
  45539. // },
  45540. // "project": {
  45541. // "description": "Project ID for this request.",
  45542. // "location": "path",
  45543. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45544. // "required": true,
  45545. // "type": "string"
  45546. // },
  45547. // "requestId": {
  45548. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45549. // "location": "query",
  45550. // "type": "string"
  45551. // }
  45552. // },
  45553. // "path": "{project}/global/backendServices/{backendService}",
  45554. // "request": {
  45555. // "$ref": "BackendService"
  45556. // },
  45557. // "response": {
  45558. // "$ref": "Operation"
  45559. // },
  45560. // "scopes": [
  45561. // "https://www.googleapis.com/auth/cloud-platform",
  45562. // "https://www.googleapis.com/auth/compute"
  45563. // ]
  45564. // }
  45565. }
  45566. // method id "compute.diskTypes.aggregatedList":
  45567. type DiskTypesAggregatedListCall struct {
  45568. s *Service
  45569. project string
  45570. urlParams_ gensupport.URLParams
  45571. ifNoneMatch_ string
  45572. ctx_ context.Context
  45573. header_ http.Header
  45574. }
  45575. // AggregatedList: Retrieves an aggregated list of disk types.
  45576. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  45577. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  45578. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45579. c.project = project
  45580. return c
  45581. }
  45582. // Filter sets the optional parameter "filter": A filter expression that
  45583. // filters resources listed in the response. The expression must specify
  45584. // the field name, a comparison operator, and the value that you want to
  45585. // use for filtering. The value must be a string, a number, or a
  45586. // boolean. The comparison operator must be either =, !=, >, or <.
  45587. //
  45588. // For example, if you are filtering Compute Engine instances, you can
  45589. // exclude instances named example-instance by specifying name !=
  45590. // example-instance.
  45591. //
  45592. // You can also filter nested fields. For example, you could specify
  45593. // scheduling.automaticRestart = false to include instances only if they
  45594. // are not scheduled for automatic restarts. You can use filtering on
  45595. // nested fields to filter based on resource labels.
  45596. //
  45597. // To filter on multiple expressions, provide each separate expression
  45598. // within parentheses. For example, (scheduling.automaticRestart = true)
  45599. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  45600. // AND expression. However, you can include AND and OR expressions
  45601. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  45602. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  45603. // true).
  45604. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  45605. c.urlParams_.Set("filter", filter)
  45606. return c
  45607. }
  45608. // MaxResults sets the optional parameter "maxResults": The maximum
  45609. // number of results per page that should be returned. If the number of
  45610. // available results is larger than maxResults, Compute Engine returns a
  45611. // nextPageToken that can be used to get the next page of results in
  45612. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  45613. // (Default: 500)
  45614. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  45615. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45616. return c
  45617. }
  45618. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  45619. // a certain order. By default, results are returned in alphanumerical
  45620. // order based on the resource name.
  45621. //
  45622. // You can also sort results in descending order based on the creation
  45623. // timestamp using orderBy="creationTimestamp desc". This sorts results
  45624. // based on the creationTimestamp field in reverse chronological order
  45625. // (newest result first). Use this to sort resources like operations so
  45626. // that the newest operation is returned first.
  45627. //
  45628. // Currently, only sorting by name or creationTimestamp desc is
  45629. // supported.
  45630. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  45631. c.urlParams_.Set("orderBy", orderBy)
  45632. return c
  45633. }
  45634. // PageToken sets the optional parameter "pageToken": Specifies a page
  45635. // token to use. Set pageToken to the nextPageToken returned by a
  45636. // previous list request to get the next page of results.
  45637. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  45638. c.urlParams_.Set("pageToken", pageToken)
  45639. return c
  45640. }
  45641. // Fields allows partial responses to be retrieved. See
  45642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45643. // for more information.
  45644. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  45645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45646. return c
  45647. }
  45648. // IfNoneMatch sets the optional parameter which makes the operation
  45649. // fail if the object's ETag matches the given value. This is useful for
  45650. // getting updates only after the object has changed since the last
  45651. // request. Use googleapi.IsNotModified to check whether the response
  45652. // error from Do is the result of In-None-Match.
  45653. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  45654. c.ifNoneMatch_ = entityTag
  45655. return c
  45656. }
  45657. // Context sets the context to be used in this call's Do method. Any
  45658. // pending HTTP request will be aborted if the provided context is
  45659. // canceled.
  45660. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  45661. c.ctx_ = ctx
  45662. return c
  45663. }
  45664. // Header returns an http.Header that can be modified by the caller to
  45665. // add HTTP headers to the request.
  45666. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  45667. if c.header_ == nil {
  45668. c.header_ = make(http.Header)
  45669. }
  45670. return c.header_
  45671. }
  45672. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  45673. reqHeaders := make(http.Header)
  45674. for k, v := range c.header_ {
  45675. reqHeaders[k] = v
  45676. }
  45677. reqHeaders.Set("User-Agent", c.s.userAgent())
  45678. if c.ifNoneMatch_ != "" {
  45679. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45680. }
  45681. var body io.Reader = nil
  45682. c.urlParams_.Set("alt", alt)
  45683. c.urlParams_.Set("prettyPrint", "false")
  45684. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  45685. urls += "?" + c.urlParams_.Encode()
  45686. req, err := http.NewRequest("GET", urls, body)
  45687. if err != nil {
  45688. return nil, err
  45689. }
  45690. req.Header = reqHeaders
  45691. googleapi.Expand(req.URL, map[string]string{
  45692. "project": c.project,
  45693. })
  45694. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45695. }
  45696. // Do executes the "compute.diskTypes.aggregatedList" call.
  45697. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  45698. // non-2xx status code is an error. Response headers are in either
  45699. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  45700. // returned at all) in error.(*googleapi.Error).Header. Use
  45701. // googleapi.IsNotModified to check whether the returned error was
  45702. // because http.StatusNotModified was returned.
  45703. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  45704. gensupport.SetOptions(c.urlParams_, opts...)
  45705. res, err := c.doRequest("json")
  45706. if res != nil && res.StatusCode == http.StatusNotModified {
  45707. if res.Body != nil {
  45708. res.Body.Close()
  45709. }
  45710. return nil, &googleapi.Error{
  45711. Code: res.StatusCode,
  45712. Header: res.Header,
  45713. }
  45714. }
  45715. if err != nil {
  45716. return nil, err
  45717. }
  45718. defer googleapi.CloseBody(res)
  45719. if err := googleapi.CheckResponse(res); err != nil {
  45720. return nil, err
  45721. }
  45722. ret := &DiskTypeAggregatedList{
  45723. ServerResponse: googleapi.ServerResponse{
  45724. Header: res.Header,
  45725. HTTPStatusCode: res.StatusCode,
  45726. },
  45727. }
  45728. target := &ret
  45729. if err := gensupport.DecodeResponse(target, res); err != nil {
  45730. return nil, err
  45731. }
  45732. return ret, nil
  45733. // {
  45734. // "description": "Retrieves an aggregated list of disk types.",
  45735. // "httpMethod": "GET",
  45736. // "id": "compute.diskTypes.aggregatedList",
  45737. // "parameterOrder": [
  45738. // "project"
  45739. // ],
  45740. // "parameters": {
  45741. // "filter": {
  45742. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  45743. // "location": "query",
  45744. // "type": "string"
  45745. // },
  45746. // "maxResults": {
  45747. // "default": "500",
  45748. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  45749. // "format": "uint32",
  45750. // "location": "query",
  45751. // "minimum": "0",
  45752. // "type": "integer"
  45753. // },
  45754. // "orderBy": {
  45755. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  45756. // "location": "query",
  45757. // "type": "string"
  45758. // },
  45759. // "pageToken": {
  45760. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  45761. // "location": "query",
  45762. // "type": "string"
  45763. // },
  45764. // "project": {
  45765. // "description": "Project ID for this request.",
  45766. // "location": "path",
  45767. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45768. // "required": true,
  45769. // "type": "string"
  45770. // }
  45771. // },
  45772. // "path": "{project}/aggregated/diskTypes",
  45773. // "response": {
  45774. // "$ref": "DiskTypeAggregatedList"
  45775. // },
  45776. // "scopes": [
  45777. // "https://www.googleapis.com/auth/cloud-platform",
  45778. // "https://www.googleapis.com/auth/compute",
  45779. // "https://www.googleapis.com/auth/compute.readonly"
  45780. // ]
  45781. // }
  45782. }
  45783. // Pages invokes f for each page of results.
  45784. // A non-nil error returned from f will halt the iteration.
  45785. // The provided context supersedes any context provided to the Context method.
  45786. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  45787. c.ctx_ = ctx
  45788. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45789. for {
  45790. x, err := c.Do()
  45791. if err != nil {
  45792. return err
  45793. }
  45794. if err := f(x); err != nil {
  45795. return err
  45796. }
  45797. if x.NextPageToken == "" {
  45798. return nil
  45799. }
  45800. c.PageToken(x.NextPageToken)
  45801. }
  45802. }
  45803. // method id "compute.diskTypes.get":
  45804. type DiskTypesGetCall struct {
  45805. s *Service
  45806. project string
  45807. zone string
  45808. diskType string
  45809. urlParams_ gensupport.URLParams
  45810. ifNoneMatch_ string
  45811. ctx_ context.Context
  45812. header_ http.Header
  45813. }
  45814. // Get: Returns the specified disk type. Gets a list of available disk
  45815. // types by making a list() request.
  45816. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  45817. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  45818. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45819. c.project = project
  45820. c.zone = zone
  45821. c.diskType = diskType
  45822. return c
  45823. }
  45824. // Fields allows partial responses to be retrieved. See
  45825. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45826. // for more information.
  45827. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  45828. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45829. return c
  45830. }
  45831. // IfNoneMatch sets the optional parameter which makes the operation
  45832. // fail if the object's ETag matches the given value. This is useful for
  45833. // getting updates only after the object has changed since the last
  45834. // request. Use googleapi.IsNotModified to check whether the response
  45835. // error from Do is the result of In-None-Match.
  45836. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  45837. c.ifNoneMatch_ = entityTag
  45838. return c
  45839. }
  45840. // Context sets the context to be used in this call's Do method. Any
  45841. // pending HTTP request will be aborted if the provided context is
  45842. // canceled.
  45843. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  45844. c.ctx_ = ctx
  45845. return c
  45846. }
  45847. // Header returns an http.Header that can be modified by the caller to
  45848. // add HTTP headers to the request.
  45849. func (c *DiskTypesGetCall) Header() http.Header {
  45850. if c.header_ == nil {
  45851. c.header_ = make(http.Header)
  45852. }
  45853. return c.header_
  45854. }
  45855. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  45856. reqHeaders := make(http.Header)
  45857. for k, v := range c.header_ {
  45858. reqHeaders[k] = v
  45859. }
  45860. reqHeaders.Set("User-Agent", c.s.userAgent())
  45861. if c.ifNoneMatch_ != "" {
  45862. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45863. }
  45864. var body io.Reader = nil
  45865. c.urlParams_.Set("alt", alt)
  45866. c.urlParams_.Set("prettyPrint", "false")
  45867. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  45868. urls += "?" + c.urlParams_.Encode()
  45869. req, err := http.NewRequest("GET", urls, body)
  45870. if err != nil {
  45871. return nil, err
  45872. }
  45873. req.Header = reqHeaders
  45874. googleapi.Expand(req.URL, map[string]string{
  45875. "project": c.project,
  45876. "zone": c.zone,
  45877. "diskType": c.diskType,
  45878. })
  45879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45880. }
  45881. // Do executes the "compute.diskTypes.get" call.
  45882. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  45883. // code is an error. Response headers are in either
  45884. // *DiskType.ServerResponse.Header or (if a response was returned at
  45885. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45886. // to check whether the returned error was because
  45887. // http.StatusNotModified was returned.
  45888. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  45889. gensupport.SetOptions(c.urlParams_, opts...)
  45890. res, err := c.doRequest("json")
  45891. if res != nil && res.StatusCode == http.StatusNotModified {
  45892. if res.Body != nil {
  45893. res.Body.Close()
  45894. }
  45895. return nil, &googleapi.Error{
  45896. Code: res.StatusCode,
  45897. Header: res.Header,
  45898. }
  45899. }
  45900. if err != nil {
  45901. return nil, err
  45902. }
  45903. defer googleapi.CloseBody(res)
  45904. if err := googleapi.CheckResponse(res); err != nil {
  45905. return nil, err
  45906. }
  45907. ret := &DiskType{
  45908. ServerResponse: googleapi.ServerResponse{
  45909. Header: res.Header,
  45910. HTTPStatusCode: res.StatusCode,
  45911. },
  45912. }
  45913. target := &ret
  45914. if err := gensupport.DecodeResponse(target, res); err != nil {
  45915. return nil, err
  45916. }
  45917. return ret, nil
  45918. // {
  45919. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  45920. // "httpMethod": "GET",
  45921. // "id": "compute.diskTypes.get",
  45922. // "parameterOrder": [
  45923. // "project",
  45924. // "zone",
  45925. // "diskType"
  45926. // ],
  45927. // "parameters": {
  45928. // "diskType": {
  45929. // "description": "Name of the disk type to return.",
  45930. // "location": "path",
  45931. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45932. // "required": true,
  45933. // "type": "string"
  45934. // },
  45935. // "project": {
  45936. // "description": "Project ID for this request.",
  45937. // "location": "path",
  45938. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45939. // "required": true,
  45940. // "type": "string"
  45941. // },
  45942. // "zone": {
  45943. // "description": "The name of the zone for this request.",
  45944. // "location": "path",
  45945. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45946. // "required": true,
  45947. // "type": "string"
  45948. // }
  45949. // },
  45950. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  45951. // "response": {
  45952. // "$ref": "DiskType"
  45953. // },
  45954. // "scopes": [
  45955. // "https://www.googleapis.com/auth/cloud-platform",
  45956. // "https://www.googleapis.com/auth/compute",
  45957. // "https://www.googleapis.com/auth/compute.readonly"
  45958. // ]
  45959. // }
  45960. }
  45961. // method id "compute.diskTypes.list":
  45962. type DiskTypesListCall struct {
  45963. s *Service
  45964. project string
  45965. zone string
  45966. urlParams_ gensupport.URLParams
  45967. ifNoneMatch_ string
  45968. ctx_ context.Context
  45969. header_ http.Header
  45970. }
  45971. // List: Retrieves a list of disk types available to the specified
  45972. // project.
  45973. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  45974. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  45975. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45976. c.project = project
  45977. c.zone = zone
  45978. return c
  45979. }
  45980. // Filter sets the optional parameter "filter": A filter expression that
  45981. // filters resources listed in the response. The expression must specify
  45982. // the field name, a comparison operator, and the value that you want to
  45983. // use for filtering. The value must be a string, a number, or a
  45984. // boolean. The comparison operator must be either =, !=, >, or <.
  45985. //
  45986. // For example, if you are filtering Compute Engine instances, you can
  45987. // exclude instances named example-instance by specifying name !=
  45988. // example-instance.
  45989. //
  45990. // You can also filter nested fields. For example, you could specify
  45991. // scheduling.automaticRestart = false to include instances only if they
  45992. // are not scheduled for automatic restarts. You can use filtering on
  45993. // nested fields to filter based on resource labels.
  45994. //
  45995. // To filter on multiple expressions, provide each separate expression
  45996. // within parentheses. For example, (scheduling.automaticRestart = true)
  45997. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  45998. // AND expression. However, you can include AND and OR expressions
  45999. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46000. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46001. // true).
  46002. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  46003. c.urlParams_.Set("filter", filter)
  46004. return c
  46005. }
  46006. // MaxResults sets the optional parameter "maxResults": The maximum
  46007. // number of results per page that should be returned. If the number of
  46008. // available results is larger than maxResults, Compute Engine returns a
  46009. // nextPageToken that can be used to get the next page of results in
  46010. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46011. // (Default: 500)
  46012. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  46013. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46014. return c
  46015. }
  46016. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46017. // a certain order. By default, results are returned in alphanumerical
  46018. // order based on the resource name.
  46019. //
  46020. // You can also sort results in descending order based on the creation
  46021. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46022. // based on the creationTimestamp field in reverse chronological order
  46023. // (newest result first). Use this to sort resources like operations so
  46024. // that the newest operation is returned first.
  46025. //
  46026. // Currently, only sorting by name or creationTimestamp desc is
  46027. // supported.
  46028. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  46029. c.urlParams_.Set("orderBy", orderBy)
  46030. return c
  46031. }
  46032. // PageToken sets the optional parameter "pageToken": Specifies a page
  46033. // token to use. Set pageToken to the nextPageToken returned by a
  46034. // previous list request to get the next page of results.
  46035. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  46036. c.urlParams_.Set("pageToken", pageToken)
  46037. return c
  46038. }
  46039. // Fields allows partial responses to be retrieved. See
  46040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46041. // for more information.
  46042. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  46043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46044. return c
  46045. }
  46046. // IfNoneMatch sets the optional parameter which makes the operation
  46047. // fail if the object's ETag matches the given value. This is useful for
  46048. // getting updates only after the object has changed since the last
  46049. // request. Use googleapi.IsNotModified to check whether the response
  46050. // error from Do is the result of In-None-Match.
  46051. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  46052. c.ifNoneMatch_ = entityTag
  46053. return c
  46054. }
  46055. // Context sets the context to be used in this call's Do method. Any
  46056. // pending HTTP request will be aborted if the provided context is
  46057. // canceled.
  46058. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  46059. c.ctx_ = ctx
  46060. return c
  46061. }
  46062. // Header returns an http.Header that can be modified by the caller to
  46063. // add HTTP headers to the request.
  46064. func (c *DiskTypesListCall) Header() http.Header {
  46065. if c.header_ == nil {
  46066. c.header_ = make(http.Header)
  46067. }
  46068. return c.header_
  46069. }
  46070. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  46071. reqHeaders := make(http.Header)
  46072. for k, v := range c.header_ {
  46073. reqHeaders[k] = v
  46074. }
  46075. reqHeaders.Set("User-Agent", c.s.userAgent())
  46076. if c.ifNoneMatch_ != "" {
  46077. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46078. }
  46079. var body io.Reader = nil
  46080. c.urlParams_.Set("alt", alt)
  46081. c.urlParams_.Set("prettyPrint", "false")
  46082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  46083. urls += "?" + c.urlParams_.Encode()
  46084. req, err := http.NewRequest("GET", urls, body)
  46085. if err != nil {
  46086. return nil, err
  46087. }
  46088. req.Header = reqHeaders
  46089. googleapi.Expand(req.URL, map[string]string{
  46090. "project": c.project,
  46091. "zone": c.zone,
  46092. })
  46093. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46094. }
  46095. // Do executes the "compute.diskTypes.list" call.
  46096. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  46097. // status code is an error. Response headers are in either
  46098. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  46099. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46100. // to check whether the returned error was because
  46101. // http.StatusNotModified was returned.
  46102. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  46103. gensupport.SetOptions(c.urlParams_, opts...)
  46104. res, err := c.doRequest("json")
  46105. if res != nil && res.StatusCode == http.StatusNotModified {
  46106. if res.Body != nil {
  46107. res.Body.Close()
  46108. }
  46109. return nil, &googleapi.Error{
  46110. Code: res.StatusCode,
  46111. Header: res.Header,
  46112. }
  46113. }
  46114. if err != nil {
  46115. return nil, err
  46116. }
  46117. defer googleapi.CloseBody(res)
  46118. if err := googleapi.CheckResponse(res); err != nil {
  46119. return nil, err
  46120. }
  46121. ret := &DiskTypeList{
  46122. ServerResponse: googleapi.ServerResponse{
  46123. Header: res.Header,
  46124. HTTPStatusCode: res.StatusCode,
  46125. },
  46126. }
  46127. target := &ret
  46128. if err := gensupport.DecodeResponse(target, res); err != nil {
  46129. return nil, err
  46130. }
  46131. return ret, nil
  46132. // {
  46133. // "description": "Retrieves a list of disk types available to the specified project.",
  46134. // "httpMethod": "GET",
  46135. // "id": "compute.diskTypes.list",
  46136. // "parameterOrder": [
  46137. // "project",
  46138. // "zone"
  46139. // ],
  46140. // "parameters": {
  46141. // "filter": {
  46142. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  46143. // "location": "query",
  46144. // "type": "string"
  46145. // },
  46146. // "maxResults": {
  46147. // "default": "500",
  46148. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46149. // "format": "uint32",
  46150. // "location": "query",
  46151. // "minimum": "0",
  46152. // "type": "integer"
  46153. // },
  46154. // "orderBy": {
  46155. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46156. // "location": "query",
  46157. // "type": "string"
  46158. // },
  46159. // "pageToken": {
  46160. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46161. // "location": "query",
  46162. // "type": "string"
  46163. // },
  46164. // "project": {
  46165. // "description": "Project ID for this request.",
  46166. // "location": "path",
  46167. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46168. // "required": true,
  46169. // "type": "string"
  46170. // },
  46171. // "zone": {
  46172. // "description": "The name of the zone for this request.",
  46173. // "location": "path",
  46174. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46175. // "required": true,
  46176. // "type": "string"
  46177. // }
  46178. // },
  46179. // "path": "{project}/zones/{zone}/diskTypes",
  46180. // "response": {
  46181. // "$ref": "DiskTypeList"
  46182. // },
  46183. // "scopes": [
  46184. // "https://www.googleapis.com/auth/cloud-platform",
  46185. // "https://www.googleapis.com/auth/compute",
  46186. // "https://www.googleapis.com/auth/compute.readonly"
  46187. // ]
  46188. // }
  46189. }
  46190. // Pages invokes f for each page of results.
  46191. // A non-nil error returned from f will halt the iteration.
  46192. // The provided context supersedes any context provided to the Context method.
  46193. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  46194. c.ctx_ = ctx
  46195. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46196. for {
  46197. x, err := c.Do()
  46198. if err != nil {
  46199. return err
  46200. }
  46201. if err := f(x); err != nil {
  46202. return err
  46203. }
  46204. if x.NextPageToken == "" {
  46205. return nil
  46206. }
  46207. c.PageToken(x.NextPageToken)
  46208. }
  46209. }
  46210. // method id "compute.disks.addResourcePolicies":
  46211. type DisksAddResourcePoliciesCall struct {
  46212. s *Service
  46213. project string
  46214. zone string
  46215. disk string
  46216. disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest
  46217. urlParams_ gensupport.URLParams
  46218. ctx_ context.Context
  46219. header_ http.Header
  46220. }
  46221. // AddResourcePolicies: Adds existing resource policies to a disk. You
  46222. // can only add one policy which will be applied to this disk for
  46223. // scheduling snapshot creation.
  46224. func (r *DisksService) AddResourcePolicies(project string, zone string, disk string, disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest) *DisksAddResourcePoliciesCall {
  46225. c := &DisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46226. c.project = project
  46227. c.zone = zone
  46228. c.disk = disk
  46229. c.disksaddresourcepoliciesrequest = disksaddresourcepoliciesrequest
  46230. return c
  46231. }
  46232. // RequestId sets the optional parameter "requestId": An optional
  46233. // request ID to identify requests. Specify a unique request ID so that
  46234. // if you must retry your request, the server will know to ignore the
  46235. // request if it has already been completed.
  46236. //
  46237. // For example, consider a situation where you make an initial request
  46238. // and the request times out. If you make the request again with the
  46239. // same request ID, the server can check if original operation with the
  46240. // same request ID was received, and if so, will ignore the second
  46241. // request. This prevents clients from accidentally creating duplicate
  46242. // commitments.
  46243. //
  46244. // The request ID must be a valid UUID with the exception that zero UUID
  46245. // is not supported (00000000-0000-0000-0000-000000000000).
  46246. func (c *DisksAddResourcePoliciesCall) RequestId(requestId string) *DisksAddResourcePoliciesCall {
  46247. c.urlParams_.Set("requestId", requestId)
  46248. return c
  46249. }
  46250. // Fields allows partial responses to be retrieved. See
  46251. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46252. // for more information.
  46253. func (c *DisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksAddResourcePoliciesCall {
  46254. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46255. return c
  46256. }
  46257. // Context sets the context to be used in this call's Do method. Any
  46258. // pending HTTP request will be aborted if the provided context is
  46259. // canceled.
  46260. func (c *DisksAddResourcePoliciesCall) Context(ctx context.Context) *DisksAddResourcePoliciesCall {
  46261. c.ctx_ = ctx
  46262. return c
  46263. }
  46264. // Header returns an http.Header that can be modified by the caller to
  46265. // add HTTP headers to the request.
  46266. func (c *DisksAddResourcePoliciesCall) Header() http.Header {
  46267. if c.header_ == nil {
  46268. c.header_ = make(http.Header)
  46269. }
  46270. return c.header_
  46271. }
  46272. func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  46273. reqHeaders := make(http.Header)
  46274. for k, v := range c.header_ {
  46275. reqHeaders[k] = v
  46276. }
  46277. reqHeaders.Set("User-Agent", c.s.userAgent())
  46278. var body io.Reader = nil
  46279. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest)
  46280. if err != nil {
  46281. return nil, err
  46282. }
  46283. reqHeaders.Set("Content-Type", "application/json")
  46284. c.urlParams_.Set("alt", alt)
  46285. c.urlParams_.Set("prettyPrint", "false")
  46286. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/addResourcePolicies")
  46287. urls += "?" + c.urlParams_.Encode()
  46288. req, err := http.NewRequest("POST", urls, body)
  46289. if err != nil {
  46290. return nil, err
  46291. }
  46292. req.Header = reqHeaders
  46293. googleapi.Expand(req.URL, map[string]string{
  46294. "project": c.project,
  46295. "zone": c.zone,
  46296. "disk": c.disk,
  46297. })
  46298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46299. }
  46300. // Do executes the "compute.disks.addResourcePolicies" call.
  46301. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46302. // status code is an error. Response headers are in either
  46303. // *Operation.ServerResponse.Header or (if a response was returned at
  46304. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46305. // to check whether the returned error was because
  46306. // http.StatusNotModified was returned.
  46307. func (c *DisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46308. gensupport.SetOptions(c.urlParams_, opts...)
  46309. res, err := c.doRequest("json")
  46310. if res != nil && res.StatusCode == http.StatusNotModified {
  46311. if res.Body != nil {
  46312. res.Body.Close()
  46313. }
  46314. return nil, &googleapi.Error{
  46315. Code: res.StatusCode,
  46316. Header: res.Header,
  46317. }
  46318. }
  46319. if err != nil {
  46320. return nil, err
  46321. }
  46322. defer googleapi.CloseBody(res)
  46323. if err := googleapi.CheckResponse(res); err != nil {
  46324. return nil, err
  46325. }
  46326. ret := &Operation{
  46327. ServerResponse: googleapi.ServerResponse{
  46328. Header: res.Header,
  46329. HTTPStatusCode: res.StatusCode,
  46330. },
  46331. }
  46332. target := &ret
  46333. if err := gensupport.DecodeResponse(target, res); err != nil {
  46334. return nil, err
  46335. }
  46336. return ret, nil
  46337. // {
  46338. // "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.",
  46339. // "httpMethod": "POST",
  46340. // "id": "compute.disks.addResourcePolicies",
  46341. // "parameterOrder": [
  46342. // "project",
  46343. // "zone",
  46344. // "disk"
  46345. // ],
  46346. // "parameters": {
  46347. // "disk": {
  46348. // "description": "The disk name for this request.",
  46349. // "location": "path",
  46350. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46351. // "required": true,
  46352. // "type": "string"
  46353. // },
  46354. // "project": {
  46355. // "description": "Project ID for this request.",
  46356. // "location": "path",
  46357. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46358. // "required": true,
  46359. // "type": "string"
  46360. // },
  46361. // "requestId": {
  46362. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46363. // "location": "query",
  46364. // "type": "string"
  46365. // },
  46366. // "zone": {
  46367. // "description": "The name of the zone for this request.",
  46368. // "location": "path",
  46369. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46370. // "required": true,
  46371. // "type": "string"
  46372. // }
  46373. // },
  46374. // "path": "{project}/zones/{zone}/disks/{disk}/addResourcePolicies",
  46375. // "request": {
  46376. // "$ref": "DisksAddResourcePoliciesRequest"
  46377. // },
  46378. // "response": {
  46379. // "$ref": "Operation"
  46380. // },
  46381. // "scopes": [
  46382. // "https://www.googleapis.com/auth/cloud-platform",
  46383. // "https://www.googleapis.com/auth/compute"
  46384. // ]
  46385. // }
  46386. }
  46387. // method id "compute.disks.aggregatedList":
  46388. type DisksAggregatedListCall struct {
  46389. s *Service
  46390. project string
  46391. urlParams_ gensupport.URLParams
  46392. ifNoneMatch_ string
  46393. ctx_ context.Context
  46394. header_ http.Header
  46395. }
  46396. // AggregatedList: Retrieves an aggregated list of persistent disks.
  46397. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  46398. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  46399. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46400. c.project = project
  46401. return c
  46402. }
  46403. // Filter sets the optional parameter "filter": A filter expression that
  46404. // filters resources listed in the response. The expression must specify
  46405. // the field name, a comparison operator, and the value that you want to
  46406. // use for filtering. The value must be a string, a number, or a
  46407. // boolean. The comparison operator must be either =, !=, >, or <.
  46408. //
  46409. // For example, if you are filtering Compute Engine instances, you can
  46410. // exclude instances named example-instance by specifying name !=
  46411. // example-instance.
  46412. //
  46413. // You can also filter nested fields. For example, you could specify
  46414. // scheduling.automaticRestart = false to include instances only if they
  46415. // are not scheduled for automatic restarts. You can use filtering on
  46416. // nested fields to filter based on resource labels.
  46417. //
  46418. // To filter on multiple expressions, provide each separate expression
  46419. // within parentheses. For example, (scheduling.automaticRestart = true)
  46420. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46421. // AND expression. However, you can include AND and OR expressions
  46422. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46423. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46424. // true).
  46425. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  46426. c.urlParams_.Set("filter", filter)
  46427. return c
  46428. }
  46429. // MaxResults sets the optional parameter "maxResults": The maximum
  46430. // number of results per page that should be returned. If the number of
  46431. // available results is larger than maxResults, Compute Engine returns a
  46432. // nextPageToken that can be used to get the next page of results in
  46433. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46434. // (Default: 500)
  46435. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  46436. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46437. return c
  46438. }
  46439. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46440. // a certain order. By default, results are returned in alphanumerical
  46441. // order based on the resource name.
  46442. //
  46443. // You can also sort results in descending order based on the creation
  46444. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46445. // based on the creationTimestamp field in reverse chronological order
  46446. // (newest result first). Use this to sort resources like operations so
  46447. // that the newest operation is returned first.
  46448. //
  46449. // Currently, only sorting by name or creationTimestamp desc is
  46450. // supported.
  46451. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  46452. c.urlParams_.Set("orderBy", orderBy)
  46453. return c
  46454. }
  46455. // PageToken sets the optional parameter "pageToken": Specifies a page
  46456. // token to use. Set pageToken to the nextPageToken returned by a
  46457. // previous list request to get the next page of results.
  46458. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  46459. c.urlParams_.Set("pageToken", pageToken)
  46460. return c
  46461. }
  46462. // Fields allows partial responses to be retrieved. See
  46463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46464. // for more information.
  46465. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  46466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46467. return c
  46468. }
  46469. // IfNoneMatch sets the optional parameter which makes the operation
  46470. // fail if the object's ETag matches the given value. This is useful for
  46471. // getting updates only after the object has changed since the last
  46472. // request. Use googleapi.IsNotModified to check whether the response
  46473. // error from Do is the result of In-None-Match.
  46474. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  46475. c.ifNoneMatch_ = entityTag
  46476. return c
  46477. }
  46478. // Context sets the context to be used in this call's Do method. Any
  46479. // pending HTTP request will be aborted if the provided context is
  46480. // canceled.
  46481. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  46482. c.ctx_ = ctx
  46483. return c
  46484. }
  46485. // Header returns an http.Header that can be modified by the caller to
  46486. // add HTTP headers to the request.
  46487. func (c *DisksAggregatedListCall) Header() http.Header {
  46488. if c.header_ == nil {
  46489. c.header_ = make(http.Header)
  46490. }
  46491. return c.header_
  46492. }
  46493. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  46494. reqHeaders := make(http.Header)
  46495. for k, v := range c.header_ {
  46496. reqHeaders[k] = v
  46497. }
  46498. reqHeaders.Set("User-Agent", c.s.userAgent())
  46499. if c.ifNoneMatch_ != "" {
  46500. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46501. }
  46502. var body io.Reader = nil
  46503. c.urlParams_.Set("alt", alt)
  46504. c.urlParams_.Set("prettyPrint", "false")
  46505. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  46506. urls += "?" + c.urlParams_.Encode()
  46507. req, err := http.NewRequest("GET", urls, body)
  46508. if err != nil {
  46509. return nil, err
  46510. }
  46511. req.Header = reqHeaders
  46512. googleapi.Expand(req.URL, map[string]string{
  46513. "project": c.project,
  46514. })
  46515. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46516. }
  46517. // Do executes the "compute.disks.aggregatedList" call.
  46518. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  46519. // non-2xx status code is an error. Response headers are in either
  46520. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  46521. // returned at all) in error.(*googleapi.Error).Header. Use
  46522. // googleapi.IsNotModified to check whether the returned error was
  46523. // because http.StatusNotModified was returned.
  46524. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  46525. gensupport.SetOptions(c.urlParams_, opts...)
  46526. res, err := c.doRequest("json")
  46527. if res != nil && res.StatusCode == http.StatusNotModified {
  46528. if res.Body != nil {
  46529. res.Body.Close()
  46530. }
  46531. return nil, &googleapi.Error{
  46532. Code: res.StatusCode,
  46533. Header: res.Header,
  46534. }
  46535. }
  46536. if err != nil {
  46537. return nil, err
  46538. }
  46539. defer googleapi.CloseBody(res)
  46540. if err := googleapi.CheckResponse(res); err != nil {
  46541. return nil, err
  46542. }
  46543. ret := &DiskAggregatedList{
  46544. ServerResponse: googleapi.ServerResponse{
  46545. Header: res.Header,
  46546. HTTPStatusCode: res.StatusCode,
  46547. },
  46548. }
  46549. target := &ret
  46550. if err := gensupport.DecodeResponse(target, res); err != nil {
  46551. return nil, err
  46552. }
  46553. return ret, nil
  46554. // {
  46555. // "description": "Retrieves an aggregated list of persistent disks.",
  46556. // "httpMethod": "GET",
  46557. // "id": "compute.disks.aggregatedList",
  46558. // "parameterOrder": [
  46559. // "project"
  46560. // ],
  46561. // "parameters": {
  46562. // "filter": {
  46563. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  46564. // "location": "query",
  46565. // "type": "string"
  46566. // },
  46567. // "maxResults": {
  46568. // "default": "500",
  46569. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46570. // "format": "uint32",
  46571. // "location": "query",
  46572. // "minimum": "0",
  46573. // "type": "integer"
  46574. // },
  46575. // "orderBy": {
  46576. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46577. // "location": "query",
  46578. // "type": "string"
  46579. // },
  46580. // "pageToken": {
  46581. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46582. // "location": "query",
  46583. // "type": "string"
  46584. // },
  46585. // "project": {
  46586. // "description": "Project ID for this request.",
  46587. // "location": "path",
  46588. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46589. // "required": true,
  46590. // "type": "string"
  46591. // }
  46592. // },
  46593. // "path": "{project}/aggregated/disks",
  46594. // "response": {
  46595. // "$ref": "DiskAggregatedList"
  46596. // },
  46597. // "scopes": [
  46598. // "https://www.googleapis.com/auth/cloud-platform",
  46599. // "https://www.googleapis.com/auth/compute",
  46600. // "https://www.googleapis.com/auth/compute.readonly"
  46601. // ]
  46602. // }
  46603. }
  46604. // Pages invokes f for each page of results.
  46605. // A non-nil error returned from f will halt the iteration.
  46606. // The provided context supersedes any context provided to the Context method.
  46607. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  46608. c.ctx_ = ctx
  46609. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46610. for {
  46611. x, err := c.Do()
  46612. if err != nil {
  46613. return err
  46614. }
  46615. if err := f(x); err != nil {
  46616. return err
  46617. }
  46618. if x.NextPageToken == "" {
  46619. return nil
  46620. }
  46621. c.PageToken(x.NextPageToken)
  46622. }
  46623. }
  46624. // method id "compute.disks.createSnapshot":
  46625. type DisksCreateSnapshotCall struct {
  46626. s *Service
  46627. project string
  46628. zone string
  46629. disk string
  46630. snapshot *Snapshot
  46631. urlParams_ gensupport.URLParams
  46632. ctx_ context.Context
  46633. header_ http.Header
  46634. }
  46635. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  46636. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  46637. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  46638. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46639. c.project = project
  46640. c.zone = zone
  46641. c.disk = disk
  46642. c.snapshot = snapshot
  46643. return c
  46644. }
  46645. // GuestFlush sets the optional parameter "guestFlush": [Input Only]
  46646. // Specifies to create an application consistent snapshot by informing
  46647. // the OS to prepare for the snapshot process. Currently only supported
  46648. // on Windows instances using the Volume Shadow Copy Service (VSS).
  46649. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  46650. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  46651. return c
  46652. }
  46653. // RequestId sets the optional parameter "requestId": An optional
  46654. // request ID to identify requests. Specify a unique request ID so that
  46655. // if you must retry your request, the server will know to ignore the
  46656. // request if it has already been completed.
  46657. //
  46658. // For example, consider a situation where you make an initial request
  46659. // and the request times out. If you make the request again with the
  46660. // same request ID, the server can check if original operation with the
  46661. // same request ID was received, and if so, will ignore the second
  46662. // request. This prevents clients from accidentally creating duplicate
  46663. // commitments.
  46664. //
  46665. // The request ID must be a valid UUID with the exception that zero UUID
  46666. // is not supported (00000000-0000-0000-0000-000000000000).
  46667. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  46668. c.urlParams_.Set("requestId", requestId)
  46669. return c
  46670. }
  46671. // Fields allows partial responses to be retrieved. See
  46672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46673. // for more information.
  46674. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  46675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46676. return c
  46677. }
  46678. // Context sets the context to be used in this call's Do method. Any
  46679. // pending HTTP request will be aborted if the provided context is
  46680. // canceled.
  46681. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  46682. c.ctx_ = ctx
  46683. return c
  46684. }
  46685. // Header returns an http.Header that can be modified by the caller to
  46686. // add HTTP headers to the request.
  46687. func (c *DisksCreateSnapshotCall) Header() http.Header {
  46688. if c.header_ == nil {
  46689. c.header_ = make(http.Header)
  46690. }
  46691. return c.header_
  46692. }
  46693. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  46694. reqHeaders := make(http.Header)
  46695. for k, v := range c.header_ {
  46696. reqHeaders[k] = v
  46697. }
  46698. reqHeaders.Set("User-Agent", c.s.userAgent())
  46699. var body io.Reader = nil
  46700. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  46701. if err != nil {
  46702. return nil, err
  46703. }
  46704. reqHeaders.Set("Content-Type", "application/json")
  46705. c.urlParams_.Set("alt", alt)
  46706. c.urlParams_.Set("prettyPrint", "false")
  46707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  46708. urls += "?" + c.urlParams_.Encode()
  46709. req, err := http.NewRequest("POST", urls, body)
  46710. if err != nil {
  46711. return nil, err
  46712. }
  46713. req.Header = reqHeaders
  46714. googleapi.Expand(req.URL, map[string]string{
  46715. "project": c.project,
  46716. "zone": c.zone,
  46717. "disk": c.disk,
  46718. })
  46719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46720. }
  46721. // Do executes the "compute.disks.createSnapshot" call.
  46722. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46723. // status code is an error. Response headers are in either
  46724. // *Operation.ServerResponse.Header or (if a response was returned at
  46725. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46726. // to check whether the returned error was because
  46727. // http.StatusNotModified was returned.
  46728. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46729. gensupport.SetOptions(c.urlParams_, opts...)
  46730. res, err := c.doRequest("json")
  46731. if res != nil && res.StatusCode == http.StatusNotModified {
  46732. if res.Body != nil {
  46733. res.Body.Close()
  46734. }
  46735. return nil, &googleapi.Error{
  46736. Code: res.StatusCode,
  46737. Header: res.Header,
  46738. }
  46739. }
  46740. if err != nil {
  46741. return nil, err
  46742. }
  46743. defer googleapi.CloseBody(res)
  46744. if err := googleapi.CheckResponse(res); err != nil {
  46745. return nil, err
  46746. }
  46747. ret := &Operation{
  46748. ServerResponse: googleapi.ServerResponse{
  46749. Header: res.Header,
  46750. HTTPStatusCode: res.StatusCode,
  46751. },
  46752. }
  46753. target := &ret
  46754. if err := gensupport.DecodeResponse(target, res); err != nil {
  46755. return nil, err
  46756. }
  46757. return ret, nil
  46758. // {
  46759. // "description": "Creates a snapshot of a specified persistent disk.",
  46760. // "httpMethod": "POST",
  46761. // "id": "compute.disks.createSnapshot",
  46762. // "parameterOrder": [
  46763. // "project",
  46764. // "zone",
  46765. // "disk"
  46766. // ],
  46767. // "parameters": {
  46768. // "disk": {
  46769. // "description": "Name of the persistent disk to snapshot.",
  46770. // "location": "path",
  46771. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46772. // "required": true,
  46773. // "type": "string"
  46774. // },
  46775. // "guestFlush": {
  46776. // "description": "[Input Only] Specifies to create an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).",
  46777. // "location": "query",
  46778. // "type": "boolean"
  46779. // },
  46780. // "project": {
  46781. // "description": "Project ID for this request.",
  46782. // "location": "path",
  46783. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46784. // "required": true,
  46785. // "type": "string"
  46786. // },
  46787. // "requestId": {
  46788. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46789. // "location": "query",
  46790. // "type": "string"
  46791. // },
  46792. // "zone": {
  46793. // "description": "The name of the zone for this request.",
  46794. // "location": "path",
  46795. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46796. // "required": true,
  46797. // "type": "string"
  46798. // }
  46799. // },
  46800. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  46801. // "request": {
  46802. // "$ref": "Snapshot"
  46803. // },
  46804. // "response": {
  46805. // "$ref": "Operation"
  46806. // },
  46807. // "scopes": [
  46808. // "https://www.googleapis.com/auth/cloud-platform",
  46809. // "https://www.googleapis.com/auth/compute"
  46810. // ]
  46811. // }
  46812. }
  46813. // method id "compute.disks.delete":
  46814. type DisksDeleteCall struct {
  46815. s *Service
  46816. project string
  46817. zone string
  46818. disk string
  46819. urlParams_ gensupport.URLParams
  46820. ctx_ context.Context
  46821. header_ http.Header
  46822. }
  46823. // Delete: Deletes the specified persistent disk. Deleting a disk
  46824. // removes its data permanently and is irreversible. However, deleting a
  46825. // disk does not delete any snapshots previously made from the disk. You
  46826. // must separately delete snapshots.
  46827. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  46828. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  46829. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46830. c.project = project
  46831. c.zone = zone
  46832. c.disk = disk
  46833. return c
  46834. }
  46835. // RequestId sets the optional parameter "requestId": An optional
  46836. // request ID to identify requests. Specify a unique request ID so that
  46837. // if you must retry your request, the server will know to ignore the
  46838. // request if it has already been completed.
  46839. //
  46840. // For example, consider a situation where you make an initial request
  46841. // and the request times out. If you make the request again with the
  46842. // same request ID, the server can check if original operation with the
  46843. // same request ID was received, and if so, will ignore the second
  46844. // request. This prevents clients from accidentally creating duplicate
  46845. // commitments.
  46846. //
  46847. // The request ID must be a valid UUID with the exception that zero UUID
  46848. // is not supported (00000000-0000-0000-0000-000000000000).
  46849. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  46850. c.urlParams_.Set("requestId", requestId)
  46851. return c
  46852. }
  46853. // Fields allows partial responses to be retrieved. See
  46854. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46855. // for more information.
  46856. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  46857. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46858. return c
  46859. }
  46860. // Context sets the context to be used in this call's Do method. Any
  46861. // pending HTTP request will be aborted if the provided context is
  46862. // canceled.
  46863. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  46864. c.ctx_ = ctx
  46865. return c
  46866. }
  46867. // Header returns an http.Header that can be modified by the caller to
  46868. // add HTTP headers to the request.
  46869. func (c *DisksDeleteCall) Header() http.Header {
  46870. if c.header_ == nil {
  46871. c.header_ = make(http.Header)
  46872. }
  46873. return c.header_
  46874. }
  46875. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  46876. reqHeaders := make(http.Header)
  46877. for k, v := range c.header_ {
  46878. reqHeaders[k] = v
  46879. }
  46880. reqHeaders.Set("User-Agent", c.s.userAgent())
  46881. var body io.Reader = nil
  46882. c.urlParams_.Set("alt", alt)
  46883. c.urlParams_.Set("prettyPrint", "false")
  46884. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  46885. urls += "?" + c.urlParams_.Encode()
  46886. req, err := http.NewRequest("DELETE", urls, body)
  46887. if err != nil {
  46888. return nil, err
  46889. }
  46890. req.Header = reqHeaders
  46891. googleapi.Expand(req.URL, map[string]string{
  46892. "project": c.project,
  46893. "zone": c.zone,
  46894. "disk": c.disk,
  46895. })
  46896. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46897. }
  46898. // Do executes the "compute.disks.delete" call.
  46899. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46900. // status code is an error. Response headers are in either
  46901. // *Operation.ServerResponse.Header or (if a response was returned at
  46902. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46903. // to check whether the returned error was because
  46904. // http.StatusNotModified was returned.
  46905. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46906. gensupport.SetOptions(c.urlParams_, opts...)
  46907. res, err := c.doRequest("json")
  46908. if res != nil && res.StatusCode == http.StatusNotModified {
  46909. if res.Body != nil {
  46910. res.Body.Close()
  46911. }
  46912. return nil, &googleapi.Error{
  46913. Code: res.StatusCode,
  46914. Header: res.Header,
  46915. }
  46916. }
  46917. if err != nil {
  46918. return nil, err
  46919. }
  46920. defer googleapi.CloseBody(res)
  46921. if err := googleapi.CheckResponse(res); err != nil {
  46922. return nil, err
  46923. }
  46924. ret := &Operation{
  46925. ServerResponse: googleapi.ServerResponse{
  46926. Header: res.Header,
  46927. HTTPStatusCode: res.StatusCode,
  46928. },
  46929. }
  46930. target := &ret
  46931. if err := gensupport.DecodeResponse(target, res); err != nil {
  46932. return nil, err
  46933. }
  46934. return ret, nil
  46935. // {
  46936. // "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.",
  46937. // "httpMethod": "DELETE",
  46938. // "id": "compute.disks.delete",
  46939. // "parameterOrder": [
  46940. // "project",
  46941. // "zone",
  46942. // "disk"
  46943. // ],
  46944. // "parameters": {
  46945. // "disk": {
  46946. // "description": "Name of the persistent disk to delete.",
  46947. // "location": "path",
  46948. // "required": true,
  46949. // "type": "string"
  46950. // },
  46951. // "project": {
  46952. // "description": "Project ID for this request.",
  46953. // "location": "path",
  46954. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46955. // "required": true,
  46956. // "type": "string"
  46957. // },
  46958. // "requestId": {
  46959. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46960. // "location": "query",
  46961. // "type": "string"
  46962. // },
  46963. // "zone": {
  46964. // "description": "The name of the zone for this request.",
  46965. // "location": "path",
  46966. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46967. // "required": true,
  46968. // "type": "string"
  46969. // }
  46970. // },
  46971. // "path": "{project}/zones/{zone}/disks/{disk}",
  46972. // "response": {
  46973. // "$ref": "Operation"
  46974. // },
  46975. // "scopes": [
  46976. // "https://www.googleapis.com/auth/cloud-platform",
  46977. // "https://www.googleapis.com/auth/compute"
  46978. // ]
  46979. // }
  46980. }
  46981. // method id "compute.disks.get":
  46982. type DisksGetCall struct {
  46983. s *Service
  46984. project string
  46985. zone string
  46986. disk string
  46987. urlParams_ gensupport.URLParams
  46988. ifNoneMatch_ string
  46989. ctx_ context.Context
  46990. header_ http.Header
  46991. }
  46992. // Get: Returns a specified persistent disk. Gets a list of available
  46993. // persistent disks by making a list() request.
  46994. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  46995. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  46996. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46997. c.project = project
  46998. c.zone = zone
  46999. c.disk = disk
  47000. return c
  47001. }
  47002. // Fields allows partial responses to be retrieved. See
  47003. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47004. // for more information.
  47005. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  47006. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47007. return c
  47008. }
  47009. // IfNoneMatch sets the optional parameter which makes the operation
  47010. // fail if the object's ETag matches the given value. This is useful for
  47011. // getting updates only after the object has changed since the last
  47012. // request. Use googleapi.IsNotModified to check whether the response
  47013. // error from Do is the result of In-None-Match.
  47014. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  47015. c.ifNoneMatch_ = entityTag
  47016. return c
  47017. }
  47018. // Context sets the context to be used in this call's Do method. Any
  47019. // pending HTTP request will be aborted if the provided context is
  47020. // canceled.
  47021. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  47022. c.ctx_ = ctx
  47023. return c
  47024. }
  47025. // Header returns an http.Header that can be modified by the caller to
  47026. // add HTTP headers to the request.
  47027. func (c *DisksGetCall) Header() http.Header {
  47028. if c.header_ == nil {
  47029. c.header_ = make(http.Header)
  47030. }
  47031. return c.header_
  47032. }
  47033. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  47034. reqHeaders := make(http.Header)
  47035. for k, v := range c.header_ {
  47036. reqHeaders[k] = v
  47037. }
  47038. reqHeaders.Set("User-Agent", c.s.userAgent())
  47039. if c.ifNoneMatch_ != "" {
  47040. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47041. }
  47042. var body io.Reader = nil
  47043. c.urlParams_.Set("alt", alt)
  47044. c.urlParams_.Set("prettyPrint", "false")
  47045. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  47046. urls += "?" + c.urlParams_.Encode()
  47047. req, err := http.NewRequest("GET", urls, body)
  47048. if err != nil {
  47049. return nil, err
  47050. }
  47051. req.Header = reqHeaders
  47052. googleapi.Expand(req.URL, map[string]string{
  47053. "project": c.project,
  47054. "zone": c.zone,
  47055. "disk": c.disk,
  47056. })
  47057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47058. }
  47059. // Do executes the "compute.disks.get" call.
  47060. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  47061. // code is an error. Response headers are in either
  47062. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  47063. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  47064. // whether the returned error was because http.StatusNotModified was
  47065. // returned.
  47066. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  47067. gensupport.SetOptions(c.urlParams_, opts...)
  47068. res, err := c.doRequest("json")
  47069. if res != nil && res.StatusCode == http.StatusNotModified {
  47070. if res.Body != nil {
  47071. res.Body.Close()
  47072. }
  47073. return nil, &googleapi.Error{
  47074. Code: res.StatusCode,
  47075. Header: res.Header,
  47076. }
  47077. }
  47078. if err != nil {
  47079. return nil, err
  47080. }
  47081. defer googleapi.CloseBody(res)
  47082. if err := googleapi.CheckResponse(res); err != nil {
  47083. return nil, err
  47084. }
  47085. ret := &Disk{
  47086. ServerResponse: googleapi.ServerResponse{
  47087. Header: res.Header,
  47088. HTTPStatusCode: res.StatusCode,
  47089. },
  47090. }
  47091. target := &ret
  47092. if err := gensupport.DecodeResponse(target, res); err != nil {
  47093. return nil, err
  47094. }
  47095. return ret, nil
  47096. // {
  47097. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  47098. // "httpMethod": "GET",
  47099. // "id": "compute.disks.get",
  47100. // "parameterOrder": [
  47101. // "project",
  47102. // "zone",
  47103. // "disk"
  47104. // ],
  47105. // "parameters": {
  47106. // "disk": {
  47107. // "description": "Name of the persistent disk to return.",
  47108. // "location": "path",
  47109. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  47110. // "required": true,
  47111. // "type": "string"
  47112. // },
  47113. // "project": {
  47114. // "description": "Project ID for this request.",
  47115. // "location": "path",
  47116. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47117. // "required": true,
  47118. // "type": "string"
  47119. // },
  47120. // "zone": {
  47121. // "description": "The name of the zone for this request.",
  47122. // "location": "path",
  47123. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47124. // "required": true,
  47125. // "type": "string"
  47126. // }
  47127. // },
  47128. // "path": "{project}/zones/{zone}/disks/{disk}",
  47129. // "response": {
  47130. // "$ref": "Disk"
  47131. // },
  47132. // "scopes": [
  47133. // "https://www.googleapis.com/auth/cloud-platform",
  47134. // "https://www.googleapis.com/auth/compute",
  47135. // "https://www.googleapis.com/auth/compute.readonly"
  47136. // ]
  47137. // }
  47138. }
  47139. // method id "compute.disks.getIamPolicy":
  47140. type DisksGetIamPolicyCall struct {
  47141. s *Service
  47142. project string
  47143. zone string
  47144. resource string
  47145. urlParams_ gensupport.URLParams
  47146. ifNoneMatch_ string
  47147. ctx_ context.Context
  47148. header_ http.Header
  47149. }
  47150. // GetIamPolicy: Gets the access control policy for a resource. May be
  47151. // empty if no such policy or resource exists.
  47152. func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
  47153. c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47154. c.project = project
  47155. c.zone = zone
  47156. c.resource = resource
  47157. return c
  47158. }
  47159. // Fields allows partial responses to be retrieved. See
  47160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47161. // for more information.
  47162. func (c *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
  47163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47164. return c
  47165. }
  47166. // IfNoneMatch sets the optional parameter which makes the operation
  47167. // fail if the object's ETag matches the given value. This is useful for
  47168. // getting updates only after the object has changed since the last
  47169. // request. Use googleapi.IsNotModified to check whether the response
  47170. // error from Do is the result of In-None-Match.
  47171. func (c *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
  47172. c.ifNoneMatch_ = entityTag
  47173. return c
  47174. }
  47175. // Context sets the context to be used in this call's Do method. Any
  47176. // pending HTTP request will be aborted if the provided context is
  47177. // canceled.
  47178. func (c *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
  47179. c.ctx_ = ctx
  47180. return c
  47181. }
  47182. // Header returns an http.Header that can be modified by the caller to
  47183. // add HTTP headers to the request.
  47184. func (c *DisksGetIamPolicyCall) Header() http.Header {
  47185. if c.header_ == nil {
  47186. c.header_ = make(http.Header)
  47187. }
  47188. return c.header_
  47189. }
  47190. func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  47191. reqHeaders := make(http.Header)
  47192. for k, v := range c.header_ {
  47193. reqHeaders[k] = v
  47194. }
  47195. reqHeaders.Set("User-Agent", c.s.userAgent())
  47196. if c.ifNoneMatch_ != "" {
  47197. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47198. }
  47199. var body io.Reader = nil
  47200. c.urlParams_.Set("alt", alt)
  47201. c.urlParams_.Set("prettyPrint", "false")
  47202. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/getIamPolicy")
  47203. urls += "?" + c.urlParams_.Encode()
  47204. req, err := http.NewRequest("GET", urls, body)
  47205. if err != nil {
  47206. return nil, err
  47207. }
  47208. req.Header = reqHeaders
  47209. googleapi.Expand(req.URL, map[string]string{
  47210. "project": c.project,
  47211. "zone": c.zone,
  47212. "resource": c.resource,
  47213. })
  47214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47215. }
  47216. // Do executes the "compute.disks.getIamPolicy" call.
  47217. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  47218. // code is an error. Response headers are in either
  47219. // *Policy.ServerResponse.Header or (if a response was returned at all)
  47220. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  47221. // check whether the returned error was because http.StatusNotModified
  47222. // was returned.
  47223. func (c *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  47224. gensupport.SetOptions(c.urlParams_, opts...)
  47225. res, err := c.doRequest("json")
  47226. if res != nil && res.StatusCode == http.StatusNotModified {
  47227. if res.Body != nil {
  47228. res.Body.Close()
  47229. }
  47230. return nil, &googleapi.Error{
  47231. Code: res.StatusCode,
  47232. Header: res.Header,
  47233. }
  47234. }
  47235. if err != nil {
  47236. return nil, err
  47237. }
  47238. defer googleapi.CloseBody(res)
  47239. if err := googleapi.CheckResponse(res); err != nil {
  47240. return nil, err
  47241. }
  47242. ret := &Policy{
  47243. ServerResponse: googleapi.ServerResponse{
  47244. Header: res.Header,
  47245. HTTPStatusCode: res.StatusCode,
  47246. },
  47247. }
  47248. target := &ret
  47249. if err := gensupport.DecodeResponse(target, res); err != nil {
  47250. return nil, err
  47251. }
  47252. return ret, nil
  47253. // {
  47254. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  47255. // "httpMethod": "GET",
  47256. // "id": "compute.disks.getIamPolicy",
  47257. // "parameterOrder": [
  47258. // "project",
  47259. // "zone",
  47260. // "resource"
  47261. // ],
  47262. // "parameters": {
  47263. // "project": {
  47264. // "description": "Project ID for this request.",
  47265. // "location": "path",
  47266. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47267. // "required": true,
  47268. // "type": "string"
  47269. // },
  47270. // "resource": {
  47271. // "description": "Name or id of the resource for this request.",
  47272. // "location": "path",
  47273. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  47274. // "required": true,
  47275. // "type": "string"
  47276. // },
  47277. // "zone": {
  47278. // "description": "The name of the zone for this request.",
  47279. // "location": "path",
  47280. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47281. // "required": true,
  47282. // "type": "string"
  47283. // }
  47284. // },
  47285. // "path": "{project}/zones/{zone}/disks/{resource}/getIamPolicy",
  47286. // "response": {
  47287. // "$ref": "Policy"
  47288. // },
  47289. // "scopes": [
  47290. // "https://www.googleapis.com/auth/cloud-platform",
  47291. // "https://www.googleapis.com/auth/compute",
  47292. // "https://www.googleapis.com/auth/compute.readonly"
  47293. // ]
  47294. // }
  47295. }
  47296. // method id "compute.disks.insert":
  47297. type DisksInsertCall struct {
  47298. s *Service
  47299. project string
  47300. zone string
  47301. disk *Disk
  47302. urlParams_ gensupport.URLParams
  47303. ctx_ context.Context
  47304. header_ http.Header
  47305. }
  47306. // Insert: Creates a persistent disk in the specified project using the
  47307. // data in the request. You can create a disk with a sourceImage, a
  47308. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  47309. // properties. You can also create a disk that is larger than the
  47310. // default size by specifying the sizeGb property.
  47311. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  47312. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  47313. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47314. c.project = project
  47315. c.zone = zone
  47316. c.disk = disk
  47317. return c
  47318. }
  47319. // RequestId sets the optional parameter "requestId": An optional
  47320. // request ID to identify requests. Specify a unique request ID so that
  47321. // if you must retry your request, the server will know to ignore the
  47322. // request if it has already been completed.
  47323. //
  47324. // For example, consider a situation where you make an initial request
  47325. // and the request times out. If you make the request again with the
  47326. // same request ID, the server can check if original operation with the
  47327. // same request ID was received, and if so, will ignore the second
  47328. // request. This prevents clients from accidentally creating duplicate
  47329. // commitments.
  47330. //
  47331. // The request ID must be a valid UUID with the exception that zero UUID
  47332. // is not supported (00000000-0000-0000-0000-000000000000).
  47333. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  47334. c.urlParams_.Set("requestId", requestId)
  47335. return c
  47336. }
  47337. // SourceImage sets the optional parameter "sourceImage": Source image
  47338. // to restore onto a disk.
  47339. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  47340. c.urlParams_.Set("sourceImage", sourceImage)
  47341. return c
  47342. }
  47343. // Fields allows partial responses to be retrieved. See
  47344. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47345. // for more information.
  47346. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  47347. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47348. return c
  47349. }
  47350. // Context sets the context to be used in this call's Do method. Any
  47351. // pending HTTP request will be aborted if the provided context is
  47352. // canceled.
  47353. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  47354. c.ctx_ = ctx
  47355. return c
  47356. }
  47357. // Header returns an http.Header that can be modified by the caller to
  47358. // add HTTP headers to the request.
  47359. func (c *DisksInsertCall) Header() http.Header {
  47360. if c.header_ == nil {
  47361. c.header_ = make(http.Header)
  47362. }
  47363. return c.header_
  47364. }
  47365. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  47366. reqHeaders := make(http.Header)
  47367. for k, v := range c.header_ {
  47368. reqHeaders[k] = v
  47369. }
  47370. reqHeaders.Set("User-Agent", c.s.userAgent())
  47371. var body io.Reader = nil
  47372. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  47373. if err != nil {
  47374. return nil, err
  47375. }
  47376. reqHeaders.Set("Content-Type", "application/json")
  47377. c.urlParams_.Set("alt", alt)
  47378. c.urlParams_.Set("prettyPrint", "false")
  47379. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  47380. urls += "?" + c.urlParams_.Encode()
  47381. req, err := http.NewRequest("POST", urls, body)
  47382. if err != nil {
  47383. return nil, err
  47384. }
  47385. req.Header = reqHeaders
  47386. googleapi.Expand(req.URL, map[string]string{
  47387. "project": c.project,
  47388. "zone": c.zone,
  47389. })
  47390. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47391. }
  47392. // Do executes the "compute.disks.insert" call.
  47393. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47394. // status code is an error. Response headers are in either
  47395. // *Operation.ServerResponse.Header or (if a response was returned at
  47396. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47397. // to check whether the returned error was because
  47398. // http.StatusNotModified was returned.
  47399. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47400. gensupport.SetOptions(c.urlParams_, opts...)
  47401. res, err := c.doRequest("json")
  47402. if res != nil && res.StatusCode == http.StatusNotModified {
  47403. if res.Body != nil {
  47404. res.Body.Close()
  47405. }
  47406. return nil, &googleapi.Error{
  47407. Code: res.StatusCode,
  47408. Header: res.Header,
  47409. }
  47410. }
  47411. if err != nil {
  47412. return nil, err
  47413. }
  47414. defer googleapi.CloseBody(res)
  47415. if err := googleapi.CheckResponse(res); err != nil {
  47416. return nil, err
  47417. }
  47418. ret := &Operation{
  47419. ServerResponse: googleapi.ServerResponse{
  47420. Header: res.Header,
  47421. HTTPStatusCode: res.StatusCode,
  47422. },
  47423. }
  47424. target := &ret
  47425. if err := gensupport.DecodeResponse(target, res); err != nil {
  47426. return nil, err
  47427. }
  47428. return ret, nil
  47429. // {
  47430. // "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.",
  47431. // "httpMethod": "POST",
  47432. // "id": "compute.disks.insert",
  47433. // "parameterOrder": [
  47434. // "project",
  47435. // "zone"
  47436. // ],
  47437. // "parameters": {
  47438. // "project": {
  47439. // "description": "Project ID for this request.",
  47440. // "location": "path",
  47441. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47442. // "required": true,
  47443. // "type": "string"
  47444. // },
  47445. // "requestId": {
  47446. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47447. // "location": "query",
  47448. // "type": "string"
  47449. // },
  47450. // "sourceImage": {
  47451. // "description": "Optional. Source image to restore onto a disk.",
  47452. // "location": "query",
  47453. // "type": "string"
  47454. // },
  47455. // "zone": {
  47456. // "description": "The name of the zone for this request.",
  47457. // "location": "path",
  47458. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47459. // "required": true,
  47460. // "type": "string"
  47461. // }
  47462. // },
  47463. // "path": "{project}/zones/{zone}/disks",
  47464. // "request": {
  47465. // "$ref": "Disk"
  47466. // },
  47467. // "response": {
  47468. // "$ref": "Operation"
  47469. // },
  47470. // "scopes": [
  47471. // "https://www.googleapis.com/auth/cloud-platform",
  47472. // "https://www.googleapis.com/auth/compute"
  47473. // ]
  47474. // }
  47475. }
  47476. // method id "compute.disks.list":
  47477. type DisksListCall struct {
  47478. s *Service
  47479. project string
  47480. zone string
  47481. urlParams_ gensupport.URLParams
  47482. ifNoneMatch_ string
  47483. ctx_ context.Context
  47484. header_ http.Header
  47485. }
  47486. // List: Retrieves a list of persistent disks contained within the
  47487. // specified zone.
  47488. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  47489. func (r *DisksService) List(project string, zone string) *DisksListCall {
  47490. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47491. c.project = project
  47492. c.zone = zone
  47493. return c
  47494. }
  47495. // Filter sets the optional parameter "filter": A filter expression that
  47496. // filters resources listed in the response. The expression must specify
  47497. // the field name, a comparison operator, and the value that you want to
  47498. // use for filtering. The value must be a string, a number, or a
  47499. // boolean. The comparison operator must be either =, !=, >, or <.
  47500. //
  47501. // For example, if you are filtering Compute Engine instances, you can
  47502. // exclude instances named example-instance by specifying name !=
  47503. // example-instance.
  47504. //
  47505. // You can also filter nested fields. For example, you could specify
  47506. // scheduling.automaticRestart = false to include instances only if they
  47507. // are not scheduled for automatic restarts. You can use filtering on
  47508. // nested fields to filter based on resource labels.
  47509. //
  47510. // To filter on multiple expressions, provide each separate expression
  47511. // within parentheses. For example, (scheduling.automaticRestart = true)
  47512. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47513. // AND expression. However, you can include AND and OR expressions
  47514. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47515. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47516. // true).
  47517. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  47518. c.urlParams_.Set("filter", filter)
  47519. return c
  47520. }
  47521. // MaxResults sets the optional parameter "maxResults": The maximum
  47522. // number of results per page that should be returned. If the number of
  47523. // available results is larger than maxResults, Compute Engine returns a
  47524. // nextPageToken that can be used to get the next page of results in
  47525. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47526. // (Default: 500)
  47527. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  47528. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47529. return c
  47530. }
  47531. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47532. // a certain order. By default, results are returned in alphanumerical
  47533. // order based on the resource name.
  47534. //
  47535. // You can also sort results in descending order based on the creation
  47536. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47537. // based on the creationTimestamp field in reverse chronological order
  47538. // (newest result first). Use this to sort resources like operations so
  47539. // that the newest operation is returned first.
  47540. //
  47541. // Currently, only sorting by name or creationTimestamp desc is
  47542. // supported.
  47543. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  47544. c.urlParams_.Set("orderBy", orderBy)
  47545. return c
  47546. }
  47547. // PageToken sets the optional parameter "pageToken": Specifies a page
  47548. // token to use. Set pageToken to the nextPageToken returned by a
  47549. // previous list request to get the next page of results.
  47550. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  47551. c.urlParams_.Set("pageToken", pageToken)
  47552. return c
  47553. }
  47554. // Fields allows partial responses to be retrieved. See
  47555. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47556. // for more information.
  47557. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  47558. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47559. return c
  47560. }
  47561. // IfNoneMatch sets the optional parameter which makes the operation
  47562. // fail if the object's ETag matches the given value. This is useful for
  47563. // getting updates only after the object has changed since the last
  47564. // request. Use googleapi.IsNotModified to check whether the response
  47565. // error from Do is the result of In-None-Match.
  47566. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  47567. c.ifNoneMatch_ = entityTag
  47568. return c
  47569. }
  47570. // Context sets the context to be used in this call's Do method. Any
  47571. // pending HTTP request will be aborted if the provided context is
  47572. // canceled.
  47573. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  47574. c.ctx_ = ctx
  47575. return c
  47576. }
  47577. // Header returns an http.Header that can be modified by the caller to
  47578. // add HTTP headers to the request.
  47579. func (c *DisksListCall) Header() http.Header {
  47580. if c.header_ == nil {
  47581. c.header_ = make(http.Header)
  47582. }
  47583. return c.header_
  47584. }
  47585. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  47586. reqHeaders := make(http.Header)
  47587. for k, v := range c.header_ {
  47588. reqHeaders[k] = v
  47589. }
  47590. reqHeaders.Set("User-Agent", c.s.userAgent())
  47591. if c.ifNoneMatch_ != "" {
  47592. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47593. }
  47594. var body io.Reader = nil
  47595. c.urlParams_.Set("alt", alt)
  47596. c.urlParams_.Set("prettyPrint", "false")
  47597. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  47598. urls += "?" + c.urlParams_.Encode()
  47599. req, err := http.NewRequest("GET", urls, body)
  47600. if err != nil {
  47601. return nil, err
  47602. }
  47603. req.Header = reqHeaders
  47604. googleapi.Expand(req.URL, map[string]string{
  47605. "project": c.project,
  47606. "zone": c.zone,
  47607. })
  47608. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47609. }
  47610. // Do executes the "compute.disks.list" call.
  47611. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  47612. // code is an error. Response headers are in either
  47613. // *DiskList.ServerResponse.Header or (if a response was returned at
  47614. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47615. // to check whether the returned error was because
  47616. // http.StatusNotModified was returned.
  47617. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  47618. gensupport.SetOptions(c.urlParams_, opts...)
  47619. res, err := c.doRequest("json")
  47620. if res != nil && res.StatusCode == http.StatusNotModified {
  47621. if res.Body != nil {
  47622. res.Body.Close()
  47623. }
  47624. return nil, &googleapi.Error{
  47625. Code: res.StatusCode,
  47626. Header: res.Header,
  47627. }
  47628. }
  47629. if err != nil {
  47630. return nil, err
  47631. }
  47632. defer googleapi.CloseBody(res)
  47633. if err := googleapi.CheckResponse(res); err != nil {
  47634. return nil, err
  47635. }
  47636. ret := &DiskList{
  47637. ServerResponse: googleapi.ServerResponse{
  47638. Header: res.Header,
  47639. HTTPStatusCode: res.StatusCode,
  47640. },
  47641. }
  47642. target := &ret
  47643. if err := gensupport.DecodeResponse(target, res); err != nil {
  47644. return nil, err
  47645. }
  47646. return ret, nil
  47647. // {
  47648. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  47649. // "httpMethod": "GET",
  47650. // "id": "compute.disks.list",
  47651. // "parameterOrder": [
  47652. // "project",
  47653. // "zone"
  47654. // ],
  47655. // "parameters": {
  47656. // "filter": {
  47657. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  47658. // "location": "query",
  47659. // "type": "string"
  47660. // },
  47661. // "maxResults": {
  47662. // "default": "500",
  47663. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  47664. // "format": "uint32",
  47665. // "location": "query",
  47666. // "minimum": "0",
  47667. // "type": "integer"
  47668. // },
  47669. // "orderBy": {
  47670. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  47671. // "location": "query",
  47672. // "type": "string"
  47673. // },
  47674. // "pageToken": {
  47675. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  47676. // "location": "query",
  47677. // "type": "string"
  47678. // },
  47679. // "project": {
  47680. // "description": "Project ID for this request.",
  47681. // "location": "path",
  47682. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47683. // "required": true,
  47684. // "type": "string"
  47685. // },
  47686. // "zone": {
  47687. // "description": "The name of the zone for this request.",
  47688. // "location": "path",
  47689. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47690. // "required": true,
  47691. // "type": "string"
  47692. // }
  47693. // },
  47694. // "path": "{project}/zones/{zone}/disks",
  47695. // "response": {
  47696. // "$ref": "DiskList"
  47697. // },
  47698. // "scopes": [
  47699. // "https://www.googleapis.com/auth/cloud-platform",
  47700. // "https://www.googleapis.com/auth/compute",
  47701. // "https://www.googleapis.com/auth/compute.readonly"
  47702. // ]
  47703. // }
  47704. }
  47705. // Pages invokes f for each page of results.
  47706. // A non-nil error returned from f will halt the iteration.
  47707. // The provided context supersedes any context provided to the Context method.
  47708. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  47709. c.ctx_ = ctx
  47710. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47711. for {
  47712. x, err := c.Do()
  47713. if err != nil {
  47714. return err
  47715. }
  47716. if err := f(x); err != nil {
  47717. return err
  47718. }
  47719. if x.NextPageToken == "" {
  47720. return nil
  47721. }
  47722. c.PageToken(x.NextPageToken)
  47723. }
  47724. }
  47725. // method id "compute.disks.removeResourcePolicies":
  47726. type DisksRemoveResourcePoliciesCall struct {
  47727. s *Service
  47728. project string
  47729. zone string
  47730. disk string
  47731. disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest
  47732. urlParams_ gensupport.URLParams
  47733. ctx_ context.Context
  47734. header_ http.Header
  47735. }
  47736. // RemoveResourcePolicies: Removes resource policies from a disk.
  47737. func (r *DisksService) RemoveResourcePolicies(project string, zone string, disk string, disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest) *DisksRemoveResourcePoliciesCall {
  47738. c := &DisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47739. c.project = project
  47740. c.zone = zone
  47741. c.disk = disk
  47742. c.disksremoveresourcepoliciesrequest = disksremoveresourcepoliciesrequest
  47743. return c
  47744. }
  47745. // RequestId sets the optional parameter "requestId": An optional
  47746. // request ID to identify requests. Specify a unique request ID so that
  47747. // if you must retry your request, the server will know to ignore the
  47748. // request if it has already been completed.
  47749. //
  47750. // For example, consider a situation where you make an initial request
  47751. // and the request times out. If you make the request again with the
  47752. // same request ID, the server can check if original operation with the
  47753. // same request ID was received, and if so, will ignore the second
  47754. // request. This prevents clients from accidentally creating duplicate
  47755. // commitments.
  47756. //
  47757. // The request ID must be a valid UUID with the exception that zero UUID
  47758. // is not supported (00000000-0000-0000-0000-000000000000).
  47759. func (c *DisksRemoveResourcePoliciesCall) RequestId(requestId string) *DisksRemoveResourcePoliciesCall {
  47760. c.urlParams_.Set("requestId", requestId)
  47761. return c
  47762. }
  47763. // Fields allows partial responses to be retrieved. See
  47764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47765. // for more information.
  47766. func (c *DisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksRemoveResourcePoliciesCall {
  47767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47768. return c
  47769. }
  47770. // Context sets the context to be used in this call's Do method. Any
  47771. // pending HTTP request will be aborted if the provided context is
  47772. // canceled.
  47773. func (c *DisksRemoveResourcePoliciesCall) Context(ctx context.Context) *DisksRemoveResourcePoliciesCall {
  47774. c.ctx_ = ctx
  47775. return c
  47776. }
  47777. // Header returns an http.Header that can be modified by the caller to
  47778. // add HTTP headers to the request.
  47779. func (c *DisksRemoveResourcePoliciesCall) Header() http.Header {
  47780. if c.header_ == nil {
  47781. c.header_ = make(http.Header)
  47782. }
  47783. return c.header_
  47784. }
  47785. func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  47786. reqHeaders := make(http.Header)
  47787. for k, v := range c.header_ {
  47788. reqHeaders[k] = v
  47789. }
  47790. reqHeaders.Set("User-Agent", c.s.userAgent())
  47791. var body io.Reader = nil
  47792. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest)
  47793. if err != nil {
  47794. return nil, err
  47795. }
  47796. reqHeaders.Set("Content-Type", "application/json")
  47797. c.urlParams_.Set("alt", alt)
  47798. c.urlParams_.Set("prettyPrint", "false")
  47799. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies")
  47800. urls += "?" + c.urlParams_.Encode()
  47801. req, err := http.NewRequest("POST", urls, body)
  47802. if err != nil {
  47803. return nil, err
  47804. }
  47805. req.Header = reqHeaders
  47806. googleapi.Expand(req.URL, map[string]string{
  47807. "project": c.project,
  47808. "zone": c.zone,
  47809. "disk": c.disk,
  47810. })
  47811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47812. }
  47813. // Do executes the "compute.disks.removeResourcePolicies" call.
  47814. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47815. // status code is an error. Response headers are in either
  47816. // *Operation.ServerResponse.Header or (if a response was returned at
  47817. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47818. // to check whether the returned error was because
  47819. // http.StatusNotModified was returned.
  47820. func (c *DisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47821. gensupport.SetOptions(c.urlParams_, opts...)
  47822. res, err := c.doRequest("json")
  47823. if res != nil && res.StatusCode == http.StatusNotModified {
  47824. if res.Body != nil {
  47825. res.Body.Close()
  47826. }
  47827. return nil, &googleapi.Error{
  47828. Code: res.StatusCode,
  47829. Header: res.Header,
  47830. }
  47831. }
  47832. if err != nil {
  47833. return nil, err
  47834. }
  47835. defer googleapi.CloseBody(res)
  47836. if err := googleapi.CheckResponse(res); err != nil {
  47837. return nil, err
  47838. }
  47839. ret := &Operation{
  47840. ServerResponse: googleapi.ServerResponse{
  47841. Header: res.Header,
  47842. HTTPStatusCode: res.StatusCode,
  47843. },
  47844. }
  47845. target := &ret
  47846. if err := gensupport.DecodeResponse(target, res); err != nil {
  47847. return nil, err
  47848. }
  47849. return ret, nil
  47850. // {
  47851. // "description": "Removes resource policies from a disk.",
  47852. // "httpMethod": "POST",
  47853. // "id": "compute.disks.removeResourcePolicies",
  47854. // "parameterOrder": [
  47855. // "project",
  47856. // "zone",
  47857. // "disk"
  47858. // ],
  47859. // "parameters": {
  47860. // "disk": {
  47861. // "description": "The disk name for this request.",
  47862. // "location": "path",
  47863. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  47864. // "required": true,
  47865. // "type": "string"
  47866. // },
  47867. // "project": {
  47868. // "description": "Project ID for this request.",
  47869. // "location": "path",
  47870. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47871. // "required": true,
  47872. // "type": "string"
  47873. // },
  47874. // "requestId": {
  47875. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47876. // "location": "query",
  47877. // "type": "string"
  47878. // },
  47879. // "zone": {
  47880. // "description": "The name of the zone for this request.",
  47881. // "location": "path",
  47882. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47883. // "required": true,
  47884. // "type": "string"
  47885. // }
  47886. // },
  47887. // "path": "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies",
  47888. // "request": {
  47889. // "$ref": "DisksRemoveResourcePoliciesRequest"
  47890. // },
  47891. // "response": {
  47892. // "$ref": "Operation"
  47893. // },
  47894. // "scopes": [
  47895. // "https://www.googleapis.com/auth/cloud-platform",
  47896. // "https://www.googleapis.com/auth/compute"
  47897. // ]
  47898. // }
  47899. }
  47900. // method id "compute.disks.resize":
  47901. type DisksResizeCall struct {
  47902. s *Service
  47903. project string
  47904. zone string
  47905. disk string
  47906. disksresizerequest *DisksResizeRequest
  47907. urlParams_ gensupport.URLParams
  47908. ctx_ context.Context
  47909. header_ http.Header
  47910. }
  47911. // Resize: Resizes the specified persistent disk. You can only increase
  47912. // the size of the disk.
  47913. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  47914. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47915. c.project = project
  47916. c.zone = zone
  47917. c.disk = disk
  47918. c.disksresizerequest = disksresizerequest
  47919. return c
  47920. }
  47921. // RequestId sets the optional parameter "requestId": An optional
  47922. // request ID to identify requests. Specify a unique request ID so that
  47923. // if you must retry your request, the server will know to ignore the
  47924. // request if it has already been completed.
  47925. //
  47926. // For example, consider a situation where you make an initial request
  47927. // and the request times out. If you make the request again with the
  47928. // same request ID, the server can check if original operation with the
  47929. // same request ID was received, and if so, will ignore the second
  47930. // request. This prevents clients from accidentally creating duplicate
  47931. // commitments.
  47932. //
  47933. // The request ID must be a valid UUID with the exception that zero UUID
  47934. // is not supported (00000000-0000-0000-0000-000000000000).
  47935. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  47936. c.urlParams_.Set("requestId", requestId)
  47937. return c
  47938. }
  47939. // Fields allows partial responses to be retrieved. See
  47940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47941. // for more information.
  47942. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  47943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47944. return c
  47945. }
  47946. // Context sets the context to be used in this call's Do method. Any
  47947. // pending HTTP request will be aborted if the provided context is
  47948. // canceled.
  47949. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  47950. c.ctx_ = ctx
  47951. return c
  47952. }
  47953. // Header returns an http.Header that can be modified by the caller to
  47954. // add HTTP headers to the request.
  47955. func (c *DisksResizeCall) Header() http.Header {
  47956. if c.header_ == nil {
  47957. c.header_ = make(http.Header)
  47958. }
  47959. return c.header_
  47960. }
  47961. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  47962. reqHeaders := make(http.Header)
  47963. for k, v := range c.header_ {
  47964. reqHeaders[k] = v
  47965. }
  47966. reqHeaders.Set("User-Agent", c.s.userAgent())
  47967. var body io.Reader = nil
  47968. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  47969. if err != nil {
  47970. return nil, err
  47971. }
  47972. reqHeaders.Set("Content-Type", "application/json")
  47973. c.urlParams_.Set("alt", alt)
  47974. c.urlParams_.Set("prettyPrint", "false")
  47975. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  47976. urls += "?" + c.urlParams_.Encode()
  47977. req, err := http.NewRequest("POST", urls, body)
  47978. if err != nil {
  47979. return nil, err
  47980. }
  47981. req.Header = reqHeaders
  47982. googleapi.Expand(req.URL, map[string]string{
  47983. "project": c.project,
  47984. "zone": c.zone,
  47985. "disk": c.disk,
  47986. })
  47987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47988. }
  47989. // Do executes the "compute.disks.resize" call.
  47990. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47991. // status code is an error. Response headers are in either
  47992. // *Operation.ServerResponse.Header or (if a response was returned at
  47993. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47994. // to check whether the returned error was because
  47995. // http.StatusNotModified was returned.
  47996. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47997. gensupport.SetOptions(c.urlParams_, opts...)
  47998. res, err := c.doRequest("json")
  47999. if res != nil && res.StatusCode == http.StatusNotModified {
  48000. if res.Body != nil {
  48001. res.Body.Close()
  48002. }
  48003. return nil, &googleapi.Error{
  48004. Code: res.StatusCode,
  48005. Header: res.Header,
  48006. }
  48007. }
  48008. if err != nil {
  48009. return nil, err
  48010. }
  48011. defer googleapi.CloseBody(res)
  48012. if err := googleapi.CheckResponse(res); err != nil {
  48013. return nil, err
  48014. }
  48015. ret := &Operation{
  48016. ServerResponse: googleapi.ServerResponse{
  48017. Header: res.Header,
  48018. HTTPStatusCode: res.StatusCode,
  48019. },
  48020. }
  48021. target := &ret
  48022. if err := gensupport.DecodeResponse(target, res); err != nil {
  48023. return nil, err
  48024. }
  48025. return ret, nil
  48026. // {
  48027. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  48028. // "httpMethod": "POST",
  48029. // "id": "compute.disks.resize",
  48030. // "parameterOrder": [
  48031. // "project",
  48032. // "zone",
  48033. // "disk"
  48034. // ],
  48035. // "parameters": {
  48036. // "disk": {
  48037. // "description": "The name of the persistent disk.",
  48038. // "location": "path",
  48039. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48040. // "required": true,
  48041. // "type": "string"
  48042. // },
  48043. // "project": {
  48044. // "description": "Project ID for this request.",
  48045. // "location": "path",
  48046. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48047. // "required": true,
  48048. // "type": "string"
  48049. // },
  48050. // "requestId": {
  48051. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48052. // "location": "query",
  48053. // "type": "string"
  48054. // },
  48055. // "zone": {
  48056. // "description": "The name of the zone for this request.",
  48057. // "location": "path",
  48058. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48059. // "required": true,
  48060. // "type": "string"
  48061. // }
  48062. // },
  48063. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  48064. // "request": {
  48065. // "$ref": "DisksResizeRequest"
  48066. // },
  48067. // "response": {
  48068. // "$ref": "Operation"
  48069. // },
  48070. // "scopes": [
  48071. // "https://www.googleapis.com/auth/cloud-platform",
  48072. // "https://www.googleapis.com/auth/compute"
  48073. // ]
  48074. // }
  48075. }
  48076. // method id "compute.disks.setIamPolicy":
  48077. type DisksSetIamPolicyCall struct {
  48078. s *Service
  48079. project string
  48080. zone string
  48081. resource string
  48082. zonesetpolicyrequest *ZoneSetPolicyRequest
  48083. urlParams_ gensupport.URLParams
  48084. ctx_ context.Context
  48085. header_ http.Header
  48086. }
  48087. // SetIamPolicy: Sets the access control policy on the specified
  48088. // resource. Replaces any existing policy.
  48089. func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
  48090. c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48091. c.project = project
  48092. c.zone = zone
  48093. c.resource = resource
  48094. c.zonesetpolicyrequest = zonesetpolicyrequest
  48095. return c
  48096. }
  48097. // Fields allows partial responses to be retrieved. See
  48098. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48099. // for more information.
  48100. func (c *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
  48101. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48102. return c
  48103. }
  48104. // Context sets the context to be used in this call's Do method. Any
  48105. // pending HTTP request will be aborted if the provided context is
  48106. // canceled.
  48107. func (c *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
  48108. c.ctx_ = ctx
  48109. return c
  48110. }
  48111. // Header returns an http.Header that can be modified by the caller to
  48112. // add HTTP headers to the request.
  48113. func (c *DisksSetIamPolicyCall) Header() http.Header {
  48114. if c.header_ == nil {
  48115. c.header_ = make(http.Header)
  48116. }
  48117. return c.header_
  48118. }
  48119. func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  48120. reqHeaders := make(http.Header)
  48121. for k, v := range c.header_ {
  48122. reqHeaders[k] = v
  48123. }
  48124. reqHeaders.Set("User-Agent", c.s.userAgent())
  48125. var body io.Reader = nil
  48126. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  48127. if err != nil {
  48128. return nil, err
  48129. }
  48130. reqHeaders.Set("Content-Type", "application/json")
  48131. c.urlParams_.Set("alt", alt)
  48132. c.urlParams_.Set("prettyPrint", "false")
  48133. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setIamPolicy")
  48134. urls += "?" + c.urlParams_.Encode()
  48135. req, err := http.NewRequest("POST", urls, body)
  48136. if err != nil {
  48137. return nil, err
  48138. }
  48139. req.Header = reqHeaders
  48140. googleapi.Expand(req.URL, map[string]string{
  48141. "project": c.project,
  48142. "zone": c.zone,
  48143. "resource": c.resource,
  48144. })
  48145. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48146. }
  48147. // Do executes the "compute.disks.setIamPolicy" call.
  48148. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  48149. // code is an error. Response headers are in either
  48150. // *Policy.ServerResponse.Header or (if a response was returned at all)
  48151. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  48152. // check whether the returned error was because http.StatusNotModified
  48153. // was returned.
  48154. func (c *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  48155. gensupport.SetOptions(c.urlParams_, opts...)
  48156. res, err := c.doRequest("json")
  48157. if res != nil && res.StatusCode == http.StatusNotModified {
  48158. if res.Body != nil {
  48159. res.Body.Close()
  48160. }
  48161. return nil, &googleapi.Error{
  48162. Code: res.StatusCode,
  48163. Header: res.Header,
  48164. }
  48165. }
  48166. if err != nil {
  48167. return nil, err
  48168. }
  48169. defer googleapi.CloseBody(res)
  48170. if err := googleapi.CheckResponse(res); err != nil {
  48171. return nil, err
  48172. }
  48173. ret := &Policy{
  48174. ServerResponse: googleapi.ServerResponse{
  48175. Header: res.Header,
  48176. HTTPStatusCode: res.StatusCode,
  48177. },
  48178. }
  48179. target := &ret
  48180. if err := gensupport.DecodeResponse(target, res); err != nil {
  48181. return nil, err
  48182. }
  48183. return ret, nil
  48184. // {
  48185. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  48186. // "httpMethod": "POST",
  48187. // "id": "compute.disks.setIamPolicy",
  48188. // "parameterOrder": [
  48189. // "project",
  48190. // "zone",
  48191. // "resource"
  48192. // ],
  48193. // "parameters": {
  48194. // "project": {
  48195. // "description": "Project ID for this request.",
  48196. // "location": "path",
  48197. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48198. // "required": true,
  48199. // "type": "string"
  48200. // },
  48201. // "resource": {
  48202. // "description": "Name or id of the resource for this request.",
  48203. // "location": "path",
  48204. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48205. // "required": true,
  48206. // "type": "string"
  48207. // },
  48208. // "zone": {
  48209. // "description": "The name of the zone for this request.",
  48210. // "location": "path",
  48211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48212. // "required": true,
  48213. // "type": "string"
  48214. // }
  48215. // },
  48216. // "path": "{project}/zones/{zone}/disks/{resource}/setIamPolicy",
  48217. // "request": {
  48218. // "$ref": "ZoneSetPolicyRequest"
  48219. // },
  48220. // "response": {
  48221. // "$ref": "Policy"
  48222. // },
  48223. // "scopes": [
  48224. // "https://www.googleapis.com/auth/cloud-platform",
  48225. // "https://www.googleapis.com/auth/compute"
  48226. // ]
  48227. // }
  48228. }
  48229. // method id "compute.disks.setLabels":
  48230. type DisksSetLabelsCall struct {
  48231. s *Service
  48232. project string
  48233. zone string
  48234. resource string
  48235. zonesetlabelsrequest *ZoneSetLabelsRequest
  48236. urlParams_ gensupport.URLParams
  48237. ctx_ context.Context
  48238. header_ http.Header
  48239. }
  48240. // SetLabels: Sets the labels on a disk. To learn more about labels,
  48241. // read the Labeling Resources documentation.
  48242. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  48243. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48244. c.project = project
  48245. c.zone = zone
  48246. c.resource = resource
  48247. c.zonesetlabelsrequest = zonesetlabelsrequest
  48248. return c
  48249. }
  48250. // RequestId sets the optional parameter "requestId": An optional
  48251. // request ID to identify requests. Specify a unique request ID so that
  48252. // if you must retry your request, the server will know to ignore the
  48253. // request if it has already been completed.
  48254. //
  48255. // For example, consider a situation where you make an initial request
  48256. // and the request times out. If you make the request again with the
  48257. // same request ID, the server can check if original operation with the
  48258. // same request ID was received, and if so, will ignore the second
  48259. // request. This prevents clients from accidentally creating duplicate
  48260. // commitments.
  48261. //
  48262. // The request ID must be a valid UUID with the exception that zero UUID
  48263. // is not supported (00000000-0000-0000-0000-000000000000).
  48264. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  48265. c.urlParams_.Set("requestId", requestId)
  48266. return c
  48267. }
  48268. // Fields allows partial responses to be retrieved. See
  48269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48270. // for more information.
  48271. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  48272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48273. return c
  48274. }
  48275. // Context sets the context to be used in this call's Do method. Any
  48276. // pending HTTP request will be aborted if the provided context is
  48277. // canceled.
  48278. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  48279. c.ctx_ = ctx
  48280. return c
  48281. }
  48282. // Header returns an http.Header that can be modified by the caller to
  48283. // add HTTP headers to the request.
  48284. func (c *DisksSetLabelsCall) Header() http.Header {
  48285. if c.header_ == nil {
  48286. c.header_ = make(http.Header)
  48287. }
  48288. return c.header_
  48289. }
  48290. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  48291. reqHeaders := make(http.Header)
  48292. for k, v := range c.header_ {
  48293. reqHeaders[k] = v
  48294. }
  48295. reqHeaders.Set("User-Agent", c.s.userAgent())
  48296. var body io.Reader = nil
  48297. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  48298. if err != nil {
  48299. return nil, err
  48300. }
  48301. reqHeaders.Set("Content-Type", "application/json")
  48302. c.urlParams_.Set("alt", alt)
  48303. c.urlParams_.Set("prettyPrint", "false")
  48304. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  48305. urls += "?" + c.urlParams_.Encode()
  48306. req, err := http.NewRequest("POST", urls, body)
  48307. if err != nil {
  48308. return nil, err
  48309. }
  48310. req.Header = reqHeaders
  48311. googleapi.Expand(req.URL, map[string]string{
  48312. "project": c.project,
  48313. "zone": c.zone,
  48314. "resource": c.resource,
  48315. })
  48316. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48317. }
  48318. // Do executes the "compute.disks.setLabels" call.
  48319. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48320. // status code is an error. Response headers are in either
  48321. // *Operation.ServerResponse.Header or (if a response was returned at
  48322. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48323. // to check whether the returned error was because
  48324. // http.StatusNotModified was returned.
  48325. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48326. gensupport.SetOptions(c.urlParams_, opts...)
  48327. res, err := c.doRequest("json")
  48328. if res != nil && res.StatusCode == http.StatusNotModified {
  48329. if res.Body != nil {
  48330. res.Body.Close()
  48331. }
  48332. return nil, &googleapi.Error{
  48333. Code: res.StatusCode,
  48334. Header: res.Header,
  48335. }
  48336. }
  48337. if err != nil {
  48338. return nil, err
  48339. }
  48340. defer googleapi.CloseBody(res)
  48341. if err := googleapi.CheckResponse(res); err != nil {
  48342. return nil, err
  48343. }
  48344. ret := &Operation{
  48345. ServerResponse: googleapi.ServerResponse{
  48346. Header: res.Header,
  48347. HTTPStatusCode: res.StatusCode,
  48348. },
  48349. }
  48350. target := &ret
  48351. if err := gensupport.DecodeResponse(target, res); err != nil {
  48352. return nil, err
  48353. }
  48354. return ret, nil
  48355. // {
  48356. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  48357. // "httpMethod": "POST",
  48358. // "id": "compute.disks.setLabels",
  48359. // "parameterOrder": [
  48360. // "project",
  48361. // "zone",
  48362. // "resource"
  48363. // ],
  48364. // "parameters": {
  48365. // "project": {
  48366. // "description": "Project ID for this request.",
  48367. // "location": "path",
  48368. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48369. // "required": true,
  48370. // "type": "string"
  48371. // },
  48372. // "requestId": {
  48373. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48374. // "location": "query",
  48375. // "type": "string"
  48376. // },
  48377. // "resource": {
  48378. // "description": "Name or id of the resource for this request.",
  48379. // "location": "path",
  48380. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48381. // "required": true,
  48382. // "type": "string"
  48383. // },
  48384. // "zone": {
  48385. // "description": "The name of the zone for this request.",
  48386. // "location": "path",
  48387. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48388. // "required": true,
  48389. // "type": "string"
  48390. // }
  48391. // },
  48392. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  48393. // "request": {
  48394. // "$ref": "ZoneSetLabelsRequest"
  48395. // },
  48396. // "response": {
  48397. // "$ref": "Operation"
  48398. // },
  48399. // "scopes": [
  48400. // "https://www.googleapis.com/auth/cloud-platform",
  48401. // "https://www.googleapis.com/auth/compute"
  48402. // ]
  48403. // }
  48404. }
  48405. // method id "compute.disks.testIamPermissions":
  48406. type DisksTestIamPermissionsCall struct {
  48407. s *Service
  48408. project string
  48409. zone string
  48410. resource string
  48411. testpermissionsrequest *TestPermissionsRequest
  48412. urlParams_ gensupport.URLParams
  48413. ctx_ context.Context
  48414. header_ http.Header
  48415. }
  48416. // TestIamPermissions: Returns permissions that a caller has on the
  48417. // specified resource.
  48418. func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
  48419. c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48420. c.project = project
  48421. c.zone = zone
  48422. c.resource = resource
  48423. c.testpermissionsrequest = testpermissionsrequest
  48424. return c
  48425. }
  48426. // Fields allows partial responses to be retrieved. See
  48427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48428. // for more information.
  48429. func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
  48430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48431. return c
  48432. }
  48433. // Context sets the context to be used in this call's Do method. Any
  48434. // pending HTTP request will be aborted if the provided context is
  48435. // canceled.
  48436. func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
  48437. c.ctx_ = ctx
  48438. return c
  48439. }
  48440. // Header returns an http.Header that can be modified by the caller to
  48441. // add HTTP headers to the request.
  48442. func (c *DisksTestIamPermissionsCall) Header() http.Header {
  48443. if c.header_ == nil {
  48444. c.header_ = make(http.Header)
  48445. }
  48446. return c.header_
  48447. }
  48448. func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  48449. reqHeaders := make(http.Header)
  48450. for k, v := range c.header_ {
  48451. reqHeaders[k] = v
  48452. }
  48453. reqHeaders.Set("User-Agent", c.s.userAgent())
  48454. var body io.Reader = nil
  48455. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  48456. if err != nil {
  48457. return nil, err
  48458. }
  48459. reqHeaders.Set("Content-Type", "application/json")
  48460. c.urlParams_.Set("alt", alt)
  48461. c.urlParams_.Set("prettyPrint", "false")
  48462. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/testIamPermissions")
  48463. urls += "?" + c.urlParams_.Encode()
  48464. req, err := http.NewRequest("POST", urls, body)
  48465. if err != nil {
  48466. return nil, err
  48467. }
  48468. req.Header = reqHeaders
  48469. googleapi.Expand(req.URL, map[string]string{
  48470. "project": c.project,
  48471. "zone": c.zone,
  48472. "resource": c.resource,
  48473. })
  48474. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48475. }
  48476. // Do executes the "compute.disks.testIamPermissions" call.
  48477. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  48478. // non-2xx status code is an error. Response headers are in either
  48479. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  48480. // returned at all) in error.(*googleapi.Error).Header. Use
  48481. // googleapi.IsNotModified to check whether the returned error was
  48482. // because http.StatusNotModified was returned.
  48483. func (c *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  48484. gensupport.SetOptions(c.urlParams_, opts...)
  48485. res, err := c.doRequest("json")
  48486. if res != nil && res.StatusCode == http.StatusNotModified {
  48487. if res.Body != nil {
  48488. res.Body.Close()
  48489. }
  48490. return nil, &googleapi.Error{
  48491. Code: res.StatusCode,
  48492. Header: res.Header,
  48493. }
  48494. }
  48495. if err != nil {
  48496. return nil, err
  48497. }
  48498. defer googleapi.CloseBody(res)
  48499. if err := googleapi.CheckResponse(res); err != nil {
  48500. return nil, err
  48501. }
  48502. ret := &TestPermissionsResponse{
  48503. ServerResponse: googleapi.ServerResponse{
  48504. Header: res.Header,
  48505. HTTPStatusCode: res.StatusCode,
  48506. },
  48507. }
  48508. target := &ret
  48509. if err := gensupport.DecodeResponse(target, res); err != nil {
  48510. return nil, err
  48511. }
  48512. return ret, nil
  48513. // {
  48514. // "description": "Returns permissions that a caller has on the specified resource.",
  48515. // "httpMethod": "POST",
  48516. // "id": "compute.disks.testIamPermissions",
  48517. // "parameterOrder": [
  48518. // "project",
  48519. // "zone",
  48520. // "resource"
  48521. // ],
  48522. // "parameters": {
  48523. // "project": {
  48524. // "description": "Project ID for this request.",
  48525. // "location": "path",
  48526. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48527. // "required": true,
  48528. // "type": "string"
  48529. // },
  48530. // "resource": {
  48531. // "description": "Name or id of the resource for this request.",
  48532. // "location": "path",
  48533. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48534. // "required": true,
  48535. // "type": "string"
  48536. // },
  48537. // "zone": {
  48538. // "description": "The name of the zone for this request.",
  48539. // "location": "path",
  48540. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48541. // "required": true,
  48542. // "type": "string"
  48543. // }
  48544. // },
  48545. // "path": "{project}/zones/{zone}/disks/{resource}/testIamPermissions",
  48546. // "request": {
  48547. // "$ref": "TestPermissionsRequest"
  48548. // },
  48549. // "response": {
  48550. // "$ref": "TestPermissionsResponse"
  48551. // },
  48552. // "scopes": [
  48553. // "https://www.googleapis.com/auth/cloud-platform",
  48554. // "https://www.googleapis.com/auth/compute",
  48555. // "https://www.googleapis.com/auth/compute.readonly"
  48556. // ]
  48557. // }
  48558. }
  48559. // method id "compute.externalVpnGateways.delete":
  48560. type ExternalVpnGatewaysDeleteCall struct {
  48561. s *Service
  48562. project string
  48563. externalVpnGateway string
  48564. urlParams_ gensupport.URLParams
  48565. ctx_ context.Context
  48566. header_ http.Header
  48567. }
  48568. // Delete: Deletes the specified externalVpnGateway.
  48569. func (r *ExternalVpnGatewaysService) Delete(project string, externalVpnGateway string) *ExternalVpnGatewaysDeleteCall {
  48570. c := &ExternalVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48571. c.project = project
  48572. c.externalVpnGateway = externalVpnGateway
  48573. return c
  48574. }
  48575. // RequestId sets the optional parameter "requestId": An optional
  48576. // request ID to identify requests. Specify a unique request ID so that
  48577. // if you must retry your request, the server will know to ignore the
  48578. // request if it has already been completed.
  48579. //
  48580. // For example, consider a situation where you make an initial request
  48581. // and the request times out. If you make the request again with the
  48582. // same request ID, the server can check if original operation with the
  48583. // same request ID was received, and if so, will ignore the second
  48584. // request. This prevents clients from accidentally creating duplicate
  48585. // commitments.
  48586. //
  48587. // The request ID must be a valid UUID with the exception that zero UUID
  48588. // is not supported (00000000-0000-0000-0000-000000000000).
  48589. func (c *ExternalVpnGatewaysDeleteCall) RequestId(requestId string) *ExternalVpnGatewaysDeleteCall {
  48590. c.urlParams_.Set("requestId", requestId)
  48591. return c
  48592. }
  48593. // Fields allows partial responses to be retrieved. See
  48594. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48595. // for more information.
  48596. func (c *ExternalVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysDeleteCall {
  48597. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48598. return c
  48599. }
  48600. // Context sets the context to be used in this call's Do method. Any
  48601. // pending HTTP request will be aborted if the provided context is
  48602. // canceled.
  48603. func (c *ExternalVpnGatewaysDeleteCall) Context(ctx context.Context) *ExternalVpnGatewaysDeleteCall {
  48604. c.ctx_ = ctx
  48605. return c
  48606. }
  48607. // Header returns an http.Header that can be modified by the caller to
  48608. // add HTTP headers to the request.
  48609. func (c *ExternalVpnGatewaysDeleteCall) Header() http.Header {
  48610. if c.header_ == nil {
  48611. c.header_ = make(http.Header)
  48612. }
  48613. return c.header_
  48614. }
  48615. func (c *ExternalVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  48616. reqHeaders := make(http.Header)
  48617. for k, v := range c.header_ {
  48618. reqHeaders[k] = v
  48619. }
  48620. reqHeaders.Set("User-Agent", c.s.userAgent())
  48621. var body io.Reader = nil
  48622. c.urlParams_.Set("alt", alt)
  48623. c.urlParams_.Set("prettyPrint", "false")
  48624. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{externalVpnGateway}")
  48625. urls += "?" + c.urlParams_.Encode()
  48626. req, err := http.NewRequest("DELETE", urls, body)
  48627. if err != nil {
  48628. return nil, err
  48629. }
  48630. req.Header = reqHeaders
  48631. googleapi.Expand(req.URL, map[string]string{
  48632. "project": c.project,
  48633. "externalVpnGateway": c.externalVpnGateway,
  48634. })
  48635. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48636. }
  48637. // Do executes the "compute.externalVpnGateways.delete" call.
  48638. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48639. // status code is an error. Response headers are in either
  48640. // *Operation.ServerResponse.Header or (if a response was returned at
  48641. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48642. // to check whether the returned error was because
  48643. // http.StatusNotModified was returned.
  48644. func (c *ExternalVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48645. gensupport.SetOptions(c.urlParams_, opts...)
  48646. res, err := c.doRequest("json")
  48647. if res != nil && res.StatusCode == http.StatusNotModified {
  48648. if res.Body != nil {
  48649. res.Body.Close()
  48650. }
  48651. return nil, &googleapi.Error{
  48652. Code: res.StatusCode,
  48653. Header: res.Header,
  48654. }
  48655. }
  48656. if err != nil {
  48657. return nil, err
  48658. }
  48659. defer googleapi.CloseBody(res)
  48660. if err := googleapi.CheckResponse(res); err != nil {
  48661. return nil, err
  48662. }
  48663. ret := &Operation{
  48664. ServerResponse: googleapi.ServerResponse{
  48665. Header: res.Header,
  48666. HTTPStatusCode: res.StatusCode,
  48667. },
  48668. }
  48669. target := &ret
  48670. if err := gensupport.DecodeResponse(target, res); err != nil {
  48671. return nil, err
  48672. }
  48673. return ret, nil
  48674. // {
  48675. // "description": "Deletes the specified externalVpnGateway.",
  48676. // "httpMethod": "DELETE",
  48677. // "id": "compute.externalVpnGateways.delete",
  48678. // "parameterOrder": [
  48679. // "project",
  48680. // "externalVpnGateway"
  48681. // ],
  48682. // "parameters": {
  48683. // "externalVpnGateway": {
  48684. // "description": "Name of the externalVpnGateways to delete.",
  48685. // "location": "path",
  48686. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48687. // "required": true,
  48688. // "type": "string"
  48689. // },
  48690. // "project": {
  48691. // "description": "Project ID for this request.",
  48692. // "location": "path",
  48693. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48694. // "required": true,
  48695. // "type": "string"
  48696. // },
  48697. // "requestId": {
  48698. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48699. // "location": "query",
  48700. // "type": "string"
  48701. // }
  48702. // },
  48703. // "path": "{project}/global/externalVpnGateways/{externalVpnGateway}",
  48704. // "response": {
  48705. // "$ref": "Operation"
  48706. // },
  48707. // "scopes": [
  48708. // "https://www.googleapis.com/auth/cloud-platform",
  48709. // "https://www.googleapis.com/auth/compute"
  48710. // ]
  48711. // }
  48712. }
  48713. // method id "compute.externalVpnGateways.get":
  48714. type ExternalVpnGatewaysGetCall struct {
  48715. s *Service
  48716. project string
  48717. externalVpnGateway string
  48718. urlParams_ gensupport.URLParams
  48719. ifNoneMatch_ string
  48720. ctx_ context.Context
  48721. header_ http.Header
  48722. }
  48723. // Get: Returns the specified externalVpnGateway. Get a list of
  48724. // available externalVpnGateways by making a list() request.
  48725. func (r *ExternalVpnGatewaysService) Get(project string, externalVpnGateway string) *ExternalVpnGatewaysGetCall {
  48726. c := &ExternalVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48727. c.project = project
  48728. c.externalVpnGateway = externalVpnGateway
  48729. return c
  48730. }
  48731. // Fields allows partial responses to be retrieved. See
  48732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48733. // for more information.
  48734. func (c *ExternalVpnGatewaysGetCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysGetCall {
  48735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48736. return c
  48737. }
  48738. // IfNoneMatch sets the optional parameter which makes the operation
  48739. // fail if the object's ETag matches the given value. This is useful for
  48740. // getting updates only after the object has changed since the last
  48741. // request. Use googleapi.IsNotModified to check whether the response
  48742. // error from Do is the result of In-None-Match.
  48743. func (c *ExternalVpnGatewaysGetCall) IfNoneMatch(entityTag string) *ExternalVpnGatewaysGetCall {
  48744. c.ifNoneMatch_ = entityTag
  48745. return c
  48746. }
  48747. // Context sets the context to be used in this call's Do method. Any
  48748. // pending HTTP request will be aborted if the provided context is
  48749. // canceled.
  48750. func (c *ExternalVpnGatewaysGetCall) Context(ctx context.Context) *ExternalVpnGatewaysGetCall {
  48751. c.ctx_ = ctx
  48752. return c
  48753. }
  48754. // Header returns an http.Header that can be modified by the caller to
  48755. // add HTTP headers to the request.
  48756. func (c *ExternalVpnGatewaysGetCall) Header() http.Header {
  48757. if c.header_ == nil {
  48758. c.header_ = make(http.Header)
  48759. }
  48760. return c.header_
  48761. }
  48762. func (c *ExternalVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  48763. reqHeaders := make(http.Header)
  48764. for k, v := range c.header_ {
  48765. reqHeaders[k] = v
  48766. }
  48767. reqHeaders.Set("User-Agent", c.s.userAgent())
  48768. if c.ifNoneMatch_ != "" {
  48769. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48770. }
  48771. var body io.Reader = nil
  48772. c.urlParams_.Set("alt", alt)
  48773. c.urlParams_.Set("prettyPrint", "false")
  48774. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{externalVpnGateway}")
  48775. urls += "?" + c.urlParams_.Encode()
  48776. req, err := http.NewRequest("GET", urls, body)
  48777. if err != nil {
  48778. return nil, err
  48779. }
  48780. req.Header = reqHeaders
  48781. googleapi.Expand(req.URL, map[string]string{
  48782. "project": c.project,
  48783. "externalVpnGateway": c.externalVpnGateway,
  48784. })
  48785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48786. }
  48787. // Do executes the "compute.externalVpnGateways.get" call.
  48788. // Exactly one of *ExternalVpnGateway or error will be non-nil. Any
  48789. // non-2xx status code is an error. Response headers are in either
  48790. // *ExternalVpnGateway.ServerResponse.Header or (if a response was
  48791. // returned at all) in error.(*googleapi.Error).Header. Use
  48792. // googleapi.IsNotModified to check whether the returned error was
  48793. // because http.StatusNotModified was returned.
  48794. func (c *ExternalVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*ExternalVpnGateway, error) {
  48795. gensupport.SetOptions(c.urlParams_, opts...)
  48796. res, err := c.doRequest("json")
  48797. if res != nil && res.StatusCode == http.StatusNotModified {
  48798. if res.Body != nil {
  48799. res.Body.Close()
  48800. }
  48801. return nil, &googleapi.Error{
  48802. Code: res.StatusCode,
  48803. Header: res.Header,
  48804. }
  48805. }
  48806. if err != nil {
  48807. return nil, err
  48808. }
  48809. defer googleapi.CloseBody(res)
  48810. if err := googleapi.CheckResponse(res); err != nil {
  48811. return nil, err
  48812. }
  48813. ret := &ExternalVpnGateway{
  48814. ServerResponse: googleapi.ServerResponse{
  48815. Header: res.Header,
  48816. HTTPStatusCode: res.StatusCode,
  48817. },
  48818. }
  48819. target := &ret
  48820. if err := gensupport.DecodeResponse(target, res); err != nil {
  48821. return nil, err
  48822. }
  48823. return ret, nil
  48824. // {
  48825. // "description": "Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request.",
  48826. // "httpMethod": "GET",
  48827. // "id": "compute.externalVpnGateways.get",
  48828. // "parameterOrder": [
  48829. // "project",
  48830. // "externalVpnGateway"
  48831. // ],
  48832. // "parameters": {
  48833. // "externalVpnGateway": {
  48834. // "description": "Name of the externalVpnGateway to return.",
  48835. // "location": "path",
  48836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48837. // "required": true,
  48838. // "type": "string"
  48839. // },
  48840. // "project": {
  48841. // "description": "Project ID for this request.",
  48842. // "location": "path",
  48843. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48844. // "required": true,
  48845. // "type": "string"
  48846. // }
  48847. // },
  48848. // "path": "{project}/global/externalVpnGateways/{externalVpnGateway}",
  48849. // "response": {
  48850. // "$ref": "ExternalVpnGateway"
  48851. // },
  48852. // "scopes": [
  48853. // "https://www.googleapis.com/auth/cloud-platform",
  48854. // "https://www.googleapis.com/auth/compute",
  48855. // "https://www.googleapis.com/auth/compute.readonly"
  48856. // ]
  48857. // }
  48858. }
  48859. // method id "compute.externalVpnGateways.insert":
  48860. type ExternalVpnGatewaysInsertCall struct {
  48861. s *Service
  48862. project string
  48863. externalvpngateway *ExternalVpnGateway
  48864. urlParams_ gensupport.URLParams
  48865. ctx_ context.Context
  48866. header_ http.Header
  48867. }
  48868. // Insert: Creates a ExternalVpnGateway in the specified project using
  48869. // the data included in the request.
  48870. func (r *ExternalVpnGatewaysService) Insert(project string, externalvpngateway *ExternalVpnGateway) *ExternalVpnGatewaysInsertCall {
  48871. c := &ExternalVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48872. c.project = project
  48873. c.externalvpngateway = externalvpngateway
  48874. return c
  48875. }
  48876. // RequestId sets the optional parameter "requestId": An optional
  48877. // request ID to identify requests. Specify a unique request ID so that
  48878. // if you must retry your request, the server will know to ignore the
  48879. // request if it has already been completed.
  48880. //
  48881. // For example, consider a situation where you make an initial request
  48882. // and the request times out. If you make the request again with the
  48883. // same request ID, the server can check if original operation with the
  48884. // same request ID was received, and if so, will ignore the second
  48885. // request. This prevents clients from accidentally creating duplicate
  48886. // commitments.
  48887. //
  48888. // The request ID must be a valid UUID with the exception that zero UUID
  48889. // is not supported (00000000-0000-0000-0000-000000000000).
  48890. func (c *ExternalVpnGatewaysInsertCall) RequestId(requestId string) *ExternalVpnGatewaysInsertCall {
  48891. c.urlParams_.Set("requestId", requestId)
  48892. return c
  48893. }
  48894. // Fields allows partial responses to be retrieved. See
  48895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48896. // for more information.
  48897. func (c *ExternalVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysInsertCall {
  48898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48899. return c
  48900. }
  48901. // Context sets the context to be used in this call's Do method. Any
  48902. // pending HTTP request will be aborted if the provided context is
  48903. // canceled.
  48904. func (c *ExternalVpnGatewaysInsertCall) Context(ctx context.Context) *ExternalVpnGatewaysInsertCall {
  48905. c.ctx_ = ctx
  48906. return c
  48907. }
  48908. // Header returns an http.Header that can be modified by the caller to
  48909. // add HTTP headers to the request.
  48910. func (c *ExternalVpnGatewaysInsertCall) Header() http.Header {
  48911. if c.header_ == nil {
  48912. c.header_ = make(http.Header)
  48913. }
  48914. return c.header_
  48915. }
  48916. func (c *ExternalVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  48917. reqHeaders := make(http.Header)
  48918. for k, v := range c.header_ {
  48919. reqHeaders[k] = v
  48920. }
  48921. reqHeaders.Set("User-Agent", c.s.userAgent())
  48922. var body io.Reader = nil
  48923. body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalvpngateway)
  48924. if err != nil {
  48925. return nil, err
  48926. }
  48927. reqHeaders.Set("Content-Type", "application/json")
  48928. c.urlParams_.Set("alt", alt)
  48929. c.urlParams_.Set("prettyPrint", "false")
  48930. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways")
  48931. urls += "?" + c.urlParams_.Encode()
  48932. req, err := http.NewRequest("POST", urls, body)
  48933. if err != nil {
  48934. return nil, err
  48935. }
  48936. req.Header = reqHeaders
  48937. googleapi.Expand(req.URL, map[string]string{
  48938. "project": c.project,
  48939. })
  48940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48941. }
  48942. // Do executes the "compute.externalVpnGateways.insert" call.
  48943. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48944. // status code is an error. Response headers are in either
  48945. // *Operation.ServerResponse.Header or (if a response was returned at
  48946. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48947. // to check whether the returned error was because
  48948. // http.StatusNotModified was returned.
  48949. func (c *ExternalVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48950. gensupport.SetOptions(c.urlParams_, opts...)
  48951. res, err := c.doRequest("json")
  48952. if res != nil && res.StatusCode == http.StatusNotModified {
  48953. if res.Body != nil {
  48954. res.Body.Close()
  48955. }
  48956. return nil, &googleapi.Error{
  48957. Code: res.StatusCode,
  48958. Header: res.Header,
  48959. }
  48960. }
  48961. if err != nil {
  48962. return nil, err
  48963. }
  48964. defer googleapi.CloseBody(res)
  48965. if err := googleapi.CheckResponse(res); err != nil {
  48966. return nil, err
  48967. }
  48968. ret := &Operation{
  48969. ServerResponse: googleapi.ServerResponse{
  48970. Header: res.Header,
  48971. HTTPStatusCode: res.StatusCode,
  48972. },
  48973. }
  48974. target := &ret
  48975. if err := gensupport.DecodeResponse(target, res); err != nil {
  48976. return nil, err
  48977. }
  48978. return ret, nil
  48979. // {
  48980. // "description": "Creates a ExternalVpnGateway in the specified project using the data included in the request.",
  48981. // "httpMethod": "POST",
  48982. // "id": "compute.externalVpnGateways.insert",
  48983. // "parameterOrder": [
  48984. // "project"
  48985. // ],
  48986. // "parameters": {
  48987. // "project": {
  48988. // "description": "Project ID for this request.",
  48989. // "location": "path",
  48990. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48991. // "required": true,
  48992. // "type": "string"
  48993. // },
  48994. // "requestId": {
  48995. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48996. // "location": "query",
  48997. // "type": "string"
  48998. // }
  48999. // },
  49000. // "path": "{project}/global/externalVpnGateways",
  49001. // "request": {
  49002. // "$ref": "ExternalVpnGateway"
  49003. // },
  49004. // "response": {
  49005. // "$ref": "Operation"
  49006. // },
  49007. // "scopes": [
  49008. // "https://www.googleapis.com/auth/cloud-platform",
  49009. // "https://www.googleapis.com/auth/compute"
  49010. // ]
  49011. // }
  49012. }
  49013. // method id "compute.externalVpnGateways.list":
  49014. type ExternalVpnGatewaysListCall struct {
  49015. s *Service
  49016. project string
  49017. urlParams_ gensupport.URLParams
  49018. ifNoneMatch_ string
  49019. ctx_ context.Context
  49020. header_ http.Header
  49021. }
  49022. // List: Retrieves the list of ExternalVpnGateway available to the
  49023. // specified project.
  49024. func (r *ExternalVpnGatewaysService) List(project string) *ExternalVpnGatewaysListCall {
  49025. c := &ExternalVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49026. c.project = project
  49027. return c
  49028. }
  49029. // Filter sets the optional parameter "filter": A filter expression that
  49030. // filters resources listed in the response. The expression must specify
  49031. // the field name, a comparison operator, and the value that you want to
  49032. // use for filtering. The value must be a string, a number, or a
  49033. // boolean. The comparison operator must be either =, !=, >, or <.
  49034. //
  49035. // For example, if you are filtering Compute Engine instances, you can
  49036. // exclude instances named example-instance by specifying name !=
  49037. // example-instance.
  49038. //
  49039. // You can also filter nested fields. For example, you could specify
  49040. // scheduling.automaticRestart = false to include instances only if they
  49041. // are not scheduled for automatic restarts. You can use filtering on
  49042. // nested fields to filter based on resource labels.
  49043. //
  49044. // To filter on multiple expressions, provide each separate expression
  49045. // within parentheses. For example, (scheduling.automaticRestart = true)
  49046. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  49047. // AND expression. However, you can include AND and OR expressions
  49048. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  49049. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  49050. // true).
  49051. func (c *ExternalVpnGatewaysListCall) Filter(filter string) *ExternalVpnGatewaysListCall {
  49052. c.urlParams_.Set("filter", filter)
  49053. return c
  49054. }
  49055. // MaxResults sets the optional parameter "maxResults": The maximum
  49056. // number of results per page that should be returned. If the number of
  49057. // available results is larger than maxResults, Compute Engine returns a
  49058. // nextPageToken that can be used to get the next page of results in
  49059. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49060. // (Default: 500)
  49061. func (c *ExternalVpnGatewaysListCall) MaxResults(maxResults int64) *ExternalVpnGatewaysListCall {
  49062. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49063. return c
  49064. }
  49065. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49066. // a certain order. By default, results are returned in alphanumerical
  49067. // order based on the resource name.
  49068. //
  49069. // You can also sort results in descending order based on the creation
  49070. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49071. // based on the creationTimestamp field in reverse chronological order
  49072. // (newest result first). Use this to sort resources like operations so
  49073. // that the newest operation is returned first.
  49074. //
  49075. // Currently, only sorting by name or creationTimestamp desc is
  49076. // supported.
  49077. func (c *ExternalVpnGatewaysListCall) OrderBy(orderBy string) *ExternalVpnGatewaysListCall {
  49078. c.urlParams_.Set("orderBy", orderBy)
  49079. return c
  49080. }
  49081. // PageToken sets the optional parameter "pageToken": Specifies a page
  49082. // token to use. Set pageToken to the nextPageToken returned by a
  49083. // previous list request to get the next page of results.
  49084. func (c *ExternalVpnGatewaysListCall) PageToken(pageToken string) *ExternalVpnGatewaysListCall {
  49085. c.urlParams_.Set("pageToken", pageToken)
  49086. return c
  49087. }
  49088. // Fields allows partial responses to be retrieved. See
  49089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49090. // for more information.
  49091. func (c *ExternalVpnGatewaysListCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysListCall {
  49092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49093. return c
  49094. }
  49095. // IfNoneMatch sets the optional parameter which makes the operation
  49096. // fail if the object's ETag matches the given value. This is useful for
  49097. // getting updates only after the object has changed since the last
  49098. // request. Use googleapi.IsNotModified to check whether the response
  49099. // error from Do is the result of In-None-Match.
  49100. func (c *ExternalVpnGatewaysListCall) IfNoneMatch(entityTag string) *ExternalVpnGatewaysListCall {
  49101. c.ifNoneMatch_ = entityTag
  49102. return c
  49103. }
  49104. // Context sets the context to be used in this call's Do method. Any
  49105. // pending HTTP request will be aborted if the provided context is
  49106. // canceled.
  49107. func (c *ExternalVpnGatewaysListCall) Context(ctx context.Context) *ExternalVpnGatewaysListCall {
  49108. c.ctx_ = ctx
  49109. return c
  49110. }
  49111. // Header returns an http.Header that can be modified by the caller to
  49112. // add HTTP headers to the request.
  49113. func (c *ExternalVpnGatewaysListCall) Header() http.Header {
  49114. if c.header_ == nil {
  49115. c.header_ = make(http.Header)
  49116. }
  49117. return c.header_
  49118. }
  49119. func (c *ExternalVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  49120. reqHeaders := make(http.Header)
  49121. for k, v := range c.header_ {
  49122. reqHeaders[k] = v
  49123. }
  49124. reqHeaders.Set("User-Agent", c.s.userAgent())
  49125. if c.ifNoneMatch_ != "" {
  49126. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49127. }
  49128. var body io.Reader = nil
  49129. c.urlParams_.Set("alt", alt)
  49130. c.urlParams_.Set("prettyPrint", "false")
  49131. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways")
  49132. urls += "?" + c.urlParams_.Encode()
  49133. req, err := http.NewRequest("GET", urls, body)
  49134. if err != nil {
  49135. return nil, err
  49136. }
  49137. req.Header = reqHeaders
  49138. googleapi.Expand(req.URL, map[string]string{
  49139. "project": c.project,
  49140. })
  49141. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49142. }
  49143. // Do executes the "compute.externalVpnGateways.list" call.
  49144. // Exactly one of *ExternalVpnGatewayList or error will be non-nil. Any
  49145. // non-2xx status code is an error. Response headers are in either
  49146. // *ExternalVpnGatewayList.ServerResponse.Header or (if a response was
  49147. // returned at all) in error.(*googleapi.Error).Header. Use
  49148. // googleapi.IsNotModified to check whether the returned error was
  49149. // because http.StatusNotModified was returned.
  49150. func (c *ExternalVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*ExternalVpnGatewayList, error) {
  49151. gensupport.SetOptions(c.urlParams_, opts...)
  49152. res, err := c.doRequest("json")
  49153. if res != nil && res.StatusCode == http.StatusNotModified {
  49154. if res.Body != nil {
  49155. res.Body.Close()
  49156. }
  49157. return nil, &googleapi.Error{
  49158. Code: res.StatusCode,
  49159. Header: res.Header,
  49160. }
  49161. }
  49162. if err != nil {
  49163. return nil, err
  49164. }
  49165. defer googleapi.CloseBody(res)
  49166. if err := googleapi.CheckResponse(res); err != nil {
  49167. return nil, err
  49168. }
  49169. ret := &ExternalVpnGatewayList{
  49170. ServerResponse: googleapi.ServerResponse{
  49171. Header: res.Header,
  49172. HTTPStatusCode: res.StatusCode,
  49173. },
  49174. }
  49175. target := &ret
  49176. if err := gensupport.DecodeResponse(target, res); err != nil {
  49177. return nil, err
  49178. }
  49179. return ret, nil
  49180. // {
  49181. // "description": "Retrieves the list of ExternalVpnGateway available to the specified project.",
  49182. // "httpMethod": "GET",
  49183. // "id": "compute.externalVpnGateways.list",
  49184. // "parameterOrder": [
  49185. // "project"
  49186. // ],
  49187. // "parameters": {
  49188. // "filter": {
  49189. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  49190. // "location": "query",
  49191. // "type": "string"
  49192. // },
  49193. // "maxResults": {
  49194. // "default": "500",
  49195. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  49196. // "format": "uint32",
  49197. // "location": "query",
  49198. // "minimum": "0",
  49199. // "type": "integer"
  49200. // },
  49201. // "orderBy": {
  49202. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  49203. // "location": "query",
  49204. // "type": "string"
  49205. // },
  49206. // "pageToken": {
  49207. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  49208. // "location": "query",
  49209. // "type": "string"
  49210. // },
  49211. // "project": {
  49212. // "description": "Project ID for this request.",
  49213. // "location": "path",
  49214. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49215. // "required": true,
  49216. // "type": "string"
  49217. // }
  49218. // },
  49219. // "path": "{project}/global/externalVpnGateways",
  49220. // "response": {
  49221. // "$ref": "ExternalVpnGatewayList"
  49222. // },
  49223. // "scopes": [
  49224. // "https://www.googleapis.com/auth/cloud-platform",
  49225. // "https://www.googleapis.com/auth/compute",
  49226. // "https://www.googleapis.com/auth/compute.readonly"
  49227. // ]
  49228. // }
  49229. }
  49230. // Pages invokes f for each page of results.
  49231. // A non-nil error returned from f will halt the iteration.
  49232. // The provided context supersedes any context provided to the Context method.
  49233. func (c *ExternalVpnGatewaysListCall) Pages(ctx context.Context, f func(*ExternalVpnGatewayList) error) error {
  49234. c.ctx_ = ctx
  49235. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49236. for {
  49237. x, err := c.Do()
  49238. if err != nil {
  49239. return err
  49240. }
  49241. if err := f(x); err != nil {
  49242. return err
  49243. }
  49244. if x.NextPageToken == "" {
  49245. return nil
  49246. }
  49247. c.PageToken(x.NextPageToken)
  49248. }
  49249. }
  49250. // method id "compute.externalVpnGateways.setLabels":
  49251. type ExternalVpnGatewaysSetLabelsCall struct {
  49252. s *Service
  49253. project string
  49254. resource string
  49255. globalsetlabelsrequest *GlobalSetLabelsRequest
  49256. urlParams_ gensupport.URLParams
  49257. ctx_ context.Context
  49258. header_ http.Header
  49259. }
  49260. // SetLabels: Sets the labels on an ExternalVpnGateway. To learn more
  49261. // about labels, read the Labeling Resources documentation.
  49262. func (r *ExternalVpnGatewaysService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ExternalVpnGatewaysSetLabelsCall {
  49263. c := &ExternalVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49264. c.project = project
  49265. c.resource = resource
  49266. c.globalsetlabelsrequest = globalsetlabelsrequest
  49267. return c
  49268. }
  49269. // Fields allows partial responses to be retrieved. See
  49270. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49271. // for more information.
  49272. func (c *ExternalVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysSetLabelsCall {
  49273. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49274. return c
  49275. }
  49276. // Context sets the context to be used in this call's Do method. Any
  49277. // pending HTTP request will be aborted if the provided context is
  49278. // canceled.
  49279. func (c *ExternalVpnGatewaysSetLabelsCall) Context(ctx context.Context) *ExternalVpnGatewaysSetLabelsCall {
  49280. c.ctx_ = ctx
  49281. return c
  49282. }
  49283. // Header returns an http.Header that can be modified by the caller to
  49284. // add HTTP headers to the request.
  49285. func (c *ExternalVpnGatewaysSetLabelsCall) Header() http.Header {
  49286. if c.header_ == nil {
  49287. c.header_ = make(http.Header)
  49288. }
  49289. return c.header_
  49290. }
  49291. func (c *ExternalVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  49292. reqHeaders := make(http.Header)
  49293. for k, v := range c.header_ {
  49294. reqHeaders[k] = v
  49295. }
  49296. reqHeaders.Set("User-Agent", c.s.userAgent())
  49297. var body io.Reader = nil
  49298. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  49299. if err != nil {
  49300. return nil, err
  49301. }
  49302. reqHeaders.Set("Content-Type", "application/json")
  49303. c.urlParams_.Set("alt", alt)
  49304. c.urlParams_.Set("prettyPrint", "false")
  49305. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{resource}/setLabels")
  49306. urls += "?" + c.urlParams_.Encode()
  49307. req, err := http.NewRequest("POST", urls, body)
  49308. if err != nil {
  49309. return nil, err
  49310. }
  49311. req.Header = reqHeaders
  49312. googleapi.Expand(req.URL, map[string]string{
  49313. "project": c.project,
  49314. "resource": c.resource,
  49315. })
  49316. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49317. }
  49318. // Do executes the "compute.externalVpnGateways.setLabels" call.
  49319. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49320. // status code is an error. Response headers are in either
  49321. // *Operation.ServerResponse.Header or (if a response was returned at
  49322. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49323. // to check whether the returned error was because
  49324. // http.StatusNotModified was returned.
  49325. func (c *ExternalVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49326. gensupport.SetOptions(c.urlParams_, opts...)
  49327. res, err := c.doRequest("json")
  49328. if res != nil && res.StatusCode == http.StatusNotModified {
  49329. if res.Body != nil {
  49330. res.Body.Close()
  49331. }
  49332. return nil, &googleapi.Error{
  49333. Code: res.StatusCode,
  49334. Header: res.Header,
  49335. }
  49336. }
  49337. if err != nil {
  49338. return nil, err
  49339. }
  49340. defer googleapi.CloseBody(res)
  49341. if err := googleapi.CheckResponse(res); err != nil {
  49342. return nil, err
  49343. }
  49344. ret := &Operation{
  49345. ServerResponse: googleapi.ServerResponse{
  49346. Header: res.Header,
  49347. HTTPStatusCode: res.StatusCode,
  49348. },
  49349. }
  49350. target := &ret
  49351. if err := gensupport.DecodeResponse(target, res); err != nil {
  49352. return nil, err
  49353. }
  49354. return ret, nil
  49355. // {
  49356. // "description": "Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  49357. // "httpMethod": "POST",
  49358. // "id": "compute.externalVpnGateways.setLabels",
  49359. // "parameterOrder": [
  49360. // "project",
  49361. // "resource"
  49362. // ],
  49363. // "parameters": {
  49364. // "project": {
  49365. // "description": "Project ID for this request.",
  49366. // "location": "path",
  49367. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49368. // "required": true,
  49369. // "type": "string"
  49370. // },
  49371. // "resource": {
  49372. // "description": "Name or id of the resource for this request.",
  49373. // "location": "path",
  49374. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49375. // "required": true,
  49376. // "type": "string"
  49377. // }
  49378. // },
  49379. // "path": "{project}/global/externalVpnGateways/{resource}/setLabels",
  49380. // "request": {
  49381. // "$ref": "GlobalSetLabelsRequest"
  49382. // },
  49383. // "response": {
  49384. // "$ref": "Operation"
  49385. // },
  49386. // "scopes": [
  49387. // "https://www.googleapis.com/auth/cloud-platform",
  49388. // "https://www.googleapis.com/auth/compute"
  49389. // ]
  49390. // }
  49391. }
  49392. // method id "compute.externalVpnGateways.testIamPermissions":
  49393. type ExternalVpnGatewaysTestIamPermissionsCall struct {
  49394. s *Service
  49395. project string
  49396. resource string
  49397. testpermissionsrequest *TestPermissionsRequest
  49398. urlParams_ gensupport.URLParams
  49399. ctx_ context.Context
  49400. header_ http.Header
  49401. }
  49402. // TestIamPermissions: Returns permissions that a caller has on the
  49403. // specified resource.
  49404. func (r *ExternalVpnGatewaysService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ExternalVpnGatewaysTestIamPermissionsCall {
  49405. c := &ExternalVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49406. c.project = project
  49407. c.resource = resource
  49408. c.testpermissionsrequest = testpermissionsrequest
  49409. return c
  49410. }
  49411. // Fields allows partial responses to be retrieved. See
  49412. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49413. // for more information.
  49414. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysTestIamPermissionsCall {
  49415. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49416. return c
  49417. }
  49418. // Context sets the context to be used in this call's Do method. Any
  49419. // pending HTTP request will be aborted if the provided context is
  49420. // canceled.
  49421. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *ExternalVpnGatewaysTestIamPermissionsCall {
  49422. c.ctx_ = ctx
  49423. return c
  49424. }
  49425. // Header returns an http.Header that can be modified by the caller to
  49426. // add HTTP headers to the request.
  49427. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Header() http.Header {
  49428. if c.header_ == nil {
  49429. c.header_ = make(http.Header)
  49430. }
  49431. return c.header_
  49432. }
  49433. func (c *ExternalVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  49434. reqHeaders := make(http.Header)
  49435. for k, v := range c.header_ {
  49436. reqHeaders[k] = v
  49437. }
  49438. reqHeaders.Set("User-Agent", c.s.userAgent())
  49439. var body io.Reader = nil
  49440. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  49441. if err != nil {
  49442. return nil, err
  49443. }
  49444. reqHeaders.Set("Content-Type", "application/json")
  49445. c.urlParams_.Set("alt", alt)
  49446. c.urlParams_.Set("prettyPrint", "false")
  49447. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{resource}/testIamPermissions")
  49448. urls += "?" + c.urlParams_.Encode()
  49449. req, err := http.NewRequest("POST", urls, body)
  49450. if err != nil {
  49451. return nil, err
  49452. }
  49453. req.Header = reqHeaders
  49454. googleapi.Expand(req.URL, map[string]string{
  49455. "project": c.project,
  49456. "resource": c.resource,
  49457. })
  49458. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49459. }
  49460. // Do executes the "compute.externalVpnGateways.testIamPermissions" call.
  49461. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  49462. // non-2xx status code is an error. Response headers are in either
  49463. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  49464. // returned at all) in error.(*googleapi.Error).Header. Use
  49465. // googleapi.IsNotModified to check whether the returned error was
  49466. // because http.StatusNotModified was returned.
  49467. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  49468. gensupport.SetOptions(c.urlParams_, opts...)
  49469. res, err := c.doRequest("json")
  49470. if res != nil && res.StatusCode == http.StatusNotModified {
  49471. if res.Body != nil {
  49472. res.Body.Close()
  49473. }
  49474. return nil, &googleapi.Error{
  49475. Code: res.StatusCode,
  49476. Header: res.Header,
  49477. }
  49478. }
  49479. if err != nil {
  49480. return nil, err
  49481. }
  49482. defer googleapi.CloseBody(res)
  49483. if err := googleapi.CheckResponse(res); err != nil {
  49484. return nil, err
  49485. }
  49486. ret := &TestPermissionsResponse{
  49487. ServerResponse: googleapi.ServerResponse{
  49488. Header: res.Header,
  49489. HTTPStatusCode: res.StatusCode,
  49490. },
  49491. }
  49492. target := &ret
  49493. if err := gensupport.DecodeResponse(target, res); err != nil {
  49494. return nil, err
  49495. }
  49496. return ret, nil
  49497. // {
  49498. // "description": "Returns permissions that a caller has on the specified resource.",
  49499. // "httpMethod": "POST",
  49500. // "id": "compute.externalVpnGateways.testIamPermissions",
  49501. // "parameterOrder": [
  49502. // "project",
  49503. // "resource"
  49504. // ],
  49505. // "parameters": {
  49506. // "project": {
  49507. // "description": "Project ID for this request.",
  49508. // "location": "path",
  49509. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49510. // "required": true,
  49511. // "type": "string"
  49512. // },
  49513. // "resource": {
  49514. // "description": "Name or id of the resource for this request.",
  49515. // "location": "path",
  49516. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49517. // "required": true,
  49518. // "type": "string"
  49519. // }
  49520. // },
  49521. // "path": "{project}/global/externalVpnGateways/{resource}/testIamPermissions",
  49522. // "request": {
  49523. // "$ref": "TestPermissionsRequest"
  49524. // },
  49525. // "response": {
  49526. // "$ref": "TestPermissionsResponse"
  49527. // },
  49528. // "scopes": [
  49529. // "https://www.googleapis.com/auth/cloud-platform",
  49530. // "https://www.googleapis.com/auth/compute",
  49531. // "https://www.googleapis.com/auth/compute.readonly"
  49532. // ]
  49533. // }
  49534. }
  49535. // method id "compute.firewalls.delete":
  49536. type FirewallsDeleteCall struct {
  49537. s *Service
  49538. project string
  49539. firewall string
  49540. urlParams_ gensupport.URLParams
  49541. ctx_ context.Context
  49542. header_ http.Header
  49543. }
  49544. // Delete: Deletes the specified firewall.
  49545. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  49546. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  49547. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49548. c.project = project
  49549. c.firewall = firewall
  49550. return c
  49551. }
  49552. // RequestId sets the optional parameter "requestId": An optional
  49553. // request ID to identify requests. Specify a unique request ID so that
  49554. // if you must retry your request, the server will know to ignore the
  49555. // request if it has already been completed.
  49556. //
  49557. // For example, consider a situation where you make an initial request
  49558. // and the request times out. If you make the request again with the
  49559. // same request ID, the server can check if original operation with the
  49560. // same request ID was received, and if so, will ignore the second
  49561. // request. This prevents clients from accidentally creating duplicate
  49562. // commitments.
  49563. //
  49564. // The request ID must be a valid UUID with the exception that zero UUID
  49565. // is not supported (00000000-0000-0000-0000-000000000000).
  49566. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  49567. c.urlParams_.Set("requestId", requestId)
  49568. return c
  49569. }
  49570. // Fields allows partial responses to be retrieved. See
  49571. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49572. // for more information.
  49573. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  49574. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49575. return c
  49576. }
  49577. // Context sets the context to be used in this call's Do method. Any
  49578. // pending HTTP request will be aborted if the provided context is
  49579. // canceled.
  49580. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  49581. c.ctx_ = ctx
  49582. return c
  49583. }
  49584. // Header returns an http.Header that can be modified by the caller to
  49585. // add HTTP headers to the request.
  49586. func (c *FirewallsDeleteCall) Header() http.Header {
  49587. if c.header_ == nil {
  49588. c.header_ = make(http.Header)
  49589. }
  49590. return c.header_
  49591. }
  49592. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  49593. reqHeaders := make(http.Header)
  49594. for k, v := range c.header_ {
  49595. reqHeaders[k] = v
  49596. }
  49597. reqHeaders.Set("User-Agent", c.s.userAgent())
  49598. var body io.Reader = nil
  49599. c.urlParams_.Set("alt", alt)
  49600. c.urlParams_.Set("prettyPrint", "false")
  49601. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  49602. urls += "?" + c.urlParams_.Encode()
  49603. req, err := http.NewRequest("DELETE", urls, body)
  49604. if err != nil {
  49605. return nil, err
  49606. }
  49607. req.Header = reqHeaders
  49608. googleapi.Expand(req.URL, map[string]string{
  49609. "project": c.project,
  49610. "firewall": c.firewall,
  49611. })
  49612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49613. }
  49614. // Do executes the "compute.firewalls.delete" call.
  49615. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49616. // status code is an error. Response headers are in either
  49617. // *Operation.ServerResponse.Header or (if a response was returned at
  49618. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49619. // to check whether the returned error was because
  49620. // http.StatusNotModified was returned.
  49621. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49622. gensupport.SetOptions(c.urlParams_, opts...)
  49623. res, err := c.doRequest("json")
  49624. if res != nil && res.StatusCode == http.StatusNotModified {
  49625. if res.Body != nil {
  49626. res.Body.Close()
  49627. }
  49628. return nil, &googleapi.Error{
  49629. Code: res.StatusCode,
  49630. Header: res.Header,
  49631. }
  49632. }
  49633. if err != nil {
  49634. return nil, err
  49635. }
  49636. defer googleapi.CloseBody(res)
  49637. if err := googleapi.CheckResponse(res); err != nil {
  49638. return nil, err
  49639. }
  49640. ret := &Operation{
  49641. ServerResponse: googleapi.ServerResponse{
  49642. Header: res.Header,
  49643. HTTPStatusCode: res.StatusCode,
  49644. },
  49645. }
  49646. target := &ret
  49647. if err := gensupport.DecodeResponse(target, res); err != nil {
  49648. return nil, err
  49649. }
  49650. return ret, nil
  49651. // {
  49652. // "description": "Deletes the specified firewall.",
  49653. // "httpMethod": "DELETE",
  49654. // "id": "compute.firewalls.delete",
  49655. // "parameterOrder": [
  49656. // "project",
  49657. // "firewall"
  49658. // ],
  49659. // "parameters": {
  49660. // "firewall": {
  49661. // "description": "Name of the firewall rule to delete.",
  49662. // "location": "path",
  49663. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49664. // "required": true,
  49665. // "type": "string"
  49666. // },
  49667. // "project": {
  49668. // "description": "Project ID for this request.",
  49669. // "location": "path",
  49670. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49671. // "required": true,
  49672. // "type": "string"
  49673. // },
  49674. // "requestId": {
  49675. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49676. // "location": "query",
  49677. // "type": "string"
  49678. // }
  49679. // },
  49680. // "path": "{project}/global/firewalls/{firewall}",
  49681. // "response": {
  49682. // "$ref": "Operation"
  49683. // },
  49684. // "scopes": [
  49685. // "https://www.googleapis.com/auth/cloud-platform",
  49686. // "https://www.googleapis.com/auth/compute"
  49687. // ]
  49688. // }
  49689. }
  49690. // method id "compute.firewalls.get":
  49691. type FirewallsGetCall struct {
  49692. s *Service
  49693. project string
  49694. firewall string
  49695. urlParams_ gensupport.URLParams
  49696. ifNoneMatch_ string
  49697. ctx_ context.Context
  49698. header_ http.Header
  49699. }
  49700. // Get: Returns the specified firewall.
  49701. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  49702. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  49703. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49704. c.project = project
  49705. c.firewall = firewall
  49706. return c
  49707. }
  49708. // Fields allows partial responses to be retrieved. See
  49709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49710. // for more information.
  49711. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  49712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49713. return c
  49714. }
  49715. // IfNoneMatch sets the optional parameter which makes the operation
  49716. // fail if the object's ETag matches the given value. This is useful for
  49717. // getting updates only after the object has changed since the last
  49718. // request. Use googleapi.IsNotModified to check whether the response
  49719. // error from Do is the result of In-None-Match.
  49720. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  49721. c.ifNoneMatch_ = entityTag
  49722. return c
  49723. }
  49724. // Context sets the context to be used in this call's Do method. Any
  49725. // pending HTTP request will be aborted if the provided context is
  49726. // canceled.
  49727. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  49728. c.ctx_ = ctx
  49729. return c
  49730. }
  49731. // Header returns an http.Header that can be modified by the caller to
  49732. // add HTTP headers to the request.
  49733. func (c *FirewallsGetCall) Header() http.Header {
  49734. if c.header_ == nil {
  49735. c.header_ = make(http.Header)
  49736. }
  49737. return c.header_
  49738. }
  49739. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  49740. reqHeaders := make(http.Header)
  49741. for k, v := range c.header_ {
  49742. reqHeaders[k] = v
  49743. }
  49744. reqHeaders.Set("User-Agent", c.s.userAgent())
  49745. if c.ifNoneMatch_ != "" {
  49746. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49747. }
  49748. var body io.Reader = nil
  49749. c.urlParams_.Set("alt", alt)
  49750. c.urlParams_.Set("prettyPrint", "false")
  49751. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  49752. urls += "?" + c.urlParams_.Encode()
  49753. req, err := http.NewRequest("GET", urls, body)
  49754. if err != nil {
  49755. return nil, err
  49756. }
  49757. req.Header = reqHeaders
  49758. googleapi.Expand(req.URL, map[string]string{
  49759. "project": c.project,
  49760. "firewall": c.firewall,
  49761. })
  49762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49763. }
  49764. // Do executes the "compute.firewalls.get" call.
  49765. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  49766. // code is an error. Response headers are in either
  49767. // *Firewall.ServerResponse.Header or (if a response was returned at
  49768. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49769. // to check whether the returned error was because
  49770. // http.StatusNotModified was returned.
  49771. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  49772. gensupport.SetOptions(c.urlParams_, opts...)
  49773. res, err := c.doRequest("json")
  49774. if res != nil && res.StatusCode == http.StatusNotModified {
  49775. if res.Body != nil {
  49776. res.Body.Close()
  49777. }
  49778. return nil, &googleapi.Error{
  49779. Code: res.StatusCode,
  49780. Header: res.Header,
  49781. }
  49782. }
  49783. if err != nil {
  49784. return nil, err
  49785. }
  49786. defer googleapi.CloseBody(res)
  49787. if err := googleapi.CheckResponse(res); err != nil {
  49788. return nil, err
  49789. }
  49790. ret := &Firewall{
  49791. ServerResponse: googleapi.ServerResponse{
  49792. Header: res.Header,
  49793. HTTPStatusCode: res.StatusCode,
  49794. },
  49795. }
  49796. target := &ret
  49797. if err := gensupport.DecodeResponse(target, res); err != nil {
  49798. return nil, err
  49799. }
  49800. return ret, nil
  49801. // {
  49802. // "description": "Returns the specified firewall.",
  49803. // "httpMethod": "GET",
  49804. // "id": "compute.firewalls.get",
  49805. // "parameterOrder": [
  49806. // "project",
  49807. // "firewall"
  49808. // ],
  49809. // "parameters": {
  49810. // "firewall": {
  49811. // "description": "Name of the firewall rule to return.",
  49812. // "location": "path",
  49813. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49814. // "required": true,
  49815. // "type": "string"
  49816. // },
  49817. // "project": {
  49818. // "description": "Project ID for this request.",
  49819. // "location": "path",
  49820. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49821. // "required": true,
  49822. // "type": "string"
  49823. // }
  49824. // },
  49825. // "path": "{project}/global/firewalls/{firewall}",
  49826. // "response": {
  49827. // "$ref": "Firewall"
  49828. // },
  49829. // "scopes": [
  49830. // "https://www.googleapis.com/auth/cloud-platform",
  49831. // "https://www.googleapis.com/auth/compute",
  49832. // "https://www.googleapis.com/auth/compute.readonly"
  49833. // ]
  49834. // }
  49835. }
  49836. // method id "compute.firewalls.insert":
  49837. type FirewallsInsertCall struct {
  49838. s *Service
  49839. project string
  49840. firewall *Firewall
  49841. urlParams_ gensupport.URLParams
  49842. ctx_ context.Context
  49843. header_ http.Header
  49844. }
  49845. // Insert: Creates a firewall rule in the specified project using the
  49846. // data included in the request.
  49847. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  49848. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  49849. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49850. c.project = project
  49851. c.firewall = firewall
  49852. return c
  49853. }
  49854. // RequestId sets the optional parameter "requestId": An optional
  49855. // request ID to identify requests. Specify a unique request ID so that
  49856. // if you must retry your request, the server will know to ignore the
  49857. // request if it has already been completed.
  49858. //
  49859. // For example, consider a situation where you make an initial request
  49860. // and the request times out. If you make the request again with the
  49861. // same request ID, the server can check if original operation with the
  49862. // same request ID was received, and if so, will ignore the second
  49863. // request. This prevents clients from accidentally creating duplicate
  49864. // commitments.
  49865. //
  49866. // The request ID must be a valid UUID with the exception that zero UUID
  49867. // is not supported (00000000-0000-0000-0000-000000000000).
  49868. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  49869. c.urlParams_.Set("requestId", requestId)
  49870. return c
  49871. }
  49872. // Fields allows partial responses to be retrieved. See
  49873. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49874. // for more information.
  49875. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  49876. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49877. return c
  49878. }
  49879. // Context sets the context to be used in this call's Do method. Any
  49880. // pending HTTP request will be aborted if the provided context is
  49881. // canceled.
  49882. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  49883. c.ctx_ = ctx
  49884. return c
  49885. }
  49886. // Header returns an http.Header that can be modified by the caller to
  49887. // add HTTP headers to the request.
  49888. func (c *FirewallsInsertCall) Header() http.Header {
  49889. if c.header_ == nil {
  49890. c.header_ = make(http.Header)
  49891. }
  49892. return c.header_
  49893. }
  49894. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  49895. reqHeaders := make(http.Header)
  49896. for k, v := range c.header_ {
  49897. reqHeaders[k] = v
  49898. }
  49899. reqHeaders.Set("User-Agent", c.s.userAgent())
  49900. var body io.Reader = nil
  49901. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  49902. if err != nil {
  49903. return nil, err
  49904. }
  49905. reqHeaders.Set("Content-Type", "application/json")
  49906. c.urlParams_.Set("alt", alt)
  49907. c.urlParams_.Set("prettyPrint", "false")
  49908. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  49909. urls += "?" + c.urlParams_.Encode()
  49910. req, err := http.NewRequest("POST", urls, body)
  49911. if err != nil {
  49912. return nil, err
  49913. }
  49914. req.Header = reqHeaders
  49915. googleapi.Expand(req.URL, map[string]string{
  49916. "project": c.project,
  49917. })
  49918. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49919. }
  49920. // Do executes the "compute.firewalls.insert" call.
  49921. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49922. // status code is an error. Response headers are in either
  49923. // *Operation.ServerResponse.Header or (if a response was returned at
  49924. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49925. // to check whether the returned error was because
  49926. // http.StatusNotModified was returned.
  49927. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49928. gensupport.SetOptions(c.urlParams_, opts...)
  49929. res, err := c.doRequest("json")
  49930. if res != nil && res.StatusCode == http.StatusNotModified {
  49931. if res.Body != nil {
  49932. res.Body.Close()
  49933. }
  49934. return nil, &googleapi.Error{
  49935. Code: res.StatusCode,
  49936. Header: res.Header,
  49937. }
  49938. }
  49939. if err != nil {
  49940. return nil, err
  49941. }
  49942. defer googleapi.CloseBody(res)
  49943. if err := googleapi.CheckResponse(res); err != nil {
  49944. return nil, err
  49945. }
  49946. ret := &Operation{
  49947. ServerResponse: googleapi.ServerResponse{
  49948. Header: res.Header,
  49949. HTTPStatusCode: res.StatusCode,
  49950. },
  49951. }
  49952. target := &ret
  49953. if err := gensupport.DecodeResponse(target, res); err != nil {
  49954. return nil, err
  49955. }
  49956. return ret, nil
  49957. // {
  49958. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  49959. // "httpMethod": "POST",
  49960. // "id": "compute.firewalls.insert",
  49961. // "parameterOrder": [
  49962. // "project"
  49963. // ],
  49964. // "parameters": {
  49965. // "project": {
  49966. // "description": "Project ID for this request.",
  49967. // "location": "path",
  49968. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49969. // "required": true,
  49970. // "type": "string"
  49971. // },
  49972. // "requestId": {
  49973. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49974. // "location": "query",
  49975. // "type": "string"
  49976. // }
  49977. // },
  49978. // "path": "{project}/global/firewalls",
  49979. // "request": {
  49980. // "$ref": "Firewall"
  49981. // },
  49982. // "response": {
  49983. // "$ref": "Operation"
  49984. // },
  49985. // "scopes": [
  49986. // "https://www.googleapis.com/auth/cloud-platform",
  49987. // "https://www.googleapis.com/auth/compute"
  49988. // ]
  49989. // }
  49990. }
  49991. // method id "compute.firewalls.list":
  49992. type FirewallsListCall struct {
  49993. s *Service
  49994. project string
  49995. urlParams_ gensupport.URLParams
  49996. ifNoneMatch_ string
  49997. ctx_ context.Context
  49998. header_ http.Header
  49999. }
  50000. // List: Retrieves the list of firewall rules available to the specified
  50001. // project.
  50002. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  50003. func (r *FirewallsService) List(project string) *FirewallsListCall {
  50004. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50005. c.project = project
  50006. return c
  50007. }
  50008. // Filter sets the optional parameter "filter": A filter expression that
  50009. // filters resources listed in the response. The expression must specify
  50010. // the field name, a comparison operator, and the value that you want to
  50011. // use for filtering. The value must be a string, a number, or a
  50012. // boolean. The comparison operator must be either =, !=, >, or <.
  50013. //
  50014. // For example, if you are filtering Compute Engine instances, you can
  50015. // exclude instances named example-instance by specifying name !=
  50016. // example-instance.
  50017. //
  50018. // You can also filter nested fields. For example, you could specify
  50019. // scheduling.automaticRestart = false to include instances only if they
  50020. // are not scheduled for automatic restarts. You can use filtering on
  50021. // nested fields to filter based on resource labels.
  50022. //
  50023. // To filter on multiple expressions, provide each separate expression
  50024. // within parentheses. For example, (scheduling.automaticRestart = true)
  50025. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50026. // AND expression. However, you can include AND and OR expressions
  50027. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50028. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50029. // true).
  50030. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  50031. c.urlParams_.Set("filter", filter)
  50032. return c
  50033. }
  50034. // MaxResults sets the optional parameter "maxResults": The maximum
  50035. // number of results per page that should be returned. If the number of
  50036. // available results is larger than maxResults, Compute Engine returns a
  50037. // nextPageToken that can be used to get the next page of results in
  50038. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50039. // (Default: 500)
  50040. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  50041. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50042. return c
  50043. }
  50044. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50045. // a certain order. By default, results are returned in alphanumerical
  50046. // order based on the resource name.
  50047. //
  50048. // You can also sort results in descending order based on the creation
  50049. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50050. // based on the creationTimestamp field in reverse chronological order
  50051. // (newest result first). Use this to sort resources like operations so
  50052. // that the newest operation is returned first.
  50053. //
  50054. // Currently, only sorting by name or creationTimestamp desc is
  50055. // supported.
  50056. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  50057. c.urlParams_.Set("orderBy", orderBy)
  50058. return c
  50059. }
  50060. // PageToken sets the optional parameter "pageToken": Specifies a page
  50061. // token to use. Set pageToken to the nextPageToken returned by a
  50062. // previous list request to get the next page of results.
  50063. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  50064. c.urlParams_.Set("pageToken", pageToken)
  50065. return c
  50066. }
  50067. // Fields allows partial responses to be retrieved. See
  50068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50069. // for more information.
  50070. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  50071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50072. return c
  50073. }
  50074. // IfNoneMatch sets the optional parameter which makes the operation
  50075. // fail if the object's ETag matches the given value. This is useful for
  50076. // getting updates only after the object has changed since the last
  50077. // request. Use googleapi.IsNotModified to check whether the response
  50078. // error from Do is the result of In-None-Match.
  50079. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  50080. c.ifNoneMatch_ = entityTag
  50081. return c
  50082. }
  50083. // Context sets the context to be used in this call's Do method. Any
  50084. // pending HTTP request will be aborted if the provided context is
  50085. // canceled.
  50086. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  50087. c.ctx_ = ctx
  50088. return c
  50089. }
  50090. // Header returns an http.Header that can be modified by the caller to
  50091. // add HTTP headers to the request.
  50092. func (c *FirewallsListCall) Header() http.Header {
  50093. if c.header_ == nil {
  50094. c.header_ = make(http.Header)
  50095. }
  50096. return c.header_
  50097. }
  50098. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  50099. reqHeaders := make(http.Header)
  50100. for k, v := range c.header_ {
  50101. reqHeaders[k] = v
  50102. }
  50103. reqHeaders.Set("User-Agent", c.s.userAgent())
  50104. if c.ifNoneMatch_ != "" {
  50105. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50106. }
  50107. var body io.Reader = nil
  50108. c.urlParams_.Set("alt", alt)
  50109. c.urlParams_.Set("prettyPrint", "false")
  50110. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  50111. urls += "?" + c.urlParams_.Encode()
  50112. req, err := http.NewRequest("GET", urls, body)
  50113. if err != nil {
  50114. return nil, err
  50115. }
  50116. req.Header = reqHeaders
  50117. googleapi.Expand(req.URL, map[string]string{
  50118. "project": c.project,
  50119. })
  50120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50121. }
  50122. // Do executes the "compute.firewalls.list" call.
  50123. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  50124. // status code is an error. Response headers are in either
  50125. // *FirewallList.ServerResponse.Header or (if a response was returned at
  50126. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50127. // to check whether the returned error was because
  50128. // http.StatusNotModified was returned.
  50129. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  50130. gensupport.SetOptions(c.urlParams_, opts...)
  50131. res, err := c.doRequest("json")
  50132. if res != nil && res.StatusCode == http.StatusNotModified {
  50133. if res.Body != nil {
  50134. res.Body.Close()
  50135. }
  50136. return nil, &googleapi.Error{
  50137. Code: res.StatusCode,
  50138. Header: res.Header,
  50139. }
  50140. }
  50141. if err != nil {
  50142. return nil, err
  50143. }
  50144. defer googleapi.CloseBody(res)
  50145. if err := googleapi.CheckResponse(res); err != nil {
  50146. return nil, err
  50147. }
  50148. ret := &FirewallList{
  50149. ServerResponse: googleapi.ServerResponse{
  50150. Header: res.Header,
  50151. HTTPStatusCode: res.StatusCode,
  50152. },
  50153. }
  50154. target := &ret
  50155. if err := gensupport.DecodeResponse(target, res); err != nil {
  50156. return nil, err
  50157. }
  50158. return ret, nil
  50159. // {
  50160. // "description": "Retrieves the list of firewall rules available to the specified project.",
  50161. // "httpMethod": "GET",
  50162. // "id": "compute.firewalls.list",
  50163. // "parameterOrder": [
  50164. // "project"
  50165. // ],
  50166. // "parameters": {
  50167. // "filter": {
  50168. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  50169. // "location": "query",
  50170. // "type": "string"
  50171. // },
  50172. // "maxResults": {
  50173. // "default": "500",
  50174. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  50175. // "format": "uint32",
  50176. // "location": "query",
  50177. // "minimum": "0",
  50178. // "type": "integer"
  50179. // },
  50180. // "orderBy": {
  50181. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  50182. // "location": "query",
  50183. // "type": "string"
  50184. // },
  50185. // "pageToken": {
  50186. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  50187. // "location": "query",
  50188. // "type": "string"
  50189. // },
  50190. // "project": {
  50191. // "description": "Project ID for this request.",
  50192. // "location": "path",
  50193. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50194. // "required": true,
  50195. // "type": "string"
  50196. // }
  50197. // },
  50198. // "path": "{project}/global/firewalls",
  50199. // "response": {
  50200. // "$ref": "FirewallList"
  50201. // },
  50202. // "scopes": [
  50203. // "https://www.googleapis.com/auth/cloud-platform",
  50204. // "https://www.googleapis.com/auth/compute",
  50205. // "https://www.googleapis.com/auth/compute.readonly"
  50206. // ]
  50207. // }
  50208. }
  50209. // Pages invokes f for each page of results.
  50210. // A non-nil error returned from f will halt the iteration.
  50211. // The provided context supersedes any context provided to the Context method.
  50212. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  50213. c.ctx_ = ctx
  50214. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50215. for {
  50216. x, err := c.Do()
  50217. if err != nil {
  50218. return err
  50219. }
  50220. if err := f(x); err != nil {
  50221. return err
  50222. }
  50223. if x.NextPageToken == "" {
  50224. return nil
  50225. }
  50226. c.PageToken(x.NextPageToken)
  50227. }
  50228. }
  50229. // method id "compute.firewalls.patch":
  50230. type FirewallsPatchCall struct {
  50231. s *Service
  50232. project string
  50233. firewall string
  50234. firewall2 *Firewall
  50235. urlParams_ gensupport.URLParams
  50236. ctx_ context.Context
  50237. header_ http.Header
  50238. }
  50239. // Patch: Updates the specified firewall rule with the data included in
  50240. // the request. This method supports PATCH semantics and uses the JSON
  50241. // merge patch format and processing rules.
  50242. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  50243. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  50244. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50245. c.project = project
  50246. c.firewall = firewall
  50247. c.firewall2 = firewall2
  50248. return c
  50249. }
  50250. // RequestId sets the optional parameter "requestId": An optional
  50251. // request ID to identify requests. Specify a unique request ID so that
  50252. // if you must retry your request, the server will know to ignore the
  50253. // request if it has already been completed.
  50254. //
  50255. // For example, consider a situation where you make an initial request
  50256. // and the request times out. If you make the request again with the
  50257. // same request ID, the server can check if original operation with the
  50258. // same request ID was received, and if so, will ignore the second
  50259. // request. This prevents clients from accidentally creating duplicate
  50260. // commitments.
  50261. //
  50262. // The request ID must be a valid UUID with the exception that zero UUID
  50263. // is not supported (00000000-0000-0000-0000-000000000000).
  50264. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  50265. c.urlParams_.Set("requestId", requestId)
  50266. return c
  50267. }
  50268. // Fields allows partial responses to be retrieved. See
  50269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50270. // for more information.
  50271. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  50272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50273. return c
  50274. }
  50275. // Context sets the context to be used in this call's Do method. Any
  50276. // pending HTTP request will be aborted if the provided context is
  50277. // canceled.
  50278. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  50279. c.ctx_ = ctx
  50280. return c
  50281. }
  50282. // Header returns an http.Header that can be modified by the caller to
  50283. // add HTTP headers to the request.
  50284. func (c *FirewallsPatchCall) Header() http.Header {
  50285. if c.header_ == nil {
  50286. c.header_ = make(http.Header)
  50287. }
  50288. return c.header_
  50289. }
  50290. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  50291. reqHeaders := make(http.Header)
  50292. for k, v := range c.header_ {
  50293. reqHeaders[k] = v
  50294. }
  50295. reqHeaders.Set("User-Agent", c.s.userAgent())
  50296. var body io.Reader = nil
  50297. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  50298. if err != nil {
  50299. return nil, err
  50300. }
  50301. reqHeaders.Set("Content-Type", "application/json")
  50302. c.urlParams_.Set("alt", alt)
  50303. c.urlParams_.Set("prettyPrint", "false")
  50304. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  50305. urls += "?" + c.urlParams_.Encode()
  50306. req, err := http.NewRequest("PATCH", urls, body)
  50307. if err != nil {
  50308. return nil, err
  50309. }
  50310. req.Header = reqHeaders
  50311. googleapi.Expand(req.URL, map[string]string{
  50312. "project": c.project,
  50313. "firewall": c.firewall,
  50314. })
  50315. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50316. }
  50317. // Do executes the "compute.firewalls.patch" call.
  50318. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50319. // status code is an error. Response headers are in either
  50320. // *Operation.ServerResponse.Header or (if a response was returned at
  50321. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50322. // to check whether the returned error was because
  50323. // http.StatusNotModified was returned.
  50324. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50325. gensupport.SetOptions(c.urlParams_, opts...)
  50326. res, err := c.doRequest("json")
  50327. if res != nil && res.StatusCode == http.StatusNotModified {
  50328. if res.Body != nil {
  50329. res.Body.Close()
  50330. }
  50331. return nil, &googleapi.Error{
  50332. Code: res.StatusCode,
  50333. Header: res.Header,
  50334. }
  50335. }
  50336. if err != nil {
  50337. return nil, err
  50338. }
  50339. defer googleapi.CloseBody(res)
  50340. if err := googleapi.CheckResponse(res); err != nil {
  50341. return nil, err
  50342. }
  50343. ret := &Operation{
  50344. ServerResponse: googleapi.ServerResponse{
  50345. Header: res.Header,
  50346. HTTPStatusCode: res.StatusCode,
  50347. },
  50348. }
  50349. target := &ret
  50350. if err := gensupport.DecodeResponse(target, res); err != nil {
  50351. return nil, err
  50352. }
  50353. return ret, nil
  50354. // {
  50355. // "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.",
  50356. // "httpMethod": "PATCH",
  50357. // "id": "compute.firewalls.patch",
  50358. // "parameterOrder": [
  50359. // "project",
  50360. // "firewall"
  50361. // ],
  50362. // "parameters": {
  50363. // "firewall": {
  50364. // "description": "Name of the firewall rule to patch.",
  50365. // "location": "path",
  50366. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50367. // "required": true,
  50368. // "type": "string"
  50369. // },
  50370. // "project": {
  50371. // "description": "Project ID for this request.",
  50372. // "location": "path",
  50373. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50374. // "required": true,
  50375. // "type": "string"
  50376. // },
  50377. // "requestId": {
  50378. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50379. // "location": "query",
  50380. // "type": "string"
  50381. // }
  50382. // },
  50383. // "path": "{project}/global/firewalls/{firewall}",
  50384. // "request": {
  50385. // "$ref": "Firewall"
  50386. // },
  50387. // "response": {
  50388. // "$ref": "Operation"
  50389. // },
  50390. // "scopes": [
  50391. // "https://www.googleapis.com/auth/cloud-platform",
  50392. // "https://www.googleapis.com/auth/compute"
  50393. // ]
  50394. // }
  50395. }
  50396. // method id "compute.firewalls.testIamPermissions":
  50397. type FirewallsTestIamPermissionsCall struct {
  50398. s *Service
  50399. project string
  50400. resource string
  50401. testpermissionsrequest *TestPermissionsRequest
  50402. urlParams_ gensupport.URLParams
  50403. ctx_ context.Context
  50404. header_ http.Header
  50405. }
  50406. // TestIamPermissions: Returns permissions that a caller has on the
  50407. // specified resource.
  50408. func (r *FirewallsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *FirewallsTestIamPermissionsCall {
  50409. c := &FirewallsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50410. c.project = project
  50411. c.resource = resource
  50412. c.testpermissionsrequest = testpermissionsrequest
  50413. return c
  50414. }
  50415. // Fields allows partial responses to be retrieved. See
  50416. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50417. // for more information.
  50418. func (c *FirewallsTestIamPermissionsCall) Fields(s ...googleapi.Field) *FirewallsTestIamPermissionsCall {
  50419. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50420. return c
  50421. }
  50422. // Context sets the context to be used in this call's Do method. Any
  50423. // pending HTTP request will be aborted if the provided context is
  50424. // canceled.
  50425. func (c *FirewallsTestIamPermissionsCall) Context(ctx context.Context) *FirewallsTestIamPermissionsCall {
  50426. c.ctx_ = ctx
  50427. return c
  50428. }
  50429. // Header returns an http.Header that can be modified by the caller to
  50430. // add HTTP headers to the request.
  50431. func (c *FirewallsTestIamPermissionsCall) Header() http.Header {
  50432. if c.header_ == nil {
  50433. c.header_ = make(http.Header)
  50434. }
  50435. return c.header_
  50436. }
  50437. func (c *FirewallsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  50438. reqHeaders := make(http.Header)
  50439. for k, v := range c.header_ {
  50440. reqHeaders[k] = v
  50441. }
  50442. reqHeaders.Set("User-Agent", c.s.userAgent())
  50443. var body io.Reader = nil
  50444. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  50445. if err != nil {
  50446. return nil, err
  50447. }
  50448. reqHeaders.Set("Content-Type", "application/json")
  50449. c.urlParams_.Set("alt", alt)
  50450. c.urlParams_.Set("prettyPrint", "false")
  50451. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{resource}/testIamPermissions")
  50452. urls += "?" + c.urlParams_.Encode()
  50453. req, err := http.NewRequest("POST", urls, body)
  50454. if err != nil {
  50455. return nil, err
  50456. }
  50457. req.Header = reqHeaders
  50458. googleapi.Expand(req.URL, map[string]string{
  50459. "project": c.project,
  50460. "resource": c.resource,
  50461. })
  50462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50463. }
  50464. // Do executes the "compute.firewalls.testIamPermissions" call.
  50465. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  50466. // non-2xx status code is an error. Response headers are in either
  50467. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  50468. // returned at all) in error.(*googleapi.Error).Header. Use
  50469. // googleapi.IsNotModified to check whether the returned error was
  50470. // because http.StatusNotModified was returned.
  50471. func (c *FirewallsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  50472. gensupport.SetOptions(c.urlParams_, opts...)
  50473. res, err := c.doRequest("json")
  50474. if res != nil && res.StatusCode == http.StatusNotModified {
  50475. if res.Body != nil {
  50476. res.Body.Close()
  50477. }
  50478. return nil, &googleapi.Error{
  50479. Code: res.StatusCode,
  50480. Header: res.Header,
  50481. }
  50482. }
  50483. if err != nil {
  50484. return nil, err
  50485. }
  50486. defer googleapi.CloseBody(res)
  50487. if err := googleapi.CheckResponse(res); err != nil {
  50488. return nil, err
  50489. }
  50490. ret := &TestPermissionsResponse{
  50491. ServerResponse: googleapi.ServerResponse{
  50492. Header: res.Header,
  50493. HTTPStatusCode: res.StatusCode,
  50494. },
  50495. }
  50496. target := &ret
  50497. if err := gensupport.DecodeResponse(target, res); err != nil {
  50498. return nil, err
  50499. }
  50500. return ret, nil
  50501. // {
  50502. // "description": "Returns permissions that a caller has on the specified resource.",
  50503. // "httpMethod": "POST",
  50504. // "id": "compute.firewalls.testIamPermissions",
  50505. // "parameterOrder": [
  50506. // "project",
  50507. // "resource"
  50508. // ],
  50509. // "parameters": {
  50510. // "project": {
  50511. // "description": "Project ID for this request.",
  50512. // "location": "path",
  50513. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50514. // "required": true,
  50515. // "type": "string"
  50516. // },
  50517. // "resource": {
  50518. // "description": "Name or id of the resource for this request.",
  50519. // "location": "path",
  50520. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50521. // "required": true,
  50522. // "type": "string"
  50523. // }
  50524. // },
  50525. // "path": "{project}/global/firewalls/{resource}/testIamPermissions",
  50526. // "request": {
  50527. // "$ref": "TestPermissionsRequest"
  50528. // },
  50529. // "response": {
  50530. // "$ref": "TestPermissionsResponse"
  50531. // },
  50532. // "scopes": [
  50533. // "https://www.googleapis.com/auth/cloud-platform",
  50534. // "https://www.googleapis.com/auth/compute",
  50535. // "https://www.googleapis.com/auth/compute.readonly"
  50536. // ]
  50537. // }
  50538. }
  50539. // method id "compute.firewalls.update":
  50540. type FirewallsUpdateCall struct {
  50541. s *Service
  50542. project string
  50543. firewall string
  50544. firewall2 *Firewall
  50545. urlParams_ gensupport.URLParams
  50546. ctx_ context.Context
  50547. header_ http.Header
  50548. }
  50549. // Update: Updates the specified firewall rule with the data included in
  50550. // the request. The PUT method can only update the following fields of
  50551. // firewall rule: allowed, description, sourceRanges, sourceTags,
  50552. // targetTags.
  50553. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  50554. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  50555. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50556. c.project = project
  50557. c.firewall = firewall
  50558. c.firewall2 = firewall2
  50559. return c
  50560. }
  50561. // RequestId sets the optional parameter "requestId": An optional
  50562. // request ID to identify requests. Specify a unique request ID so that
  50563. // if you must retry your request, the server will know to ignore the
  50564. // request if it has already been completed.
  50565. //
  50566. // For example, consider a situation where you make an initial request
  50567. // and the request times out. If you make the request again with the
  50568. // same request ID, the server can check if original operation with the
  50569. // same request ID was received, and if so, will ignore the second
  50570. // request. This prevents clients from accidentally creating duplicate
  50571. // commitments.
  50572. //
  50573. // The request ID must be a valid UUID with the exception that zero UUID
  50574. // is not supported (00000000-0000-0000-0000-000000000000).
  50575. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  50576. c.urlParams_.Set("requestId", requestId)
  50577. return c
  50578. }
  50579. // Fields allows partial responses to be retrieved. See
  50580. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50581. // for more information.
  50582. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  50583. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50584. return c
  50585. }
  50586. // Context sets the context to be used in this call's Do method. Any
  50587. // pending HTTP request will be aborted if the provided context is
  50588. // canceled.
  50589. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  50590. c.ctx_ = ctx
  50591. return c
  50592. }
  50593. // Header returns an http.Header that can be modified by the caller to
  50594. // add HTTP headers to the request.
  50595. func (c *FirewallsUpdateCall) Header() http.Header {
  50596. if c.header_ == nil {
  50597. c.header_ = make(http.Header)
  50598. }
  50599. return c.header_
  50600. }
  50601. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  50602. reqHeaders := make(http.Header)
  50603. for k, v := range c.header_ {
  50604. reqHeaders[k] = v
  50605. }
  50606. reqHeaders.Set("User-Agent", c.s.userAgent())
  50607. var body io.Reader = nil
  50608. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  50609. if err != nil {
  50610. return nil, err
  50611. }
  50612. reqHeaders.Set("Content-Type", "application/json")
  50613. c.urlParams_.Set("alt", alt)
  50614. c.urlParams_.Set("prettyPrint", "false")
  50615. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  50616. urls += "?" + c.urlParams_.Encode()
  50617. req, err := http.NewRequest("PUT", urls, body)
  50618. if err != nil {
  50619. return nil, err
  50620. }
  50621. req.Header = reqHeaders
  50622. googleapi.Expand(req.URL, map[string]string{
  50623. "project": c.project,
  50624. "firewall": c.firewall,
  50625. })
  50626. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50627. }
  50628. // Do executes the "compute.firewalls.update" call.
  50629. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50630. // status code is an error. Response headers are in either
  50631. // *Operation.ServerResponse.Header or (if a response was returned at
  50632. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50633. // to check whether the returned error was because
  50634. // http.StatusNotModified was returned.
  50635. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50636. gensupport.SetOptions(c.urlParams_, opts...)
  50637. res, err := c.doRequest("json")
  50638. if res != nil && res.StatusCode == http.StatusNotModified {
  50639. if res.Body != nil {
  50640. res.Body.Close()
  50641. }
  50642. return nil, &googleapi.Error{
  50643. Code: res.StatusCode,
  50644. Header: res.Header,
  50645. }
  50646. }
  50647. if err != nil {
  50648. return nil, err
  50649. }
  50650. defer googleapi.CloseBody(res)
  50651. if err := googleapi.CheckResponse(res); err != nil {
  50652. return nil, err
  50653. }
  50654. ret := &Operation{
  50655. ServerResponse: googleapi.ServerResponse{
  50656. Header: res.Header,
  50657. HTTPStatusCode: res.StatusCode,
  50658. },
  50659. }
  50660. target := &ret
  50661. if err := gensupport.DecodeResponse(target, res); err != nil {
  50662. return nil, err
  50663. }
  50664. return ret, nil
  50665. // {
  50666. // "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.",
  50667. // "httpMethod": "PUT",
  50668. // "id": "compute.firewalls.update",
  50669. // "parameterOrder": [
  50670. // "project",
  50671. // "firewall"
  50672. // ],
  50673. // "parameters": {
  50674. // "firewall": {
  50675. // "description": "Name of the firewall rule to update.",
  50676. // "location": "path",
  50677. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50678. // "required": true,
  50679. // "type": "string"
  50680. // },
  50681. // "project": {
  50682. // "description": "Project ID for this request.",
  50683. // "location": "path",
  50684. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50685. // "required": true,
  50686. // "type": "string"
  50687. // },
  50688. // "requestId": {
  50689. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50690. // "location": "query",
  50691. // "type": "string"
  50692. // }
  50693. // },
  50694. // "path": "{project}/global/firewalls/{firewall}",
  50695. // "request": {
  50696. // "$ref": "Firewall"
  50697. // },
  50698. // "response": {
  50699. // "$ref": "Operation"
  50700. // },
  50701. // "scopes": [
  50702. // "https://www.googleapis.com/auth/cloud-platform",
  50703. // "https://www.googleapis.com/auth/compute"
  50704. // ]
  50705. // }
  50706. }
  50707. // method id "compute.forwardingRules.aggregatedList":
  50708. type ForwardingRulesAggregatedListCall struct {
  50709. s *Service
  50710. project string
  50711. urlParams_ gensupport.URLParams
  50712. ifNoneMatch_ string
  50713. ctx_ context.Context
  50714. header_ http.Header
  50715. }
  50716. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  50717. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  50718. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  50719. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50720. c.project = project
  50721. return c
  50722. }
  50723. // Filter sets the optional parameter "filter": A filter expression that
  50724. // filters resources listed in the response. The expression must specify
  50725. // the field name, a comparison operator, and the value that you want to
  50726. // use for filtering. The value must be a string, a number, or a
  50727. // boolean. The comparison operator must be either =, !=, >, or <.
  50728. //
  50729. // For example, if you are filtering Compute Engine instances, you can
  50730. // exclude instances named example-instance by specifying name !=
  50731. // example-instance.
  50732. //
  50733. // You can also filter nested fields. For example, you could specify
  50734. // scheduling.automaticRestart = false to include instances only if they
  50735. // are not scheduled for automatic restarts. You can use filtering on
  50736. // nested fields to filter based on resource labels.
  50737. //
  50738. // To filter on multiple expressions, provide each separate expression
  50739. // within parentheses. For example, (scheduling.automaticRestart = true)
  50740. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50741. // AND expression. However, you can include AND and OR expressions
  50742. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50743. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50744. // true).
  50745. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  50746. c.urlParams_.Set("filter", filter)
  50747. return c
  50748. }
  50749. // MaxResults sets the optional parameter "maxResults": The maximum
  50750. // number of results per page that should be returned. If the number of
  50751. // available results is larger than maxResults, Compute Engine returns a
  50752. // nextPageToken that can be used to get the next page of results in
  50753. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50754. // (Default: 500)
  50755. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  50756. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50757. return c
  50758. }
  50759. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50760. // a certain order. By default, results are returned in alphanumerical
  50761. // order based on the resource name.
  50762. //
  50763. // You can also sort results in descending order based on the creation
  50764. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50765. // based on the creationTimestamp field in reverse chronological order
  50766. // (newest result first). Use this to sort resources like operations so
  50767. // that the newest operation is returned first.
  50768. //
  50769. // Currently, only sorting by name or creationTimestamp desc is
  50770. // supported.
  50771. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  50772. c.urlParams_.Set("orderBy", orderBy)
  50773. return c
  50774. }
  50775. // PageToken sets the optional parameter "pageToken": Specifies a page
  50776. // token to use. Set pageToken to the nextPageToken returned by a
  50777. // previous list request to get the next page of results.
  50778. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  50779. c.urlParams_.Set("pageToken", pageToken)
  50780. return c
  50781. }
  50782. // Fields allows partial responses to be retrieved. See
  50783. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50784. // for more information.
  50785. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  50786. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50787. return c
  50788. }
  50789. // IfNoneMatch sets the optional parameter which makes the operation
  50790. // fail if the object's ETag matches the given value. This is useful for
  50791. // getting updates only after the object has changed since the last
  50792. // request. Use googleapi.IsNotModified to check whether the response
  50793. // error from Do is the result of In-None-Match.
  50794. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  50795. c.ifNoneMatch_ = entityTag
  50796. return c
  50797. }
  50798. // Context sets the context to be used in this call's Do method. Any
  50799. // pending HTTP request will be aborted if the provided context is
  50800. // canceled.
  50801. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  50802. c.ctx_ = ctx
  50803. return c
  50804. }
  50805. // Header returns an http.Header that can be modified by the caller to
  50806. // add HTTP headers to the request.
  50807. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  50808. if c.header_ == nil {
  50809. c.header_ = make(http.Header)
  50810. }
  50811. return c.header_
  50812. }
  50813. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  50814. reqHeaders := make(http.Header)
  50815. for k, v := range c.header_ {
  50816. reqHeaders[k] = v
  50817. }
  50818. reqHeaders.Set("User-Agent", c.s.userAgent())
  50819. if c.ifNoneMatch_ != "" {
  50820. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50821. }
  50822. var body io.Reader = nil
  50823. c.urlParams_.Set("alt", alt)
  50824. c.urlParams_.Set("prettyPrint", "false")
  50825. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  50826. urls += "?" + c.urlParams_.Encode()
  50827. req, err := http.NewRequest("GET", urls, body)
  50828. if err != nil {
  50829. return nil, err
  50830. }
  50831. req.Header = reqHeaders
  50832. googleapi.Expand(req.URL, map[string]string{
  50833. "project": c.project,
  50834. })
  50835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50836. }
  50837. // Do executes the "compute.forwardingRules.aggregatedList" call.
  50838. // Exactly one of *ForwardingRuleAggregatedList or error will be
  50839. // non-nil. Any non-2xx status code is an error. Response headers are in
  50840. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  50841. // response was returned at all) in error.(*googleapi.Error).Header. Use
  50842. // googleapi.IsNotModified to check whether the returned error was
  50843. // because http.StatusNotModified was returned.
  50844. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  50845. gensupport.SetOptions(c.urlParams_, opts...)
  50846. res, err := c.doRequest("json")
  50847. if res != nil && res.StatusCode == http.StatusNotModified {
  50848. if res.Body != nil {
  50849. res.Body.Close()
  50850. }
  50851. return nil, &googleapi.Error{
  50852. Code: res.StatusCode,
  50853. Header: res.Header,
  50854. }
  50855. }
  50856. if err != nil {
  50857. return nil, err
  50858. }
  50859. defer googleapi.CloseBody(res)
  50860. if err := googleapi.CheckResponse(res); err != nil {
  50861. return nil, err
  50862. }
  50863. ret := &ForwardingRuleAggregatedList{
  50864. ServerResponse: googleapi.ServerResponse{
  50865. Header: res.Header,
  50866. HTTPStatusCode: res.StatusCode,
  50867. },
  50868. }
  50869. target := &ret
  50870. if err := gensupport.DecodeResponse(target, res); err != nil {
  50871. return nil, err
  50872. }
  50873. return ret, nil
  50874. // {
  50875. // "description": "Retrieves an aggregated list of forwarding rules.",
  50876. // "httpMethod": "GET",
  50877. // "id": "compute.forwardingRules.aggregatedList",
  50878. // "parameterOrder": [
  50879. // "project"
  50880. // ],
  50881. // "parameters": {
  50882. // "filter": {
  50883. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  50884. // "location": "query",
  50885. // "type": "string"
  50886. // },
  50887. // "maxResults": {
  50888. // "default": "500",
  50889. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  50890. // "format": "uint32",
  50891. // "location": "query",
  50892. // "minimum": "0",
  50893. // "type": "integer"
  50894. // },
  50895. // "orderBy": {
  50896. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  50897. // "location": "query",
  50898. // "type": "string"
  50899. // },
  50900. // "pageToken": {
  50901. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  50902. // "location": "query",
  50903. // "type": "string"
  50904. // },
  50905. // "project": {
  50906. // "description": "Project ID for this request.",
  50907. // "location": "path",
  50908. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50909. // "required": true,
  50910. // "type": "string"
  50911. // }
  50912. // },
  50913. // "path": "{project}/aggregated/forwardingRules",
  50914. // "response": {
  50915. // "$ref": "ForwardingRuleAggregatedList"
  50916. // },
  50917. // "scopes": [
  50918. // "https://www.googleapis.com/auth/cloud-platform",
  50919. // "https://www.googleapis.com/auth/compute",
  50920. // "https://www.googleapis.com/auth/compute.readonly"
  50921. // ]
  50922. // }
  50923. }
  50924. // Pages invokes f for each page of results.
  50925. // A non-nil error returned from f will halt the iteration.
  50926. // The provided context supersedes any context provided to the Context method.
  50927. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  50928. c.ctx_ = ctx
  50929. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50930. for {
  50931. x, err := c.Do()
  50932. if err != nil {
  50933. return err
  50934. }
  50935. if err := f(x); err != nil {
  50936. return err
  50937. }
  50938. if x.NextPageToken == "" {
  50939. return nil
  50940. }
  50941. c.PageToken(x.NextPageToken)
  50942. }
  50943. }
  50944. // method id "compute.forwardingRules.delete":
  50945. type ForwardingRulesDeleteCall struct {
  50946. s *Service
  50947. project string
  50948. region string
  50949. forwardingRule string
  50950. urlParams_ gensupport.URLParams
  50951. ctx_ context.Context
  50952. header_ http.Header
  50953. }
  50954. // Delete: Deletes the specified ForwardingRule resource.
  50955. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  50956. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  50957. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50958. c.project = project
  50959. c.region = region
  50960. c.forwardingRule = forwardingRule
  50961. return c
  50962. }
  50963. // RequestId sets the optional parameter "requestId": An optional
  50964. // request ID to identify requests. Specify a unique request ID so that
  50965. // if you must retry your request, the server will know to ignore the
  50966. // request if it has already been completed.
  50967. //
  50968. // For example, consider a situation where you make an initial request
  50969. // and the request times out. If you make the request again with the
  50970. // same request ID, the server can check if original operation with the
  50971. // same request ID was received, and if so, will ignore the second
  50972. // request. This prevents clients from accidentally creating duplicate
  50973. // commitments.
  50974. //
  50975. // The request ID must be a valid UUID with the exception that zero UUID
  50976. // is not supported (00000000-0000-0000-0000-000000000000).
  50977. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  50978. c.urlParams_.Set("requestId", requestId)
  50979. return c
  50980. }
  50981. // Fields allows partial responses to be retrieved. See
  50982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50983. // for more information.
  50984. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  50985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50986. return c
  50987. }
  50988. // Context sets the context to be used in this call's Do method. Any
  50989. // pending HTTP request will be aborted if the provided context is
  50990. // canceled.
  50991. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  50992. c.ctx_ = ctx
  50993. return c
  50994. }
  50995. // Header returns an http.Header that can be modified by the caller to
  50996. // add HTTP headers to the request.
  50997. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  50998. if c.header_ == nil {
  50999. c.header_ = make(http.Header)
  51000. }
  51001. return c.header_
  51002. }
  51003. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  51004. reqHeaders := make(http.Header)
  51005. for k, v := range c.header_ {
  51006. reqHeaders[k] = v
  51007. }
  51008. reqHeaders.Set("User-Agent", c.s.userAgent())
  51009. var body io.Reader = nil
  51010. c.urlParams_.Set("alt", alt)
  51011. c.urlParams_.Set("prettyPrint", "false")
  51012. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  51013. urls += "?" + c.urlParams_.Encode()
  51014. req, err := http.NewRequest("DELETE", urls, body)
  51015. if err != nil {
  51016. return nil, err
  51017. }
  51018. req.Header = reqHeaders
  51019. googleapi.Expand(req.URL, map[string]string{
  51020. "project": c.project,
  51021. "region": c.region,
  51022. "forwardingRule": c.forwardingRule,
  51023. })
  51024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51025. }
  51026. // Do executes the "compute.forwardingRules.delete" call.
  51027. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51028. // status code is an error. Response headers are in either
  51029. // *Operation.ServerResponse.Header or (if a response was returned at
  51030. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51031. // to check whether the returned error was because
  51032. // http.StatusNotModified was returned.
  51033. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51034. gensupport.SetOptions(c.urlParams_, opts...)
  51035. res, err := c.doRequest("json")
  51036. if res != nil && res.StatusCode == http.StatusNotModified {
  51037. if res.Body != nil {
  51038. res.Body.Close()
  51039. }
  51040. return nil, &googleapi.Error{
  51041. Code: res.StatusCode,
  51042. Header: res.Header,
  51043. }
  51044. }
  51045. if err != nil {
  51046. return nil, err
  51047. }
  51048. defer googleapi.CloseBody(res)
  51049. if err := googleapi.CheckResponse(res); err != nil {
  51050. return nil, err
  51051. }
  51052. ret := &Operation{
  51053. ServerResponse: googleapi.ServerResponse{
  51054. Header: res.Header,
  51055. HTTPStatusCode: res.StatusCode,
  51056. },
  51057. }
  51058. target := &ret
  51059. if err := gensupport.DecodeResponse(target, res); err != nil {
  51060. return nil, err
  51061. }
  51062. return ret, nil
  51063. // {
  51064. // "description": "Deletes the specified ForwardingRule resource.",
  51065. // "httpMethod": "DELETE",
  51066. // "id": "compute.forwardingRules.delete",
  51067. // "parameterOrder": [
  51068. // "project",
  51069. // "region",
  51070. // "forwardingRule"
  51071. // ],
  51072. // "parameters": {
  51073. // "forwardingRule": {
  51074. // "description": "Name of the ForwardingRule resource to delete.",
  51075. // "location": "path",
  51076. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51077. // "required": true,
  51078. // "type": "string"
  51079. // },
  51080. // "project": {
  51081. // "description": "Project ID for this request.",
  51082. // "location": "path",
  51083. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51084. // "required": true,
  51085. // "type": "string"
  51086. // },
  51087. // "region": {
  51088. // "description": "Name of the region scoping this request.",
  51089. // "location": "path",
  51090. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51091. // "required": true,
  51092. // "type": "string"
  51093. // },
  51094. // "requestId": {
  51095. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51096. // "location": "query",
  51097. // "type": "string"
  51098. // }
  51099. // },
  51100. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  51101. // "response": {
  51102. // "$ref": "Operation"
  51103. // },
  51104. // "scopes": [
  51105. // "https://www.googleapis.com/auth/cloud-platform",
  51106. // "https://www.googleapis.com/auth/compute"
  51107. // ]
  51108. // }
  51109. }
  51110. // method id "compute.forwardingRules.get":
  51111. type ForwardingRulesGetCall struct {
  51112. s *Service
  51113. project string
  51114. region string
  51115. forwardingRule string
  51116. urlParams_ gensupport.URLParams
  51117. ifNoneMatch_ string
  51118. ctx_ context.Context
  51119. header_ http.Header
  51120. }
  51121. // Get: Returns the specified ForwardingRule resource.
  51122. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  51123. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  51124. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51125. c.project = project
  51126. c.region = region
  51127. c.forwardingRule = forwardingRule
  51128. return c
  51129. }
  51130. // Fields allows partial responses to be retrieved. See
  51131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51132. // for more information.
  51133. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  51134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51135. return c
  51136. }
  51137. // IfNoneMatch sets the optional parameter which makes the operation
  51138. // fail if the object's ETag matches the given value. This is useful for
  51139. // getting updates only after the object has changed since the last
  51140. // request. Use googleapi.IsNotModified to check whether the response
  51141. // error from Do is the result of In-None-Match.
  51142. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  51143. c.ifNoneMatch_ = entityTag
  51144. return c
  51145. }
  51146. // Context sets the context to be used in this call's Do method. Any
  51147. // pending HTTP request will be aborted if the provided context is
  51148. // canceled.
  51149. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  51150. c.ctx_ = ctx
  51151. return c
  51152. }
  51153. // Header returns an http.Header that can be modified by the caller to
  51154. // add HTTP headers to the request.
  51155. func (c *ForwardingRulesGetCall) Header() http.Header {
  51156. if c.header_ == nil {
  51157. c.header_ = make(http.Header)
  51158. }
  51159. return c.header_
  51160. }
  51161. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  51162. reqHeaders := make(http.Header)
  51163. for k, v := range c.header_ {
  51164. reqHeaders[k] = v
  51165. }
  51166. reqHeaders.Set("User-Agent", c.s.userAgent())
  51167. if c.ifNoneMatch_ != "" {
  51168. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51169. }
  51170. var body io.Reader = nil
  51171. c.urlParams_.Set("alt", alt)
  51172. c.urlParams_.Set("prettyPrint", "false")
  51173. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  51174. urls += "?" + c.urlParams_.Encode()
  51175. req, err := http.NewRequest("GET", urls, body)
  51176. if err != nil {
  51177. return nil, err
  51178. }
  51179. req.Header = reqHeaders
  51180. googleapi.Expand(req.URL, map[string]string{
  51181. "project": c.project,
  51182. "region": c.region,
  51183. "forwardingRule": c.forwardingRule,
  51184. })
  51185. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51186. }
  51187. // Do executes the "compute.forwardingRules.get" call.
  51188. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  51189. // status code is an error. Response headers are in either
  51190. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  51191. // at all) in error.(*googleapi.Error).Header. Use
  51192. // googleapi.IsNotModified to check whether the returned error was
  51193. // because http.StatusNotModified was returned.
  51194. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  51195. gensupport.SetOptions(c.urlParams_, opts...)
  51196. res, err := c.doRequest("json")
  51197. if res != nil && res.StatusCode == http.StatusNotModified {
  51198. if res.Body != nil {
  51199. res.Body.Close()
  51200. }
  51201. return nil, &googleapi.Error{
  51202. Code: res.StatusCode,
  51203. Header: res.Header,
  51204. }
  51205. }
  51206. if err != nil {
  51207. return nil, err
  51208. }
  51209. defer googleapi.CloseBody(res)
  51210. if err := googleapi.CheckResponse(res); err != nil {
  51211. return nil, err
  51212. }
  51213. ret := &ForwardingRule{
  51214. ServerResponse: googleapi.ServerResponse{
  51215. Header: res.Header,
  51216. HTTPStatusCode: res.StatusCode,
  51217. },
  51218. }
  51219. target := &ret
  51220. if err := gensupport.DecodeResponse(target, res); err != nil {
  51221. return nil, err
  51222. }
  51223. return ret, nil
  51224. // {
  51225. // "description": "Returns the specified ForwardingRule resource.",
  51226. // "httpMethod": "GET",
  51227. // "id": "compute.forwardingRules.get",
  51228. // "parameterOrder": [
  51229. // "project",
  51230. // "region",
  51231. // "forwardingRule"
  51232. // ],
  51233. // "parameters": {
  51234. // "forwardingRule": {
  51235. // "description": "Name of the ForwardingRule resource to return.",
  51236. // "location": "path",
  51237. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51238. // "required": true,
  51239. // "type": "string"
  51240. // },
  51241. // "project": {
  51242. // "description": "Project ID for this request.",
  51243. // "location": "path",
  51244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51245. // "required": true,
  51246. // "type": "string"
  51247. // },
  51248. // "region": {
  51249. // "description": "Name of the region scoping this request.",
  51250. // "location": "path",
  51251. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51252. // "required": true,
  51253. // "type": "string"
  51254. // }
  51255. // },
  51256. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  51257. // "response": {
  51258. // "$ref": "ForwardingRule"
  51259. // },
  51260. // "scopes": [
  51261. // "https://www.googleapis.com/auth/cloud-platform",
  51262. // "https://www.googleapis.com/auth/compute",
  51263. // "https://www.googleapis.com/auth/compute.readonly"
  51264. // ]
  51265. // }
  51266. }
  51267. // method id "compute.forwardingRules.insert":
  51268. type ForwardingRulesInsertCall struct {
  51269. s *Service
  51270. project string
  51271. region string
  51272. forwardingrule *ForwardingRule
  51273. urlParams_ gensupport.URLParams
  51274. ctx_ context.Context
  51275. header_ http.Header
  51276. }
  51277. // Insert: Creates a ForwardingRule resource in the specified project
  51278. // and region using the data included in the request.
  51279. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  51280. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  51281. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51282. c.project = project
  51283. c.region = region
  51284. c.forwardingrule = forwardingrule
  51285. return c
  51286. }
  51287. // RequestId sets the optional parameter "requestId": An optional
  51288. // request ID to identify requests. Specify a unique request ID so that
  51289. // if you must retry your request, the server will know to ignore the
  51290. // request if it has already been completed.
  51291. //
  51292. // For example, consider a situation where you make an initial request
  51293. // and the request times out. If you make the request again with the
  51294. // same request ID, the server can check if original operation with the
  51295. // same request ID was received, and if so, will ignore the second
  51296. // request. This prevents clients from accidentally creating duplicate
  51297. // commitments.
  51298. //
  51299. // The request ID must be a valid UUID with the exception that zero UUID
  51300. // is not supported (00000000-0000-0000-0000-000000000000).
  51301. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  51302. c.urlParams_.Set("requestId", requestId)
  51303. return c
  51304. }
  51305. // Fields allows partial responses to be retrieved. See
  51306. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51307. // for more information.
  51308. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  51309. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51310. return c
  51311. }
  51312. // Context sets the context to be used in this call's Do method. Any
  51313. // pending HTTP request will be aborted if the provided context is
  51314. // canceled.
  51315. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  51316. c.ctx_ = ctx
  51317. return c
  51318. }
  51319. // Header returns an http.Header that can be modified by the caller to
  51320. // add HTTP headers to the request.
  51321. func (c *ForwardingRulesInsertCall) Header() http.Header {
  51322. if c.header_ == nil {
  51323. c.header_ = make(http.Header)
  51324. }
  51325. return c.header_
  51326. }
  51327. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  51328. reqHeaders := make(http.Header)
  51329. for k, v := range c.header_ {
  51330. reqHeaders[k] = v
  51331. }
  51332. reqHeaders.Set("User-Agent", c.s.userAgent())
  51333. var body io.Reader = nil
  51334. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  51335. if err != nil {
  51336. return nil, err
  51337. }
  51338. reqHeaders.Set("Content-Type", "application/json")
  51339. c.urlParams_.Set("alt", alt)
  51340. c.urlParams_.Set("prettyPrint", "false")
  51341. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  51342. urls += "?" + c.urlParams_.Encode()
  51343. req, err := http.NewRequest("POST", urls, body)
  51344. if err != nil {
  51345. return nil, err
  51346. }
  51347. req.Header = reqHeaders
  51348. googleapi.Expand(req.URL, map[string]string{
  51349. "project": c.project,
  51350. "region": c.region,
  51351. })
  51352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51353. }
  51354. // Do executes the "compute.forwardingRules.insert" call.
  51355. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51356. // status code is an error. Response headers are in either
  51357. // *Operation.ServerResponse.Header or (if a response was returned at
  51358. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51359. // to check whether the returned error was because
  51360. // http.StatusNotModified was returned.
  51361. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51362. gensupport.SetOptions(c.urlParams_, opts...)
  51363. res, err := c.doRequest("json")
  51364. if res != nil && res.StatusCode == http.StatusNotModified {
  51365. if res.Body != nil {
  51366. res.Body.Close()
  51367. }
  51368. return nil, &googleapi.Error{
  51369. Code: res.StatusCode,
  51370. Header: res.Header,
  51371. }
  51372. }
  51373. if err != nil {
  51374. return nil, err
  51375. }
  51376. defer googleapi.CloseBody(res)
  51377. if err := googleapi.CheckResponse(res); err != nil {
  51378. return nil, err
  51379. }
  51380. ret := &Operation{
  51381. ServerResponse: googleapi.ServerResponse{
  51382. Header: res.Header,
  51383. HTTPStatusCode: res.StatusCode,
  51384. },
  51385. }
  51386. target := &ret
  51387. if err := gensupport.DecodeResponse(target, res); err != nil {
  51388. return nil, err
  51389. }
  51390. return ret, nil
  51391. // {
  51392. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  51393. // "httpMethod": "POST",
  51394. // "id": "compute.forwardingRules.insert",
  51395. // "parameterOrder": [
  51396. // "project",
  51397. // "region"
  51398. // ],
  51399. // "parameters": {
  51400. // "project": {
  51401. // "description": "Project ID for this request.",
  51402. // "location": "path",
  51403. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51404. // "required": true,
  51405. // "type": "string"
  51406. // },
  51407. // "region": {
  51408. // "description": "Name of the region scoping this request.",
  51409. // "location": "path",
  51410. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51411. // "required": true,
  51412. // "type": "string"
  51413. // },
  51414. // "requestId": {
  51415. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51416. // "location": "query",
  51417. // "type": "string"
  51418. // }
  51419. // },
  51420. // "path": "{project}/regions/{region}/forwardingRules",
  51421. // "request": {
  51422. // "$ref": "ForwardingRule"
  51423. // },
  51424. // "response": {
  51425. // "$ref": "Operation"
  51426. // },
  51427. // "scopes": [
  51428. // "https://www.googleapis.com/auth/cloud-platform",
  51429. // "https://www.googleapis.com/auth/compute"
  51430. // ]
  51431. // }
  51432. }
  51433. // method id "compute.forwardingRules.list":
  51434. type ForwardingRulesListCall struct {
  51435. s *Service
  51436. project string
  51437. region string
  51438. urlParams_ gensupport.URLParams
  51439. ifNoneMatch_ string
  51440. ctx_ context.Context
  51441. header_ http.Header
  51442. }
  51443. // List: Retrieves a list of ForwardingRule resources available to the
  51444. // specified project and region.
  51445. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  51446. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  51447. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51448. c.project = project
  51449. c.region = region
  51450. return c
  51451. }
  51452. // Filter sets the optional parameter "filter": A filter expression that
  51453. // filters resources listed in the response. The expression must specify
  51454. // the field name, a comparison operator, and the value that you want to
  51455. // use for filtering. The value must be a string, a number, or a
  51456. // boolean. The comparison operator must be either =, !=, >, or <.
  51457. //
  51458. // For example, if you are filtering Compute Engine instances, you can
  51459. // exclude instances named example-instance by specifying name !=
  51460. // example-instance.
  51461. //
  51462. // You can also filter nested fields. For example, you could specify
  51463. // scheduling.automaticRestart = false to include instances only if they
  51464. // are not scheduled for automatic restarts. You can use filtering on
  51465. // nested fields to filter based on resource labels.
  51466. //
  51467. // To filter on multiple expressions, provide each separate expression
  51468. // within parentheses. For example, (scheduling.automaticRestart = true)
  51469. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51470. // AND expression. However, you can include AND and OR expressions
  51471. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51472. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51473. // true).
  51474. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  51475. c.urlParams_.Set("filter", filter)
  51476. return c
  51477. }
  51478. // MaxResults sets the optional parameter "maxResults": The maximum
  51479. // number of results per page that should be returned. If the number of
  51480. // available results is larger than maxResults, Compute Engine returns a
  51481. // nextPageToken that can be used to get the next page of results in
  51482. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51483. // (Default: 500)
  51484. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  51485. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51486. return c
  51487. }
  51488. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51489. // a certain order. By default, results are returned in alphanumerical
  51490. // order based on the resource name.
  51491. //
  51492. // You can also sort results in descending order based on the creation
  51493. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51494. // based on the creationTimestamp field in reverse chronological order
  51495. // (newest result first). Use this to sort resources like operations so
  51496. // that the newest operation is returned first.
  51497. //
  51498. // Currently, only sorting by name or creationTimestamp desc is
  51499. // supported.
  51500. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  51501. c.urlParams_.Set("orderBy", orderBy)
  51502. return c
  51503. }
  51504. // PageToken sets the optional parameter "pageToken": Specifies a page
  51505. // token to use. Set pageToken to the nextPageToken returned by a
  51506. // previous list request to get the next page of results.
  51507. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  51508. c.urlParams_.Set("pageToken", pageToken)
  51509. return c
  51510. }
  51511. // Fields allows partial responses to be retrieved. See
  51512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51513. // for more information.
  51514. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  51515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51516. return c
  51517. }
  51518. // IfNoneMatch sets the optional parameter which makes the operation
  51519. // fail if the object's ETag matches the given value. This is useful for
  51520. // getting updates only after the object has changed since the last
  51521. // request. Use googleapi.IsNotModified to check whether the response
  51522. // error from Do is the result of In-None-Match.
  51523. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  51524. c.ifNoneMatch_ = entityTag
  51525. return c
  51526. }
  51527. // Context sets the context to be used in this call's Do method. Any
  51528. // pending HTTP request will be aborted if the provided context is
  51529. // canceled.
  51530. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  51531. c.ctx_ = ctx
  51532. return c
  51533. }
  51534. // Header returns an http.Header that can be modified by the caller to
  51535. // add HTTP headers to the request.
  51536. func (c *ForwardingRulesListCall) Header() http.Header {
  51537. if c.header_ == nil {
  51538. c.header_ = make(http.Header)
  51539. }
  51540. return c.header_
  51541. }
  51542. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  51543. reqHeaders := make(http.Header)
  51544. for k, v := range c.header_ {
  51545. reqHeaders[k] = v
  51546. }
  51547. reqHeaders.Set("User-Agent", c.s.userAgent())
  51548. if c.ifNoneMatch_ != "" {
  51549. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51550. }
  51551. var body io.Reader = nil
  51552. c.urlParams_.Set("alt", alt)
  51553. c.urlParams_.Set("prettyPrint", "false")
  51554. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  51555. urls += "?" + c.urlParams_.Encode()
  51556. req, err := http.NewRequest("GET", urls, body)
  51557. if err != nil {
  51558. return nil, err
  51559. }
  51560. req.Header = reqHeaders
  51561. googleapi.Expand(req.URL, map[string]string{
  51562. "project": c.project,
  51563. "region": c.region,
  51564. })
  51565. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51566. }
  51567. // Do executes the "compute.forwardingRules.list" call.
  51568. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  51569. // non-2xx status code is an error. Response headers are in either
  51570. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  51571. // returned at all) in error.(*googleapi.Error).Header. Use
  51572. // googleapi.IsNotModified to check whether the returned error was
  51573. // because http.StatusNotModified was returned.
  51574. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  51575. gensupport.SetOptions(c.urlParams_, opts...)
  51576. res, err := c.doRequest("json")
  51577. if res != nil && res.StatusCode == http.StatusNotModified {
  51578. if res.Body != nil {
  51579. res.Body.Close()
  51580. }
  51581. return nil, &googleapi.Error{
  51582. Code: res.StatusCode,
  51583. Header: res.Header,
  51584. }
  51585. }
  51586. if err != nil {
  51587. return nil, err
  51588. }
  51589. defer googleapi.CloseBody(res)
  51590. if err := googleapi.CheckResponse(res); err != nil {
  51591. return nil, err
  51592. }
  51593. ret := &ForwardingRuleList{
  51594. ServerResponse: googleapi.ServerResponse{
  51595. Header: res.Header,
  51596. HTTPStatusCode: res.StatusCode,
  51597. },
  51598. }
  51599. target := &ret
  51600. if err := gensupport.DecodeResponse(target, res); err != nil {
  51601. return nil, err
  51602. }
  51603. return ret, nil
  51604. // {
  51605. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  51606. // "httpMethod": "GET",
  51607. // "id": "compute.forwardingRules.list",
  51608. // "parameterOrder": [
  51609. // "project",
  51610. // "region"
  51611. // ],
  51612. // "parameters": {
  51613. // "filter": {
  51614. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  51615. // "location": "query",
  51616. // "type": "string"
  51617. // },
  51618. // "maxResults": {
  51619. // "default": "500",
  51620. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  51621. // "format": "uint32",
  51622. // "location": "query",
  51623. // "minimum": "0",
  51624. // "type": "integer"
  51625. // },
  51626. // "orderBy": {
  51627. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  51628. // "location": "query",
  51629. // "type": "string"
  51630. // },
  51631. // "pageToken": {
  51632. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  51633. // "location": "query",
  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. // "region": {
  51644. // "description": "Name of the region scoping this request.",
  51645. // "location": "path",
  51646. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51647. // "required": true,
  51648. // "type": "string"
  51649. // }
  51650. // },
  51651. // "path": "{project}/regions/{region}/forwardingRules",
  51652. // "response": {
  51653. // "$ref": "ForwardingRuleList"
  51654. // },
  51655. // "scopes": [
  51656. // "https://www.googleapis.com/auth/cloud-platform",
  51657. // "https://www.googleapis.com/auth/compute",
  51658. // "https://www.googleapis.com/auth/compute.readonly"
  51659. // ]
  51660. // }
  51661. }
  51662. // Pages invokes f for each page of results.
  51663. // A non-nil error returned from f will halt the iteration.
  51664. // The provided context supersedes any context provided to the Context method.
  51665. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  51666. c.ctx_ = ctx
  51667. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51668. for {
  51669. x, err := c.Do()
  51670. if err != nil {
  51671. return err
  51672. }
  51673. if err := f(x); err != nil {
  51674. return err
  51675. }
  51676. if x.NextPageToken == "" {
  51677. return nil
  51678. }
  51679. c.PageToken(x.NextPageToken)
  51680. }
  51681. }
  51682. // method id "compute.forwardingRules.patch":
  51683. type ForwardingRulesPatchCall struct {
  51684. s *Service
  51685. project string
  51686. region string
  51687. forwardingRule string
  51688. forwardingrule *ForwardingRule
  51689. urlParams_ gensupport.URLParams
  51690. ctx_ context.Context
  51691. header_ http.Header
  51692. }
  51693. // Patch: Updates the specified forwarding rule with the data included
  51694. // in the request. This method supports PATCH semantics and uses the
  51695. // JSON merge patch format and processing rules. Currently, you can only
  51696. // patch the network_tier field.
  51697. func (r *ForwardingRulesService) Patch(project string, region string, forwardingRule string, forwardingrule *ForwardingRule) *ForwardingRulesPatchCall {
  51698. c := &ForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51699. c.project = project
  51700. c.region = region
  51701. c.forwardingRule = forwardingRule
  51702. c.forwardingrule = forwardingrule
  51703. return c
  51704. }
  51705. // RequestId sets the optional parameter "requestId": An optional
  51706. // request ID to identify requests. Specify a unique request ID so that
  51707. // if you must retry your request, the server will know to ignore the
  51708. // request if it has already been completed.
  51709. //
  51710. // For example, consider a situation where you make an initial request
  51711. // and the request times out. If you make the request again with the
  51712. // same request ID, the server can check if original operation with the
  51713. // same request ID was received, and if so, will ignore the second
  51714. // request. This prevents clients from accidentally creating duplicate
  51715. // commitments.
  51716. //
  51717. // The request ID must be a valid UUID with the exception that zero UUID
  51718. // is not supported (00000000-0000-0000-0000-000000000000).
  51719. func (c *ForwardingRulesPatchCall) RequestId(requestId string) *ForwardingRulesPatchCall {
  51720. c.urlParams_.Set("requestId", requestId)
  51721. return c
  51722. }
  51723. // Fields allows partial responses to be retrieved. See
  51724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51725. // for more information.
  51726. func (c *ForwardingRulesPatchCall) Fields(s ...googleapi.Field) *ForwardingRulesPatchCall {
  51727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51728. return c
  51729. }
  51730. // Context sets the context to be used in this call's Do method. Any
  51731. // pending HTTP request will be aborted if the provided context is
  51732. // canceled.
  51733. func (c *ForwardingRulesPatchCall) Context(ctx context.Context) *ForwardingRulesPatchCall {
  51734. c.ctx_ = ctx
  51735. return c
  51736. }
  51737. // Header returns an http.Header that can be modified by the caller to
  51738. // add HTTP headers to the request.
  51739. func (c *ForwardingRulesPatchCall) Header() http.Header {
  51740. if c.header_ == nil {
  51741. c.header_ = make(http.Header)
  51742. }
  51743. return c.header_
  51744. }
  51745. func (c *ForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
  51746. reqHeaders := make(http.Header)
  51747. for k, v := range c.header_ {
  51748. reqHeaders[k] = v
  51749. }
  51750. reqHeaders.Set("User-Agent", c.s.userAgent())
  51751. var body io.Reader = nil
  51752. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  51753. if err != nil {
  51754. return nil, err
  51755. }
  51756. reqHeaders.Set("Content-Type", "application/json")
  51757. c.urlParams_.Set("alt", alt)
  51758. c.urlParams_.Set("prettyPrint", "false")
  51759. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  51760. urls += "?" + c.urlParams_.Encode()
  51761. req, err := http.NewRequest("PATCH", urls, body)
  51762. if err != nil {
  51763. return nil, err
  51764. }
  51765. req.Header = reqHeaders
  51766. googleapi.Expand(req.URL, map[string]string{
  51767. "project": c.project,
  51768. "region": c.region,
  51769. "forwardingRule": c.forwardingRule,
  51770. })
  51771. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51772. }
  51773. // Do executes the "compute.forwardingRules.patch" call.
  51774. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51775. // status code is an error. Response headers are in either
  51776. // *Operation.ServerResponse.Header or (if a response was returned at
  51777. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51778. // to check whether the returned error was because
  51779. // http.StatusNotModified was returned.
  51780. func (c *ForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51781. gensupport.SetOptions(c.urlParams_, opts...)
  51782. res, err := c.doRequest("json")
  51783. if res != nil && res.StatusCode == http.StatusNotModified {
  51784. if res.Body != nil {
  51785. res.Body.Close()
  51786. }
  51787. return nil, &googleapi.Error{
  51788. Code: res.StatusCode,
  51789. Header: res.Header,
  51790. }
  51791. }
  51792. if err != nil {
  51793. return nil, err
  51794. }
  51795. defer googleapi.CloseBody(res)
  51796. if err := googleapi.CheckResponse(res); err != nil {
  51797. return nil, err
  51798. }
  51799. ret := &Operation{
  51800. ServerResponse: googleapi.ServerResponse{
  51801. Header: res.Header,
  51802. HTTPStatusCode: res.StatusCode,
  51803. },
  51804. }
  51805. target := &ret
  51806. if err := gensupport.DecodeResponse(target, res); err != nil {
  51807. return nil, err
  51808. }
  51809. return ret, nil
  51810. // {
  51811. // "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.",
  51812. // "httpMethod": "PATCH",
  51813. // "id": "compute.forwardingRules.patch",
  51814. // "parameterOrder": [
  51815. // "project",
  51816. // "region",
  51817. // "forwardingRule"
  51818. // ],
  51819. // "parameters": {
  51820. // "forwardingRule": {
  51821. // "description": "Name of the ForwardingRule resource to patch.",
  51822. // "location": "path",
  51823. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51824. // "required": true,
  51825. // "type": "string"
  51826. // },
  51827. // "project": {
  51828. // "description": "Project ID for this request.",
  51829. // "location": "path",
  51830. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51831. // "required": true,
  51832. // "type": "string"
  51833. // },
  51834. // "region": {
  51835. // "description": "Name of the region scoping this request.",
  51836. // "location": "path",
  51837. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51838. // "required": true,
  51839. // "type": "string"
  51840. // },
  51841. // "requestId": {
  51842. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51843. // "location": "query",
  51844. // "type": "string"
  51845. // }
  51846. // },
  51847. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  51848. // "request": {
  51849. // "$ref": "ForwardingRule"
  51850. // },
  51851. // "response": {
  51852. // "$ref": "Operation"
  51853. // },
  51854. // "scopes": [
  51855. // "https://www.googleapis.com/auth/cloud-platform",
  51856. // "https://www.googleapis.com/auth/compute"
  51857. // ]
  51858. // }
  51859. }
  51860. // method id "compute.forwardingRules.setLabels":
  51861. type ForwardingRulesSetLabelsCall struct {
  51862. s *Service
  51863. project string
  51864. region string
  51865. resource string
  51866. regionsetlabelsrequest *RegionSetLabelsRequest
  51867. urlParams_ gensupport.URLParams
  51868. ctx_ context.Context
  51869. header_ http.Header
  51870. }
  51871. // SetLabels: Sets the labels on the specified resource. To learn more
  51872. // about labels, read the Labeling Resources documentation.
  51873. func (r *ForwardingRulesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *ForwardingRulesSetLabelsCall {
  51874. c := &ForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51875. c.project = project
  51876. c.region = region
  51877. c.resource = resource
  51878. c.regionsetlabelsrequest = regionsetlabelsrequest
  51879. return c
  51880. }
  51881. // RequestId sets the optional parameter "requestId": An optional
  51882. // request ID to identify requests. Specify a unique request ID so that
  51883. // if you must retry your request, the server will know to ignore the
  51884. // request if it has already been completed.
  51885. //
  51886. // For example, consider a situation where you make an initial request
  51887. // and the request times out. If you make the request again with the
  51888. // same request ID, the server can check if original operation with the
  51889. // same request ID was received, and if so, will ignore the second
  51890. // request. This prevents clients from accidentally creating duplicate
  51891. // commitments.
  51892. //
  51893. // The request ID must be a valid UUID with the exception that zero UUID
  51894. // is not supported (00000000-0000-0000-0000-000000000000).
  51895. func (c *ForwardingRulesSetLabelsCall) RequestId(requestId string) *ForwardingRulesSetLabelsCall {
  51896. c.urlParams_.Set("requestId", requestId)
  51897. return c
  51898. }
  51899. // Fields allows partial responses to be retrieved. See
  51900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51901. // for more information.
  51902. func (c *ForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *ForwardingRulesSetLabelsCall {
  51903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51904. return c
  51905. }
  51906. // Context sets the context to be used in this call's Do method. Any
  51907. // pending HTTP request will be aborted if the provided context is
  51908. // canceled.
  51909. func (c *ForwardingRulesSetLabelsCall) Context(ctx context.Context) *ForwardingRulesSetLabelsCall {
  51910. c.ctx_ = ctx
  51911. return c
  51912. }
  51913. // Header returns an http.Header that can be modified by the caller to
  51914. // add HTTP headers to the request.
  51915. func (c *ForwardingRulesSetLabelsCall) Header() http.Header {
  51916. if c.header_ == nil {
  51917. c.header_ = make(http.Header)
  51918. }
  51919. return c.header_
  51920. }
  51921. func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  51922. reqHeaders := make(http.Header)
  51923. for k, v := range c.header_ {
  51924. reqHeaders[k] = v
  51925. }
  51926. reqHeaders.Set("User-Agent", c.s.userAgent())
  51927. var body io.Reader = nil
  51928. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  51929. if err != nil {
  51930. return nil, err
  51931. }
  51932. reqHeaders.Set("Content-Type", "application/json")
  51933. c.urlParams_.Set("alt", alt)
  51934. c.urlParams_.Set("prettyPrint", "false")
  51935. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/setLabels")
  51936. urls += "?" + c.urlParams_.Encode()
  51937. req, err := http.NewRequest("POST", urls, body)
  51938. if err != nil {
  51939. return nil, err
  51940. }
  51941. req.Header = reqHeaders
  51942. googleapi.Expand(req.URL, map[string]string{
  51943. "project": c.project,
  51944. "region": c.region,
  51945. "resource": c.resource,
  51946. })
  51947. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51948. }
  51949. // Do executes the "compute.forwardingRules.setLabels" call.
  51950. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51951. // status code is an error. Response headers are in either
  51952. // *Operation.ServerResponse.Header or (if a response was returned at
  51953. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51954. // to check whether the returned error was because
  51955. // http.StatusNotModified was returned.
  51956. func (c *ForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51957. gensupport.SetOptions(c.urlParams_, opts...)
  51958. res, err := c.doRequest("json")
  51959. if res != nil && res.StatusCode == http.StatusNotModified {
  51960. if res.Body != nil {
  51961. res.Body.Close()
  51962. }
  51963. return nil, &googleapi.Error{
  51964. Code: res.StatusCode,
  51965. Header: res.Header,
  51966. }
  51967. }
  51968. if err != nil {
  51969. return nil, err
  51970. }
  51971. defer googleapi.CloseBody(res)
  51972. if err := googleapi.CheckResponse(res); err != nil {
  51973. return nil, err
  51974. }
  51975. ret := &Operation{
  51976. ServerResponse: googleapi.ServerResponse{
  51977. Header: res.Header,
  51978. HTTPStatusCode: res.StatusCode,
  51979. },
  51980. }
  51981. target := &ret
  51982. if err := gensupport.DecodeResponse(target, res); err != nil {
  51983. return nil, err
  51984. }
  51985. return ret, nil
  51986. // {
  51987. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  51988. // "httpMethod": "POST",
  51989. // "id": "compute.forwardingRules.setLabels",
  51990. // "parameterOrder": [
  51991. // "project",
  51992. // "region",
  51993. // "resource"
  51994. // ],
  51995. // "parameters": {
  51996. // "project": {
  51997. // "description": "Project ID for this request.",
  51998. // "location": "path",
  51999. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52000. // "required": true,
  52001. // "type": "string"
  52002. // },
  52003. // "region": {
  52004. // "description": "The region for this request.",
  52005. // "location": "path",
  52006. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52007. // "required": true,
  52008. // "type": "string"
  52009. // },
  52010. // "requestId": {
  52011. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52012. // "location": "query",
  52013. // "type": "string"
  52014. // },
  52015. // "resource": {
  52016. // "description": "Name or id of the resource for this request.",
  52017. // "location": "path",
  52018. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52019. // "required": true,
  52020. // "type": "string"
  52021. // }
  52022. // },
  52023. // "path": "{project}/regions/{region}/forwardingRules/{resource}/setLabels",
  52024. // "request": {
  52025. // "$ref": "RegionSetLabelsRequest"
  52026. // },
  52027. // "response": {
  52028. // "$ref": "Operation"
  52029. // },
  52030. // "scopes": [
  52031. // "https://www.googleapis.com/auth/cloud-platform",
  52032. // "https://www.googleapis.com/auth/compute"
  52033. // ]
  52034. // }
  52035. }
  52036. // method id "compute.forwardingRules.setTarget":
  52037. type ForwardingRulesSetTargetCall struct {
  52038. s *Service
  52039. project string
  52040. region string
  52041. forwardingRule string
  52042. targetreference *TargetReference
  52043. urlParams_ gensupport.URLParams
  52044. ctx_ context.Context
  52045. header_ http.Header
  52046. }
  52047. // SetTarget: Changes target URL for forwarding rule. The new target
  52048. // should be of the same type as the old target.
  52049. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  52050. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  52051. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52052. c.project = project
  52053. c.region = region
  52054. c.forwardingRule = forwardingRule
  52055. c.targetreference = targetreference
  52056. return c
  52057. }
  52058. // RequestId sets the optional parameter "requestId": An optional
  52059. // request ID to identify requests. Specify a unique request ID so that
  52060. // if you must retry your request, the server will know to ignore the
  52061. // request if it has already been completed.
  52062. //
  52063. // For example, consider a situation where you make an initial request
  52064. // and the request times out. If you make the request again with the
  52065. // same request ID, the server can check if original operation with the
  52066. // same request ID was received, and if so, will ignore the second
  52067. // request. This prevents clients from accidentally creating duplicate
  52068. // commitments.
  52069. //
  52070. // The request ID must be a valid UUID with the exception that zero UUID
  52071. // is not supported (00000000-0000-0000-0000-000000000000).
  52072. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  52073. c.urlParams_.Set("requestId", requestId)
  52074. return c
  52075. }
  52076. // Fields allows partial responses to be retrieved. See
  52077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52078. // for more information.
  52079. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  52080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52081. return c
  52082. }
  52083. // Context sets the context to be used in this call's Do method. Any
  52084. // pending HTTP request will be aborted if the provided context is
  52085. // canceled.
  52086. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  52087. c.ctx_ = ctx
  52088. return c
  52089. }
  52090. // Header returns an http.Header that can be modified by the caller to
  52091. // add HTTP headers to the request.
  52092. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  52093. if c.header_ == nil {
  52094. c.header_ = make(http.Header)
  52095. }
  52096. return c.header_
  52097. }
  52098. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  52099. reqHeaders := make(http.Header)
  52100. for k, v := range c.header_ {
  52101. reqHeaders[k] = v
  52102. }
  52103. reqHeaders.Set("User-Agent", c.s.userAgent())
  52104. var body io.Reader = nil
  52105. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  52106. if err != nil {
  52107. return nil, err
  52108. }
  52109. reqHeaders.Set("Content-Type", "application/json")
  52110. c.urlParams_.Set("alt", alt)
  52111. c.urlParams_.Set("prettyPrint", "false")
  52112. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  52113. urls += "?" + c.urlParams_.Encode()
  52114. req, err := http.NewRequest("POST", urls, body)
  52115. if err != nil {
  52116. return nil, err
  52117. }
  52118. req.Header = reqHeaders
  52119. googleapi.Expand(req.URL, map[string]string{
  52120. "project": c.project,
  52121. "region": c.region,
  52122. "forwardingRule": c.forwardingRule,
  52123. })
  52124. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52125. }
  52126. // Do executes the "compute.forwardingRules.setTarget" call.
  52127. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52128. // status code is an error. Response headers are in either
  52129. // *Operation.ServerResponse.Header or (if a response was returned at
  52130. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52131. // to check whether the returned error was because
  52132. // http.StatusNotModified was returned.
  52133. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52134. gensupport.SetOptions(c.urlParams_, opts...)
  52135. res, err := c.doRequest("json")
  52136. if res != nil && res.StatusCode == http.StatusNotModified {
  52137. if res.Body != nil {
  52138. res.Body.Close()
  52139. }
  52140. return nil, &googleapi.Error{
  52141. Code: res.StatusCode,
  52142. Header: res.Header,
  52143. }
  52144. }
  52145. if err != nil {
  52146. return nil, err
  52147. }
  52148. defer googleapi.CloseBody(res)
  52149. if err := googleapi.CheckResponse(res); err != nil {
  52150. return nil, err
  52151. }
  52152. ret := &Operation{
  52153. ServerResponse: googleapi.ServerResponse{
  52154. Header: res.Header,
  52155. HTTPStatusCode: res.StatusCode,
  52156. },
  52157. }
  52158. target := &ret
  52159. if err := gensupport.DecodeResponse(target, res); err != nil {
  52160. return nil, err
  52161. }
  52162. return ret, nil
  52163. // {
  52164. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  52165. // "httpMethod": "POST",
  52166. // "id": "compute.forwardingRules.setTarget",
  52167. // "parameterOrder": [
  52168. // "project",
  52169. // "region",
  52170. // "forwardingRule"
  52171. // ],
  52172. // "parameters": {
  52173. // "forwardingRule": {
  52174. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  52175. // "location": "path",
  52176. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52177. // "required": true,
  52178. // "type": "string"
  52179. // },
  52180. // "project": {
  52181. // "description": "Project ID for this request.",
  52182. // "location": "path",
  52183. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52184. // "required": true,
  52185. // "type": "string"
  52186. // },
  52187. // "region": {
  52188. // "description": "Name of the region scoping this request.",
  52189. // "location": "path",
  52190. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52191. // "required": true,
  52192. // "type": "string"
  52193. // },
  52194. // "requestId": {
  52195. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52196. // "location": "query",
  52197. // "type": "string"
  52198. // }
  52199. // },
  52200. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  52201. // "request": {
  52202. // "$ref": "TargetReference"
  52203. // },
  52204. // "response": {
  52205. // "$ref": "Operation"
  52206. // },
  52207. // "scopes": [
  52208. // "https://www.googleapis.com/auth/cloud-platform",
  52209. // "https://www.googleapis.com/auth/compute"
  52210. // ]
  52211. // }
  52212. }
  52213. // method id "compute.forwardingRules.testIamPermissions":
  52214. type ForwardingRulesTestIamPermissionsCall struct {
  52215. s *Service
  52216. project string
  52217. region string
  52218. resource string
  52219. testpermissionsrequest *TestPermissionsRequest
  52220. urlParams_ gensupport.URLParams
  52221. ctx_ context.Context
  52222. header_ http.Header
  52223. }
  52224. // TestIamPermissions: Returns permissions that a caller has on the
  52225. // specified resource.
  52226. func (r *ForwardingRulesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ForwardingRulesTestIamPermissionsCall {
  52227. c := &ForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52228. c.project = project
  52229. c.region = region
  52230. c.resource = resource
  52231. c.testpermissionsrequest = testpermissionsrequest
  52232. return c
  52233. }
  52234. // Fields allows partial responses to be retrieved. See
  52235. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52236. // for more information.
  52237. func (c *ForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ForwardingRulesTestIamPermissionsCall {
  52238. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52239. return c
  52240. }
  52241. // Context sets the context to be used in this call's Do method. Any
  52242. // pending HTTP request will be aborted if the provided context is
  52243. // canceled.
  52244. func (c *ForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *ForwardingRulesTestIamPermissionsCall {
  52245. c.ctx_ = ctx
  52246. return c
  52247. }
  52248. // Header returns an http.Header that can be modified by the caller to
  52249. // add HTTP headers to the request.
  52250. func (c *ForwardingRulesTestIamPermissionsCall) Header() http.Header {
  52251. if c.header_ == nil {
  52252. c.header_ = make(http.Header)
  52253. }
  52254. return c.header_
  52255. }
  52256. func (c *ForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  52257. reqHeaders := make(http.Header)
  52258. for k, v := range c.header_ {
  52259. reqHeaders[k] = v
  52260. }
  52261. reqHeaders.Set("User-Agent", c.s.userAgent())
  52262. var body io.Reader = nil
  52263. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  52264. if err != nil {
  52265. return nil, err
  52266. }
  52267. reqHeaders.Set("Content-Type", "application/json")
  52268. c.urlParams_.Set("alt", alt)
  52269. c.urlParams_.Set("prettyPrint", "false")
  52270. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions")
  52271. urls += "?" + c.urlParams_.Encode()
  52272. req, err := http.NewRequest("POST", urls, body)
  52273. if err != nil {
  52274. return nil, err
  52275. }
  52276. req.Header = reqHeaders
  52277. googleapi.Expand(req.URL, map[string]string{
  52278. "project": c.project,
  52279. "region": c.region,
  52280. "resource": c.resource,
  52281. })
  52282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52283. }
  52284. // Do executes the "compute.forwardingRules.testIamPermissions" call.
  52285. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  52286. // non-2xx status code is an error. Response headers are in either
  52287. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  52288. // returned at all) in error.(*googleapi.Error).Header. Use
  52289. // googleapi.IsNotModified to check whether the returned error was
  52290. // because http.StatusNotModified was returned.
  52291. func (c *ForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  52292. gensupport.SetOptions(c.urlParams_, opts...)
  52293. res, err := c.doRequest("json")
  52294. if res != nil && res.StatusCode == http.StatusNotModified {
  52295. if res.Body != nil {
  52296. res.Body.Close()
  52297. }
  52298. return nil, &googleapi.Error{
  52299. Code: res.StatusCode,
  52300. Header: res.Header,
  52301. }
  52302. }
  52303. if err != nil {
  52304. return nil, err
  52305. }
  52306. defer googleapi.CloseBody(res)
  52307. if err := googleapi.CheckResponse(res); err != nil {
  52308. return nil, err
  52309. }
  52310. ret := &TestPermissionsResponse{
  52311. ServerResponse: googleapi.ServerResponse{
  52312. Header: res.Header,
  52313. HTTPStatusCode: res.StatusCode,
  52314. },
  52315. }
  52316. target := &ret
  52317. if err := gensupport.DecodeResponse(target, res); err != nil {
  52318. return nil, err
  52319. }
  52320. return ret, nil
  52321. // {
  52322. // "description": "Returns permissions that a caller has on the specified resource.",
  52323. // "httpMethod": "POST",
  52324. // "id": "compute.forwardingRules.testIamPermissions",
  52325. // "parameterOrder": [
  52326. // "project",
  52327. // "region",
  52328. // "resource"
  52329. // ],
  52330. // "parameters": {
  52331. // "project": {
  52332. // "description": "Project ID for this request.",
  52333. // "location": "path",
  52334. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52335. // "required": true,
  52336. // "type": "string"
  52337. // },
  52338. // "region": {
  52339. // "description": "The name of the region for this request.",
  52340. // "location": "path",
  52341. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52342. // "required": true,
  52343. // "type": "string"
  52344. // },
  52345. // "resource": {
  52346. // "description": "Name or id of the resource for this request.",
  52347. // "location": "path",
  52348. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52349. // "required": true,
  52350. // "type": "string"
  52351. // }
  52352. // },
  52353. // "path": "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions",
  52354. // "request": {
  52355. // "$ref": "TestPermissionsRequest"
  52356. // },
  52357. // "response": {
  52358. // "$ref": "TestPermissionsResponse"
  52359. // },
  52360. // "scopes": [
  52361. // "https://www.googleapis.com/auth/cloud-platform",
  52362. // "https://www.googleapis.com/auth/compute",
  52363. // "https://www.googleapis.com/auth/compute.readonly"
  52364. // ]
  52365. // }
  52366. }
  52367. // method id "compute.globalAddresses.delete":
  52368. type GlobalAddressesDeleteCall struct {
  52369. s *Service
  52370. project string
  52371. address string
  52372. urlParams_ gensupport.URLParams
  52373. ctx_ context.Context
  52374. header_ http.Header
  52375. }
  52376. // Delete: Deletes the specified address resource.
  52377. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  52378. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  52379. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52380. c.project = project
  52381. c.address = address
  52382. return c
  52383. }
  52384. // RequestId sets the optional parameter "requestId": An optional
  52385. // request ID to identify requests. Specify a unique request ID so that
  52386. // if you must retry your request, the server will know to ignore the
  52387. // request if it has already been completed.
  52388. //
  52389. // For example, consider a situation where you make an initial request
  52390. // and the request times out. If you make the request again with the
  52391. // same request ID, the server can check if original operation with the
  52392. // same request ID was received, and if so, will ignore the second
  52393. // request. This prevents clients from accidentally creating duplicate
  52394. // commitments.
  52395. //
  52396. // The request ID must be a valid UUID with the exception that zero UUID
  52397. // is not supported (00000000-0000-0000-0000-000000000000).
  52398. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  52399. c.urlParams_.Set("requestId", requestId)
  52400. return c
  52401. }
  52402. // Fields allows partial responses to be retrieved. See
  52403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52404. // for more information.
  52405. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  52406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52407. return c
  52408. }
  52409. // Context sets the context to be used in this call's Do method. Any
  52410. // pending HTTP request will be aborted if the provided context is
  52411. // canceled.
  52412. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  52413. c.ctx_ = ctx
  52414. return c
  52415. }
  52416. // Header returns an http.Header that can be modified by the caller to
  52417. // add HTTP headers to the request.
  52418. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  52419. if c.header_ == nil {
  52420. c.header_ = make(http.Header)
  52421. }
  52422. return c.header_
  52423. }
  52424. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  52425. reqHeaders := make(http.Header)
  52426. for k, v := range c.header_ {
  52427. reqHeaders[k] = v
  52428. }
  52429. reqHeaders.Set("User-Agent", c.s.userAgent())
  52430. var body io.Reader = nil
  52431. c.urlParams_.Set("alt", alt)
  52432. c.urlParams_.Set("prettyPrint", "false")
  52433. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  52434. urls += "?" + c.urlParams_.Encode()
  52435. req, err := http.NewRequest("DELETE", urls, body)
  52436. if err != nil {
  52437. return nil, err
  52438. }
  52439. req.Header = reqHeaders
  52440. googleapi.Expand(req.URL, map[string]string{
  52441. "project": c.project,
  52442. "address": c.address,
  52443. })
  52444. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52445. }
  52446. // Do executes the "compute.globalAddresses.delete" call.
  52447. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52448. // status code is an error. Response headers are in either
  52449. // *Operation.ServerResponse.Header or (if a response was returned at
  52450. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52451. // to check whether the returned error was because
  52452. // http.StatusNotModified was returned.
  52453. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52454. gensupport.SetOptions(c.urlParams_, opts...)
  52455. res, err := c.doRequest("json")
  52456. if res != nil && res.StatusCode == http.StatusNotModified {
  52457. if res.Body != nil {
  52458. res.Body.Close()
  52459. }
  52460. return nil, &googleapi.Error{
  52461. Code: res.StatusCode,
  52462. Header: res.Header,
  52463. }
  52464. }
  52465. if err != nil {
  52466. return nil, err
  52467. }
  52468. defer googleapi.CloseBody(res)
  52469. if err := googleapi.CheckResponse(res); err != nil {
  52470. return nil, err
  52471. }
  52472. ret := &Operation{
  52473. ServerResponse: googleapi.ServerResponse{
  52474. Header: res.Header,
  52475. HTTPStatusCode: res.StatusCode,
  52476. },
  52477. }
  52478. target := &ret
  52479. if err := gensupport.DecodeResponse(target, res); err != nil {
  52480. return nil, err
  52481. }
  52482. return ret, nil
  52483. // {
  52484. // "description": "Deletes the specified address resource.",
  52485. // "httpMethod": "DELETE",
  52486. // "id": "compute.globalAddresses.delete",
  52487. // "parameterOrder": [
  52488. // "project",
  52489. // "address"
  52490. // ],
  52491. // "parameters": {
  52492. // "address": {
  52493. // "description": "Name of the address resource to delete.",
  52494. // "location": "path",
  52495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52496. // "required": true,
  52497. // "type": "string"
  52498. // },
  52499. // "project": {
  52500. // "description": "Project ID for this request.",
  52501. // "location": "path",
  52502. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52503. // "required": true,
  52504. // "type": "string"
  52505. // },
  52506. // "requestId": {
  52507. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52508. // "location": "query",
  52509. // "type": "string"
  52510. // }
  52511. // },
  52512. // "path": "{project}/global/addresses/{address}",
  52513. // "response": {
  52514. // "$ref": "Operation"
  52515. // },
  52516. // "scopes": [
  52517. // "https://www.googleapis.com/auth/cloud-platform",
  52518. // "https://www.googleapis.com/auth/compute"
  52519. // ]
  52520. // }
  52521. }
  52522. // method id "compute.globalAddresses.get":
  52523. type GlobalAddressesGetCall struct {
  52524. s *Service
  52525. project string
  52526. address string
  52527. urlParams_ gensupport.URLParams
  52528. ifNoneMatch_ string
  52529. ctx_ context.Context
  52530. header_ http.Header
  52531. }
  52532. // Get: Returns the specified address resource. Gets a list of available
  52533. // addresses by making a list() request.
  52534. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  52535. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  52536. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52537. c.project = project
  52538. c.address = address
  52539. return c
  52540. }
  52541. // Fields allows partial responses to be retrieved. See
  52542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52543. // for more information.
  52544. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  52545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52546. return c
  52547. }
  52548. // IfNoneMatch sets the optional parameter which makes the operation
  52549. // fail if the object's ETag matches the given value. This is useful for
  52550. // getting updates only after the object has changed since the last
  52551. // request. Use googleapi.IsNotModified to check whether the response
  52552. // error from Do is the result of In-None-Match.
  52553. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  52554. c.ifNoneMatch_ = entityTag
  52555. return c
  52556. }
  52557. // Context sets the context to be used in this call's Do method. Any
  52558. // pending HTTP request will be aborted if the provided context is
  52559. // canceled.
  52560. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  52561. c.ctx_ = ctx
  52562. return c
  52563. }
  52564. // Header returns an http.Header that can be modified by the caller to
  52565. // add HTTP headers to the request.
  52566. func (c *GlobalAddressesGetCall) Header() http.Header {
  52567. if c.header_ == nil {
  52568. c.header_ = make(http.Header)
  52569. }
  52570. return c.header_
  52571. }
  52572. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  52573. reqHeaders := make(http.Header)
  52574. for k, v := range c.header_ {
  52575. reqHeaders[k] = v
  52576. }
  52577. reqHeaders.Set("User-Agent", c.s.userAgent())
  52578. if c.ifNoneMatch_ != "" {
  52579. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52580. }
  52581. var body io.Reader = nil
  52582. c.urlParams_.Set("alt", alt)
  52583. c.urlParams_.Set("prettyPrint", "false")
  52584. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  52585. urls += "?" + c.urlParams_.Encode()
  52586. req, err := http.NewRequest("GET", urls, body)
  52587. if err != nil {
  52588. return nil, err
  52589. }
  52590. req.Header = reqHeaders
  52591. googleapi.Expand(req.URL, map[string]string{
  52592. "project": c.project,
  52593. "address": c.address,
  52594. })
  52595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52596. }
  52597. // Do executes the "compute.globalAddresses.get" call.
  52598. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  52599. // code is an error. Response headers are in either
  52600. // *Address.ServerResponse.Header or (if a response was returned at all)
  52601. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  52602. // check whether the returned error was because http.StatusNotModified
  52603. // was returned.
  52604. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  52605. gensupport.SetOptions(c.urlParams_, opts...)
  52606. res, err := c.doRequest("json")
  52607. if res != nil && res.StatusCode == http.StatusNotModified {
  52608. if res.Body != nil {
  52609. res.Body.Close()
  52610. }
  52611. return nil, &googleapi.Error{
  52612. Code: res.StatusCode,
  52613. Header: res.Header,
  52614. }
  52615. }
  52616. if err != nil {
  52617. return nil, err
  52618. }
  52619. defer googleapi.CloseBody(res)
  52620. if err := googleapi.CheckResponse(res); err != nil {
  52621. return nil, err
  52622. }
  52623. ret := &Address{
  52624. ServerResponse: googleapi.ServerResponse{
  52625. Header: res.Header,
  52626. HTTPStatusCode: res.StatusCode,
  52627. },
  52628. }
  52629. target := &ret
  52630. if err := gensupport.DecodeResponse(target, res); err != nil {
  52631. return nil, err
  52632. }
  52633. return ret, nil
  52634. // {
  52635. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  52636. // "httpMethod": "GET",
  52637. // "id": "compute.globalAddresses.get",
  52638. // "parameterOrder": [
  52639. // "project",
  52640. // "address"
  52641. // ],
  52642. // "parameters": {
  52643. // "address": {
  52644. // "description": "Name of the address resource to return.",
  52645. // "location": "path",
  52646. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52647. // "required": true,
  52648. // "type": "string"
  52649. // },
  52650. // "project": {
  52651. // "description": "Project ID for this request.",
  52652. // "location": "path",
  52653. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52654. // "required": true,
  52655. // "type": "string"
  52656. // }
  52657. // },
  52658. // "path": "{project}/global/addresses/{address}",
  52659. // "response": {
  52660. // "$ref": "Address"
  52661. // },
  52662. // "scopes": [
  52663. // "https://www.googleapis.com/auth/cloud-platform",
  52664. // "https://www.googleapis.com/auth/compute",
  52665. // "https://www.googleapis.com/auth/compute.readonly"
  52666. // ]
  52667. // }
  52668. }
  52669. // method id "compute.globalAddresses.insert":
  52670. type GlobalAddressesInsertCall struct {
  52671. s *Service
  52672. project string
  52673. address *Address
  52674. urlParams_ gensupport.URLParams
  52675. ctx_ context.Context
  52676. header_ http.Header
  52677. }
  52678. // Insert: Creates an address resource in the specified project using
  52679. // the data included in the request.
  52680. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  52681. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  52682. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52683. c.project = project
  52684. c.address = address
  52685. return c
  52686. }
  52687. // RequestId sets the optional parameter "requestId": An optional
  52688. // request ID to identify requests. Specify a unique request ID so that
  52689. // if you must retry your request, the server will know to ignore the
  52690. // request if it has already been completed.
  52691. //
  52692. // For example, consider a situation where you make an initial request
  52693. // and the request times out. If you make the request again with the
  52694. // same request ID, the server can check if original operation with the
  52695. // same request ID was received, and if so, will ignore the second
  52696. // request. This prevents clients from accidentally creating duplicate
  52697. // commitments.
  52698. //
  52699. // The request ID must be a valid UUID with the exception that zero UUID
  52700. // is not supported (00000000-0000-0000-0000-000000000000).
  52701. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  52702. c.urlParams_.Set("requestId", requestId)
  52703. return c
  52704. }
  52705. // Fields allows partial responses to be retrieved. See
  52706. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52707. // for more information.
  52708. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  52709. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52710. return c
  52711. }
  52712. // Context sets the context to be used in this call's Do method. Any
  52713. // pending HTTP request will be aborted if the provided context is
  52714. // canceled.
  52715. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  52716. c.ctx_ = ctx
  52717. return c
  52718. }
  52719. // Header returns an http.Header that can be modified by the caller to
  52720. // add HTTP headers to the request.
  52721. func (c *GlobalAddressesInsertCall) Header() http.Header {
  52722. if c.header_ == nil {
  52723. c.header_ = make(http.Header)
  52724. }
  52725. return c.header_
  52726. }
  52727. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  52728. reqHeaders := make(http.Header)
  52729. for k, v := range c.header_ {
  52730. reqHeaders[k] = v
  52731. }
  52732. reqHeaders.Set("User-Agent", c.s.userAgent())
  52733. var body io.Reader = nil
  52734. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  52735. if err != nil {
  52736. return nil, err
  52737. }
  52738. reqHeaders.Set("Content-Type", "application/json")
  52739. c.urlParams_.Set("alt", alt)
  52740. c.urlParams_.Set("prettyPrint", "false")
  52741. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  52742. urls += "?" + c.urlParams_.Encode()
  52743. req, err := http.NewRequest("POST", urls, body)
  52744. if err != nil {
  52745. return nil, err
  52746. }
  52747. req.Header = reqHeaders
  52748. googleapi.Expand(req.URL, map[string]string{
  52749. "project": c.project,
  52750. })
  52751. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52752. }
  52753. // Do executes the "compute.globalAddresses.insert" call.
  52754. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52755. // status code is an error. Response headers are in either
  52756. // *Operation.ServerResponse.Header or (if a response was returned at
  52757. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52758. // to check whether the returned error was because
  52759. // http.StatusNotModified was returned.
  52760. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52761. gensupport.SetOptions(c.urlParams_, opts...)
  52762. res, err := c.doRequest("json")
  52763. if res != nil && res.StatusCode == http.StatusNotModified {
  52764. if res.Body != nil {
  52765. res.Body.Close()
  52766. }
  52767. return nil, &googleapi.Error{
  52768. Code: res.StatusCode,
  52769. Header: res.Header,
  52770. }
  52771. }
  52772. if err != nil {
  52773. return nil, err
  52774. }
  52775. defer googleapi.CloseBody(res)
  52776. if err := googleapi.CheckResponse(res); err != nil {
  52777. return nil, err
  52778. }
  52779. ret := &Operation{
  52780. ServerResponse: googleapi.ServerResponse{
  52781. Header: res.Header,
  52782. HTTPStatusCode: res.StatusCode,
  52783. },
  52784. }
  52785. target := &ret
  52786. if err := gensupport.DecodeResponse(target, res); err != nil {
  52787. return nil, err
  52788. }
  52789. return ret, nil
  52790. // {
  52791. // "description": "Creates an address resource in the specified project using the data included in the request.",
  52792. // "httpMethod": "POST",
  52793. // "id": "compute.globalAddresses.insert",
  52794. // "parameterOrder": [
  52795. // "project"
  52796. // ],
  52797. // "parameters": {
  52798. // "project": {
  52799. // "description": "Project ID for this request.",
  52800. // "location": "path",
  52801. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52802. // "required": true,
  52803. // "type": "string"
  52804. // },
  52805. // "requestId": {
  52806. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52807. // "location": "query",
  52808. // "type": "string"
  52809. // }
  52810. // },
  52811. // "path": "{project}/global/addresses",
  52812. // "request": {
  52813. // "$ref": "Address"
  52814. // },
  52815. // "response": {
  52816. // "$ref": "Operation"
  52817. // },
  52818. // "scopes": [
  52819. // "https://www.googleapis.com/auth/cloud-platform",
  52820. // "https://www.googleapis.com/auth/compute"
  52821. // ]
  52822. // }
  52823. }
  52824. // method id "compute.globalAddresses.list":
  52825. type GlobalAddressesListCall struct {
  52826. s *Service
  52827. project string
  52828. urlParams_ gensupport.URLParams
  52829. ifNoneMatch_ string
  52830. ctx_ context.Context
  52831. header_ http.Header
  52832. }
  52833. // List: Retrieves a list of global addresses.
  52834. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  52835. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  52836. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52837. c.project = project
  52838. return c
  52839. }
  52840. // Filter sets the optional parameter "filter": A filter expression that
  52841. // filters resources listed in the response. The expression must specify
  52842. // the field name, a comparison operator, and the value that you want to
  52843. // use for filtering. The value must be a string, a number, or a
  52844. // boolean. The comparison operator must be either =, !=, >, or <.
  52845. //
  52846. // For example, if you are filtering Compute Engine instances, you can
  52847. // exclude instances named example-instance by specifying name !=
  52848. // example-instance.
  52849. //
  52850. // You can also filter nested fields. For example, you could specify
  52851. // scheduling.automaticRestart = false to include instances only if they
  52852. // are not scheduled for automatic restarts. You can use filtering on
  52853. // nested fields to filter based on resource labels.
  52854. //
  52855. // To filter on multiple expressions, provide each separate expression
  52856. // within parentheses. For example, (scheduling.automaticRestart = true)
  52857. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  52858. // AND expression. However, you can include AND and OR expressions
  52859. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  52860. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  52861. // true).
  52862. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  52863. c.urlParams_.Set("filter", filter)
  52864. return c
  52865. }
  52866. // MaxResults sets the optional parameter "maxResults": The maximum
  52867. // number of results per page that should be returned. If the number of
  52868. // available results is larger than maxResults, Compute Engine returns a
  52869. // nextPageToken that can be used to get the next page of results in
  52870. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  52871. // (Default: 500)
  52872. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  52873. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  52874. return c
  52875. }
  52876. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  52877. // a certain order. By default, results are returned in alphanumerical
  52878. // order based on the resource name.
  52879. //
  52880. // You can also sort results in descending order based on the creation
  52881. // timestamp using orderBy="creationTimestamp desc". This sorts results
  52882. // based on the creationTimestamp field in reverse chronological order
  52883. // (newest result first). Use this to sort resources like operations so
  52884. // that the newest operation is returned first.
  52885. //
  52886. // Currently, only sorting by name or creationTimestamp desc is
  52887. // supported.
  52888. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  52889. c.urlParams_.Set("orderBy", orderBy)
  52890. return c
  52891. }
  52892. // PageToken sets the optional parameter "pageToken": Specifies a page
  52893. // token to use. Set pageToken to the nextPageToken returned by a
  52894. // previous list request to get the next page of results.
  52895. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  52896. c.urlParams_.Set("pageToken", pageToken)
  52897. return c
  52898. }
  52899. // Fields allows partial responses to be retrieved. See
  52900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52901. // for more information.
  52902. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  52903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52904. return c
  52905. }
  52906. // IfNoneMatch sets the optional parameter which makes the operation
  52907. // fail if the object's ETag matches the given value. This is useful for
  52908. // getting updates only after the object has changed since the last
  52909. // request. Use googleapi.IsNotModified to check whether the response
  52910. // error from Do is the result of In-None-Match.
  52911. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  52912. c.ifNoneMatch_ = entityTag
  52913. return c
  52914. }
  52915. // Context sets the context to be used in this call's Do method. Any
  52916. // pending HTTP request will be aborted if the provided context is
  52917. // canceled.
  52918. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  52919. c.ctx_ = ctx
  52920. return c
  52921. }
  52922. // Header returns an http.Header that can be modified by the caller to
  52923. // add HTTP headers to the request.
  52924. func (c *GlobalAddressesListCall) Header() http.Header {
  52925. if c.header_ == nil {
  52926. c.header_ = make(http.Header)
  52927. }
  52928. return c.header_
  52929. }
  52930. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  52931. reqHeaders := make(http.Header)
  52932. for k, v := range c.header_ {
  52933. reqHeaders[k] = v
  52934. }
  52935. reqHeaders.Set("User-Agent", c.s.userAgent())
  52936. if c.ifNoneMatch_ != "" {
  52937. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52938. }
  52939. var body io.Reader = nil
  52940. c.urlParams_.Set("alt", alt)
  52941. c.urlParams_.Set("prettyPrint", "false")
  52942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  52943. urls += "?" + c.urlParams_.Encode()
  52944. req, err := http.NewRequest("GET", urls, body)
  52945. if err != nil {
  52946. return nil, err
  52947. }
  52948. req.Header = reqHeaders
  52949. googleapi.Expand(req.URL, map[string]string{
  52950. "project": c.project,
  52951. })
  52952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52953. }
  52954. // Do executes the "compute.globalAddresses.list" call.
  52955. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  52956. // status code is an error. Response headers are in either
  52957. // *AddressList.ServerResponse.Header or (if a response was returned at
  52958. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52959. // to check whether the returned error was because
  52960. // http.StatusNotModified was returned.
  52961. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  52962. gensupport.SetOptions(c.urlParams_, opts...)
  52963. res, err := c.doRequest("json")
  52964. if res != nil && res.StatusCode == http.StatusNotModified {
  52965. if res.Body != nil {
  52966. res.Body.Close()
  52967. }
  52968. return nil, &googleapi.Error{
  52969. Code: res.StatusCode,
  52970. Header: res.Header,
  52971. }
  52972. }
  52973. if err != nil {
  52974. return nil, err
  52975. }
  52976. defer googleapi.CloseBody(res)
  52977. if err := googleapi.CheckResponse(res); err != nil {
  52978. return nil, err
  52979. }
  52980. ret := &AddressList{
  52981. ServerResponse: googleapi.ServerResponse{
  52982. Header: res.Header,
  52983. HTTPStatusCode: res.StatusCode,
  52984. },
  52985. }
  52986. target := &ret
  52987. if err := gensupport.DecodeResponse(target, res); err != nil {
  52988. return nil, err
  52989. }
  52990. return ret, nil
  52991. // {
  52992. // "description": "Retrieves a list of global addresses.",
  52993. // "httpMethod": "GET",
  52994. // "id": "compute.globalAddresses.list",
  52995. // "parameterOrder": [
  52996. // "project"
  52997. // ],
  52998. // "parameters": {
  52999. // "filter": {
  53000. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  53001. // "location": "query",
  53002. // "type": "string"
  53003. // },
  53004. // "maxResults": {
  53005. // "default": "500",
  53006. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  53007. // "format": "uint32",
  53008. // "location": "query",
  53009. // "minimum": "0",
  53010. // "type": "integer"
  53011. // },
  53012. // "orderBy": {
  53013. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  53014. // "location": "query",
  53015. // "type": "string"
  53016. // },
  53017. // "pageToken": {
  53018. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  53019. // "location": "query",
  53020. // "type": "string"
  53021. // },
  53022. // "project": {
  53023. // "description": "Project ID for this request.",
  53024. // "location": "path",
  53025. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53026. // "required": true,
  53027. // "type": "string"
  53028. // }
  53029. // },
  53030. // "path": "{project}/global/addresses",
  53031. // "response": {
  53032. // "$ref": "AddressList"
  53033. // },
  53034. // "scopes": [
  53035. // "https://www.googleapis.com/auth/cloud-platform",
  53036. // "https://www.googleapis.com/auth/compute",
  53037. // "https://www.googleapis.com/auth/compute.readonly"
  53038. // ]
  53039. // }
  53040. }
  53041. // Pages invokes f for each page of results.
  53042. // A non-nil error returned from f will halt the iteration.
  53043. // The provided context supersedes any context provided to the Context method.
  53044. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  53045. c.ctx_ = ctx
  53046. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  53047. for {
  53048. x, err := c.Do()
  53049. if err != nil {
  53050. return err
  53051. }
  53052. if err := f(x); err != nil {
  53053. return err
  53054. }
  53055. if x.NextPageToken == "" {
  53056. return nil
  53057. }
  53058. c.PageToken(x.NextPageToken)
  53059. }
  53060. }
  53061. // method id "compute.globalAddresses.setLabels":
  53062. type GlobalAddressesSetLabelsCall struct {
  53063. s *Service
  53064. project string
  53065. resource string
  53066. globalsetlabelsrequest *GlobalSetLabelsRequest
  53067. urlParams_ gensupport.URLParams
  53068. ctx_ context.Context
  53069. header_ http.Header
  53070. }
  53071. // SetLabels: Sets the labels on a GlobalAddress. To learn more about
  53072. // labels, read the Labeling Resources documentation.
  53073. func (r *GlobalAddressesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalAddressesSetLabelsCall {
  53074. c := &GlobalAddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53075. c.project = project
  53076. c.resource = resource
  53077. c.globalsetlabelsrequest = globalsetlabelsrequest
  53078. return c
  53079. }
  53080. // Fields allows partial responses to be retrieved. See
  53081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53082. // for more information.
  53083. func (c *GlobalAddressesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalAddressesSetLabelsCall {
  53084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53085. return c
  53086. }
  53087. // Context sets the context to be used in this call's Do method. Any
  53088. // pending HTTP request will be aborted if the provided context is
  53089. // canceled.
  53090. func (c *GlobalAddressesSetLabelsCall) Context(ctx context.Context) *GlobalAddressesSetLabelsCall {
  53091. c.ctx_ = ctx
  53092. return c
  53093. }
  53094. // Header returns an http.Header that can be modified by the caller to
  53095. // add HTTP headers to the request.
  53096. func (c *GlobalAddressesSetLabelsCall) Header() http.Header {
  53097. if c.header_ == nil {
  53098. c.header_ = make(http.Header)
  53099. }
  53100. return c.header_
  53101. }
  53102. func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  53103. reqHeaders := make(http.Header)
  53104. for k, v := range c.header_ {
  53105. reqHeaders[k] = v
  53106. }
  53107. reqHeaders.Set("User-Agent", c.s.userAgent())
  53108. var body io.Reader = nil
  53109. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  53110. if err != nil {
  53111. return nil, err
  53112. }
  53113. reqHeaders.Set("Content-Type", "application/json")
  53114. c.urlParams_.Set("alt", alt)
  53115. c.urlParams_.Set("prettyPrint", "false")
  53116. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/setLabels")
  53117. urls += "?" + c.urlParams_.Encode()
  53118. req, err := http.NewRequest("POST", urls, body)
  53119. if err != nil {
  53120. return nil, err
  53121. }
  53122. req.Header = reqHeaders
  53123. googleapi.Expand(req.URL, map[string]string{
  53124. "project": c.project,
  53125. "resource": c.resource,
  53126. })
  53127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53128. }
  53129. // Do executes the "compute.globalAddresses.setLabels" call.
  53130. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53131. // status code is an error. Response headers are in either
  53132. // *Operation.ServerResponse.Header or (if a response was returned at
  53133. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53134. // to check whether the returned error was because
  53135. // http.StatusNotModified was returned.
  53136. func (c *GlobalAddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53137. gensupport.SetOptions(c.urlParams_, opts...)
  53138. res, err := c.doRequest("json")
  53139. if res != nil && res.StatusCode == http.StatusNotModified {
  53140. if res.Body != nil {
  53141. res.Body.Close()
  53142. }
  53143. return nil, &googleapi.Error{
  53144. Code: res.StatusCode,
  53145. Header: res.Header,
  53146. }
  53147. }
  53148. if err != nil {
  53149. return nil, err
  53150. }
  53151. defer googleapi.CloseBody(res)
  53152. if err := googleapi.CheckResponse(res); err != nil {
  53153. return nil, err
  53154. }
  53155. ret := &Operation{
  53156. ServerResponse: googleapi.ServerResponse{
  53157. Header: res.Header,
  53158. HTTPStatusCode: res.StatusCode,
  53159. },
  53160. }
  53161. target := &ret
  53162. if err := gensupport.DecodeResponse(target, res); err != nil {
  53163. return nil, err
  53164. }
  53165. return ret, nil
  53166. // {
  53167. // "description": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.",
  53168. // "httpMethod": "POST",
  53169. // "id": "compute.globalAddresses.setLabels",
  53170. // "parameterOrder": [
  53171. // "project",
  53172. // "resource"
  53173. // ],
  53174. // "parameters": {
  53175. // "project": {
  53176. // "description": "Project ID for this request.",
  53177. // "location": "path",
  53178. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53179. // "required": true,
  53180. // "type": "string"
  53181. // },
  53182. // "resource": {
  53183. // "description": "Name or id of the resource for this request.",
  53184. // "location": "path",
  53185. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53186. // "required": true,
  53187. // "type": "string"
  53188. // }
  53189. // },
  53190. // "path": "{project}/global/addresses/{resource}/setLabels",
  53191. // "request": {
  53192. // "$ref": "GlobalSetLabelsRequest"
  53193. // },
  53194. // "response": {
  53195. // "$ref": "Operation"
  53196. // },
  53197. // "scopes": [
  53198. // "https://www.googleapis.com/auth/cloud-platform",
  53199. // "https://www.googleapis.com/auth/compute"
  53200. // ]
  53201. // }
  53202. }
  53203. // method id "compute.globalAddresses.testIamPermissions":
  53204. type GlobalAddressesTestIamPermissionsCall struct {
  53205. s *Service
  53206. project string
  53207. resource string
  53208. testpermissionsrequest *TestPermissionsRequest
  53209. urlParams_ gensupport.URLParams
  53210. ctx_ context.Context
  53211. header_ http.Header
  53212. }
  53213. // TestIamPermissions: Returns permissions that a caller has on the
  53214. // specified resource.
  53215. func (r *GlobalAddressesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalAddressesTestIamPermissionsCall {
  53216. c := &GlobalAddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53217. c.project = project
  53218. c.resource = resource
  53219. c.testpermissionsrequest = testpermissionsrequest
  53220. return c
  53221. }
  53222. // Fields allows partial responses to be retrieved. See
  53223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53224. // for more information.
  53225. func (c *GlobalAddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalAddressesTestIamPermissionsCall {
  53226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53227. return c
  53228. }
  53229. // Context sets the context to be used in this call's Do method. Any
  53230. // pending HTTP request will be aborted if the provided context is
  53231. // canceled.
  53232. func (c *GlobalAddressesTestIamPermissionsCall) Context(ctx context.Context) *GlobalAddressesTestIamPermissionsCall {
  53233. c.ctx_ = ctx
  53234. return c
  53235. }
  53236. // Header returns an http.Header that can be modified by the caller to
  53237. // add HTTP headers to the request.
  53238. func (c *GlobalAddressesTestIamPermissionsCall) Header() http.Header {
  53239. if c.header_ == nil {
  53240. c.header_ = make(http.Header)
  53241. }
  53242. return c.header_
  53243. }
  53244. func (c *GlobalAddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  53245. reqHeaders := make(http.Header)
  53246. for k, v := range c.header_ {
  53247. reqHeaders[k] = v
  53248. }
  53249. reqHeaders.Set("User-Agent", c.s.userAgent())
  53250. var body io.Reader = nil
  53251. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  53252. if err != nil {
  53253. return nil, err
  53254. }
  53255. reqHeaders.Set("Content-Type", "application/json")
  53256. c.urlParams_.Set("alt", alt)
  53257. c.urlParams_.Set("prettyPrint", "false")
  53258. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/testIamPermissions")
  53259. urls += "?" + c.urlParams_.Encode()
  53260. req, err := http.NewRequest("POST", urls, body)
  53261. if err != nil {
  53262. return nil, err
  53263. }
  53264. req.Header = reqHeaders
  53265. googleapi.Expand(req.URL, map[string]string{
  53266. "project": c.project,
  53267. "resource": c.resource,
  53268. })
  53269. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53270. }
  53271. // Do executes the "compute.globalAddresses.testIamPermissions" call.
  53272. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  53273. // non-2xx status code is an error. Response headers are in either
  53274. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  53275. // returned at all) in error.(*googleapi.Error).Header. Use
  53276. // googleapi.IsNotModified to check whether the returned error was
  53277. // because http.StatusNotModified was returned.
  53278. func (c *GlobalAddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  53279. gensupport.SetOptions(c.urlParams_, opts...)
  53280. res, err := c.doRequest("json")
  53281. if res != nil && res.StatusCode == http.StatusNotModified {
  53282. if res.Body != nil {
  53283. res.Body.Close()
  53284. }
  53285. return nil, &googleapi.Error{
  53286. Code: res.StatusCode,
  53287. Header: res.Header,
  53288. }
  53289. }
  53290. if err != nil {
  53291. return nil, err
  53292. }
  53293. defer googleapi.CloseBody(res)
  53294. if err := googleapi.CheckResponse(res); err != nil {
  53295. return nil, err
  53296. }
  53297. ret := &TestPermissionsResponse{
  53298. ServerResponse: googleapi.ServerResponse{
  53299. Header: res.Header,
  53300. HTTPStatusCode: res.StatusCode,
  53301. },
  53302. }
  53303. target := &ret
  53304. if err := gensupport.DecodeResponse(target, res); err != nil {
  53305. return nil, err
  53306. }
  53307. return ret, nil
  53308. // {
  53309. // "description": "Returns permissions that a caller has on the specified resource.",
  53310. // "httpMethod": "POST",
  53311. // "id": "compute.globalAddresses.testIamPermissions",
  53312. // "parameterOrder": [
  53313. // "project",
  53314. // "resource"
  53315. // ],
  53316. // "parameters": {
  53317. // "project": {
  53318. // "description": "Project ID for this request.",
  53319. // "location": "path",
  53320. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53321. // "required": true,
  53322. // "type": "string"
  53323. // },
  53324. // "resource": {
  53325. // "description": "Name or id of the resource for this request.",
  53326. // "location": "path",
  53327. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53328. // "required": true,
  53329. // "type": "string"
  53330. // }
  53331. // },
  53332. // "path": "{project}/global/addresses/{resource}/testIamPermissions",
  53333. // "request": {
  53334. // "$ref": "TestPermissionsRequest"
  53335. // },
  53336. // "response": {
  53337. // "$ref": "TestPermissionsResponse"
  53338. // },
  53339. // "scopes": [
  53340. // "https://www.googleapis.com/auth/cloud-platform",
  53341. // "https://www.googleapis.com/auth/compute",
  53342. // "https://www.googleapis.com/auth/compute.readonly"
  53343. // ]
  53344. // }
  53345. }
  53346. // method id "compute.globalForwardingRules.delete":
  53347. type GlobalForwardingRulesDeleteCall struct {
  53348. s *Service
  53349. project string
  53350. forwardingRule string
  53351. urlParams_ gensupport.URLParams
  53352. ctx_ context.Context
  53353. header_ http.Header
  53354. }
  53355. // Delete: Deletes the specified GlobalForwardingRule resource.
  53356. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  53357. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  53358. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53359. c.project = project
  53360. c.forwardingRule = forwardingRule
  53361. return c
  53362. }
  53363. // RequestId sets the optional parameter "requestId": An optional
  53364. // request ID to identify requests. Specify a unique request ID so that
  53365. // if you must retry your request, the server will know to ignore the
  53366. // request if it has already been completed.
  53367. //
  53368. // For example, consider a situation where you make an initial request
  53369. // and the request times out. If you make the request again with the
  53370. // same request ID, the server can check if original operation with the
  53371. // same request ID was received, and if so, will ignore the second
  53372. // request. This prevents clients from accidentally creating duplicate
  53373. // commitments.
  53374. //
  53375. // The request ID must be a valid UUID with the exception that zero UUID
  53376. // is not supported (00000000-0000-0000-0000-000000000000).
  53377. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  53378. c.urlParams_.Set("requestId", requestId)
  53379. return c
  53380. }
  53381. // Fields allows partial responses to be retrieved. See
  53382. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53383. // for more information.
  53384. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  53385. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53386. return c
  53387. }
  53388. // Context sets the context to be used in this call's Do method. Any
  53389. // pending HTTP request will be aborted if the provided context is
  53390. // canceled.
  53391. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  53392. c.ctx_ = ctx
  53393. return c
  53394. }
  53395. // Header returns an http.Header that can be modified by the caller to
  53396. // add HTTP headers to the request.
  53397. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  53398. if c.header_ == nil {
  53399. c.header_ = make(http.Header)
  53400. }
  53401. return c.header_
  53402. }
  53403. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  53404. reqHeaders := make(http.Header)
  53405. for k, v := range c.header_ {
  53406. reqHeaders[k] = v
  53407. }
  53408. reqHeaders.Set("User-Agent", c.s.userAgent())
  53409. var body io.Reader = nil
  53410. c.urlParams_.Set("alt", alt)
  53411. c.urlParams_.Set("prettyPrint", "false")
  53412. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  53413. urls += "?" + c.urlParams_.Encode()
  53414. req, err := http.NewRequest("DELETE", urls, body)
  53415. if err != nil {
  53416. return nil, err
  53417. }
  53418. req.Header = reqHeaders
  53419. googleapi.Expand(req.URL, map[string]string{
  53420. "project": c.project,
  53421. "forwardingRule": c.forwardingRule,
  53422. })
  53423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53424. }
  53425. // Do executes the "compute.globalForwardingRules.delete" call.
  53426. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53427. // status code is an error. Response headers are in either
  53428. // *Operation.ServerResponse.Header or (if a response was returned at
  53429. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53430. // to check whether the returned error was because
  53431. // http.StatusNotModified was returned.
  53432. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53433. gensupport.SetOptions(c.urlParams_, opts...)
  53434. res, err := c.doRequest("json")
  53435. if res != nil && res.StatusCode == http.StatusNotModified {
  53436. if res.Body != nil {
  53437. res.Body.Close()
  53438. }
  53439. return nil, &googleapi.Error{
  53440. Code: res.StatusCode,
  53441. Header: res.Header,
  53442. }
  53443. }
  53444. if err != nil {
  53445. return nil, err
  53446. }
  53447. defer googleapi.CloseBody(res)
  53448. if err := googleapi.CheckResponse(res); err != nil {
  53449. return nil, err
  53450. }
  53451. ret := &Operation{
  53452. ServerResponse: googleapi.ServerResponse{
  53453. Header: res.Header,
  53454. HTTPStatusCode: res.StatusCode,
  53455. },
  53456. }
  53457. target := &ret
  53458. if err := gensupport.DecodeResponse(target, res); err != nil {
  53459. return nil, err
  53460. }
  53461. return ret, nil
  53462. // {
  53463. // "description": "Deletes the specified GlobalForwardingRule resource.",
  53464. // "httpMethod": "DELETE",
  53465. // "id": "compute.globalForwardingRules.delete",
  53466. // "parameterOrder": [
  53467. // "project",
  53468. // "forwardingRule"
  53469. // ],
  53470. // "parameters": {
  53471. // "forwardingRule": {
  53472. // "description": "Name of the ForwardingRule resource to delete.",
  53473. // "location": "path",
  53474. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53475. // "required": true,
  53476. // "type": "string"
  53477. // },
  53478. // "project": {
  53479. // "description": "Project ID for this request.",
  53480. // "location": "path",
  53481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53482. // "required": true,
  53483. // "type": "string"
  53484. // },
  53485. // "requestId": {
  53486. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53487. // "location": "query",
  53488. // "type": "string"
  53489. // }
  53490. // },
  53491. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  53492. // "response": {
  53493. // "$ref": "Operation"
  53494. // },
  53495. // "scopes": [
  53496. // "https://www.googleapis.com/auth/cloud-platform",
  53497. // "https://www.googleapis.com/auth/compute"
  53498. // ]
  53499. // }
  53500. }
  53501. // method id "compute.globalForwardingRules.get":
  53502. type GlobalForwardingRulesGetCall struct {
  53503. s *Service
  53504. project string
  53505. forwardingRule string
  53506. urlParams_ gensupport.URLParams
  53507. ifNoneMatch_ string
  53508. ctx_ context.Context
  53509. header_ http.Header
  53510. }
  53511. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  53512. // of available forwarding rules by making a list() request.
  53513. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  53514. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  53515. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53516. c.project = project
  53517. c.forwardingRule = forwardingRule
  53518. return c
  53519. }
  53520. // Fields allows partial responses to be retrieved. See
  53521. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53522. // for more information.
  53523. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  53524. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53525. return c
  53526. }
  53527. // IfNoneMatch sets the optional parameter which makes the operation
  53528. // fail if the object's ETag matches the given value. This is useful for
  53529. // getting updates only after the object has changed since the last
  53530. // request. Use googleapi.IsNotModified to check whether the response
  53531. // error from Do is the result of In-None-Match.
  53532. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  53533. c.ifNoneMatch_ = entityTag
  53534. return c
  53535. }
  53536. // Context sets the context to be used in this call's Do method. Any
  53537. // pending HTTP request will be aborted if the provided context is
  53538. // canceled.
  53539. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  53540. c.ctx_ = ctx
  53541. return c
  53542. }
  53543. // Header returns an http.Header that can be modified by the caller to
  53544. // add HTTP headers to the request.
  53545. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  53546. if c.header_ == nil {
  53547. c.header_ = make(http.Header)
  53548. }
  53549. return c.header_
  53550. }
  53551. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  53552. reqHeaders := make(http.Header)
  53553. for k, v := range c.header_ {
  53554. reqHeaders[k] = v
  53555. }
  53556. reqHeaders.Set("User-Agent", c.s.userAgent())
  53557. if c.ifNoneMatch_ != "" {
  53558. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53559. }
  53560. var body io.Reader = nil
  53561. c.urlParams_.Set("alt", alt)
  53562. c.urlParams_.Set("prettyPrint", "false")
  53563. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  53564. urls += "?" + c.urlParams_.Encode()
  53565. req, err := http.NewRequest("GET", urls, body)
  53566. if err != nil {
  53567. return nil, err
  53568. }
  53569. req.Header = reqHeaders
  53570. googleapi.Expand(req.URL, map[string]string{
  53571. "project": c.project,
  53572. "forwardingRule": c.forwardingRule,
  53573. })
  53574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53575. }
  53576. // Do executes the "compute.globalForwardingRules.get" call.
  53577. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  53578. // status code is an error. Response headers are in either
  53579. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  53580. // at all) in error.(*googleapi.Error).Header. Use
  53581. // googleapi.IsNotModified to check whether the returned error was
  53582. // because http.StatusNotModified was returned.
  53583. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  53584. gensupport.SetOptions(c.urlParams_, opts...)
  53585. res, err := c.doRequest("json")
  53586. if res != nil && res.StatusCode == http.StatusNotModified {
  53587. if res.Body != nil {
  53588. res.Body.Close()
  53589. }
  53590. return nil, &googleapi.Error{
  53591. Code: res.StatusCode,
  53592. Header: res.Header,
  53593. }
  53594. }
  53595. if err != nil {
  53596. return nil, err
  53597. }
  53598. defer googleapi.CloseBody(res)
  53599. if err := googleapi.CheckResponse(res); err != nil {
  53600. return nil, err
  53601. }
  53602. ret := &ForwardingRule{
  53603. ServerResponse: googleapi.ServerResponse{
  53604. Header: res.Header,
  53605. HTTPStatusCode: res.StatusCode,
  53606. },
  53607. }
  53608. target := &ret
  53609. if err := gensupport.DecodeResponse(target, res); err != nil {
  53610. return nil, err
  53611. }
  53612. return ret, nil
  53613. // {
  53614. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  53615. // "httpMethod": "GET",
  53616. // "id": "compute.globalForwardingRules.get",
  53617. // "parameterOrder": [
  53618. // "project",
  53619. // "forwardingRule"
  53620. // ],
  53621. // "parameters": {
  53622. // "forwardingRule": {
  53623. // "description": "Name of the ForwardingRule resource to return.",
  53624. // "location": "path",
  53625. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53626. // "required": true,
  53627. // "type": "string"
  53628. // },
  53629. // "project": {
  53630. // "description": "Project ID for this request.",
  53631. // "location": "path",
  53632. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53633. // "required": true,
  53634. // "type": "string"
  53635. // }
  53636. // },
  53637. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  53638. // "response": {
  53639. // "$ref": "ForwardingRule"
  53640. // },
  53641. // "scopes": [
  53642. // "https://www.googleapis.com/auth/cloud-platform",
  53643. // "https://www.googleapis.com/auth/compute",
  53644. // "https://www.googleapis.com/auth/compute.readonly"
  53645. // ]
  53646. // }
  53647. }
  53648. // method id "compute.globalForwardingRules.insert":
  53649. type GlobalForwardingRulesInsertCall struct {
  53650. s *Service
  53651. project string
  53652. forwardingrule *ForwardingRule
  53653. urlParams_ gensupport.URLParams
  53654. ctx_ context.Context
  53655. header_ http.Header
  53656. }
  53657. // Insert: Creates a GlobalForwardingRule resource in the specified
  53658. // project using the data included in the request.
  53659. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  53660. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  53661. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53662. c.project = project
  53663. c.forwardingrule = forwardingrule
  53664. return c
  53665. }
  53666. // RequestId sets the optional parameter "requestId": An optional
  53667. // request ID to identify requests. Specify a unique request ID so that
  53668. // if you must retry your request, the server will know to ignore the
  53669. // request if it has already been completed.
  53670. //
  53671. // For example, consider a situation where you make an initial request
  53672. // and the request times out. If you make the request again with the
  53673. // same request ID, the server can check if original operation with the
  53674. // same request ID was received, and if so, will ignore the second
  53675. // request. This prevents clients from accidentally creating duplicate
  53676. // commitments.
  53677. //
  53678. // The request ID must be a valid UUID with the exception that zero UUID
  53679. // is not supported (00000000-0000-0000-0000-000000000000).
  53680. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  53681. c.urlParams_.Set("requestId", requestId)
  53682. return c
  53683. }
  53684. // Fields allows partial responses to be retrieved. See
  53685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53686. // for more information.
  53687. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  53688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53689. return c
  53690. }
  53691. // Context sets the context to be used in this call's Do method. Any
  53692. // pending HTTP request will be aborted if the provided context is
  53693. // canceled.
  53694. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  53695. c.ctx_ = ctx
  53696. return c
  53697. }
  53698. // Header returns an http.Header that can be modified by the caller to
  53699. // add HTTP headers to the request.
  53700. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  53701. if c.header_ == nil {
  53702. c.header_ = make(http.Header)
  53703. }
  53704. return c.header_
  53705. }
  53706. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  53707. reqHeaders := make(http.Header)
  53708. for k, v := range c.header_ {
  53709. reqHeaders[k] = v
  53710. }
  53711. reqHeaders.Set("User-Agent", c.s.userAgent())
  53712. var body io.Reader = nil
  53713. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  53714. if err != nil {
  53715. return nil, err
  53716. }
  53717. reqHeaders.Set("Content-Type", "application/json")
  53718. c.urlParams_.Set("alt", alt)
  53719. c.urlParams_.Set("prettyPrint", "false")
  53720. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  53721. urls += "?" + c.urlParams_.Encode()
  53722. req, err := http.NewRequest("POST", urls, body)
  53723. if err != nil {
  53724. return nil, err
  53725. }
  53726. req.Header = reqHeaders
  53727. googleapi.Expand(req.URL, map[string]string{
  53728. "project": c.project,
  53729. })
  53730. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53731. }
  53732. // Do executes the "compute.globalForwardingRules.insert" call.
  53733. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53734. // status code is an error. Response headers are in either
  53735. // *Operation.ServerResponse.Header or (if a response was returned at
  53736. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53737. // to check whether the returned error was because
  53738. // http.StatusNotModified was returned.
  53739. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53740. gensupport.SetOptions(c.urlParams_, opts...)
  53741. res, err := c.doRequest("json")
  53742. if res != nil && res.StatusCode == http.StatusNotModified {
  53743. if res.Body != nil {
  53744. res.Body.Close()
  53745. }
  53746. return nil, &googleapi.Error{
  53747. Code: res.StatusCode,
  53748. Header: res.Header,
  53749. }
  53750. }
  53751. if err != nil {
  53752. return nil, err
  53753. }
  53754. defer googleapi.CloseBody(res)
  53755. if err := googleapi.CheckResponse(res); err != nil {
  53756. return nil, err
  53757. }
  53758. ret := &Operation{
  53759. ServerResponse: googleapi.ServerResponse{
  53760. Header: res.Header,
  53761. HTTPStatusCode: res.StatusCode,
  53762. },
  53763. }
  53764. target := &ret
  53765. if err := gensupport.DecodeResponse(target, res); err != nil {
  53766. return nil, err
  53767. }
  53768. return ret, nil
  53769. // {
  53770. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  53771. // "httpMethod": "POST",
  53772. // "id": "compute.globalForwardingRules.insert",
  53773. // "parameterOrder": [
  53774. // "project"
  53775. // ],
  53776. // "parameters": {
  53777. // "project": {
  53778. // "description": "Project ID for this request.",
  53779. // "location": "path",
  53780. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53781. // "required": true,
  53782. // "type": "string"
  53783. // },
  53784. // "requestId": {
  53785. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53786. // "location": "query",
  53787. // "type": "string"
  53788. // }
  53789. // },
  53790. // "path": "{project}/global/forwardingRules",
  53791. // "request": {
  53792. // "$ref": "ForwardingRule"
  53793. // },
  53794. // "response": {
  53795. // "$ref": "Operation"
  53796. // },
  53797. // "scopes": [
  53798. // "https://www.googleapis.com/auth/cloud-platform",
  53799. // "https://www.googleapis.com/auth/compute"
  53800. // ]
  53801. // }
  53802. }
  53803. // method id "compute.globalForwardingRules.list":
  53804. type GlobalForwardingRulesListCall struct {
  53805. s *Service
  53806. project string
  53807. urlParams_ gensupport.URLParams
  53808. ifNoneMatch_ string
  53809. ctx_ context.Context
  53810. header_ http.Header
  53811. }
  53812. // List: Retrieves a list of GlobalForwardingRule resources available to
  53813. // the specified project.
  53814. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  53815. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  53816. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53817. c.project = project
  53818. return c
  53819. }
  53820. // Filter sets the optional parameter "filter": A filter expression that
  53821. // filters resources listed in the response. The expression must specify
  53822. // the field name, a comparison operator, and the value that you want to
  53823. // use for filtering. The value must be a string, a number, or a
  53824. // boolean. The comparison operator must be either =, !=, >, or <.
  53825. //
  53826. // For example, if you are filtering Compute Engine instances, you can
  53827. // exclude instances named example-instance by specifying name !=
  53828. // example-instance.
  53829. //
  53830. // You can also filter nested fields. For example, you could specify
  53831. // scheduling.automaticRestart = false to include instances only if they
  53832. // are not scheduled for automatic restarts. You can use filtering on
  53833. // nested fields to filter based on resource labels.
  53834. //
  53835. // To filter on multiple expressions, provide each separate expression
  53836. // within parentheses. For example, (scheduling.automaticRestart = true)
  53837. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  53838. // AND expression. However, you can include AND and OR expressions
  53839. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  53840. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  53841. // true).
  53842. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  53843. c.urlParams_.Set("filter", filter)
  53844. return c
  53845. }
  53846. // MaxResults sets the optional parameter "maxResults": The maximum
  53847. // number of results per page that should be returned. If the number of
  53848. // available results is larger than maxResults, Compute Engine returns a
  53849. // nextPageToken that can be used to get the next page of results in
  53850. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  53851. // (Default: 500)
  53852. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  53853. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  53854. return c
  53855. }
  53856. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  53857. // a certain order. By default, results are returned in alphanumerical
  53858. // order based on the resource name.
  53859. //
  53860. // You can also sort results in descending order based on the creation
  53861. // timestamp using orderBy="creationTimestamp desc". This sorts results
  53862. // based on the creationTimestamp field in reverse chronological order
  53863. // (newest result first). Use this to sort resources like operations so
  53864. // that the newest operation is returned first.
  53865. //
  53866. // Currently, only sorting by name or creationTimestamp desc is
  53867. // supported.
  53868. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  53869. c.urlParams_.Set("orderBy", orderBy)
  53870. return c
  53871. }
  53872. // PageToken sets the optional parameter "pageToken": Specifies a page
  53873. // token to use. Set pageToken to the nextPageToken returned by a
  53874. // previous list request to get the next page of results.
  53875. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  53876. c.urlParams_.Set("pageToken", pageToken)
  53877. return c
  53878. }
  53879. // Fields allows partial responses to be retrieved. See
  53880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53881. // for more information.
  53882. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  53883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53884. return c
  53885. }
  53886. // IfNoneMatch sets the optional parameter which makes the operation
  53887. // fail if the object's ETag matches the given value. This is useful for
  53888. // getting updates only after the object has changed since the last
  53889. // request. Use googleapi.IsNotModified to check whether the response
  53890. // error from Do is the result of In-None-Match.
  53891. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  53892. c.ifNoneMatch_ = entityTag
  53893. return c
  53894. }
  53895. // Context sets the context to be used in this call's Do method. Any
  53896. // pending HTTP request will be aborted if the provided context is
  53897. // canceled.
  53898. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  53899. c.ctx_ = ctx
  53900. return c
  53901. }
  53902. // Header returns an http.Header that can be modified by the caller to
  53903. // add HTTP headers to the request.
  53904. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  53905. if c.header_ == nil {
  53906. c.header_ = make(http.Header)
  53907. }
  53908. return c.header_
  53909. }
  53910. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  53911. reqHeaders := make(http.Header)
  53912. for k, v := range c.header_ {
  53913. reqHeaders[k] = v
  53914. }
  53915. reqHeaders.Set("User-Agent", c.s.userAgent())
  53916. if c.ifNoneMatch_ != "" {
  53917. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53918. }
  53919. var body io.Reader = nil
  53920. c.urlParams_.Set("alt", alt)
  53921. c.urlParams_.Set("prettyPrint", "false")
  53922. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  53923. urls += "?" + c.urlParams_.Encode()
  53924. req, err := http.NewRequest("GET", urls, body)
  53925. if err != nil {
  53926. return nil, err
  53927. }
  53928. req.Header = reqHeaders
  53929. googleapi.Expand(req.URL, map[string]string{
  53930. "project": c.project,
  53931. })
  53932. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53933. }
  53934. // Do executes the "compute.globalForwardingRules.list" call.
  53935. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  53936. // non-2xx status code is an error. Response headers are in either
  53937. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  53938. // returned at all) in error.(*googleapi.Error).Header. Use
  53939. // googleapi.IsNotModified to check whether the returned error was
  53940. // because http.StatusNotModified was returned.
  53941. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  53942. gensupport.SetOptions(c.urlParams_, opts...)
  53943. res, err := c.doRequest("json")
  53944. if res != nil && res.StatusCode == http.StatusNotModified {
  53945. if res.Body != nil {
  53946. res.Body.Close()
  53947. }
  53948. return nil, &googleapi.Error{
  53949. Code: res.StatusCode,
  53950. Header: res.Header,
  53951. }
  53952. }
  53953. if err != nil {
  53954. return nil, err
  53955. }
  53956. defer googleapi.CloseBody(res)
  53957. if err := googleapi.CheckResponse(res); err != nil {
  53958. return nil, err
  53959. }
  53960. ret := &ForwardingRuleList{
  53961. ServerResponse: googleapi.ServerResponse{
  53962. Header: res.Header,
  53963. HTTPStatusCode: res.StatusCode,
  53964. },
  53965. }
  53966. target := &ret
  53967. if err := gensupport.DecodeResponse(target, res); err != nil {
  53968. return nil, err
  53969. }
  53970. return ret, nil
  53971. // {
  53972. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  53973. // "httpMethod": "GET",
  53974. // "id": "compute.globalForwardingRules.list",
  53975. // "parameterOrder": [
  53976. // "project"
  53977. // ],
  53978. // "parameters": {
  53979. // "filter": {
  53980. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  53981. // "location": "query",
  53982. // "type": "string"
  53983. // },
  53984. // "maxResults": {
  53985. // "default": "500",
  53986. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  53987. // "format": "uint32",
  53988. // "location": "query",
  53989. // "minimum": "0",
  53990. // "type": "integer"
  53991. // },
  53992. // "orderBy": {
  53993. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  53994. // "location": "query",
  53995. // "type": "string"
  53996. // },
  53997. // "pageToken": {
  53998. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  53999. // "location": "query",
  54000. // "type": "string"
  54001. // },
  54002. // "project": {
  54003. // "description": "Project ID for this request.",
  54004. // "location": "path",
  54005. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54006. // "required": true,
  54007. // "type": "string"
  54008. // }
  54009. // },
  54010. // "path": "{project}/global/forwardingRules",
  54011. // "response": {
  54012. // "$ref": "ForwardingRuleList"
  54013. // },
  54014. // "scopes": [
  54015. // "https://www.googleapis.com/auth/cloud-platform",
  54016. // "https://www.googleapis.com/auth/compute",
  54017. // "https://www.googleapis.com/auth/compute.readonly"
  54018. // ]
  54019. // }
  54020. }
  54021. // Pages invokes f for each page of results.
  54022. // A non-nil error returned from f will halt the iteration.
  54023. // The provided context supersedes any context provided to the Context method.
  54024. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  54025. c.ctx_ = ctx
  54026. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  54027. for {
  54028. x, err := c.Do()
  54029. if err != nil {
  54030. return err
  54031. }
  54032. if err := f(x); err != nil {
  54033. return err
  54034. }
  54035. if x.NextPageToken == "" {
  54036. return nil
  54037. }
  54038. c.PageToken(x.NextPageToken)
  54039. }
  54040. }
  54041. // method id "compute.globalForwardingRules.patch":
  54042. type GlobalForwardingRulesPatchCall struct {
  54043. s *Service
  54044. project string
  54045. forwardingRule string
  54046. forwardingrule *ForwardingRule
  54047. urlParams_ gensupport.URLParams
  54048. ctx_ context.Context
  54049. header_ http.Header
  54050. }
  54051. // Patch: Updates the specified forwarding rule with the data included
  54052. // in the request. This method supports PATCH semantics and uses the
  54053. // JSON merge patch format and processing rules. Currently, you can only
  54054. // patch the network_tier field.
  54055. func (r *GlobalForwardingRulesService) Patch(project string, forwardingRule string, forwardingrule *ForwardingRule) *GlobalForwardingRulesPatchCall {
  54056. c := &GlobalForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54057. c.project = project
  54058. c.forwardingRule = forwardingRule
  54059. c.forwardingrule = forwardingrule
  54060. return c
  54061. }
  54062. // RequestId sets the optional parameter "requestId": An optional
  54063. // request ID to identify requests. Specify a unique request ID so that
  54064. // if you must retry your request, the server will know to ignore the
  54065. // request if it has already been completed.
  54066. //
  54067. // For example, consider a situation where you make an initial request
  54068. // and the request times out. If you make the request again with the
  54069. // same request ID, the server can check if original operation with the
  54070. // same request ID was received, and if so, will ignore the second
  54071. // request. This prevents clients from accidentally creating duplicate
  54072. // commitments.
  54073. //
  54074. // The request ID must be a valid UUID with the exception that zero UUID
  54075. // is not supported (00000000-0000-0000-0000-000000000000).
  54076. func (c *GlobalForwardingRulesPatchCall) RequestId(requestId string) *GlobalForwardingRulesPatchCall {
  54077. c.urlParams_.Set("requestId", requestId)
  54078. return c
  54079. }
  54080. // Fields allows partial responses to be retrieved. See
  54081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54082. // for more information.
  54083. func (c *GlobalForwardingRulesPatchCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesPatchCall {
  54084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54085. return c
  54086. }
  54087. // Context sets the context to be used in this call's Do method. Any
  54088. // pending HTTP request will be aborted if the provided context is
  54089. // canceled.
  54090. func (c *GlobalForwardingRulesPatchCall) Context(ctx context.Context) *GlobalForwardingRulesPatchCall {
  54091. c.ctx_ = ctx
  54092. return c
  54093. }
  54094. // Header returns an http.Header that can be modified by the caller to
  54095. // add HTTP headers to the request.
  54096. func (c *GlobalForwardingRulesPatchCall) Header() http.Header {
  54097. if c.header_ == nil {
  54098. c.header_ = make(http.Header)
  54099. }
  54100. return c.header_
  54101. }
  54102. func (c *GlobalForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
  54103. reqHeaders := make(http.Header)
  54104. for k, v := range c.header_ {
  54105. reqHeaders[k] = v
  54106. }
  54107. reqHeaders.Set("User-Agent", c.s.userAgent())
  54108. var body io.Reader = nil
  54109. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  54110. if err != nil {
  54111. return nil, err
  54112. }
  54113. reqHeaders.Set("Content-Type", "application/json")
  54114. c.urlParams_.Set("alt", alt)
  54115. c.urlParams_.Set("prettyPrint", "false")
  54116. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  54117. urls += "?" + c.urlParams_.Encode()
  54118. req, err := http.NewRequest("PATCH", urls, body)
  54119. if err != nil {
  54120. return nil, err
  54121. }
  54122. req.Header = reqHeaders
  54123. googleapi.Expand(req.URL, map[string]string{
  54124. "project": c.project,
  54125. "forwardingRule": c.forwardingRule,
  54126. })
  54127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54128. }
  54129. // Do executes the "compute.globalForwardingRules.patch" call.
  54130. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54131. // status code is an error. Response headers are in either
  54132. // *Operation.ServerResponse.Header or (if a response was returned at
  54133. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54134. // to check whether the returned error was because
  54135. // http.StatusNotModified was returned.
  54136. func (c *GlobalForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54137. gensupport.SetOptions(c.urlParams_, opts...)
  54138. res, err := c.doRequest("json")
  54139. if res != nil && res.StatusCode == http.StatusNotModified {
  54140. if res.Body != nil {
  54141. res.Body.Close()
  54142. }
  54143. return nil, &googleapi.Error{
  54144. Code: res.StatusCode,
  54145. Header: res.Header,
  54146. }
  54147. }
  54148. if err != nil {
  54149. return nil, err
  54150. }
  54151. defer googleapi.CloseBody(res)
  54152. if err := googleapi.CheckResponse(res); err != nil {
  54153. return nil, err
  54154. }
  54155. ret := &Operation{
  54156. ServerResponse: googleapi.ServerResponse{
  54157. Header: res.Header,
  54158. HTTPStatusCode: res.StatusCode,
  54159. },
  54160. }
  54161. target := &ret
  54162. if err := gensupport.DecodeResponse(target, res); err != nil {
  54163. return nil, err
  54164. }
  54165. return ret, nil
  54166. // {
  54167. // "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.",
  54168. // "httpMethod": "PATCH",
  54169. // "id": "compute.globalForwardingRules.patch",
  54170. // "parameterOrder": [
  54171. // "project",
  54172. // "forwardingRule"
  54173. // ],
  54174. // "parameters": {
  54175. // "forwardingRule": {
  54176. // "description": "Name of the ForwardingRule resource to patch.",
  54177. // "location": "path",
  54178. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54179. // "required": true,
  54180. // "type": "string"
  54181. // },
  54182. // "project": {
  54183. // "description": "Project ID for this request.",
  54184. // "location": "path",
  54185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54186. // "required": true,
  54187. // "type": "string"
  54188. // },
  54189. // "requestId": {
  54190. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54191. // "location": "query",
  54192. // "type": "string"
  54193. // }
  54194. // },
  54195. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  54196. // "request": {
  54197. // "$ref": "ForwardingRule"
  54198. // },
  54199. // "response": {
  54200. // "$ref": "Operation"
  54201. // },
  54202. // "scopes": [
  54203. // "https://www.googleapis.com/auth/cloud-platform",
  54204. // "https://www.googleapis.com/auth/compute"
  54205. // ]
  54206. // }
  54207. }
  54208. // method id "compute.globalForwardingRules.setLabels":
  54209. type GlobalForwardingRulesSetLabelsCall struct {
  54210. s *Service
  54211. project string
  54212. resource string
  54213. globalsetlabelsrequest *GlobalSetLabelsRequest
  54214. urlParams_ gensupport.URLParams
  54215. ctx_ context.Context
  54216. header_ http.Header
  54217. }
  54218. // SetLabels: Sets the labels on the specified resource. To learn more
  54219. // about labels, read the Labeling Resources documentation.
  54220. func (r *GlobalForwardingRulesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalForwardingRulesSetLabelsCall {
  54221. c := &GlobalForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54222. c.project = project
  54223. c.resource = resource
  54224. c.globalsetlabelsrequest = globalsetlabelsrequest
  54225. return c
  54226. }
  54227. // Fields allows partial responses to be retrieved. See
  54228. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54229. // for more information.
  54230. func (c *GlobalForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetLabelsCall {
  54231. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54232. return c
  54233. }
  54234. // Context sets the context to be used in this call's Do method. Any
  54235. // pending HTTP request will be aborted if the provided context is
  54236. // canceled.
  54237. func (c *GlobalForwardingRulesSetLabelsCall) Context(ctx context.Context) *GlobalForwardingRulesSetLabelsCall {
  54238. c.ctx_ = ctx
  54239. return c
  54240. }
  54241. // Header returns an http.Header that can be modified by the caller to
  54242. // add HTTP headers to the request.
  54243. func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header {
  54244. if c.header_ == nil {
  54245. c.header_ = make(http.Header)
  54246. }
  54247. return c.header_
  54248. }
  54249. func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  54250. reqHeaders := make(http.Header)
  54251. for k, v := range c.header_ {
  54252. reqHeaders[k] = v
  54253. }
  54254. reqHeaders.Set("User-Agent", c.s.userAgent())
  54255. var body io.Reader = nil
  54256. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  54257. if err != nil {
  54258. return nil, err
  54259. }
  54260. reqHeaders.Set("Content-Type", "application/json")
  54261. c.urlParams_.Set("alt", alt)
  54262. c.urlParams_.Set("prettyPrint", "false")
  54263. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/setLabels")
  54264. urls += "?" + c.urlParams_.Encode()
  54265. req, err := http.NewRequest("POST", urls, body)
  54266. if err != nil {
  54267. return nil, err
  54268. }
  54269. req.Header = reqHeaders
  54270. googleapi.Expand(req.URL, map[string]string{
  54271. "project": c.project,
  54272. "resource": c.resource,
  54273. })
  54274. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54275. }
  54276. // Do executes the "compute.globalForwardingRules.setLabels" call.
  54277. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54278. // status code is an error. Response headers are in either
  54279. // *Operation.ServerResponse.Header or (if a response was returned at
  54280. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54281. // to check whether the returned error was because
  54282. // http.StatusNotModified was returned.
  54283. func (c *GlobalForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54284. gensupport.SetOptions(c.urlParams_, opts...)
  54285. res, err := c.doRequest("json")
  54286. if res != nil && res.StatusCode == http.StatusNotModified {
  54287. if res.Body != nil {
  54288. res.Body.Close()
  54289. }
  54290. return nil, &googleapi.Error{
  54291. Code: res.StatusCode,
  54292. Header: res.Header,
  54293. }
  54294. }
  54295. if err != nil {
  54296. return nil, err
  54297. }
  54298. defer googleapi.CloseBody(res)
  54299. if err := googleapi.CheckResponse(res); err != nil {
  54300. return nil, err
  54301. }
  54302. ret := &Operation{
  54303. ServerResponse: googleapi.ServerResponse{
  54304. Header: res.Header,
  54305. HTTPStatusCode: res.StatusCode,
  54306. },
  54307. }
  54308. target := &ret
  54309. if err := gensupport.DecodeResponse(target, res); err != nil {
  54310. return nil, err
  54311. }
  54312. return ret, nil
  54313. // {
  54314. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  54315. // "httpMethod": "POST",
  54316. // "id": "compute.globalForwardingRules.setLabels",
  54317. // "parameterOrder": [
  54318. // "project",
  54319. // "resource"
  54320. // ],
  54321. // "parameters": {
  54322. // "project": {
  54323. // "description": "Project ID for this request.",
  54324. // "location": "path",
  54325. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54326. // "required": true,
  54327. // "type": "string"
  54328. // },
  54329. // "resource": {
  54330. // "description": "Name or id of the resource for this request.",
  54331. // "location": "path",
  54332. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54333. // "required": true,
  54334. // "type": "string"
  54335. // }
  54336. // },
  54337. // "path": "{project}/global/forwardingRules/{resource}/setLabels",
  54338. // "request": {
  54339. // "$ref": "GlobalSetLabelsRequest"
  54340. // },
  54341. // "response": {
  54342. // "$ref": "Operation"
  54343. // },
  54344. // "scopes": [
  54345. // "https://www.googleapis.com/auth/cloud-platform",
  54346. // "https://www.googleapis.com/auth/compute"
  54347. // ]
  54348. // }
  54349. }
  54350. // method id "compute.globalForwardingRules.setTarget":
  54351. type GlobalForwardingRulesSetTargetCall struct {
  54352. s *Service
  54353. project string
  54354. forwardingRule string
  54355. targetreference *TargetReference
  54356. urlParams_ gensupport.URLParams
  54357. ctx_ context.Context
  54358. header_ http.Header
  54359. }
  54360. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  54361. // The new target should be of the same type as the old target.
  54362. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  54363. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  54364. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54365. c.project = project
  54366. c.forwardingRule = forwardingRule
  54367. c.targetreference = targetreference
  54368. return c
  54369. }
  54370. // RequestId sets the optional parameter "requestId": An optional
  54371. // request ID to identify requests. Specify a unique request ID so that
  54372. // if you must retry your request, the server will know to ignore the
  54373. // request if it has already been completed.
  54374. //
  54375. // For example, consider a situation where you make an initial request
  54376. // and the request times out. If you make the request again with the
  54377. // same request ID, the server can check if original operation with the
  54378. // same request ID was received, and if so, will ignore the second
  54379. // request. This prevents clients from accidentally creating duplicate
  54380. // commitments.
  54381. //
  54382. // The request ID must be a valid UUID with the exception that zero UUID
  54383. // is not supported (00000000-0000-0000-0000-000000000000).
  54384. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  54385. c.urlParams_.Set("requestId", requestId)
  54386. return c
  54387. }
  54388. // Fields allows partial responses to be retrieved. See
  54389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54390. // for more information.
  54391. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  54392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54393. return c
  54394. }
  54395. // Context sets the context to be used in this call's Do method. Any
  54396. // pending HTTP request will be aborted if the provided context is
  54397. // canceled.
  54398. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  54399. c.ctx_ = ctx
  54400. return c
  54401. }
  54402. // Header returns an http.Header that can be modified by the caller to
  54403. // add HTTP headers to the request.
  54404. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  54405. if c.header_ == nil {
  54406. c.header_ = make(http.Header)
  54407. }
  54408. return c.header_
  54409. }
  54410. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  54411. reqHeaders := make(http.Header)
  54412. for k, v := range c.header_ {
  54413. reqHeaders[k] = v
  54414. }
  54415. reqHeaders.Set("User-Agent", c.s.userAgent())
  54416. var body io.Reader = nil
  54417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  54418. if err != nil {
  54419. return nil, err
  54420. }
  54421. reqHeaders.Set("Content-Type", "application/json")
  54422. c.urlParams_.Set("alt", alt)
  54423. c.urlParams_.Set("prettyPrint", "false")
  54424. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  54425. urls += "?" + c.urlParams_.Encode()
  54426. req, err := http.NewRequest("POST", urls, body)
  54427. if err != nil {
  54428. return nil, err
  54429. }
  54430. req.Header = reqHeaders
  54431. googleapi.Expand(req.URL, map[string]string{
  54432. "project": c.project,
  54433. "forwardingRule": c.forwardingRule,
  54434. })
  54435. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54436. }
  54437. // Do executes the "compute.globalForwardingRules.setTarget" call.
  54438. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54439. // status code is an error. Response headers are in either
  54440. // *Operation.ServerResponse.Header or (if a response was returned at
  54441. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54442. // to check whether the returned error was because
  54443. // http.StatusNotModified was returned.
  54444. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54445. gensupport.SetOptions(c.urlParams_, opts...)
  54446. res, err := c.doRequest("json")
  54447. if res != nil && res.StatusCode == http.StatusNotModified {
  54448. if res.Body != nil {
  54449. res.Body.Close()
  54450. }
  54451. return nil, &googleapi.Error{
  54452. Code: res.StatusCode,
  54453. Header: res.Header,
  54454. }
  54455. }
  54456. if err != nil {
  54457. return nil, err
  54458. }
  54459. defer googleapi.CloseBody(res)
  54460. if err := googleapi.CheckResponse(res); err != nil {
  54461. return nil, err
  54462. }
  54463. ret := &Operation{
  54464. ServerResponse: googleapi.ServerResponse{
  54465. Header: res.Header,
  54466. HTTPStatusCode: res.StatusCode,
  54467. },
  54468. }
  54469. target := &ret
  54470. if err := gensupport.DecodeResponse(target, res); err != nil {
  54471. return nil, err
  54472. }
  54473. return ret, nil
  54474. // {
  54475. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  54476. // "httpMethod": "POST",
  54477. // "id": "compute.globalForwardingRules.setTarget",
  54478. // "parameterOrder": [
  54479. // "project",
  54480. // "forwardingRule"
  54481. // ],
  54482. // "parameters": {
  54483. // "forwardingRule": {
  54484. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  54485. // "location": "path",
  54486. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54487. // "required": true,
  54488. // "type": "string"
  54489. // },
  54490. // "project": {
  54491. // "description": "Project ID for this request.",
  54492. // "location": "path",
  54493. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54494. // "required": true,
  54495. // "type": "string"
  54496. // },
  54497. // "requestId": {
  54498. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54499. // "location": "query",
  54500. // "type": "string"
  54501. // }
  54502. // },
  54503. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  54504. // "request": {
  54505. // "$ref": "TargetReference"
  54506. // },
  54507. // "response": {
  54508. // "$ref": "Operation"
  54509. // },
  54510. // "scopes": [
  54511. // "https://www.googleapis.com/auth/cloud-platform",
  54512. // "https://www.googleapis.com/auth/compute"
  54513. // ]
  54514. // }
  54515. }
  54516. // method id "compute.globalForwardingRules.testIamPermissions":
  54517. type GlobalForwardingRulesTestIamPermissionsCall struct {
  54518. s *Service
  54519. project string
  54520. resource string
  54521. testpermissionsrequest *TestPermissionsRequest
  54522. urlParams_ gensupport.URLParams
  54523. ctx_ context.Context
  54524. header_ http.Header
  54525. }
  54526. // TestIamPermissions: Returns permissions that a caller has on the
  54527. // specified resource.
  54528. func (r *GlobalForwardingRulesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalForwardingRulesTestIamPermissionsCall {
  54529. c := &GlobalForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54530. c.project = project
  54531. c.resource = resource
  54532. c.testpermissionsrequest = testpermissionsrequest
  54533. return c
  54534. }
  54535. // Fields allows partial responses to be retrieved. See
  54536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54537. // for more information.
  54538. func (c *GlobalForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesTestIamPermissionsCall {
  54539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54540. return c
  54541. }
  54542. // Context sets the context to be used in this call's Do method. Any
  54543. // pending HTTP request will be aborted if the provided context is
  54544. // canceled.
  54545. func (c *GlobalForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *GlobalForwardingRulesTestIamPermissionsCall {
  54546. c.ctx_ = ctx
  54547. return c
  54548. }
  54549. // Header returns an http.Header that can be modified by the caller to
  54550. // add HTTP headers to the request.
  54551. func (c *GlobalForwardingRulesTestIamPermissionsCall) Header() http.Header {
  54552. if c.header_ == nil {
  54553. c.header_ = make(http.Header)
  54554. }
  54555. return c.header_
  54556. }
  54557. func (c *GlobalForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  54558. reqHeaders := make(http.Header)
  54559. for k, v := range c.header_ {
  54560. reqHeaders[k] = v
  54561. }
  54562. reqHeaders.Set("User-Agent", c.s.userAgent())
  54563. var body io.Reader = nil
  54564. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  54565. if err != nil {
  54566. return nil, err
  54567. }
  54568. reqHeaders.Set("Content-Type", "application/json")
  54569. c.urlParams_.Set("alt", alt)
  54570. c.urlParams_.Set("prettyPrint", "false")
  54571. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/testIamPermissions")
  54572. urls += "?" + c.urlParams_.Encode()
  54573. req, err := http.NewRequest("POST", urls, body)
  54574. if err != nil {
  54575. return nil, err
  54576. }
  54577. req.Header = reqHeaders
  54578. googleapi.Expand(req.URL, map[string]string{
  54579. "project": c.project,
  54580. "resource": c.resource,
  54581. })
  54582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54583. }
  54584. // Do executes the "compute.globalForwardingRules.testIamPermissions" call.
  54585. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  54586. // non-2xx status code is an error. Response headers are in either
  54587. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  54588. // returned at all) in error.(*googleapi.Error).Header. Use
  54589. // googleapi.IsNotModified to check whether the returned error was
  54590. // because http.StatusNotModified was returned.
  54591. func (c *GlobalForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  54592. gensupport.SetOptions(c.urlParams_, opts...)
  54593. res, err := c.doRequest("json")
  54594. if res != nil && res.StatusCode == http.StatusNotModified {
  54595. if res.Body != nil {
  54596. res.Body.Close()
  54597. }
  54598. return nil, &googleapi.Error{
  54599. Code: res.StatusCode,
  54600. Header: res.Header,
  54601. }
  54602. }
  54603. if err != nil {
  54604. return nil, err
  54605. }
  54606. defer googleapi.CloseBody(res)
  54607. if err := googleapi.CheckResponse(res); err != nil {
  54608. return nil, err
  54609. }
  54610. ret := &TestPermissionsResponse{
  54611. ServerResponse: googleapi.ServerResponse{
  54612. Header: res.Header,
  54613. HTTPStatusCode: res.StatusCode,
  54614. },
  54615. }
  54616. target := &ret
  54617. if err := gensupport.DecodeResponse(target, res); err != nil {
  54618. return nil, err
  54619. }
  54620. return ret, nil
  54621. // {
  54622. // "description": "Returns permissions that a caller has on the specified resource.",
  54623. // "httpMethod": "POST",
  54624. // "id": "compute.globalForwardingRules.testIamPermissions",
  54625. // "parameterOrder": [
  54626. // "project",
  54627. // "resource"
  54628. // ],
  54629. // "parameters": {
  54630. // "project": {
  54631. // "description": "Project ID for this request.",
  54632. // "location": "path",
  54633. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54634. // "required": true,
  54635. // "type": "string"
  54636. // },
  54637. // "resource": {
  54638. // "description": "Name or id of the resource for this request.",
  54639. // "location": "path",
  54640. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54641. // "required": true,
  54642. // "type": "string"
  54643. // }
  54644. // },
  54645. // "path": "{project}/global/forwardingRules/{resource}/testIamPermissions",
  54646. // "request": {
  54647. // "$ref": "TestPermissionsRequest"
  54648. // },
  54649. // "response": {
  54650. // "$ref": "TestPermissionsResponse"
  54651. // },
  54652. // "scopes": [
  54653. // "https://www.googleapis.com/auth/cloud-platform",
  54654. // "https://www.googleapis.com/auth/compute",
  54655. // "https://www.googleapis.com/auth/compute.readonly"
  54656. // ]
  54657. // }
  54658. }
  54659. // method id "compute.globalNetworkEndpointGroups.attachNetworkEndpoints":
  54660. type GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall struct {
  54661. s *Service
  54662. project string
  54663. networkEndpointGroup string
  54664. globalnetworkendpointgroupsattachendpointsrequest *GlobalNetworkEndpointGroupsAttachEndpointsRequest
  54665. urlParams_ gensupport.URLParams
  54666. ctx_ context.Context
  54667. header_ http.Header
  54668. }
  54669. // AttachNetworkEndpoints: Attach a network endpoint to the specified
  54670. // network endpoint group.
  54671. func (r *GlobalNetworkEndpointGroupsService) AttachNetworkEndpoints(project string, networkEndpointGroup string, globalnetworkendpointgroupsattachendpointsrequest *GlobalNetworkEndpointGroupsAttachEndpointsRequest) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
  54672. c := &GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54673. c.project = project
  54674. c.networkEndpointGroup = networkEndpointGroup
  54675. c.globalnetworkendpointgroupsattachendpointsrequest = globalnetworkendpointgroupsattachendpointsrequest
  54676. return c
  54677. }
  54678. // RequestId sets the optional parameter "requestId": An optional
  54679. // request ID to identify requests. Specify a unique request ID so that
  54680. // if you must retry your request, the server will know to ignore the
  54681. // request if it has already been completed.
  54682. //
  54683. // For example, consider a situation where you make an initial request
  54684. // and the request times out. If you make the request again with the
  54685. // same request ID, the server can check if original operation with the
  54686. // same request ID was received, and if so, will ignore the second
  54687. // request. This prevents clients from accidentally creating duplicate
  54688. // commitments.
  54689. //
  54690. // The request ID must be a valid UUID with the exception that zero UUID
  54691. // is not supported (00000000-0000-0000-0000-000000000000).
  54692. func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
  54693. c.urlParams_.Set("requestId", requestId)
  54694. return c
  54695. }
  54696. // Fields allows partial responses to be retrieved. See
  54697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54698. // for more information.
  54699. func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
  54700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54701. return c
  54702. }
  54703. // Context sets the context to be used in this call's Do method. Any
  54704. // pending HTTP request will be aborted if the provided context is
  54705. // canceled.
  54706. func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
  54707. c.ctx_ = ctx
  54708. return c
  54709. }
  54710. // Header returns an http.Header that can be modified by the caller to
  54711. // add HTTP headers to the request.
  54712. func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
  54713. if c.header_ == nil {
  54714. c.header_ = make(http.Header)
  54715. }
  54716. return c.header_
  54717. }
  54718. func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  54719. reqHeaders := make(http.Header)
  54720. for k, v := range c.header_ {
  54721. reqHeaders[k] = v
  54722. }
  54723. reqHeaders.Set("User-Agent", c.s.userAgent())
  54724. var body io.Reader = nil
  54725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsattachendpointsrequest)
  54726. if err != nil {
  54727. return nil, err
  54728. }
  54729. reqHeaders.Set("Content-Type", "application/json")
  54730. c.urlParams_.Set("alt", alt)
  54731. c.urlParams_.Set("prettyPrint", "false")
  54732. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
  54733. urls += "?" + c.urlParams_.Encode()
  54734. req, err := http.NewRequest("POST", urls, body)
  54735. if err != nil {
  54736. return nil, err
  54737. }
  54738. req.Header = reqHeaders
  54739. googleapi.Expand(req.URL, map[string]string{
  54740. "project": c.project,
  54741. "networkEndpointGroup": c.networkEndpointGroup,
  54742. })
  54743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54744. }
  54745. // Do executes the "compute.globalNetworkEndpointGroups.attachNetworkEndpoints" call.
  54746. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54747. // status code is an error. Response headers are in either
  54748. // *Operation.ServerResponse.Header or (if a response was returned at
  54749. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54750. // to check whether the returned error was because
  54751. // http.StatusNotModified was returned.
  54752. func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54753. gensupport.SetOptions(c.urlParams_, opts...)
  54754. res, err := c.doRequest("json")
  54755. if res != nil && res.StatusCode == http.StatusNotModified {
  54756. if res.Body != nil {
  54757. res.Body.Close()
  54758. }
  54759. return nil, &googleapi.Error{
  54760. Code: res.StatusCode,
  54761. Header: res.Header,
  54762. }
  54763. }
  54764. if err != nil {
  54765. return nil, err
  54766. }
  54767. defer googleapi.CloseBody(res)
  54768. if err := googleapi.CheckResponse(res); err != nil {
  54769. return nil, err
  54770. }
  54771. ret := &Operation{
  54772. ServerResponse: googleapi.ServerResponse{
  54773. Header: res.Header,
  54774. HTTPStatusCode: res.StatusCode,
  54775. },
  54776. }
  54777. target := &ret
  54778. if err := gensupport.DecodeResponse(target, res); err != nil {
  54779. return nil, err
  54780. }
  54781. return ret, nil
  54782. // {
  54783. // "description": "Attach a network endpoint to the specified network endpoint group.",
  54784. // "httpMethod": "POST",
  54785. // "id": "compute.globalNetworkEndpointGroups.attachNetworkEndpoints",
  54786. // "parameterOrder": [
  54787. // "project",
  54788. // "networkEndpointGroup"
  54789. // ],
  54790. // "parameters": {
  54791. // "networkEndpointGroup": {
  54792. // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
  54793. // "location": "path",
  54794. // "required": true,
  54795. // "type": "string"
  54796. // },
  54797. // "project": {
  54798. // "description": "Project ID for this request.",
  54799. // "location": "path",
  54800. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54801. // "required": true,
  54802. // "type": "string"
  54803. // },
  54804. // "requestId": {
  54805. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54806. // "location": "query",
  54807. // "type": "string"
  54808. // }
  54809. // },
  54810. // "path": "{project}/global/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
  54811. // "request": {
  54812. // "$ref": "GlobalNetworkEndpointGroupsAttachEndpointsRequest"
  54813. // },
  54814. // "response": {
  54815. // "$ref": "Operation"
  54816. // },
  54817. // "scopes": [
  54818. // "https://www.googleapis.com/auth/cloud-platform",
  54819. // "https://www.googleapis.com/auth/compute"
  54820. // ]
  54821. // }
  54822. }
  54823. // method id "compute.globalNetworkEndpointGroups.delete":
  54824. type GlobalNetworkEndpointGroupsDeleteCall struct {
  54825. s *Service
  54826. project string
  54827. networkEndpointGroup string
  54828. urlParams_ gensupport.URLParams
  54829. ctx_ context.Context
  54830. header_ http.Header
  54831. }
  54832. // Delete: Deletes the specified network endpoint group.Note that the
  54833. // NEG cannot be deleted if there are backend services referencing it.
  54834. func (r *GlobalNetworkEndpointGroupsService) Delete(project string, networkEndpointGroup string) *GlobalNetworkEndpointGroupsDeleteCall {
  54835. c := &GlobalNetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54836. c.project = project
  54837. c.networkEndpointGroup = networkEndpointGroup
  54838. return c
  54839. }
  54840. // RequestId sets the optional parameter "requestId": An optional
  54841. // request ID to identify requests. Specify a unique request ID so that
  54842. // if you must retry your request, the server will know to ignore the
  54843. // request if it has already been completed.
  54844. //
  54845. // For example, consider a situation where you make an initial request
  54846. // and the request times out. If you make the request again with the
  54847. // same request ID, the server can check if original operation with the
  54848. // same request ID was received, and if so, will ignore the second
  54849. // request. This prevents clients from accidentally creating duplicate
  54850. // commitments.
  54851. //
  54852. // The request ID must be a valid UUID with the exception that zero UUID
  54853. // is not supported (00000000-0000-0000-0000-000000000000).
  54854. func (c *GlobalNetworkEndpointGroupsDeleteCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsDeleteCall {
  54855. c.urlParams_.Set("requestId", requestId)
  54856. return c
  54857. }
  54858. // Fields allows partial responses to be retrieved. See
  54859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54860. // for more information.
  54861. func (c *GlobalNetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsDeleteCall {
  54862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54863. return c
  54864. }
  54865. // Context sets the context to be used in this call's Do method. Any
  54866. // pending HTTP request will be aborted if the provided context is
  54867. // canceled.
  54868. func (c *GlobalNetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsDeleteCall {
  54869. c.ctx_ = ctx
  54870. return c
  54871. }
  54872. // Header returns an http.Header that can be modified by the caller to
  54873. // add HTTP headers to the request.
  54874. func (c *GlobalNetworkEndpointGroupsDeleteCall) Header() http.Header {
  54875. if c.header_ == nil {
  54876. c.header_ = make(http.Header)
  54877. }
  54878. return c.header_
  54879. }
  54880. func (c *GlobalNetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  54881. reqHeaders := make(http.Header)
  54882. for k, v := range c.header_ {
  54883. reqHeaders[k] = v
  54884. }
  54885. reqHeaders.Set("User-Agent", c.s.userAgent())
  54886. var body io.Reader = nil
  54887. c.urlParams_.Set("alt", alt)
  54888. c.urlParams_.Set("prettyPrint", "false")
  54889. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networkEndpointGroups/{networkEndpointGroup}")
  54890. urls += "?" + c.urlParams_.Encode()
  54891. req, err := http.NewRequest("DELETE", urls, body)
  54892. if err != nil {
  54893. return nil, err
  54894. }
  54895. req.Header = reqHeaders
  54896. googleapi.Expand(req.URL, map[string]string{
  54897. "project": c.project,
  54898. "networkEndpointGroup": c.networkEndpointGroup,
  54899. })
  54900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54901. }
  54902. // Do executes the "compute.globalNetworkEndpointGroups.delete" call.
  54903. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54904. // status code is an error. Response headers are in either
  54905. // *Operation.ServerResponse.Header or (if a response was returned at
  54906. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54907. // to check whether the returned error was because
  54908. // http.StatusNotModified was returned.
  54909. func (c *GlobalNetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54910. gensupport.SetOptions(c.urlParams_, opts...)
  54911. res, err := c.doRequest("json")
  54912. if res != nil && res.StatusCode == http.StatusNotModified {
  54913. if res.Body != nil {
  54914. res.Body.Close()
  54915. }
  54916. return nil, &googleapi.Error{
  54917. Code: res.StatusCode,
  54918. Header: res.Header,
  54919. }
  54920. }
  54921. if err != nil {
  54922. return nil, err
  54923. }
  54924. defer googleapi.CloseBody(res)
  54925. if err := googleapi.CheckResponse(res); err != nil {
  54926. return nil, err
  54927. }
  54928. ret := &Operation{
  54929. ServerResponse: googleapi.ServerResponse{
  54930. Header: res.Header,
  54931. HTTPStatusCode: res.StatusCode,
  54932. },
  54933. }
  54934. target := &ret
  54935. if err := gensupport.DecodeResponse(target, res); err != nil {
  54936. return nil, err
  54937. }
  54938. return ret, nil
  54939. // {
  54940. // "description": "Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it.",
  54941. // "httpMethod": "DELETE",
  54942. // "id": "compute.globalNetworkEndpointGroups.delete",
  54943. // "parameterOrder": [
  54944. // "project",
  54945. // "networkEndpointGroup"
  54946. // ],
  54947. // "parameters": {
  54948. // "networkEndpointGroup": {
  54949. // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
  54950. // "location": "path",
  54951. // "required": true,
  54952. // "type": "string"
  54953. // },
  54954. // "project": {
  54955. // "description": "Project ID for this request.",
  54956. // "location": "path",
  54957. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54958. // "required": true,
  54959. // "type": "string"
  54960. // },
  54961. // "requestId": {
  54962. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54963. // "location": "query",
  54964. // "type": "string"
  54965. // }
  54966. // },
  54967. // "path": "{project}/global/networkEndpointGroups/{networkEndpointGroup}",
  54968. // "response": {
  54969. // "$ref": "Operation"
  54970. // },
  54971. // "scopes": [
  54972. // "https://www.googleapis.com/auth/cloud-platform",
  54973. // "https://www.googleapis.com/auth/compute"
  54974. // ]
  54975. // }
  54976. }
  54977. // method id "compute.globalNetworkEndpointGroups.detachNetworkEndpoints":
  54978. type GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall struct {
  54979. s *Service
  54980. project string
  54981. networkEndpointGroup string
  54982. globalnetworkendpointgroupsdetachendpointsrequest *GlobalNetworkEndpointGroupsDetachEndpointsRequest
  54983. urlParams_ gensupport.URLParams
  54984. ctx_ context.Context
  54985. header_ http.Header
  54986. }
  54987. // DetachNetworkEndpoints: Detach the network endpoint from the
  54988. // specified network endpoint group.
  54989. func (r *GlobalNetworkEndpointGroupsService) DetachNetworkEndpoints(project string, networkEndpointGroup string, globalnetworkendpointgroupsdetachendpointsrequest *GlobalNetworkEndpointGroupsDetachEndpointsRequest) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
  54990. c := &GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54991. c.project = project
  54992. c.networkEndpointGroup = networkEndpointGroup
  54993. c.globalnetworkendpointgroupsdetachendpointsrequest = globalnetworkendpointgroupsdetachendpointsrequest
  54994. return c
  54995. }
  54996. // RequestId sets the optional parameter "requestId": An optional
  54997. // request ID to identify requests. Specify a unique request ID so that
  54998. // if you must retry your request, the server will know to ignore the
  54999. // request if it has already been completed.
  55000. //
  55001. // For example, consider a situation where you make an initial request
  55002. // and the request times out. If you make the request again with the
  55003. // same request ID, the server can check if original operation with the
  55004. // same request ID was received, and if so, will ignore the second
  55005. // request. This prevents clients from accidentally creating duplicate
  55006. // commitments.
  55007. //
  55008. // The request ID must be a valid UUID with the exception that zero UUID
  55009. // is not supported (00000000-0000-0000-0000-000000000000).
  55010. func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
  55011. c.urlParams_.Set("requestId", requestId)
  55012. return c
  55013. }
  55014. // Fields allows partial responses to be retrieved. See
  55015. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55016. // for more information.
  55017. func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
  55018. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55019. return c
  55020. }
  55021. // Context sets the context to be used in this call's Do method. Any
  55022. // pending HTTP request will be aborted if the provided context is
  55023. // canceled.
  55024. func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
  55025. c.ctx_ = ctx
  55026. return c
  55027. }
  55028. // Header returns an http.Header that can be modified by the caller to
  55029. // add HTTP headers to the request.
  55030. func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
  55031. if c.header_ == nil {
  55032. c.header_ = make(http.Header)
  55033. }
  55034. return c.header_
  55035. }
  55036. func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  55037. reqHeaders := make(http.Header)
  55038. for k, v := range c.header_ {
  55039. reqHeaders[k] = v
  55040. }
  55041. reqHeaders.Set("User-Agent", c.s.userAgent())
  55042. var body io.Reader = nil
  55043. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsdetachendpointsrequest)
  55044. if err != nil {
  55045. return nil, err
  55046. }
  55047. reqHeaders.Set("Content-Type", "application/json")
  55048. c.urlParams_.Set("alt", alt)
  55049. c.urlParams_.Set("prettyPrint", "false")
  55050. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
  55051. urls += "?" + c.urlParams_.Encode()
  55052. req, err := http.NewRequest("POST", urls, body)
  55053. if err != nil {
  55054. return nil, err
  55055. }
  55056. req.Header = reqHeaders
  55057. googleapi.Expand(req.URL, map[string]string{
  55058. "project": c.project,
  55059. "networkEndpointGroup": c.networkEndpointGroup,
  55060. })
  55061. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55062. }
  55063. // Do executes the "compute.globalNetworkEndpointGroups.detachNetworkEndpoints" call.
  55064. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55065. // status code is an error. Response headers are in either
  55066. // *Operation.ServerResponse.Header or (if a response was returned at
  55067. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55068. // to check whether the returned error was because
  55069. // http.StatusNotModified was returned.
  55070. func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55071. gensupport.SetOptions(c.urlParams_, opts...)
  55072. res, err := c.doRequest("json")
  55073. if res != nil && res.StatusCode == http.StatusNotModified {
  55074. if res.Body != nil {
  55075. res.Body.Close()
  55076. }
  55077. return nil, &googleapi.Error{
  55078. Code: res.StatusCode,
  55079. Header: res.Header,
  55080. }
  55081. }
  55082. if err != nil {
  55083. return nil, err
  55084. }
  55085. defer googleapi.CloseBody(res)
  55086. if err := googleapi.CheckResponse(res); err != nil {
  55087. return nil, err
  55088. }
  55089. ret := &Operation{
  55090. ServerResponse: googleapi.ServerResponse{
  55091. Header: res.Header,
  55092. HTTPStatusCode: res.StatusCode,
  55093. },
  55094. }
  55095. target := &ret
  55096. if err := gensupport.DecodeResponse(target, res); err != nil {
  55097. return nil, err
  55098. }
  55099. return ret, nil
  55100. // {
  55101. // "description": "Detach the network endpoint from the specified network endpoint group.",
  55102. // "httpMethod": "POST",
  55103. // "id": "compute.globalNetworkEndpointGroups.detachNetworkEndpoints",
  55104. // "parameterOrder": [
  55105. // "project",
  55106. // "networkEndpointGroup"
  55107. // ],
  55108. // "parameters": {
  55109. // "networkEndpointGroup": {
  55110. // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
  55111. // "location": "path",
  55112. // "required": true,
  55113. // "type": "string"
  55114. // },
  55115. // "project": {
  55116. // "description": "Project ID for this request.",
  55117. // "location": "path",
  55118. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55119. // "required": true,
  55120. // "type": "string"
  55121. // },
  55122. // "requestId": {
  55123. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55124. // "location": "query",
  55125. // "type": "string"
  55126. // }
  55127. // },
  55128. // "path": "{project}/global/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
  55129. // "request": {
  55130. // "$ref": "GlobalNetworkEndpointGroupsDetachEndpointsRequest"
  55131. // },
  55132. // "response": {
  55133. // "$ref": "Operation"
  55134. // },
  55135. // "scopes": [
  55136. // "https://www.googleapis.com/auth/cloud-platform",
  55137. // "https://www.googleapis.com/auth/compute"
  55138. // ]
  55139. // }
  55140. }
  55141. // method id "compute.globalNetworkEndpointGroups.get":
  55142. type GlobalNetworkEndpointGroupsGetCall struct {
  55143. s *Service
  55144. project string
  55145. networkEndpointGroup string
  55146. urlParams_ gensupport.URLParams
  55147. ifNoneMatch_ string
  55148. ctx_ context.Context
  55149. header_ http.Header
  55150. }
  55151. // Get: Returns the specified network endpoint group. Gets a list of
  55152. // available network endpoint groups by making a list() request.
  55153. func (r *GlobalNetworkEndpointGroupsService) Get(project string, networkEndpointGroup string) *GlobalNetworkEndpointGroupsGetCall {
  55154. c := &GlobalNetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55155. c.project = project
  55156. c.networkEndpointGroup = networkEndpointGroup
  55157. return c
  55158. }
  55159. // Fields allows partial responses to be retrieved. See
  55160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55161. // for more information.
  55162. func (c *GlobalNetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsGetCall {
  55163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55164. return c
  55165. }
  55166. // IfNoneMatch sets the optional parameter which makes the operation
  55167. // fail if the object's ETag matches the given value. This is useful for
  55168. // getting updates only after the object has changed since the last
  55169. // request. Use googleapi.IsNotModified to check whether the response
  55170. // error from Do is the result of In-None-Match.
  55171. func (c *GlobalNetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *GlobalNetworkEndpointGroupsGetCall {
  55172. c.ifNoneMatch_ = entityTag
  55173. return c
  55174. }
  55175. // Context sets the context to be used in this call's Do method. Any
  55176. // pending HTTP request will be aborted if the provided context is
  55177. // canceled.
  55178. func (c *GlobalNetworkEndpointGroupsGetCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsGetCall {
  55179. c.ctx_ = ctx
  55180. return c
  55181. }
  55182. // Header returns an http.Header that can be modified by the caller to
  55183. // add HTTP headers to the request.
  55184. func (c *GlobalNetworkEndpointGroupsGetCall) Header() http.Header {
  55185. if c.header_ == nil {
  55186. c.header_ = make(http.Header)
  55187. }
  55188. return c.header_
  55189. }
  55190. func (c *GlobalNetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  55191. reqHeaders := make(http.Header)
  55192. for k, v := range c.header_ {
  55193. reqHeaders[k] = v
  55194. }
  55195. reqHeaders.Set("User-Agent", c.s.userAgent())
  55196. if c.ifNoneMatch_ != "" {
  55197. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55198. }
  55199. var body io.Reader = nil
  55200. c.urlParams_.Set("alt", alt)
  55201. c.urlParams_.Set("prettyPrint", "false")
  55202. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networkEndpointGroups/{networkEndpointGroup}")
  55203. urls += "?" + c.urlParams_.Encode()
  55204. req, err := http.NewRequest("GET", urls, body)
  55205. if err != nil {
  55206. return nil, err
  55207. }
  55208. req.Header = reqHeaders
  55209. googleapi.Expand(req.URL, map[string]string{
  55210. "project": c.project,
  55211. "networkEndpointGroup": c.networkEndpointGroup,
  55212. })
  55213. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55214. }
  55215. // Do executes the "compute.globalNetworkEndpointGroups.get" call.
  55216. // Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
  55217. // non-2xx status code is an error. Response headers are in either
  55218. // *NetworkEndpointGroup.ServerResponse.Header or (if a response was
  55219. // returned at all) in error.(*googleapi.Error).Header. Use
  55220. // googleapi.IsNotModified to check whether the returned error was
  55221. // because http.StatusNotModified was returned.
  55222. func (c *GlobalNetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) {
  55223. gensupport.SetOptions(c.urlParams_, opts...)
  55224. res, err := c.doRequest("json")
  55225. if res != nil && res.StatusCode == http.StatusNotModified {
  55226. if res.Body != nil {
  55227. res.Body.Close()
  55228. }
  55229. return nil, &googleapi.Error{
  55230. Code: res.StatusCode,
  55231. Header: res.Header,
  55232. }
  55233. }
  55234. if err != nil {
  55235. return nil, err
  55236. }
  55237. defer googleapi.CloseBody(res)
  55238. if err := googleapi.CheckResponse(res); err != nil {
  55239. return nil, err
  55240. }
  55241. ret := &NetworkEndpointGroup{
  55242. ServerResponse: googleapi.ServerResponse{
  55243. Header: res.Header,
  55244. HTTPStatusCode: res.StatusCode,
  55245. },
  55246. }
  55247. target := &ret
  55248. if err := gensupport.DecodeResponse(target, res); err != nil {
  55249. return nil, err
  55250. }
  55251. return ret, nil
  55252. // {
  55253. // "description": "Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.",
  55254. // "httpMethod": "GET",
  55255. // "id": "compute.globalNetworkEndpointGroups.get",
  55256. // "parameterOrder": [
  55257. // "project",
  55258. // "networkEndpointGroup"
  55259. // ],
  55260. // "parameters": {
  55261. // "networkEndpointGroup": {
  55262. // "description": "The name of the network endpoint group. It should comply with RFC1035.",
  55263. // "location": "path",
  55264. // "required": true,
  55265. // "type": "string"
  55266. // },
  55267. // "project": {
  55268. // "description": "Project ID for this request.",
  55269. // "location": "path",
  55270. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55271. // "required": true,
  55272. // "type": "string"
  55273. // }
  55274. // },
  55275. // "path": "{project}/global/networkEndpointGroups/{networkEndpointGroup}",
  55276. // "response": {
  55277. // "$ref": "NetworkEndpointGroup"
  55278. // },
  55279. // "scopes": [
  55280. // "https://www.googleapis.com/auth/cloud-platform",
  55281. // "https://www.googleapis.com/auth/compute",
  55282. // "https://www.googleapis.com/auth/compute.readonly"
  55283. // ]
  55284. // }
  55285. }
  55286. // method id "compute.globalNetworkEndpointGroups.insert":
  55287. type GlobalNetworkEndpointGroupsInsertCall struct {
  55288. s *Service
  55289. project string
  55290. networkendpointgroup *NetworkEndpointGroup
  55291. urlParams_ gensupport.URLParams
  55292. ctx_ context.Context
  55293. header_ http.Header
  55294. }
  55295. // Insert: Creates a network endpoint group in the specified project
  55296. // using the parameters that are included in the request.
  55297. func (r *GlobalNetworkEndpointGroupsService) Insert(project string, networkendpointgroup *NetworkEndpointGroup) *GlobalNetworkEndpointGroupsInsertCall {
  55298. c := &GlobalNetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55299. c.project = project
  55300. c.networkendpointgroup = networkendpointgroup
  55301. return c
  55302. }
  55303. // RequestId sets the optional parameter "requestId": An optional
  55304. // request ID to identify requests. Specify a unique request ID so that
  55305. // if you must retry your request, the server will know to ignore the
  55306. // request if it has already been completed.
  55307. //
  55308. // For example, consider a situation where you make an initial request
  55309. // and the request times out. If you make the request again with the
  55310. // same request ID, the server can check if original operation with the
  55311. // same request ID was received, and if so, will ignore the second
  55312. // request. This prevents clients from accidentally creating duplicate
  55313. // commitments.
  55314. //
  55315. // The request ID must be a valid UUID with the exception that zero UUID
  55316. // is not supported (00000000-0000-0000-0000-000000000000).
  55317. func (c *GlobalNetworkEndpointGroupsInsertCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsInsertCall {
  55318. c.urlParams_.Set("requestId", requestId)
  55319. return c
  55320. }
  55321. // Fields allows partial responses to be retrieved. See
  55322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55323. // for more information.
  55324. func (c *GlobalNetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsInsertCall {
  55325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55326. return c
  55327. }
  55328. // Context sets the context to be used in this call's Do method. Any
  55329. // pending HTTP request will be aborted if the provided context is
  55330. // canceled.
  55331. func (c *GlobalNetworkEndpointGroupsInsertCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsInsertCall {
  55332. c.ctx_ = ctx
  55333. return c
  55334. }
  55335. // Header returns an http.Header that can be modified by the caller to
  55336. // add HTTP headers to the request.
  55337. func (c *GlobalNetworkEndpointGroupsInsertCall) Header() http.Header {
  55338. if c.header_ == nil {
  55339. c.header_ = make(http.Header)
  55340. }
  55341. return c.header_
  55342. }
  55343. func (c *GlobalNetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  55344. reqHeaders := make(http.Header)
  55345. for k, v := range c.header_ {
  55346. reqHeaders[k] = v
  55347. }
  55348. reqHeaders.Set("User-Agent", c.s.userAgent())
  55349. var body io.Reader = nil
  55350. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
  55351. if err != nil {
  55352. return nil, err
  55353. }
  55354. reqHeaders.Set("Content-Type", "application/json")
  55355. c.urlParams_.Set("alt", alt)
  55356. c.urlParams_.Set("prettyPrint", "false")
  55357. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networkEndpointGroups")
  55358. urls += "?" + c.urlParams_.Encode()
  55359. req, err := http.NewRequest("POST", urls, body)
  55360. if err != nil {
  55361. return nil, err
  55362. }
  55363. req.Header = reqHeaders
  55364. googleapi.Expand(req.URL, map[string]string{
  55365. "project": c.project,
  55366. })
  55367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55368. }
  55369. // Do executes the "compute.globalNetworkEndpointGroups.insert" call.
  55370. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55371. // status code is an error. Response headers are in either
  55372. // *Operation.ServerResponse.Header or (if a response was returned at
  55373. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55374. // to check whether the returned error was because
  55375. // http.StatusNotModified was returned.
  55376. func (c *GlobalNetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55377. gensupport.SetOptions(c.urlParams_, opts...)
  55378. res, err := c.doRequest("json")
  55379. if res != nil && res.StatusCode == http.StatusNotModified {
  55380. if res.Body != nil {
  55381. res.Body.Close()
  55382. }
  55383. return nil, &googleapi.Error{
  55384. Code: res.StatusCode,
  55385. Header: res.Header,
  55386. }
  55387. }
  55388. if err != nil {
  55389. return nil, err
  55390. }
  55391. defer googleapi.CloseBody(res)
  55392. if err := googleapi.CheckResponse(res); err != nil {
  55393. return nil, err
  55394. }
  55395. ret := &Operation{
  55396. ServerResponse: googleapi.ServerResponse{
  55397. Header: res.Header,
  55398. HTTPStatusCode: res.StatusCode,
  55399. },
  55400. }
  55401. target := &ret
  55402. if err := gensupport.DecodeResponse(target, res); err != nil {
  55403. return nil, err
  55404. }
  55405. return ret, nil
  55406. // {
  55407. // "description": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
  55408. // "httpMethod": "POST",
  55409. // "id": "compute.globalNetworkEndpointGroups.insert",
  55410. // "parameterOrder": [
  55411. // "project"
  55412. // ],
  55413. // "parameters": {
  55414. // "project": {
  55415. // "description": "Project ID for this request.",
  55416. // "location": "path",
  55417. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55418. // "required": true,
  55419. // "type": "string"
  55420. // },
  55421. // "requestId": {
  55422. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55423. // "location": "query",
  55424. // "type": "string"
  55425. // }
  55426. // },
  55427. // "path": "{project}/global/networkEndpointGroups",
  55428. // "request": {
  55429. // "$ref": "NetworkEndpointGroup"
  55430. // },
  55431. // "response": {
  55432. // "$ref": "Operation"
  55433. // },
  55434. // "scopes": [
  55435. // "https://www.googleapis.com/auth/cloud-platform",
  55436. // "https://www.googleapis.com/auth/compute"
  55437. // ]
  55438. // }
  55439. }
  55440. // method id "compute.globalNetworkEndpointGroups.list":
  55441. type GlobalNetworkEndpointGroupsListCall struct {
  55442. s *Service
  55443. project string
  55444. urlParams_ gensupport.URLParams
  55445. ifNoneMatch_ string
  55446. ctx_ context.Context
  55447. header_ http.Header
  55448. }
  55449. // List: Retrieves the list of network endpoint groups that are located
  55450. // in the specified project.
  55451. func (r *GlobalNetworkEndpointGroupsService) List(project string) *GlobalNetworkEndpointGroupsListCall {
  55452. c := &GlobalNetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55453. c.project = project
  55454. return c
  55455. }
  55456. // Filter sets the optional parameter "filter": A filter expression that
  55457. // filters resources listed in the response. The expression must specify
  55458. // the field name, a comparison operator, and the value that you want to
  55459. // use for filtering. The value must be a string, a number, or a
  55460. // boolean. The comparison operator must be either =, !=, >, or <.
  55461. //
  55462. // For example, if you are filtering Compute Engine instances, you can
  55463. // exclude instances named example-instance by specifying name !=
  55464. // example-instance.
  55465. //
  55466. // You can also filter nested fields. For example, you could specify
  55467. // scheduling.automaticRestart = false to include instances only if they
  55468. // are not scheduled for automatic restarts. You can use filtering on
  55469. // nested fields to filter based on resource labels.
  55470. //
  55471. // To filter on multiple expressions, provide each separate expression
  55472. // within parentheses. For example, (scheduling.automaticRestart = true)
  55473. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55474. // AND expression. However, you can include AND and OR expressions
  55475. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55476. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55477. // true).
  55478. func (c *GlobalNetworkEndpointGroupsListCall) Filter(filter string) *GlobalNetworkEndpointGroupsListCall {
  55479. c.urlParams_.Set("filter", filter)
  55480. return c
  55481. }
  55482. // MaxResults sets the optional parameter "maxResults": The maximum
  55483. // number of results per page that should be returned. If the number of
  55484. // available results is larger than maxResults, Compute Engine returns a
  55485. // nextPageToken that can be used to get the next page of results in
  55486. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55487. // (Default: 500)
  55488. func (c *GlobalNetworkEndpointGroupsListCall) MaxResults(maxResults int64) *GlobalNetworkEndpointGroupsListCall {
  55489. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55490. return c
  55491. }
  55492. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55493. // a certain order. By default, results are returned in alphanumerical
  55494. // order based on the resource name.
  55495. //
  55496. // You can also sort results in descending order based on the creation
  55497. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55498. // based on the creationTimestamp field in reverse chronological order
  55499. // (newest result first). Use this to sort resources like operations so
  55500. // that the newest operation is returned first.
  55501. //
  55502. // Currently, only sorting by name or creationTimestamp desc is
  55503. // supported.
  55504. func (c *GlobalNetworkEndpointGroupsListCall) OrderBy(orderBy string) *GlobalNetworkEndpointGroupsListCall {
  55505. c.urlParams_.Set("orderBy", orderBy)
  55506. return c
  55507. }
  55508. // PageToken sets the optional parameter "pageToken": Specifies a page
  55509. // token to use. Set pageToken to the nextPageToken returned by a
  55510. // previous list request to get the next page of results.
  55511. func (c *GlobalNetworkEndpointGroupsListCall) PageToken(pageToken string) *GlobalNetworkEndpointGroupsListCall {
  55512. c.urlParams_.Set("pageToken", pageToken)
  55513. return c
  55514. }
  55515. // Fields allows partial responses to be retrieved. See
  55516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55517. // for more information.
  55518. func (c *GlobalNetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsListCall {
  55519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55520. return c
  55521. }
  55522. // IfNoneMatch sets the optional parameter which makes the operation
  55523. // fail if the object's ETag matches the given value. This is useful for
  55524. // getting updates only after the object has changed since the last
  55525. // request. Use googleapi.IsNotModified to check whether the response
  55526. // error from Do is the result of In-None-Match.
  55527. func (c *GlobalNetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *GlobalNetworkEndpointGroupsListCall {
  55528. c.ifNoneMatch_ = entityTag
  55529. return c
  55530. }
  55531. // Context sets the context to be used in this call's Do method. Any
  55532. // pending HTTP request will be aborted if the provided context is
  55533. // canceled.
  55534. func (c *GlobalNetworkEndpointGroupsListCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsListCall {
  55535. c.ctx_ = ctx
  55536. return c
  55537. }
  55538. // Header returns an http.Header that can be modified by the caller to
  55539. // add HTTP headers to the request.
  55540. func (c *GlobalNetworkEndpointGroupsListCall) Header() http.Header {
  55541. if c.header_ == nil {
  55542. c.header_ = make(http.Header)
  55543. }
  55544. return c.header_
  55545. }
  55546. func (c *GlobalNetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
  55547. reqHeaders := make(http.Header)
  55548. for k, v := range c.header_ {
  55549. reqHeaders[k] = v
  55550. }
  55551. reqHeaders.Set("User-Agent", c.s.userAgent())
  55552. if c.ifNoneMatch_ != "" {
  55553. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55554. }
  55555. var body io.Reader = nil
  55556. c.urlParams_.Set("alt", alt)
  55557. c.urlParams_.Set("prettyPrint", "false")
  55558. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networkEndpointGroups")
  55559. urls += "?" + c.urlParams_.Encode()
  55560. req, err := http.NewRequest("GET", urls, body)
  55561. if err != nil {
  55562. return nil, err
  55563. }
  55564. req.Header = reqHeaders
  55565. googleapi.Expand(req.URL, map[string]string{
  55566. "project": c.project,
  55567. })
  55568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55569. }
  55570. // Do executes the "compute.globalNetworkEndpointGroups.list" call.
  55571. // Exactly one of *NetworkEndpointGroupList or error will be non-nil.
  55572. // Any non-2xx status code is an error. Response headers are in either
  55573. // *NetworkEndpointGroupList.ServerResponse.Header or (if a response was
  55574. // returned at all) in error.(*googleapi.Error).Header. Use
  55575. // googleapi.IsNotModified to check whether the returned error was
  55576. // because http.StatusNotModified was returned.
  55577. func (c *GlobalNetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) {
  55578. gensupport.SetOptions(c.urlParams_, opts...)
  55579. res, err := c.doRequest("json")
  55580. if res != nil && res.StatusCode == http.StatusNotModified {
  55581. if res.Body != nil {
  55582. res.Body.Close()
  55583. }
  55584. return nil, &googleapi.Error{
  55585. Code: res.StatusCode,
  55586. Header: res.Header,
  55587. }
  55588. }
  55589. if err != nil {
  55590. return nil, err
  55591. }
  55592. defer googleapi.CloseBody(res)
  55593. if err := googleapi.CheckResponse(res); err != nil {
  55594. return nil, err
  55595. }
  55596. ret := &NetworkEndpointGroupList{
  55597. ServerResponse: googleapi.ServerResponse{
  55598. Header: res.Header,
  55599. HTTPStatusCode: res.StatusCode,
  55600. },
  55601. }
  55602. target := &ret
  55603. if err := gensupport.DecodeResponse(target, res); err != nil {
  55604. return nil, err
  55605. }
  55606. return ret, nil
  55607. // {
  55608. // "description": "Retrieves the list of network endpoint groups that are located in the specified project.",
  55609. // "httpMethod": "GET",
  55610. // "id": "compute.globalNetworkEndpointGroups.list",
  55611. // "parameterOrder": [
  55612. // "project"
  55613. // ],
  55614. // "parameters": {
  55615. // "filter": {
  55616. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  55617. // "location": "query",
  55618. // "type": "string"
  55619. // },
  55620. // "maxResults": {
  55621. // "default": "500",
  55622. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  55623. // "format": "uint32",
  55624. // "location": "query",
  55625. // "minimum": "0",
  55626. // "type": "integer"
  55627. // },
  55628. // "orderBy": {
  55629. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  55630. // "location": "query",
  55631. // "type": "string"
  55632. // },
  55633. // "pageToken": {
  55634. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  55635. // "location": "query",
  55636. // "type": "string"
  55637. // },
  55638. // "project": {
  55639. // "description": "Project ID for this request.",
  55640. // "location": "path",
  55641. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55642. // "required": true,
  55643. // "type": "string"
  55644. // }
  55645. // },
  55646. // "path": "{project}/global/networkEndpointGroups",
  55647. // "response": {
  55648. // "$ref": "NetworkEndpointGroupList"
  55649. // },
  55650. // "scopes": [
  55651. // "https://www.googleapis.com/auth/cloud-platform",
  55652. // "https://www.googleapis.com/auth/compute",
  55653. // "https://www.googleapis.com/auth/compute.readonly"
  55654. // ]
  55655. // }
  55656. }
  55657. // Pages invokes f for each page of results.
  55658. // A non-nil error returned from f will halt the iteration.
  55659. // The provided context supersedes any context provided to the Context method.
  55660. func (c *GlobalNetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error {
  55661. c.ctx_ = ctx
  55662. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55663. for {
  55664. x, err := c.Do()
  55665. if err != nil {
  55666. return err
  55667. }
  55668. if err := f(x); err != nil {
  55669. return err
  55670. }
  55671. if x.NextPageToken == "" {
  55672. return nil
  55673. }
  55674. c.PageToken(x.NextPageToken)
  55675. }
  55676. }
  55677. // method id "compute.globalNetworkEndpointGroups.listNetworkEndpoints":
  55678. type GlobalNetworkEndpointGroupsListNetworkEndpointsCall struct {
  55679. s *Service
  55680. project string
  55681. networkEndpointGroup string
  55682. urlParams_ gensupport.URLParams
  55683. ctx_ context.Context
  55684. header_ http.Header
  55685. }
  55686. // ListNetworkEndpoints: Lists the network endpoints in the specified
  55687. // network endpoint group.
  55688. func (r *GlobalNetworkEndpointGroupsService) ListNetworkEndpoints(project string, networkEndpointGroup string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
  55689. c := &GlobalNetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55690. c.project = project
  55691. c.networkEndpointGroup = networkEndpointGroup
  55692. return c
  55693. }
  55694. // Filter sets the optional parameter "filter": A filter expression that
  55695. // filters resources listed in the response. The expression must specify
  55696. // the field name, a comparison operator, and the value that you want to
  55697. // use for filtering. The value must be a string, a number, or a
  55698. // boolean. The comparison operator must be either =, !=, >, or <.
  55699. //
  55700. // For example, if you are filtering Compute Engine instances, you can
  55701. // exclude instances named example-instance by specifying name !=
  55702. // example-instance.
  55703. //
  55704. // You can also filter nested fields. For example, you could specify
  55705. // scheduling.automaticRestart = false to include instances only if they
  55706. // are not scheduled for automatic restarts. You can use filtering on
  55707. // nested fields to filter based on resource labels.
  55708. //
  55709. // To filter on multiple expressions, provide each separate expression
  55710. // within parentheses. For example, (scheduling.automaticRestart = true)
  55711. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55712. // AND expression. However, you can include AND and OR expressions
  55713. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55714. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55715. // true).
  55716. func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
  55717. c.urlParams_.Set("filter", filter)
  55718. return c
  55719. }
  55720. // MaxResults sets the optional parameter "maxResults": The maximum
  55721. // number of results per page that should be returned. If the number of
  55722. // available results is larger than maxResults, Compute Engine returns a
  55723. // nextPageToken that can be used to get the next page of results in
  55724. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55725. // (Default: 500)
  55726. func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
  55727. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55728. return c
  55729. }
  55730. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55731. // a certain order. By default, results are returned in alphanumerical
  55732. // order based on the resource name.
  55733. //
  55734. // You can also sort results in descending order based on the creation
  55735. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55736. // based on the creationTimestamp field in reverse chronological order
  55737. // (newest result first). Use this to sort resources like operations so
  55738. // that the newest operation is returned first.
  55739. //
  55740. // Currently, only sorting by name or creationTimestamp desc is
  55741. // supported.
  55742. func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
  55743. c.urlParams_.Set("orderBy", orderBy)
  55744. return c
  55745. }
  55746. // PageToken sets the optional parameter "pageToken": Specifies a page
  55747. // token to use. Set pageToken to the nextPageToken returned by a
  55748. // previous list request to get the next page of results.
  55749. func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
  55750. c.urlParams_.Set("pageToken", pageToken)
  55751. return c
  55752. }
  55753. // Fields allows partial responses to be retrieved. See
  55754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55755. // for more information.
  55756. func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
  55757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55758. return c
  55759. }
  55760. // Context sets the context to be used in this call's Do method. Any
  55761. // pending HTTP request will be aborted if the provided context is
  55762. // canceled.
  55763. func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
  55764. c.ctx_ = ctx
  55765. return c
  55766. }
  55767. // Header returns an http.Header that can be modified by the caller to
  55768. // add HTTP headers to the request.
  55769. func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
  55770. if c.header_ == nil {
  55771. c.header_ = make(http.Header)
  55772. }
  55773. return c.header_
  55774. }
  55775. func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  55776. reqHeaders := make(http.Header)
  55777. for k, v := range c.header_ {
  55778. reqHeaders[k] = v
  55779. }
  55780. reqHeaders.Set("User-Agent", c.s.userAgent())
  55781. var body io.Reader = nil
  55782. c.urlParams_.Set("alt", alt)
  55783. c.urlParams_.Set("prettyPrint", "false")
  55784. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
  55785. urls += "?" + c.urlParams_.Encode()
  55786. req, err := http.NewRequest("POST", urls, body)
  55787. if err != nil {
  55788. return nil, err
  55789. }
  55790. req.Header = reqHeaders
  55791. googleapi.Expand(req.URL, map[string]string{
  55792. "project": c.project,
  55793. "networkEndpointGroup": c.networkEndpointGroup,
  55794. })
  55795. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55796. }
  55797. // Do executes the "compute.globalNetworkEndpointGroups.listNetworkEndpoints" call.
  55798. // Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
  55799. // will be non-nil. Any non-2xx status code is an error. Response
  55800. // headers are in either
  55801. // *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or
  55802. // (if a response was returned at all) in
  55803. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  55804. // whether the returned error was because http.StatusNotModified was
  55805. // returned.
  55806. func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) {
  55807. gensupport.SetOptions(c.urlParams_, opts...)
  55808. res, err := c.doRequest("json")
  55809. if res != nil && res.StatusCode == http.StatusNotModified {
  55810. if res.Body != nil {
  55811. res.Body.Close()
  55812. }
  55813. return nil, &googleapi.Error{
  55814. Code: res.StatusCode,
  55815. Header: res.Header,
  55816. }
  55817. }
  55818. if err != nil {
  55819. return nil, err
  55820. }
  55821. defer googleapi.CloseBody(res)
  55822. if err := googleapi.CheckResponse(res); err != nil {
  55823. return nil, err
  55824. }
  55825. ret := &NetworkEndpointGroupsListNetworkEndpoints{
  55826. ServerResponse: googleapi.ServerResponse{
  55827. Header: res.Header,
  55828. HTTPStatusCode: res.StatusCode,
  55829. },
  55830. }
  55831. target := &ret
  55832. if err := gensupport.DecodeResponse(target, res); err != nil {
  55833. return nil, err
  55834. }
  55835. return ret, nil
  55836. // {
  55837. // "description": "Lists the network endpoints in the specified network endpoint group.",
  55838. // "httpMethod": "POST",
  55839. // "id": "compute.globalNetworkEndpointGroups.listNetworkEndpoints",
  55840. // "parameterOrder": [
  55841. // "project",
  55842. // "networkEndpointGroup"
  55843. // ],
  55844. // "parameters": {
  55845. // "filter": {
  55846. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  55847. // "location": "query",
  55848. // "type": "string"
  55849. // },
  55850. // "maxResults": {
  55851. // "default": "500",
  55852. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  55853. // "format": "uint32",
  55854. // "location": "query",
  55855. // "minimum": "0",
  55856. // "type": "integer"
  55857. // },
  55858. // "networkEndpointGroup": {
  55859. // "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.",
  55860. // "location": "path",
  55861. // "required": true,
  55862. // "type": "string"
  55863. // },
  55864. // "orderBy": {
  55865. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  55866. // "location": "query",
  55867. // "type": "string"
  55868. // },
  55869. // "pageToken": {
  55870. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  55871. // "location": "query",
  55872. // "type": "string"
  55873. // },
  55874. // "project": {
  55875. // "description": "Project ID for this request.",
  55876. // "location": "path",
  55877. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55878. // "required": true,
  55879. // "type": "string"
  55880. // }
  55881. // },
  55882. // "path": "{project}/global/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
  55883. // "response": {
  55884. // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
  55885. // },
  55886. // "scopes": [
  55887. // "https://www.googleapis.com/auth/cloud-platform",
  55888. // "https://www.googleapis.com/auth/compute",
  55889. // "https://www.googleapis.com/auth/compute.readonly"
  55890. // ]
  55891. // }
  55892. }
  55893. // Pages invokes f for each page of results.
  55894. // A non-nil error returned from f will halt the iteration.
  55895. // The provided context supersedes any context provided to the Context method.
  55896. func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error {
  55897. c.ctx_ = ctx
  55898. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55899. for {
  55900. x, err := c.Do()
  55901. if err != nil {
  55902. return err
  55903. }
  55904. if err := f(x); err != nil {
  55905. return err
  55906. }
  55907. if x.NextPageToken == "" {
  55908. return nil
  55909. }
  55910. c.PageToken(x.NextPageToken)
  55911. }
  55912. }
  55913. // method id "compute.globalOperations.aggregatedList":
  55914. type GlobalOperationsAggregatedListCall struct {
  55915. s *Service
  55916. project string
  55917. urlParams_ gensupport.URLParams
  55918. ifNoneMatch_ string
  55919. ctx_ context.Context
  55920. header_ http.Header
  55921. }
  55922. // AggregatedList: Retrieves an aggregated list of all operations.
  55923. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  55924. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  55925. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55926. c.project = project
  55927. return c
  55928. }
  55929. // Filter sets the optional parameter "filter": A filter expression that
  55930. // filters resources listed in the response. The expression must specify
  55931. // the field name, a comparison operator, and the value that you want to
  55932. // use for filtering. The value must be a string, a number, or a
  55933. // boolean. The comparison operator must be either =, !=, >, or <.
  55934. //
  55935. // For example, if you are filtering Compute Engine instances, you can
  55936. // exclude instances named example-instance by specifying name !=
  55937. // example-instance.
  55938. //
  55939. // You can also filter nested fields. For example, you could specify
  55940. // scheduling.automaticRestart = false to include instances only if they
  55941. // are not scheduled for automatic restarts. You can use filtering on
  55942. // nested fields to filter based on resource labels.
  55943. //
  55944. // To filter on multiple expressions, provide each separate expression
  55945. // within parentheses. For example, (scheduling.automaticRestart = true)
  55946. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55947. // AND expression. However, you can include AND and OR expressions
  55948. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55949. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55950. // true).
  55951. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  55952. c.urlParams_.Set("filter", filter)
  55953. return c
  55954. }
  55955. // MaxResults sets the optional parameter "maxResults": The maximum
  55956. // number of results per page that should be returned. If the number of
  55957. // available results is larger than maxResults, Compute Engine returns a
  55958. // nextPageToken that can be used to get the next page of results in
  55959. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55960. // (Default: 500)
  55961. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  55962. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55963. return c
  55964. }
  55965. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55966. // a certain order. By default, results are returned in alphanumerical
  55967. // order based on the resource name.
  55968. //
  55969. // You can also sort results in descending order based on the creation
  55970. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55971. // based on the creationTimestamp field in reverse chronological order
  55972. // (newest result first). Use this to sort resources like operations so
  55973. // that the newest operation is returned first.
  55974. //
  55975. // Currently, only sorting by name or creationTimestamp desc is
  55976. // supported.
  55977. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  55978. c.urlParams_.Set("orderBy", orderBy)
  55979. return c
  55980. }
  55981. // PageToken sets the optional parameter "pageToken": Specifies a page
  55982. // token to use. Set pageToken to the nextPageToken returned by a
  55983. // previous list request to get the next page of results.
  55984. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  55985. c.urlParams_.Set("pageToken", pageToken)
  55986. return c
  55987. }
  55988. // Fields allows partial responses to be retrieved. See
  55989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55990. // for more information.
  55991. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  55992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55993. return c
  55994. }
  55995. // IfNoneMatch sets the optional parameter which makes the operation
  55996. // fail if the object's ETag matches the given value. This is useful for
  55997. // getting updates only after the object has changed since the last
  55998. // request. Use googleapi.IsNotModified to check whether the response
  55999. // error from Do is the result of In-None-Match.
  56000. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  56001. c.ifNoneMatch_ = entityTag
  56002. return c
  56003. }
  56004. // Context sets the context to be used in this call's Do method. Any
  56005. // pending HTTP request will be aborted if the provided context is
  56006. // canceled.
  56007. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  56008. c.ctx_ = ctx
  56009. return c
  56010. }
  56011. // Header returns an http.Header that can be modified by the caller to
  56012. // add HTTP headers to the request.
  56013. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  56014. if c.header_ == nil {
  56015. c.header_ = make(http.Header)
  56016. }
  56017. return c.header_
  56018. }
  56019. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  56020. reqHeaders := make(http.Header)
  56021. for k, v := range c.header_ {
  56022. reqHeaders[k] = v
  56023. }
  56024. reqHeaders.Set("User-Agent", c.s.userAgent())
  56025. if c.ifNoneMatch_ != "" {
  56026. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56027. }
  56028. var body io.Reader = nil
  56029. c.urlParams_.Set("alt", alt)
  56030. c.urlParams_.Set("prettyPrint", "false")
  56031. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  56032. urls += "?" + c.urlParams_.Encode()
  56033. req, err := http.NewRequest("GET", urls, body)
  56034. if err != nil {
  56035. return nil, err
  56036. }
  56037. req.Header = reqHeaders
  56038. googleapi.Expand(req.URL, map[string]string{
  56039. "project": c.project,
  56040. })
  56041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56042. }
  56043. // Do executes the "compute.globalOperations.aggregatedList" call.
  56044. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  56045. // non-2xx status code is an error. Response headers are in either
  56046. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  56047. // returned at all) in error.(*googleapi.Error).Header. Use
  56048. // googleapi.IsNotModified to check whether the returned error was
  56049. // because http.StatusNotModified was returned.
  56050. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  56051. gensupport.SetOptions(c.urlParams_, opts...)
  56052. res, err := c.doRequest("json")
  56053. if res != nil && res.StatusCode == http.StatusNotModified {
  56054. if res.Body != nil {
  56055. res.Body.Close()
  56056. }
  56057. return nil, &googleapi.Error{
  56058. Code: res.StatusCode,
  56059. Header: res.Header,
  56060. }
  56061. }
  56062. if err != nil {
  56063. return nil, err
  56064. }
  56065. defer googleapi.CloseBody(res)
  56066. if err := googleapi.CheckResponse(res); err != nil {
  56067. return nil, err
  56068. }
  56069. ret := &OperationAggregatedList{
  56070. ServerResponse: googleapi.ServerResponse{
  56071. Header: res.Header,
  56072. HTTPStatusCode: res.StatusCode,
  56073. },
  56074. }
  56075. target := &ret
  56076. if err := gensupport.DecodeResponse(target, res); err != nil {
  56077. return nil, err
  56078. }
  56079. return ret, nil
  56080. // {
  56081. // "description": "Retrieves an aggregated list of all operations.",
  56082. // "httpMethod": "GET",
  56083. // "id": "compute.globalOperations.aggregatedList",
  56084. // "parameterOrder": [
  56085. // "project"
  56086. // ],
  56087. // "parameters": {
  56088. // "filter": {
  56089. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  56090. // "location": "query",
  56091. // "type": "string"
  56092. // },
  56093. // "maxResults": {
  56094. // "default": "500",
  56095. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  56096. // "format": "uint32",
  56097. // "location": "query",
  56098. // "minimum": "0",
  56099. // "type": "integer"
  56100. // },
  56101. // "orderBy": {
  56102. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  56103. // "location": "query",
  56104. // "type": "string"
  56105. // },
  56106. // "pageToken": {
  56107. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  56108. // "location": "query",
  56109. // "type": "string"
  56110. // },
  56111. // "project": {
  56112. // "description": "Project ID for this request.",
  56113. // "location": "path",
  56114. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56115. // "required": true,
  56116. // "type": "string"
  56117. // }
  56118. // },
  56119. // "path": "{project}/aggregated/operations",
  56120. // "response": {
  56121. // "$ref": "OperationAggregatedList"
  56122. // },
  56123. // "scopes": [
  56124. // "https://www.googleapis.com/auth/cloud-platform",
  56125. // "https://www.googleapis.com/auth/compute",
  56126. // "https://www.googleapis.com/auth/compute.readonly"
  56127. // ]
  56128. // }
  56129. }
  56130. // Pages invokes f for each page of results.
  56131. // A non-nil error returned from f will halt the iteration.
  56132. // The provided context supersedes any context provided to the Context method.
  56133. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  56134. c.ctx_ = ctx
  56135. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56136. for {
  56137. x, err := c.Do()
  56138. if err != nil {
  56139. return err
  56140. }
  56141. if err := f(x); err != nil {
  56142. return err
  56143. }
  56144. if x.NextPageToken == "" {
  56145. return nil
  56146. }
  56147. c.PageToken(x.NextPageToken)
  56148. }
  56149. }
  56150. // method id "compute.globalOperations.delete":
  56151. type GlobalOperationsDeleteCall struct {
  56152. s *Service
  56153. project string
  56154. operation string
  56155. urlParams_ gensupport.URLParams
  56156. ctx_ context.Context
  56157. header_ http.Header
  56158. }
  56159. // Delete: Deletes the specified Operations resource.
  56160. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  56161. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  56162. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56163. c.project = project
  56164. c.operation = operation
  56165. return c
  56166. }
  56167. // Fields allows partial responses to be retrieved. See
  56168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56169. // for more information.
  56170. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  56171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56172. return c
  56173. }
  56174. // Context sets the context to be used in this call's Do method. Any
  56175. // pending HTTP request will be aborted if the provided context is
  56176. // canceled.
  56177. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  56178. c.ctx_ = ctx
  56179. return c
  56180. }
  56181. // Header returns an http.Header that can be modified by the caller to
  56182. // add HTTP headers to the request.
  56183. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  56184. if c.header_ == nil {
  56185. c.header_ = make(http.Header)
  56186. }
  56187. return c.header_
  56188. }
  56189. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  56190. reqHeaders := make(http.Header)
  56191. for k, v := range c.header_ {
  56192. reqHeaders[k] = v
  56193. }
  56194. reqHeaders.Set("User-Agent", c.s.userAgent())
  56195. var body io.Reader = nil
  56196. c.urlParams_.Set("alt", alt)
  56197. c.urlParams_.Set("prettyPrint", "false")
  56198. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  56199. urls += "?" + c.urlParams_.Encode()
  56200. req, err := http.NewRequest("DELETE", urls, body)
  56201. if err != nil {
  56202. return nil, err
  56203. }
  56204. req.Header = reqHeaders
  56205. googleapi.Expand(req.URL, map[string]string{
  56206. "project": c.project,
  56207. "operation": c.operation,
  56208. })
  56209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56210. }
  56211. // Do executes the "compute.globalOperations.delete" call.
  56212. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  56213. gensupport.SetOptions(c.urlParams_, opts...)
  56214. res, err := c.doRequest("json")
  56215. if err != nil {
  56216. return err
  56217. }
  56218. defer googleapi.CloseBody(res)
  56219. if err := googleapi.CheckResponse(res); err != nil {
  56220. return err
  56221. }
  56222. return nil
  56223. // {
  56224. // "description": "Deletes the specified Operations resource.",
  56225. // "httpMethod": "DELETE",
  56226. // "id": "compute.globalOperations.delete",
  56227. // "parameterOrder": [
  56228. // "project",
  56229. // "operation"
  56230. // ],
  56231. // "parameters": {
  56232. // "operation": {
  56233. // "description": "Name of the Operations resource to delete.",
  56234. // "location": "path",
  56235. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56236. // "required": true,
  56237. // "type": "string"
  56238. // },
  56239. // "project": {
  56240. // "description": "Project ID for this request.",
  56241. // "location": "path",
  56242. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56243. // "required": true,
  56244. // "type": "string"
  56245. // }
  56246. // },
  56247. // "path": "{project}/global/operations/{operation}",
  56248. // "scopes": [
  56249. // "https://www.googleapis.com/auth/cloud-platform",
  56250. // "https://www.googleapis.com/auth/compute"
  56251. // ]
  56252. // }
  56253. }
  56254. // method id "compute.globalOperations.get":
  56255. type GlobalOperationsGetCall struct {
  56256. s *Service
  56257. project string
  56258. operation string
  56259. urlParams_ gensupport.URLParams
  56260. ifNoneMatch_ string
  56261. ctx_ context.Context
  56262. header_ http.Header
  56263. }
  56264. // Get: Retrieves the specified Operations resource. Gets a list of
  56265. // operations by making a list() request.
  56266. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  56267. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  56268. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56269. c.project = project
  56270. c.operation = operation
  56271. return c
  56272. }
  56273. // Fields allows partial responses to be retrieved. See
  56274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56275. // for more information.
  56276. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  56277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56278. return c
  56279. }
  56280. // IfNoneMatch sets the optional parameter which makes the operation
  56281. // fail if the object's ETag matches the given value. This is useful for
  56282. // getting updates only after the object has changed since the last
  56283. // request. Use googleapi.IsNotModified to check whether the response
  56284. // error from Do is the result of In-None-Match.
  56285. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  56286. c.ifNoneMatch_ = entityTag
  56287. return c
  56288. }
  56289. // Context sets the context to be used in this call's Do method. Any
  56290. // pending HTTP request will be aborted if the provided context is
  56291. // canceled.
  56292. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  56293. c.ctx_ = ctx
  56294. return c
  56295. }
  56296. // Header returns an http.Header that can be modified by the caller to
  56297. // add HTTP headers to the request.
  56298. func (c *GlobalOperationsGetCall) Header() http.Header {
  56299. if c.header_ == nil {
  56300. c.header_ = make(http.Header)
  56301. }
  56302. return c.header_
  56303. }
  56304. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  56305. reqHeaders := make(http.Header)
  56306. for k, v := range c.header_ {
  56307. reqHeaders[k] = v
  56308. }
  56309. reqHeaders.Set("User-Agent", c.s.userAgent())
  56310. if c.ifNoneMatch_ != "" {
  56311. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56312. }
  56313. var body io.Reader = nil
  56314. c.urlParams_.Set("alt", alt)
  56315. c.urlParams_.Set("prettyPrint", "false")
  56316. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  56317. urls += "?" + c.urlParams_.Encode()
  56318. req, err := http.NewRequest("GET", urls, body)
  56319. if err != nil {
  56320. return nil, err
  56321. }
  56322. req.Header = reqHeaders
  56323. googleapi.Expand(req.URL, map[string]string{
  56324. "project": c.project,
  56325. "operation": c.operation,
  56326. })
  56327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56328. }
  56329. // Do executes the "compute.globalOperations.get" call.
  56330. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56331. // status code is an error. Response headers are in either
  56332. // *Operation.ServerResponse.Header or (if a response was returned at
  56333. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56334. // to check whether the returned error was because
  56335. // http.StatusNotModified was returned.
  56336. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56337. gensupport.SetOptions(c.urlParams_, opts...)
  56338. res, err := c.doRequest("json")
  56339. if res != nil && res.StatusCode == http.StatusNotModified {
  56340. if res.Body != nil {
  56341. res.Body.Close()
  56342. }
  56343. return nil, &googleapi.Error{
  56344. Code: res.StatusCode,
  56345. Header: res.Header,
  56346. }
  56347. }
  56348. if err != nil {
  56349. return nil, err
  56350. }
  56351. defer googleapi.CloseBody(res)
  56352. if err := googleapi.CheckResponse(res); err != nil {
  56353. return nil, err
  56354. }
  56355. ret := &Operation{
  56356. ServerResponse: googleapi.ServerResponse{
  56357. Header: res.Header,
  56358. HTTPStatusCode: res.StatusCode,
  56359. },
  56360. }
  56361. target := &ret
  56362. if err := gensupport.DecodeResponse(target, res); err != nil {
  56363. return nil, err
  56364. }
  56365. return ret, nil
  56366. // {
  56367. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  56368. // "httpMethod": "GET",
  56369. // "id": "compute.globalOperations.get",
  56370. // "parameterOrder": [
  56371. // "project",
  56372. // "operation"
  56373. // ],
  56374. // "parameters": {
  56375. // "operation": {
  56376. // "description": "Name of the Operations resource to return.",
  56377. // "location": "path",
  56378. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56379. // "required": true,
  56380. // "type": "string"
  56381. // },
  56382. // "project": {
  56383. // "description": "Project ID for this request.",
  56384. // "location": "path",
  56385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56386. // "required": true,
  56387. // "type": "string"
  56388. // }
  56389. // },
  56390. // "path": "{project}/global/operations/{operation}",
  56391. // "response": {
  56392. // "$ref": "Operation"
  56393. // },
  56394. // "scopes": [
  56395. // "https://www.googleapis.com/auth/cloud-platform",
  56396. // "https://www.googleapis.com/auth/compute",
  56397. // "https://www.googleapis.com/auth/compute.readonly"
  56398. // ]
  56399. // }
  56400. }
  56401. // method id "compute.globalOperations.list":
  56402. type GlobalOperationsListCall struct {
  56403. s *Service
  56404. project string
  56405. urlParams_ gensupport.URLParams
  56406. ifNoneMatch_ string
  56407. ctx_ context.Context
  56408. header_ http.Header
  56409. }
  56410. // List: Retrieves a list of Operation resources contained within the
  56411. // specified project.
  56412. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  56413. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  56414. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56415. c.project = project
  56416. return c
  56417. }
  56418. // Filter sets the optional parameter "filter": A filter expression that
  56419. // filters resources listed in the response. The expression must specify
  56420. // the field name, a comparison operator, and the value that you want to
  56421. // use for filtering. The value must be a string, a number, or a
  56422. // boolean. The comparison operator must be either =, !=, >, or <.
  56423. //
  56424. // For example, if you are filtering Compute Engine instances, you can
  56425. // exclude instances named example-instance by specifying name !=
  56426. // example-instance.
  56427. //
  56428. // You can also filter nested fields. For example, you could specify
  56429. // scheduling.automaticRestart = false to include instances only if they
  56430. // are not scheduled for automatic restarts. You can use filtering on
  56431. // nested fields to filter based on resource labels.
  56432. //
  56433. // To filter on multiple expressions, provide each separate expression
  56434. // within parentheses. For example, (scheduling.automaticRestart = true)
  56435. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56436. // AND expression. However, you can include AND and OR expressions
  56437. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56438. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56439. // true).
  56440. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  56441. c.urlParams_.Set("filter", filter)
  56442. return c
  56443. }
  56444. // MaxResults sets the optional parameter "maxResults": The maximum
  56445. // number of results per page that should be returned. If the number of
  56446. // available results is larger than maxResults, Compute Engine returns a
  56447. // nextPageToken that can be used to get the next page of results in
  56448. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56449. // (Default: 500)
  56450. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  56451. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56452. return c
  56453. }
  56454. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56455. // a certain order. By default, results are returned in alphanumerical
  56456. // order based on the resource name.
  56457. //
  56458. // You can also sort results in descending order based on the creation
  56459. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56460. // based on the creationTimestamp field in reverse chronological order
  56461. // (newest result first). Use this to sort resources like operations so
  56462. // that the newest operation is returned first.
  56463. //
  56464. // Currently, only sorting by name or creationTimestamp desc is
  56465. // supported.
  56466. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  56467. c.urlParams_.Set("orderBy", orderBy)
  56468. return c
  56469. }
  56470. // PageToken sets the optional parameter "pageToken": Specifies a page
  56471. // token to use. Set pageToken to the nextPageToken returned by a
  56472. // previous list request to get the next page of results.
  56473. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  56474. c.urlParams_.Set("pageToken", pageToken)
  56475. return c
  56476. }
  56477. // Fields allows partial responses to be retrieved. See
  56478. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56479. // for more information.
  56480. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  56481. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56482. return c
  56483. }
  56484. // IfNoneMatch sets the optional parameter which makes the operation
  56485. // fail if the object's ETag matches the given value. This is useful for
  56486. // getting updates only after the object has changed since the last
  56487. // request. Use googleapi.IsNotModified to check whether the response
  56488. // error from Do is the result of In-None-Match.
  56489. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  56490. c.ifNoneMatch_ = entityTag
  56491. return c
  56492. }
  56493. // Context sets the context to be used in this call's Do method. Any
  56494. // pending HTTP request will be aborted if the provided context is
  56495. // canceled.
  56496. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  56497. c.ctx_ = ctx
  56498. return c
  56499. }
  56500. // Header returns an http.Header that can be modified by the caller to
  56501. // add HTTP headers to the request.
  56502. func (c *GlobalOperationsListCall) Header() http.Header {
  56503. if c.header_ == nil {
  56504. c.header_ = make(http.Header)
  56505. }
  56506. return c.header_
  56507. }
  56508. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  56509. reqHeaders := make(http.Header)
  56510. for k, v := range c.header_ {
  56511. reqHeaders[k] = v
  56512. }
  56513. reqHeaders.Set("User-Agent", c.s.userAgent())
  56514. if c.ifNoneMatch_ != "" {
  56515. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56516. }
  56517. var body io.Reader = nil
  56518. c.urlParams_.Set("alt", alt)
  56519. c.urlParams_.Set("prettyPrint", "false")
  56520. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  56521. urls += "?" + c.urlParams_.Encode()
  56522. req, err := http.NewRequest("GET", urls, body)
  56523. if err != nil {
  56524. return nil, err
  56525. }
  56526. req.Header = reqHeaders
  56527. googleapi.Expand(req.URL, map[string]string{
  56528. "project": c.project,
  56529. })
  56530. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56531. }
  56532. // Do executes the "compute.globalOperations.list" call.
  56533. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  56534. // status code is an error. Response headers are in either
  56535. // *OperationList.ServerResponse.Header or (if a response was returned
  56536. // at all) in error.(*googleapi.Error).Header. Use
  56537. // googleapi.IsNotModified to check whether the returned error was
  56538. // because http.StatusNotModified was returned.
  56539. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  56540. gensupport.SetOptions(c.urlParams_, opts...)
  56541. res, err := c.doRequest("json")
  56542. if res != nil && res.StatusCode == http.StatusNotModified {
  56543. if res.Body != nil {
  56544. res.Body.Close()
  56545. }
  56546. return nil, &googleapi.Error{
  56547. Code: res.StatusCode,
  56548. Header: res.Header,
  56549. }
  56550. }
  56551. if err != nil {
  56552. return nil, err
  56553. }
  56554. defer googleapi.CloseBody(res)
  56555. if err := googleapi.CheckResponse(res); err != nil {
  56556. return nil, err
  56557. }
  56558. ret := &OperationList{
  56559. ServerResponse: googleapi.ServerResponse{
  56560. Header: res.Header,
  56561. HTTPStatusCode: res.StatusCode,
  56562. },
  56563. }
  56564. target := &ret
  56565. if err := gensupport.DecodeResponse(target, res); err != nil {
  56566. return nil, err
  56567. }
  56568. return ret, nil
  56569. // {
  56570. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  56571. // "httpMethod": "GET",
  56572. // "id": "compute.globalOperations.list",
  56573. // "parameterOrder": [
  56574. // "project"
  56575. // ],
  56576. // "parameters": {
  56577. // "filter": {
  56578. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  56579. // "location": "query",
  56580. // "type": "string"
  56581. // },
  56582. // "maxResults": {
  56583. // "default": "500",
  56584. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  56585. // "format": "uint32",
  56586. // "location": "query",
  56587. // "minimum": "0",
  56588. // "type": "integer"
  56589. // },
  56590. // "orderBy": {
  56591. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  56592. // "location": "query",
  56593. // "type": "string"
  56594. // },
  56595. // "pageToken": {
  56596. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  56597. // "location": "query",
  56598. // "type": "string"
  56599. // },
  56600. // "project": {
  56601. // "description": "Project ID for this request.",
  56602. // "location": "path",
  56603. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56604. // "required": true,
  56605. // "type": "string"
  56606. // }
  56607. // },
  56608. // "path": "{project}/global/operations",
  56609. // "response": {
  56610. // "$ref": "OperationList"
  56611. // },
  56612. // "scopes": [
  56613. // "https://www.googleapis.com/auth/cloud-platform",
  56614. // "https://www.googleapis.com/auth/compute",
  56615. // "https://www.googleapis.com/auth/compute.readonly"
  56616. // ]
  56617. // }
  56618. }
  56619. // Pages invokes f for each page of results.
  56620. // A non-nil error returned from f will halt the iteration.
  56621. // The provided context supersedes any context provided to the Context method.
  56622. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  56623. c.ctx_ = ctx
  56624. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56625. for {
  56626. x, err := c.Do()
  56627. if err != nil {
  56628. return err
  56629. }
  56630. if err := f(x); err != nil {
  56631. return err
  56632. }
  56633. if x.NextPageToken == "" {
  56634. return nil
  56635. }
  56636. c.PageToken(x.NextPageToken)
  56637. }
  56638. }
  56639. // method id "compute.globalOperations.wait":
  56640. type GlobalOperationsWaitCall struct {
  56641. s *Service
  56642. project string
  56643. operation string
  56644. urlParams_ gensupport.URLParams
  56645. ctx_ context.Context
  56646. header_ http.Header
  56647. }
  56648. // Wait: Waits for the specified Operations resource until it is done or
  56649. // timeout, and retrieves the specified Operations resource. 1.
  56650. // Immediately returns when the operation is already done. 2. Waits for
  56651. // no more than the default deadline (2 minutes, subject to change) and
  56652. // then returns the current state of the operation, which may be DONE or
  56653. // still in progress. 3. Is best-effort: a. The server can wait less
  56654. // than the default deadline or zero seconds, in overload situations. b.
  56655. // There is no guarantee that the operation is actually done when
  56656. // returns. 4. User should be prepared to retry if the operation is not
  56657. // DONE.
  56658. func (r *GlobalOperationsService) Wait(project string, operation string) *GlobalOperationsWaitCall {
  56659. c := &GlobalOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56660. c.project = project
  56661. c.operation = operation
  56662. return c
  56663. }
  56664. // Fields allows partial responses to be retrieved. See
  56665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56666. // for more information.
  56667. func (c *GlobalOperationsWaitCall) Fields(s ...googleapi.Field) *GlobalOperationsWaitCall {
  56668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56669. return c
  56670. }
  56671. // Context sets the context to be used in this call's Do method. Any
  56672. // pending HTTP request will be aborted if the provided context is
  56673. // canceled.
  56674. func (c *GlobalOperationsWaitCall) Context(ctx context.Context) *GlobalOperationsWaitCall {
  56675. c.ctx_ = ctx
  56676. return c
  56677. }
  56678. // Header returns an http.Header that can be modified by the caller to
  56679. // add HTTP headers to the request.
  56680. func (c *GlobalOperationsWaitCall) Header() http.Header {
  56681. if c.header_ == nil {
  56682. c.header_ = make(http.Header)
  56683. }
  56684. return c.header_
  56685. }
  56686. func (c *GlobalOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  56687. reqHeaders := make(http.Header)
  56688. for k, v := range c.header_ {
  56689. reqHeaders[k] = v
  56690. }
  56691. reqHeaders.Set("User-Agent", c.s.userAgent())
  56692. var body io.Reader = nil
  56693. c.urlParams_.Set("alt", alt)
  56694. c.urlParams_.Set("prettyPrint", "false")
  56695. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}/wait")
  56696. urls += "?" + c.urlParams_.Encode()
  56697. req, err := http.NewRequest("POST", urls, body)
  56698. if err != nil {
  56699. return nil, err
  56700. }
  56701. req.Header = reqHeaders
  56702. googleapi.Expand(req.URL, map[string]string{
  56703. "project": c.project,
  56704. "operation": c.operation,
  56705. })
  56706. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56707. }
  56708. // Do executes the "compute.globalOperations.wait" call.
  56709. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56710. // status code is an error. Response headers are in either
  56711. // *Operation.ServerResponse.Header or (if a response was returned at
  56712. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56713. // to check whether the returned error was because
  56714. // http.StatusNotModified was returned.
  56715. func (c *GlobalOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56716. gensupport.SetOptions(c.urlParams_, opts...)
  56717. res, err := c.doRequest("json")
  56718. if res != nil && res.StatusCode == http.StatusNotModified {
  56719. if res.Body != nil {
  56720. res.Body.Close()
  56721. }
  56722. return nil, &googleapi.Error{
  56723. Code: res.StatusCode,
  56724. Header: res.Header,
  56725. }
  56726. }
  56727. if err != nil {
  56728. return nil, err
  56729. }
  56730. defer googleapi.CloseBody(res)
  56731. if err := googleapi.CheckResponse(res); err != nil {
  56732. return nil, err
  56733. }
  56734. ret := &Operation{
  56735. ServerResponse: googleapi.ServerResponse{
  56736. Header: res.Header,
  56737. HTTPStatusCode: res.StatusCode,
  56738. },
  56739. }
  56740. target := &ret
  56741. if err := gensupport.DecodeResponse(target, res); err != nil {
  56742. return nil, err
  56743. }
  56744. return ret, nil
  56745. // {
  56746. // "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.",
  56747. // "httpMethod": "POST",
  56748. // "id": "compute.globalOperations.wait",
  56749. // "parameterOrder": [
  56750. // "project",
  56751. // "operation"
  56752. // ],
  56753. // "parameters": {
  56754. // "operation": {
  56755. // "description": "Name of the Operations resource to return.",
  56756. // "location": "path",
  56757. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56758. // "required": true,
  56759. // "type": "string"
  56760. // },
  56761. // "project": {
  56762. // "description": "Project ID for this request.",
  56763. // "location": "path",
  56764. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56765. // "required": true,
  56766. // "type": "string"
  56767. // }
  56768. // },
  56769. // "path": "{project}/global/operations/{operation}/wait",
  56770. // "response": {
  56771. // "$ref": "Operation"
  56772. // },
  56773. // "scopes": [
  56774. // "https://www.googleapis.com/auth/cloud-platform",
  56775. // "https://www.googleapis.com/auth/compute",
  56776. // "https://www.googleapis.com/auth/compute.readonly"
  56777. // ]
  56778. // }
  56779. }
  56780. // method id "compute.globalOrganizationOperations.delete":
  56781. type GlobalOrganizationOperationsDeleteCall struct {
  56782. s *Service
  56783. operation string
  56784. urlParams_ gensupport.URLParams
  56785. ctx_ context.Context
  56786. header_ http.Header
  56787. }
  56788. // Delete: Deletes the specified Operations resource.
  56789. func (r *GlobalOrganizationOperationsService) Delete(operation string) *GlobalOrganizationOperationsDeleteCall {
  56790. c := &GlobalOrganizationOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56791. c.operation = operation
  56792. return c
  56793. }
  56794. // ParentId sets the optional parameter "parentId": Parent ID for this
  56795. // request.
  56796. func (c *GlobalOrganizationOperationsDeleteCall) ParentId(parentId string) *GlobalOrganizationOperationsDeleteCall {
  56797. c.urlParams_.Set("parentId", parentId)
  56798. return c
  56799. }
  56800. // Fields allows partial responses to be retrieved. See
  56801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56802. // for more information.
  56803. func (c *GlobalOrganizationOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsDeleteCall {
  56804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56805. return c
  56806. }
  56807. // Context sets the context to be used in this call's Do method. Any
  56808. // pending HTTP request will be aborted if the provided context is
  56809. // canceled.
  56810. func (c *GlobalOrganizationOperationsDeleteCall) Context(ctx context.Context) *GlobalOrganizationOperationsDeleteCall {
  56811. c.ctx_ = ctx
  56812. return c
  56813. }
  56814. // Header returns an http.Header that can be modified by the caller to
  56815. // add HTTP headers to the request.
  56816. func (c *GlobalOrganizationOperationsDeleteCall) Header() http.Header {
  56817. if c.header_ == nil {
  56818. c.header_ = make(http.Header)
  56819. }
  56820. return c.header_
  56821. }
  56822. func (c *GlobalOrganizationOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  56823. reqHeaders := make(http.Header)
  56824. for k, v := range c.header_ {
  56825. reqHeaders[k] = v
  56826. }
  56827. reqHeaders.Set("User-Agent", c.s.userAgent())
  56828. var body io.Reader = nil
  56829. c.urlParams_.Set("alt", alt)
  56830. c.urlParams_.Set("prettyPrint", "false")
  56831. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}")
  56832. urls += "?" + c.urlParams_.Encode()
  56833. req, err := http.NewRequest("DELETE", urls, body)
  56834. if err != nil {
  56835. return nil, err
  56836. }
  56837. req.Header = reqHeaders
  56838. googleapi.Expand(req.URL, map[string]string{
  56839. "operation": c.operation,
  56840. })
  56841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56842. }
  56843. // Do executes the "compute.globalOrganizationOperations.delete" call.
  56844. func (c *GlobalOrganizationOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  56845. gensupport.SetOptions(c.urlParams_, opts...)
  56846. res, err := c.doRequest("json")
  56847. if err != nil {
  56848. return err
  56849. }
  56850. defer googleapi.CloseBody(res)
  56851. if err := googleapi.CheckResponse(res); err != nil {
  56852. return err
  56853. }
  56854. return nil
  56855. // {
  56856. // "description": "Deletes the specified Operations resource.",
  56857. // "httpMethod": "DELETE",
  56858. // "id": "compute.globalOrganizationOperations.delete",
  56859. // "parameterOrder": [
  56860. // "operation"
  56861. // ],
  56862. // "parameters": {
  56863. // "operation": {
  56864. // "description": "Name of the Operations resource to delete.",
  56865. // "location": "path",
  56866. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56867. // "required": true,
  56868. // "type": "string"
  56869. // },
  56870. // "parentId": {
  56871. // "description": "Parent ID for this request.",
  56872. // "location": "query",
  56873. // "type": "string"
  56874. // }
  56875. // },
  56876. // "path": "locations/global/operations/{operation}",
  56877. // "scopes": [
  56878. // "https://www.googleapis.com/auth/cloud-platform",
  56879. // "https://www.googleapis.com/auth/compute"
  56880. // ]
  56881. // }
  56882. }
  56883. // method id "compute.globalOrganizationOperations.get":
  56884. type GlobalOrganizationOperationsGetCall struct {
  56885. s *Service
  56886. operation string
  56887. urlParams_ gensupport.URLParams
  56888. ifNoneMatch_ string
  56889. ctx_ context.Context
  56890. header_ http.Header
  56891. }
  56892. // Get: Retrieves the specified Operations resource. Gets a list of
  56893. // operations by making a list() request.
  56894. func (r *GlobalOrganizationOperationsService) Get(operation string) *GlobalOrganizationOperationsGetCall {
  56895. c := &GlobalOrganizationOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56896. c.operation = operation
  56897. return c
  56898. }
  56899. // ParentId sets the optional parameter "parentId": Parent ID for this
  56900. // request.
  56901. func (c *GlobalOrganizationOperationsGetCall) ParentId(parentId string) *GlobalOrganizationOperationsGetCall {
  56902. c.urlParams_.Set("parentId", parentId)
  56903. return c
  56904. }
  56905. // Fields allows partial responses to be retrieved. See
  56906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56907. // for more information.
  56908. func (c *GlobalOrganizationOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsGetCall {
  56909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56910. return c
  56911. }
  56912. // IfNoneMatch sets the optional parameter which makes the operation
  56913. // fail if the object's ETag matches the given value. This is useful for
  56914. // getting updates only after the object has changed since the last
  56915. // request. Use googleapi.IsNotModified to check whether the response
  56916. // error from Do is the result of In-None-Match.
  56917. func (c *GlobalOrganizationOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOrganizationOperationsGetCall {
  56918. c.ifNoneMatch_ = entityTag
  56919. return c
  56920. }
  56921. // Context sets the context to be used in this call's Do method. Any
  56922. // pending HTTP request will be aborted if the provided context is
  56923. // canceled.
  56924. func (c *GlobalOrganizationOperationsGetCall) Context(ctx context.Context) *GlobalOrganizationOperationsGetCall {
  56925. c.ctx_ = ctx
  56926. return c
  56927. }
  56928. // Header returns an http.Header that can be modified by the caller to
  56929. // add HTTP headers to the request.
  56930. func (c *GlobalOrganizationOperationsGetCall) Header() http.Header {
  56931. if c.header_ == nil {
  56932. c.header_ = make(http.Header)
  56933. }
  56934. return c.header_
  56935. }
  56936. func (c *GlobalOrganizationOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  56937. reqHeaders := make(http.Header)
  56938. for k, v := range c.header_ {
  56939. reqHeaders[k] = v
  56940. }
  56941. reqHeaders.Set("User-Agent", c.s.userAgent())
  56942. if c.ifNoneMatch_ != "" {
  56943. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56944. }
  56945. var body io.Reader = nil
  56946. c.urlParams_.Set("alt", alt)
  56947. c.urlParams_.Set("prettyPrint", "false")
  56948. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}")
  56949. urls += "?" + c.urlParams_.Encode()
  56950. req, err := http.NewRequest("GET", urls, body)
  56951. if err != nil {
  56952. return nil, err
  56953. }
  56954. req.Header = reqHeaders
  56955. googleapi.Expand(req.URL, map[string]string{
  56956. "operation": c.operation,
  56957. })
  56958. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56959. }
  56960. // Do executes the "compute.globalOrganizationOperations.get" call.
  56961. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56962. // status code is an error. Response headers are in either
  56963. // *Operation.ServerResponse.Header or (if a response was returned at
  56964. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56965. // to check whether the returned error was because
  56966. // http.StatusNotModified was returned.
  56967. func (c *GlobalOrganizationOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56968. gensupport.SetOptions(c.urlParams_, opts...)
  56969. res, err := c.doRequest("json")
  56970. if res != nil && res.StatusCode == http.StatusNotModified {
  56971. if res.Body != nil {
  56972. res.Body.Close()
  56973. }
  56974. return nil, &googleapi.Error{
  56975. Code: res.StatusCode,
  56976. Header: res.Header,
  56977. }
  56978. }
  56979. if err != nil {
  56980. return nil, err
  56981. }
  56982. defer googleapi.CloseBody(res)
  56983. if err := googleapi.CheckResponse(res); err != nil {
  56984. return nil, err
  56985. }
  56986. ret := &Operation{
  56987. ServerResponse: googleapi.ServerResponse{
  56988. Header: res.Header,
  56989. HTTPStatusCode: res.StatusCode,
  56990. },
  56991. }
  56992. target := &ret
  56993. if err := gensupport.DecodeResponse(target, res); err != nil {
  56994. return nil, err
  56995. }
  56996. return ret, nil
  56997. // {
  56998. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  56999. // "httpMethod": "GET",
  57000. // "id": "compute.globalOrganizationOperations.get",
  57001. // "parameterOrder": [
  57002. // "operation"
  57003. // ],
  57004. // "parameters": {
  57005. // "operation": {
  57006. // "description": "Name of the Operations resource to return.",
  57007. // "location": "path",
  57008. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57009. // "required": true,
  57010. // "type": "string"
  57011. // },
  57012. // "parentId": {
  57013. // "description": "Parent ID for this request.",
  57014. // "location": "query",
  57015. // "type": "string"
  57016. // }
  57017. // },
  57018. // "path": "locations/global/operations/{operation}",
  57019. // "response": {
  57020. // "$ref": "Operation"
  57021. // },
  57022. // "scopes": [
  57023. // "https://www.googleapis.com/auth/cloud-platform",
  57024. // "https://www.googleapis.com/auth/compute",
  57025. // "https://www.googleapis.com/auth/compute.readonly"
  57026. // ]
  57027. // }
  57028. }
  57029. // method id "compute.globalOrganizationOperations.list":
  57030. type GlobalOrganizationOperationsListCall struct {
  57031. s *Service
  57032. urlParams_ gensupport.URLParams
  57033. ifNoneMatch_ string
  57034. ctx_ context.Context
  57035. header_ http.Header
  57036. }
  57037. // List: Retrieves a list of Operation resources contained within the
  57038. // specified organization.
  57039. func (r *GlobalOrganizationOperationsService) List() *GlobalOrganizationOperationsListCall {
  57040. c := &GlobalOrganizationOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57041. return c
  57042. }
  57043. // Filter sets the optional parameter "filter": A filter expression that
  57044. // filters resources listed in the response. The expression must specify
  57045. // the field name, a comparison operator, and the value that you want to
  57046. // use for filtering. The value must be a string, a number, or a
  57047. // boolean. The comparison operator must be either =, !=, >, or <.
  57048. //
  57049. // For example, if you are filtering Compute Engine instances, you can
  57050. // exclude instances named example-instance by specifying name !=
  57051. // example-instance.
  57052. //
  57053. // You can also filter nested fields. For example, you could specify
  57054. // scheduling.automaticRestart = false to include instances only if they
  57055. // are not scheduled for automatic restarts. You can use filtering on
  57056. // nested fields to filter based on resource labels.
  57057. //
  57058. // To filter on multiple expressions, provide each separate expression
  57059. // within parentheses. For example, (scheduling.automaticRestart = true)
  57060. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57061. // AND expression. However, you can include AND and OR expressions
  57062. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57063. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57064. // true).
  57065. func (c *GlobalOrganizationOperationsListCall) Filter(filter string) *GlobalOrganizationOperationsListCall {
  57066. c.urlParams_.Set("filter", filter)
  57067. return c
  57068. }
  57069. // MaxResults sets the optional parameter "maxResults": The maximum
  57070. // number of results per page that should be returned. If the number of
  57071. // available results is larger than maxResults, Compute Engine returns a
  57072. // nextPageToken that can be used to get the next page of results in
  57073. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57074. // (Default: 500)
  57075. func (c *GlobalOrganizationOperationsListCall) MaxResults(maxResults int64) *GlobalOrganizationOperationsListCall {
  57076. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57077. return c
  57078. }
  57079. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57080. // a certain order. By default, results are returned in alphanumerical
  57081. // order based on the resource name.
  57082. //
  57083. // You can also sort results in descending order based on the creation
  57084. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57085. // based on the creationTimestamp field in reverse chronological order
  57086. // (newest result first). Use this to sort resources like operations so
  57087. // that the newest operation is returned first.
  57088. //
  57089. // Currently, only sorting by name or creationTimestamp desc is
  57090. // supported.
  57091. func (c *GlobalOrganizationOperationsListCall) OrderBy(orderBy string) *GlobalOrganizationOperationsListCall {
  57092. c.urlParams_.Set("orderBy", orderBy)
  57093. return c
  57094. }
  57095. // PageToken sets the optional parameter "pageToken": Specifies a page
  57096. // token to use. Set pageToken to the nextPageToken returned by a
  57097. // previous list request to get the next page of results.
  57098. func (c *GlobalOrganizationOperationsListCall) PageToken(pageToken string) *GlobalOrganizationOperationsListCall {
  57099. c.urlParams_.Set("pageToken", pageToken)
  57100. return c
  57101. }
  57102. // ParentId sets the optional parameter "parentId": Parent ID for this
  57103. // request.
  57104. func (c *GlobalOrganizationOperationsListCall) ParentId(parentId string) *GlobalOrganizationOperationsListCall {
  57105. c.urlParams_.Set("parentId", parentId)
  57106. return c
  57107. }
  57108. // Fields allows partial responses to be retrieved. See
  57109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57110. // for more information.
  57111. func (c *GlobalOrganizationOperationsListCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsListCall {
  57112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57113. return c
  57114. }
  57115. // IfNoneMatch sets the optional parameter which makes the operation
  57116. // fail if the object's ETag matches the given value. This is useful for
  57117. // getting updates only after the object has changed since the last
  57118. // request. Use googleapi.IsNotModified to check whether the response
  57119. // error from Do is the result of In-None-Match.
  57120. func (c *GlobalOrganizationOperationsListCall) IfNoneMatch(entityTag string) *GlobalOrganizationOperationsListCall {
  57121. c.ifNoneMatch_ = entityTag
  57122. return c
  57123. }
  57124. // Context sets the context to be used in this call's Do method. Any
  57125. // pending HTTP request will be aborted if the provided context is
  57126. // canceled.
  57127. func (c *GlobalOrganizationOperationsListCall) Context(ctx context.Context) *GlobalOrganizationOperationsListCall {
  57128. c.ctx_ = ctx
  57129. return c
  57130. }
  57131. // Header returns an http.Header that can be modified by the caller to
  57132. // add HTTP headers to the request.
  57133. func (c *GlobalOrganizationOperationsListCall) Header() http.Header {
  57134. if c.header_ == nil {
  57135. c.header_ = make(http.Header)
  57136. }
  57137. return c.header_
  57138. }
  57139. func (c *GlobalOrganizationOperationsListCall) doRequest(alt string) (*http.Response, error) {
  57140. reqHeaders := make(http.Header)
  57141. for k, v := range c.header_ {
  57142. reqHeaders[k] = v
  57143. }
  57144. reqHeaders.Set("User-Agent", c.s.userAgent())
  57145. if c.ifNoneMatch_ != "" {
  57146. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57147. }
  57148. var body io.Reader = nil
  57149. c.urlParams_.Set("alt", alt)
  57150. c.urlParams_.Set("prettyPrint", "false")
  57151. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations")
  57152. urls += "?" + c.urlParams_.Encode()
  57153. req, err := http.NewRequest("GET", urls, body)
  57154. if err != nil {
  57155. return nil, err
  57156. }
  57157. req.Header = reqHeaders
  57158. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57159. }
  57160. // Do executes the "compute.globalOrganizationOperations.list" call.
  57161. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  57162. // status code is an error. Response headers are in either
  57163. // *OperationList.ServerResponse.Header or (if a response was returned
  57164. // at all) in error.(*googleapi.Error).Header. Use
  57165. // googleapi.IsNotModified to check whether the returned error was
  57166. // because http.StatusNotModified was returned.
  57167. func (c *GlobalOrganizationOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  57168. gensupport.SetOptions(c.urlParams_, opts...)
  57169. res, err := c.doRequest("json")
  57170. if res != nil && res.StatusCode == http.StatusNotModified {
  57171. if res.Body != nil {
  57172. res.Body.Close()
  57173. }
  57174. return nil, &googleapi.Error{
  57175. Code: res.StatusCode,
  57176. Header: res.Header,
  57177. }
  57178. }
  57179. if err != nil {
  57180. return nil, err
  57181. }
  57182. defer googleapi.CloseBody(res)
  57183. if err := googleapi.CheckResponse(res); err != nil {
  57184. return nil, err
  57185. }
  57186. ret := &OperationList{
  57187. ServerResponse: googleapi.ServerResponse{
  57188. Header: res.Header,
  57189. HTTPStatusCode: res.StatusCode,
  57190. },
  57191. }
  57192. target := &ret
  57193. if err := gensupport.DecodeResponse(target, res); err != nil {
  57194. return nil, err
  57195. }
  57196. return ret, nil
  57197. // {
  57198. // "description": "Retrieves a list of Operation resources contained within the specified organization.",
  57199. // "httpMethod": "GET",
  57200. // "id": "compute.globalOrganizationOperations.list",
  57201. // "parameters": {
  57202. // "filter": {
  57203. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  57204. // "location": "query",
  57205. // "type": "string"
  57206. // },
  57207. // "maxResults": {
  57208. // "default": "500",
  57209. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57210. // "format": "uint32",
  57211. // "location": "query",
  57212. // "minimum": "0",
  57213. // "type": "integer"
  57214. // },
  57215. // "orderBy": {
  57216. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57217. // "location": "query",
  57218. // "type": "string"
  57219. // },
  57220. // "pageToken": {
  57221. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  57222. // "location": "query",
  57223. // "type": "string"
  57224. // },
  57225. // "parentId": {
  57226. // "description": "Parent ID for this request.",
  57227. // "location": "query",
  57228. // "type": "string"
  57229. // }
  57230. // },
  57231. // "path": "locations/global/operations",
  57232. // "response": {
  57233. // "$ref": "OperationList"
  57234. // },
  57235. // "scopes": [
  57236. // "https://www.googleapis.com/auth/cloud-platform",
  57237. // "https://www.googleapis.com/auth/compute",
  57238. // "https://www.googleapis.com/auth/compute.readonly"
  57239. // ]
  57240. // }
  57241. }
  57242. // Pages invokes f for each page of results.
  57243. // A non-nil error returned from f will halt the iteration.
  57244. // The provided context supersedes any context provided to the Context method.
  57245. func (c *GlobalOrganizationOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  57246. c.ctx_ = ctx
  57247. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57248. for {
  57249. x, err := c.Do()
  57250. if err != nil {
  57251. return err
  57252. }
  57253. if err := f(x); err != nil {
  57254. return err
  57255. }
  57256. if x.NextPageToken == "" {
  57257. return nil
  57258. }
  57259. c.PageToken(x.NextPageToken)
  57260. }
  57261. }
  57262. // method id "compute.globalOrganizationOperations.wait":
  57263. type GlobalOrganizationOperationsWaitCall struct {
  57264. s *Service
  57265. operation string
  57266. urlParams_ gensupport.URLParams
  57267. ctx_ context.Context
  57268. header_ http.Header
  57269. }
  57270. // Wait: Waits for the specified Operations resource until it is done or
  57271. // timeout, and retrieves the specified Operations resource. 1.
  57272. // Immediately returns when the operation is already done. 2. Waits for
  57273. // no more than the default deadline (2 minutes, subject to change) and
  57274. // then returns the current state of the operation, which may be DONE or
  57275. // still in progress. 3. Is best-effort: a. The server can wait less
  57276. // than the default deadline or zero seconds, in overload situations. b.
  57277. // There is no guarantee that the operation is actually done when
  57278. // returns. 4. User should be prepared to retry if the operation is not
  57279. // DONE.
  57280. func (r *GlobalOrganizationOperationsService) Wait(operation string) *GlobalOrganizationOperationsWaitCall {
  57281. c := &GlobalOrganizationOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57282. c.operation = operation
  57283. return c
  57284. }
  57285. // ParentId sets the optional parameter "parentId": Parent ID for this
  57286. // request.
  57287. func (c *GlobalOrganizationOperationsWaitCall) ParentId(parentId string) *GlobalOrganizationOperationsWaitCall {
  57288. c.urlParams_.Set("parentId", parentId)
  57289. return c
  57290. }
  57291. // Fields allows partial responses to be retrieved. See
  57292. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57293. // for more information.
  57294. func (c *GlobalOrganizationOperationsWaitCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsWaitCall {
  57295. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57296. return c
  57297. }
  57298. // Context sets the context to be used in this call's Do method. Any
  57299. // pending HTTP request will be aborted if the provided context is
  57300. // canceled.
  57301. func (c *GlobalOrganizationOperationsWaitCall) Context(ctx context.Context) *GlobalOrganizationOperationsWaitCall {
  57302. c.ctx_ = ctx
  57303. return c
  57304. }
  57305. // Header returns an http.Header that can be modified by the caller to
  57306. // add HTTP headers to the request.
  57307. func (c *GlobalOrganizationOperationsWaitCall) Header() http.Header {
  57308. if c.header_ == nil {
  57309. c.header_ = make(http.Header)
  57310. }
  57311. return c.header_
  57312. }
  57313. func (c *GlobalOrganizationOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  57314. reqHeaders := make(http.Header)
  57315. for k, v := range c.header_ {
  57316. reqHeaders[k] = v
  57317. }
  57318. reqHeaders.Set("User-Agent", c.s.userAgent())
  57319. var body io.Reader = nil
  57320. c.urlParams_.Set("alt", alt)
  57321. c.urlParams_.Set("prettyPrint", "false")
  57322. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}/wait")
  57323. urls += "?" + c.urlParams_.Encode()
  57324. req, err := http.NewRequest("POST", urls, body)
  57325. if err != nil {
  57326. return nil, err
  57327. }
  57328. req.Header = reqHeaders
  57329. googleapi.Expand(req.URL, map[string]string{
  57330. "operation": c.operation,
  57331. })
  57332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57333. }
  57334. // Do executes the "compute.globalOrganizationOperations.wait" call.
  57335. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57336. // status code is an error. Response headers are in either
  57337. // *Operation.ServerResponse.Header or (if a response was returned at
  57338. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57339. // to check whether the returned error was because
  57340. // http.StatusNotModified was returned.
  57341. func (c *GlobalOrganizationOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57342. gensupport.SetOptions(c.urlParams_, opts...)
  57343. res, err := c.doRequest("json")
  57344. if res != nil && res.StatusCode == http.StatusNotModified {
  57345. if res.Body != nil {
  57346. res.Body.Close()
  57347. }
  57348. return nil, &googleapi.Error{
  57349. Code: res.StatusCode,
  57350. Header: res.Header,
  57351. }
  57352. }
  57353. if err != nil {
  57354. return nil, err
  57355. }
  57356. defer googleapi.CloseBody(res)
  57357. if err := googleapi.CheckResponse(res); err != nil {
  57358. return nil, err
  57359. }
  57360. ret := &Operation{
  57361. ServerResponse: googleapi.ServerResponse{
  57362. Header: res.Header,
  57363. HTTPStatusCode: res.StatusCode,
  57364. },
  57365. }
  57366. target := &ret
  57367. if err := gensupport.DecodeResponse(target, res); err != nil {
  57368. return nil, err
  57369. }
  57370. return ret, nil
  57371. // {
  57372. // "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.",
  57373. // "httpMethod": "POST",
  57374. // "id": "compute.globalOrganizationOperations.wait",
  57375. // "parameterOrder": [
  57376. // "operation"
  57377. // ],
  57378. // "parameters": {
  57379. // "operation": {
  57380. // "description": "Name of the Operations resource to return.",
  57381. // "location": "path",
  57382. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57383. // "required": true,
  57384. // "type": "string"
  57385. // },
  57386. // "parentId": {
  57387. // "description": "Parent ID for this request.",
  57388. // "location": "query",
  57389. // "type": "string"
  57390. // }
  57391. // },
  57392. // "path": "locations/global/operations/{operation}/wait",
  57393. // "response": {
  57394. // "$ref": "Operation"
  57395. // },
  57396. // "scopes": [
  57397. // "https://www.googleapis.com/auth/cloud-platform",
  57398. // "https://www.googleapis.com/auth/compute",
  57399. // "https://www.googleapis.com/auth/compute.readonly"
  57400. // ]
  57401. // }
  57402. }
  57403. // method id "compute.healthChecks.aggregatedList":
  57404. type HealthChecksAggregatedListCall struct {
  57405. s *Service
  57406. project string
  57407. urlParams_ gensupport.URLParams
  57408. ifNoneMatch_ string
  57409. ctx_ context.Context
  57410. header_ http.Header
  57411. }
  57412. // AggregatedList: Retrieves the list of all HealthCheck resources,
  57413. // regional and global, available to the specified project.
  57414. func (r *HealthChecksService) AggregatedList(project string) *HealthChecksAggregatedListCall {
  57415. c := &HealthChecksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57416. c.project = project
  57417. return c
  57418. }
  57419. // Filter sets the optional parameter "filter": A filter expression that
  57420. // filters resources listed in the response. The expression must specify
  57421. // the field name, a comparison operator, and the value that you want to
  57422. // use for filtering. The value must be a string, a number, or a
  57423. // boolean. The comparison operator must be either =, !=, >, or <.
  57424. //
  57425. // For example, if you are filtering Compute Engine instances, you can
  57426. // exclude instances named example-instance by specifying name !=
  57427. // example-instance.
  57428. //
  57429. // You can also filter nested fields. For example, you could specify
  57430. // scheduling.automaticRestart = false to include instances only if they
  57431. // are not scheduled for automatic restarts. You can use filtering on
  57432. // nested fields to filter based on resource labels.
  57433. //
  57434. // To filter on multiple expressions, provide each separate expression
  57435. // within parentheses. For example, (scheduling.automaticRestart = true)
  57436. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57437. // AND expression. However, you can include AND and OR expressions
  57438. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57439. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57440. // true).
  57441. func (c *HealthChecksAggregatedListCall) Filter(filter string) *HealthChecksAggregatedListCall {
  57442. c.urlParams_.Set("filter", filter)
  57443. return c
  57444. }
  57445. // MaxResults sets the optional parameter "maxResults": The maximum
  57446. // number of results per page that should be returned. If the number of
  57447. // available results is larger than maxResults, Compute Engine returns a
  57448. // nextPageToken that can be used to get the next page of results in
  57449. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57450. // (Default: 500)
  57451. func (c *HealthChecksAggregatedListCall) MaxResults(maxResults int64) *HealthChecksAggregatedListCall {
  57452. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57453. return c
  57454. }
  57455. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57456. // a certain order. By default, results are returned in alphanumerical
  57457. // order based on the resource name.
  57458. //
  57459. // You can also sort results in descending order based on the creation
  57460. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57461. // based on the creationTimestamp field in reverse chronological order
  57462. // (newest result first). Use this to sort resources like operations so
  57463. // that the newest operation is returned first.
  57464. //
  57465. // Currently, only sorting by name or creationTimestamp desc is
  57466. // supported.
  57467. func (c *HealthChecksAggregatedListCall) OrderBy(orderBy string) *HealthChecksAggregatedListCall {
  57468. c.urlParams_.Set("orderBy", orderBy)
  57469. return c
  57470. }
  57471. // PageToken sets the optional parameter "pageToken": Specifies a page
  57472. // token to use. Set pageToken to the nextPageToken returned by a
  57473. // previous list request to get the next page of results.
  57474. func (c *HealthChecksAggregatedListCall) PageToken(pageToken string) *HealthChecksAggregatedListCall {
  57475. c.urlParams_.Set("pageToken", pageToken)
  57476. return c
  57477. }
  57478. // Fields allows partial responses to be retrieved. See
  57479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57480. // for more information.
  57481. func (c *HealthChecksAggregatedListCall) Fields(s ...googleapi.Field) *HealthChecksAggregatedListCall {
  57482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57483. return c
  57484. }
  57485. // IfNoneMatch sets the optional parameter which makes the operation
  57486. // fail if the object's ETag matches the given value. This is useful for
  57487. // getting updates only after the object has changed since the last
  57488. // request. Use googleapi.IsNotModified to check whether the response
  57489. // error from Do is the result of In-None-Match.
  57490. func (c *HealthChecksAggregatedListCall) IfNoneMatch(entityTag string) *HealthChecksAggregatedListCall {
  57491. c.ifNoneMatch_ = entityTag
  57492. return c
  57493. }
  57494. // Context sets the context to be used in this call's Do method. Any
  57495. // pending HTTP request will be aborted if the provided context is
  57496. // canceled.
  57497. func (c *HealthChecksAggregatedListCall) Context(ctx context.Context) *HealthChecksAggregatedListCall {
  57498. c.ctx_ = ctx
  57499. return c
  57500. }
  57501. // Header returns an http.Header that can be modified by the caller to
  57502. // add HTTP headers to the request.
  57503. func (c *HealthChecksAggregatedListCall) Header() http.Header {
  57504. if c.header_ == nil {
  57505. c.header_ = make(http.Header)
  57506. }
  57507. return c.header_
  57508. }
  57509. func (c *HealthChecksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  57510. reqHeaders := make(http.Header)
  57511. for k, v := range c.header_ {
  57512. reqHeaders[k] = v
  57513. }
  57514. reqHeaders.Set("User-Agent", c.s.userAgent())
  57515. if c.ifNoneMatch_ != "" {
  57516. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57517. }
  57518. var body io.Reader = nil
  57519. c.urlParams_.Set("alt", alt)
  57520. c.urlParams_.Set("prettyPrint", "false")
  57521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/healthChecks")
  57522. urls += "?" + c.urlParams_.Encode()
  57523. req, err := http.NewRequest("GET", urls, body)
  57524. if err != nil {
  57525. return nil, err
  57526. }
  57527. req.Header = reqHeaders
  57528. googleapi.Expand(req.URL, map[string]string{
  57529. "project": c.project,
  57530. })
  57531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57532. }
  57533. // Do executes the "compute.healthChecks.aggregatedList" call.
  57534. // Exactly one of *HealthChecksAggregatedList or error will be non-nil.
  57535. // Any non-2xx status code is an error. Response headers are in either
  57536. // *HealthChecksAggregatedList.ServerResponse.Header or (if a response
  57537. // was returned at all) in error.(*googleapi.Error).Header. Use
  57538. // googleapi.IsNotModified to check whether the returned error was
  57539. // because http.StatusNotModified was returned.
  57540. func (c *HealthChecksAggregatedListCall) Do(opts ...googleapi.CallOption) (*HealthChecksAggregatedList, error) {
  57541. gensupport.SetOptions(c.urlParams_, opts...)
  57542. res, err := c.doRequest("json")
  57543. if res != nil && res.StatusCode == http.StatusNotModified {
  57544. if res.Body != nil {
  57545. res.Body.Close()
  57546. }
  57547. return nil, &googleapi.Error{
  57548. Code: res.StatusCode,
  57549. Header: res.Header,
  57550. }
  57551. }
  57552. if err != nil {
  57553. return nil, err
  57554. }
  57555. defer googleapi.CloseBody(res)
  57556. if err := googleapi.CheckResponse(res); err != nil {
  57557. return nil, err
  57558. }
  57559. ret := &HealthChecksAggregatedList{
  57560. ServerResponse: googleapi.ServerResponse{
  57561. Header: res.Header,
  57562. HTTPStatusCode: res.StatusCode,
  57563. },
  57564. }
  57565. target := &ret
  57566. if err := gensupport.DecodeResponse(target, res); err != nil {
  57567. return nil, err
  57568. }
  57569. return ret, nil
  57570. // {
  57571. // "description": "Retrieves the list of all HealthCheck resources, regional and global, available to the specified project.",
  57572. // "httpMethod": "GET",
  57573. // "id": "compute.healthChecks.aggregatedList",
  57574. // "parameterOrder": [
  57575. // "project"
  57576. // ],
  57577. // "parameters": {
  57578. // "filter": {
  57579. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  57580. // "location": "query",
  57581. // "type": "string"
  57582. // },
  57583. // "maxResults": {
  57584. // "default": "500",
  57585. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57586. // "format": "uint32",
  57587. // "location": "query",
  57588. // "minimum": "0",
  57589. // "type": "integer"
  57590. // },
  57591. // "orderBy": {
  57592. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57593. // "location": "query",
  57594. // "type": "string"
  57595. // },
  57596. // "pageToken": {
  57597. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  57598. // "location": "query",
  57599. // "type": "string"
  57600. // },
  57601. // "project": {
  57602. // "description": "Name of the project scoping this request.",
  57603. // "location": "path",
  57604. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57605. // "required": true,
  57606. // "type": "string"
  57607. // }
  57608. // },
  57609. // "path": "{project}/aggregated/healthChecks",
  57610. // "response": {
  57611. // "$ref": "HealthChecksAggregatedList"
  57612. // },
  57613. // "scopes": [
  57614. // "https://www.googleapis.com/auth/cloud-platform",
  57615. // "https://www.googleapis.com/auth/compute",
  57616. // "https://www.googleapis.com/auth/compute.readonly"
  57617. // ]
  57618. // }
  57619. }
  57620. // Pages invokes f for each page of results.
  57621. // A non-nil error returned from f will halt the iteration.
  57622. // The provided context supersedes any context provided to the Context method.
  57623. func (c *HealthChecksAggregatedListCall) Pages(ctx context.Context, f func(*HealthChecksAggregatedList) error) error {
  57624. c.ctx_ = ctx
  57625. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57626. for {
  57627. x, err := c.Do()
  57628. if err != nil {
  57629. return err
  57630. }
  57631. if err := f(x); err != nil {
  57632. return err
  57633. }
  57634. if x.NextPageToken == "" {
  57635. return nil
  57636. }
  57637. c.PageToken(x.NextPageToken)
  57638. }
  57639. }
  57640. // method id "compute.healthChecks.delete":
  57641. type HealthChecksDeleteCall struct {
  57642. s *Service
  57643. project string
  57644. healthCheck string
  57645. urlParams_ gensupport.URLParams
  57646. ctx_ context.Context
  57647. header_ http.Header
  57648. }
  57649. // Delete: Deletes the specified HealthCheck resource.
  57650. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  57651. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57652. c.project = project
  57653. c.healthCheck = healthCheck
  57654. return c
  57655. }
  57656. // RequestId sets the optional parameter "requestId": An optional
  57657. // request ID to identify requests. Specify a unique request ID so that
  57658. // if you must retry your request, the server will know to ignore the
  57659. // request if it has already been completed.
  57660. //
  57661. // For example, consider a situation where you make an initial request
  57662. // and the request times out. If you make the request again with the
  57663. // same request ID, the server can check if original operation with the
  57664. // same request ID was received, and if so, will ignore the second
  57665. // request. This prevents clients from accidentally creating duplicate
  57666. // commitments.
  57667. //
  57668. // The request ID must be a valid UUID with the exception that zero UUID
  57669. // is not supported (00000000-0000-0000-0000-000000000000).
  57670. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  57671. c.urlParams_.Set("requestId", requestId)
  57672. return c
  57673. }
  57674. // Fields allows partial responses to be retrieved. See
  57675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57676. // for more information.
  57677. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  57678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57679. return c
  57680. }
  57681. // Context sets the context to be used in this call's Do method. Any
  57682. // pending HTTP request will be aborted if the provided context is
  57683. // canceled.
  57684. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  57685. c.ctx_ = ctx
  57686. return c
  57687. }
  57688. // Header returns an http.Header that can be modified by the caller to
  57689. // add HTTP headers to the request.
  57690. func (c *HealthChecksDeleteCall) Header() http.Header {
  57691. if c.header_ == nil {
  57692. c.header_ = make(http.Header)
  57693. }
  57694. return c.header_
  57695. }
  57696. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  57697. reqHeaders := make(http.Header)
  57698. for k, v := range c.header_ {
  57699. reqHeaders[k] = v
  57700. }
  57701. reqHeaders.Set("User-Agent", c.s.userAgent())
  57702. var body io.Reader = nil
  57703. c.urlParams_.Set("alt", alt)
  57704. c.urlParams_.Set("prettyPrint", "false")
  57705. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  57706. urls += "?" + c.urlParams_.Encode()
  57707. req, err := http.NewRequest("DELETE", urls, body)
  57708. if err != nil {
  57709. return nil, err
  57710. }
  57711. req.Header = reqHeaders
  57712. googleapi.Expand(req.URL, map[string]string{
  57713. "project": c.project,
  57714. "healthCheck": c.healthCheck,
  57715. })
  57716. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57717. }
  57718. // Do executes the "compute.healthChecks.delete" call.
  57719. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57720. // status code is an error. Response headers are in either
  57721. // *Operation.ServerResponse.Header or (if a response was returned at
  57722. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57723. // to check whether the returned error was because
  57724. // http.StatusNotModified was returned.
  57725. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57726. gensupport.SetOptions(c.urlParams_, opts...)
  57727. res, err := c.doRequest("json")
  57728. if res != nil && res.StatusCode == http.StatusNotModified {
  57729. if res.Body != nil {
  57730. res.Body.Close()
  57731. }
  57732. return nil, &googleapi.Error{
  57733. Code: res.StatusCode,
  57734. Header: res.Header,
  57735. }
  57736. }
  57737. if err != nil {
  57738. return nil, err
  57739. }
  57740. defer googleapi.CloseBody(res)
  57741. if err := googleapi.CheckResponse(res); err != nil {
  57742. return nil, err
  57743. }
  57744. ret := &Operation{
  57745. ServerResponse: googleapi.ServerResponse{
  57746. Header: res.Header,
  57747. HTTPStatusCode: res.StatusCode,
  57748. },
  57749. }
  57750. target := &ret
  57751. if err := gensupport.DecodeResponse(target, res); err != nil {
  57752. return nil, err
  57753. }
  57754. return ret, nil
  57755. // {
  57756. // "description": "Deletes the specified HealthCheck resource.",
  57757. // "httpMethod": "DELETE",
  57758. // "id": "compute.healthChecks.delete",
  57759. // "parameterOrder": [
  57760. // "project",
  57761. // "healthCheck"
  57762. // ],
  57763. // "parameters": {
  57764. // "healthCheck": {
  57765. // "description": "Name of the HealthCheck resource to delete.",
  57766. // "location": "path",
  57767. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57768. // "required": true,
  57769. // "type": "string"
  57770. // },
  57771. // "project": {
  57772. // "description": "Project ID for this request.",
  57773. // "location": "path",
  57774. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57775. // "required": true,
  57776. // "type": "string"
  57777. // },
  57778. // "requestId": {
  57779. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57780. // "location": "query",
  57781. // "type": "string"
  57782. // }
  57783. // },
  57784. // "path": "{project}/global/healthChecks/{healthCheck}",
  57785. // "response": {
  57786. // "$ref": "Operation"
  57787. // },
  57788. // "scopes": [
  57789. // "https://www.googleapis.com/auth/cloud-platform",
  57790. // "https://www.googleapis.com/auth/compute"
  57791. // ]
  57792. // }
  57793. }
  57794. // method id "compute.healthChecks.get":
  57795. type HealthChecksGetCall struct {
  57796. s *Service
  57797. project string
  57798. healthCheck string
  57799. urlParams_ gensupport.URLParams
  57800. ifNoneMatch_ string
  57801. ctx_ context.Context
  57802. header_ http.Header
  57803. }
  57804. // Get: Returns the specified HealthCheck resource. Gets a list of
  57805. // available health checks by making a list() request.
  57806. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  57807. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57808. c.project = project
  57809. c.healthCheck = healthCheck
  57810. return c
  57811. }
  57812. // Fields allows partial responses to be retrieved. See
  57813. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57814. // for more information.
  57815. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  57816. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57817. return c
  57818. }
  57819. // IfNoneMatch sets the optional parameter which makes the operation
  57820. // fail if the object's ETag matches the given value. This is useful for
  57821. // getting updates only after the object has changed since the last
  57822. // request. Use googleapi.IsNotModified to check whether the response
  57823. // error from Do is the result of In-None-Match.
  57824. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  57825. c.ifNoneMatch_ = entityTag
  57826. return c
  57827. }
  57828. // Context sets the context to be used in this call's Do method. Any
  57829. // pending HTTP request will be aborted if the provided context is
  57830. // canceled.
  57831. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  57832. c.ctx_ = ctx
  57833. return c
  57834. }
  57835. // Header returns an http.Header that can be modified by the caller to
  57836. // add HTTP headers to the request.
  57837. func (c *HealthChecksGetCall) Header() http.Header {
  57838. if c.header_ == nil {
  57839. c.header_ = make(http.Header)
  57840. }
  57841. return c.header_
  57842. }
  57843. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  57844. reqHeaders := make(http.Header)
  57845. for k, v := range c.header_ {
  57846. reqHeaders[k] = v
  57847. }
  57848. reqHeaders.Set("User-Agent", c.s.userAgent())
  57849. if c.ifNoneMatch_ != "" {
  57850. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57851. }
  57852. var body io.Reader = nil
  57853. c.urlParams_.Set("alt", alt)
  57854. c.urlParams_.Set("prettyPrint", "false")
  57855. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  57856. urls += "?" + c.urlParams_.Encode()
  57857. req, err := http.NewRequest("GET", urls, body)
  57858. if err != nil {
  57859. return nil, err
  57860. }
  57861. req.Header = reqHeaders
  57862. googleapi.Expand(req.URL, map[string]string{
  57863. "project": c.project,
  57864. "healthCheck": c.healthCheck,
  57865. })
  57866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57867. }
  57868. // Do executes the "compute.healthChecks.get" call.
  57869. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  57870. // status code is an error. Response headers are in either
  57871. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  57872. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57873. // to check whether the returned error was because
  57874. // http.StatusNotModified was returned.
  57875. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  57876. gensupport.SetOptions(c.urlParams_, opts...)
  57877. res, err := c.doRequest("json")
  57878. if res != nil && res.StatusCode == http.StatusNotModified {
  57879. if res.Body != nil {
  57880. res.Body.Close()
  57881. }
  57882. return nil, &googleapi.Error{
  57883. Code: res.StatusCode,
  57884. Header: res.Header,
  57885. }
  57886. }
  57887. if err != nil {
  57888. return nil, err
  57889. }
  57890. defer googleapi.CloseBody(res)
  57891. if err := googleapi.CheckResponse(res); err != nil {
  57892. return nil, err
  57893. }
  57894. ret := &HealthCheck{
  57895. ServerResponse: googleapi.ServerResponse{
  57896. Header: res.Header,
  57897. HTTPStatusCode: res.StatusCode,
  57898. },
  57899. }
  57900. target := &ret
  57901. if err := gensupport.DecodeResponse(target, res); err != nil {
  57902. return nil, err
  57903. }
  57904. return ret, nil
  57905. // {
  57906. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  57907. // "httpMethod": "GET",
  57908. // "id": "compute.healthChecks.get",
  57909. // "parameterOrder": [
  57910. // "project",
  57911. // "healthCheck"
  57912. // ],
  57913. // "parameters": {
  57914. // "healthCheck": {
  57915. // "description": "Name of the HealthCheck resource to return.",
  57916. // "location": "path",
  57917. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57918. // "required": true,
  57919. // "type": "string"
  57920. // },
  57921. // "project": {
  57922. // "description": "Project ID for this request.",
  57923. // "location": "path",
  57924. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57925. // "required": true,
  57926. // "type": "string"
  57927. // }
  57928. // },
  57929. // "path": "{project}/global/healthChecks/{healthCheck}",
  57930. // "response": {
  57931. // "$ref": "HealthCheck"
  57932. // },
  57933. // "scopes": [
  57934. // "https://www.googleapis.com/auth/cloud-platform",
  57935. // "https://www.googleapis.com/auth/compute",
  57936. // "https://www.googleapis.com/auth/compute.readonly"
  57937. // ]
  57938. // }
  57939. }
  57940. // method id "compute.healthChecks.insert":
  57941. type HealthChecksInsertCall struct {
  57942. s *Service
  57943. project string
  57944. healthcheck *HealthCheck
  57945. urlParams_ gensupport.URLParams
  57946. ctx_ context.Context
  57947. header_ http.Header
  57948. }
  57949. // Insert: Creates a HealthCheck resource in the specified project using
  57950. // the data included in the request.
  57951. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  57952. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57953. c.project = project
  57954. c.healthcheck = healthcheck
  57955. return c
  57956. }
  57957. // RequestId sets the optional parameter "requestId": An optional
  57958. // request ID to identify requests. Specify a unique request ID so that
  57959. // if you must retry your request, the server will know to ignore the
  57960. // request if it has already been completed.
  57961. //
  57962. // For example, consider a situation where you make an initial request
  57963. // and the request times out. If you make the request again with the
  57964. // same request ID, the server can check if original operation with the
  57965. // same request ID was received, and if so, will ignore the second
  57966. // request. This prevents clients from accidentally creating duplicate
  57967. // commitments.
  57968. //
  57969. // The request ID must be a valid UUID with the exception that zero UUID
  57970. // is not supported (00000000-0000-0000-0000-000000000000).
  57971. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  57972. c.urlParams_.Set("requestId", requestId)
  57973. return c
  57974. }
  57975. // Fields allows partial responses to be retrieved. See
  57976. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57977. // for more information.
  57978. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  57979. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57980. return c
  57981. }
  57982. // Context sets the context to be used in this call's Do method. Any
  57983. // pending HTTP request will be aborted if the provided context is
  57984. // canceled.
  57985. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  57986. c.ctx_ = ctx
  57987. return c
  57988. }
  57989. // Header returns an http.Header that can be modified by the caller to
  57990. // add HTTP headers to the request.
  57991. func (c *HealthChecksInsertCall) Header() http.Header {
  57992. if c.header_ == nil {
  57993. c.header_ = make(http.Header)
  57994. }
  57995. return c.header_
  57996. }
  57997. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  57998. reqHeaders := make(http.Header)
  57999. for k, v := range c.header_ {
  58000. reqHeaders[k] = v
  58001. }
  58002. reqHeaders.Set("User-Agent", c.s.userAgent())
  58003. var body io.Reader = nil
  58004. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  58005. if err != nil {
  58006. return nil, err
  58007. }
  58008. reqHeaders.Set("Content-Type", "application/json")
  58009. c.urlParams_.Set("alt", alt)
  58010. c.urlParams_.Set("prettyPrint", "false")
  58011. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  58012. urls += "?" + c.urlParams_.Encode()
  58013. req, err := http.NewRequest("POST", urls, body)
  58014. if err != nil {
  58015. return nil, err
  58016. }
  58017. req.Header = reqHeaders
  58018. googleapi.Expand(req.URL, map[string]string{
  58019. "project": c.project,
  58020. })
  58021. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58022. }
  58023. // Do executes the "compute.healthChecks.insert" call.
  58024. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58025. // status code is an error. Response headers are in either
  58026. // *Operation.ServerResponse.Header or (if a response was returned at
  58027. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58028. // to check whether the returned error was because
  58029. // http.StatusNotModified was returned.
  58030. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58031. gensupport.SetOptions(c.urlParams_, opts...)
  58032. res, err := c.doRequest("json")
  58033. if res != nil && res.StatusCode == http.StatusNotModified {
  58034. if res.Body != nil {
  58035. res.Body.Close()
  58036. }
  58037. return nil, &googleapi.Error{
  58038. Code: res.StatusCode,
  58039. Header: res.Header,
  58040. }
  58041. }
  58042. if err != nil {
  58043. return nil, err
  58044. }
  58045. defer googleapi.CloseBody(res)
  58046. if err := googleapi.CheckResponse(res); err != nil {
  58047. return nil, err
  58048. }
  58049. ret := &Operation{
  58050. ServerResponse: googleapi.ServerResponse{
  58051. Header: res.Header,
  58052. HTTPStatusCode: res.StatusCode,
  58053. },
  58054. }
  58055. target := &ret
  58056. if err := gensupport.DecodeResponse(target, res); err != nil {
  58057. return nil, err
  58058. }
  58059. return ret, nil
  58060. // {
  58061. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  58062. // "httpMethod": "POST",
  58063. // "id": "compute.healthChecks.insert",
  58064. // "parameterOrder": [
  58065. // "project"
  58066. // ],
  58067. // "parameters": {
  58068. // "project": {
  58069. // "description": "Project ID for this request.",
  58070. // "location": "path",
  58071. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58072. // "required": true,
  58073. // "type": "string"
  58074. // },
  58075. // "requestId": {
  58076. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58077. // "location": "query",
  58078. // "type": "string"
  58079. // }
  58080. // },
  58081. // "path": "{project}/global/healthChecks",
  58082. // "request": {
  58083. // "$ref": "HealthCheck"
  58084. // },
  58085. // "response": {
  58086. // "$ref": "Operation"
  58087. // },
  58088. // "scopes": [
  58089. // "https://www.googleapis.com/auth/cloud-platform",
  58090. // "https://www.googleapis.com/auth/compute"
  58091. // ]
  58092. // }
  58093. }
  58094. // method id "compute.healthChecks.list":
  58095. type HealthChecksListCall struct {
  58096. s *Service
  58097. project string
  58098. urlParams_ gensupport.URLParams
  58099. ifNoneMatch_ string
  58100. ctx_ context.Context
  58101. header_ http.Header
  58102. }
  58103. // List: Retrieves the list of HealthCheck resources available to the
  58104. // specified project.
  58105. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  58106. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58107. c.project = project
  58108. return c
  58109. }
  58110. // Filter sets the optional parameter "filter": A filter expression that
  58111. // filters resources listed in the response. The expression must specify
  58112. // the field name, a comparison operator, and the value that you want to
  58113. // use for filtering. The value must be a string, a number, or a
  58114. // boolean. The comparison operator must be either =, !=, >, or <.
  58115. //
  58116. // For example, if you are filtering Compute Engine instances, you can
  58117. // exclude instances named example-instance by specifying name !=
  58118. // example-instance.
  58119. //
  58120. // You can also filter nested fields. For example, you could specify
  58121. // scheduling.automaticRestart = false to include instances only if they
  58122. // are not scheduled for automatic restarts. You can use filtering on
  58123. // nested fields to filter based on resource labels.
  58124. //
  58125. // To filter on multiple expressions, provide each separate expression
  58126. // within parentheses. For example, (scheduling.automaticRestart = true)
  58127. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58128. // AND expression. However, you can include AND and OR expressions
  58129. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58130. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58131. // true).
  58132. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  58133. c.urlParams_.Set("filter", filter)
  58134. return c
  58135. }
  58136. // MaxResults sets the optional parameter "maxResults": The maximum
  58137. // number of results per page that should be returned. If the number of
  58138. // available results is larger than maxResults, Compute Engine returns a
  58139. // nextPageToken that can be used to get the next page of results in
  58140. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58141. // (Default: 500)
  58142. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  58143. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58144. return c
  58145. }
  58146. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58147. // a certain order. By default, results are returned in alphanumerical
  58148. // order based on the resource name.
  58149. //
  58150. // You can also sort results in descending order based on the creation
  58151. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58152. // based on the creationTimestamp field in reverse chronological order
  58153. // (newest result first). Use this to sort resources like operations so
  58154. // that the newest operation is returned first.
  58155. //
  58156. // Currently, only sorting by name or creationTimestamp desc is
  58157. // supported.
  58158. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  58159. c.urlParams_.Set("orderBy", orderBy)
  58160. return c
  58161. }
  58162. // PageToken sets the optional parameter "pageToken": Specifies a page
  58163. // token to use. Set pageToken to the nextPageToken returned by a
  58164. // previous list request to get the next page of results.
  58165. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  58166. c.urlParams_.Set("pageToken", pageToken)
  58167. return c
  58168. }
  58169. // Fields allows partial responses to be retrieved. See
  58170. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58171. // for more information.
  58172. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  58173. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58174. return c
  58175. }
  58176. // IfNoneMatch sets the optional parameter which makes the operation
  58177. // fail if the object's ETag matches the given value. This is useful for
  58178. // getting updates only after the object has changed since the last
  58179. // request. Use googleapi.IsNotModified to check whether the response
  58180. // error from Do is the result of In-None-Match.
  58181. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  58182. c.ifNoneMatch_ = entityTag
  58183. return c
  58184. }
  58185. // Context sets the context to be used in this call's Do method. Any
  58186. // pending HTTP request will be aborted if the provided context is
  58187. // canceled.
  58188. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  58189. c.ctx_ = ctx
  58190. return c
  58191. }
  58192. // Header returns an http.Header that can be modified by the caller to
  58193. // add HTTP headers to the request.
  58194. func (c *HealthChecksListCall) Header() http.Header {
  58195. if c.header_ == nil {
  58196. c.header_ = make(http.Header)
  58197. }
  58198. return c.header_
  58199. }
  58200. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  58201. reqHeaders := make(http.Header)
  58202. for k, v := range c.header_ {
  58203. reqHeaders[k] = v
  58204. }
  58205. reqHeaders.Set("User-Agent", c.s.userAgent())
  58206. if c.ifNoneMatch_ != "" {
  58207. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58208. }
  58209. var body io.Reader = nil
  58210. c.urlParams_.Set("alt", alt)
  58211. c.urlParams_.Set("prettyPrint", "false")
  58212. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  58213. urls += "?" + c.urlParams_.Encode()
  58214. req, err := http.NewRequest("GET", urls, body)
  58215. if err != nil {
  58216. return nil, err
  58217. }
  58218. req.Header = reqHeaders
  58219. googleapi.Expand(req.URL, map[string]string{
  58220. "project": c.project,
  58221. })
  58222. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58223. }
  58224. // Do executes the "compute.healthChecks.list" call.
  58225. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  58226. // status code is an error. Response headers are in either
  58227. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  58228. // at all) in error.(*googleapi.Error).Header. Use
  58229. // googleapi.IsNotModified to check whether the returned error was
  58230. // because http.StatusNotModified was returned.
  58231. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  58232. gensupport.SetOptions(c.urlParams_, opts...)
  58233. res, err := c.doRequest("json")
  58234. if res != nil && res.StatusCode == http.StatusNotModified {
  58235. if res.Body != nil {
  58236. res.Body.Close()
  58237. }
  58238. return nil, &googleapi.Error{
  58239. Code: res.StatusCode,
  58240. Header: res.Header,
  58241. }
  58242. }
  58243. if err != nil {
  58244. return nil, err
  58245. }
  58246. defer googleapi.CloseBody(res)
  58247. if err := googleapi.CheckResponse(res); err != nil {
  58248. return nil, err
  58249. }
  58250. ret := &HealthCheckList{
  58251. ServerResponse: googleapi.ServerResponse{
  58252. Header: res.Header,
  58253. HTTPStatusCode: res.StatusCode,
  58254. },
  58255. }
  58256. target := &ret
  58257. if err := gensupport.DecodeResponse(target, res); err != nil {
  58258. return nil, err
  58259. }
  58260. return ret, nil
  58261. // {
  58262. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  58263. // "httpMethod": "GET",
  58264. // "id": "compute.healthChecks.list",
  58265. // "parameterOrder": [
  58266. // "project"
  58267. // ],
  58268. // "parameters": {
  58269. // "filter": {
  58270. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  58271. // "location": "query",
  58272. // "type": "string"
  58273. // },
  58274. // "maxResults": {
  58275. // "default": "500",
  58276. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  58277. // "format": "uint32",
  58278. // "location": "query",
  58279. // "minimum": "0",
  58280. // "type": "integer"
  58281. // },
  58282. // "orderBy": {
  58283. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  58284. // "location": "query",
  58285. // "type": "string"
  58286. // },
  58287. // "pageToken": {
  58288. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  58289. // "location": "query",
  58290. // "type": "string"
  58291. // },
  58292. // "project": {
  58293. // "description": "Project ID for this request.",
  58294. // "location": "path",
  58295. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58296. // "required": true,
  58297. // "type": "string"
  58298. // }
  58299. // },
  58300. // "path": "{project}/global/healthChecks",
  58301. // "response": {
  58302. // "$ref": "HealthCheckList"
  58303. // },
  58304. // "scopes": [
  58305. // "https://www.googleapis.com/auth/cloud-platform",
  58306. // "https://www.googleapis.com/auth/compute",
  58307. // "https://www.googleapis.com/auth/compute.readonly"
  58308. // ]
  58309. // }
  58310. }
  58311. // Pages invokes f for each page of results.
  58312. // A non-nil error returned from f will halt the iteration.
  58313. // The provided context supersedes any context provided to the Context method.
  58314. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  58315. c.ctx_ = ctx
  58316. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58317. for {
  58318. x, err := c.Do()
  58319. if err != nil {
  58320. return err
  58321. }
  58322. if err := f(x); err != nil {
  58323. return err
  58324. }
  58325. if x.NextPageToken == "" {
  58326. return nil
  58327. }
  58328. c.PageToken(x.NextPageToken)
  58329. }
  58330. }
  58331. // method id "compute.healthChecks.patch":
  58332. type HealthChecksPatchCall struct {
  58333. s *Service
  58334. project string
  58335. healthCheck string
  58336. healthcheck *HealthCheck
  58337. urlParams_ gensupport.URLParams
  58338. ctx_ context.Context
  58339. header_ http.Header
  58340. }
  58341. // Patch: Updates a HealthCheck resource in the specified project using
  58342. // the data included in the request. This method supports PATCH
  58343. // semantics and uses the JSON merge patch format and processing rules.
  58344. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  58345. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58346. c.project = project
  58347. c.healthCheck = healthCheck
  58348. c.healthcheck = healthcheck
  58349. return c
  58350. }
  58351. // RequestId sets the optional parameter "requestId": An optional
  58352. // request ID to identify requests. Specify a unique request ID so that
  58353. // if you must retry your request, the server will know to ignore the
  58354. // request if it has already been completed.
  58355. //
  58356. // For example, consider a situation where you make an initial request
  58357. // and the request times out. If you make the request again with the
  58358. // same request ID, the server can check if original operation with the
  58359. // same request ID was received, and if so, will ignore the second
  58360. // request. This prevents clients from accidentally creating duplicate
  58361. // commitments.
  58362. //
  58363. // The request ID must be a valid UUID with the exception that zero UUID
  58364. // is not supported (00000000-0000-0000-0000-000000000000).
  58365. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  58366. c.urlParams_.Set("requestId", requestId)
  58367. return c
  58368. }
  58369. // Fields allows partial responses to be retrieved. See
  58370. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58371. // for more information.
  58372. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  58373. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58374. return c
  58375. }
  58376. // Context sets the context to be used in this call's Do method. Any
  58377. // pending HTTP request will be aborted if the provided context is
  58378. // canceled.
  58379. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  58380. c.ctx_ = ctx
  58381. return c
  58382. }
  58383. // Header returns an http.Header that can be modified by the caller to
  58384. // add HTTP headers to the request.
  58385. func (c *HealthChecksPatchCall) Header() http.Header {
  58386. if c.header_ == nil {
  58387. c.header_ = make(http.Header)
  58388. }
  58389. return c.header_
  58390. }
  58391. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  58392. reqHeaders := make(http.Header)
  58393. for k, v := range c.header_ {
  58394. reqHeaders[k] = v
  58395. }
  58396. reqHeaders.Set("User-Agent", c.s.userAgent())
  58397. var body io.Reader = nil
  58398. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  58399. if err != nil {
  58400. return nil, err
  58401. }
  58402. reqHeaders.Set("Content-Type", "application/json")
  58403. c.urlParams_.Set("alt", alt)
  58404. c.urlParams_.Set("prettyPrint", "false")
  58405. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  58406. urls += "?" + c.urlParams_.Encode()
  58407. req, err := http.NewRequest("PATCH", urls, body)
  58408. if err != nil {
  58409. return nil, err
  58410. }
  58411. req.Header = reqHeaders
  58412. googleapi.Expand(req.URL, map[string]string{
  58413. "project": c.project,
  58414. "healthCheck": c.healthCheck,
  58415. })
  58416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58417. }
  58418. // Do executes the "compute.healthChecks.patch" call.
  58419. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58420. // status code is an error. Response headers are in either
  58421. // *Operation.ServerResponse.Header or (if a response was returned at
  58422. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58423. // to check whether the returned error was because
  58424. // http.StatusNotModified was returned.
  58425. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58426. gensupport.SetOptions(c.urlParams_, opts...)
  58427. res, err := c.doRequest("json")
  58428. if res != nil && res.StatusCode == http.StatusNotModified {
  58429. if res.Body != nil {
  58430. res.Body.Close()
  58431. }
  58432. return nil, &googleapi.Error{
  58433. Code: res.StatusCode,
  58434. Header: res.Header,
  58435. }
  58436. }
  58437. if err != nil {
  58438. return nil, err
  58439. }
  58440. defer googleapi.CloseBody(res)
  58441. if err := googleapi.CheckResponse(res); err != nil {
  58442. return nil, err
  58443. }
  58444. ret := &Operation{
  58445. ServerResponse: googleapi.ServerResponse{
  58446. Header: res.Header,
  58447. HTTPStatusCode: res.StatusCode,
  58448. },
  58449. }
  58450. target := &ret
  58451. if err := gensupport.DecodeResponse(target, res); err != nil {
  58452. return nil, err
  58453. }
  58454. return ret, nil
  58455. // {
  58456. // "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.",
  58457. // "httpMethod": "PATCH",
  58458. // "id": "compute.healthChecks.patch",
  58459. // "parameterOrder": [
  58460. // "project",
  58461. // "healthCheck"
  58462. // ],
  58463. // "parameters": {
  58464. // "healthCheck": {
  58465. // "description": "Name of the HealthCheck resource to patch.",
  58466. // "location": "path",
  58467. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58468. // "required": true,
  58469. // "type": "string"
  58470. // },
  58471. // "project": {
  58472. // "description": "Project ID for this request.",
  58473. // "location": "path",
  58474. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58475. // "required": true,
  58476. // "type": "string"
  58477. // },
  58478. // "requestId": {
  58479. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58480. // "location": "query",
  58481. // "type": "string"
  58482. // }
  58483. // },
  58484. // "path": "{project}/global/healthChecks/{healthCheck}",
  58485. // "request": {
  58486. // "$ref": "HealthCheck"
  58487. // },
  58488. // "response": {
  58489. // "$ref": "Operation"
  58490. // },
  58491. // "scopes": [
  58492. // "https://www.googleapis.com/auth/cloud-platform",
  58493. // "https://www.googleapis.com/auth/compute"
  58494. // ]
  58495. // }
  58496. }
  58497. // method id "compute.healthChecks.testIamPermissions":
  58498. type HealthChecksTestIamPermissionsCall struct {
  58499. s *Service
  58500. project string
  58501. resource string
  58502. testpermissionsrequest *TestPermissionsRequest
  58503. urlParams_ gensupport.URLParams
  58504. ctx_ context.Context
  58505. header_ http.Header
  58506. }
  58507. // TestIamPermissions: Returns permissions that a caller has on the
  58508. // specified resource.
  58509. func (r *HealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HealthChecksTestIamPermissionsCall {
  58510. c := &HealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58511. c.project = project
  58512. c.resource = resource
  58513. c.testpermissionsrequest = testpermissionsrequest
  58514. return c
  58515. }
  58516. // Fields allows partial responses to be retrieved. See
  58517. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58518. // for more information.
  58519. func (c *HealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HealthChecksTestIamPermissionsCall {
  58520. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58521. return c
  58522. }
  58523. // Context sets the context to be used in this call's Do method. Any
  58524. // pending HTTP request will be aborted if the provided context is
  58525. // canceled.
  58526. func (c *HealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HealthChecksTestIamPermissionsCall {
  58527. c.ctx_ = ctx
  58528. return c
  58529. }
  58530. // Header returns an http.Header that can be modified by the caller to
  58531. // add HTTP headers to the request.
  58532. func (c *HealthChecksTestIamPermissionsCall) Header() http.Header {
  58533. if c.header_ == nil {
  58534. c.header_ = make(http.Header)
  58535. }
  58536. return c.header_
  58537. }
  58538. func (c *HealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  58539. reqHeaders := make(http.Header)
  58540. for k, v := range c.header_ {
  58541. reqHeaders[k] = v
  58542. }
  58543. reqHeaders.Set("User-Agent", c.s.userAgent())
  58544. var body io.Reader = nil
  58545. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  58546. if err != nil {
  58547. return nil, err
  58548. }
  58549. reqHeaders.Set("Content-Type", "application/json")
  58550. c.urlParams_.Set("alt", alt)
  58551. c.urlParams_.Set("prettyPrint", "false")
  58552. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{resource}/testIamPermissions")
  58553. urls += "?" + c.urlParams_.Encode()
  58554. req, err := http.NewRequest("POST", urls, body)
  58555. if err != nil {
  58556. return nil, err
  58557. }
  58558. req.Header = reqHeaders
  58559. googleapi.Expand(req.URL, map[string]string{
  58560. "project": c.project,
  58561. "resource": c.resource,
  58562. })
  58563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58564. }
  58565. // Do executes the "compute.healthChecks.testIamPermissions" call.
  58566. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  58567. // non-2xx status code is an error. Response headers are in either
  58568. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  58569. // returned at all) in error.(*googleapi.Error).Header. Use
  58570. // googleapi.IsNotModified to check whether the returned error was
  58571. // because http.StatusNotModified was returned.
  58572. func (c *HealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  58573. gensupport.SetOptions(c.urlParams_, opts...)
  58574. res, err := c.doRequest("json")
  58575. if res != nil && res.StatusCode == http.StatusNotModified {
  58576. if res.Body != nil {
  58577. res.Body.Close()
  58578. }
  58579. return nil, &googleapi.Error{
  58580. Code: res.StatusCode,
  58581. Header: res.Header,
  58582. }
  58583. }
  58584. if err != nil {
  58585. return nil, err
  58586. }
  58587. defer googleapi.CloseBody(res)
  58588. if err := googleapi.CheckResponse(res); err != nil {
  58589. return nil, err
  58590. }
  58591. ret := &TestPermissionsResponse{
  58592. ServerResponse: googleapi.ServerResponse{
  58593. Header: res.Header,
  58594. HTTPStatusCode: res.StatusCode,
  58595. },
  58596. }
  58597. target := &ret
  58598. if err := gensupport.DecodeResponse(target, res); err != nil {
  58599. return nil, err
  58600. }
  58601. return ret, nil
  58602. // {
  58603. // "description": "Returns permissions that a caller has on the specified resource.",
  58604. // "httpMethod": "POST",
  58605. // "id": "compute.healthChecks.testIamPermissions",
  58606. // "parameterOrder": [
  58607. // "project",
  58608. // "resource"
  58609. // ],
  58610. // "parameters": {
  58611. // "project": {
  58612. // "description": "Project ID for this request.",
  58613. // "location": "path",
  58614. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58615. // "required": true,
  58616. // "type": "string"
  58617. // },
  58618. // "resource": {
  58619. // "description": "Name or id of the resource for this request.",
  58620. // "location": "path",
  58621. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58622. // "required": true,
  58623. // "type": "string"
  58624. // }
  58625. // },
  58626. // "path": "{project}/global/healthChecks/{resource}/testIamPermissions",
  58627. // "request": {
  58628. // "$ref": "TestPermissionsRequest"
  58629. // },
  58630. // "response": {
  58631. // "$ref": "TestPermissionsResponse"
  58632. // },
  58633. // "scopes": [
  58634. // "https://www.googleapis.com/auth/cloud-platform",
  58635. // "https://www.googleapis.com/auth/compute",
  58636. // "https://www.googleapis.com/auth/compute.readonly"
  58637. // ]
  58638. // }
  58639. }
  58640. // method id "compute.healthChecks.update":
  58641. type HealthChecksUpdateCall struct {
  58642. s *Service
  58643. project string
  58644. healthCheck string
  58645. healthcheck *HealthCheck
  58646. urlParams_ gensupport.URLParams
  58647. ctx_ context.Context
  58648. header_ http.Header
  58649. }
  58650. // Update: Updates a HealthCheck resource in the specified project using
  58651. // the data included in the request.
  58652. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  58653. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58654. c.project = project
  58655. c.healthCheck = healthCheck
  58656. c.healthcheck = healthcheck
  58657. return c
  58658. }
  58659. // RequestId sets the optional parameter "requestId": An optional
  58660. // request ID to identify requests. Specify a unique request ID so that
  58661. // if you must retry your request, the server will know to ignore the
  58662. // request if it has already been completed.
  58663. //
  58664. // For example, consider a situation where you make an initial request
  58665. // and the request times out. If you make the request again with the
  58666. // same request ID, the server can check if original operation with the
  58667. // same request ID was received, and if so, will ignore the second
  58668. // request. This prevents clients from accidentally creating duplicate
  58669. // commitments.
  58670. //
  58671. // The request ID must be a valid UUID with the exception that zero UUID
  58672. // is not supported (00000000-0000-0000-0000-000000000000).
  58673. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  58674. c.urlParams_.Set("requestId", requestId)
  58675. return c
  58676. }
  58677. // Fields allows partial responses to be retrieved. See
  58678. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58679. // for more information.
  58680. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  58681. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58682. return c
  58683. }
  58684. // Context sets the context to be used in this call's Do method. Any
  58685. // pending HTTP request will be aborted if the provided context is
  58686. // canceled.
  58687. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  58688. c.ctx_ = ctx
  58689. return c
  58690. }
  58691. // Header returns an http.Header that can be modified by the caller to
  58692. // add HTTP headers to the request.
  58693. func (c *HealthChecksUpdateCall) Header() http.Header {
  58694. if c.header_ == nil {
  58695. c.header_ = make(http.Header)
  58696. }
  58697. return c.header_
  58698. }
  58699. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  58700. reqHeaders := make(http.Header)
  58701. for k, v := range c.header_ {
  58702. reqHeaders[k] = v
  58703. }
  58704. reqHeaders.Set("User-Agent", c.s.userAgent())
  58705. var body io.Reader = nil
  58706. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  58707. if err != nil {
  58708. return nil, err
  58709. }
  58710. reqHeaders.Set("Content-Type", "application/json")
  58711. c.urlParams_.Set("alt", alt)
  58712. c.urlParams_.Set("prettyPrint", "false")
  58713. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  58714. urls += "?" + c.urlParams_.Encode()
  58715. req, err := http.NewRequest("PUT", urls, body)
  58716. if err != nil {
  58717. return nil, err
  58718. }
  58719. req.Header = reqHeaders
  58720. googleapi.Expand(req.URL, map[string]string{
  58721. "project": c.project,
  58722. "healthCheck": c.healthCheck,
  58723. })
  58724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58725. }
  58726. // Do executes the "compute.healthChecks.update" call.
  58727. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58728. // status code is an error. Response headers are in either
  58729. // *Operation.ServerResponse.Header or (if a response was returned at
  58730. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58731. // to check whether the returned error was because
  58732. // http.StatusNotModified was returned.
  58733. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58734. gensupport.SetOptions(c.urlParams_, opts...)
  58735. res, err := c.doRequest("json")
  58736. if res != nil && res.StatusCode == http.StatusNotModified {
  58737. if res.Body != nil {
  58738. res.Body.Close()
  58739. }
  58740. return nil, &googleapi.Error{
  58741. Code: res.StatusCode,
  58742. Header: res.Header,
  58743. }
  58744. }
  58745. if err != nil {
  58746. return nil, err
  58747. }
  58748. defer googleapi.CloseBody(res)
  58749. if err := googleapi.CheckResponse(res); err != nil {
  58750. return nil, err
  58751. }
  58752. ret := &Operation{
  58753. ServerResponse: googleapi.ServerResponse{
  58754. Header: res.Header,
  58755. HTTPStatusCode: res.StatusCode,
  58756. },
  58757. }
  58758. target := &ret
  58759. if err := gensupport.DecodeResponse(target, res); err != nil {
  58760. return nil, err
  58761. }
  58762. return ret, nil
  58763. // {
  58764. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  58765. // "httpMethod": "PUT",
  58766. // "id": "compute.healthChecks.update",
  58767. // "parameterOrder": [
  58768. // "project",
  58769. // "healthCheck"
  58770. // ],
  58771. // "parameters": {
  58772. // "healthCheck": {
  58773. // "description": "Name of the HealthCheck resource to update.",
  58774. // "location": "path",
  58775. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58776. // "required": true,
  58777. // "type": "string"
  58778. // },
  58779. // "project": {
  58780. // "description": "Project ID for this request.",
  58781. // "location": "path",
  58782. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58783. // "required": true,
  58784. // "type": "string"
  58785. // },
  58786. // "requestId": {
  58787. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58788. // "location": "query",
  58789. // "type": "string"
  58790. // }
  58791. // },
  58792. // "path": "{project}/global/healthChecks/{healthCheck}",
  58793. // "request": {
  58794. // "$ref": "HealthCheck"
  58795. // },
  58796. // "response": {
  58797. // "$ref": "Operation"
  58798. // },
  58799. // "scopes": [
  58800. // "https://www.googleapis.com/auth/cloud-platform",
  58801. // "https://www.googleapis.com/auth/compute"
  58802. // ]
  58803. // }
  58804. }
  58805. // method id "compute.httpHealthChecks.delete":
  58806. type HttpHealthChecksDeleteCall struct {
  58807. s *Service
  58808. project string
  58809. httpHealthCheck string
  58810. urlParams_ gensupport.URLParams
  58811. ctx_ context.Context
  58812. header_ http.Header
  58813. }
  58814. // Delete: Deletes the specified HttpHealthCheck resource.
  58815. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  58816. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  58817. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58818. c.project = project
  58819. c.httpHealthCheck = httpHealthCheck
  58820. return c
  58821. }
  58822. // RequestId sets the optional parameter "requestId": An optional
  58823. // request ID to identify requests. Specify a unique request ID so that
  58824. // if you must retry your request, the server will know to ignore the
  58825. // request if it has already been completed.
  58826. //
  58827. // For example, consider a situation where you make an initial request
  58828. // and the request times out. If you make the request again with the
  58829. // same request ID, the server can check if original operation with the
  58830. // same request ID was received, and if so, will ignore the second
  58831. // request. This prevents clients from accidentally creating duplicate
  58832. // commitments.
  58833. //
  58834. // The request ID must be a valid UUID with the exception that zero UUID
  58835. // is not supported (00000000-0000-0000-0000-000000000000).
  58836. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  58837. c.urlParams_.Set("requestId", requestId)
  58838. return c
  58839. }
  58840. // Fields allows partial responses to be retrieved. See
  58841. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58842. // for more information.
  58843. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  58844. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58845. return c
  58846. }
  58847. // Context sets the context to be used in this call's Do method. Any
  58848. // pending HTTP request will be aborted if the provided context is
  58849. // canceled.
  58850. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  58851. c.ctx_ = ctx
  58852. return c
  58853. }
  58854. // Header returns an http.Header that can be modified by the caller to
  58855. // add HTTP headers to the request.
  58856. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  58857. if c.header_ == nil {
  58858. c.header_ = make(http.Header)
  58859. }
  58860. return c.header_
  58861. }
  58862. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  58863. reqHeaders := make(http.Header)
  58864. for k, v := range c.header_ {
  58865. reqHeaders[k] = v
  58866. }
  58867. reqHeaders.Set("User-Agent", c.s.userAgent())
  58868. var body io.Reader = nil
  58869. c.urlParams_.Set("alt", alt)
  58870. c.urlParams_.Set("prettyPrint", "false")
  58871. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  58872. urls += "?" + c.urlParams_.Encode()
  58873. req, err := http.NewRequest("DELETE", urls, body)
  58874. if err != nil {
  58875. return nil, err
  58876. }
  58877. req.Header = reqHeaders
  58878. googleapi.Expand(req.URL, map[string]string{
  58879. "project": c.project,
  58880. "httpHealthCheck": c.httpHealthCheck,
  58881. })
  58882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58883. }
  58884. // Do executes the "compute.httpHealthChecks.delete" call.
  58885. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58886. // status code is an error. Response headers are in either
  58887. // *Operation.ServerResponse.Header or (if a response was returned at
  58888. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58889. // to check whether the returned error was because
  58890. // http.StatusNotModified was returned.
  58891. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58892. gensupport.SetOptions(c.urlParams_, opts...)
  58893. res, err := c.doRequest("json")
  58894. if res != nil && res.StatusCode == http.StatusNotModified {
  58895. if res.Body != nil {
  58896. res.Body.Close()
  58897. }
  58898. return nil, &googleapi.Error{
  58899. Code: res.StatusCode,
  58900. Header: res.Header,
  58901. }
  58902. }
  58903. if err != nil {
  58904. return nil, err
  58905. }
  58906. defer googleapi.CloseBody(res)
  58907. if err := googleapi.CheckResponse(res); err != nil {
  58908. return nil, err
  58909. }
  58910. ret := &Operation{
  58911. ServerResponse: googleapi.ServerResponse{
  58912. Header: res.Header,
  58913. HTTPStatusCode: res.StatusCode,
  58914. },
  58915. }
  58916. target := &ret
  58917. if err := gensupport.DecodeResponse(target, res); err != nil {
  58918. return nil, err
  58919. }
  58920. return ret, nil
  58921. // {
  58922. // "description": "Deletes the specified HttpHealthCheck resource.",
  58923. // "httpMethod": "DELETE",
  58924. // "id": "compute.httpHealthChecks.delete",
  58925. // "parameterOrder": [
  58926. // "project",
  58927. // "httpHealthCheck"
  58928. // ],
  58929. // "parameters": {
  58930. // "httpHealthCheck": {
  58931. // "description": "Name of the HttpHealthCheck resource to delete.",
  58932. // "location": "path",
  58933. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58934. // "required": true,
  58935. // "type": "string"
  58936. // },
  58937. // "project": {
  58938. // "description": "Project ID for this request.",
  58939. // "location": "path",
  58940. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58941. // "required": true,
  58942. // "type": "string"
  58943. // },
  58944. // "requestId": {
  58945. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58946. // "location": "query",
  58947. // "type": "string"
  58948. // }
  58949. // },
  58950. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  58951. // "response": {
  58952. // "$ref": "Operation"
  58953. // },
  58954. // "scopes": [
  58955. // "https://www.googleapis.com/auth/cloud-platform",
  58956. // "https://www.googleapis.com/auth/compute"
  58957. // ]
  58958. // }
  58959. }
  58960. // method id "compute.httpHealthChecks.get":
  58961. type HttpHealthChecksGetCall struct {
  58962. s *Service
  58963. project string
  58964. httpHealthCheck string
  58965. urlParams_ gensupport.URLParams
  58966. ifNoneMatch_ string
  58967. ctx_ context.Context
  58968. header_ http.Header
  58969. }
  58970. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  58971. // available HTTP health checks by making a list() request.
  58972. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  58973. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  58974. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58975. c.project = project
  58976. c.httpHealthCheck = httpHealthCheck
  58977. return c
  58978. }
  58979. // Fields allows partial responses to be retrieved. See
  58980. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58981. // for more information.
  58982. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  58983. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58984. return c
  58985. }
  58986. // IfNoneMatch sets the optional parameter which makes the operation
  58987. // fail if the object's ETag matches the given value. This is useful for
  58988. // getting updates only after the object has changed since the last
  58989. // request. Use googleapi.IsNotModified to check whether the response
  58990. // error from Do is the result of In-None-Match.
  58991. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  58992. c.ifNoneMatch_ = entityTag
  58993. return c
  58994. }
  58995. // Context sets the context to be used in this call's Do method. Any
  58996. // pending HTTP request will be aborted if the provided context is
  58997. // canceled.
  58998. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  58999. c.ctx_ = ctx
  59000. return c
  59001. }
  59002. // Header returns an http.Header that can be modified by the caller to
  59003. // add HTTP headers to the request.
  59004. func (c *HttpHealthChecksGetCall) Header() http.Header {
  59005. if c.header_ == nil {
  59006. c.header_ = make(http.Header)
  59007. }
  59008. return c.header_
  59009. }
  59010. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  59011. reqHeaders := make(http.Header)
  59012. for k, v := range c.header_ {
  59013. reqHeaders[k] = v
  59014. }
  59015. reqHeaders.Set("User-Agent", c.s.userAgent())
  59016. if c.ifNoneMatch_ != "" {
  59017. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59018. }
  59019. var body io.Reader = nil
  59020. c.urlParams_.Set("alt", alt)
  59021. c.urlParams_.Set("prettyPrint", "false")
  59022. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  59023. urls += "?" + c.urlParams_.Encode()
  59024. req, err := http.NewRequest("GET", urls, body)
  59025. if err != nil {
  59026. return nil, err
  59027. }
  59028. req.Header = reqHeaders
  59029. googleapi.Expand(req.URL, map[string]string{
  59030. "project": c.project,
  59031. "httpHealthCheck": c.httpHealthCheck,
  59032. })
  59033. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59034. }
  59035. // Do executes the "compute.httpHealthChecks.get" call.
  59036. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  59037. // status code is an error. Response headers are in either
  59038. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  59039. // at all) in error.(*googleapi.Error).Header. Use
  59040. // googleapi.IsNotModified to check whether the returned error was
  59041. // because http.StatusNotModified was returned.
  59042. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  59043. gensupport.SetOptions(c.urlParams_, opts...)
  59044. res, err := c.doRequest("json")
  59045. if res != nil && res.StatusCode == http.StatusNotModified {
  59046. if res.Body != nil {
  59047. res.Body.Close()
  59048. }
  59049. return nil, &googleapi.Error{
  59050. Code: res.StatusCode,
  59051. Header: res.Header,
  59052. }
  59053. }
  59054. if err != nil {
  59055. return nil, err
  59056. }
  59057. defer googleapi.CloseBody(res)
  59058. if err := googleapi.CheckResponse(res); err != nil {
  59059. return nil, err
  59060. }
  59061. ret := &HttpHealthCheck{
  59062. ServerResponse: googleapi.ServerResponse{
  59063. Header: res.Header,
  59064. HTTPStatusCode: res.StatusCode,
  59065. },
  59066. }
  59067. target := &ret
  59068. if err := gensupport.DecodeResponse(target, res); err != nil {
  59069. return nil, err
  59070. }
  59071. return ret, nil
  59072. // {
  59073. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  59074. // "httpMethod": "GET",
  59075. // "id": "compute.httpHealthChecks.get",
  59076. // "parameterOrder": [
  59077. // "project",
  59078. // "httpHealthCheck"
  59079. // ],
  59080. // "parameters": {
  59081. // "httpHealthCheck": {
  59082. // "description": "Name of the HttpHealthCheck resource to return.",
  59083. // "location": "path",
  59084. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59085. // "required": true,
  59086. // "type": "string"
  59087. // },
  59088. // "project": {
  59089. // "description": "Project ID for this request.",
  59090. // "location": "path",
  59091. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59092. // "required": true,
  59093. // "type": "string"
  59094. // }
  59095. // },
  59096. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  59097. // "response": {
  59098. // "$ref": "HttpHealthCheck"
  59099. // },
  59100. // "scopes": [
  59101. // "https://www.googleapis.com/auth/cloud-platform",
  59102. // "https://www.googleapis.com/auth/compute",
  59103. // "https://www.googleapis.com/auth/compute.readonly"
  59104. // ]
  59105. // }
  59106. }
  59107. // method id "compute.httpHealthChecks.insert":
  59108. type HttpHealthChecksInsertCall struct {
  59109. s *Service
  59110. project string
  59111. httphealthcheck *HttpHealthCheck
  59112. urlParams_ gensupport.URLParams
  59113. ctx_ context.Context
  59114. header_ http.Header
  59115. }
  59116. // Insert: Creates a HttpHealthCheck resource in the specified project
  59117. // using the data included in the request.
  59118. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  59119. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  59120. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59121. c.project = project
  59122. c.httphealthcheck = httphealthcheck
  59123. return c
  59124. }
  59125. // RequestId sets the optional parameter "requestId": An optional
  59126. // request ID to identify requests. Specify a unique request ID so that
  59127. // if you must retry your request, the server will know to ignore the
  59128. // request if it has already been completed.
  59129. //
  59130. // For example, consider a situation where you make an initial request
  59131. // and the request times out. If you make the request again with the
  59132. // same request ID, the server can check if original operation with the
  59133. // same request ID was received, and if so, will ignore the second
  59134. // request. This prevents clients from accidentally creating duplicate
  59135. // commitments.
  59136. //
  59137. // The request ID must be a valid UUID with the exception that zero UUID
  59138. // is not supported (00000000-0000-0000-0000-000000000000).
  59139. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  59140. c.urlParams_.Set("requestId", requestId)
  59141. return c
  59142. }
  59143. // Fields allows partial responses to be retrieved. See
  59144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59145. // for more information.
  59146. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  59147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59148. return c
  59149. }
  59150. // Context sets the context to be used in this call's Do method. Any
  59151. // pending HTTP request will be aborted if the provided context is
  59152. // canceled.
  59153. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  59154. c.ctx_ = ctx
  59155. return c
  59156. }
  59157. // Header returns an http.Header that can be modified by the caller to
  59158. // add HTTP headers to the request.
  59159. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  59160. if c.header_ == nil {
  59161. c.header_ = make(http.Header)
  59162. }
  59163. return c.header_
  59164. }
  59165. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  59166. reqHeaders := make(http.Header)
  59167. for k, v := range c.header_ {
  59168. reqHeaders[k] = v
  59169. }
  59170. reqHeaders.Set("User-Agent", c.s.userAgent())
  59171. var body io.Reader = nil
  59172. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  59173. if err != nil {
  59174. return nil, err
  59175. }
  59176. reqHeaders.Set("Content-Type", "application/json")
  59177. c.urlParams_.Set("alt", alt)
  59178. c.urlParams_.Set("prettyPrint", "false")
  59179. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  59180. urls += "?" + c.urlParams_.Encode()
  59181. req, err := http.NewRequest("POST", urls, body)
  59182. if err != nil {
  59183. return nil, err
  59184. }
  59185. req.Header = reqHeaders
  59186. googleapi.Expand(req.URL, map[string]string{
  59187. "project": c.project,
  59188. })
  59189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59190. }
  59191. // Do executes the "compute.httpHealthChecks.insert" call.
  59192. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59193. // status code is an error. Response headers are in either
  59194. // *Operation.ServerResponse.Header or (if a response was returned at
  59195. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59196. // to check whether the returned error was because
  59197. // http.StatusNotModified was returned.
  59198. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59199. gensupport.SetOptions(c.urlParams_, opts...)
  59200. res, err := c.doRequest("json")
  59201. if res != nil && res.StatusCode == http.StatusNotModified {
  59202. if res.Body != nil {
  59203. res.Body.Close()
  59204. }
  59205. return nil, &googleapi.Error{
  59206. Code: res.StatusCode,
  59207. Header: res.Header,
  59208. }
  59209. }
  59210. if err != nil {
  59211. return nil, err
  59212. }
  59213. defer googleapi.CloseBody(res)
  59214. if err := googleapi.CheckResponse(res); err != nil {
  59215. return nil, err
  59216. }
  59217. ret := &Operation{
  59218. ServerResponse: googleapi.ServerResponse{
  59219. Header: res.Header,
  59220. HTTPStatusCode: res.StatusCode,
  59221. },
  59222. }
  59223. target := &ret
  59224. if err := gensupport.DecodeResponse(target, res); err != nil {
  59225. return nil, err
  59226. }
  59227. return ret, nil
  59228. // {
  59229. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  59230. // "httpMethod": "POST",
  59231. // "id": "compute.httpHealthChecks.insert",
  59232. // "parameterOrder": [
  59233. // "project"
  59234. // ],
  59235. // "parameters": {
  59236. // "project": {
  59237. // "description": "Project ID for this request.",
  59238. // "location": "path",
  59239. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59240. // "required": true,
  59241. // "type": "string"
  59242. // },
  59243. // "requestId": {
  59244. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59245. // "location": "query",
  59246. // "type": "string"
  59247. // }
  59248. // },
  59249. // "path": "{project}/global/httpHealthChecks",
  59250. // "request": {
  59251. // "$ref": "HttpHealthCheck"
  59252. // },
  59253. // "response": {
  59254. // "$ref": "Operation"
  59255. // },
  59256. // "scopes": [
  59257. // "https://www.googleapis.com/auth/cloud-platform",
  59258. // "https://www.googleapis.com/auth/compute"
  59259. // ]
  59260. // }
  59261. }
  59262. // method id "compute.httpHealthChecks.list":
  59263. type HttpHealthChecksListCall struct {
  59264. s *Service
  59265. project string
  59266. urlParams_ gensupport.URLParams
  59267. ifNoneMatch_ string
  59268. ctx_ context.Context
  59269. header_ http.Header
  59270. }
  59271. // List: Retrieves the list of HttpHealthCheck resources available to
  59272. // the specified project.
  59273. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  59274. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  59275. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59276. c.project = project
  59277. return c
  59278. }
  59279. // Filter sets the optional parameter "filter": A filter expression that
  59280. // filters resources listed in the response. The expression must specify
  59281. // the field name, a comparison operator, and the value that you want to
  59282. // use for filtering. The value must be a string, a number, or a
  59283. // boolean. The comparison operator must be either =, !=, >, or <.
  59284. //
  59285. // For example, if you are filtering Compute Engine instances, you can
  59286. // exclude instances named example-instance by specifying name !=
  59287. // example-instance.
  59288. //
  59289. // You can also filter nested fields. For example, you could specify
  59290. // scheduling.automaticRestart = false to include instances only if they
  59291. // are not scheduled for automatic restarts. You can use filtering on
  59292. // nested fields to filter based on resource labels.
  59293. //
  59294. // To filter on multiple expressions, provide each separate expression
  59295. // within parentheses. For example, (scheduling.automaticRestart = true)
  59296. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59297. // AND expression. However, you can include AND and OR expressions
  59298. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59299. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59300. // true).
  59301. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  59302. c.urlParams_.Set("filter", filter)
  59303. return c
  59304. }
  59305. // MaxResults sets the optional parameter "maxResults": The maximum
  59306. // number of results per page that should be returned. If the number of
  59307. // available results is larger than maxResults, Compute Engine returns a
  59308. // nextPageToken that can be used to get the next page of results in
  59309. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59310. // (Default: 500)
  59311. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  59312. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59313. return c
  59314. }
  59315. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59316. // a certain order. By default, results are returned in alphanumerical
  59317. // order based on the resource name.
  59318. //
  59319. // You can also sort results in descending order based on the creation
  59320. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59321. // based on the creationTimestamp field in reverse chronological order
  59322. // (newest result first). Use this to sort resources like operations so
  59323. // that the newest operation is returned first.
  59324. //
  59325. // Currently, only sorting by name or creationTimestamp desc is
  59326. // supported.
  59327. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  59328. c.urlParams_.Set("orderBy", orderBy)
  59329. return c
  59330. }
  59331. // PageToken sets the optional parameter "pageToken": Specifies a page
  59332. // token to use. Set pageToken to the nextPageToken returned by a
  59333. // previous list request to get the next page of results.
  59334. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  59335. c.urlParams_.Set("pageToken", pageToken)
  59336. return c
  59337. }
  59338. // Fields allows partial responses to be retrieved. See
  59339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59340. // for more information.
  59341. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  59342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59343. return c
  59344. }
  59345. // IfNoneMatch sets the optional parameter which makes the operation
  59346. // fail if the object's ETag matches the given value. This is useful for
  59347. // getting updates only after the object has changed since the last
  59348. // request. Use googleapi.IsNotModified to check whether the response
  59349. // error from Do is the result of In-None-Match.
  59350. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  59351. c.ifNoneMatch_ = entityTag
  59352. return c
  59353. }
  59354. // Context sets the context to be used in this call's Do method. Any
  59355. // pending HTTP request will be aborted if the provided context is
  59356. // canceled.
  59357. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  59358. c.ctx_ = ctx
  59359. return c
  59360. }
  59361. // Header returns an http.Header that can be modified by the caller to
  59362. // add HTTP headers to the request.
  59363. func (c *HttpHealthChecksListCall) Header() http.Header {
  59364. if c.header_ == nil {
  59365. c.header_ = make(http.Header)
  59366. }
  59367. return c.header_
  59368. }
  59369. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  59370. reqHeaders := make(http.Header)
  59371. for k, v := range c.header_ {
  59372. reqHeaders[k] = v
  59373. }
  59374. reqHeaders.Set("User-Agent", c.s.userAgent())
  59375. if c.ifNoneMatch_ != "" {
  59376. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59377. }
  59378. var body io.Reader = nil
  59379. c.urlParams_.Set("alt", alt)
  59380. c.urlParams_.Set("prettyPrint", "false")
  59381. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  59382. urls += "?" + c.urlParams_.Encode()
  59383. req, err := http.NewRequest("GET", urls, body)
  59384. if err != nil {
  59385. return nil, err
  59386. }
  59387. req.Header = reqHeaders
  59388. googleapi.Expand(req.URL, map[string]string{
  59389. "project": c.project,
  59390. })
  59391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59392. }
  59393. // Do executes the "compute.httpHealthChecks.list" call.
  59394. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  59395. // non-2xx status code is an error. Response headers are in either
  59396. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  59397. // returned at all) in error.(*googleapi.Error).Header. Use
  59398. // googleapi.IsNotModified to check whether the returned error was
  59399. // because http.StatusNotModified was returned.
  59400. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  59401. gensupport.SetOptions(c.urlParams_, opts...)
  59402. res, err := c.doRequest("json")
  59403. if res != nil && res.StatusCode == http.StatusNotModified {
  59404. if res.Body != nil {
  59405. res.Body.Close()
  59406. }
  59407. return nil, &googleapi.Error{
  59408. Code: res.StatusCode,
  59409. Header: res.Header,
  59410. }
  59411. }
  59412. if err != nil {
  59413. return nil, err
  59414. }
  59415. defer googleapi.CloseBody(res)
  59416. if err := googleapi.CheckResponse(res); err != nil {
  59417. return nil, err
  59418. }
  59419. ret := &HttpHealthCheckList{
  59420. ServerResponse: googleapi.ServerResponse{
  59421. Header: res.Header,
  59422. HTTPStatusCode: res.StatusCode,
  59423. },
  59424. }
  59425. target := &ret
  59426. if err := gensupport.DecodeResponse(target, res); err != nil {
  59427. return nil, err
  59428. }
  59429. return ret, nil
  59430. // {
  59431. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  59432. // "httpMethod": "GET",
  59433. // "id": "compute.httpHealthChecks.list",
  59434. // "parameterOrder": [
  59435. // "project"
  59436. // ],
  59437. // "parameters": {
  59438. // "filter": {
  59439. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  59440. // "location": "query",
  59441. // "type": "string"
  59442. // },
  59443. // "maxResults": {
  59444. // "default": "500",
  59445. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  59446. // "format": "uint32",
  59447. // "location": "query",
  59448. // "minimum": "0",
  59449. // "type": "integer"
  59450. // },
  59451. // "orderBy": {
  59452. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  59453. // "location": "query",
  59454. // "type": "string"
  59455. // },
  59456. // "pageToken": {
  59457. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  59458. // "location": "query",
  59459. // "type": "string"
  59460. // },
  59461. // "project": {
  59462. // "description": "Project ID for this request.",
  59463. // "location": "path",
  59464. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59465. // "required": true,
  59466. // "type": "string"
  59467. // }
  59468. // },
  59469. // "path": "{project}/global/httpHealthChecks",
  59470. // "response": {
  59471. // "$ref": "HttpHealthCheckList"
  59472. // },
  59473. // "scopes": [
  59474. // "https://www.googleapis.com/auth/cloud-platform",
  59475. // "https://www.googleapis.com/auth/compute",
  59476. // "https://www.googleapis.com/auth/compute.readonly"
  59477. // ]
  59478. // }
  59479. }
  59480. // Pages invokes f for each page of results.
  59481. // A non-nil error returned from f will halt the iteration.
  59482. // The provided context supersedes any context provided to the Context method.
  59483. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  59484. c.ctx_ = ctx
  59485. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59486. for {
  59487. x, err := c.Do()
  59488. if err != nil {
  59489. return err
  59490. }
  59491. if err := f(x); err != nil {
  59492. return err
  59493. }
  59494. if x.NextPageToken == "" {
  59495. return nil
  59496. }
  59497. c.PageToken(x.NextPageToken)
  59498. }
  59499. }
  59500. // method id "compute.httpHealthChecks.patch":
  59501. type HttpHealthChecksPatchCall struct {
  59502. s *Service
  59503. project string
  59504. httpHealthCheck string
  59505. httphealthcheck *HttpHealthCheck
  59506. urlParams_ gensupport.URLParams
  59507. ctx_ context.Context
  59508. header_ http.Header
  59509. }
  59510. // Patch: Updates a HttpHealthCheck resource in the specified project
  59511. // using the data included in the request. This method supports PATCH
  59512. // semantics and uses the JSON merge patch format and processing rules.
  59513. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  59514. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  59515. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59516. c.project = project
  59517. c.httpHealthCheck = httpHealthCheck
  59518. c.httphealthcheck = httphealthcheck
  59519. return c
  59520. }
  59521. // RequestId sets the optional parameter "requestId": An optional
  59522. // request ID to identify requests. Specify a unique request ID so that
  59523. // if you must retry your request, the server will know to ignore the
  59524. // request if it has already been completed.
  59525. //
  59526. // For example, consider a situation where you make an initial request
  59527. // and the request times out. If you make the request again with the
  59528. // same request ID, the server can check if original operation with the
  59529. // same request ID was received, and if so, will ignore the second
  59530. // request. This prevents clients from accidentally creating duplicate
  59531. // commitments.
  59532. //
  59533. // The request ID must be a valid UUID with the exception that zero UUID
  59534. // is not supported (00000000-0000-0000-0000-000000000000).
  59535. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  59536. c.urlParams_.Set("requestId", requestId)
  59537. return c
  59538. }
  59539. // Fields allows partial responses to be retrieved. See
  59540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59541. // for more information.
  59542. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  59543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59544. return c
  59545. }
  59546. // Context sets the context to be used in this call's Do method. Any
  59547. // pending HTTP request will be aborted if the provided context is
  59548. // canceled.
  59549. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  59550. c.ctx_ = ctx
  59551. return c
  59552. }
  59553. // Header returns an http.Header that can be modified by the caller to
  59554. // add HTTP headers to the request.
  59555. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  59556. if c.header_ == nil {
  59557. c.header_ = make(http.Header)
  59558. }
  59559. return c.header_
  59560. }
  59561. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  59562. reqHeaders := make(http.Header)
  59563. for k, v := range c.header_ {
  59564. reqHeaders[k] = v
  59565. }
  59566. reqHeaders.Set("User-Agent", c.s.userAgent())
  59567. var body io.Reader = nil
  59568. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  59569. if err != nil {
  59570. return nil, err
  59571. }
  59572. reqHeaders.Set("Content-Type", "application/json")
  59573. c.urlParams_.Set("alt", alt)
  59574. c.urlParams_.Set("prettyPrint", "false")
  59575. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  59576. urls += "?" + c.urlParams_.Encode()
  59577. req, err := http.NewRequest("PATCH", urls, body)
  59578. if err != nil {
  59579. return nil, err
  59580. }
  59581. req.Header = reqHeaders
  59582. googleapi.Expand(req.URL, map[string]string{
  59583. "project": c.project,
  59584. "httpHealthCheck": c.httpHealthCheck,
  59585. })
  59586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59587. }
  59588. // Do executes the "compute.httpHealthChecks.patch" call.
  59589. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59590. // status code is an error. Response headers are in either
  59591. // *Operation.ServerResponse.Header or (if a response was returned at
  59592. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59593. // to check whether the returned error was because
  59594. // http.StatusNotModified was returned.
  59595. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59596. gensupport.SetOptions(c.urlParams_, opts...)
  59597. res, err := c.doRequest("json")
  59598. if res != nil && res.StatusCode == http.StatusNotModified {
  59599. if res.Body != nil {
  59600. res.Body.Close()
  59601. }
  59602. return nil, &googleapi.Error{
  59603. Code: res.StatusCode,
  59604. Header: res.Header,
  59605. }
  59606. }
  59607. if err != nil {
  59608. return nil, err
  59609. }
  59610. defer googleapi.CloseBody(res)
  59611. if err := googleapi.CheckResponse(res); err != nil {
  59612. return nil, err
  59613. }
  59614. ret := &Operation{
  59615. ServerResponse: googleapi.ServerResponse{
  59616. Header: res.Header,
  59617. HTTPStatusCode: res.StatusCode,
  59618. },
  59619. }
  59620. target := &ret
  59621. if err := gensupport.DecodeResponse(target, res); err != nil {
  59622. return nil, err
  59623. }
  59624. return ret, nil
  59625. // {
  59626. // "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.",
  59627. // "httpMethod": "PATCH",
  59628. // "id": "compute.httpHealthChecks.patch",
  59629. // "parameterOrder": [
  59630. // "project",
  59631. // "httpHealthCheck"
  59632. // ],
  59633. // "parameters": {
  59634. // "httpHealthCheck": {
  59635. // "description": "Name of the HttpHealthCheck resource to patch.",
  59636. // "location": "path",
  59637. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59638. // "required": true,
  59639. // "type": "string"
  59640. // },
  59641. // "project": {
  59642. // "description": "Project ID for this request.",
  59643. // "location": "path",
  59644. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59645. // "required": true,
  59646. // "type": "string"
  59647. // },
  59648. // "requestId": {
  59649. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59650. // "location": "query",
  59651. // "type": "string"
  59652. // }
  59653. // },
  59654. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  59655. // "request": {
  59656. // "$ref": "HttpHealthCheck"
  59657. // },
  59658. // "response": {
  59659. // "$ref": "Operation"
  59660. // },
  59661. // "scopes": [
  59662. // "https://www.googleapis.com/auth/cloud-platform",
  59663. // "https://www.googleapis.com/auth/compute"
  59664. // ]
  59665. // }
  59666. }
  59667. // method id "compute.httpHealthChecks.testIamPermissions":
  59668. type HttpHealthChecksTestIamPermissionsCall struct {
  59669. s *Service
  59670. project string
  59671. resource string
  59672. testpermissionsrequest *TestPermissionsRequest
  59673. urlParams_ gensupport.URLParams
  59674. ctx_ context.Context
  59675. header_ http.Header
  59676. }
  59677. // TestIamPermissions: Returns permissions that a caller has on the
  59678. // specified resource.
  59679. func (r *HttpHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpHealthChecksTestIamPermissionsCall {
  59680. c := &HttpHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59681. c.project = project
  59682. c.resource = resource
  59683. c.testpermissionsrequest = testpermissionsrequest
  59684. return c
  59685. }
  59686. // Fields allows partial responses to be retrieved. See
  59687. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59688. // for more information.
  59689. func (c *HttpHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpHealthChecksTestIamPermissionsCall {
  59690. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59691. return c
  59692. }
  59693. // Context sets the context to be used in this call's Do method. Any
  59694. // pending HTTP request will be aborted if the provided context is
  59695. // canceled.
  59696. func (c *HttpHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpHealthChecksTestIamPermissionsCall {
  59697. c.ctx_ = ctx
  59698. return c
  59699. }
  59700. // Header returns an http.Header that can be modified by the caller to
  59701. // add HTTP headers to the request.
  59702. func (c *HttpHealthChecksTestIamPermissionsCall) Header() http.Header {
  59703. if c.header_ == nil {
  59704. c.header_ = make(http.Header)
  59705. }
  59706. return c.header_
  59707. }
  59708. func (c *HttpHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  59709. reqHeaders := make(http.Header)
  59710. for k, v := range c.header_ {
  59711. reqHeaders[k] = v
  59712. }
  59713. reqHeaders.Set("User-Agent", c.s.userAgent())
  59714. var body io.Reader = nil
  59715. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  59716. if err != nil {
  59717. return nil, err
  59718. }
  59719. reqHeaders.Set("Content-Type", "application/json")
  59720. c.urlParams_.Set("alt", alt)
  59721. c.urlParams_.Set("prettyPrint", "false")
  59722. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{resource}/testIamPermissions")
  59723. urls += "?" + c.urlParams_.Encode()
  59724. req, err := http.NewRequest("POST", urls, body)
  59725. if err != nil {
  59726. return nil, err
  59727. }
  59728. req.Header = reqHeaders
  59729. googleapi.Expand(req.URL, map[string]string{
  59730. "project": c.project,
  59731. "resource": c.resource,
  59732. })
  59733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59734. }
  59735. // Do executes the "compute.httpHealthChecks.testIamPermissions" call.
  59736. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  59737. // non-2xx status code is an error. Response headers are in either
  59738. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  59739. // returned at all) in error.(*googleapi.Error).Header. Use
  59740. // googleapi.IsNotModified to check whether the returned error was
  59741. // because http.StatusNotModified was returned.
  59742. func (c *HttpHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  59743. gensupport.SetOptions(c.urlParams_, opts...)
  59744. res, err := c.doRequest("json")
  59745. if res != nil && res.StatusCode == http.StatusNotModified {
  59746. if res.Body != nil {
  59747. res.Body.Close()
  59748. }
  59749. return nil, &googleapi.Error{
  59750. Code: res.StatusCode,
  59751. Header: res.Header,
  59752. }
  59753. }
  59754. if err != nil {
  59755. return nil, err
  59756. }
  59757. defer googleapi.CloseBody(res)
  59758. if err := googleapi.CheckResponse(res); err != nil {
  59759. return nil, err
  59760. }
  59761. ret := &TestPermissionsResponse{
  59762. ServerResponse: googleapi.ServerResponse{
  59763. Header: res.Header,
  59764. HTTPStatusCode: res.StatusCode,
  59765. },
  59766. }
  59767. target := &ret
  59768. if err := gensupport.DecodeResponse(target, res); err != nil {
  59769. return nil, err
  59770. }
  59771. return ret, nil
  59772. // {
  59773. // "description": "Returns permissions that a caller has on the specified resource.",
  59774. // "httpMethod": "POST",
  59775. // "id": "compute.httpHealthChecks.testIamPermissions",
  59776. // "parameterOrder": [
  59777. // "project",
  59778. // "resource"
  59779. // ],
  59780. // "parameters": {
  59781. // "project": {
  59782. // "description": "Project ID for this request.",
  59783. // "location": "path",
  59784. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59785. // "required": true,
  59786. // "type": "string"
  59787. // },
  59788. // "resource": {
  59789. // "description": "Name or id of the resource for this request.",
  59790. // "location": "path",
  59791. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59792. // "required": true,
  59793. // "type": "string"
  59794. // }
  59795. // },
  59796. // "path": "{project}/global/httpHealthChecks/{resource}/testIamPermissions",
  59797. // "request": {
  59798. // "$ref": "TestPermissionsRequest"
  59799. // },
  59800. // "response": {
  59801. // "$ref": "TestPermissionsResponse"
  59802. // },
  59803. // "scopes": [
  59804. // "https://www.googleapis.com/auth/cloud-platform",
  59805. // "https://www.googleapis.com/auth/compute",
  59806. // "https://www.googleapis.com/auth/compute.readonly"
  59807. // ]
  59808. // }
  59809. }
  59810. // method id "compute.httpHealthChecks.update":
  59811. type HttpHealthChecksUpdateCall struct {
  59812. s *Service
  59813. project string
  59814. httpHealthCheck string
  59815. httphealthcheck *HttpHealthCheck
  59816. urlParams_ gensupport.URLParams
  59817. ctx_ context.Context
  59818. header_ http.Header
  59819. }
  59820. // Update: Updates a HttpHealthCheck resource in the specified project
  59821. // using the data included in the request.
  59822. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  59823. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  59824. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59825. c.project = project
  59826. c.httpHealthCheck = httpHealthCheck
  59827. c.httphealthcheck = httphealthcheck
  59828. return c
  59829. }
  59830. // RequestId sets the optional parameter "requestId": An optional
  59831. // request ID to identify requests. Specify a unique request ID so that
  59832. // if you must retry your request, the server will know to ignore the
  59833. // request if it has already been completed.
  59834. //
  59835. // For example, consider a situation where you make an initial request
  59836. // and the request times out. If you make the request again with the
  59837. // same request ID, the server can check if original operation with the
  59838. // same request ID was received, and if so, will ignore the second
  59839. // request. This prevents clients from accidentally creating duplicate
  59840. // commitments.
  59841. //
  59842. // The request ID must be a valid UUID with the exception that zero UUID
  59843. // is not supported (00000000-0000-0000-0000-000000000000).
  59844. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  59845. c.urlParams_.Set("requestId", requestId)
  59846. return c
  59847. }
  59848. // Fields allows partial responses to be retrieved. See
  59849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59850. // for more information.
  59851. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  59852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59853. return c
  59854. }
  59855. // Context sets the context to be used in this call's Do method. Any
  59856. // pending HTTP request will be aborted if the provided context is
  59857. // canceled.
  59858. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  59859. c.ctx_ = ctx
  59860. return c
  59861. }
  59862. // Header returns an http.Header that can be modified by the caller to
  59863. // add HTTP headers to the request.
  59864. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  59865. if c.header_ == nil {
  59866. c.header_ = make(http.Header)
  59867. }
  59868. return c.header_
  59869. }
  59870. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  59871. reqHeaders := make(http.Header)
  59872. for k, v := range c.header_ {
  59873. reqHeaders[k] = v
  59874. }
  59875. reqHeaders.Set("User-Agent", c.s.userAgent())
  59876. var body io.Reader = nil
  59877. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  59878. if err != nil {
  59879. return nil, err
  59880. }
  59881. reqHeaders.Set("Content-Type", "application/json")
  59882. c.urlParams_.Set("alt", alt)
  59883. c.urlParams_.Set("prettyPrint", "false")
  59884. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  59885. urls += "?" + c.urlParams_.Encode()
  59886. req, err := http.NewRequest("PUT", urls, body)
  59887. if err != nil {
  59888. return nil, err
  59889. }
  59890. req.Header = reqHeaders
  59891. googleapi.Expand(req.URL, map[string]string{
  59892. "project": c.project,
  59893. "httpHealthCheck": c.httpHealthCheck,
  59894. })
  59895. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59896. }
  59897. // Do executes the "compute.httpHealthChecks.update" call.
  59898. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59899. // status code is an error. Response headers are in either
  59900. // *Operation.ServerResponse.Header or (if a response was returned at
  59901. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59902. // to check whether the returned error was because
  59903. // http.StatusNotModified was returned.
  59904. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59905. gensupport.SetOptions(c.urlParams_, opts...)
  59906. res, err := c.doRequest("json")
  59907. if res != nil && res.StatusCode == http.StatusNotModified {
  59908. if res.Body != nil {
  59909. res.Body.Close()
  59910. }
  59911. return nil, &googleapi.Error{
  59912. Code: res.StatusCode,
  59913. Header: res.Header,
  59914. }
  59915. }
  59916. if err != nil {
  59917. return nil, err
  59918. }
  59919. defer googleapi.CloseBody(res)
  59920. if err := googleapi.CheckResponse(res); err != nil {
  59921. return nil, err
  59922. }
  59923. ret := &Operation{
  59924. ServerResponse: googleapi.ServerResponse{
  59925. Header: res.Header,
  59926. HTTPStatusCode: res.StatusCode,
  59927. },
  59928. }
  59929. target := &ret
  59930. if err := gensupport.DecodeResponse(target, res); err != nil {
  59931. return nil, err
  59932. }
  59933. return ret, nil
  59934. // {
  59935. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  59936. // "httpMethod": "PUT",
  59937. // "id": "compute.httpHealthChecks.update",
  59938. // "parameterOrder": [
  59939. // "project",
  59940. // "httpHealthCheck"
  59941. // ],
  59942. // "parameters": {
  59943. // "httpHealthCheck": {
  59944. // "description": "Name of the HttpHealthCheck resource to update.",
  59945. // "location": "path",
  59946. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59947. // "required": true,
  59948. // "type": "string"
  59949. // },
  59950. // "project": {
  59951. // "description": "Project ID for this request.",
  59952. // "location": "path",
  59953. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59954. // "required": true,
  59955. // "type": "string"
  59956. // },
  59957. // "requestId": {
  59958. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59959. // "location": "query",
  59960. // "type": "string"
  59961. // }
  59962. // },
  59963. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  59964. // "request": {
  59965. // "$ref": "HttpHealthCheck"
  59966. // },
  59967. // "response": {
  59968. // "$ref": "Operation"
  59969. // },
  59970. // "scopes": [
  59971. // "https://www.googleapis.com/auth/cloud-platform",
  59972. // "https://www.googleapis.com/auth/compute"
  59973. // ]
  59974. // }
  59975. }
  59976. // method id "compute.httpsHealthChecks.delete":
  59977. type HttpsHealthChecksDeleteCall struct {
  59978. s *Service
  59979. project string
  59980. httpsHealthCheck string
  59981. urlParams_ gensupport.URLParams
  59982. ctx_ context.Context
  59983. header_ http.Header
  59984. }
  59985. // Delete: Deletes the specified HttpsHealthCheck resource.
  59986. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  59987. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59988. c.project = project
  59989. c.httpsHealthCheck = httpsHealthCheck
  59990. return c
  59991. }
  59992. // RequestId sets the optional parameter "requestId": An optional
  59993. // request ID to identify requests. Specify a unique request ID so that
  59994. // if you must retry your request, the server will know to ignore the
  59995. // request if it has already been completed.
  59996. //
  59997. // For example, consider a situation where you make an initial request
  59998. // and the request times out. If you make the request again with the
  59999. // same request ID, the server can check if original operation with the
  60000. // same request ID was received, and if so, will ignore the second
  60001. // request. This prevents clients from accidentally creating duplicate
  60002. // commitments.
  60003. //
  60004. // The request ID must be a valid UUID with the exception that zero UUID
  60005. // is not supported (00000000-0000-0000-0000-000000000000).
  60006. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  60007. c.urlParams_.Set("requestId", requestId)
  60008. return c
  60009. }
  60010. // Fields allows partial responses to be retrieved. See
  60011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60012. // for more information.
  60013. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  60014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60015. return c
  60016. }
  60017. // Context sets the context to be used in this call's Do method. Any
  60018. // pending HTTP request will be aborted if the provided context is
  60019. // canceled.
  60020. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  60021. c.ctx_ = ctx
  60022. return c
  60023. }
  60024. // Header returns an http.Header that can be modified by the caller to
  60025. // add HTTP headers to the request.
  60026. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  60027. if c.header_ == nil {
  60028. c.header_ = make(http.Header)
  60029. }
  60030. return c.header_
  60031. }
  60032. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  60033. reqHeaders := make(http.Header)
  60034. for k, v := range c.header_ {
  60035. reqHeaders[k] = v
  60036. }
  60037. reqHeaders.Set("User-Agent", c.s.userAgent())
  60038. var body io.Reader = nil
  60039. c.urlParams_.Set("alt", alt)
  60040. c.urlParams_.Set("prettyPrint", "false")
  60041. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  60042. urls += "?" + c.urlParams_.Encode()
  60043. req, err := http.NewRequest("DELETE", urls, body)
  60044. if err != nil {
  60045. return nil, err
  60046. }
  60047. req.Header = reqHeaders
  60048. googleapi.Expand(req.URL, map[string]string{
  60049. "project": c.project,
  60050. "httpsHealthCheck": c.httpsHealthCheck,
  60051. })
  60052. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60053. }
  60054. // Do executes the "compute.httpsHealthChecks.delete" call.
  60055. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60056. // status code is an error. Response headers are in either
  60057. // *Operation.ServerResponse.Header or (if a response was returned at
  60058. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60059. // to check whether the returned error was because
  60060. // http.StatusNotModified was returned.
  60061. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60062. gensupport.SetOptions(c.urlParams_, opts...)
  60063. res, err := c.doRequest("json")
  60064. if res != nil && res.StatusCode == http.StatusNotModified {
  60065. if res.Body != nil {
  60066. res.Body.Close()
  60067. }
  60068. return nil, &googleapi.Error{
  60069. Code: res.StatusCode,
  60070. Header: res.Header,
  60071. }
  60072. }
  60073. if err != nil {
  60074. return nil, err
  60075. }
  60076. defer googleapi.CloseBody(res)
  60077. if err := googleapi.CheckResponse(res); err != nil {
  60078. return nil, err
  60079. }
  60080. ret := &Operation{
  60081. ServerResponse: googleapi.ServerResponse{
  60082. Header: res.Header,
  60083. HTTPStatusCode: res.StatusCode,
  60084. },
  60085. }
  60086. target := &ret
  60087. if err := gensupport.DecodeResponse(target, res); err != nil {
  60088. return nil, err
  60089. }
  60090. return ret, nil
  60091. // {
  60092. // "description": "Deletes the specified HttpsHealthCheck resource.",
  60093. // "httpMethod": "DELETE",
  60094. // "id": "compute.httpsHealthChecks.delete",
  60095. // "parameterOrder": [
  60096. // "project",
  60097. // "httpsHealthCheck"
  60098. // ],
  60099. // "parameters": {
  60100. // "httpsHealthCheck": {
  60101. // "description": "Name of the HttpsHealthCheck resource to delete.",
  60102. // "location": "path",
  60103. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60104. // "required": true,
  60105. // "type": "string"
  60106. // },
  60107. // "project": {
  60108. // "description": "Project ID for this request.",
  60109. // "location": "path",
  60110. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60111. // "required": true,
  60112. // "type": "string"
  60113. // },
  60114. // "requestId": {
  60115. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60116. // "location": "query",
  60117. // "type": "string"
  60118. // }
  60119. // },
  60120. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  60121. // "response": {
  60122. // "$ref": "Operation"
  60123. // },
  60124. // "scopes": [
  60125. // "https://www.googleapis.com/auth/cloud-platform",
  60126. // "https://www.googleapis.com/auth/compute"
  60127. // ]
  60128. // }
  60129. }
  60130. // method id "compute.httpsHealthChecks.get":
  60131. type HttpsHealthChecksGetCall struct {
  60132. s *Service
  60133. project string
  60134. httpsHealthCheck string
  60135. urlParams_ gensupport.URLParams
  60136. ifNoneMatch_ string
  60137. ctx_ context.Context
  60138. header_ http.Header
  60139. }
  60140. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  60141. // available HTTPS health checks by making a list() request.
  60142. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  60143. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60144. c.project = project
  60145. c.httpsHealthCheck = httpsHealthCheck
  60146. return c
  60147. }
  60148. // Fields allows partial responses to be retrieved. See
  60149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60150. // for more information.
  60151. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  60152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60153. return c
  60154. }
  60155. // IfNoneMatch sets the optional parameter which makes the operation
  60156. // fail if the object's ETag matches the given value. This is useful for
  60157. // getting updates only after the object has changed since the last
  60158. // request. Use googleapi.IsNotModified to check whether the response
  60159. // error from Do is the result of In-None-Match.
  60160. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  60161. c.ifNoneMatch_ = entityTag
  60162. return c
  60163. }
  60164. // Context sets the context to be used in this call's Do method. Any
  60165. // pending HTTP request will be aborted if the provided context is
  60166. // canceled.
  60167. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  60168. c.ctx_ = ctx
  60169. return c
  60170. }
  60171. // Header returns an http.Header that can be modified by the caller to
  60172. // add HTTP headers to the request.
  60173. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  60174. if c.header_ == nil {
  60175. c.header_ = make(http.Header)
  60176. }
  60177. return c.header_
  60178. }
  60179. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  60180. reqHeaders := make(http.Header)
  60181. for k, v := range c.header_ {
  60182. reqHeaders[k] = v
  60183. }
  60184. reqHeaders.Set("User-Agent", c.s.userAgent())
  60185. if c.ifNoneMatch_ != "" {
  60186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60187. }
  60188. var body io.Reader = nil
  60189. c.urlParams_.Set("alt", alt)
  60190. c.urlParams_.Set("prettyPrint", "false")
  60191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  60192. urls += "?" + c.urlParams_.Encode()
  60193. req, err := http.NewRequest("GET", urls, body)
  60194. if err != nil {
  60195. return nil, err
  60196. }
  60197. req.Header = reqHeaders
  60198. googleapi.Expand(req.URL, map[string]string{
  60199. "project": c.project,
  60200. "httpsHealthCheck": c.httpsHealthCheck,
  60201. })
  60202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60203. }
  60204. // Do executes the "compute.httpsHealthChecks.get" call.
  60205. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  60206. // non-2xx status code is an error. Response headers are in either
  60207. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  60208. // returned at all) in error.(*googleapi.Error).Header. Use
  60209. // googleapi.IsNotModified to check whether the returned error was
  60210. // because http.StatusNotModified was returned.
  60211. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  60212. gensupport.SetOptions(c.urlParams_, opts...)
  60213. res, err := c.doRequest("json")
  60214. if res != nil && res.StatusCode == http.StatusNotModified {
  60215. if res.Body != nil {
  60216. res.Body.Close()
  60217. }
  60218. return nil, &googleapi.Error{
  60219. Code: res.StatusCode,
  60220. Header: res.Header,
  60221. }
  60222. }
  60223. if err != nil {
  60224. return nil, err
  60225. }
  60226. defer googleapi.CloseBody(res)
  60227. if err := googleapi.CheckResponse(res); err != nil {
  60228. return nil, err
  60229. }
  60230. ret := &HttpsHealthCheck{
  60231. ServerResponse: googleapi.ServerResponse{
  60232. Header: res.Header,
  60233. HTTPStatusCode: res.StatusCode,
  60234. },
  60235. }
  60236. target := &ret
  60237. if err := gensupport.DecodeResponse(target, res); err != nil {
  60238. return nil, err
  60239. }
  60240. return ret, nil
  60241. // {
  60242. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  60243. // "httpMethod": "GET",
  60244. // "id": "compute.httpsHealthChecks.get",
  60245. // "parameterOrder": [
  60246. // "project",
  60247. // "httpsHealthCheck"
  60248. // ],
  60249. // "parameters": {
  60250. // "httpsHealthCheck": {
  60251. // "description": "Name of the HttpsHealthCheck resource to return.",
  60252. // "location": "path",
  60253. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60254. // "required": true,
  60255. // "type": "string"
  60256. // },
  60257. // "project": {
  60258. // "description": "Project ID for this request.",
  60259. // "location": "path",
  60260. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60261. // "required": true,
  60262. // "type": "string"
  60263. // }
  60264. // },
  60265. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  60266. // "response": {
  60267. // "$ref": "HttpsHealthCheck"
  60268. // },
  60269. // "scopes": [
  60270. // "https://www.googleapis.com/auth/cloud-platform",
  60271. // "https://www.googleapis.com/auth/compute",
  60272. // "https://www.googleapis.com/auth/compute.readonly"
  60273. // ]
  60274. // }
  60275. }
  60276. // method id "compute.httpsHealthChecks.insert":
  60277. type HttpsHealthChecksInsertCall struct {
  60278. s *Service
  60279. project string
  60280. httpshealthcheck *HttpsHealthCheck
  60281. urlParams_ gensupport.URLParams
  60282. ctx_ context.Context
  60283. header_ http.Header
  60284. }
  60285. // Insert: Creates a HttpsHealthCheck resource in the specified project
  60286. // using the data included in the request.
  60287. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  60288. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60289. c.project = project
  60290. c.httpshealthcheck = httpshealthcheck
  60291. return c
  60292. }
  60293. // RequestId sets the optional parameter "requestId": An optional
  60294. // request ID to identify requests. Specify a unique request ID so that
  60295. // if you must retry your request, the server will know to ignore the
  60296. // request if it has already been completed.
  60297. //
  60298. // For example, consider a situation where you make an initial request
  60299. // and the request times out. If you make the request again with the
  60300. // same request ID, the server can check if original operation with the
  60301. // same request ID was received, and if so, will ignore the second
  60302. // request. This prevents clients from accidentally creating duplicate
  60303. // commitments.
  60304. //
  60305. // The request ID must be a valid UUID with the exception that zero UUID
  60306. // is not supported (00000000-0000-0000-0000-000000000000).
  60307. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  60308. c.urlParams_.Set("requestId", requestId)
  60309. return c
  60310. }
  60311. // Fields allows partial responses to be retrieved. See
  60312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60313. // for more information.
  60314. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  60315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60316. return c
  60317. }
  60318. // Context sets the context to be used in this call's Do method. Any
  60319. // pending HTTP request will be aborted if the provided context is
  60320. // canceled.
  60321. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  60322. c.ctx_ = ctx
  60323. return c
  60324. }
  60325. // Header returns an http.Header that can be modified by the caller to
  60326. // add HTTP headers to the request.
  60327. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  60328. if c.header_ == nil {
  60329. c.header_ = make(http.Header)
  60330. }
  60331. return c.header_
  60332. }
  60333. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  60334. reqHeaders := make(http.Header)
  60335. for k, v := range c.header_ {
  60336. reqHeaders[k] = v
  60337. }
  60338. reqHeaders.Set("User-Agent", c.s.userAgent())
  60339. var body io.Reader = nil
  60340. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  60341. if err != nil {
  60342. return nil, err
  60343. }
  60344. reqHeaders.Set("Content-Type", "application/json")
  60345. c.urlParams_.Set("alt", alt)
  60346. c.urlParams_.Set("prettyPrint", "false")
  60347. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  60348. urls += "?" + c.urlParams_.Encode()
  60349. req, err := http.NewRequest("POST", urls, body)
  60350. if err != nil {
  60351. return nil, err
  60352. }
  60353. req.Header = reqHeaders
  60354. googleapi.Expand(req.URL, map[string]string{
  60355. "project": c.project,
  60356. })
  60357. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60358. }
  60359. // Do executes the "compute.httpsHealthChecks.insert" call.
  60360. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60361. // status code is an error. Response headers are in either
  60362. // *Operation.ServerResponse.Header or (if a response was returned at
  60363. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60364. // to check whether the returned error was because
  60365. // http.StatusNotModified was returned.
  60366. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60367. gensupport.SetOptions(c.urlParams_, opts...)
  60368. res, err := c.doRequest("json")
  60369. if res != nil && res.StatusCode == http.StatusNotModified {
  60370. if res.Body != nil {
  60371. res.Body.Close()
  60372. }
  60373. return nil, &googleapi.Error{
  60374. Code: res.StatusCode,
  60375. Header: res.Header,
  60376. }
  60377. }
  60378. if err != nil {
  60379. return nil, err
  60380. }
  60381. defer googleapi.CloseBody(res)
  60382. if err := googleapi.CheckResponse(res); err != nil {
  60383. return nil, err
  60384. }
  60385. ret := &Operation{
  60386. ServerResponse: googleapi.ServerResponse{
  60387. Header: res.Header,
  60388. HTTPStatusCode: res.StatusCode,
  60389. },
  60390. }
  60391. target := &ret
  60392. if err := gensupport.DecodeResponse(target, res); err != nil {
  60393. return nil, err
  60394. }
  60395. return ret, nil
  60396. // {
  60397. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  60398. // "httpMethod": "POST",
  60399. // "id": "compute.httpsHealthChecks.insert",
  60400. // "parameterOrder": [
  60401. // "project"
  60402. // ],
  60403. // "parameters": {
  60404. // "project": {
  60405. // "description": "Project ID for this request.",
  60406. // "location": "path",
  60407. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60408. // "required": true,
  60409. // "type": "string"
  60410. // },
  60411. // "requestId": {
  60412. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60413. // "location": "query",
  60414. // "type": "string"
  60415. // }
  60416. // },
  60417. // "path": "{project}/global/httpsHealthChecks",
  60418. // "request": {
  60419. // "$ref": "HttpsHealthCheck"
  60420. // },
  60421. // "response": {
  60422. // "$ref": "Operation"
  60423. // },
  60424. // "scopes": [
  60425. // "https://www.googleapis.com/auth/cloud-platform",
  60426. // "https://www.googleapis.com/auth/compute"
  60427. // ]
  60428. // }
  60429. }
  60430. // method id "compute.httpsHealthChecks.list":
  60431. type HttpsHealthChecksListCall struct {
  60432. s *Service
  60433. project string
  60434. urlParams_ gensupport.URLParams
  60435. ifNoneMatch_ string
  60436. ctx_ context.Context
  60437. header_ http.Header
  60438. }
  60439. // List: Retrieves the list of HttpsHealthCheck resources available to
  60440. // the specified project.
  60441. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  60442. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60443. c.project = project
  60444. return c
  60445. }
  60446. // Filter sets the optional parameter "filter": A filter expression that
  60447. // filters resources listed in the response. The expression must specify
  60448. // the field name, a comparison operator, and the value that you want to
  60449. // use for filtering. The value must be a string, a number, or a
  60450. // boolean. The comparison operator must be either =, !=, >, or <.
  60451. //
  60452. // For example, if you are filtering Compute Engine instances, you can
  60453. // exclude instances named example-instance by specifying name !=
  60454. // example-instance.
  60455. //
  60456. // You can also filter nested fields. For example, you could specify
  60457. // scheduling.automaticRestart = false to include instances only if they
  60458. // are not scheduled for automatic restarts. You can use filtering on
  60459. // nested fields to filter based on resource labels.
  60460. //
  60461. // To filter on multiple expressions, provide each separate expression
  60462. // within parentheses. For example, (scheduling.automaticRestart = true)
  60463. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60464. // AND expression. However, you can include AND and OR expressions
  60465. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60466. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60467. // true).
  60468. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  60469. c.urlParams_.Set("filter", filter)
  60470. return c
  60471. }
  60472. // MaxResults sets the optional parameter "maxResults": The maximum
  60473. // number of results per page that should be returned. If the number of
  60474. // available results is larger than maxResults, Compute Engine returns a
  60475. // nextPageToken that can be used to get the next page of results in
  60476. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60477. // (Default: 500)
  60478. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  60479. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60480. return c
  60481. }
  60482. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60483. // a certain order. By default, results are returned in alphanumerical
  60484. // order based on the resource name.
  60485. //
  60486. // You can also sort results in descending order based on the creation
  60487. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60488. // based on the creationTimestamp field in reverse chronological order
  60489. // (newest result first). Use this to sort resources like operations so
  60490. // that the newest operation is returned first.
  60491. //
  60492. // Currently, only sorting by name or creationTimestamp desc is
  60493. // supported.
  60494. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  60495. c.urlParams_.Set("orderBy", orderBy)
  60496. return c
  60497. }
  60498. // PageToken sets the optional parameter "pageToken": Specifies a page
  60499. // token to use. Set pageToken to the nextPageToken returned by a
  60500. // previous list request to get the next page of results.
  60501. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  60502. c.urlParams_.Set("pageToken", pageToken)
  60503. return c
  60504. }
  60505. // Fields allows partial responses to be retrieved. See
  60506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60507. // for more information.
  60508. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  60509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60510. return c
  60511. }
  60512. // IfNoneMatch sets the optional parameter which makes the operation
  60513. // fail if the object's ETag matches the given value. This is useful for
  60514. // getting updates only after the object has changed since the last
  60515. // request. Use googleapi.IsNotModified to check whether the response
  60516. // error from Do is the result of In-None-Match.
  60517. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  60518. c.ifNoneMatch_ = entityTag
  60519. return c
  60520. }
  60521. // Context sets the context to be used in this call's Do method. Any
  60522. // pending HTTP request will be aborted if the provided context is
  60523. // canceled.
  60524. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  60525. c.ctx_ = ctx
  60526. return c
  60527. }
  60528. // Header returns an http.Header that can be modified by the caller to
  60529. // add HTTP headers to the request.
  60530. func (c *HttpsHealthChecksListCall) Header() http.Header {
  60531. if c.header_ == nil {
  60532. c.header_ = make(http.Header)
  60533. }
  60534. return c.header_
  60535. }
  60536. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  60537. reqHeaders := make(http.Header)
  60538. for k, v := range c.header_ {
  60539. reqHeaders[k] = v
  60540. }
  60541. reqHeaders.Set("User-Agent", c.s.userAgent())
  60542. if c.ifNoneMatch_ != "" {
  60543. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60544. }
  60545. var body io.Reader = nil
  60546. c.urlParams_.Set("alt", alt)
  60547. c.urlParams_.Set("prettyPrint", "false")
  60548. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  60549. urls += "?" + c.urlParams_.Encode()
  60550. req, err := http.NewRequest("GET", urls, body)
  60551. if err != nil {
  60552. return nil, err
  60553. }
  60554. req.Header = reqHeaders
  60555. googleapi.Expand(req.URL, map[string]string{
  60556. "project": c.project,
  60557. })
  60558. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60559. }
  60560. // Do executes the "compute.httpsHealthChecks.list" call.
  60561. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  60562. // non-2xx status code is an error. Response headers are in either
  60563. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  60564. // returned at all) in error.(*googleapi.Error).Header. Use
  60565. // googleapi.IsNotModified to check whether the returned error was
  60566. // because http.StatusNotModified was returned.
  60567. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  60568. gensupport.SetOptions(c.urlParams_, opts...)
  60569. res, err := c.doRequest("json")
  60570. if res != nil && res.StatusCode == http.StatusNotModified {
  60571. if res.Body != nil {
  60572. res.Body.Close()
  60573. }
  60574. return nil, &googleapi.Error{
  60575. Code: res.StatusCode,
  60576. Header: res.Header,
  60577. }
  60578. }
  60579. if err != nil {
  60580. return nil, err
  60581. }
  60582. defer googleapi.CloseBody(res)
  60583. if err := googleapi.CheckResponse(res); err != nil {
  60584. return nil, err
  60585. }
  60586. ret := &HttpsHealthCheckList{
  60587. ServerResponse: googleapi.ServerResponse{
  60588. Header: res.Header,
  60589. HTTPStatusCode: res.StatusCode,
  60590. },
  60591. }
  60592. target := &ret
  60593. if err := gensupport.DecodeResponse(target, res); err != nil {
  60594. return nil, err
  60595. }
  60596. return ret, nil
  60597. // {
  60598. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  60599. // "httpMethod": "GET",
  60600. // "id": "compute.httpsHealthChecks.list",
  60601. // "parameterOrder": [
  60602. // "project"
  60603. // ],
  60604. // "parameters": {
  60605. // "filter": {
  60606. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  60607. // "location": "query",
  60608. // "type": "string"
  60609. // },
  60610. // "maxResults": {
  60611. // "default": "500",
  60612. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  60613. // "format": "uint32",
  60614. // "location": "query",
  60615. // "minimum": "0",
  60616. // "type": "integer"
  60617. // },
  60618. // "orderBy": {
  60619. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  60620. // "location": "query",
  60621. // "type": "string"
  60622. // },
  60623. // "pageToken": {
  60624. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  60625. // "location": "query",
  60626. // "type": "string"
  60627. // },
  60628. // "project": {
  60629. // "description": "Project ID for this request.",
  60630. // "location": "path",
  60631. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60632. // "required": true,
  60633. // "type": "string"
  60634. // }
  60635. // },
  60636. // "path": "{project}/global/httpsHealthChecks",
  60637. // "response": {
  60638. // "$ref": "HttpsHealthCheckList"
  60639. // },
  60640. // "scopes": [
  60641. // "https://www.googleapis.com/auth/cloud-platform",
  60642. // "https://www.googleapis.com/auth/compute",
  60643. // "https://www.googleapis.com/auth/compute.readonly"
  60644. // ]
  60645. // }
  60646. }
  60647. // Pages invokes f for each page of results.
  60648. // A non-nil error returned from f will halt the iteration.
  60649. // The provided context supersedes any context provided to the Context method.
  60650. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  60651. c.ctx_ = ctx
  60652. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60653. for {
  60654. x, err := c.Do()
  60655. if err != nil {
  60656. return err
  60657. }
  60658. if err := f(x); err != nil {
  60659. return err
  60660. }
  60661. if x.NextPageToken == "" {
  60662. return nil
  60663. }
  60664. c.PageToken(x.NextPageToken)
  60665. }
  60666. }
  60667. // method id "compute.httpsHealthChecks.patch":
  60668. type HttpsHealthChecksPatchCall struct {
  60669. s *Service
  60670. project string
  60671. httpsHealthCheck string
  60672. httpshealthcheck *HttpsHealthCheck
  60673. urlParams_ gensupport.URLParams
  60674. ctx_ context.Context
  60675. header_ http.Header
  60676. }
  60677. // Patch: Updates a HttpsHealthCheck resource in the specified project
  60678. // using the data included in the request. This method supports PATCH
  60679. // semantics and uses the JSON merge patch format and processing rules.
  60680. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  60681. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60682. c.project = project
  60683. c.httpsHealthCheck = httpsHealthCheck
  60684. c.httpshealthcheck = httpshealthcheck
  60685. return c
  60686. }
  60687. // RequestId sets the optional parameter "requestId": An optional
  60688. // request ID to identify requests. Specify a unique request ID so that
  60689. // if you must retry your request, the server will know to ignore the
  60690. // request if it has already been completed.
  60691. //
  60692. // For example, consider a situation where you make an initial request
  60693. // and the request times out. If you make the request again with the
  60694. // same request ID, the server can check if original operation with the
  60695. // same request ID was received, and if so, will ignore the second
  60696. // request. This prevents clients from accidentally creating duplicate
  60697. // commitments.
  60698. //
  60699. // The request ID must be a valid UUID with the exception that zero UUID
  60700. // is not supported (00000000-0000-0000-0000-000000000000).
  60701. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  60702. c.urlParams_.Set("requestId", requestId)
  60703. return c
  60704. }
  60705. // Fields allows partial responses to be retrieved. See
  60706. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60707. // for more information.
  60708. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  60709. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60710. return c
  60711. }
  60712. // Context sets the context to be used in this call's Do method. Any
  60713. // pending HTTP request will be aborted if the provided context is
  60714. // canceled.
  60715. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  60716. c.ctx_ = ctx
  60717. return c
  60718. }
  60719. // Header returns an http.Header that can be modified by the caller to
  60720. // add HTTP headers to the request.
  60721. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  60722. if c.header_ == nil {
  60723. c.header_ = make(http.Header)
  60724. }
  60725. return c.header_
  60726. }
  60727. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  60728. reqHeaders := make(http.Header)
  60729. for k, v := range c.header_ {
  60730. reqHeaders[k] = v
  60731. }
  60732. reqHeaders.Set("User-Agent", c.s.userAgent())
  60733. var body io.Reader = nil
  60734. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  60735. if err != nil {
  60736. return nil, err
  60737. }
  60738. reqHeaders.Set("Content-Type", "application/json")
  60739. c.urlParams_.Set("alt", alt)
  60740. c.urlParams_.Set("prettyPrint", "false")
  60741. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  60742. urls += "?" + c.urlParams_.Encode()
  60743. req, err := http.NewRequest("PATCH", urls, body)
  60744. if err != nil {
  60745. return nil, err
  60746. }
  60747. req.Header = reqHeaders
  60748. googleapi.Expand(req.URL, map[string]string{
  60749. "project": c.project,
  60750. "httpsHealthCheck": c.httpsHealthCheck,
  60751. })
  60752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60753. }
  60754. // Do executes the "compute.httpsHealthChecks.patch" call.
  60755. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60756. // status code is an error. Response headers are in either
  60757. // *Operation.ServerResponse.Header or (if a response was returned at
  60758. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60759. // to check whether the returned error was because
  60760. // http.StatusNotModified was returned.
  60761. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60762. gensupport.SetOptions(c.urlParams_, opts...)
  60763. res, err := c.doRequest("json")
  60764. if res != nil && res.StatusCode == http.StatusNotModified {
  60765. if res.Body != nil {
  60766. res.Body.Close()
  60767. }
  60768. return nil, &googleapi.Error{
  60769. Code: res.StatusCode,
  60770. Header: res.Header,
  60771. }
  60772. }
  60773. if err != nil {
  60774. return nil, err
  60775. }
  60776. defer googleapi.CloseBody(res)
  60777. if err := googleapi.CheckResponse(res); err != nil {
  60778. return nil, err
  60779. }
  60780. ret := &Operation{
  60781. ServerResponse: googleapi.ServerResponse{
  60782. Header: res.Header,
  60783. HTTPStatusCode: res.StatusCode,
  60784. },
  60785. }
  60786. target := &ret
  60787. if err := gensupport.DecodeResponse(target, res); err != nil {
  60788. return nil, err
  60789. }
  60790. return ret, nil
  60791. // {
  60792. // "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.",
  60793. // "httpMethod": "PATCH",
  60794. // "id": "compute.httpsHealthChecks.patch",
  60795. // "parameterOrder": [
  60796. // "project",
  60797. // "httpsHealthCheck"
  60798. // ],
  60799. // "parameters": {
  60800. // "httpsHealthCheck": {
  60801. // "description": "Name of the HttpsHealthCheck resource to patch.",
  60802. // "location": "path",
  60803. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60804. // "required": true,
  60805. // "type": "string"
  60806. // },
  60807. // "project": {
  60808. // "description": "Project ID for this request.",
  60809. // "location": "path",
  60810. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60811. // "required": true,
  60812. // "type": "string"
  60813. // },
  60814. // "requestId": {
  60815. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60816. // "location": "query",
  60817. // "type": "string"
  60818. // }
  60819. // },
  60820. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  60821. // "request": {
  60822. // "$ref": "HttpsHealthCheck"
  60823. // },
  60824. // "response": {
  60825. // "$ref": "Operation"
  60826. // },
  60827. // "scopes": [
  60828. // "https://www.googleapis.com/auth/cloud-platform",
  60829. // "https://www.googleapis.com/auth/compute"
  60830. // ]
  60831. // }
  60832. }
  60833. // method id "compute.httpsHealthChecks.testIamPermissions":
  60834. type HttpsHealthChecksTestIamPermissionsCall struct {
  60835. s *Service
  60836. project string
  60837. resource string
  60838. testpermissionsrequest *TestPermissionsRequest
  60839. urlParams_ gensupport.URLParams
  60840. ctx_ context.Context
  60841. header_ http.Header
  60842. }
  60843. // TestIamPermissions: Returns permissions that a caller has on the
  60844. // specified resource.
  60845. func (r *HttpsHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpsHealthChecksTestIamPermissionsCall {
  60846. c := &HttpsHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60847. c.project = project
  60848. c.resource = resource
  60849. c.testpermissionsrequest = testpermissionsrequest
  60850. return c
  60851. }
  60852. // Fields allows partial responses to be retrieved. See
  60853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60854. // for more information.
  60855. func (c *HttpsHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpsHealthChecksTestIamPermissionsCall {
  60856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60857. return c
  60858. }
  60859. // Context sets the context to be used in this call's Do method. Any
  60860. // pending HTTP request will be aborted if the provided context is
  60861. // canceled.
  60862. func (c *HttpsHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpsHealthChecksTestIamPermissionsCall {
  60863. c.ctx_ = ctx
  60864. return c
  60865. }
  60866. // Header returns an http.Header that can be modified by the caller to
  60867. // add HTTP headers to the request.
  60868. func (c *HttpsHealthChecksTestIamPermissionsCall) Header() http.Header {
  60869. if c.header_ == nil {
  60870. c.header_ = make(http.Header)
  60871. }
  60872. return c.header_
  60873. }
  60874. func (c *HttpsHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  60875. reqHeaders := make(http.Header)
  60876. for k, v := range c.header_ {
  60877. reqHeaders[k] = v
  60878. }
  60879. reqHeaders.Set("User-Agent", c.s.userAgent())
  60880. var body io.Reader = nil
  60881. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  60882. if err != nil {
  60883. return nil, err
  60884. }
  60885. reqHeaders.Set("Content-Type", "application/json")
  60886. c.urlParams_.Set("alt", alt)
  60887. c.urlParams_.Set("prettyPrint", "false")
  60888. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{resource}/testIamPermissions")
  60889. urls += "?" + c.urlParams_.Encode()
  60890. req, err := http.NewRequest("POST", urls, body)
  60891. if err != nil {
  60892. return nil, err
  60893. }
  60894. req.Header = reqHeaders
  60895. googleapi.Expand(req.URL, map[string]string{
  60896. "project": c.project,
  60897. "resource": c.resource,
  60898. })
  60899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60900. }
  60901. // Do executes the "compute.httpsHealthChecks.testIamPermissions" call.
  60902. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  60903. // non-2xx status code is an error. Response headers are in either
  60904. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  60905. // returned at all) in error.(*googleapi.Error).Header. Use
  60906. // googleapi.IsNotModified to check whether the returned error was
  60907. // because http.StatusNotModified was returned.
  60908. func (c *HttpsHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  60909. gensupport.SetOptions(c.urlParams_, opts...)
  60910. res, err := c.doRequest("json")
  60911. if res != nil && res.StatusCode == http.StatusNotModified {
  60912. if res.Body != nil {
  60913. res.Body.Close()
  60914. }
  60915. return nil, &googleapi.Error{
  60916. Code: res.StatusCode,
  60917. Header: res.Header,
  60918. }
  60919. }
  60920. if err != nil {
  60921. return nil, err
  60922. }
  60923. defer googleapi.CloseBody(res)
  60924. if err := googleapi.CheckResponse(res); err != nil {
  60925. return nil, err
  60926. }
  60927. ret := &TestPermissionsResponse{
  60928. ServerResponse: googleapi.ServerResponse{
  60929. Header: res.Header,
  60930. HTTPStatusCode: res.StatusCode,
  60931. },
  60932. }
  60933. target := &ret
  60934. if err := gensupport.DecodeResponse(target, res); err != nil {
  60935. return nil, err
  60936. }
  60937. return ret, nil
  60938. // {
  60939. // "description": "Returns permissions that a caller has on the specified resource.",
  60940. // "httpMethod": "POST",
  60941. // "id": "compute.httpsHealthChecks.testIamPermissions",
  60942. // "parameterOrder": [
  60943. // "project",
  60944. // "resource"
  60945. // ],
  60946. // "parameters": {
  60947. // "project": {
  60948. // "description": "Project ID for this request.",
  60949. // "location": "path",
  60950. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60951. // "required": true,
  60952. // "type": "string"
  60953. // },
  60954. // "resource": {
  60955. // "description": "Name or id of the resource for this request.",
  60956. // "location": "path",
  60957. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60958. // "required": true,
  60959. // "type": "string"
  60960. // }
  60961. // },
  60962. // "path": "{project}/global/httpsHealthChecks/{resource}/testIamPermissions",
  60963. // "request": {
  60964. // "$ref": "TestPermissionsRequest"
  60965. // },
  60966. // "response": {
  60967. // "$ref": "TestPermissionsResponse"
  60968. // },
  60969. // "scopes": [
  60970. // "https://www.googleapis.com/auth/cloud-platform",
  60971. // "https://www.googleapis.com/auth/compute",
  60972. // "https://www.googleapis.com/auth/compute.readonly"
  60973. // ]
  60974. // }
  60975. }
  60976. // method id "compute.httpsHealthChecks.update":
  60977. type HttpsHealthChecksUpdateCall struct {
  60978. s *Service
  60979. project string
  60980. httpsHealthCheck string
  60981. httpshealthcheck *HttpsHealthCheck
  60982. urlParams_ gensupport.URLParams
  60983. ctx_ context.Context
  60984. header_ http.Header
  60985. }
  60986. // Update: Updates a HttpsHealthCheck resource in the specified project
  60987. // using the data included in the request.
  60988. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  60989. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60990. c.project = project
  60991. c.httpsHealthCheck = httpsHealthCheck
  60992. c.httpshealthcheck = httpshealthcheck
  60993. return c
  60994. }
  60995. // RequestId sets the optional parameter "requestId": An optional
  60996. // request ID to identify requests. Specify a unique request ID so that
  60997. // if you must retry your request, the server will know to ignore the
  60998. // request if it has already been completed.
  60999. //
  61000. // For example, consider a situation where you make an initial request
  61001. // and the request times out. If you make the request again with the
  61002. // same request ID, the server can check if original operation with the
  61003. // same request ID was received, and if so, will ignore the second
  61004. // request. This prevents clients from accidentally creating duplicate
  61005. // commitments.
  61006. //
  61007. // The request ID must be a valid UUID with the exception that zero UUID
  61008. // is not supported (00000000-0000-0000-0000-000000000000).
  61009. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  61010. c.urlParams_.Set("requestId", requestId)
  61011. return c
  61012. }
  61013. // Fields allows partial responses to be retrieved. See
  61014. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61015. // for more information.
  61016. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  61017. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61018. return c
  61019. }
  61020. // Context sets the context to be used in this call's Do method. Any
  61021. // pending HTTP request will be aborted if the provided context is
  61022. // canceled.
  61023. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  61024. c.ctx_ = ctx
  61025. return c
  61026. }
  61027. // Header returns an http.Header that can be modified by the caller to
  61028. // add HTTP headers to the request.
  61029. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  61030. if c.header_ == nil {
  61031. c.header_ = make(http.Header)
  61032. }
  61033. return c.header_
  61034. }
  61035. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  61036. reqHeaders := make(http.Header)
  61037. for k, v := range c.header_ {
  61038. reqHeaders[k] = v
  61039. }
  61040. reqHeaders.Set("User-Agent", c.s.userAgent())
  61041. var body io.Reader = nil
  61042. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  61043. if err != nil {
  61044. return nil, err
  61045. }
  61046. reqHeaders.Set("Content-Type", "application/json")
  61047. c.urlParams_.Set("alt", alt)
  61048. c.urlParams_.Set("prettyPrint", "false")
  61049. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  61050. urls += "?" + c.urlParams_.Encode()
  61051. req, err := http.NewRequest("PUT", urls, body)
  61052. if err != nil {
  61053. return nil, err
  61054. }
  61055. req.Header = reqHeaders
  61056. googleapi.Expand(req.URL, map[string]string{
  61057. "project": c.project,
  61058. "httpsHealthCheck": c.httpsHealthCheck,
  61059. })
  61060. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61061. }
  61062. // Do executes the "compute.httpsHealthChecks.update" call.
  61063. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61064. // status code is an error. Response headers are in either
  61065. // *Operation.ServerResponse.Header or (if a response was returned at
  61066. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61067. // to check whether the returned error was because
  61068. // http.StatusNotModified was returned.
  61069. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61070. gensupport.SetOptions(c.urlParams_, opts...)
  61071. res, err := c.doRequest("json")
  61072. if res != nil && res.StatusCode == http.StatusNotModified {
  61073. if res.Body != nil {
  61074. res.Body.Close()
  61075. }
  61076. return nil, &googleapi.Error{
  61077. Code: res.StatusCode,
  61078. Header: res.Header,
  61079. }
  61080. }
  61081. if err != nil {
  61082. return nil, err
  61083. }
  61084. defer googleapi.CloseBody(res)
  61085. if err := googleapi.CheckResponse(res); err != nil {
  61086. return nil, err
  61087. }
  61088. ret := &Operation{
  61089. ServerResponse: googleapi.ServerResponse{
  61090. Header: res.Header,
  61091. HTTPStatusCode: res.StatusCode,
  61092. },
  61093. }
  61094. target := &ret
  61095. if err := gensupport.DecodeResponse(target, res); err != nil {
  61096. return nil, err
  61097. }
  61098. return ret, nil
  61099. // {
  61100. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  61101. // "httpMethod": "PUT",
  61102. // "id": "compute.httpsHealthChecks.update",
  61103. // "parameterOrder": [
  61104. // "project",
  61105. // "httpsHealthCheck"
  61106. // ],
  61107. // "parameters": {
  61108. // "httpsHealthCheck": {
  61109. // "description": "Name of the HttpsHealthCheck resource to update.",
  61110. // "location": "path",
  61111. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61112. // "required": true,
  61113. // "type": "string"
  61114. // },
  61115. // "project": {
  61116. // "description": "Project ID for this request.",
  61117. // "location": "path",
  61118. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61119. // "required": true,
  61120. // "type": "string"
  61121. // },
  61122. // "requestId": {
  61123. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61124. // "location": "query",
  61125. // "type": "string"
  61126. // }
  61127. // },
  61128. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  61129. // "request": {
  61130. // "$ref": "HttpsHealthCheck"
  61131. // },
  61132. // "response": {
  61133. // "$ref": "Operation"
  61134. // },
  61135. // "scopes": [
  61136. // "https://www.googleapis.com/auth/cloud-platform",
  61137. // "https://www.googleapis.com/auth/compute"
  61138. // ]
  61139. // }
  61140. }
  61141. // method id "compute.images.delete":
  61142. type ImagesDeleteCall struct {
  61143. s *Service
  61144. project string
  61145. image string
  61146. urlParams_ gensupport.URLParams
  61147. ctx_ context.Context
  61148. header_ http.Header
  61149. }
  61150. // Delete: Deletes the specified image.
  61151. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  61152. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  61153. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61154. c.project = project
  61155. c.image = image
  61156. return c
  61157. }
  61158. // RequestId sets the optional parameter "requestId": An optional
  61159. // request ID to identify requests. Specify a unique request ID so that
  61160. // if you must retry your request, the server will know to ignore the
  61161. // request if it has already been completed.
  61162. //
  61163. // For example, consider a situation where you make an initial request
  61164. // and the request times out. If you make the request again with the
  61165. // same request ID, the server can check if original operation with the
  61166. // same request ID was received, and if so, will ignore the second
  61167. // request. This prevents clients from accidentally creating duplicate
  61168. // commitments.
  61169. //
  61170. // The request ID must be a valid UUID with the exception that zero UUID
  61171. // is not supported (00000000-0000-0000-0000-000000000000).
  61172. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  61173. c.urlParams_.Set("requestId", requestId)
  61174. return c
  61175. }
  61176. // Fields allows partial responses to be retrieved. See
  61177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61178. // for more information.
  61179. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  61180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61181. return c
  61182. }
  61183. // Context sets the context to be used in this call's Do method. Any
  61184. // pending HTTP request will be aborted if the provided context is
  61185. // canceled.
  61186. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  61187. c.ctx_ = ctx
  61188. return c
  61189. }
  61190. // Header returns an http.Header that can be modified by the caller to
  61191. // add HTTP headers to the request.
  61192. func (c *ImagesDeleteCall) Header() http.Header {
  61193. if c.header_ == nil {
  61194. c.header_ = make(http.Header)
  61195. }
  61196. return c.header_
  61197. }
  61198. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  61199. reqHeaders := make(http.Header)
  61200. for k, v := range c.header_ {
  61201. reqHeaders[k] = v
  61202. }
  61203. reqHeaders.Set("User-Agent", c.s.userAgent())
  61204. var body io.Reader = nil
  61205. c.urlParams_.Set("alt", alt)
  61206. c.urlParams_.Set("prettyPrint", "false")
  61207. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  61208. urls += "?" + c.urlParams_.Encode()
  61209. req, err := http.NewRequest("DELETE", urls, body)
  61210. if err != nil {
  61211. return nil, err
  61212. }
  61213. req.Header = reqHeaders
  61214. googleapi.Expand(req.URL, map[string]string{
  61215. "project": c.project,
  61216. "image": c.image,
  61217. })
  61218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61219. }
  61220. // Do executes the "compute.images.delete" call.
  61221. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61222. // status code is an error. Response headers are in either
  61223. // *Operation.ServerResponse.Header or (if a response was returned at
  61224. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61225. // to check whether the returned error was because
  61226. // http.StatusNotModified was returned.
  61227. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61228. gensupport.SetOptions(c.urlParams_, opts...)
  61229. res, err := c.doRequest("json")
  61230. if res != nil && res.StatusCode == http.StatusNotModified {
  61231. if res.Body != nil {
  61232. res.Body.Close()
  61233. }
  61234. return nil, &googleapi.Error{
  61235. Code: res.StatusCode,
  61236. Header: res.Header,
  61237. }
  61238. }
  61239. if err != nil {
  61240. return nil, err
  61241. }
  61242. defer googleapi.CloseBody(res)
  61243. if err := googleapi.CheckResponse(res); err != nil {
  61244. return nil, err
  61245. }
  61246. ret := &Operation{
  61247. ServerResponse: googleapi.ServerResponse{
  61248. Header: res.Header,
  61249. HTTPStatusCode: res.StatusCode,
  61250. },
  61251. }
  61252. target := &ret
  61253. if err := gensupport.DecodeResponse(target, res); err != nil {
  61254. return nil, err
  61255. }
  61256. return ret, nil
  61257. // {
  61258. // "description": "Deletes the specified image.",
  61259. // "httpMethod": "DELETE",
  61260. // "id": "compute.images.delete",
  61261. // "parameterOrder": [
  61262. // "project",
  61263. // "image"
  61264. // ],
  61265. // "parameters": {
  61266. // "image": {
  61267. // "description": "Name of the image resource to delete.",
  61268. // "location": "path",
  61269. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61270. // "required": true,
  61271. // "type": "string"
  61272. // },
  61273. // "project": {
  61274. // "description": "Project ID for this request.",
  61275. // "location": "path",
  61276. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61277. // "required": true,
  61278. // "type": "string"
  61279. // },
  61280. // "requestId": {
  61281. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61282. // "location": "query",
  61283. // "type": "string"
  61284. // }
  61285. // },
  61286. // "path": "{project}/global/images/{image}",
  61287. // "response": {
  61288. // "$ref": "Operation"
  61289. // },
  61290. // "scopes": [
  61291. // "https://www.googleapis.com/auth/cloud-platform",
  61292. // "https://www.googleapis.com/auth/compute"
  61293. // ]
  61294. // }
  61295. }
  61296. // method id "compute.images.deprecate":
  61297. type ImagesDeprecateCall struct {
  61298. s *Service
  61299. project string
  61300. image string
  61301. deprecationstatus *DeprecationStatus
  61302. urlParams_ gensupport.URLParams
  61303. ctx_ context.Context
  61304. header_ http.Header
  61305. }
  61306. // Deprecate: Sets the deprecation status of an image.
  61307. //
  61308. // If an empty request body is given, clears the deprecation status
  61309. // instead.
  61310. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  61311. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  61312. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61313. c.project = project
  61314. c.image = image
  61315. c.deprecationstatus = deprecationstatus
  61316. return c
  61317. }
  61318. // RequestId sets the optional parameter "requestId": An optional
  61319. // request ID to identify requests. Specify a unique request ID so that
  61320. // if you must retry your request, the server will know to ignore the
  61321. // request if it has already been completed.
  61322. //
  61323. // For example, consider a situation where you make an initial request
  61324. // and the request times out. If you make the request again with the
  61325. // same request ID, the server can check if original operation with the
  61326. // same request ID was received, and if so, will ignore the second
  61327. // request. This prevents clients from accidentally creating duplicate
  61328. // commitments.
  61329. //
  61330. // The request ID must be a valid UUID with the exception that zero UUID
  61331. // is not supported (00000000-0000-0000-0000-000000000000).
  61332. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  61333. c.urlParams_.Set("requestId", requestId)
  61334. return c
  61335. }
  61336. // Fields allows partial responses to be retrieved. See
  61337. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61338. // for more information.
  61339. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  61340. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61341. return c
  61342. }
  61343. // Context sets the context to be used in this call's Do method. Any
  61344. // pending HTTP request will be aborted if the provided context is
  61345. // canceled.
  61346. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  61347. c.ctx_ = ctx
  61348. return c
  61349. }
  61350. // Header returns an http.Header that can be modified by the caller to
  61351. // add HTTP headers to the request.
  61352. func (c *ImagesDeprecateCall) Header() http.Header {
  61353. if c.header_ == nil {
  61354. c.header_ = make(http.Header)
  61355. }
  61356. return c.header_
  61357. }
  61358. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  61359. reqHeaders := make(http.Header)
  61360. for k, v := range c.header_ {
  61361. reqHeaders[k] = v
  61362. }
  61363. reqHeaders.Set("User-Agent", c.s.userAgent())
  61364. var body io.Reader = nil
  61365. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  61366. if err != nil {
  61367. return nil, err
  61368. }
  61369. reqHeaders.Set("Content-Type", "application/json")
  61370. c.urlParams_.Set("alt", alt)
  61371. c.urlParams_.Set("prettyPrint", "false")
  61372. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  61373. urls += "?" + c.urlParams_.Encode()
  61374. req, err := http.NewRequest("POST", urls, body)
  61375. if err != nil {
  61376. return nil, err
  61377. }
  61378. req.Header = reqHeaders
  61379. googleapi.Expand(req.URL, map[string]string{
  61380. "project": c.project,
  61381. "image": c.image,
  61382. })
  61383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61384. }
  61385. // Do executes the "compute.images.deprecate" call.
  61386. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61387. // status code is an error. Response headers are in either
  61388. // *Operation.ServerResponse.Header or (if a response was returned at
  61389. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61390. // to check whether the returned error was because
  61391. // http.StatusNotModified was returned.
  61392. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61393. gensupport.SetOptions(c.urlParams_, opts...)
  61394. res, err := c.doRequest("json")
  61395. if res != nil && res.StatusCode == http.StatusNotModified {
  61396. if res.Body != nil {
  61397. res.Body.Close()
  61398. }
  61399. return nil, &googleapi.Error{
  61400. Code: res.StatusCode,
  61401. Header: res.Header,
  61402. }
  61403. }
  61404. if err != nil {
  61405. return nil, err
  61406. }
  61407. defer googleapi.CloseBody(res)
  61408. if err := googleapi.CheckResponse(res); err != nil {
  61409. return nil, err
  61410. }
  61411. ret := &Operation{
  61412. ServerResponse: googleapi.ServerResponse{
  61413. Header: res.Header,
  61414. HTTPStatusCode: res.StatusCode,
  61415. },
  61416. }
  61417. target := &ret
  61418. if err := gensupport.DecodeResponse(target, res); err != nil {
  61419. return nil, err
  61420. }
  61421. return ret, nil
  61422. // {
  61423. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  61424. // "httpMethod": "POST",
  61425. // "id": "compute.images.deprecate",
  61426. // "parameterOrder": [
  61427. // "project",
  61428. // "image"
  61429. // ],
  61430. // "parameters": {
  61431. // "image": {
  61432. // "description": "Image name.",
  61433. // "location": "path",
  61434. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61435. // "required": true,
  61436. // "type": "string"
  61437. // },
  61438. // "project": {
  61439. // "description": "Project ID for this request.",
  61440. // "location": "path",
  61441. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61442. // "required": true,
  61443. // "type": "string"
  61444. // },
  61445. // "requestId": {
  61446. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61447. // "location": "query",
  61448. // "type": "string"
  61449. // }
  61450. // },
  61451. // "path": "{project}/global/images/{image}/deprecate",
  61452. // "request": {
  61453. // "$ref": "DeprecationStatus"
  61454. // },
  61455. // "response": {
  61456. // "$ref": "Operation"
  61457. // },
  61458. // "scopes": [
  61459. // "https://www.googleapis.com/auth/cloud-platform",
  61460. // "https://www.googleapis.com/auth/compute"
  61461. // ]
  61462. // }
  61463. }
  61464. // method id "compute.images.get":
  61465. type ImagesGetCall struct {
  61466. s *Service
  61467. project string
  61468. image string
  61469. urlParams_ gensupport.URLParams
  61470. ifNoneMatch_ string
  61471. ctx_ context.Context
  61472. header_ http.Header
  61473. }
  61474. // Get: Returns the specified image. Gets a list of available images by
  61475. // making a list() request.
  61476. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  61477. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  61478. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61479. c.project = project
  61480. c.image = image
  61481. return c
  61482. }
  61483. // Fields allows partial responses to be retrieved. See
  61484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61485. // for more information.
  61486. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  61487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61488. return c
  61489. }
  61490. // IfNoneMatch sets the optional parameter which makes the operation
  61491. // fail if the object's ETag matches the given value. This is useful for
  61492. // getting updates only after the object has changed since the last
  61493. // request. Use googleapi.IsNotModified to check whether the response
  61494. // error from Do is the result of In-None-Match.
  61495. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  61496. c.ifNoneMatch_ = entityTag
  61497. return c
  61498. }
  61499. // Context sets the context to be used in this call's Do method. Any
  61500. // pending HTTP request will be aborted if the provided context is
  61501. // canceled.
  61502. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  61503. c.ctx_ = ctx
  61504. return c
  61505. }
  61506. // Header returns an http.Header that can be modified by the caller to
  61507. // add HTTP headers to the request.
  61508. func (c *ImagesGetCall) Header() http.Header {
  61509. if c.header_ == nil {
  61510. c.header_ = make(http.Header)
  61511. }
  61512. return c.header_
  61513. }
  61514. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  61515. reqHeaders := make(http.Header)
  61516. for k, v := range c.header_ {
  61517. reqHeaders[k] = v
  61518. }
  61519. reqHeaders.Set("User-Agent", c.s.userAgent())
  61520. if c.ifNoneMatch_ != "" {
  61521. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61522. }
  61523. var body io.Reader = nil
  61524. c.urlParams_.Set("alt", alt)
  61525. c.urlParams_.Set("prettyPrint", "false")
  61526. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  61527. urls += "?" + c.urlParams_.Encode()
  61528. req, err := http.NewRequest("GET", urls, body)
  61529. if err != nil {
  61530. return nil, err
  61531. }
  61532. req.Header = reqHeaders
  61533. googleapi.Expand(req.URL, map[string]string{
  61534. "project": c.project,
  61535. "image": c.image,
  61536. })
  61537. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61538. }
  61539. // Do executes the "compute.images.get" call.
  61540. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  61541. // code is an error. Response headers are in either
  61542. // *Image.ServerResponse.Header or (if a response was returned at all)
  61543. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  61544. // check whether the returned error was because http.StatusNotModified
  61545. // was returned.
  61546. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  61547. gensupport.SetOptions(c.urlParams_, opts...)
  61548. res, err := c.doRequest("json")
  61549. if res != nil && res.StatusCode == http.StatusNotModified {
  61550. if res.Body != nil {
  61551. res.Body.Close()
  61552. }
  61553. return nil, &googleapi.Error{
  61554. Code: res.StatusCode,
  61555. Header: res.Header,
  61556. }
  61557. }
  61558. if err != nil {
  61559. return nil, err
  61560. }
  61561. defer googleapi.CloseBody(res)
  61562. if err := googleapi.CheckResponse(res); err != nil {
  61563. return nil, err
  61564. }
  61565. ret := &Image{
  61566. ServerResponse: googleapi.ServerResponse{
  61567. Header: res.Header,
  61568. HTTPStatusCode: res.StatusCode,
  61569. },
  61570. }
  61571. target := &ret
  61572. if err := gensupport.DecodeResponse(target, res); err != nil {
  61573. return nil, err
  61574. }
  61575. return ret, nil
  61576. // {
  61577. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  61578. // "httpMethod": "GET",
  61579. // "id": "compute.images.get",
  61580. // "parameterOrder": [
  61581. // "project",
  61582. // "image"
  61583. // ],
  61584. // "parameters": {
  61585. // "image": {
  61586. // "description": "Name of the image resource to return.",
  61587. // "location": "path",
  61588. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61589. // "required": true,
  61590. // "type": "string"
  61591. // },
  61592. // "project": {
  61593. // "description": "Project ID for this request.",
  61594. // "location": "path",
  61595. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61596. // "required": true,
  61597. // "type": "string"
  61598. // }
  61599. // },
  61600. // "path": "{project}/global/images/{image}",
  61601. // "response": {
  61602. // "$ref": "Image"
  61603. // },
  61604. // "scopes": [
  61605. // "https://www.googleapis.com/auth/cloud-platform",
  61606. // "https://www.googleapis.com/auth/compute",
  61607. // "https://www.googleapis.com/auth/compute.readonly"
  61608. // ]
  61609. // }
  61610. }
  61611. // method id "compute.images.getFromFamily":
  61612. type ImagesGetFromFamilyCall struct {
  61613. s *Service
  61614. project string
  61615. family string
  61616. urlParams_ gensupport.URLParams
  61617. ifNoneMatch_ string
  61618. ctx_ context.Context
  61619. header_ http.Header
  61620. }
  61621. // GetFromFamily: Returns the latest image that is part of an image
  61622. // family and is not deprecated.
  61623. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  61624. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61625. c.project = project
  61626. c.family = family
  61627. return c
  61628. }
  61629. // Fields allows partial responses to be retrieved. See
  61630. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61631. // for more information.
  61632. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  61633. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61634. return c
  61635. }
  61636. // IfNoneMatch sets the optional parameter which makes the operation
  61637. // fail if the object's ETag matches the given value. This is useful for
  61638. // getting updates only after the object has changed since the last
  61639. // request. Use googleapi.IsNotModified to check whether the response
  61640. // error from Do is the result of In-None-Match.
  61641. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  61642. c.ifNoneMatch_ = entityTag
  61643. return c
  61644. }
  61645. // Context sets the context to be used in this call's Do method. Any
  61646. // pending HTTP request will be aborted if the provided context is
  61647. // canceled.
  61648. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  61649. c.ctx_ = ctx
  61650. return c
  61651. }
  61652. // Header returns an http.Header that can be modified by the caller to
  61653. // add HTTP headers to the request.
  61654. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  61655. if c.header_ == nil {
  61656. c.header_ = make(http.Header)
  61657. }
  61658. return c.header_
  61659. }
  61660. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  61661. reqHeaders := make(http.Header)
  61662. for k, v := range c.header_ {
  61663. reqHeaders[k] = v
  61664. }
  61665. reqHeaders.Set("User-Agent", c.s.userAgent())
  61666. if c.ifNoneMatch_ != "" {
  61667. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61668. }
  61669. var body io.Reader = nil
  61670. c.urlParams_.Set("alt", alt)
  61671. c.urlParams_.Set("prettyPrint", "false")
  61672. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  61673. urls += "?" + c.urlParams_.Encode()
  61674. req, err := http.NewRequest("GET", urls, body)
  61675. if err != nil {
  61676. return nil, err
  61677. }
  61678. req.Header = reqHeaders
  61679. googleapi.Expand(req.URL, map[string]string{
  61680. "project": c.project,
  61681. "family": c.family,
  61682. })
  61683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61684. }
  61685. // Do executes the "compute.images.getFromFamily" call.
  61686. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  61687. // code is an error. Response headers are in either
  61688. // *Image.ServerResponse.Header or (if a response was returned at all)
  61689. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  61690. // check whether the returned error was because http.StatusNotModified
  61691. // was returned.
  61692. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  61693. gensupport.SetOptions(c.urlParams_, opts...)
  61694. res, err := c.doRequest("json")
  61695. if res != nil && res.StatusCode == http.StatusNotModified {
  61696. if res.Body != nil {
  61697. res.Body.Close()
  61698. }
  61699. return nil, &googleapi.Error{
  61700. Code: res.StatusCode,
  61701. Header: res.Header,
  61702. }
  61703. }
  61704. if err != nil {
  61705. return nil, err
  61706. }
  61707. defer googleapi.CloseBody(res)
  61708. if err := googleapi.CheckResponse(res); err != nil {
  61709. return nil, err
  61710. }
  61711. ret := &Image{
  61712. ServerResponse: googleapi.ServerResponse{
  61713. Header: res.Header,
  61714. HTTPStatusCode: res.StatusCode,
  61715. },
  61716. }
  61717. target := &ret
  61718. if err := gensupport.DecodeResponse(target, res); err != nil {
  61719. return nil, err
  61720. }
  61721. return ret, nil
  61722. // {
  61723. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  61724. // "httpMethod": "GET",
  61725. // "id": "compute.images.getFromFamily",
  61726. // "parameterOrder": [
  61727. // "project",
  61728. // "family"
  61729. // ],
  61730. // "parameters": {
  61731. // "family": {
  61732. // "description": "Name of the image family to search for.",
  61733. // "location": "path",
  61734. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61735. // "required": true,
  61736. // "type": "string"
  61737. // },
  61738. // "project": {
  61739. // "description": "Project ID for this request.",
  61740. // "location": "path",
  61741. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61742. // "required": true,
  61743. // "type": "string"
  61744. // }
  61745. // },
  61746. // "path": "{project}/global/images/family/{family}",
  61747. // "response": {
  61748. // "$ref": "Image"
  61749. // },
  61750. // "scopes": [
  61751. // "https://www.googleapis.com/auth/cloud-platform",
  61752. // "https://www.googleapis.com/auth/compute",
  61753. // "https://www.googleapis.com/auth/compute.readonly"
  61754. // ]
  61755. // }
  61756. }
  61757. // method id "compute.images.getIamPolicy":
  61758. type ImagesGetIamPolicyCall struct {
  61759. s *Service
  61760. project string
  61761. resource string
  61762. urlParams_ gensupport.URLParams
  61763. ifNoneMatch_ string
  61764. ctx_ context.Context
  61765. header_ http.Header
  61766. }
  61767. // GetIamPolicy: Gets the access control policy for a resource. May be
  61768. // empty if no such policy or resource exists.
  61769. func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
  61770. c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61771. c.project = project
  61772. c.resource = resource
  61773. return c
  61774. }
  61775. // Fields allows partial responses to be retrieved. See
  61776. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61777. // for more information.
  61778. func (c *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
  61779. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61780. return c
  61781. }
  61782. // IfNoneMatch sets the optional parameter which makes the operation
  61783. // fail if the object's ETag matches the given value. This is useful for
  61784. // getting updates only after the object has changed since the last
  61785. // request. Use googleapi.IsNotModified to check whether the response
  61786. // error from Do is the result of In-None-Match.
  61787. func (c *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
  61788. c.ifNoneMatch_ = entityTag
  61789. return c
  61790. }
  61791. // Context sets the context to be used in this call's Do method. Any
  61792. // pending HTTP request will be aborted if the provided context is
  61793. // canceled.
  61794. func (c *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
  61795. c.ctx_ = ctx
  61796. return c
  61797. }
  61798. // Header returns an http.Header that can be modified by the caller to
  61799. // add HTTP headers to the request.
  61800. func (c *ImagesGetIamPolicyCall) Header() http.Header {
  61801. if c.header_ == nil {
  61802. c.header_ = make(http.Header)
  61803. }
  61804. return c.header_
  61805. }
  61806. func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  61807. reqHeaders := make(http.Header)
  61808. for k, v := range c.header_ {
  61809. reqHeaders[k] = v
  61810. }
  61811. reqHeaders.Set("User-Agent", c.s.userAgent())
  61812. if c.ifNoneMatch_ != "" {
  61813. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61814. }
  61815. var body io.Reader = nil
  61816. c.urlParams_.Set("alt", alt)
  61817. c.urlParams_.Set("prettyPrint", "false")
  61818. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/getIamPolicy")
  61819. urls += "?" + c.urlParams_.Encode()
  61820. req, err := http.NewRequest("GET", urls, body)
  61821. if err != nil {
  61822. return nil, err
  61823. }
  61824. req.Header = reqHeaders
  61825. googleapi.Expand(req.URL, map[string]string{
  61826. "project": c.project,
  61827. "resource": c.resource,
  61828. })
  61829. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61830. }
  61831. // Do executes the "compute.images.getIamPolicy" call.
  61832. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  61833. // code is an error. Response headers are in either
  61834. // *Policy.ServerResponse.Header or (if a response was returned at all)
  61835. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  61836. // check whether the returned error was because http.StatusNotModified
  61837. // was returned.
  61838. func (c *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  61839. gensupport.SetOptions(c.urlParams_, opts...)
  61840. res, err := c.doRequest("json")
  61841. if res != nil && res.StatusCode == http.StatusNotModified {
  61842. if res.Body != nil {
  61843. res.Body.Close()
  61844. }
  61845. return nil, &googleapi.Error{
  61846. Code: res.StatusCode,
  61847. Header: res.Header,
  61848. }
  61849. }
  61850. if err != nil {
  61851. return nil, err
  61852. }
  61853. defer googleapi.CloseBody(res)
  61854. if err := googleapi.CheckResponse(res); err != nil {
  61855. return nil, err
  61856. }
  61857. ret := &Policy{
  61858. ServerResponse: googleapi.ServerResponse{
  61859. Header: res.Header,
  61860. HTTPStatusCode: res.StatusCode,
  61861. },
  61862. }
  61863. target := &ret
  61864. if err := gensupport.DecodeResponse(target, res); err != nil {
  61865. return nil, err
  61866. }
  61867. return ret, nil
  61868. // {
  61869. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  61870. // "httpMethod": "GET",
  61871. // "id": "compute.images.getIamPolicy",
  61872. // "parameterOrder": [
  61873. // "project",
  61874. // "resource"
  61875. // ],
  61876. // "parameters": {
  61877. // "project": {
  61878. // "description": "Project ID for this request.",
  61879. // "location": "path",
  61880. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61881. // "required": true,
  61882. // "type": "string"
  61883. // },
  61884. // "resource": {
  61885. // "description": "Name or id of the resource for this request.",
  61886. // "location": "path",
  61887. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61888. // "required": true,
  61889. // "type": "string"
  61890. // }
  61891. // },
  61892. // "path": "{project}/global/images/{resource}/getIamPolicy",
  61893. // "response": {
  61894. // "$ref": "Policy"
  61895. // },
  61896. // "scopes": [
  61897. // "https://www.googleapis.com/auth/cloud-platform",
  61898. // "https://www.googleapis.com/auth/compute",
  61899. // "https://www.googleapis.com/auth/compute.readonly"
  61900. // ]
  61901. // }
  61902. }
  61903. // method id "compute.images.insert":
  61904. type ImagesInsertCall struct {
  61905. s *Service
  61906. project string
  61907. image *Image
  61908. urlParams_ gensupport.URLParams
  61909. ctx_ context.Context
  61910. header_ http.Header
  61911. }
  61912. // Insert: Creates an image in the specified project using the data
  61913. // included in the request.
  61914. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  61915. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  61916. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61917. c.project = project
  61918. c.image = image
  61919. return c
  61920. }
  61921. // ForceCreate sets the optional parameter "forceCreate": Force image
  61922. // creation if true.
  61923. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  61924. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  61925. return c
  61926. }
  61927. // RequestId sets the optional parameter "requestId": An optional
  61928. // request ID to identify requests. Specify a unique request ID so that
  61929. // if you must retry your request, the server will know to ignore the
  61930. // request if it has already been completed.
  61931. //
  61932. // For example, consider a situation where you make an initial request
  61933. // and the request times out. If you make the request again with the
  61934. // same request ID, the server can check if original operation with the
  61935. // same request ID was received, and if so, will ignore the second
  61936. // request. This prevents clients from accidentally creating duplicate
  61937. // commitments.
  61938. //
  61939. // The request ID must be a valid UUID with the exception that zero UUID
  61940. // is not supported (00000000-0000-0000-0000-000000000000).
  61941. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  61942. c.urlParams_.Set("requestId", requestId)
  61943. return c
  61944. }
  61945. // Fields allows partial responses to be retrieved. See
  61946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61947. // for more information.
  61948. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  61949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61950. return c
  61951. }
  61952. // Context sets the context to be used in this call's Do method. Any
  61953. // pending HTTP request will be aborted if the provided context is
  61954. // canceled.
  61955. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  61956. c.ctx_ = ctx
  61957. return c
  61958. }
  61959. // Header returns an http.Header that can be modified by the caller to
  61960. // add HTTP headers to the request.
  61961. func (c *ImagesInsertCall) Header() http.Header {
  61962. if c.header_ == nil {
  61963. c.header_ = make(http.Header)
  61964. }
  61965. return c.header_
  61966. }
  61967. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  61968. reqHeaders := make(http.Header)
  61969. for k, v := range c.header_ {
  61970. reqHeaders[k] = v
  61971. }
  61972. reqHeaders.Set("User-Agent", c.s.userAgent())
  61973. var body io.Reader = nil
  61974. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  61975. if err != nil {
  61976. return nil, err
  61977. }
  61978. reqHeaders.Set("Content-Type", "application/json")
  61979. c.urlParams_.Set("alt", alt)
  61980. c.urlParams_.Set("prettyPrint", "false")
  61981. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  61982. urls += "?" + c.urlParams_.Encode()
  61983. req, err := http.NewRequest("POST", urls, body)
  61984. if err != nil {
  61985. return nil, err
  61986. }
  61987. req.Header = reqHeaders
  61988. googleapi.Expand(req.URL, map[string]string{
  61989. "project": c.project,
  61990. })
  61991. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61992. }
  61993. // Do executes the "compute.images.insert" call.
  61994. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61995. // status code is an error. Response headers are in either
  61996. // *Operation.ServerResponse.Header or (if a response was returned at
  61997. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61998. // to check whether the returned error was because
  61999. // http.StatusNotModified was returned.
  62000. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62001. gensupport.SetOptions(c.urlParams_, opts...)
  62002. res, err := c.doRequest("json")
  62003. if res != nil && res.StatusCode == http.StatusNotModified {
  62004. if res.Body != nil {
  62005. res.Body.Close()
  62006. }
  62007. return nil, &googleapi.Error{
  62008. Code: res.StatusCode,
  62009. Header: res.Header,
  62010. }
  62011. }
  62012. if err != nil {
  62013. return nil, err
  62014. }
  62015. defer googleapi.CloseBody(res)
  62016. if err := googleapi.CheckResponse(res); err != nil {
  62017. return nil, err
  62018. }
  62019. ret := &Operation{
  62020. ServerResponse: googleapi.ServerResponse{
  62021. Header: res.Header,
  62022. HTTPStatusCode: res.StatusCode,
  62023. },
  62024. }
  62025. target := &ret
  62026. if err := gensupport.DecodeResponse(target, res); err != nil {
  62027. return nil, err
  62028. }
  62029. return ret, nil
  62030. // {
  62031. // "description": "Creates an image in the specified project using the data included in the request.",
  62032. // "httpMethod": "POST",
  62033. // "id": "compute.images.insert",
  62034. // "parameterOrder": [
  62035. // "project"
  62036. // ],
  62037. // "parameters": {
  62038. // "forceCreate": {
  62039. // "description": "Force image creation if true.",
  62040. // "location": "query",
  62041. // "type": "boolean"
  62042. // },
  62043. // "project": {
  62044. // "description": "Project ID for this request.",
  62045. // "location": "path",
  62046. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62047. // "required": true,
  62048. // "type": "string"
  62049. // },
  62050. // "requestId": {
  62051. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62052. // "location": "query",
  62053. // "type": "string"
  62054. // }
  62055. // },
  62056. // "path": "{project}/global/images",
  62057. // "request": {
  62058. // "$ref": "Image"
  62059. // },
  62060. // "response": {
  62061. // "$ref": "Operation"
  62062. // },
  62063. // "scopes": [
  62064. // "https://www.googleapis.com/auth/cloud-platform",
  62065. // "https://www.googleapis.com/auth/compute",
  62066. // "https://www.googleapis.com/auth/devstorage.full_control",
  62067. // "https://www.googleapis.com/auth/devstorage.read_only",
  62068. // "https://www.googleapis.com/auth/devstorage.read_write"
  62069. // ]
  62070. // }
  62071. }
  62072. // method id "compute.images.list":
  62073. type ImagesListCall struct {
  62074. s *Service
  62075. project string
  62076. urlParams_ gensupport.URLParams
  62077. ifNoneMatch_ string
  62078. ctx_ context.Context
  62079. header_ http.Header
  62080. }
  62081. // List: Retrieves the list of custom images available to the specified
  62082. // project. Custom images are images you create that belong to your
  62083. // project. This method does not get any images that belong to other
  62084. // projects, including publicly-available images, like Debian 8. If you
  62085. // want to get a list of publicly-available images, use this method to
  62086. // make a request to the respective image project, such as debian-cloud
  62087. // or windows-cloud.
  62088. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  62089. func (r *ImagesService) List(project string) *ImagesListCall {
  62090. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62091. c.project = project
  62092. return c
  62093. }
  62094. // Filter sets the optional parameter "filter": A filter expression that
  62095. // filters resources listed in the response. The expression must specify
  62096. // the field name, a comparison operator, and the value that you want to
  62097. // use for filtering. The value must be a string, a number, or a
  62098. // boolean. The comparison operator must be either =, !=, >, or <.
  62099. //
  62100. // For example, if you are filtering Compute Engine instances, you can
  62101. // exclude instances named example-instance by specifying name !=
  62102. // example-instance.
  62103. //
  62104. // You can also filter nested fields. For example, you could specify
  62105. // scheduling.automaticRestart = false to include instances only if they
  62106. // are not scheduled for automatic restarts. You can use filtering on
  62107. // nested fields to filter based on resource labels.
  62108. //
  62109. // To filter on multiple expressions, provide each separate expression
  62110. // within parentheses. For example, (scheduling.automaticRestart = true)
  62111. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62112. // AND expression. However, you can include AND and OR expressions
  62113. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62114. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62115. // true).
  62116. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  62117. c.urlParams_.Set("filter", filter)
  62118. return c
  62119. }
  62120. // MaxResults sets the optional parameter "maxResults": The maximum
  62121. // number of results per page that should be returned. If the number of
  62122. // available results is larger than maxResults, Compute Engine returns a
  62123. // nextPageToken that can be used to get the next page of results in
  62124. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62125. // (Default: 500)
  62126. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  62127. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62128. return c
  62129. }
  62130. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62131. // a certain order. By default, results are returned in alphanumerical
  62132. // order based on the resource name.
  62133. //
  62134. // You can also sort results in descending order based on the creation
  62135. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62136. // based on the creationTimestamp field in reverse chronological order
  62137. // (newest result first). Use this to sort resources like operations so
  62138. // that the newest operation is returned first.
  62139. //
  62140. // Currently, only sorting by name or creationTimestamp desc is
  62141. // supported.
  62142. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  62143. c.urlParams_.Set("orderBy", orderBy)
  62144. return c
  62145. }
  62146. // PageToken sets the optional parameter "pageToken": Specifies a page
  62147. // token to use. Set pageToken to the nextPageToken returned by a
  62148. // previous list request to get the next page of results.
  62149. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  62150. c.urlParams_.Set("pageToken", pageToken)
  62151. return c
  62152. }
  62153. // Fields allows partial responses to be retrieved. See
  62154. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62155. // for more information.
  62156. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  62157. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62158. return c
  62159. }
  62160. // IfNoneMatch sets the optional parameter which makes the operation
  62161. // fail if the object's ETag matches the given value. This is useful for
  62162. // getting updates only after the object has changed since the last
  62163. // request. Use googleapi.IsNotModified to check whether the response
  62164. // error from Do is the result of In-None-Match.
  62165. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  62166. c.ifNoneMatch_ = entityTag
  62167. return c
  62168. }
  62169. // Context sets the context to be used in this call's Do method. Any
  62170. // pending HTTP request will be aborted if the provided context is
  62171. // canceled.
  62172. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  62173. c.ctx_ = ctx
  62174. return c
  62175. }
  62176. // Header returns an http.Header that can be modified by the caller to
  62177. // add HTTP headers to the request.
  62178. func (c *ImagesListCall) Header() http.Header {
  62179. if c.header_ == nil {
  62180. c.header_ = make(http.Header)
  62181. }
  62182. return c.header_
  62183. }
  62184. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  62185. reqHeaders := make(http.Header)
  62186. for k, v := range c.header_ {
  62187. reqHeaders[k] = v
  62188. }
  62189. reqHeaders.Set("User-Agent", c.s.userAgent())
  62190. if c.ifNoneMatch_ != "" {
  62191. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62192. }
  62193. var body io.Reader = nil
  62194. c.urlParams_.Set("alt", alt)
  62195. c.urlParams_.Set("prettyPrint", "false")
  62196. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  62197. urls += "?" + c.urlParams_.Encode()
  62198. req, err := http.NewRequest("GET", urls, body)
  62199. if err != nil {
  62200. return nil, err
  62201. }
  62202. req.Header = reqHeaders
  62203. googleapi.Expand(req.URL, map[string]string{
  62204. "project": c.project,
  62205. })
  62206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62207. }
  62208. // Do executes the "compute.images.list" call.
  62209. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  62210. // status code is an error. Response headers are in either
  62211. // *ImageList.ServerResponse.Header or (if a response was returned at
  62212. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62213. // to check whether the returned error was because
  62214. // http.StatusNotModified was returned.
  62215. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  62216. gensupport.SetOptions(c.urlParams_, opts...)
  62217. res, err := c.doRequest("json")
  62218. if res != nil && res.StatusCode == http.StatusNotModified {
  62219. if res.Body != nil {
  62220. res.Body.Close()
  62221. }
  62222. return nil, &googleapi.Error{
  62223. Code: res.StatusCode,
  62224. Header: res.Header,
  62225. }
  62226. }
  62227. if err != nil {
  62228. return nil, err
  62229. }
  62230. defer googleapi.CloseBody(res)
  62231. if err := googleapi.CheckResponse(res); err != nil {
  62232. return nil, err
  62233. }
  62234. ret := &ImageList{
  62235. ServerResponse: googleapi.ServerResponse{
  62236. Header: res.Header,
  62237. HTTPStatusCode: res.StatusCode,
  62238. },
  62239. }
  62240. target := &ret
  62241. if err := gensupport.DecodeResponse(target, res); err != nil {
  62242. return nil, err
  62243. }
  62244. return ret, nil
  62245. // {
  62246. // "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.",
  62247. // "httpMethod": "GET",
  62248. // "id": "compute.images.list",
  62249. // "parameterOrder": [
  62250. // "project"
  62251. // ],
  62252. // "parameters": {
  62253. // "filter": {
  62254. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  62255. // "location": "query",
  62256. // "type": "string"
  62257. // },
  62258. // "maxResults": {
  62259. // "default": "500",
  62260. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  62261. // "format": "uint32",
  62262. // "location": "query",
  62263. // "minimum": "0",
  62264. // "type": "integer"
  62265. // },
  62266. // "orderBy": {
  62267. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  62268. // "location": "query",
  62269. // "type": "string"
  62270. // },
  62271. // "pageToken": {
  62272. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  62273. // "location": "query",
  62274. // "type": "string"
  62275. // },
  62276. // "project": {
  62277. // "description": "Project ID for this request.",
  62278. // "location": "path",
  62279. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62280. // "required": true,
  62281. // "type": "string"
  62282. // }
  62283. // },
  62284. // "path": "{project}/global/images",
  62285. // "response": {
  62286. // "$ref": "ImageList"
  62287. // },
  62288. // "scopes": [
  62289. // "https://www.googleapis.com/auth/cloud-platform",
  62290. // "https://www.googleapis.com/auth/compute",
  62291. // "https://www.googleapis.com/auth/compute.readonly"
  62292. // ]
  62293. // }
  62294. }
  62295. // Pages invokes f for each page of results.
  62296. // A non-nil error returned from f will halt the iteration.
  62297. // The provided context supersedes any context provided to the Context method.
  62298. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  62299. c.ctx_ = ctx
  62300. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62301. for {
  62302. x, err := c.Do()
  62303. if err != nil {
  62304. return err
  62305. }
  62306. if err := f(x); err != nil {
  62307. return err
  62308. }
  62309. if x.NextPageToken == "" {
  62310. return nil
  62311. }
  62312. c.PageToken(x.NextPageToken)
  62313. }
  62314. }
  62315. // method id "compute.images.setIamPolicy":
  62316. type ImagesSetIamPolicyCall struct {
  62317. s *Service
  62318. project string
  62319. resource string
  62320. globalsetpolicyrequest *GlobalSetPolicyRequest
  62321. urlParams_ gensupport.URLParams
  62322. ctx_ context.Context
  62323. header_ http.Header
  62324. }
  62325. // SetIamPolicy: Sets the access control policy on the specified
  62326. // resource. Replaces any existing policy.
  62327. func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
  62328. c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62329. c.project = project
  62330. c.resource = resource
  62331. c.globalsetpolicyrequest = globalsetpolicyrequest
  62332. return c
  62333. }
  62334. // Fields allows partial responses to be retrieved. See
  62335. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62336. // for more information.
  62337. func (c *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
  62338. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62339. return c
  62340. }
  62341. // Context sets the context to be used in this call's Do method. Any
  62342. // pending HTTP request will be aborted if the provided context is
  62343. // canceled.
  62344. func (c *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
  62345. c.ctx_ = ctx
  62346. return c
  62347. }
  62348. // Header returns an http.Header that can be modified by the caller to
  62349. // add HTTP headers to the request.
  62350. func (c *ImagesSetIamPolicyCall) Header() http.Header {
  62351. if c.header_ == nil {
  62352. c.header_ = make(http.Header)
  62353. }
  62354. return c.header_
  62355. }
  62356. func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  62357. reqHeaders := make(http.Header)
  62358. for k, v := range c.header_ {
  62359. reqHeaders[k] = v
  62360. }
  62361. reqHeaders.Set("User-Agent", c.s.userAgent())
  62362. var body io.Reader = nil
  62363. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  62364. if err != nil {
  62365. return nil, err
  62366. }
  62367. reqHeaders.Set("Content-Type", "application/json")
  62368. c.urlParams_.Set("alt", alt)
  62369. c.urlParams_.Set("prettyPrint", "false")
  62370. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setIamPolicy")
  62371. urls += "?" + c.urlParams_.Encode()
  62372. req, err := http.NewRequest("POST", 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. "resource": c.resource,
  62380. })
  62381. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62382. }
  62383. // Do executes the "compute.images.setIamPolicy" call.
  62384. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  62385. // code is an error. Response headers are in either
  62386. // *Policy.ServerResponse.Header or (if a response was returned at all)
  62387. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  62388. // check whether the returned error was because http.StatusNotModified
  62389. // was returned.
  62390. func (c *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  62391. gensupport.SetOptions(c.urlParams_, opts...)
  62392. res, err := c.doRequest("json")
  62393. if res != nil && res.StatusCode == http.StatusNotModified {
  62394. if res.Body != nil {
  62395. res.Body.Close()
  62396. }
  62397. return nil, &googleapi.Error{
  62398. Code: res.StatusCode,
  62399. Header: res.Header,
  62400. }
  62401. }
  62402. if err != nil {
  62403. return nil, err
  62404. }
  62405. defer googleapi.CloseBody(res)
  62406. if err := googleapi.CheckResponse(res); err != nil {
  62407. return nil, err
  62408. }
  62409. ret := &Policy{
  62410. ServerResponse: googleapi.ServerResponse{
  62411. Header: res.Header,
  62412. HTTPStatusCode: res.StatusCode,
  62413. },
  62414. }
  62415. target := &ret
  62416. if err := gensupport.DecodeResponse(target, res); err != nil {
  62417. return nil, err
  62418. }
  62419. return ret, nil
  62420. // {
  62421. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  62422. // "httpMethod": "POST",
  62423. // "id": "compute.images.setIamPolicy",
  62424. // "parameterOrder": [
  62425. // "project",
  62426. // "resource"
  62427. // ],
  62428. // "parameters": {
  62429. // "project": {
  62430. // "description": "Project ID for this request.",
  62431. // "location": "path",
  62432. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62433. // "required": true,
  62434. // "type": "string"
  62435. // },
  62436. // "resource": {
  62437. // "description": "Name or id of the resource for this request.",
  62438. // "location": "path",
  62439. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62440. // "required": true,
  62441. // "type": "string"
  62442. // }
  62443. // },
  62444. // "path": "{project}/global/images/{resource}/setIamPolicy",
  62445. // "request": {
  62446. // "$ref": "GlobalSetPolicyRequest"
  62447. // },
  62448. // "response": {
  62449. // "$ref": "Policy"
  62450. // },
  62451. // "scopes": [
  62452. // "https://www.googleapis.com/auth/cloud-platform",
  62453. // "https://www.googleapis.com/auth/compute"
  62454. // ]
  62455. // }
  62456. }
  62457. // method id "compute.images.setLabels":
  62458. type ImagesSetLabelsCall struct {
  62459. s *Service
  62460. project string
  62461. resource string
  62462. globalsetlabelsrequest *GlobalSetLabelsRequest
  62463. urlParams_ gensupport.URLParams
  62464. ctx_ context.Context
  62465. header_ http.Header
  62466. }
  62467. // SetLabels: Sets the labels on an image. To learn more about labels,
  62468. // read the Labeling Resources documentation.
  62469. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  62470. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62471. c.project = project
  62472. c.resource = resource
  62473. c.globalsetlabelsrequest = globalsetlabelsrequest
  62474. return c
  62475. }
  62476. // Fields allows partial responses to be retrieved. See
  62477. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62478. // for more information.
  62479. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  62480. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62481. return c
  62482. }
  62483. // Context sets the context to be used in this call's Do method. Any
  62484. // pending HTTP request will be aborted if the provided context is
  62485. // canceled.
  62486. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  62487. c.ctx_ = ctx
  62488. return c
  62489. }
  62490. // Header returns an http.Header that can be modified by the caller to
  62491. // add HTTP headers to the request.
  62492. func (c *ImagesSetLabelsCall) Header() http.Header {
  62493. if c.header_ == nil {
  62494. c.header_ = make(http.Header)
  62495. }
  62496. return c.header_
  62497. }
  62498. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  62499. reqHeaders := make(http.Header)
  62500. for k, v := range c.header_ {
  62501. reqHeaders[k] = v
  62502. }
  62503. reqHeaders.Set("User-Agent", c.s.userAgent())
  62504. var body io.Reader = nil
  62505. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  62506. if err != nil {
  62507. return nil, err
  62508. }
  62509. reqHeaders.Set("Content-Type", "application/json")
  62510. c.urlParams_.Set("alt", alt)
  62511. c.urlParams_.Set("prettyPrint", "false")
  62512. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  62513. urls += "?" + c.urlParams_.Encode()
  62514. req, err := http.NewRequest("POST", urls, body)
  62515. if err != nil {
  62516. return nil, err
  62517. }
  62518. req.Header = reqHeaders
  62519. googleapi.Expand(req.URL, map[string]string{
  62520. "project": c.project,
  62521. "resource": c.resource,
  62522. })
  62523. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62524. }
  62525. // Do executes the "compute.images.setLabels" call.
  62526. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62527. // status code is an error. Response headers are in either
  62528. // *Operation.ServerResponse.Header or (if a response was returned at
  62529. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62530. // to check whether the returned error was because
  62531. // http.StatusNotModified was returned.
  62532. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62533. gensupport.SetOptions(c.urlParams_, opts...)
  62534. res, err := c.doRequest("json")
  62535. if res != nil && res.StatusCode == http.StatusNotModified {
  62536. if res.Body != nil {
  62537. res.Body.Close()
  62538. }
  62539. return nil, &googleapi.Error{
  62540. Code: res.StatusCode,
  62541. Header: res.Header,
  62542. }
  62543. }
  62544. if err != nil {
  62545. return nil, err
  62546. }
  62547. defer googleapi.CloseBody(res)
  62548. if err := googleapi.CheckResponse(res); err != nil {
  62549. return nil, err
  62550. }
  62551. ret := &Operation{
  62552. ServerResponse: googleapi.ServerResponse{
  62553. Header: res.Header,
  62554. HTTPStatusCode: res.StatusCode,
  62555. },
  62556. }
  62557. target := &ret
  62558. if err := gensupport.DecodeResponse(target, res); err != nil {
  62559. return nil, err
  62560. }
  62561. return ret, nil
  62562. // {
  62563. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  62564. // "httpMethod": "POST",
  62565. // "id": "compute.images.setLabels",
  62566. // "parameterOrder": [
  62567. // "project",
  62568. // "resource"
  62569. // ],
  62570. // "parameters": {
  62571. // "project": {
  62572. // "description": "Project ID for this request.",
  62573. // "location": "path",
  62574. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62575. // "required": true,
  62576. // "type": "string"
  62577. // },
  62578. // "resource": {
  62579. // "description": "Name or id of the resource for this request.",
  62580. // "location": "path",
  62581. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62582. // "required": true,
  62583. // "type": "string"
  62584. // }
  62585. // },
  62586. // "path": "{project}/global/images/{resource}/setLabels",
  62587. // "request": {
  62588. // "$ref": "GlobalSetLabelsRequest"
  62589. // },
  62590. // "response": {
  62591. // "$ref": "Operation"
  62592. // },
  62593. // "scopes": [
  62594. // "https://www.googleapis.com/auth/cloud-platform",
  62595. // "https://www.googleapis.com/auth/compute"
  62596. // ]
  62597. // }
  62598. }
  62599. // method id "compute.images.testIamPermissions":
  62600. type ImagesTestIamPermissionsCall struct {
  62601. s *Service
  62602. project string
  62603. resource string
  62604. testpermissionsrequest *TestPermissionsRequest
  62605. urlParams_ gensupport.URLParams
  62606. ctx_ context.Context
  62607. header_ http.Header
  62608. }
  62609. // TestIamPermissions: Returns permissions that a caller has on the
  62610. // specified resource.
  62611. func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
  62612. c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62613. c.project = project
  62614. c.resource = resource
  62615. c.testpermissionsrequest = testpermissionsrequest
  62616. return c
  62617. }
  62618. // Fields allows partial responses to be retrieved. See
  62619. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62620. // for more information.
  62621. func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
  62622. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62623. return c
  62624. }
  62625. // Context sets the context to be used in this call's Do method. Any
  62626. // pending HTTP request will be aborted if the provided context is
  62627. // canceled.
  62628. func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
  62629. c.ctx_ = ctx
  62630. return c
  62631. }
  62632. // Header returns an http.Header that can be modified by the caller to
  62633. // add HTTP headers to the request.
  62634. func (c *ImagesTestIamPermissionsCall) Header() http.Header {
  62635. if c.header_ == nil {
  62636. c.header_ = make(http.Header)
  62637. }
  62638. return c.header_
  62639. }
  62640. func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  62641. reqHeaders := make(http.Header)
  62642. for k, v := range c.header_ {
  62643. reqHeaders[k] = v
  62644. }
  62645. reqHeaders.Set("User-Agent", c.s.userAgent())
  62646. var body io.Reader = nil
  62647. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  62648. if err != nil {
  62649. return nil, err
  62650. }
  62651. reqHeaders.Set("Content-Type", "application/json")
  62652. c.urlParams_.Set("alt", alt)
  62653. c.urlParams_.Set("prettyPrint", "false")
  62654. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/testIamPermissions")
  62655. urls += "?" + c.urlParams_.Encode()
  62656. req, err := http.NewRequest("POST", urls, body)
  62657. if err != nil {
  62658. return nil, err
  62659. }
  62660. req.Header = reqHeaders
  62661. googleapi.Expand(req.URL, map[string]string{
  62662. "project": c.project,
  62663. "resource": c.resource,
  62664. })
  62665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62666. }
  62667. // Do executes the "compute.images.testIamPermissions" call.
  62668. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  62669. // non-2xx status code is an error. Response headers are in either
  62670. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  62671. // returned at all) in error.(*googleapi.Error).Header. Use
  62672. // googleapi.IsNotModified to check whether the returned error was
  62673. // because http.StatusNotModified was returned.
  62674. func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  62675. gensupport.SetOptions(c.urlParams_, opts...)
  62676. res, err := c.doRequest("json")
  62677. if res != nil && res.StatusCode == http.StatusNotModified {
  62678. if res.Body != nil {
  62679. res.Body.Close()
  62680. }
  62681. return nil, &googleapi.Error{
  62682. Code: res.StatusCode,
  62683. Header: res.Header,
  62684. }
  62685. }
  62686. if err != nil {
  62687. return nil, err
  62688. }
  62689. defer googleapi.CloseBody(res)
  62690. if err := googleapi.CheckResponse(res); err != nil {
  62691. return nil, err
  62692. }
  62693. ret := &TestPermissionsResponse{
  62694. ServerResponse: googleapi.ServerResponse{
  62695. Header: res.Header,
  62696. HTTPStatusCode: res.StatusCode,
  62697. },
  62698. }
  62699. target := &ret
  62700. if err := gensupport.DecodeResponse(target, res); err != nil {
  62701. return nil, err
  62702. }
  62703. return ret, nil
  62704. // {
  62705. // "description": "Returns permissions that a caller has on the specified resource.",
  62706. // "httpMethod": "POST",
  62707. // "id": "compute.images.testIamPermissions",
  62708. // "parameterOrder": [
  62709. // "project",
  62710. // "resource"
  62711. // ],
  62712. // "parameters": {
  62713. // "project": {
  62714. // "description": "Project ID for this request.",
  62715. // "location": "path",
  62716. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62717. // "required": true,
  62718. // "type": "string"
  62719. // },
  62720. // "resource": {
  62721. // "description": "Name or id of the resource for this request.",
  62722. // "location": "path",
  62723. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62724. // "required": true,
  62725. // "type": "string"
  62726. // }
  62727. // },
  62728. // "path": "{project}/global/images/{resource}/testIamPermissions",
  62729. // "request": {
  62730. // "$ref": "TestPermissionsRequest"
  62731. // },
  62732. // "response": {
  62733. // "$ref": "TestPermissionsResponse"
  62734. // },
  62735. // "scopes": [
  62736. // "https://www.googleapis.com/auth/cloud-platform",
  62737. // "https://www.googleapis.com/auth/compute",
  62738. // "https://www.googleapis.com/auth/compute.readonly"
  62739. // ]
  62740. // }
  62741. }
  62742. // method id "compute.instanceGroupManagers.abandonInstances":
  62743. type InstanceGroupManagersAbandonInstancesCall struct {
  62744. s *Service
  62745. project string
  62746. zone string
  62747. instanceGroupManager string
  62748. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  62749. urlParams_ gensupport.URLParams
  62750. ctx_ context.Context
  62751. header_ http.Header
  62752. }
  62753. // AbandonInstances: Flags the specified instances to be removed from
  62754. // the managed instance group. Abandoning an instance does not delete
  62755. // the instance, but it does remove the instance from any target pools
  62756. // that are applied by the managed instance group. This method reduces
  62757. // the targetSize of the managed instance group by the number of
  62758. // instances that you abandon. This operation is marked as DONE when the
  62759. // action is scheduled even if the instances have not yet been removed
  62760. // from the group. You must separately verify the status of the
  62761. // abandoning action with the listmanagedinstances method.
  62762. //
  62763. // If the group is part of a backend service that has enabled connection
  62764. // draining, it can take up to 60 seconds after the connection draining
  62765. // duration has elapsed before the VM instance is removed or
  62766. // deleted.
  62767. //
  62768. // You can specify a maximum of 1000 instances with this method per
  62769. // request.
  62770. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  62771. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62772. c.project = project
  62773. c.zone = zone
  62774. c.instanceGroupManager = instanceGroupManager
  62775. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  62776. return c
  62777. }
  62778. // RequestId sets the optional parameter "requestId": An optional
  62779. // request ID to identify requests. Specify a unique request ID so that
  62780. // if you must retry your request, the server will know to ignore the
  62781. // request if it has already been completed.
  62782. //
  62783. // For example, consider a situation where you make an initial request
  62784. // and the request times out. If you make the request again with the
  62785. // same request ID, the server can check if original operation with the
  62786. // same request ID was received, and if so, will ignore the second
  62787. // request. This prevents clients from accidentally creating duplicate
  62788. // commitments.
  62789. //
  62790. // The request ID must be a valid UUID with the exception that zero UUID
  62791. // is not supported (00000000-0000-0000-0000-000000000000).
  62792. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  62793. c.urlParams_.Set("requestId", requestId)
  62794. return c
  62795. }
  62796. // Fields allows partial responses to be retrieved. See
  62797. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62798. // for more information.
  62799. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  62800. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62801. return c
  62802. }
  62803. // Context sets the context to be used in this call's Do method. Any
  62804. // pending HTTP request will be aborted if the provided context is
  62805. // canceled.
  62806. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  62807. c.ctx_ = ctx
  62808. return c
  62809. }
  62810. // Header returns an http.Header that can be modified by the caller to
  62811. // add HTTP headers to the request.
  62812. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  62813. if c.header_ == nil {
  62814. c.header_ = make(http.Header)
  62815. }
  62816. return c.header_
  62817. }
  62818. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  62819. reqHeaders := make(http.Header)
  62820. for k, v := range c.header_ {
  62821. reqHeaders[k] = v
  62822. }
  62823. reqHeaders.Set("User-Agent", c.s.userAgent())
  62824. var body io.Reader = nil
  62825. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  62826. if err != nil {
  62827. return nil, err
  62828. }
  62829. reqHeaders.Set("Content-Type", "application/json")
  62830. c.urlParams_.Set("alt", alt)
  62831. c.urlParams_.Set("prettyPrint", "false")
  62832. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  62833. urls += "?" + c.urlParams_.Encode()
  62834. req, err := http.NewRequest("POST", urls, body)
  62835. if err != nil {
  62836. return nil, err
  62837. }
  62838. req.Header = reqHeaders
  62839. googleapi.Expand(req.URL, map[string]string{
  62840. "project": c.project,
  62841. "zone": c.zone,
  62842. "instanceGroupManager": c.instanceGroupManager,
  62843. })
  62844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62845. }
  62846. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  62847. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62848. // status code is an error. Response headers are in either
  62849. // *Operation.ServerResponse.Header or (if a response was returned at
  62850. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62851. // to check whether the returned error was because
  62852. // http.StatusNotModified was returned.
  62853. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62854. gensupport.SetOptions(c.urlParams_, opts...)
  62855. res, err := c.doRequest("json")
  62856. if res != nil && res.StatusCode == http.StatusNotModified {
  62857. if res.Body != nil {
  62858. res.Body.Close()
  62859. }
  62860. return nil, &googleapi.Error{
  62861. Code: res.StatusCode,
  62862. Header: res.Header,
  62863. }
  62864. }
  62865. if err != nil {
  62866. return nil, err
  62867. }
  62868. defer googleapi.CloseBody(res)
  62869. if err := googleapi.CheckResponse(res); err != nil {
  62870. return nil, err
  62871. }
  62872. ret := &Operation{
  62873. ServerResponse: googleapi.ServerResponse{
  62874. Header: res.Header,
  62875. HTTPStatusCode: res.StatusCode,
  62876. },
  62877. }
  62878. target := &ret
  62879. if err := gensupport.DecodeResponse(target, res); err != nil {
  62880. return nil, err
  62881. }
  62882. return ret, nil
  62883. // {
  62884. // "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.",
  62885. // "httpMethod": "POST",
  62886. // "id": "compute.instanceGroupManagers.abandonInstances",
  62887. // "parameterOrder": [
  62888. // "project",
  62889. // "zone",
  62890. // "instanceGroupManager"
  62891. // ],
  62892. // "parameters": {
  62893. // "instanceGroupManager": {
  62894. // "description": "The name of the managed instance group.",
  62895. // "location": "path",
  62896. // "required": true,
  62897. // "type": "string"
  62898. // },
  62899. // "project": {
  62900. // "description": "Project ID for this request.",
  62901. // "location": "path",
  62902. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62903. // "required": true,
  62904. // "type": "string"
  62905. // },
  62906. // "requestId": {
  62907. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62908. // "location": "query",
  62909. // "type": "string"
  62910. // },
  62911. // "zone": {
  62912. // "description": "The name of the zone where the managed instance group is located.",
  62913. // "location": "path",
  62914. // "required": true,
  62915. // "type": "string"
  62916. // }
  62917. // },
  62918. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  62919. // "request": {
  62920. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  62921. // },
  62922. // "response": {
  62923. // "$ref": "Operation"
  62924. // },
  62925. // "scopes": [
  62926. // "https://www.googleapis.com/auth/cloud-platform",
  62927. // "https://www.googleapis.com/auth/compute"
  62928. // ]
  62929. // }
  62930. }
  62931. // method id "compute.instanceGroupManagers.aggregatedList":
  62932. type InstanceGroupManagersAggregatedListCall struct {
  62933. s *Service
  62934. project string
  62935. urlParams_ gensupport.URLParams
  62936. ifNoneMatch_ string
  62937. ctx_ context.Context
  62938. header_ http.Header
  62939. }
  62940. // AggregatedList: Retrieves the list of managed instance groups and
  62941. // groups them by zone.
  62942. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  62943. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62944. c.project = project
  62945. return c
  62946. }
  62947. // Filter sets the optional parameter "filter": A filter expression that
  62948. // filters resources listed in the response. The expression must specify
  62949. // the field name, a comparison operator, and the value that you want to
  62950. // use for filtering. The value must be a string, a number, or a
  62951. // boolean. The comparison operator must be either =, !=, >, or <.
  62952. //
  62953. // For example, if you are filtering Compute Engine instances, you can
  62954. // exclude instances named example-instance by specifying name !=
  62955. // example-instance.
  62956. //
  62957. // You can also filter nested fields. For example, you could specify
  62958. // scheduling.automaticRestart = false to include instances only if they
  62959. // are not scheduled for automatic restarts. You can use filtering on
  62960. // nested fields to filter based on resource labels.
  62961. //
  62962. // To filter on multiple expressions, provide each separate expression
  62963. // within parentheses. For example, (scheduling.automaticRestart = true)
  62964. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62965. // AND expression. However, you can include AND and OR expressions
  62966. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62967. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62968. // true).
  62969. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  62970. c.urlParams_.Set("filter", filter)
  62971. return c
  62972. }
  62973. // MaxResults sets the optional parameter "maxResults": The maximum
  62974. // number of results per page that should be returned. If the number of
  62975. // available results is larger than maxResults, Compute Engine returns a
  62976. // nextPageToken that can be used to get the next page of results in
  62977. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62978. // (Default: 500)
  62979. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  62980. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62981. return c
  62982. }
  62983. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62984. // a certain order. By default, results are returned in alphanumerical
  62985. // order based on the resource name.
  62986. //
  62987. // You can also sort results in descending order based on the creation
  62988. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62989. // based on the creationTimestamp field in reverse chronological order
  62990. // (newest result first). Use this to sort resources like operations so
  62991. // that the newest operation is returned first.
  62992. //
  62993. // Currently, only sorting by name or creationTimestamp desc is
  62994. // supported.
  62995. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  62996. c.urlParams_.Set("orderBy", orderBy)
  62997. return c
  62998. }
  62999. // PageToken sets the optional parameter "pageToken": Specifies a page
  63000. // token to use. Set pageToken to the nextPageToken returned by a
  63001. // previous list request to get the next page of results.
  63002. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  63003. c.urlParams_.Set("pageToken", pageToken)
  63004. return c
  63005. }
  63006. // Fields allows partial responses to be retrieved. See
  63007. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63008. // for more information.
  63009. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  63010. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63011. return c
  63012. }
  63013. // IfNoneMatch sets the optional parameter which makes the operation
  63014. // fail if the object's ETag matches the given value. This is useful for
  63015. // getting updates only after the object has changed since the last
  63016. // request. Use googleapi.IsNotModified to check whether the response
  63017. // error from Do is the result of In-None-Match.
  63018. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  63019. c.ifNoneMatch_ = entityTag
  63020. return c
  63021. }
  63022. // Context sets the context to be used in this call's Do method. Any
  63023. // pending HTTP request will be aborted if the provided context is
  63024. // canceled.
  63025. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  63026. c.ctx_ = ctx
  63027. return c
  63028. }
  63029. // Header returns an http.Header that can be modified by the caller to
  63030. // add HTTP headers to the request.
  63031. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  63032. if c.header_ == nil {
  63033. c.header_ = make(http.Header)
  63034. }
  63035. return c.header_
  63036. }
  63037. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  63038. reqHeaders := make(http.Header)
  63039. for k, v := range c.header_ {
  63040. reqHeaders[k] = v
  63041. }
  63042. reqHeaders.Set("User-Agent", c.s.userAgent())
  63043. if c.ifNoneMatch_ != "" {
  63044. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63045. }
  63046. var body io.Reader = nil
  63047. c.urlParams_.Set("alt", alt)
  63048. c.urlParams_.Set("prettyPrint", "false")
  63049. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  63050. urls += "?" + c.urlParams_.Encode()
  63051. req, err := http.NewRequest("GET", urls, body)
  63052. if err != nil {
  63053. return nil, err
  63054. }
  63055. req.Header = reqHeaders
  63056. googleapi.Expand(req.URL, map[string]string{
  63057. "project": c.project,
  63058. })
  63059. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63060. }
  63061. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  63062. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  63063. // non-nil. Any non-2xx status code is an error. Response headers are in
  63064. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  63065. // (if a response was returned at all) in
  63066. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  63067. // whether the returned error was because http.StatusNotModified was
  63068. // returned.
  63069. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  63070. gensupport.SetOptions(c.urlParams_, opts...)
  63071. res, err := c.doRequest("json")
  63072. if res != nil && res.StatusCode == http.StatusNotModified {
  63073. if res.Body != nil {
  63074. res.Body.Close()
  63075. }
  63076. return nil, &googleapi.Error{
  63077. Code: res.StatusCode,
  63078. Header: res.Header,
  63079. }
  63080. }
  63081. if err != nil {
  63082. return nil, err
  63083. }
  63084. defer googleapi.CloseBody(res)
  63085. if err := googleapi.CheckResponse(res); err != nil {
  63086. return nil, err
  63087. }
  63088. ret := &InstanceGroupManagerAggregatedList{
  63089. ServerResponse: googleapi.ServerResponse{
  63090. Header: res.Header,
  63091. HTTPStatusCode: res.StatusCode,
  63092. },
  63093. }
  63094. target := &ret
  63095. if err := gensupport.DecodeResponse(target, res); err != nil {
  63096. return nil, err
  63097. }
  63098. return ret, nil
  63099. // {
  63100. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  63101. // "httpMethod": "GET",
  63102. // "id": "compute.instanceGroupManagers.aggregatedList",
  63103. // "parameterOrder": [
  63104. // "project"
  63105. // ],
  63106. // "parameters": {
  63107. // "filter": {
  63108. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  63109. // "location": "query",
  63110. // "type": "string"
  63111. // },
  63112. // "maxResults": {
  63113. // "default": "500",
  63114. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  63115. // "format": "uint32",
  63116. // "location": "query",
  63117. // "minimum": "0",
  63118. // "type": "integer"
  63119. // },
  63120. // "orderBy": {
  63121. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  63122. // "location": "query",
  63123. // "type": "string"
  63124. // },
  63125. // "pageToken": {
  63126. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  63127. // "location": "query",
  63128. // "type": "string"
  63129. // },
  63130. // "project": {
  63131. // "description": "Project ID for this request.",
  63132. // "location": "path",
  63133. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63134. // "required": true,
  63135. // "type": "string"
  63136. // }
  63137. // },
  63138. // "path": "{project}/aggregated/instanceGroupManagers",
  63139. // "response": {
  63140. // "$ref": "InstanceGroupManagerAggregatedList"
  63141. // },
  63142. // "scopes": [
  63143. // "https://www.googleapis.com/auth/cloud-platform",
  63144. // "https://www.googleapis.com/auth/compute",
  63145. // "https://www.googleapis.com/auth/compute.readonly"
  63146. // ]
  63147. // }
  63148. }
  63149. // Pages invokes f for each page of results.
  63150. // A non-nil error returned from f will halt the iteration.
  63151. // The provided context supersedes any context provided to the Context method.
  63152. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  63153. c.ctx_ = ctx
  63154. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  63155. for {
  63156. x, err := c.Do()
  63157. if err != nil {
  63158. return err
  63159. }
  63160. if err := f(x); err != nil {
  63161. return err
  63162. }
  63163. if x.NextPageToken == "" {
  63164. return nil
  63165. }
  63166. c.PageToken(x.NextPageToken)
  63167. }
  63168. }
  63169. // method id "compute.instanceGroupManagers.applyUpdatesToInstances":
  63170. type InstanceGroupManagersApplyUpdatesToInstancesCall struct {
  63171. s *Service
  63172. project string
  63173. zone string
  63174. instanceGroupManager string
  63175. instancegroupmanagersapplyupdatesrequest *InstanceGroupManagersApplyUpdatesRequest
  63176. urlParams_ gensupport.URLParams
  63177. ctx_ context.Context
  63178. header_ http.Header
  63179. }
  63180. // ApplyUpdatesToInstances: Apply changes to selected instances on the
  63181. // managed instance group. This method can be used to apply new
  63182. // overrides and/or new versions.
  63183. func (r *InstanceGroupManagersService) ApplyUpdatesToInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersapplyupdatesrequest *InstanceGroupManagersApplyUpdatesRequest) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  63184. c := &InstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63185. c.project = project
  63186. c.zone = zone
  63187. c.instanceGroupManager = instanceGroupManager
  63188. c.instancegroupmanagersapplyupdatesrequest = instancegroupmanagersapplyupdatesrequest
  63189. return c
  63190. }
  63191. // Fields allows partial responses to be retrieved. See
  63192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63193. // for more information.
  63194. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  63195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63196. return c
  63197. }
  63198. // Context sets the context to be used in this call's Do method. Any
  63199. // pending HTTP request will be aborted if the provided context is
  63200. // canceled.
  63201. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  63202. c.ctx_ = ctx
  63203. return c
  63204. }
  63205. // Header returns an http.Header that can be modified by the caller to
  63206. // add HTTP headers to the request.
  63207. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header {
  63208. if c.header_ == nil {
  63209. c.header_ = make(http.Header)
  63210. }
  63211. return c.header_
  63212. }
  63213. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) {
  63214. reqHeaders := make(http.Header)
  63215. for k, v := range c.header_ {
  63216. reqHeaders[k] = v
  63217. }
  63218. reqHeaders.Set("User-Agent", c.s.userAgent())
  63219. var body io.Reader = nil
  63220. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersapplyupdatesrequest)
  63221. if err != nil {
  63222. return nil, err
  63223. }
  63224. reqHeaders.Set("Content-Type", "application/json")
  63225. c.urlParams_.Set("alt", alt)
  63226. c.urlParams_.Set("prettyPrint", "false")
  63227. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances")
  63228. urls += "?" + c.urlParams_.Encode()
  63229. req, err := http.NewRequest("POST", urls, body)
  63230. if err != nil {
  63231. return nil, err
  63232. }
  63233. req.Header = reqHeaders
  63234. googleapi.Expand(req.URL, map[string]string{
  63235. "project": c.project,
  63236. "zone": c.zone,
  63237. "instanceGroupManager": c.instanceGroupManager,
  63238. })
  63239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63240. }
  63241. // Do executes the "compute.instanceGroupManagers.applyUpdatesToInstances" call.
  63242. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63243. // status code is an error. Response headers are in either
  63244. // *Operation.ServerResponse.Header or (if a response was returned at
  63245. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63246. // to check whether the returned error was because
  63247. // http.StatusNotModified was returned.
  63248. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63249. gensupport.SetOptions(c.urlParams_, opts...)
  63250. res, err := c.doRequest("json")
  63251. if res != nil && res.StatusCode == http.StatusNotModified {
  63252. if res.Body != nil {
  63253. res.Body.Close()
  63254. }
  63255. return nil, &googleapi.Error{
  63256. Code: res.StatusCode,
  63257. Header: res.Header,
  63258. }
  63259. }
  63260. if err != nil {
  63261. return nil, err
  63262. }
  63263. defer googleapi.CloseBody(res)
  63264. if err := googleapi.CheckResponse(res); err != nil {
  63265. return nil, err
  63266. }
  63267. ret := &Operation{
  63268. ServerResponse: googleapi.ServerResponse{
  63269. Header: res.Header,
  63270. HTTPStatusCode: res.StatusCode,
  63271. },
  63272. }
  63273. target := &ret
  63274. if err := gensupport.DecodeResponse(target, res); err != nil {
  63275. return nil, err
  63276. }
  63277. return ret, nil
  63278. // {
  63279. // "description": "Apply changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.",
  63280. // "httpMethod": "POST",
  63281. // "id": "compute.instanceGroupManagers.applyUpdatesToInstances",
  63282. // "parameterOrder": [
  63283. // "project",
  63284. // "zone",
  63285. // "instanceGroupManager"
  63286. // ],
  63287. // "parameters": {
  63288. // "instanceGroupManager": {
  63289. // "description": "The name of the managed instance group, should conform to RFC1035.",
  63290. // "location": "path",
  63291. // "required": true,
  63292. // "type": "string"
  63293. // },
  63294. // "project": {
  63295. // "description": "Project ID for this request.",
  63296. // "location": "path",
  63297. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63298. // "required": true,
  63299. // "type": "string"
  63300. // },
  63301. // "zone": {
  63302. // "description": "The name of the zone where the managed instance group is located. Should conform to RFC1035.",
  63303. // "location": "path",
  63304. // "required": true,
  63305. // "type": "string"
  63306. // }
  63307. // },
  63308. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
  63309. // "request": {
  63310. // "$ref": "InstanceGroupManagersApplyUpdatesRequest"
  63311. // },
  63312. // "response": {
  63313. // "$ref": "Operation"
  63314. // },
  63315. // "scopes": [
  63316. // "https://www.googleapis.com/auth/cloud-platform",
  63317. // "https://www.googleapis.com/auth/compute"
  63318. // ]
  63319. // }
  63320. }
  63321. // method id "compute.instanceGroupManagers.createInstances":
  63322. type InstanceGroupManagersCreateInstancesCall struct {
  63323. s *Service
  63324. project string
  63325. zone string
  63326. instanceGroupManager string
  63327. instancegroupmanagerscreateinstancesrequest *InstanceGroupManagersCreateInstancesRequest
  63328. urlParams_ gensupport.URLParams
  63329. ctx_ context.Context
  63330. header_ http.Header
  63331. }
  63332. // CreateInstances: Creates instances with per-instance configs in this
  63333. // managed instance group. Instances are created using the current
  63334. // instance template. The create instances operation is marked DONE if
  63335. // the createInstances request is successful. The underlying actions
  63336. // take additional time. You must separately verify the status of the
  63337. // creating or actions with the listmanagedinstances method.
  63338. func (r *InstanceGroupManagersService) CreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagerscreateinstancesrequest *InstanceGroupManagersCreateInstancesRequest) *InstanceGroupManagersCreateInstancesCall {
  63339. c := &InstanceGroupManagersCreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63340. c.project = project
  63341. c.zone = zone
  63342. c.instanceGroupManager = instanceGroupManager
  63343. c.instancegroupmanagerscreateinstancesrequest = instancegroupmanagerscreateinstancesrequest
  63344. return c
  63345. }
  63346. // RequestId sets the optional parameter "requestId": An optional
  63347. // request ID to identify requests. Specify a unique request ID so that
  63348. // if you must retry your request, the server will know to ignore the
  63349. // request if it has already been completed.
  63350. //
  63351. // For example, consider a situation where you make an initial request
  63352. // and the request times out. If you make the request again with the
  63353. // same request ID, the server can check if original operation with the
  63354. // same request ID was received, and if so, will ignore the second
  63355. // request.
  63356. //
  63357. // The request ID must be a valid UUID with the exception that zero UUID
  63358. // is not supported (00000000-0000-0000-0000-000000000000).
  63359. func (c *InstanceGroupManagersCreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersCreateInstancesCall {
  63360. c.urlParams_.Set("requestId", requestId)
  63361. return c
  63362. }
  63363. // Fields allows partial responses to be retrieved. See
  63364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63365. // for more information.
  63366. func (c *InstanceGroupManagersCreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersCreateInstancesCall {
  63367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63368. return c
  63369. }
  63370. // Context sets the context to be used in this call's Do method. Any
  63371. // pending HTTP request will be aborted if the provided context is
  63372. // canceled.
  63373. func (c *InstanceGroupManagersCreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersCreateInstancesCall {
  63374. c.ctx_ = ctx
  63375. return c
  63376. }
  63377. // Header returns an http.Header that can be modified by the caller to
  63378. // add HTTP headers to the request.
  63379. func (c *InstanceGroupManagersCreateInstancesCall) Header() http.Header {
  63380. if c.header_ == nil {
  63381. c.header_ = make(http.Header)
  63382. }
  63383. return c.header_
  63384. }
  63385. func (c *InstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  63386. reqHeaders := make(http.Header)
  63387. for k, v := range c.header_ {
  63388. reqHeaders[k] = v
  63389. }
  63390. reqHeaders.Set("User-Agent", c.s.userAgent())
  63391. var body io.Reader = nil
  63392. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerscreateinstancesrequest)
  63393. if err != nil {
  63394. return nil, err
  63395. }
  63396. reqHeaders.Set("Content-Type", "application/json")
  63397. c.urlParams_.Set("alt", alt)
  63398. c.urlParams_.Set("prettyPrint", "false")
  63399. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/createInstances")
  63400. urls += "?" + c.urlParams_.Encode()
  63401. req, err := http.NewRequest("POST", urls, body)
  63402. if err != nil {
  63403. return nil, err
  63404. }
  63405. req.Header = reqHeaders
  63406. googleapi.Expand(req.URL, map[string]string{
  63407. "project": c.project,
  63408. "zone": c.zone,
  63409. "instanceGroupManager": c.instanceGroupManager,
  63410. })
  63411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63412. }
  63413. // Do executes the "compute.instanceGroupManagers.createInstances" call.
  63414. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63415. // status code is an error. Response headers are in either
  63416. // *Operation.ServerResponse.Header or (if a response was returned at
  63417. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63418. // to check whether the returned error was because
  63419. // http.StatusNotModified was returned.
  63420. func (c *InstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63421. gensupport.SetOptions(c.urlParams_, opts...)
  63422. res, err := c.doRequest("json")
  63423. if res != nil && res.StatusCode == http.StatusNotModified {
  63424. if res.Body != nil {
  63425. res.Body.Close()
  63426. }
  63427. return nil, &googleapi.Error{
  63428. Code: res.StatusCode,
  63429. Header: res.Header,
  63430. }
  63431. }
  63432. if err != nil {
  63433. return nil, err
  63434. }
  63435. defer googleapi.CloseBody(res)
  63436. if err := googleapi.CheckResponse(res); err != nil {
  63437. return nil, err
  63438. }
  63439. ret := &Operation{
  63440. ServerResponse: googleapi.ServerResponse{
  63441. Header: res.Header,
  63442. HTTPStatusCode: res.StatusCode,
  63443. },
  63444. }
  63445. target := &ret
  63446. if err := gensupport.DecodeResponse(target, res); err != nil {
  63447. return nil, err
  63448. }
  63449. return ret, nil
  63450. // {
  63451. // "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.",
  63452. // "httpMethod": "POST",
  63453. // "id": "compute.instanceGroupManagers.createInstances",
  63454. // "parameterOrder": [
  63455. // "project",
  63456. // "zone",
  63457. // "instanceGroupManager"
  63458. // ],
  63459. // "parameters": {
  63460. // "instanceGroupManager": {
  63461. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  63462. // "location": "path",
  63463. // "required": true,
  63464. // "type": "string"
  63465. // },
  63466. // "project": {
  63467. // "description": "Project ID for this request.",
  63468. // "location": "path",
  63469. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63470. // "required": true,
  63471. // "type": "string"
  63472. // },
  63473. // "requestId": {
  63474. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same 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).",
  63475. // "location": "query",
  63476. // "type": "string"
  63477. // },
  63478. // "zone": {
  63479. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  63480. // "location": "path",
  63481. // "required": true,
  63482. // "type": "string"
  63483. // }
  63484. // },
  63485. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/createInstances",
  63486. // "request": {
  63487. // "$ref": "InstanceGroupManagersCreateInstancesRequest"
  63488. // },
  63489. // "response": {
  63490. // "$ref": "Operation"
  63491. // },
  63492. // "scopes": [
  63493. // "https://www.googleapis.com/auth/cloud-platform",
  63494. // "https://www.googleapis.com/auth/compute"
  63495. // ]
  63496. // }
  63497. }
  63498. // method id "compute.instanceGroupManagers.delete":
  63499. type InstanceGroupManagersDeleteCall struct {
  63500. s *Service
  63501. project string
  63502. zone string
  63503. instanceGroupManager string
  63504. urlParams_ gensupport.URLParams
  63505. ctx_ context.Context
  63506. header_ http.Header
  63507. }
  63508. // Delete: Deletes the specified managed instance group and all of the
  63509. // instances in that group. Note that the instance group must not belong
  63510. // to a backend service. Read Deleting an instance group for more
  63511. // information.
  63512. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  63513. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63514. c.project = project
  63515. c.zone = zone
  63516. c.instanceGroupManager = instanceGroupManager
  63517. return c
  63518. }
  63519. // RequestId sets the optional parameter "requestId": An optional
  63520. // request ID to identify requests. Specify a unique request ID so that
  63521. // if you must retry your request, the server will know to ignore the
  63522. // request if it has already been completed.
  63523. //
  63524. // For example, consider a situation where you make an initial request
  63525. // and the request times out. If you make the request again with the
  63526. // same request ID, the server can check if original operation with the
  63527. // same request ID was received, and if so, will ignore the second
  63528. // request. This prevents clients from accidentally creating duplicate
  63529. // commitments.
  63530. //
  63531. // The request ID must be a valid UUID with the exception that zero UUID
  63532. // is not supported (00000000-0000-0000-0000-000000000000).
  63533. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  63534. c.urlParams_.Set("requestId", requestId)
  63535. return c
  63536. }
  63537. // Fields allows partial responses to be retrieved. See
  63538. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63539. // for more information.
  63540. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  63541. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63542. return c
  63543. }
  63544. // Context sets the context to be used in this call's Do method. Any
  63545. // pending HTTP request will be aborted if the provided context is
  63546. // canceled.
  63547. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  63548. c.ctx_ = ctx
  63549. return c
  63550. }
  63551. // Header returns an http.Header that can be modified by the caller to
  63552. // add HTTP headers to the request.
  63553. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  63554. if c.header_ == nil {
  63555. c.header_ = make(http.Header)
  63556. }
  63557. return c.header_
  63558. }
  63559. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  63560. reqHeaders := make(http.Header)
  63561. for k, v := range c.header_ {
  63562. reqHeaders[k] = v
  63563. }
  63564. reqHeaders.Set("User-Agent", c.s.userAgent())
  63565. var body io.Reader = nil
  63566. c.urlParams_.Set("alt", alt)
  63567. c.urlParams_.Set("prettyPrint", "false")
  63568. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  63569. urls += "?" + c.urlParams_.Encode()
  63570. req, err := http.NewRequest("DELETE", urls, body)
  63571. if err != nil {
  63572. return nil, err
  63573. }
  63574. req.Header = reqHeaders
  63575. googleapi.Expand(req.URL, map[string]string{
  63576. "project": c.project,
  63577. "zone": c.zone,
  63578. "instanceGroupManager": c.instanceGroupManager,
  63579. })
  63580. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63581. }
  63582. // Do executes the "compute.instanceGroupManagers.delete" call.
  63583. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63584. // status code is an error. Response headers are in either
  63585. // *Operation.ServerResponse.Header or (if a response was returned at
  63586. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63587. // to check whether the returned error was because
  63588. // http.StatusNotModified was returned.
  63589. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63590. gensupport.SetOptions(c.urlParams_, opts...)
  63591. res, err := c.doRequest("json")
  63592. if res != nil && res.StatusCode == http.StatusNotModified {
  63593. if res.Body != nil {
  63594. res.Body.Close()
  63595. }
  63596. return nil, &googleapi.Error{
  63597. Code: res.StatusCode,
  63598. Header: res.Header,
  63599. }
  63600. }
  63601. if err != nil {
  63602. return nil, err
  63603. }
  63604. defer googleapi.CloseBody(res)
  63605. if err := googleapi.CheckResponse(res); err != nil {
  63606. return nil, err
  63607. }
  63608. ret := &Operation{
  63609. ServerResponse: googleapi.ServerResponse{
  63610. Header: res.Header,
  63611. HTTPStatusCode: res.StatusCode,
  63612. },
  63613. }
  63614. target := &ret
  63615. if err := gensupport.DecodeResponse(target, res); err != nil {
  63616. return nil, err
  63617. }
  63618. return ret, nil
  63619. // {
  63620. // "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.",
  63621. // "httpMethod": "DELETE",
  63622. // "id": "compute.instanceGroupManagers.delete",
  63623. // "parameterOrder": [
  63624. // "project",
  63625. // "zone",
  63626. // "instanceGroupManager"
  63627. // ],
  63628. // "parameters": {
  63629. // "instanceGroupManager": {
  63630. // "description": "The name of the managed instance group to delete.",
  63631. // "location": "path",
  63632. // "required": true,
  63633. // "type": "string"
  63634. // },
  63635. // "project": {
  63636. // "description": "Project ID for this request.",
  63637. // "location": "path",
  63638. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63639. // "required": true,
  63640. // "type": "string"
  63641. // },
  63642. // "requestId": {
  63643. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63644. // "location": "query",
  63645. // "type": "string"
  63646. // },
  63647. // "zone": {
  63648. // "description": "The name of the zone where the managed instance group is located.",
  63649. // "location": "path",
  63650. // "required": true,
  63651. // "type": "string"
  63652. // }
  63653. // },
  63654. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  63655. // "response": {
  63656. // "$ref": "Operation"
  63657. // },
  63658. // "scopes": [
  63659. // "https://www.googleapis.com/auth/cloud-platform",
  63660. // "https://www.googleapis.com/auth/compute"
  63661. // ]
  63662. // }
  63663. }
  63664. // method id "compute.instanceGroupManagers.deleteInstances":
  63665. type InstanceGroupManagersDeleteInstancesCall struct {
  63666. s *Service
  63667. project string
  63668. zone string
  63669. instanceGroupManager string
  63670. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  63671. urlParams_ gensupport.URLParams
  63672. ctx_ context.Context
  63673. header_ http.Header
  63674. }
  63675. // DeleteInstances: Flags the specified instances in the managed
  63676. // instance group for immediate deletion. The instances are also removed
  63677. // from any target pools of which they were a member. This method
  63678. // reduces the targetSize of the managed instance group by the number of
  63679. // instances that you delete. This operation is marked as DONE when the
  63680. // action is scheduled even if the instances are still being deleted.
  63681. // You must separately verify the status of the deleting action with the
  63682. // listmanagedinstances method.
  63683. //
  63684. // If the group is part of a backend service that has enabled connection
  63685. // draining, it can take up to 60 seconds after the connection draining
  63686. // duration has elapsed before the VM instance is removed or
  63687. // deleted.
  63688. //
  63689. // You can specify a maximum of 1000 instances with this method per
  63690. // request.
  63691. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  63692. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63693. c.project = project
  63694. c.zone = zone
  63695. c.instanceGroupManager = instanceGroupManager
  63696. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  63697. return c
  63698. }
  63699. // RequestId sets the optional parameter "requestId": An optional
  63700. // request ID to identify requests. Specify a unique request ID so that
  63701. // if you must retry your request, the server will know to ignore the
  63702. // request if it has already been completed.
  63703. //
  63704. // For example, consider a situation where you make an initial request
  63705. // and the request times out. If you make the request again with the
  63706. // same request ID, the server can check if original operation with the
  63707. // same request ID was received, and if so, will ignore the second
  63708. // request. This prevents clients from accidentally creating duplicate
  63709. // commitments.
  63710. //
  63711. // The request ID must be a valid UUID with the exception that zero UUID
  63712. // is not supported (00000000-0000-0000-0000-000000000000).
  63713. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  63714. c.urlParams_.Set("requestId", requestId)
  63715. return c
  63716. }
  63717. // Fields allows partial responses to be retrieved. See
  63718. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63719. // for more information.
  63720. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  63721. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63722. return c
  63723. }
  63724. // Context sets the context to be used in this call's Do method. Any
  63725. // pending HTTP request will be aborted if the provided context is
  63726. // canceled.
  63727. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  63728. c.ctx_ = ctx
  63729. return c
  63730. }
  63731. // Header returns an http.Header that can be modified by the caller to
  63732. // add HTTP headers to the request.
  63733. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  63734. if c.header_ == nil {
  63735. c.header_ = make(http.Header)
  63736. }
  63737. return c.header_
  63738. }
  63739. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  63740. reqHeaders := make(http.Header)
  63741. for k, v := range c.header_ {
  63742. reqHeaders[k] = v
  63743. }
  63744. reqHeaders.Set("User-Agent", c.s.userAgent())
  63745. var body io.Reader = nil
  63746. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  63747. if err != nil {
  63748. return nil, err
  63749. }
  63750. reqHeaders.Set("Content-Type", "application/json")
  63751. c.urlParams_.Set("alt", alt)
  63752. c.urlParams_.Set("prettyPrint", "false")
  63753. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  63754. urls += "?" + c.urlParams_.Encode()
  63755. req, err := http.NewRequest("POST", urls, body)
  63756. if err != nil {
  63757. return nil, err
  63758. }
  63759. req.Header = reqHeaders
  63760. googleapi.Expand(req.URL, map[string]string{
  63761. "project": c.project,
  63762. "zone": c.zone,
  63763. "instanceGroupManager": c.instanceGroupManager,
  63764. })
  63765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63766. }
  63767. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  63768. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63769. // status code is an error. Response headers are in either
  63770. // *Operation.ServerResponse.Header or (if a response was returned at
  63771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63772. // to check whether the returned error was because
  63773. // http.StatusNotModified was returned.
  63774. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63775. gensupport.SetOptions(c.urlParams_, opts...)
  63776. res, err := c.doRequest("json")
  63777. if res != nil && res.StatusCode == http.StatusNotModified {
  63778. if res.Body != nil {
  63779. res.Body.Close()
  63780. }
  63781. return nil, &googleapi.Error{
  63782. Code: res.StatusCode,
  63783. Header: res.Header,
  63784. }
  63785. }
  63786. if err != nil {
  63787. return nil, err
  63788. }
  63789. defer googleapi.CloseBody(res)
  63790. if err := googleapi.CheckResponse(res); err != nil {
  63791. return nil, err
  63792. }
  63793. ret := &Operation{
  63794. ServerResponse: googleapi.ServerResponse{
  63795. Header: res.Header,
  63796. HTTPStatusCode: res.StatusCode,
  63797. },
  63798. }
  63799. target := &ret
  63800. if err := gensupport.DecodeResponse(target, res); err != nil {
  63801. return nil, err
  63802. }
  63803. return ret, nil
  63804. // {
  63805. // "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.",
  63806. // "httpMethod": "POST",
  63807. // "id": "compute.instanceGroupManagers.deleteInstances",
  63808. // "parameterOrder": [
  63809. // "project",
  63810. // "zone",
  63811. // "instanceGroupManager"
  63812. // ],
  63813. // "parameters": {
  63814. // "instanceGroupManager": {
  63815. // "description": "The name of the managed instance group.",
  63816. // "location": "path",
  63817. // "required": true,
  63818. // "type": "string"
  63819. // },
  63820. // "project": {
  63821. // "description": "Project ID for this request.",
  63822. // "location": "path",
  63823. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63824. // "required": true,
  63825. // "type": "string"
  63826. // },
  63827. // "requestId": {
  63828. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63829. // "location": "query",
  63830. // "type": "string"
  63831. // },
  63832. // "zone": {
  63833. // "description": "The name of the zone where the managed instance group is located.",
  63834. // "location": "path",
  63835. // "required": true,
  63836. // "type": "string"
  63837. // }
  63838. // },
  63839. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  63840. // "request": {
  63841. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  63842. // },
  63843. // "response": {
  63844. // "$ref": "Operation"
  63845. // },
  63846. // "scopes": [
  63847. // "https://www.googleapis.com/auth/cloud-platform",
  63848. // "https://www.googleapis.com/auth/compute"
  63849. // ]
  63850. // }
  63851. }
  63852. // method id "compute.instanceGroupManagers.deletePerInstanceConfigs":
  63853. type InstanceGroupManagersDeletePerInstanceConfigsCall struct {
  63854. s *Service
  63855. project string
  63856. zone string
  63857. instanceGroupManager string
  63858. instancegroupmanagersdeleteperinstanceconfigsreq *InstanceGroupManagersDeletePerInstanceConfigsReq
  63859. urlParams_ gensupport.URLParams
  63860. ctx_ context.Context
  63861. header_ http.Header
  63862. }
  63863. // DeletePerInstanceConfigs: Deletes selected per-instance configs for
  63864. // the managed instance group.
  63865. func (r *InstanceGroupManagersService) DeletePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteperinstanceconfigsreq *InstanceGroupManagersDeletePerInstanceConfigsReq) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  63866. c := &InstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63867. c.project = project
  63868. c.zone = zone
  63869. c.instanceGroupManager = instanceGroupManager
  63870. c.instancegroupmanagersdeleteperinstanceconfigsreq = instancegroupmanagersdeleteperinstanceconfigsreq
  63871. return c
  63872. }
  63873. // Fields allows partial responses to be retrieved. See
  63874. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63875. // for more information.
  63876. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  63877. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63878. return c
  63879. }
  63880. // Context sets the context to be used in this call's Do method. Any
  63881. // pending HTTP request will be aborted if the provided context is
  63882. // canceled.
  63883. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  63884. c.ctx_ = ctx
  63885. return c
  63886. }
  63887. // Header returns an http.Header that can be modified by the caller to
  63888. // add HTTP headers to the request.
  63889. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header {
  63890. if c.header_ == nil {
  63891. c.header_ = make(http.Header)
  63892. }
  63893. return c.header_
  63894. }
  63895. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  63896. reqHeaders := make(http.Header)
  63897. for k, v := range c.header_ {
  63898. reqHeaders[k] = v
  63899. }
  63900. reqHeaders.Set("User-Agent", c.s.userAgent())
  63901. var body io.Reader = nil
  63902. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteperinstanceconfigsreq)
  63903. if err != nil {
  63904. return nil, err
  63905. }
  63906. reqHeaders.Set("Content-Type", "application/json")
  63907. c.urlParams_.Set("alt", alt)
  63908. c.urlParams_.Set("prettyPrint", "false")
  63909. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs")
  63910. urls += "?" + c.urlParams_.Encode()
  63911. req, err := http.NewRequest("POST", urls, body)
  63912. if err != nil {
  63913. return nil, err
  63914. }
  63915. req.Header = reqHeaders
  63916. googleapi.Expand(req.URL, map[string]string{
  63917. "project": c.project,
  63918. "zone": c.zone,
  63919. "instanceGroupManager": c.instanceGroupManager,
  63920. })
  63921. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63922. }
  63923. // Do executes the "compute.instanceGroupManagers.deletePerInstanceConfigs" call.
  63924. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63925. // status code is an error. Response headers are in either
  63926. // *Operation.ServerResponse.Header or (if a response was returned at
  63927. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63928. // to check whether the returned error was because
  63929. // http.StatusNotModified was returned.
  63930. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63931. gensupport.SetOptions(c.urlParams_, opts...)
  63932. res, err := c.doRequest("json")
  63933. if res != nil && res.StatusCode == http.StatusNotModified {
  63934. if res.Body != nil {
  63935. res.Body.Close()
  63936. }
  63937. return nil, &googleapi.Error{
  63938. Code: res.StatusCode,
  63939. Header: res.Header,
  63940. }
  63941. }
  63942. if err != nil {
  63943. return nil, err
  63944. }
  63945. defer googleapi.CloseBody(res)
  63946. if err := googleapi.CheckResponse(res); err != nil {
  63947. return nil, err
  63948. }
  63949. ret := &Operation{
  63950. ServerResponse: googleapi.ServerResponse{
  63951. Header: res.Header,
  63952. HTTPStatusCode: res.StatusCode,
  63953. },
  63954. }
  63955. target := &ret
  63956. if err := gensupport.DecodeResponse(target, res); err != nil {
  63957. return nil, err
  63958. }
  63959. return ret, nil
  63960. // {
  63961. // "description": "Deletes selected per-instance configs for the managed instance group.",
  63962. // "httpMethod": "POST",
  63963. // "id": "compute.instanceGroupManagers.deletePerInstanceConfigs",
  63964. // "parameterOrder": [
  63965. // "project",
  63966. // "zone",
  63967. // "instanceGroupManager"
  63968. // ],
  63969. // "parameters": {
  63970. // "instanceGroupManager": {
  63971. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  63972. // "location": "path",
  63973. // "required": true,
  63974. // "type": "string"
  63975. // },
  63976. // "project": {
  63977. // "description": "Project ID for this request.",
  63978. // "location": "path",
  63979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63980. // "required": true,
  63981. // "type": "string"
  63982. // },
  63983. // "zone": {
  63984. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  63985. // "location": "path",
  63986. // "required": true,
  63987. // "type": "string"
  63988. // }
  63989. // },
  63990. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
  63991. // "request": {
  63992. // "$ref": "InstanceGroupManagersDeletePerInstanceConfigsReq"
  63993. // },
  63994. // "response": {
  63995. // "$ref": "Operation"
  63996. // },
  63997. // "scopes": [
  63998. // "https://www.googleapis.com/auth/cloud-platform",
  63999. // "https://www.googleapis.com/auth/compute"
  64000. // ]
  64001. // }
  64002. }
  64003. // method id "compute.instanceGroupManagers.get":
  64004. type InstanceGroupManagersGetCall struct {
  64005. s *Service
  64006. project string
  64007. zone string
  64008. instanceGroupManager string
  64009. urlParams_ gensupport.URLParams
  64010. ifNoneMatch_ string
  64011. ctx_ context.Context
  64012. header_ http.Header
  64013. }
  64014. // Get: Returns all of the details about the specified managed instance
  64015. // group. Gets a list of available managed instance groups by making a
  64016. // list() request.
  64017. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  64018. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64019. c.project = project
  64020. c.zone = zone
  64021. c.instanceGroupManager = instanceGroupManager
  64022. return c
  64023. }
  64024. // Fields allows partial responses to be retrieved. See
  64025. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64026. // for more information.
  64027. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  64028. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64029. return c
  64030. }
  64031. // IfNoneMatch sets the optional parameter which makes the operation
  64032. // fail if the object's ETag matches the given value. This is useful for
  64033. // getting updates only after the object has changed since the last
  64034. // request. Use googleapi.IsNotModified to check whether the response
  64035. // error from Do is the result of In-None-Match.
  64036. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  64037. c.ifNoneMatch_ = entityTag
  64038. return c
  64039. }
  64040. // Context sets the context to be used in this call's Do method. Any
  64041. // pending HTTP request will be aborted if the provided context is
  64042. // canceled.
  64043. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  64044. c.ctx_ = ctx
  64045. return c
  64046. }
  64047. // Header returns an http.Header that can be modified by the caller to
  64048. // add HTTP headers to the request.
  64049. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  64050. if c.header_ == nil {
  64051. c.header_ = make(http.Header)
  64052. }
  64053. return c.header_
  64054. }
  64055. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  64056. reqHeaders := make(http.Header)
  64057. for k, v := range c.header_ {
  64058. reqHeaders[k] = v
  64059. }
  64060. reqHeaders.Set("User-Agent", c.s.userAgent())
  64061. if c.ifNoneMatch_ != "" {
  64062. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64063. }
  64064. var body io.Reader = nil
  64065. c.urlParams_.Set("alt", alt)
  64066. c.urlParams_.Set("prettyPrint", "false")
  64067. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  64068. urls += "?" + c.urlParams_.Encode()
  64069. req, err := http.NewRequest("GET", urls, body)
  64070. if err != nil {
  64071. return nil, err
  64072. }
  64073. req.Header = reqHeaders
  64074. googleapi.Expand(req.URL, map[string]string{
  64075. "project": c.project,
  64076. "zone": c.zone,
  64077. "instanceGroupManager": c.instanceGroupManager,
  64078. })
  64079. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64080. }
  64081. // Do executes the "compute.instanceGroupManagers.get" call.
  64082. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  64083. // non-2xx status code is an error. Response headers are in either
  64084. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  64085. // returned at all) in error.(*googleapi.Error).Header. Use
  64086. // googleapi.IsNotModified to check whether the returned error was
  64087. // because http.StatusNotModified was returned.
  64088. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  64089. gensupport.SetOptions(c.urlParams_, opts...)
  64090. res, err := c.doRequest("json")
  64091. if res != nil && res.StatusCode == http.StatusNotModified {
  64092. if res.Body != nil {
  64093. res.Body.Close()
  64094. }
  64095. return nil, &googleapi.Error{
  64096. Code: res.StatusCode,
  64097. Header: res.Header,
  64098. }
  64099. }
  64100. if err != nil {
  64101. return nil, err
  64102. }
  64103. defer googleapi.CloseBody(res)
  64104. if err := googleapi.CheckResponse(res); err != nil {
  64105. return nil, err
  64106. }
  64107. ret := &InstanceGroupManager{
  64108. ServerResponse: googleapi.ServerResponse{
  64109. Header: res.Header,
  64110. HTTPStatusCode: res.StatusCode,
  64111. },
  64112. }
  64113. target := &ret
  64114. if err := gensupport.DecodeResponse(target, res); err != nil {
  64115. return nil, err
  64116. }
  64117. return ret, nil
  64118. // {
  64119. // "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.",
  64120. // "httpMethod": "GET",
  64121. // "id": "compute.instanceGroupManagers.get",
  64122. // "parameterOrder": [
  64123. // "project",
  64124. // "zone",
  64125. // "instanceGroupManager"
  64126. // ],
  64127. // "parameters": {
  64128. // "instanceGroupManager": {
  64129. // "description": "The name of the managed instance group.",
  64130. // "location": "path",
  64131. // "required": true,
  64132. // "type": "string"
  64133. // },
  64134. // "project": {
  64135. // "description": "Project ID for this request.",
  64136. // "location": "path",
  64137. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64138. // "required": true,
  64139. // "type": "string"
  64140. // },
  64141. // "zone": {
  64142. // "description": "The name of the zone where the managed instance group is located.",
  64143. // "location": "path",
  64144. // "required": true,
  64145. // "type": "string"
  64146. // }
  64147. // },
  64148. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  64149. // "response": {
  64150. // "$ref": "InstanceGroupManager"
  64151. // },
  64152. // "scopes": [
  64153. // "https://www.googleapis.com/auth/cloud-platform",
  64154. // "https://www.googleapis.com/auth/compute",
  64155. // "https://www.googleapis.com/auth/compute.readonly"
  64156. // ]
  64157. // }
  64158. }
  64159. // method id "compute.instanceGroupManagers.insert":
  64160. type InstanceGroupManagersInsertCall struct {
  64161. s *Service
  64162. project string
  64163. zone string
  64164. instancegroupmanager *InstanceGroupManager
  64165. urlParams_ gensupport.URLParams
  64166. ctx_ context.Context
  64167. header_ http.Header
  64168. }
  64169. // Insert: Creates a managed instance group using the information that
  64170. // you specify in the request. After the group is created, instances in
  64171. // the group are created using the specified instance template. This
  64172. // operation is marked as DONE when the group is created even if the
  64173. // instances in the group have not yet been created. You must separately
  64174. // verify the status of the individual instances with the
  64175. // listmanagedinstances method.
  64176. //
  64177. // A managed instance group can have up to 1000 VM instances per group.
  64178. // Please contact Cloud Support if you need an increase in this limit.
  64179. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  64180. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64181. c.project = project
  64182. c.zone = zone
  64183. c.instancegroupmanager = instancegroupmanager
  64184. return c
  64185. }
  64186. // RequestId sets the optional parameter "requestId": An optional
  64187. // request ID to identify requests. Specify a unique request ID so that
  64188. // if you must retry your request, the server will know to ignore the
  64189. // request if it has already been completed.
  64190. //
  64191. // For example, consider a situation where you make an initial request
  64192. // and the request times out. If you make the request again with the
  64193. // same request ID, the server can check if original operation with the
  64194. // same request ID was received, and if so, will ignore the second
  64195. // request. This prevents clients from accidentally creating duplicate
  64196. // commitments.
  64197. //
  64198. // The request ID must be a valid UUID with the exception that zero UUID
  64199. // is not supported (00000000-0000-0000-0000-000000000000).
  64200. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  64201. c.urlParams_.Set("requestId", requestId)
  64202. return c
  64203. }
  64204. // Fields allows partial responses to be retrieved. See
  64205. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64206. // for more information.
  64207. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  64208. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64209. return c
  64210. }
  64211. // Context sets the context to be used in this call's Do method. Any
  64212. // pending HTTP request will be aborted if the provided context is
  64213. // canceled.
  64214. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  64215. c.ctx_ = ctx
  64216. return c
  64217. }
  64218. // Header returns an http.Header that can be modified by the caller to
  64219. // add HTTP headers to the request.
  64220. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  64221. if c.header_ == nil {
  64222. c.header_ = make(http.Header)
  64223. }
  64224. return c.header_
  64225. }
  64226. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  64227. reqHeaders := make(http.Header)
  64228. for k, v := range c.header_ {
  64229. reqHeaders[k] = v
  64230. }
  64231. reqHeaders.Set("User-Agent", c.s.userAgent())
  64232. var body io.Reader = nil
  64233. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  64234. if err != nil {
  64235. return nil, err
  64236. }
  64237. reqHeaders.Set("Content-Type", "application/json")
  64238. c.urlParams_.Set("alt", alt)
  64239. c.urlParams_.Set("prettyPrint", "false")
  64240. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  64241. urls += "?" + c.urlParams_.Encode()
  64242. req, err := http.NewRequest("POST", urls, body)
  64243. if err != nil {
  64244. return nil, err
  64245. }
  64246. req.Header = reqHeaders
  64247. googleapi.Expand(req.URL, map[string]string{
  64248. "project": c.project,
  64249. "zone": c.zone,
  64250. })
  64251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64252. }
  64253. // Do executes the "compute.instanceGroupManagers.insert" call.
  64254. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64255. // status code is an error. Response headers are in either
  64256. // *Operation.ServerResponse.Header or (if a response was returned at
  64257. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64258. // to check whether the returned error was because
  64259. // http.StatusNotModified was returned.
  64260. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64261. gensupport.SetOptions(c.urlParams_, opts...)
  64262. res, err := c.doRequest("json")
  64263. if res != nil && res.StatusCode == http.StatusNotModified {
  64264. if res.Body != nil {
  64265. res.Body.Close()
  64266. }
  64267. return nil, &googleapi.Error{
  64268. Code: res.StatusCode,
  64269. Header: res.Header,
  64270. }
  64271. }
  64272. if err != nil {
  64273. return nil, err
  64274. }
  64275. defer googleapi.CloseBody(res)
  64276. if err := googleapi.CheckResponse(res); err != nil {
  64277. return nil, err
  64278. }
  64279. ret := &Operation{
  64280. ServerResponse: googleapi.ServerResponse{
  64281. Header: res.Header,
  64282. HTTPStatusCode: res.StatusCode,
  64283. },
  64284. }
  64285. target := &ret
  64286. if err := gensupport.DecodeResponse(target, res); err != nil {
  64287. return nil, err
  64288. }
  64289. return ret, nil
  64290. // {
  64291. // "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.",
  64292. // "httpMethod": "POST",
  64293. // "id": "compute.instanceGroupManagers.insert",
  64294. // "parameterOrder": [
  64295. // "project",
  64296. // "zone"
  64297. // ],
  64298. // "parameters": {
  64299. // "project": {
  64300. // "description": "Project ID for this request.",
  64301. // "location": "path",
  64302. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64303. // "required": true,
  64304. // "type": "string"
  64305. // },
  64306. // "requestId": {
  64307. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64308. // "location": "query",
  64309. // "type": "string"
  64310. // },
  64311. // "zone": {
  64312. // "description": "The name of the zone where you want to create the managed instance group.",
  64313. // "location": "path",
  64314. // "required": true,
  64315. // "type": "string"
  64316. // }
  64317. // },
  64318. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  64319. // "request": {
  64320. // "$ref": "InstanceGroupManager"
  64321. // },
  64322. // "response": {
  64323. // "$ref": "Operation"
  64324. // },
  64325. // "scopes": [
  64326. // "https://www.googleapis.com/auth/cloud-platform",
  64327. // "https://www.googleapis.com/auth/compute"
  64328. // ]
  64329. // }
  64330. }
  64331. // method id "compute.instanceGroupManagers.list":
  64332. type InstanceGroupManagersListCall struct {
  64333. s *Service
  64334. project string
  64335. zone string
  64336. urlParams_ gensupport.URLParams
  64337. ifNoneMatch_ string
  64338. ctx_ context.Context
  64339. header_ http.Header
  64340. }
  64341. // List: Retrieves a list of managed instance groups that are contained
  64342. // within the specified project and zone.
  64343. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  64344. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64345. c.project = project
  64346. c.zone = zone
  64347. return c
  64348. }
  64349. // Filter sets the optional parameter "filter": A filter expression that
  64350. // filters resources listed in the response. The expression must specify
  64351. // the field name, a comparison operator, and the value that you want to
  64352. // use for filtering. The value must be a string, a number, or a
  64353. // boolean. The comparison operator must be either =, !=, >, or <.
  64354. //
  64355. // For example, if you are filtering Compute Engine instances, you can
  64356. // exclude instances named example-instance by specifying name !=
  64357. // example-instance.
  64358. //
  64359. // You can also filter nested fields. For example, you could specify
  64360. // scheduling.automaticRestart = false to include instances only if they
  64361. // are not scheduled for automatic restarts. You can use filtering on
  64362. // nested fields to filter based on resource labels.
  64363. //
  64364. // To filter on multiple expressions, provide each separate expression
  64365. // within parentheses. For example, (scheduling.automaticRestart = true)
  64366. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64367. // AND expression. However, you can include AND and OR expressions
  64368. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64369. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64370. // true).
  64371. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  64372. c.urlParams_.Set("filter", filter)
  64373. return c
  64374. }
  64375. // MaxResults sets the optional parameter "maxResults": The maximum
  64376. // number of results per page that should be returned. If the number of
  64377. // available results is larger than maxResults, Compute Engine returns a
  64378. // nextPageToken that can be used to get the next page of results in
  64379. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64380. // (Default: 500)
  64381. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  64382. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64383. return c
  64384. }
  64385. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64386. // a certain order. By default, results are returned in alphanumerical
  64387. // order based on the resource name.
  64388. //
  64389. // You can also sort results in descending order based on the creation
  64390. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64391. // based on the creationTimestamp field in reverse chronological order
  64392. // (newest result first). Use this to sort resources like operations so
  64393. // that the newest operation is returned first.
  64394. //
  64395. // Currently, only sorting by name or creationTimestamp desc is
  64396. // supported.
  64397. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  64398. c.urlParams_.Set("orderBy", orderBy)
  64399. return c
  64400. }
  64401. // PageToken sets the optional parameter "pageToken": Specifies a page
  64402. // token to use. Set pageToken to the nextPageToken returned by a
  64403. // previous list request to get the next page of results.
  64404. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  64405. c.urlParams_.Set("pageToken", pageToken)
  64406. return c
  64407. }
  64408. // Fields allows partial responses to be retrieved. See
  64409. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64410. // for more information.
  64411. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  64412. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64413. return c
  64414. }
  64415. // IfNoneMatch sets the optional parameter which makes the operation
  64416. // fail if the object's ETag matches the given value. This is useful for
  64417. // getting updates only after the object has changed since the last
  64418. // request. Use googleapi.IsNotModified to check whether the response
  64419. // error from Do is the result of In-None-Match.
  64420. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  64421. c.ifNoneMatch_ = entityTag
  64422. return c
  64423. }
  64424. // Context sets the context to be used in this call's Do method. Any
  64425. // pending HTTP request will be aborted if the provided context is
  64426. // canceled.
  64427. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  64428. c.ctx_ = ctx
  64429. return c
  64430. }
  64431. // Header returns an http.Header that can be modified by the caller to
  64432. // add HTTP headers to the request.
  64433. func (c *InstanceGroupManagersListCall) Header() http.Header {
  64434. if c.header_ == nil {
  64435. c.header_ = make(http.Header)
  64436. }
  64437. return c.header_
  64438. }
  64439. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  64440. reqHeaders := make(http.Header)
  64441. for k, v := range c.header_ {
  64442. reqHeaders[k] = v
  64443. }
  64444. reqHeaders.Set("User-Agent", c.s.userAgent())
  64445. if c.ifNoneMatch_ != "" {
  64446. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64447. }
  64448. var body io.Reader = nil
  64449. c.urlParams_.Set("alt", alt)
  64450. c.urlParams_.Set("prettyPrint", "false")
  64451. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  64452. urls += "?" + c.urlParams_.Encode()
  64453. req, err := http.NewRequest("GET", urls, body)
  64454. if err != nil {
  64455. return nil, err
  64456. }
  64457. req.Header = reqHeaders
  64458. googleapi.Expand(req.URL, map[string]string{
  64459. "project": c.project,
  64460. "zone": c.zone,
  64461. })
  64462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64463. }
  64464. // Do executes the "compute.instanceGroupManagers.list" call.
  64465. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  64466. // Any non-2xx status code is an error. Response headers are in either
  64467. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  64468. // returned at all) in error.(*googleapi.Error).Header. Use
  64469. // googleapi.IsNotModified to check whether the returned error was
  64470. // because http.StatusNotModified was returned.
  64471. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  64472. gensupport.SetOptions(c.urlParams_, opts...)
  64473. res, err := c.doRequest("json")
  64474. if res != nil && res.StatusCode == http.StatusNotModified {
  64475. if res.Body != nil {
  64476. res.Body.Close()
  64477. }
  64478. return nil, &googleapi.Error{
  64479. Code: res.StatusCode,
  64480. Header: res.Header,
  64481. }
  64482. }
  64483. if err != nil {
  64484. return nil, err
  64485. }
  64486. defer googleapi.CloseBody(res)
  64487. if err := googleapi.CheckResponse(res); err != nil {
  64488. return nil, err
  64489. }
  64490. ret := &InstanceGroupManagerList{
  64491. ServerResponse: googleapi.ServerResponse{
  64492. Header: res.Header,
  64493. HTTPStatusCode: res.StatusCode,
  64494. },
  64495. }
  64496. target := &ret
  64497. if err := gensupport.DecodeResponse(target, res); err != nil {
  64498. return nil, err
  64499. }
  64500. return ret, nil
  64501. // {
  64502. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  64503. // "httpMethod": "GET",
  64504. // "id": "compute.instanceGroupManagers.list",
  64505. // "parameterOrder": [
  64506. // "project",
  64507. // "zone"
  64508. // ],
  64509. // "parameters": {
  64510. // "filter": {
  64511. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64512. // "location": "query",
  64513. // "type": "string"
  64514. // },
  64515. // "maxResults": {
  64516. // "default": "500",
  64517. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64518. // "format": "uint32",
  64519. // "location": "query",
  64520. // "minimum": "0",
  64521. // "type": "integer"
  64522. // },
  64523. // "orderBy": {
  64524. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64525. // "location": "query",
  64526. // "type": "string"
  64527. // },
  64528. // "pageToken": {
  64529. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64530. // "location": "query",
  64531. // "type": "string"
  64532. // },
  64533. // "project": {
  64534. // "description": "Project ID for this request.",
  64535. // "location": "path",
  64536. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64537. // "required": true,
  64538. // "type": "string"
  64539. // },
  64540. // "zone": {
  64541. // "description": "The name of the zone where the managed instance group is located.",
  64542. // "location": "path",
  64543. // "required": true,
  64544. // "type": "string"
  64545. // }
  64546. // },
  64547. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  64548. // "response": {
  64549. // "$ref": "InstanceGroupManagerList"
  64550. // },
  64551. // "scopes": [
  64552. // "https://www.googleapis.com/auth/cloud-platform",
  64553. // "https://www.googleapis.com/auth/compute",
  64554. // "https://www.googleapis.com/auth/compute.readonly"
  64555. // ]
  64556. // }
  64557. }
  64558. // Pages invokes f for each page of results.
  64559. // A non-nil error returned from f will halt the iteration.
  64560. // The provided context supersedes any context provided to the Context method.
  64561. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  64562. c.ctx_ = ctx
  64563. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64564. for {
  64565. x, err := c.Do()
  64566. if err != nil {
  64567. return err
  64568. }
  64569. if err := f(x); err != nil {
  64570. return err
  64571. }
  64572. if x.NextPageToken == "" {
  64573. return nil
  64574. }
  64575. c.PageToken(x.NextPageToken)
  64576. }
  64577. }
  64578. // method id "compute.instanceGroupManagers.listManagedInstances":
  64579. type InstanceGroupManagersListManagedInstancesCall struct {
  64580. s *Service
  64581. project string
  64582. zone string
  64583. instanceGroupManager string
  64584. urlParams_ gensupport.URLParams
  64585. ctx_ context.Context
  64586. header_ http.Header
  64587. }
  64588. // ListManagedInstances: Lists all of the instances in the managed
  64589. // instance group. Each instance in the list has a currentAction, which
  64590. // indicates the action that the managed instance group is performing on
  64591. // the instance. For example, if the group is still creating an
  64592. // instance, the currentAction is CREATING. If a previous action failed,
  64593. // the list displays the errors for that failed action.
  64594. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  64595. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64596. c.project = project
  64597. c.zone = zone
  64598. c.instanceGroupManager = instanceGroupManager
  64599. return c
  64600. }
  64601. // Filter sets the optional parameter "filter": A filter expression that
  64602. // filters resources listed in the response. The expression must specify
  64603. // the field name, a comparison operator, and the value that you want to
  64604. // use for filtering. The value must be a string, a number, or a
  64605. // boolean. The comparison operator must be either =, !=, >, or <.
  64606. //
  64607. // For example, if you are filtering Compute Engine instances, you can
  64608. // exclude instances named example-instance by specifying name !=
  64609. // example-instance.
  64610. //
  64611. // You can also filter nested fields. For example, you could specify
  64612. // scheduling.automaticRestart = false to include instances only if they
  64613. // are not scheduled for automatic restarts. You can use filtering on
  64614. // nested fields to filter based on resource labels.
  64615. //
  64616. // To filter on multiple expressions, provide each separate expression
  64617. // within parentheses. For example, (scheduling.automaticRestart = true)
  64618. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64619. // AND expression. However, you can include AND and OR expressions
  64620. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64621. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64622. // true).
  64623. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  64624. c.urlParams_.Set("filter", filter)
  64625. return c
  64626. }
  64627. // MaxResults sets the optional parameter "maxResults": The maximum
  64628. // number of results per page that should be returned. If the number of
  64629. // available results is larger than maxResults, Compute Engine returns a
  64630. // nextPageToken that can be used to get the next page of results in
  64631. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64632. // (Default: 500)
  64633. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  64634. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64635. return c
  64636. }
  64637. // OrderBy sets the optional parameter "order_by": Sorts list results by
  64638. // a certain order. By default, results are returned in alphanumerical
  64639. // order based on the resource name.
  64640. //
  64641. // You can also sort results in descending order based on the creation
  64642. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64643. // based on the creationTimestamp field in reverse chronological order
  64644. // (newest result first). Use this to sort resources like operations so
  64645. // that the newest operation is returned first.
  64646. //
  64647. // Currently, only sorting by name or creationTimestamp desc is
  64648. // supported.
  64649. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  64650. c.urlParams_.Set("order_by", orderBy)
  64651. return c
  64652. }
  64653. // PageToken sets the optional parameter "pageToken": Specifies a page
  64654. // token to use. Set pageToken to the nextPageToken returned by a
  64655. // previous list request to get the next page of results.
  64656. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  64657. c.urlParams_.Set("pageToken", pageToken)
  64658. return c
  64659. }
  64660. // Fields allows partial responses to be retrieved. See
  64661. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64662. // for more information.
  64663. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  64664. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64665. return c
  64666. }
  64667. // Context sets the context to be used in this call's Do method. Any
  64668. // pending HTTP request will be aborted if the provided context is
  64669. // canceled.
  64670. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  64671. c.ctx_ = ctx
  64672. return c
  64673. }
  64674. // Header returns an http.Header that can be modified by the caller to
  64675. // add HTTP headers to the request.
  64676. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  64677. if c.header_ == nil {
  64678. c.header_ = make(http.Header)
  64679. }
  64680. return c.header_
  64681. }
  64682. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  64683. reqHeaders := make(http.Header)
  64684. for k, v := range c.header_ {
  64685. reqHeaders[k] = v
  64686. }
  64687. reqHeaders.Set("User-Agent", c.s.userAgent())
  64688. var body io.Reader = nil
  64689. c.urlParams_.Set("alt", alt)
  64690. c.urlParams_.Set("prettyPrint", "false")
  64691. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  64692. urls += "?" + c.urlParams_.Encode()
  64693. req, err := http.NewRequest("POST", urls, body)
  64694. if err != nil {
  64695. return nil, err
  64696. }
  64697. req.Header = reqHeaders
  64698. googleapi.Expand(req.URL, map[string]string{
  64699. "project": c.project,
  64700. "zone": c.zone,
  64701. "instanceGroupManager": c.instanceGroupManager,
  64702. })
  64703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64704. }
  64705. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  64706. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  64707. // error will be non-nil. Any non-2xx status code is an error. Response
  64708. // headers are in either
  64709. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  64710. // er or (if a response was returned at all) in
  64711. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  64712. // whether the returned error was because http.StatusNotModified was
  64713. // returned.
  64714. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  64715. gensupport.SetOptions(c.urlParams_, opts...)
  64716. res, err := c.doRequest("json")
  64717. if res != nil && res.StatusCode == http.StatusNotModified {
  64718. if res.Body != nil {
  64719. res.Body.Close()
  64720. }
  64721. return nil, &googleapi.Error{
  64722. Code: res.StatusCode,
  64723. Header: res.Header,
  64724. }
  64725. }
  64726. if err != nil {
  64727. return nil, err
  64728. }
  64729. defer googleapi.CloseBody(res)
  64730. if err := googleapi.CheckResponse(res); err != nil {
  64731. return nil, err
  64732. }
  64733. ret := &InstanceGroupManagersListManagedInstancesResponse{
  64734. ServerResponse: googleapi.ServerResponse{
  64735. Header: res.Header,
  64736. HTTPStatusCode: res.StatusCode,
  64737. },
  64738. }
  64739. target := &ret
  64740. if err := gensupport.DecodeResponse(target, res); err != nil {
  64741. return nil, err
  64742. }
  64743. return ret, nil
  64744. // {
  64745. // "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.",
  64746. // "httpMethod": "POST",
  64747. // "id": "compute.instanceGroupManagers.listManagedInstances",
  64748. // "parameterOrder": [
  64749. // "project",
  64750. // "zone",
  64751. // "instanceGroupManager"
  64752. // ],
  64753. // "parameters": {
  64754. // "filter": {
  64755. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64756. // "location": "query",
  64757. // "type": "string"
  64758. // },
  64759. // "instanceGroupManager": {
  64760. // "description": "The name of the managed instance group.",
  64761. // "location": "path",
  64762. // "required": true,
  64763. // "type": "string"
  64764. // },
  64765. // "maxResults": {
  64766. // "default": "500",
  64767. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64768. // "format": "uint32",
  64769. // "location": "query",
  64770. // "minimum": "0",
  64771. // "type": "integer"
  64772. // },
  64773. // "order_by": {
  64774. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64775. // "location": "query",
  64776. // "type": "string"
  64777. // },
  64778. // "pageToken": {
  64779. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64780. // "location": "query",
  64781. // "type": "string"
  64782. // },
  64783. // "project": {
  64784. // "description": "Project ID for this request.",
  64785. // "location": "path",
  64786. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64787. // "required": true,
  64788. // "type": "string"
  64789. // },
  64790. // "zone": {
  64791. // "description": "The name of the zone where the managed instance group is located.",
  64792. // "location": "path",
  64793. // "required": true,
  64794. // "type": "string"
  64795. // }
  64796. // },
  64797. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  64798. // "response": {
  64799. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  64800. // },
  64801. // "scopes": [
  64802. // "https://www.googleapis.com/auth/cloud-platform",
  64803. // "https://www.googleapis.com/auth/compute",
  64804. // "https://www.googleapis.com/auth/compute.readonly"
  64805. // ]
  64806. // }
  64807. }
  64808. // Pages invokes f for each page of results.
  64809. // A non-nil error returned from f will halt the iteration.
  64810. // The provided context supersedes any context provided to the Context method.
  64811. func (c *InstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListManagedInstancesResponse) error) error {
  64812. c.ctx_ = ctx
  64813. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64814. for {
  64815. x, err := c.Do()
  64816. if err != nil {
  64817. return err
  64818. }
  64819. if err := f(x); err != nil {
  64820. return err
  64821. }
  64822. if x.NextPageToken == "" {
  64823. return nil
  64824. }
  64825. c.PageToken(x.NextPageToken)
  64826. }
  64827. }
  64828. // method id "compute.instanceGroupManagers.listPerInstanceConfigs":
  64829. type InstanceGroupManagersListPerInstanceConfigsCall struct {
  64830. s *Service
  64831. project string
  64832. zone string
  64833. instanceGroupManager string
  64834. urlParams_ gensupport.URLParams
  64835. ctx_ context.Context
  64836. header_ http.Header
  64837. }
  64838. // ListPerInstanceConfigs: Lists all of the per-instance configs defined
  64839. // for the managed instance group.
  64840. func (r *InstanceGroupManagersService) ListPerInstanceConfigs(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListPerInstanceConfigsCall {
  64841. c := &InstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64842. c.project = project
  64843. c.zone = zone
  64844. c.instanceGroupManager = instanceGroupManager
  64845. return c
  64846. }
  64847. // Filter sets the optional parameter "filter": A filter expression that
  64848. // filters resources listed in the response. The expression must specify
  64849. // the field name, a comparison operator, and the value that you want to
  64850. // use for filtering. The value must be a string, a number, or a
  64851. // boolean. The comparison operator must be either =, !=, >, or <.
  64852. //
  64853. // For example, if you are filtering Compute Engine instances, you can
  64854. // exclude instances named example-instance by specifying name !=
  64855. // example-instance.
  64856. //
  64857. // You can also filter nested fields. For example, you could specify
  64858. // scheduling.automaticRestart = false to include instances only if they
  64859. // are not scheduled for automatic restarts. You can use filtering on
  64860. // nested fields to filter based on resource labels.
  64861. //
  64862. // To filter on multiple expressions, provide each separate expression
  64863. // within parentheses. For example, (scheduling.automaticRestart = true)
  64864. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64865. // AND expression. However, you can include AND and OR expressions
  64866. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64867. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64868. // true).
  64869. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *InstanceGroupManagersListPerInstanceConfigsCall {
  64870. c.urlParams_.Set("filter", filter)
  64871. return c
  64872. }
  64873. // MaxResults sets the optional parameter "maxResults": The maximum
  64874. // number of results per page that should be returned. If the number of
  64875. // available results is larger than maxResults, Compute Engine returns a
  64876. // nextPageToken that can be used to get the next page of results in
  64877. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64878. // (Default: 500)
  64879. func (c *InstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *InstanceGroupManagersListPerInstanceConfigsCall {
  64880. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64881. return c
  64882. }
  64883. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64884. // a certain order. By default, results are returned in alphanumerical
  64885. // order based on the resource name.
  64886. //
  64887. // You can also sort results in descending order based on the creation
  64888. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64889. // based on the creationTimestamp field in reverse chronological order
  64890. // (newest result first). Use this to sort resources like operations so
  64891. // that the newest operation is returned first.
  64892. //
  64893. // Currently, only sorting by name or creationTimestamp desc is
  64894. // supported.
  64895. func (c *InstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *InstanceGroupManagersListPerInstanceConfigsCall {
  64896. c.urlParams_.Set("orderBy", orderBy)
  64897. return c
  64898. }
  64899. // PageToken sets the optional parameter "pageToken": Specifies a page
  64900. // token to use. Set pageToken to the nextPageToken returned by a
  64901. // previous list request to get the next page of results.
  64902. func (c *InstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *InstanceGroupManagersListPerInstanceConfigsCall {
  64903. c.urlParams_.Set("pageToken", pageToken)
  64904. return c
  64905. }
  64906. // Fields allows partial responses to be retrieved. See
  64907. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64908. // for more information.
  64909. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListPerInstanceConfigsCall {
  64910. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64911. return c
  64912. }
  64913. // Context sets the context to be used in this call's Do method. Any
  64914. // pending HTTP request will be aborted if the provided context is
  64915. // canceled.
  64916. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersListPerInstanceConfigsCall {
  64917. c.ctx_ = ctx
  64918. return c
  64919. }
  64920. // Header returns an http.Header that can be modified by the caller to
  64921. // add HTTP headers to the request.
  64922. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header {
  64923. if c.header_ == nil {
  64924. c.header_ = make(http.Header)
  64925. }
  64926. return c.header_
  64927. }
  64928. func (c *InstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  64929. reqHeaders := make(http.Header)
  64930. for k, v := range c.header_ {
  64931. reqHeaders[k] = v
  64932. }
  64933. reqHeaders.Set("User-Agent", c.s.userAgent())
  64934. var body io.Reader = nil
  64935. c.urlParams_.Set("alt", alt)
  64936. c.urlParams_.Set("prettyPrint", "false")
  64937. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs")
  64938. urls += "?" + c.urlParams_.Encode()
  64939. req, err := http.NewRequest("POST", urls, body)
  64940. if err != nil {
  64941. return nil, err
  64942. }
  64943. req.Header = reqHeaders
  64944. googleapi.Expand(req.URL, map[string]string{
  64945. "project": c.project,
  64946. "zone": c.zone,
  64947. "instanceGroupManager": c.instanceGroupManager,
  64948. })
  64949. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64950. }
  64951. // Do executes the "compute.instanceGroupManagers.listPerInstanceConfigs" call.
  64952. // Exactly one of *InstanceGroupManagersListPerInstanceConfigsResp or
  64953. // error will be non-nil. Any non-2xx status code is an error. Response
  64954. // headers are in either
  64955. // *InstanceGroupManagersListPerInstanceConfigsResp.ServerResponse.Header
  64956. // or (if a response was returned at all) in
  64957. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  64958. // whether the returned error was because http.StatusNotModified was
  64959. // returned.
  64960. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListPerInstanceConfigsResp, error) {
  64961. gensupport.SetOptions(c.urlParams_, opts...)
  64962. res, err := c.doRequest("json")
  64963. if res != nil && res.StatusCode == http.StatusNotModified {
  64964. if res.Body != nil {
  64965. res.Body.Close()
  64966. }
  64967. return nil, &googleapi.Error{
  64968. Code: res.StatusCode,
  64969. Header: res.Header,
  64970. }
  64971. }
  64972. if err != nil {
  64973. return nil, err
  64974. }
  64975. defer googleapi.CloseBody(res)
  64976. if err := googleapi.CheckResponse(res); err != nil {
  64977. return nil, err
  64978. }
  64979. ret := &InstanceGroupManagersListPerInstanceConfigsResp{
  64980. ServerResponse: googleapi.ServerResponse{
  64981. Header: res.Header,
  64982. HTTPStatusCode: res.StatusCode,
  64983. },
  64984. }
  64985. target := &ret
  64986. if err := gensupport.DecodeResponse(target, res); err != nil {
  64987. return nil, err
  64988. }
  64989. return ret, nil
  64990. // {
  64991. // "description": "Lists all of the per-instance configs defined for the managed instance group.",
  64992. // "httpMethod": "POST",
  64993. // "id": "compute.instanceGroupManagers.listPerInstanceConfigs",
  64994. // "parameterOrder": [
  64995. // "project",
  64996. // "zone",
  64997. // "instanceGroupManager"
  64998. // ],
  64999. // "parameters": {
  65000. // "filter": {
  65001. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  65002. // "location": "query",
  65003. // "type": "string"
  65004. // },
  65005. // "instanceGroupManager": {
  65006. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  65007. // "location": "path",
  65008. // "required": true,
  65009. // "type": "string"
  65010. // },
  65011. // "maxResults": {
  65012. // "default": "500",
  65013. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  65014. // "format": "uint32",
  65015. // "location": "query",
  65016. // "minimum": "0",
  65017. // "type": "integer"
  65018. // },
  65019. // "orderBy": {
  65020. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  65021. // "location": "query",
  65022. // "type": "string"
  65023. // },
  65024. // "pageToken": {
  65025. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  65026. // "location": "query",
  65027. // "type": "string"
  65028. // },
  65029. // "project": {
  65030. // "description": "Project ID for this request.",
  65031. // "location": "path",
  65032. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65033. // "required": true,
  65034. // "type": "string"
  65035. // },
  65036. // "zone": {
  65037. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  65038. // "location": "path",
  65039. // "required": true,
  65040. // "type": "string"
  65041. // }
  65042. // },
  65043. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
  65044. // "response": {
  65045. // "$ref": "InstanceGroupManagersListPerInstanceConfigsResp"
  65046. // },
  65047. // "scopes": [
  65048. // "https://www.googleapis.com/auth/cloud-platform",
  65049. // "https://www.googleapis.com/auth/compute",
  65050. // "https://www.googleapis.com/auth/compute.readonly"
  65051. // ]
  65052. // }
  65053. }
  65054. // Pages invokes f for each page of results.
  65055. // A non-nil error returned from f will halt the iteration.
  65056. // The provided context supersedes any context provided to the Context method.
  65057. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListPerInstanceConfigsResp) error) error {
  65058. c.ctx_ = ctx
  65059. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65060. for {
  65061. x, err := c.Do()
  65062. if err != nil {
  65063. return err
  65064. }
  65065. if err := f(x); err != nil {
  65066. return err
  65067. }
  65068. if x.NextPageToken == "" {
  65069. return nil
  65070. }
  65071. c.PageToken(x.NextPageToken)
  65072. }
  65073. }
  65074. // method id "compute.instanceGroupManagers.patch":
  65075. type InstanceGroupManagersPatchCall struct {
  65076. s *Service
  65077. project string
  65078. zone string
  65079. instanceGroupManager string
  65080. instancegroupmanager *InstanceGroupManager
  65081. urlParams_ gensupport.URLParams
  65082. ctx_ context.Context
  65083. header_ http.Header
  65084. }
  65085. // Patch: Updates a managed instance group using the information that
  65086. // you specify in the request. This operation is marked as DONE when the
  65087. // group is patched even if the instances in the group are still in the
  65088. // process of being patched. You must separately verify the status of
  65089. // the individual instances with the listManagedInstances method. This
  65090. // method supports PATCH semantics and uses the JSON merge patch format
  65091. // and processing rules.
  65092. func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
  65093. c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65094. c.project = project
  65095. c.zone = zone
  65096. c.instanceGroupManager = instanceGroupManager
  65097. c.instancegroupmanager = instancegroupmanager
  65098. return c
  65099. }
  65100. // RequestId sets the optional parameter "requestId": An optional
  65101. // request ID to identify requests. Specify a unique request ID so that
  65102. // if you must retry your request, the server will know to ignore the
  65103. // request if it has already been completed.
  65104. //
  65105. // For example, consider a situation where you make an initial request
  65106. // and the request times out. If you make the request again with the
  65107. // same request ID, the server can check if original operation with the
  65108. // same request ID was received, and if so, will ignore the second
  65109. // request. This prevents clients from accidentally creating duplicate
  65110. // commitments.
  65111. //
  65112. // The request ID must be a valid UUID with the exception that zero UUID
  65113. // is not supported (00000000-0000-0000-0000-000000000000).
  65114. func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
  65115. c.urlParams_.Set("requestId", requestId)
  65116. return c
  65117. }
  65118. // Fields allows partial responses to be retrieved. See
  65119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65120. // for more information.
  65121. func (c *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
  65122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65123. return c
  65124. }
  65125. // Context sets the context to be used in this call's Do method. Any
  65126. // pending HTTP request will be aborted if the provided context is
  65127. // canceled.
  65128. func (c *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
  65129. c.ctx_ = ctx
  65130. return c
  65131. }
  65132. // Header returns an http.Header that can be modified by the caller to
  65133. // add HTTP headers to the request.
  65134. func (c *InstanceGroupManagersPatchCall) Header() http.Header {
  65135. if c.header_ == nil {
  65136. c.header_ = make(http.Header)
  65137. }
  65138. return c.header_
  65139. }
  65140. func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  65141. reqHeaders := make(http.Header)
  65142. for k, v := range c.header_ {
  65143. reqHeaders[k] = v
  65144. }
  65145. reqHeaders.Set("User-Agent", c.s.userAgent())
  65146. var body io.Reader = nil
  65147. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  65148. if err != nil {
  65149. return nil, err
  65150. }
  65151. reqHeaders.Set("Content-Type", "application/json")
  65152. c.urlParams_.Set("alt", alt)
  65153. c.urlParams_.Set("prettyPrint", "false")
  65154. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  65155. urls += "?" + c.urlParams_.Encode()
  65156. req, err := http.NewRequest("PATCH", urls, body)
  65157. if err != nil {
  65158. return nil, err
  65159. }
  65160. req.Header = reqHeaders
  65161. googleapi.Expand(req.URL, map[string]string{
  65162. "project": c.project,
  65163. "zone": c.zone,
  65164. "instanceGroupManager": c.instanceGroupManager,
  65165. })
  65166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65167. }
  65168. // Do executes the "compute.instanceGroupManagers.patch" call.
  65169. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65170. // status code is an error. Response headers are in either
  65171. // *Operation.ServerResponse.Header or (if a response was returned at
  65172. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65173. // to check whether the returned error was because
  65174. // http.StatusNotModified was returned.
  65175. func (c *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65176. gensupport.SetOptions(c.urlParams_, opts...)
  65177. res, err := c.doRequest("json")
  65178. if res != nil && res.StatusCode == http.StatusNotModified {
  65179. if res.Body != nil {
  65180. res.Body.Close()
  65181. }
  65182. return nil, &googleapi.Error{
  65183. Code: res.StatusCode,
  65184. Header: res.Header,
  65185. }
  65186. }
  65187. if err != nil {
  65188. return nil, err
  65189. }
  65190. defer googleapi.CloseBody(res)
  65191. if err := googleapi.CheckResponse(res); err != nil {
  65192. return nil, err
  65193. }
  65194. ret := &Operation{
  65195. ServerResponse: googleapi.ServerResponse{
  65196. Header: res.Header,
  65197. HTTPStatusCode: res.StatusCode,
  65198. },
  65199. }
  65200. target := &ret
  65201. if err := gensupport.DecodeResponse(target, res); err != nil {
  65202. return nil, err
  65203. }
  65204. return ret, nil
  65205. // {
  65206. // "description": "Updates 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.",
  65207. // "httpMethod": "PATCH",
  65208. // "id": "compute.instanceGroupManagers.patch",
  65209. // "parameterOrder": [
  65210. // "project",
  65211. // "zone",
  65212. // "instanceGroupManager"
  65213. // ],
  65214. // "parameters": {
  65215. // "instanceGroupManager": {
  65216. // "description": "The name of the instance group manager.",
  65217. // "location": "path",
  65218. // "required": true,
  65219. // "type": "string"
  65220. // },
  65221. // "project": {
  65222. // "description": "Project ID for this request.",
  65223. // "location": "path",
  65224. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65225. // "required": true,
  65226. // "type": "string"
  65227. // },
  65228. // "requestId": {
  65229. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65230. // "location": "query",
  65231. // "type": "string"
  65232. // },
  65233. // "zone": {
  65234. // "description": "The name of the zone where you want to create the managed instance group.",
  65235. // "location": "path",
  65236. // "required": true,
  65237. // "type": "string"
  65238. // }
  65239. // },
  65240. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  65241. // "request": {
  65242. // "$ref": "InstanceGroupManager"
  65243. // },
  65244. // "response": {
  65245. // "$ref": "Operation"
  65246. // },
  65247. // "scopes": [
  65248. // "https://www.googleapis.com/auth/cloud-platform",
  65249. // "https://www.googleapis.com/auth/compute"
  65250. // ]
  65251. // }
  65252. }
  65253. // method id "compute.instanceGroupManagers.patchPerInstanceConfigs":
  65254. type InstanceGroupManagersPatchPerInstanceConfigsCall struct {
  65255. s *Service
  65256. project string
  65257. zone string
  65258. instanceGroupManager string
  65259. instancegroupmanagerspatchperinstanceconfigsreq *InstanceGroupManagersPatchPerInstanceConfigsReq
  65260. urlParams_ gensupport.URLParams
  65261. ctx_ context.Context
  65262. header_ http.Header
  65263. }
  65264. // PatchPerInstanceConfigs: Insert or patch (for the ones that already
  65265. // exist) per-instance configs for the managed instance group.
  65266. // perInstanceConfig.instance serves as a key used to distinguish
  65267. // whether to perform insert or patch.
  65268. func (r *InstanceGroupManagersService) PatchPerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagerspatchperinstanceconfigsreq *InstanceGroupManagersPatchPerInstanceConfigsReq) *InstanceGroupManagersPatchPerInstanceConfigsCall {
  65269. c := &InstanceGroupManagersPatchPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65270. c.project = project
  65271. c.zone = zone
  65272. c.instanceGroupManager = instanceGroupManager
  65273. c.instancegroupmanagerspatchperinstanceconfigsreq = instancegroupmanagerspatchperinstanceconfigsreq
  65274. return c
  65275. }
  65276. // RequestId sets the optional parameter "requestId": An optional
  65277. // request ID to identify requests. Specify a unique request ID so that
  65278. // if you must retry your request, the server will know to ignore the
  65279. // request if it has already been completed.
  65280. //
  65281. // For example, consider a situation where you make an initial request
  65282. // and the request times out. If you make the request again with the
  65283. // same request ID, the server can check if original operation with the
  65284. // same request ID was received, and if so, will ignore the second
  65285. // request. This prevents clients from accidentally creating duplicate
  65286. // commitments.
  65287. //
  65288. // The request ID must be a valid UUID with the exception that zero UUID
  65289. // is not supported (00000000-0000-0000-0000-000000000000).
  65290. func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) RequestId(requestId string) *InstanceGroupManagersPatchPerInstanceConfigsCall {
  65291. c.urlParams_.Set("requestId", requestId)
  65292. return c
  65293. }
  65294. // Fields allows partial responses to be retrieved. See
  65295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65296. // for more information.
  65297. func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchPerInstanceConfigsCall {
  65298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65299. return c
  65300. }
  65301. // Context sets the context to be used in this call's Do method. Any
  65302. // pending HTTP request will be aborted if the provided context is
  65303. // canceled.
  65304. func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersPatchPerInstanceConfigsCall {
  65305. c.ctx_ = ctx
  65306. return c
  65307. }
  65308. // Header returns an http.Header that can be modified by the caller to
  65309. // add HTTP headers to the request.
  65310. func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.Header {
  65311. if c.header_ == nil {
  65312. c.header_ = make(http.Header)
  65313. }
  65314. return c.header_
  65315. }
  65316. func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  65317. reqHeaders := make(http.Header)
  65318. for k, v := range c.header_ {
  65319. reqHeaders[k] = v
  65320. }
  65321. reqHeaders.Set("User-Agent", c.s.userAgent())
  65322. var body io.Reader = nil
  65323. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerspatchperinstanceconfigsreq)
  65324. if err != nil {
  65325. return nil, err
  65326. }
  65327. reqHeaders.Set("Content-Type", "application/json")
  65328. c.urlParams_.Set("alt", alt)
  65329. c.urlParams_.Set("prettyPrint", "false")
  65330. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs")
  65331. urls += "?" + c.urlParams_.Encode()
  65332. req, err := http.NewRequest("POST", urls, body)
  65333. if err != nil {
  65334. return nil, err
  65335. }
  65336. req.Header = reqHeaders
  65337. googleapi.Expand(req.URL, map[string]string{
  65338. "project": c.project,
  65339. "zone": c.zone,
  65340. "instanceGroupManager": c.instanceGroupManager,
  65341. })
  65342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65343. }
  65344. // Do executes the "compute.instanceGroupManagers.patchPerInstanceConfigs" call.
  65345. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65346. // status code is an error. Response headers are in either
  65347. // *Operation.ServerResponse.Header or (if a response was returned at
  65348. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65349. // to check whether the returned error was because
  65350. // http.StatusNotModified was returned.
  65351. func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65352. gensupport.SetOptions(c.urlParams_, opts...)
  65353. res, err := c.doRequest("json")
  65354. if res != nil && res.StatusCode == http.StatusNotModified {
  65355. if res.Body != nil {
  65356. res.Body.Close()
  65357. }
  65358. return nil, &googleapi.Error{
  65359. Code: res.StatusCode,
  65360. Header: res.Header,
  65361. }
  65362. }
  65363. if err != nil {
  65364. return nil, err
  65365. }
  65366. defer googleapi.CloseBody(res)
  65367. if err := googleapi.CheckResponse(res); err != nil {
  65368. return nil, err
  65369. }
  65370. ret := &Operation{
  65371. ServerResponse: googleapi.ServerResponse{
  65372. Header: res.Header,
  65373. HTTPStatusCode: res.StatusCode,
  65374. },
  65375. }
  65376. target := &ret
  65377. if err := gensupport.DecodeResponse(target, res); err != nil {
  65378. return nil, err
  65379. }
  65380. return ret, nil
  65381. // {
  65382. // "description": "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.",
  65383. // "httpMethod": "POST",
  65384. // "id": "compute.instanceGroupManagers.patchPerInstanceConfigs",
  65385. // "parameterOrder": [
  65386. // "project",
  65387. // "zone",
  65388. // "instanceGroupManager"
  65389. // ],
  65390. // "parameters": {
  65391. // "instanceGroupManager": {
  65392. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  65393. // "location": "path",
  65394. // "required": true,
  65395. // "type": "string"
  65396. // },
  65397. // "project": {
  65398. // "description": "Project ID for this request.",
  65399. // "location": "path",
  65400. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65401. // "required": true,
  65402. // "type": "string"
  65403. // },
  65404. // "requestId": {
  65405. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65406. // "location": "query",
  65407. // "type": "string"
  65408. // },
  65409. // "zone": {
  65410. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  65411. // "location": "path",
  65412. // "required": true,
  65413. // "type": "string"
  65414. // }
  65415. // },
  65416. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs",
  65417. // "request": {
  65418. // "$ref": "InstanceGroupManagersPatchPerInstanceConfigsReq"
  65419. // },
  65420. // "response": {
  65421. // "$ref": "Operation"
  65422. // },
  65423. // "scopes": [
  65424. // "https://www.googleapis.com/auth/cloud-platform",
  65425. // "https://www.googleapis.com/auth/compute"
  65426. // ]
  65427. // }
  65428. }
  65429. // method id "compute.instanceGroupManagers.recreateInstances":
  65430. type InstanceGroupManagersRecreateInstancesCall struct {
  65431. s *Service
  65432. project string
  65433. zone string
  65434. instanceGroupManager string
  65435. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  65436. urlParams_ gensupport.URLParams
  65437. ctx_ context.Context
  65438. header_ http.Header
  65439. }
  65440. // RecreateInstances: Flags the specified instances in the managed
  65441. // instance group to be immediately recreated. The instances are deleted
  65442. // and recreated using the current instance template for the managed
  65443. // instance group. This operation is marked as DONE when the flag is set
  65444. // even if the instances have not yet been recreated. You must
  65445. // separately verify the status of the recreating action with the
  65446. // listmanagedinstances method.
  65447. //
  65448. // If the group is part of a backend service that has enabled connection
  65449. // draining, it can take up to 60 seconds after the connection draining
  65450. // duration has elapsed before the VM instance is removed or
  65451. // deleted.
  65452. //
  65453. // You can specify a maximum of 1000 instances with this method per
  65454. // request.
  65455. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  65456. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65457. c.project = project
  65458. c.zone = zone
  65459. c.instanceGroupManager = instanceGroupManager
  65460. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  65461. return c
  65462. }
  65463. // RequestId sets the optional parameter "requestId": An optional
  65464. // request ID to identify requests. Specify a unique request ID so that
  65465. // if you must retry your request, the server will know to ignore the
  65466. // request if it has already been completed.
  65467. //
  65468. // For example, consider a situation where you make an initial request
  65469. // and the request times out. If you make the request again with the
  65470. // same request ID, the server can check if original operation with the
  65471. // same request ID was received, and if so, will ignore the second
  65472. // request. This prevents clients from accidentally creating duplicate
  65473. // commitments.
  65474. //
  65475. // The request ID must be a valid UUID with the exception that zero UUID
  65476. // is not supported (00000000-0000-0000-0000-000000000000).
  65477. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  65478. c.urlParams_.Set("requestId", requestId)
  65479. return c
  65480. }
  65481. // Fields allows partial responses to be retrieved. See
  65482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65483. // for more information.
  65484. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  65485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65486. return c
  65487. }
  65488. // Context sets the context to be used in this call's Do method. Any
  65489. // pending HTTP request will be aborted if the provided context is
  65490. // canceled.
  65491. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  65492. c.ctx_ = ctx
  65493. return c
  65494. }
  65495. // Header returns an http.Header that can be modified by the caller to
  65496. // add HTTP headers to the request.
  65497. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  65498. if c.header_ == nil {
  65499. c.header_ = make(http.Header)
  65500. }
  65501. return c.header_
  65502. }
  65503. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  65504. reqHeaders := make(http.Header)
  65505. for k, v := range c.header_ {
  65506. reqHeaders[k] = v
  65507. }
  65508. reqHeaders.Set("User-Agent", c.s.userAgent())
  65509. var body io.Reader = nil
  65510. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  65511. if err != nil {
  65512. return nil, err
  65513. }
  65514. reqHeaders.Set("Content-Type", "application/json")
  65515. c.urlParams_.Set("alt", alt)
  65516. c.urlParams_.Set("prettyPrint", "false")
  65517. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  65518. urls += "?" + c.urlParams_.Encode()
  65519. req, err := http.NewRequest("POST", urls, body)
  65520. if err != nil {
  65521. return nil, err
  65522. }
  65523. req.Header = reqHeaders
  65524. googleapi.Expand(req.URL, map[string]string{
  65525. "project": c.project,
  65526. "zone": c.zone,
  65527. "instanceGroupManager": c.instanceGroupManager,
  65528. })
  65529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65530. }
  65531. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  65532. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65533. // status code is an error. Response headers are in either
  65534. // *Operation.ServerResponse.Header or (if a response was returned at
  65535. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65536. // to check whether the returned error was because
  65537. // http.StatusNotModified was returned.
  65538. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65539. gensupport.SetOptions(c.urlParams_, opts...)
  65540. res, err := c.doRequest("json")
  65541. if res != nil && res.StatusCode == http.StatusNotModified {
  65542. if res.Body != nil {
  65543. res.Body.Close()
  65544. }
  65545. return nil, &googleapi.Error{
  65546. Code: res.StatusCode,
  65547. Header: res.Header,
  65548. }
  65549. }
  65550. if err != nil {
  65551. return nil, err
  65552. }
  65553. defer googleapi.CloseBody(res)
  65554. if err := googleapi.CheckResponse(res); err != nil {
  65555. return nil, err
  65556. }
  65557. ret := &Operation{
  65558. ServerResponse: googleapi.ServerResponse{
  65559. Header: res.Header,
  65560. HTTPStatusCode: res.StatusCode,
  65561. },
  65562. }
  65563. target := &ret
  65564. if err := gensupport.DecodeResponse(target, res); err != nil {
  65565. return nil, err
  65566. }
  65567. return ret, nil
  65568. // {
  65569. // "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.",
  65570. // "httpMethod": "POST",
  65571. // "id": "compute.instanceGroupManagers.recreateInstances",
  65572. // "parameterOrder": [
  65573. // "project",
  65574. // "zone",
  65575. // "instanceGroupManager"
  65576. // ],
  65577. // "parameters": {
  65578. // "instanceGroupManager": {
  65579. // "description": "The name of the managed instance group.",
  65580. // "location": "path",
  65581. // "required": true,
  65582. // "type": "string"
  65583. // },
  65584. // "project": {
  65585. // "description": "Project ID for this request.",
  65586. // "location": "path",
  65587. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65588. // "required": true,
  65589. // "type": "string"
  65590. // },
  65591. // "requestId": {
  65592. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65593. // "location": "query",
  65594. // "type": "string"
  65595. // },
  65596. // "zone": {
  65597. // "description": "The name of the zone where the managed instance group is located.",
  65598. // "location": "path",
  65599. // "required": true,
  65600. // "type": "string"
  65601. // }
  65602. // },
  65603. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  65604. // "request": {
  65605. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  65606. // },
  65607. // "response": {
  65608. // "$ref": "Operation"
  65609. // },
  65610. // "scopes": [
  65611. // "https://www.googleapis.com/auth/cloud-platform",
  65612. // "https://www.googleapis.com/auth/compute"
  65613. // ]
  65614. // }
  65615. }
  65616. // method id "compute.instanceGroupManagers.resize":
  65617. type InstanceGroupManagersResizeCall struct {
  65618. s *Service
  65619. project string
  65620. zone string
  65621. instanceGroupManager string
  65622. urlParams_ gensupport.URLParams
  65623. ctx_ context.Context
  65624. header_ http.Header
  65625. }
  65626. // Resize: Resizes the managed instance group. If you increase the size,
  65627. // the group creates new instances using the current instance template.
  65628. // If you decrease the size, the group deletes instances. The resize
  65629. // operation is marked DONE when the resize actions are scheduled even
  65630. // if the group has not yet added or deleted any instances. You must
  65631. // separately verify the status of the creating or deleting actions with
  65632. // the listmanagedinstances method.
  65633. //
  65634. // When resizing down, the instance group arbitrarily chooses the order
  65635. // in which VMs are deleted. The group takes into account some VM
  65636. // attributes when making the selection including:
  65637. //
  65638. // + The status of the VM instance. + The health of the VM instance. +
  65639. // The instance template version the VM is based on. + For regional
  65640. // managed instance groups, the location of the VM instance.
  65641. //
  65642. // This list is subject to change.
  65643. //
  65644. // If the group is part of a backend service that has enabled connection
  65645. // draining, it can take up to 60 seconds after the connection draining
  65646. // duration has elapsed before the VM instance is removed or deleted.
  65647. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  65648. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65649. c.project = project
  65650. c.zone = zone
  65651. c.instanceGroupManager = instanceGroupManager
  65652. c.urlParams_.Set("size", fmt.Sprint(size))
  65653. return c
  65654. }
  65655. // RequestId sets the optional parameter "requestId": An optional
  65656. // request ID to identify requests. Specify a unique request ID so that
  65657. // if you must retry your request, the server will know to ignore the
  65658. // request if it has already been completed.
  65659. //
  65660. // For example, consider a situation where you make an initial request
  65661. // and the request times out. If you make the request again with the
  65662. // same request ID, the server can check if original operation with the
  65663. // same request ID was received, and if so, will ignore the second
  65664. // request. This prevents clients from accidentally creating duplicate
  65665. // commitments.
  65666. //
  65667. // The request ID must be a valid UUID with the exception that zero UUID
  65668. // is not supported (00000000-0000-0000-0000-000000000000).
  65669. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  65670. c.urlParams_.Set("requestId", requestId)
  65671. return c
  65672. }
  65673. // Fields allows partial responses to be retrieved. See
  65674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65675. // for more information.
  65676. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  65677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65678. return c
  65679. }
  65680. // Context sets the context to be used in this call's Do method. Any
  65681. // pending HTTP request will be aborted if the provided context is
  65682. // canceled.
  65683. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  65684. c.ctx_ = ctx
  65685. return c
  65686. }
  65687. // Header returns an http.Header that can be modified by the caller to
  65688. // add HTTP headers to the request.
  65689. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  65690. if c.header_ == nil {
  65691. c.header_ = make(http.Header)
  65692. }
  65693. return c.header_
  65694. }
  65695. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  65696. reqHeaders := make(http.Header)
  65697. for k, v := range c.header_ {
  65698. reqHeaders[k] = v
  65699. }
  65700. reqHeaders.Set("User-Agent", c.s.userAgent())
  65701. var body io.Reader = nil
  65702. c.urlParams_.Set("alt", alt)
  65703. c.urlParams_.Set("prettyPrint", "false")
  65704. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  65705. urls += "?" + c.urlParams_.Encode()
  65706. req, err := http.NewRequest("POST", urls, body)
  65707. if err != nil {
  65708. return nil, err
  65709. }
  65710. req.Header = reqHeaders
  65711. googleapi.Expand(req.URL, map[string]string{
  65712. "project": c.project,
  65713. "zone": c.zone,
  65714. "instanceGroupManager": c.instanceGroupManager,
  65715. })
  65716. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65717. }
  65718. // Do executes the "compute.instanceGroupManagers.resize" call.
  65719. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65720. // status code is an error. Response headers are in either
  65721. // *Operation.ServerResponse.Header or (if a response was returned at
  65722. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65723. // to check whether the returned error was because
  65724. // http.StatusNotModified was returned.
  65725. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65726. gensupport.SetOptions(c.urlParams_, opts...)
  65727. res, err := c.doRequest("json")
  65728. if res != nil && res.StatusCode == http.StatusNotModified {
  65729. if res.Body != nil {
  65730. res.Body.Close()
  65731. }
  65732. return nil, &googleapi.Error{
  65733. Code: res.StatusCode,
  65734. Header: res.Header,
  65735. }
  65736. }
  65737. if err != nil {
  65738. return nil, err
  65739. }
  65740. defer googleapi.CloseBody(res)
  65741. if err := googleapi.CheckResponse(res); err != nil {
  65742. return nil, err
  65743. }
  65744. ret := &Operation{
  65745. ServerResponse: googleapi.ServerResponse{
  65746. Header: res.Header,
  65747. HTTPStatusCode: res.StatusCode,
  65748. },
  65749. }
  65750. target := &ret
  65751. if err := gensupport.DecodeResponse(target, res); err != nil {
  65752. return nil, err
  65753. }
  65754. return ret, nil
  65755. // {
  65756. // "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.",
  65757. // "httpMethod": "POST",
  65758. // "id": "compute.instanceGroupManagers.resize",
  65759. // "parameterOrder": [
  65760. // "project",
  65761. // "zone",
  65762. // "instanceGroupManager",
  65763. // "size"
  65764. // ],
  65765. // "parameters": {
  65766. // "instanceGroupManager": {
  65767. // "description": "The name of the managed instance group.",
  65768. // "location": "path",
  65769. // "required": true,
  65770. // "type": "string"
  65771. // },
  65772. // "project": {
  65773. // "description": "Project ID for this request.",
  65774. // "location": "path",
  65775. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65776. // "required": true,
  65777. // "type": "string"
  65778. // },
  65779. // "requestId": {
  65780. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65781. // "location": "query",
  65782. // "type": "string"
  65783. // },
  65784. // "size": {
  65785. // "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.",
  65786. // "format": "int32",
  65787. // "location": "query",
  65788. // "required": true,
  65789. // "type": "integer"
  65790. // },
  65791. // "zone": {
  65792. // "description": "The name of the zone where the managed instance group is located.",
  65793. // "location": "path",
  65794. // "required": true,
  65795. // "type": "string"
  65796. // }
  65797. // },
  65798. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  65799. // "response": {
  65800. // "$ref": "Operation"
  65801. // },
  65802. // "scopes": [
  65803. // "https://www.googleapis.com/auth/cloud-platform",
  65804. // "https://www.googleapis.com/auth/compute"
  65805. // ]
  65806. // }
  65807. }
  65808. // method id "compute.instanceGroupManagers.resizeAdvanced":
  65809. type InstanceGroupManagersResizeAdvancedCall struct {
  65810. s *Service
  65811. project string
  65812. zone string
  65813. instanceGroupManager string
  65814. instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest
  65815. urlParams_ gensupport.URLParams
  65816. ctx_ context.Context
  65817. header_ http.Header
  65818. }
  65819. // ResizeAdvanced: Resizes the managed instance group with advanced
  65820. // configuration options like disabling creation retries. This is an
  65821. // extended version of the resize method.
  65822. //
  65823. // If you increase the size of the instance group, the group creates new
  65824. // instances using the current instance template. If you decrease the
  65825. // size, the group deletes instances. The resize operation is marked
  65826. // DONE when the resize actions are scheduled even if the group has not
  65827. // yet added or deleted any instances. You must separately verify the
  65828. // status of the creating, creatingWithoutRetries, or deleting actions
  65829. // with the get or listmanagedinstances method.
  65830. //
  65831. // If the group is part of a backend service that has enabled connection
  65832. // draining, it can take up to 60 seconds after the connection draining
  65833. // duration has elapsed before the VM instance is removed or deleted.
  65834. func (r *InstanceGroupManagersService) ResizeAdvanced(project string, zone string, instanceGroupManager string, instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest) *InstanceGroupManagersResizeAdvancedCall {
  65835. c := &InstanceGroupManagersResizeAdvancedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65836. c.project = project
  65837. c.zone = zone
  65838. c.instanceGroupManager = instanceGroupManager
  65839. c.instancegroupmanagersresizeadvancedrequest = instancegroupmanagersresizeadvancedrequest
  65840. return c
  65841. }
  65842. // RequestId sets the optional parameter "requestId": An optional
  65843. // request ID to identify requests. Specify a unique request ID so that
  65844. // if you must retry your request, the server will know to ignore the
  65845. // request if it has already been completed.
  65846. //
  65847. // For example, consider a situation where you make an initial request
  65848. // and the request times out. If you make the request again with the
  65849. // same request ID, the server can check if original operation with the
  65850. // same request ID was received, and if so, will ignore the second
  65851. // request. This prevents clients from accidentally creating duplicate
  65852. // commitments.
  65853. //
  65854. // The request ID must be a valid UUID with the exception that zero UUID
  65855. // is not supported (00000000-0000-0000-0000-000000000000).
  65856. func (c *InstanceGroupManagersResizeAdvancedCall) RequestId(requestId string) *InstanceGroupManagersResizeAdvancedCall {
  65857. c.urlParams_.Set("requestId", requestId)
  65858. return c
  65859. }
  65860. // Fields allows partial responses to be retrieved. See
  65861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65862. // for more information.
  65863. func (c *InstanceGroupManagersResizeAdvancedCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeAdvancedCall {
  65864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65865. return c
  65866. }
  65867. // Context sets the context to be used in this call's Do method. Any
  65868. // pending HTTP request will be aborted if the provided context is
  65869. // canceled.
  65870. func (c *InstanceGroupManagersResizeAdvancedCall) Context(ctx context.Context) *InstanceGroupManagersResizeAdvancedCall {
  65871. c.ctx_ = ctx
  65872. return c
  65873. }
  65874. // Header returns an http.Header that can be modified by the caller to
  65875. // add HTTP headers to the request.
  65876. func (c *InstanceGroupManagersResizeAdvancedCall) Header() http.Header {
  65877. if c.header_ == nil {
  65878. c.header_ = make(http.Header)
  65879. }
  65880. return c.header_
  65881. }
  65882. func (c *InstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) {
  65883. reqHeaders := make(http.Header)
  65884. for k, v := range c.header_ {
  65885. reqHeaders[k] = v
  65886. }
  65887. reqHeaders.Set("User-Agent", c.s.userAgent())
  65888. var body io.Reader = nil
  65889. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresizeadvancedrequest)
  65890. if err != nil {
  65891. return nil, err
  65892. }
  65893. reqHeaders.Set("Content-Type", "application/json")
  65894. c.urlParams_.Set("alt", alt)
  65895. c.urlParams_.Set("prettyPrint", "false")
  65896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced")
  65897. urls += "?" + c.urlParams_.Encode()
  65898. req, err := http.NewRequest("POST", urls, body)
  65899. if err != nil {
  65900. return nil, err
  65901. }
  65902. req.Header = reqHeaders
  65903. googleapi.Expand(req.URL, map[string]string{
  65904. "project": c.project,
  65905. "zone": c.zone,
  65906. "instanceGroupManager": c.instanceGroupManager,
  65907. })
  65908. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65909. }
  65910. // Do executes the "compute.instanceGroupManagers.resizeAdvanced" call.
  65911. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65912. // status code is an error. Response headers are in either
  65913. // *Operation.ServerResponse.Header or (if a response was returned at
  65914. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65915. // to check whether the returned error was because
  65916. // http.StatusNotModified was returned.
  65917. func (c *InstanceGroupManagersResizeAdvancedCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65918. gensupport.SetOptions(c.urlParams_, opts...)
  65919. res, err := c.doRequest("json")
  65920. if res != nil && res.StatusCode == http.StatusNotModified {
  65921. if res.Body != nil {
  65922. res.Body.Close()
  65923. }
  65924. return nil, &googleapi.Error{
  65925. Code: res.StatusCode,
  65926. Header: res.Header,
  65927. }
  65928. }
  65929. if err != nil {
  65930. return nil, err
  65931. }
  65932. defer googleapi.CloseBody(res)
  65933. if err := googleapi.CheckResponse(res); err != nil {
  65934. return nil, err
  65935. }
  65936. ret := &Operation{
  65937. ServerResponse: googleapi.ServerResponse{
  65938. Header: res.Header,
  65939. HTTPStatusCode: res.StatusCode,
  65940. },
  65941. }
  65942. target := &ret
  65943. if err := gensupport.DecodeResponse(target, res); err != nil {
  65944. return nil, err
  65945. }
  65946. return ret, nil
  65947. // {
  65948. // "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.",
  65949. // "httpMethod": "POST",
  65950. // "id": "compute.instanceGroupManagers.resizeAdvanced",
  65951. // "parameterOrder": [
  65952. // "project",
  65953. // "zone",
  65954. // "instanceGroupManager"
  65955. // ],
  65956. // "parameters": {
  65957. // "instanceGroupManager": {
  65958. // "description": "The name of the managed instance group.",
  65959. // "location": "path",
  65960. // "required": true,
  65961. // "type": "string"
  65962. // },
  65963. // "project": {
  65964. // "description": "Project ID for this request.",
  65965. // "location": "path",
  65966. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65967. // "required": true,
  65968. // "type": "string"
  65969. // },
  65970. // "requestId": {
  65971. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65972. // "location": "query",
  65973. // "type": "string"
  65974. // },
  65975. // "zone": {
  65976. // "description": "The name of the zone where the managed instance group is located.",
  65977. // "location": "path",
  65978. // "required": true,
  65979. // "type": "string"
  65980. // }
  65981. // },
  65982. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced",
  65983. // "request": {
  65984. // "$ref": "InstanceGroupManagersResizeAdvancedRequest"
  65985. // },
  65986. // "response": {
  65987. // "$ref": "Operation"
  65988. // },
  65989. // "scopes": [
  65990. // "https://www.googleapis.com/auth/cloud-platform",
  65991. // "https://www.googleapis.com/auth/compute"
  65992. // ]
  65993. // }
  65994. }
  65995. // method id "compute.instanceGroupManagers.setAutoHealingPolicies":
  65996. type InstanceGroupManagersSetAutoHealingPoliciesCall struct {
  65997. s *Service
  65998. project string
  65999. zone string
  66000. instanceGroupManager string
  66001. instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest
  66002. urlParams_ gensupport.URLParams
  66003. ctx_ context.Context
  66004. header_ http.Header
  66005. }
  66006. // SetAutoHealingPolicies: Modifies the autohealing policies.
  66007. // [Deprecated] This method is deprecated. Please use Patch instead.
  66008. func (r *InstanceGroupManagersService) SetAutoHealingPolicies(project string, zone string, instanceGroupManager string, instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  66009. c := &InstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66010. c.project = project
  66011. c.zone = zone
  66012. c.instanceGroupManager = instanceGroupManager
  66013. c.instancegroupmanagerssetautohealingrequest = instancegroupmanagerssetautohealingrequest
  66014. return c
  66015. }
  66016. // RequestId sets the optional parameter "requestId": An optional
  66017. // request ID to identify requests. Specify a unique request ID so that
  66018. // if you must retry your request, the server will know to ignore the
  66019. // request if it has already been completed.
  66020. //
  66021. // For example, consider a situation where you make an initial request
  66022. // and the request times out. If you make the request again with the
  66023. // same request ID, the server can check if original operation with the
  66024. // same request ID was received, and if so, will ignore the second
  66025. // request. This prevents clients from accidentally creating duplicate
  66026. // commitments.
  66027. //
  66028. // The request ID must be a valid UUID with the exception that zero UUID
  66029. // is not supported (00000000-0000-0000-0000-000000000000).
  66030. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  66031. c.urlParams_.Set("requestId", requestId)
  66032. return c
  66033. }
  66034. // Fields allows partial responses to be retrieved. See
  66035. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66036. // for more information.
  66037. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  66038. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66039. return c
  66040. }
  66041. // Context sets the context to be used in this call's Do method. Any
  66042. // pending HTTP request will be aborted if the provided context is
  66043. // canceled.
  66044. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  66045. c.ctx_ = ctx
  66046. return c
  66047. }
  66048. // Header returns an http.Header that can be modified by the caller to
  66049. // add HTTP headers to the request.
  66050. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  66051. if c.header_ == nil {
  66052. c.header_ = make(http.Header)
  66053. }
  66054. return c.header_
  66055. }
  66056. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  66057. reqHeaders := make(http.Header)
  66058. for k, v := range c.header_ {
  66059. reqHeaders[k] = v
  66060. }
  66061. reqHeaders.Set("User-Agent", c.s.userAgent())
  66062. var body io.Reader = nil
  66063. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest)
  66064. if err != nil {
  66065. return nil, err
  66066. }
  66067. reqHeaders.Set("Content-Type", "application/json")
  66068. c.urlParams_.Set("alt", alt)
  66069. c.urlParams_.Set("prettyPrint", "false")
  66070. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  66071. urls += "?" + c.urlParams_.Encode()
  66072. req, err := http.NewRequest("POST", urls, body)
  66073. if err != nil {
  66074. return nil, err
  66075. }
  66076. req.Header = reqHeaders
  66077. googleapi.Expand(req.URL, map[string]string{
  66078. "project": c.project,
  66079. "zone": c.zone,
  66080. "instanceGroupManager": c.instanceGroupManager,
  66081. })
  66082. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66083. }
  66084. // Do executes the "compute.instanceGroupManagers.setAutoHealingPolicies" call.
  66085. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66086. // status code is an error. Response headers are in either
  66087. // *Operation.ServerResponse.Header or (if a response was returned at
  66088. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66089. // to check whether the returned error was because
  66090. // http.StatusNotModified was returned.
  66091. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66092. gensupport.SetOptions(c.urlParams_, opts...)
  66093. res, err := c.doRequest("json")
  66094. if res != nil && res.StatusCode == http.StatusNotModified {
  66095. if res.Body != nil {
  66096. res.Body.Close()
  66097. }
  66098. return nil, &googleapi.Error{
  66099. Code: res.StatusCode,
  66100. Header: res.Header,
  66101. }
  66102. }
  66103. if err != nil {
  66104. return nil, err
  66105. }
  66106. defer googleapi.CloseBody(res)
  66107. if err := googleapi.CheckResponse(res); err != nil {
  66108. return nil, err
  66109. }
  66110. ret := &Operation{
  66111. ServerResponse: googleapi.ServerResponse{
  66112. Header: res.Header,
  66113. HTTPStatusCode: res.StatusCode,
  66114. },
  66115. }
  66116. target := &ret
  66117. if err := gensupport.DecodeResponse(target, res); err != nil {
  66118. return nil, err
  66119. }
  66120. return ret, nil
  66121. // {
  66122. // "description": "Modifies the autohealing policies. [Deprecated] This method is deprecated. Please use Patch instead.",
  66123. // "httpMethod": "POST",
  66124. // "id": "compute.instanceGroupManagers.setAutoHealingPolicies",
  66125. // "parameterOrder": [
  66126. // "project",
  66127. // "zone",
  66128. // "instanceGroupManager"
  66129. // ],
  66130. // "parameters": {
  66131. // "instanceGroupManager": {
  66132. // "description": "The name of the instance group manager.",
  66133. // "location": "path",
  66134. // "required": true,
  66135. // "type": "string"
  66136. // },
  66137. // "project": {
  66138. // "description": "Project ID for this request.",
  66139. // "location": "path",
  66140. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66141. // "required": true,
  66142. // "type": "string"
  66143. // },
  66144. // "requestId": {
  66145. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66146. // "location": "query",
  66147. // "type": "string"
  66148. // },
  66149. // "zone": {
  66150. // "description": "The name of the zone where the managed instance group is located.",
  66151. // "location": "path",
  66152. // "required": true,
  66153. // "type": "string"
  66154. // }
  66155. // },
  66156. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  66157. // "request": {
  66158. // "$ref": "InstanceGroupManagersSetAutoHealingRequest"
  66159. // },
  66160. // "response": {
  66161. // "$ref": "Operation"
  66162. // },
  66163. // "scopes": [
  66164. // "https://www.googleapis.com/auth/cloud-platform",
  66165. // "https://www.googleapis.com/auth/compute"
  66166. // ]
  66167. // }
  66168. }
  66169. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  66170. type InstanceGroupManagersSetInstanceTemplateCall struct {
  66171. s *Service
  66172. project string
  66173. zone string
  66174. instanceGroupManager string
  66175. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  66176. urlParams_ gensupport.URLParams
  66177. ctx_ context.Context
  66178. header_ http.Header
  66179. }
  66180. // SetInstanceTemplate: Specifies the instance template to use when
  66181. // creating new instances in this group. The templates for existing
  66182. // instances in the group do not change unless you recreate them.
  66183. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  66184. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66185. c.project = project
  66186. c.zone = zone
  66187. c.instanceGroupManager = instanceGroupManager
  66188. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  66189. return c
  66190. }
  66191. // RequestId sets the optional parameter "requestId": An optional
  66192. // request ID to identify requests. Specify a unique request ID so that
  66193. // if you must retry your request, the server will know to ignore the
  66194. // request if it has already been completed.
  66195. //
  66196. // For example, consider a situation where you make an initial request
  66197. // and the request times out. If you make the request again with the
  66198. // same request ID, the server can check if original operation with the
  66199. // same request ID was received, and if so, will ignore the second
  66200. // request. This prevents clients from accidentally creating duplicate
  66201. // commitments.
  66202. //
  66203. // The request ID must be a valid UUID with the exception that zero UUID
  66204. // is not supported (00000000-0000-0000-0000-000000000000).
  66205. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  66206. c.urlParams_.Set("requestId", requestId)
  66207. return c
  66208. }
  66209. // Fields allows partial responses to be retrieved. See
  66210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66211. // for more information.
  66212. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  66213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66214. return c
  66215. }
  66216. // Context sets the context to be used in this call's Do method. Any
  66217. // pending HTTP request will be aborted if the provided context is
  66218. // canceled.
  66219. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  66220. c.ctx_ = ctx
  66221. return c
  66222. }
  66223. // Header returns an http.Header that can be modified by the caller to
  66224. // add HTTP headers to the request.
  66225. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  66226. if c.header_ == nil {
  66227. c.header_ = make(http.Header)
  66228. }
  66229. return c.header_
  66230. }
  66231. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  66232. reqHeaders := make(http.Header)
  66233. for k, v := range c.header_ {
  66234. reqHeaders[k] = v
  66235. }
  66236. reqHeaders.Set("User-Agent", c.s.userAgent())
  66237. var body io.Reader = nil
  66238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  66239. if err != nil {
  66240. return nil, err
  66241. }
  66242. reqHeaders.Set("Content-Type", "application/json")
  66243. c.urlParams_.Set("alt", alt)
  66244. c.urlParams_.Set("prettyPrint", "false")
  66245. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  66246. urls += "?" + c.urlParams_.Encode()
  66247. req, err := http.NewRequest("POST", urls, body)
  66248. if err != nil {
  66249. return nil, err
  66250. }
  66251. req.Header = reqHeaders
  66252. googleapi.Expand(req.URL, map[string]string{
  66253. "project": c.project,
  66254. "zone": c.zone,
  66255. "instanceGroupManager": c.instanceGroupManager,
  66256. })
  66257. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66258. }
  66259. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  66260. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66261. // status code is an error. Response headers are in either
  66262. // *Operation.ServerResponse.Header or (if a response was returned at
  66263. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66264. // to check whether the returned error was because
  66265. // http.StatusNotModified was returned.
  66266. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66267. gensupport.SetOptions(c.urlParams_, opts...)
  66268. res, err := c.doRequest("json")
  66269. if res != nil && res.StatusCode == http.StatusNotModified {
  66270. if res.Body != nil {
  66271. res.Body.Close()
  66272. }
  66273. return nil, &googleapi.Error{
  66274. Code: res.StatusCode,
  66275. Header: res.Header,
  66276. }
  66277. }
  66278. if err != nil {
  66279. return nil, err
  66280. }
  66281. defer googleapi.CloseBody(res)
  66282. if err := googleapi.CheckResponse(res); err != nil {
  66283. return nil, err
  66284. }
  66285. ret := &Operation{
  66286. ServerResponse: googleapi.ServerResponse{
  66287. Header: res.Header,
  66288. HTTPStatusCode: res.StatusCode,
  66289. },
  66290. }
  66291. target := &ret
  66292. if err := gensupport.DecodeResponse(target, res); err != nil {
  66293. return nil, err
  66294. }
  66295. return ret, nil
  66296. // {
  66297. // "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.",
  66298. // "httpMethod": "POST",
  66299. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  66300. // "parameterOrder": [
  66301. // "project",
  66302. // "zone",
  66303. // "instanceGroupManager"
  66304. // ],
  66305. // "parameters": {
  66306. // "instanceGroupManager": {
  66307. // "description": "The name of the managed instance group.",
  66308. // "location": "path",
  66309. // "required": true,
  66310. // "type": "string"
  66311. // },
  66312. // "project": {
  66313. // "description": "Project ID for this request.",
  66314. // "location": "path",
  66315. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66316. // "required": true,
  66317. // "type": "string"
  66318. // },
  66319. // "requestId": {
  66320. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66321. // "location": "query",
  66322. // "type": "string"
  66323. // },
  66324. // "zone": {
  66325. // "description": "The name of the zone where the managed instance group is located.",
  66326. // "location": "path",
  66327. // "required": true,
  66328. // "type": "string"
  66329. // }
  66330. // },
  66331. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  66332. // "request": {
  66333. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  66334. // },
  66335. // "response": {
  66336. // "$ref": "Operation"
  66337. // },
  66338. // "scopes": [
  66339. // "https://www.googleapis.com/auth/cloud-platform",
  66340. // "https://www.googleapis.com/auth/compute"
  66341. // ]
  66342. // }
  66343. }
  66344. // method id "compute.instanceGroupManagers.setTargetPools":
  66345. type InstanceGroupManagersSetTargetPoolsCall struct {
  66346. s *Service
  66347. project string
  66348. zone string
  66349. instanceGroupManager string
  66350. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  66351. urlParams_ gensupport.URLParams
  66352. ctx_ context.Context
  66353. header_ http.Header
  66354. }
  66355. // SetTargetPools: Modifies the target pools to which all instances in
  66356. // this managed instance group are assigned. The target pools
  66357. // automatically apply to all of the instances in the managed instance
  66358. // group. This operation is marked DONE when you make the request even
  66359. // if the instances have not yet been added to their target pools. The
  66360. // change might take some time to apply to all of the instances in the
  66361. // group depending on the size of the group.
  66362. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  66363. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66364. c.project = project
  66365. c.zone = zone
  66366. c.instanceGroupManager = instanceGroupManager
  66367. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  66368. return c
  66369. }
  66370. // RequestId sets the optional parameter "requestId": An optional
  66371. // request ID to identify requests. Specify a unique request ID so that
  66372. // if you must retry your request, the server will know to ignore the
  66373. // request if it has already been completed.
  66374. //
  66375. // For example, consider a situation where you make an initial request
  66376. // and the request times out. If you make the request again with the
  66377. // same request ID, the server can check if original operation with the
  66378. // same request ID was received, and if so, will ignore the second
  66379. // request. This prevents clients from accidentally creating duplicate
  66380. // commitments.
  66381. //
  66382. // The request ID must be a valid UUID with the exception that zero UUID
  66383. // is not supported (00000000-0000-0000-0000-000000000000).
  66384. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  66385. c.urlParams_.Set("requestId", requestId)
  66386. return c
  66387. }
  66388. // Fields allows partial responses to be retrieved. See
  66389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66390. // for more information.
  66391. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  66392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66393. return c
  66394. }
  66395. // Context sets the context to be used in this call's Do method. Any
  66396. // pending HTTP request will be aborted if the provided context is
  66397. // canceled.
  66398. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  66399. c.ctx_ = ctx
  66400. return c
  66401. }
  66402. // Header returns an http.Header that can be modified by the caller to
  66403. // add HTTP headers to the request.
  66404. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  66405. if c.header_ == nil {
  66406. c.header_ = make(http.Header)
  66407. }
  66408. return c.header_
  66409. }
  66410. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  66411. reqHeaders := make(http.Header)
  66412. for k, v := range c.header_ {
  66413. reqHeaders[k] = v
  66414. }
  66415. reqHeaders.Set("User-Agent", c.s.userAgent())
  66416. var body io.Reader = nil
  66417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  66418. if err != nil {
  66419. return nil, err
  66420. }
  66421. reqHeaders.Set("Content-Type", "application/json")
  66422. c.urlParams_.Set("alt", alt)
  66423. c.urlParams_.Set("prettyPrint", "false")
  66424. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  66425. urls += "?" + c.urlParams_.Encode()
  66426. req, err := http.NewRequest("POST", urls, body)
  66427. if err != nil {
  66428. return nil, err
  66429. }
  66430. req.Header = reqHeaders
  66431. googleapi.Expand(req.URL, map[string]string{
  66432. "project": c.project,
  66433. "zone": c.zone,
  66434. "instanceGroupManager": c.instanceGroupManager,
  66435. })
  66436. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66437. }
  66438. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  66439. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66440. // status code is an error. Response headers are in either
  66441. // *Operation.ServerResponse.Header or (if a response was returned at
  66442. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66443. // to check whether the returned error was because
  66444. // http.StatusNotModified was returned.
  66445. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66446. gensupport.SetOptions(c.urlParams_, opts...)
  66447. res, err := c.doRequest("json")
  66448. if res != nil && res.StatusCode == http.StatusNotModified {
  66449. if res.Body != nil {
  66450. res.Body.Close()
  66451. }
  66452. return nil, &googleapi.Error{
  66453. Code: res.StatusCode,
  66454. Header: res.Header,
  66455. }
  66456. }
  66457. if err != nil {
  66458. return nil, err
  66459. }
  66460. defer googleapi.CloseBody(res)
  66461. if err := googleapi.CheckResponse(res); err != nil {
  66462. return nil, err
  66463. }
  66464. ret := &Operation{
  66465. ServerResponse: googleapi.ServerResponse{
  66466. Header: res.Header,
  66467. HTTPStatusCode: res.StatusCode,
  66468. },
  66469. }
  66470. target := &ret
  66471. if err := gensupport.DecodeResponse(target, res); err != nil {
  66472. return nil, err
  66473. }
  66474. return ret, nil
  66475. // {
  66476. // "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.",
  66477. // "httpMethod": "POST",
  66478. // "id": "compute.instanceGroupManagers.setTargetPools",
  66479. // "parameterOrder": [
  66480. // "project",
  66481. // "zone",
  66482. // "instanceGroupManager"
  66483. // ],
  66484. // "parameters": {
  66485. // "instanceGroupManager": {
  66486. // "description": "The name of the managed instance group.",
  66487. // "location": "path",
  66488. // "required": true,
  66489. // "type": "string"
  66490. // },
  66491. // "project": {
  66492. // "description": "Project ID for this request.",
  66493. // "location": "path",
  66494. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66495. // "required": true,
  66496. // "type": "string"
  66497. // },
  66498. // "requestId": {
  66499. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66500. // "location": "query",
  66501. // "type": "string"
  66502. // },
  66503. // "zone": {
  66504. // "description": "The name of the zone where the managed instance group is located.",
  66505. // "location": "path",
  66506. // "required": true,
  66507. // "type": "string"
  66508. // }
  66509. // },
  66510. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  66511. // "request": {
  66512. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  66513. // },
  66514. // "response": {
  66515. // "$ref": "Operation"
  66516. // },
  66517. // "scopes": [
  66518. // "https://www.googleapis.com/auth/cloud-platform",
  66519. // "https://www.googleapis.com/auth/compute"
  66520. // ]
  66521. // }
  66522. }
  66523. // method id "compute.instanceGroupManagers.testIamPermissions":
  66524. type InstanceGroupManagersTestIamPermissionsCall struct {
  66525. s *Service
  66526. project string
  66527. zone string
  66528. resource string
  66529. testpermissionsrequest *TestPermissionsRequest
  66530. urlParams_ gensupport.URLParams
  66531. ctx_ context.Context
  66532. header_ http.Header
  66533. }
  66534. // TestIamPermissions: Returns permissions that a caller has on the
  66535. // specified resource.
  66536. func (r *InstanceGroupManagersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupManagersTestIamPermissionsCall {
  66537. c := &InstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66538. c.project = project
  66539. c.zone = zone
  66540. c.resource = resource
  66541. c.testpermissionsrequest = testpermissionsrequest
  66542. return c
  66543. }
  66544. // Fields allows partial responses to be retrieved. See
  66545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66546. // for more information.
  66547. func (c *InstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersTestIamPermissionsCall {
  66548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66549. return c
  66550. }
  66551. // Context sets the context to be used in this call's Do method. Any
  66552. // pending HTTP request will be aborted if the provided context is
  66553. // canceled.
  66554. func (c *InstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupManagersTestIamPermissionsCall {
  66555. c.ctx_ = ctx
  66556. return c
  66557. }
  66558. // Header returns an http.Header that can be modified by the caller to
  66559. // add HTTP headers to the request.
  66560. func (c *InstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  66561. if c.header_ == nil {
  66562. c.header_ = make(http.Header)
  66563. }
  66564. return c.header_
  66565. }
  66566. func (c *InstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  66567. reqHeaders := make(http.Header)
  66568. for k, v := range c.header_ {
  66569. reqHeaders[k] = v
  66570. }
  66571. reqHeaders.Set("User-Agent", c.s.userAgent())
  66572. var body io.Reader = nil
  66573. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  66574. if err != nil {
  66575. return nil, err
  66576. }
  66577. reqHeaders.Set("Content-Type", "application/json")
  66578. c.urlParams_.Set("alt", alt)
  66579. c.urlParams_.Set("prettyPrint", "false")
  66580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions")
  66581. urls += "?" + c.urlParams_.Encode()
  66582. req, err := http.NewRequest("POST", urls, body)
  66583. if err != nil {
  66584. return nil, err
  66585. }
  66586. req.Header = reqHeaders
  66587. googleapi.Expand(req.URL, map[string]string{
  66588. "project": c.project,
  66589. "zone": c.zone,
  66590. "resource": c.resource,
  66591. })
  66592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66593. }
  66594. // Do executes the "compute.instanceGroupManagers.testIamPermissions" call.
  66595. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  66596. // non-2xx status code is an error. Response headers are in either
  66597. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  66598. // returned at all) in error.(*googleapi.Error).Header. Use
  66599. // googleapi.IsNotModified to check whether the returned error was
  66600. // because http.StatusNotModified was returned.
  66601. func (c *InstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  66602. gensupport.SetOptions(c.urlParams_, opts...)
  66603. res, err := c.doRequest("json")
  66604. if res != nil && res.StatusCode == http.StatusNotModified {
  66605. if res.Body != nil {
  66606. res.Body.Close()
  66607. }
  66608. return nil, &googleapi.Error{
  66609. Code: res.StatusCode,
  66610. Header: res.Header,
  66611. }
  66612. }
  66613. if err != nil {
  66614. return nil, err
  66615. }
  66616. defer googleapi.CloseBody(res)
  66617. if err := googleapi.CheckResponse(res); err != nil {
  66618. return nil, err
  66619. }
  66620. ret := &TestPermissionsResponse{
  66621. ServerResponse: googleapi.ServerResponse{
  66622. Header: res.Header,
  66623. HTTPStatusCode: res.StatusCode,
  66624. },
  66625. }
  66626. target := &ret
  66627. if err := gensupport.DecodeResponse(target, res); err != nil {
  66628. return nil, err
  66629. }
  66630. return ret, nil
  66631. // {
  66632. // "description": "Returns permissions that a caller has on the specified resource.",
  66633. // "httpMethod": "POST",
  66634. // "id": "compute.instanceGroupManagers.testIamPermissions",
  66635. // "parameterOrder": [
  66636. // "project",
  66637. // "zone",
  66638. // "resource"
  66639. // ],
  66640. // "parameters": {
  66641. // "project": {
  66642. // "description": "Project ID for this request.",
  66643. // "location": "path",
  66644. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66645. // "required": true,
  66646. // "type": "string"
  66647. // },
  66648. // "resource": {
  66649. // "description": "Name or id of the resource for this request.",
  66650. // "location": "path",
  66651. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66652. // "required": true,
  66653. // "type": "string"
  66654. // },
  66655. // "zone": {
  66656. // "description": "The name of the zone for this request.",
  66657. // "location": "path",
  66658. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66659. // "required": true,
  66660. // "type": "string"
  66661. // }
  66662. // },
  66663. // "path": "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions",
  66664. // "request": {
  66665. // "$ref": "TestPermissionsRequest"
  66666. // },
  66667. // "response": {
  66668. // "$ref": "TestPermissionsResponse"
  66669. // },
  66670. // "scopes": [
  66671. // "https://www.googleapis.com/auth/cloud-platform",
  66672. // "https://www.googleapis.com/auth/compute",
  66673. // "https://www.googleapis.com/auth/compute.readonly"
  66674. // ]
  66675. // }
  66676. }
  66677. // method id "compute.instanceGroupManagers.update":
  66678. type InstanceGroupManagersUpdateCall struct {
  66679. s *Service
  66680. project string
  66681. zone string
  66682. instanceGroupManager string
  66683. instancegroupmanager *InstanceGroupManager
  66684. urlParams_ gensupport.URLParams
  66685. ctx_ context.Context
  66686. header_ http.Header
  66687. }
  66688. // Update: Updates a managed instance group using the information that
  66689. // you specify in the request. This operation is marked as DONE when the
  66690. // group is updated even if the instances in the group have not yet been
  66691. // updated. You must separately verify the status of the individual
  66692. // instances with the listManagedInstances method.
  66693. func (r *InstanceGroupManagersService) Update(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersUpdateCall {
  66694. c := &InstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66695. c.project = project
  66696. c.zone = zone
  66697. c.instanceGroupManager = instanceGroupManager
  66698. c.instancegroupmanager = instancegroupmanager
  66699. return c
  66700. }
  66701. // RequestId sets the optional parameter "requestId": An optional
  66702. // request ID to identify requests. Specify a unique request ID so that
  66703. // if you must retry your request, the server will know to ignore the
  66704. // request if it has already been completed.
  66705. //
  66706. // For example, consider a situation where you make an initial request
  66707. // and the request times out. If you make the request again with the
  66708. // same request ID, the server can check if original operation with the
  66709. // same request ID was received, and if so, will ignore the second
  66710. // request. This prevents clients from accidentally creating duplicate
  66711. // commitments.
  66712. //
  66713. // The request ID must be a valid UUID with the exception that zero UUID
  66714. // is not supported (00000000-0000-0000-0000-000000000000).
  66715. func (c *InstanceGroupManagersUpdateCall) RequestId(requestId string) *InstanceGroupManagersUpdateCall {
  66716. c.urlParams_.Set("requestId", requestId)
  66717. return c
  66718. }
  66719. // Fields allows partial responses to be retrieved. See
  66720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66721. // for more information.
  66722. func (c *InstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdateCall {
  66723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66724. return c
  66725. }
  66726. // Context sets the context to be used in this call's Do method. Any
  66727. // pending HTTP request will be aborted if the provided context is
  66728. // canceled.
  66729. func (c *InstanceGroupManagersUpdateCall) Context(ctx context.Context) *InstanceGroupManagersUpdateCall {
  66730. c.ctx_ = ctx
  66731. return c
  66732. }
  66733. // Header returns an http.Header that can be modified by the caller to
  66734. // add HTTP headers to the request.
  66735. func (c *InstanceGroupManagersUpdateCall) Header() http.Header {
  66736. if c.header_ == nil {
  66737. c.header_ = make(http.Header)
  66738. }
  66739. return c.header_
  66740. }
  66741. func (c *InstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  66742. reqHeaders := make(http.Header)
  66743. for k, v := range c.header_ {
  66744. reqHeaders[k] = v
  66745. }
  66746. reqHeaders.Set("User-Agent", c.s.userAgent())
  66747. var body io.Reader = nil
  66748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  66749. if err != nil {
  66750. return nil, err
  66751. }
  66752. reqHeaders.Set("Content-Type", "application/json")
  66753. c.urlParams_.Set("alt", alt)
  66754. c.urlParams_.Set("prettyPrint", "false")
  66755. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  66756. urls += "?" + c.urlParams_.Encode()
  66757. req, err := http.NewRequest("PUT", urls, body)
  66758. if err != nil {
  66759. return nil, err
  66760. }
  66761. req.Header = reqHeaders
  66762. googleapi.Expand(req.URL, map[string]string{
  66763. "project": c.project,
  66764. "zone": c.zone,
  66765. "instanceGroupManager": c.instanceGroupManager,
  66766. })
  66767. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66768. }
  66769. // Do executes the "compute.instanceGroupManagers.update" call.
  66770. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66771. // status code is an error. Response headers are in either
  66772. // *Operation.ServerResponse.Header or (if a response was returned at
  66773. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66774. // to check whether the returned error was because
  66775. // http.StatusNotModified was returned.
  66776. func (c *InstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66777. gensupport.SetOptions(c.urlParams_, opts...)
  66778. res, err := c.doRequest("json")
  66779. if res != nil && res.StatusCode == http.StatusNotModified {
  66780. if res.Body != nil {
  66781. res.Body.Close()
  66782. }
  66783. return nil, &googleapi.Error{
  66784. Code: res.StatusCode,
  66785. Header: res.Header,
  66786. }
  66787. }
  66788. if err != nil {
  66789. return nil, err
  66790. }
  66791. defer googleapi.CloseBody(res)
  66792. if err := googleapi.CheckResponse(res); err != nil {
  66793. return nil, err
  66794. }
  66795. ret := &Operation{
  66796. ServerResponse: googleapi.ServerResponse{
  66797. Header: res.Header,
  66798. HTTPStatusCode: res.StatusCode,
  66799. },
  66800. }
  66801. target := &ret
  66802. if err := gensupport.DecodeResponse(target, res); err != nil {
  66803. return nil, err
  66804. }
  66805. return ret, nil
  66806. // {
  66807. // "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.",
  66808. // "httpMethod": "PUT",
  66809. // "id": "compute.instanceGroupManagers.update",
  66810. // "parameterOrder": [
  66811. // "project",
  66812. // "zone",
  66813. // "instanceGroupManager"
  66814. // ],
  66815. // "parameters": {
  66816. // "instanceGroupManager": {
  66817. // "description": "The name of the instance group manager.",
  66818. // "location": "path",
  66819. // "required": true,
  66820. // "type": "string"
  66821. // },
  66822. // "project": {
  66823. // "description": "Project ID for this request.",
  66824. // "location": "path",
  66825. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66826. // "required": true,
  66827. // "type": "string"
  66828. // },
  66829. // "requestId": {
  66830. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66831. // "location": "query",
  66832. // "type": "string"
  66833. // },
  66834. // "zone": {
  66835. // "description": "The name of the zone where you want to create the managed instance group.",
  66836. // "location": "path",
  66837. // "required": true,
  66838. // "type": "string"
  66839. // }
  66840. // },
  66841. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  66842. // "request": {
  66843. // "$ref": "InstanceGroupManager"
  66844. // },
  66845. // "response": {
  66846. // "$ref": "Operation"
  66847. // },
  66848. // "scopes": [
  66849. // "https://www.googleapis.com/auth/cloud-platform",
  66850. // "https://www.googleapis.com/auth/compute"
  66851. // ]
  66852. // }
  66853. }
  66854. // method id "compute.instanceGroupManagers.updatePerInstanceConfigs":
  66855. type InstanceGroupManagersUpdatePerInstanceConfigsCall struct {
  66856. s *Service
  66857. project string
  66858. zone string
  66859. instanceGroupManager string
  66860. instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq
  66861. urlParams_ gensupport.URLParams
  66862. ctx_ context.Context
  66863. header_ http.Header
  66864. }
  66865. // UpdatePerInstanceConfigs: Insert or update (for the ones that already
  66866. // exist) per-instance configs for the managed instance group.
  66867. // perInstanceConfig.instance serves as a key used to distinguish
  66868. // whether to perform insert or patch.
  66869. func (r *InstanceGroupManagersService) UpdatePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  66870. c := &InstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66871. c.project = project
  66872. c.zone = zone
  66873. c.instanceGroupManager = instanceGroupManager
  66874. c.instancegroupmanagersupdateperinstanceconfigsreq = instancegroupmanagersupdateperinstanceconfigsreq
  66875. return c
  66876. }
  66877. // RequestId sets the optional parameter "requestId": An optional
  66878. // request ID to identify requests. Specify a unique request ID so that
  66879. // if you must retry your request, the server will know to ignore the
  66880. // request if it has already been completed.
  66881. //
  66882. // For example, consider a situation where you make an initial request
  66883. // and the request times out. If you make the request again with the
  66884. // same request ID, the server can check if original operation with the
  66885. // same request ID was received, and if so, will ignore the second
  66886. // request. This prevents clients from accidentally creating duplicate
  66887. // commitments.
  66888. //
  66889. // The request ID must be a valid UUID with the exception that zero UUID
  66890. // is not supported (00000000-0000-0000-0000-000000000000).
  66891. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  66892. c.urlParams_.Set("requestId", requestId)
  66893. return c
  66894. }
  66895. // Fields allows partial responses to be retrieved. See
  66896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66897. // for more information.
  66898. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  66899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66900. return c
  66901. }
  66902. // Context sets the context to be used in this call's Do method. Any
  66903. // pending HTTP request will be aborted if the provided context is
  66904. // canceled.
  66905. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  66906. c.ctx_ = ctx
  66907. return c
  66908. }
  66909. // Header returns an http.Header that can be modified by the caller to
  66910. // add HTTP headers to the request.
  66911. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header {
  66912. if c.header_ == nil {
  66913. c.header_ = make(http.Header)
  66914. }
  66915. return c.header_
  66916. }
  66917. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  66918. reqHeaders := make(http.Header)
  66919. for k, v := range c.header_ {
  66920. reqHeaders[k] = v
  66921. }
  66922. reqHeaders.Set("User-Agent", c.s.userAgent())
  66923. var body io.Reader = nil
  66924. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersupdateperinstanceconfigsreq)
  66925. if err != nil {
  66926. return nil, err
  66927. }
  66928. reqHeaders.Set("Content-Type", "application/json")
  66929. c.urlParams_.Set("alt", alt)
  66930. c.urlParams_.Set("prettyPrint", "false")
  66931. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs")
  66932. urls += "?" + c.urlParams_.Encode()
  66933. req, err := http.NewRequest("POST", urls, body)
  66934. if err != nil {
  66935. return nil, err
  66936. }
  66937. req.Header = reqHeaders
  66938. googleapi.Expand(req.URL, map[string]string{
  66939. "project": c.project,
  66940. "zone": c.zone,
  66941. "instanceGroupManager": c.instanceGroupManager,
  66942. })
  66943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66944. }
  66945. // Do executes the "compute.instanceGroupManagers.updatePerInstanceConfigs" call.
  66946. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66947. // status code is an error. Response headers are in either
  66948. // *Operation.ServerResponse.Header or (if a response was returned at
  66949. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66950. // to check whether the returned error was because
  66951. // http.StatusNotModified was returned.
  66952. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66953. gensupport.SetOptions(c.urlParams_, opts...)
  66954. res, err := c.doRequest("json")
  66955. if res != nil && res.StatusCode == http.StatusNotModified {
  66956. if res.Body != nil {
  66957. res.Body.Close()
  66958. }
  66959. return nil, &googleapi.Error{
  66960. Code: res.StatusCode,
  66961. Header: res.Header,
  66962. }
  66963. }
  66964. if err != nil {
  66965. return nil, err
  66966. }
  66967. defer googleapi.CloseBody(res)
  66968. if err := googleapi.CheckResponse(res); err != nil {
  66969. return nil, err
  66970. }
  66971. ret := &Operation{
  66972. ServerResponse: googleapi.ServerResponse{
  66973. Header: res.Header,
  66974. HTTPStatusCode: res.StatusCode,
  66975. },
  66976. }
  66977. target := &ret
  66978. if err := gensupport.DecodeResponse(target, res); err != nil {
  66979. return nil, err
  66980. }
  66981. return ret, nil
  66982. // {
  66983. // "description": "Insert or update (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.",
  66984. // "httpMethod": "POST",
  66985. // "id": "compute.instanceGroupManagers.updatePerInstanceConfigs",
  66986. // "parameterOrder": [
  66987. // "project",
  66988. // "zone",
  66989. // "instanceGroupManager"
  66990. // ],
  66991. // "parameters": {
  66992. // "instanceGroupManager": {
  66993. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  66994. // "location": "path",
  66995. // "required": true,
  66996. // "type": "string"
  66997. // },
  66998. // "project": {
  66999. // "description": "Project ID for this request.",
  67000. // "location": "path",
  67001. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67002. // "required": true,
  67003. // "type": "string"
  67004. // },
  67005. // "requestId": {
  67006. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67007. // "location": "query",
  67008. // "type": "string"
  67009. // },
  67010. // "zone": {
  67011. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  67012. // "location": "path",
  67013. // "required": true,
  67014. // "type": "string"
  67015. // }
  67016. // },
  67017. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
  67018. // "request": {
  67019. // "$ref": "InstanceGroupManagersUpdatePerInstanceConfigsReq"
  67020. // },
  67021. // "response": {
  67022. // "$ref": "Operation"
  67023. // },
  67024. // "scopes": [
  67025. // "https://www.googleapis.com/auth/cloud-platform",
  67026. // "https://www.googleapis.com/auth/compute"
  67027. // ]
  67028. // }
  67029. }
  67030. // method id "compute.instanceGroups.addInstances":
  67031. type InstanceGroupsAddInstancesCall struct {
  67032. s *Service
  67033. project string
  67034. zone string
  67035. instanceGroup string
  67036. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  67037. urlParams_ gensupport.URLParams
  67038. ctx_ context.Context
  67039. header_ http.Header
  67040. }
  67041. // AddInstances: Adds a list of instances to the specified instance
  67042. // group. All of the instances in the instance group must be in the same
  67043. // network/subnetwork. Read Adding instances for more information.
  67044. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  67045. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67046. c.project = project
  67047. c.zone = zone
  67048. c.instanceGroup = instanceGroup
  67049. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  67050. return c
  67051. }
  67052. // RequestId sets the optional parameter "requestId": An optional
  67053. // request ID to identify requests. Specify a unique request ID so that
  67054. // if you must retry your request, the server will know to ignore the
  67055. // request if it has already been completed.
  67056. //
  67057. // For example, consider a situation where you make an initial request
  67058. // and the request times out. If you make the request again with the
  67059. // same request ID, the server can check if original operation with the
  67060. // same request ID was received, and if so, will ignore the second
  67061. // request. This prevents clients from accidentally creating duplicate
  67062. // commitments.
  67063. //
  67064. // The request ID must be a valid UUID with the exception that zero UUID
  67065. // is not supported (00000000-0000-0000-0000-000000000000).
  67066. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  67067. c.urlParams_.Set("requestId", requestId)
  67068. return c
  67069. }
  67070. // Fields allows partial responses to be retrieved. See
  67071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67072. // for more information.
  67073. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  67074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67075. return c
  67076. }
  67077. // Context sets the context to be used in this call's Do method. Any
  67078. // pending HTTP request will be aborted if the provided context is
  67079. // canceled.
  67080. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  67081. c.ctx_ = ctx
  67082. return c
  67083. }
  67084. // Header returns an http.Header that can be modified by the caller to
  67085. // add HTTP headers to the request.
  67086. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  67087. if c.header_ == nil {
  67088. c.header_ = make(http.Header)
  67089. }
  67090. return c.header_
  67091. }
  67092. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  67093. reqHeaders := make(http.Header)
  67094. for k, v := range c.header_ {
  67095. reqHeaders[k] = v
  67096. }
  67097. reqHeaders.Set("User-Agent", c.s.userAgent())
  67098. var body io.Reader = nil
  67099. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  67100. if err != nil {
  67101. return nil, err
  67102. }
  67103. reqHeaders.Set("Content-Type", "application/json")
  67104. c.urlParams_.Set("alt", alt)
  67105. c.urlParams_.Set("prettyPrint", "false")
  67106. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  67107. urls += "?" + c.urlParams_.Encode()
  67108. req, err := http.NewRequest("POST", urls, body)
  67109. if err != nil {
  67110. return nil, err
  67111. }
  67112. req.Header = reqHeaders
  67113. googleapi.Expand(req.URL, map[string]string{
  67114. "project": c.project,
  67115. "zone": c.zone,
  67116. "instanceGroup": c.instanceGroup,
  67117. })
  67118. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67119. }
  67120. // Do executes the "compute.instanceGroups.addInstances" call.
  67121. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67122. // status code is an error. Response headers are in either
  67123. // *Operation.ServerResponse.Header or (if a response was returned at
  67124. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67125. // to check whether the returned error was because
  67126. // http.StatusNotModified was returned.
  67127. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67128. gensupport.SetOptions(c.urlParams_, opts...)
  67129. res, err := c.doRequest("json")
  67130. if res != nil && res.StatusCode == http.StatusNotModified {
  67131. if res.Body != nil {
  67132. res.Body.Close()
  67133. }
  67134. return nil, &googleapi.Error{
  67135. Code: res.StatusCode,
  67136. Header: res.Header,
  67137. }
  67138. }
  67139. if err != nil {
  67140. return nil, err
  67141. }
  67142. defer googleapi.CloseBody(res)
  67143. if err := googleapi.CheckResponse(res); err != nil {
  67144. return nil, err
  67145. }
  67146. ret := &Operation{
  67147. ServerResponse: googleapi.ServerResponse{
  67148. Header: res.Header,
  67149. HTTPStatusCode: res.StatusCode,
  67150. },
  67151. }
  67152. target := &ret
  67153. if err := gensupport.DecodeResponse(target, res); err != nil {
  67154. return nil, err
  67155. }
  67156. return ret, nil
  67157. // {
  67158. // "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.",
  67159. // "httpMethod": "POST",
  67160. // "id": "compute.instanceGroups.addInstances",
  67161. // "parameterOrder": [
  67162. // "project",
  67163. // "zone",
  67164. // "instanceGroup"
  67165. // ],
  67166. // "parameters": {
  67167. // "instanceGroup": {
  67168. // "description": "The name of the instance group where you are adding instances.",
  67169. // "location": "path",
  67170. // "required": true,
  67171. // "type": "string"
  67172. // },
  67173. // "project": {
  67174. // "description": "Project ID for this request.",
  67175. // "location": "path",
  67176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67177. // "required": true,
  67178. // "type": "string"
  67179. // },
  67180. // "requestId": {
  67181. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67182. // "location": "query",
  67183. // "type": "string"
  67184. // },
  67185. // "zone": {
  67186. // "description": "The name of the zone where the instance group is located.",
  67187. // "location": "path",
  67188. // "required": true,
  67189. // "type": "string"
  67190. // }
  67191. // },
  67192. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  67193. // "request": {
  67194. // "$ref": "InstanceGroupsAddInstancesRequest"
  67195. // },
  67196. // "response": {
  67197. // "$ref": "Operation"
  67198. // },
  67199. // "scopes": [
  67200. // "https://www.googleapis.com/auth/cloud-platform",
  67201. // "https://www.googleapis.com/auth/compute"
  67202. // ]
  67203. // }
  67204. }
  67205. // method id "compute.instanceGroups.aggregatedList":
  67206. type InstanceGroupsAggregatedListCall struct {
  67207. s *Service
  67208. project string
  67209. urlParams_ gensupport.URLParams
  67210. ifNoneMatch_ string
  67211. ctx_ context.Context
  67212. header_ http.Header
  67213. }
  67214. // AggregatedList: Retrieves the list of instance groups and sorts them
  67215. // by zone.
  67216. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  67217. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67218. c.project = project
  67219. return c
  67220. }
  67221. // Filter sets the optional parameter "filter": A filter expression that
  67222. // filters resources listed in the response. The expression must specify
  67223. // the field name, a comparison operator, and the value that you want to
  67224. // use for filtering. The value must be a string, a number, or a
  67225. // boolean. The comparison operator must be either =, !=, >, or <.
  67226. //
  67227. // For example, if you are filtering Compute Engine instances, you can
  67228. // exclude instances named example-instance by specifying name !=
  67229. // example-instance.
  67230. //
  67231. // You can also filter nested fields. For example, you could specify
  67232. // scheduling.automaticRestart = false to include instances only if they
  67233. // are not scheduled for automatic restarts. You can use filtering on
  67234. // nested fields to filter based on resource labels.
  67235. //
  67236. // To filter on multiple expressions, provide each separate expression
  67237. // within parentheses. For example, (scheduling.automaticRestart = true)
  67238. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67239. // AND expression. However, you can include AND and OR expressions
  67240. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67241. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67242. // true).
  67243. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  67244. c.urlParams_.Set("filter", filter)
  67245. return c
  67246. }
  67247. // MaxResults sets the optional parameter "maxResults": The maximum
  67248. // number of results per page that should be returned. If the number of
  67249. // available results is larger than maxResults, Compute Engine returns a
  67250. // nextPageToken that can be used to get the next page of results in
  67251. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67252. // (Default: 500)
  67253. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  67254. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67255. return c
  67256. }
  67257. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67258. // a certain order. By default, results are returned in alphanumerical
  67259. // order based on the resource name.
  67260. //
  67261. // You can also sort results in descending order based on the creation
  67262. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67263. // based on the creationTimestamp field in reverse chronological order
  67264. // (newest result first). Use this to sort resources like operations so
  67265. // that the newest operation is returned first.
  67266. //
  67267. // Currently, only sorting by name or creationTimestamp desc is
  67268. // supported.
  67269. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  67270. c.urlParams_.Set("orderBy", orderBy)
  67271. return c
  67272. }
  67273. // PageToken sets the optional parameter "pageToken": Specifies a page
  67274. // token to use. Set pageToken to the nextPageToken returned by a
  67275. // previous list request to get the next page of results.
  67276. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  67277. c.urlParams_.Set("pageToken", pageToken)
  67278. return c
  67279. }
  67280. // Fields allows partial responses to be retrieved. See
  67281. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67282. // for more information.
  67283. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  67284. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67285. return c
  67286. }
  67287. // IfNoneMatch sets the optional parameter which makes the operation
  67288. // fail if the object's ETag matches the given value. This is useful for
  67289. // getting updates only after the object has changed since the last
  67290. // request. Use googleapi.IsNotModified to check whether the response
  67291. // error from Do is the result of In-None-Match.
  67292. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  67293. c.ifNoneMatch_ = entityTag
  67294. return c
  67295. }
  67296. // Context sets the context to be used in this call's Do method. Any
  67297. // pending HTTP request will be aborted if the provided context is
  67298. // canceled.
  67299. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  67300. c.ctx_ = ctx
  67301. return c
  67302. }
  67303. // Header returns an http.Header that can be modified by the caller to
  67304. // add HTTP headers to the request.
  67305. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  67306. if c.header_ == nil {
  67307. c.header_ = make(http.Header)
  67308. }
  67309. return c.header_
  67310. }
  67311. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  67312. reqHeaders := make(http.Header)
  67313. for k, v := range c.header_ {
  67314. reqHeaders[k] = v
  67315. }
  67316. reqHeaders.Set("User-Agent", c.s.userAgent())
  67317. if c.ifNoneMatch_ != "" {
  67318. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67319. }
  67320. var body io.Reader = nil
  67321. c.urlParams_.Set("alt", alt)
  67322. c.urlParams_.Set("prettyPrint", "false")
  67323. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  67324. urls += "?" + c.urlParams_.Encode()
  67325. req, err := http.NewRequest("GET", urls, body)
  67326. if err != nil {
  67327. return nil, err
  67328. }
  67329. req.Header = reqHeaders
  67330. googleapi.Expand(req.URL, map[string]string{
  67331. "project": c.project,
  67332. })
  67333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67334. }
  67335. // Do executes the "compute.instanceGroups.aggregatedList" call.
  67336. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  67337. // Any non-2xx status code is an error. Response headers are in either
  67338. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  67339. // was returned at all) in error.(*googleapi.Error).Header. Use
  67340. // googleapi.IsNotModified to check whether the returned error was
  67341. // because http.StatusNotModified was returned.
  67342. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  67343. gensupport.SetOptions(c.urlParams_, opts...)
  67344. res, err := c.doRequest("json")
  67345. if res != nil && res.StatusCode == http.StatusNotModified {
  67346. if res.Body != nil {
  67347. res.Body.Close()
  67348. }
  67349. return nil, &googleapi.Error{
  67350. Code: res.StatusCode,
  67351. Header: res.Header,
  67352. }
  67353. }
  67354. if err != nil {
  67355. return nil, err
  67356. }
  67357. defer googleapi.CloseBody(res)
  67358. if err := googleapi.CheckResponse(res); err != nil {
  67359. return nil, err
  67360. }
  67361. ret := &InstanceGroupAggregatedList{
  67362. ServerResponse: googleapi.ServerResponse{
  67363. Header: res.Header,
  67364. HTTPStatusCode: res.StatusCode,
  67365. },
  67366. }
  67367. target := &ret
  67368. if err := gensupport.DecodeResponse(target, res); err != nil {
  67369. return nil, err
  67370. }
  67371. return ret, nil
  67372. // {
  67373. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  67374. // "httpMethod": "GET",
  67375. // "id": "compute.instanceGroups.aggregatedList",
  67376. // "parameterOrder": [
  67377. // "project"
  67378. // ],
  67379. // "parameters": {
  67380. // "filter": {
  67381. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  67382. // "location": "query",
  67383. // "type": "string"
  67384. // },
  67385. // "maxResults": {
  67386. // "default": "500",
  67387. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  67388. // "format": "uint32",
  67389. // "location": "query",
  67390. // "minimum": "0",
  67391. // "type": "integer"
  67392. // },
  67393. // "orderBy": {
  67394. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  67395. // "location": "query",
  67396. // "type": "string"
  67397. // },
  67398. // "pageToken": {
  67399. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  67400. // "location": "query",
  67401. // "type": "string"
  67402. // },
  67403. // "project": {
  67404. // "description": "Project ID for this request.",
  67405. // "location": "path",
  67406. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67407. // "required": true,
  67408. // "type": "string"
  67409. // }
  67410. // },
  67411. // "path": "{project}/aggregated/instanceGroups",
  67412. // "response": {
  67413. // "$ref": "InstanceGroupAggregatedList"
  67414. // },
  67415. // "scopes": [
  67416. // "https://www.googleapis.com/auth/cloud-platform",
  67417. // "https://www.googleapis.com/auth/compute",
  67418. // "https://www.googleapis.com/auth/compute.readonly"
  67419. // ]
  67420. // }
  67421. }
  67422. // Pages invokes f for each page of results.
  67423. // A non-nil error returned from f will halt the iteration.
  67424. // The provided context supersedes any context provided to the Context method.
  67425. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  67426. c.ctx_ = ctx
  67427. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67428. for {
  67429. x, err := c.Do()
  67430. if err != nil {
  67431. return err
  67432. }
  67433. if err := f(x); err != nil {
  67434. return err
  67435. }
  67436. if x.NextPageToken == "" {
  67437. return nil
  67438. }
  67439. c.PageToken(x.NextPageToken)
  67440. }
  67441. }
  67442. // method id "compute.instanceGroups.delete":
  67443. type InstanceGroupsDeleteCall struct {
  67444. s *Service
  67445. project string
  67446. zone string
  67447. instanceGroup string
  67448. urlParams_ gensupport.URLParams
  67449. ctx_ context.Context
  67450. header_ http.Header
  67451. }
  67452. // Delete: Deletes the specified instance group. The instances in the
  67453. // group are not deleted. Note that instance group must not belong to a
  67454. // backend service. Read Deleting an instance group for more
  67455. // information.
  67456. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  67457. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67458. c.project = project
  67459. c.zone = zone
  67460. c.instanceGroup = instanceGroup
  67461. return c
  67462. }
  67463. // RequestId sets the optional parameter "requestId": An optional
  67464. // request ID to identify requests. Specify a unique request ID so that
  67465. // if you must retry your request, the server will know to ignore the
  67466. // request if it has already been completed.
  67467. //
  67468. // For example, consider a situation where you make an initial request
  67469. // and the request times out. If you make the request again with the
  67470. // same request ID, the server can check if original operation with the
  67471. // same request ID was received, and if so, will ignore the second
  67472. // request. This prevents clients from accidentally creating duplicate
  67473. // commitments.
  67474. //
  67475. // The request ID must be a valid UUID with the exception that zero UUID
  67476. // is not supported (00000000-0000-0000-0000-000000000000).
  67477. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  67478. c.urlParams_.Set("requestId", requestId)
  67479. return c
  67480. }
  67481. // Fields allows partial responses to be retrieved. See
  67482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67483. // for more information.
  67484. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  67485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67486. return c
  67487. }
  67488. // Context sets the context to be used in this call's Do method. Any
  67489. // pending HTTP request will be aborted if the provided context is
  67490. // canceled.
  67491. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  67492. c.ctx_ = ctx
  67493. return c
  67494. }
  67495. // Header returns an http.Header that can be modified by the caller to
  67496. // add HTTP headers to the request.
  67497. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  67498. if c.header_ == nil {
  67499. c.header_ = make(http.Header)
  67500. }
  67501. return c.header_
  67502. }
  67503. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  67504. reqHeaders := make(http.Header)
  67505. for k, v := range c.header_ {
  67506. reqHeaders[k] = v
  67507. }
  67508. reqHeaders.Set("User-Agent", c.s.userAgent())
  67509. var body io.Reader = nil
  67510. c.urlParams_.Set("alt", alt)
  67511. c.urlParams_.Set("prettyPrint", "false")
  67512. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  67513. urls += "?" + c.urlParams_.Encode()
  67514. req, err := http.NewRequest("DELETE", urls, body)
  67515. if err != nil {
  67516. return nil, err
  67517. }
  67518. req.Header = reqHeaders
  67519. googleapi.Expand(req.URL, map[string]string{
  67520. "project": c.project,
  67521. "zone": c.zone,
  67522. "instanceGroup": c.instanceGroup,
  67523. })
  67524. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67525. }
  67526. // Do executes the "compute.instanceGroups.delete" call.
  67527. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67528. // status code is an error. Response headers are in either
  67529. // *Operation.ServerResponse.Header or (if a response was returned at
  67530. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67531. // to check whether the returned error was because
  67532. // http.StatusNotModified was returned.
  67533. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67534. gensupport.SetOptions(c.urlParams_, opts...)
  67535. res, err := c.doRequest("json")
  67536. if res != nil && res.StatusCode == http.StatusNotModified {
  67537. if res.Body != nil {
  67538. res.Body.Close()
  67539. }
  67540. return nil, &googleapi.Error{
  67541. Code: res.StatusCode,
  67542. Header: res.Header,
  67543. }
  67544. }
  67545. if err != nil {
  67546. return nil, err
  67547. }
  67548. defer googleapi.CloseBody(res)
  67549. if err := googleapi.CheckResponse(res); err != nil {
  67550. return nil, err
  67551. }
  67552. ret := &Operation{
  67553. ServerResponse: googleapi.ServerResponse{
  67554. Header: res.Header,
  67555. HTTPStatusCode: res.StatusCode,
  67556. },
  67557. }
  67558. target := &ret
  67559. if err := gensupport.DecodeResponse(target, res); err != nil {
  67560. return nil, err
  67561. }
  67562. return ret, nil
  67563. // {
  67564. // "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.",
  67565. // "httpMethod": "DELETE",
  67566. // "id": "compute.instanceGroups.delete",
  67567. // "parameterOrder": [
  67568. // "project",
  67569. // "zone",
  67570. // "instanceGroup"
  67571. // ],
  67572. // "parameters": {
  67573. // "instanceGroup": {
  67574. // "description": "The name of the instance group to delete.",
  67575. // "location": "path",
  67576. // "required": true,
  67577. // "type": "string"
  67578. // },
  67579. // "project": {
  67580. // "description": "Project ID for this request.",
  67581. // "location": "path",
  67582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67583. // "required": true,
  67584. // "type": "string"
  67585. // },
  67586. // "requestId": {
  67587. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67588. // "location": "query",
  67589. // "type": "string"
  67590. // },
  67591. // "zone": {
  67592. // "description": "The name of the zone where the instance group is located.",
  67593. // "location": "path",
  67594. // "required": true,
  67595. // "type": "string"
  67596. // }
  67597. // },
  67598. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  67599. // "response": {
  67600. // "$ref": "Operation"
  67601. // },
  67602. // "scopes": [
  67603. // "https://www.googleapis.com/auth/cloud-platform",
  67604. // "https://www.googleapis.com/auth/compute"
  67605. // ]
  67606. // }
  67607. }
  67608. // method id "compute.instanceGroups.get":
  67609. type InstanceGroupsGetCall struct {
  67610. s *Service
  67611. project string
  67612. zone string
  67613. instanceGroup string
  67614. urlParams_ gensupport.URLParams
  67615. ifNoneMatch_ string
  67616. ctx_ context.Context
  67617. header_ http.Header
  67618. }
  67619. // Get: Returns the specified instance group. Gets a list of available
  67620. // instance groups by making a list() request.
  67621. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  67622. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67623. c.project = project
  67624. c.zone = zone
  67625. c.instanceGroup = instanceGroup
  67626. return c
  67627. }
  67628. // Fields allows partial responses to be retrieved. See
  67629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67630. // for more information.
  67631. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  67632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67633. return c
  67634. }
  67635. // IfNoneMatch sets the optional parameter which makes the operation
  67636. // fail if the object's ETag matches the given value. This is useful for
  67637. // getting updates only after the object has changed since the last
  67638. // request. Use googleapi.IsNotModified to check whether the response
  67639. // error from Do is the result of In-None-Match.
  67640. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  67641. c.ifNoneMatch_ = entityTag
  67642. return c
  67643. }
  67644. // Context sets the context to be used in this call's Do method. Any
  67645. // pending HTTP request will be aborted if the provided context is
  67646. // canceled.
  67647. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  67648. c.ctx_ = ctx
  67649. return c
  67650. }
  67651. // Header returns an http.Header that can be modified by the caller to
  67652. // add HTTP headers to the request.
  67653. func (c *InstanceGroupsGetCall) Header() http.Header {
  67654. if c.header_ == nil {
  67655. c.header_ = make(http.Header)
  67656. }
  67657. return c.header_
  67658. }
  67659. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  67660. reqHeaders := make(http.Header)
  67661. for k, v := range c.header_ {
  67662. reqHeaders[k] = v
  67663. }
  67664. reqHeaders.Set("User-Agent", c.s.userAgent())
  67665. if c.ifNoneMatch_ != "" {
  67666. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67667. }
  67668. var body io.Reader = nil
  67669. c.urlParams_.Set("alt", alt)
  67670. c.urlParams_.Set("prettyPrint", "false")
  67671. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  67672. urls += "?" + c.urlParams_.Encode()
  67673. req, err := http.NewRequest("GET", urls, body)
  67674. if err != nil {
  67675. return nil, err
  67676. }
  67677. req.Header = reqHeaders
  67678. googleapi.Expand(req.URL, map[string]string{
  67679. "project": c.project,
  67680. "zone": c.zone,
  67681. "instanceGroup": c.instanceGroup,
  67682. })
  67683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67684. }
  67685. // Do executes the "compute.instanceGroups.get" call.
  67686. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  67687. // status code is an error. Response headers are in either
  67688. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  67689. // at all) in error.(*googleapi.Error).Header. Use
  67690. // googleapi.IsNotModified to check whether the returned error was
  67691. // because http.StatusNotModified was returned.
  67692. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  67693. gensupport.SetOptions(c.urlParams_, opts...)
  67694. res, err := c.doRequest("json")
  67695. if res != nil && res.StatusCode == http.StatusNotModified {
  67696. if res.Body != nil {
  67697. res.Body.Close()
  67698. }
  67699. return nil, &googleapi.Error{
  67700. Code: res.StatusCode,
  67701. Header: res.Header,
  67702. }
  67703. }
  67704. if err != nil {
  67705. return nil, err
  67706. }
  67707. defer googleapi.CloseBody(res)
  67708. if err := googleapi.CheckResponse(res); err != nil {
  67709. return nil, err
  67710. }
  67711. ret := &InstanceGroup{
  67712. ServerResponse: googleapi.ServerResponse{
  67713. Header: res.Header,
  67714. HTTPStatusCode: res.StatusCode,
  67715. },
  67716. }
  67717. target := &ret
  67718. if err := gensupport.DecodeResponse(target, res); err != nil {
  67719. return nil, err
  67720. }
  67721. return ret, nil
  67722. // {
  67723. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  67724. // "httpMethod": "GET",
  67725. // "id": "compute.instanceGroups.get",
  67726. // "parameterOrder": [
  67727. // "project",
  67728. // "zone",
  67729. // "instanceGroup"
  67730. // ],
  67731. // "parameters": {
  67732. // "instanceGroup": {
  67733. // "description": "The name of the instance group.",
  67734. // "location": "path",
  67735. // "required": true,
  67736. // "type": "string"
  67737. // },
  67738. // "project": {
  67739. // "description": "Project ID for this request.",
  67740. // "location": "path",
  67741. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67742. // "required": true,
  67743. // "type": "string"
  67744. // },
  67745. // "zone": {
  67746. // "description": "The name of the zone where the instance group is located.",
  67747. // "location": "path",
  67748. // "required": true,
  67749. // "type": "string"
  67750. // }
  67751. // },
  67752. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  67753. // "response": {
  67754. // "$ref": "InstanceGroup"
  67755. // },
  67756. // "scopes": [
  67757. // "https://www.googleapis.com/auth/cloud-platform",
  67758. // "https://www.googleapis.com/auth/compute",
  67759. // "https://www.googleapis.com/auth/compute.readonly"
  67760. // ]
  67761. // }
  67762. }
  67763. // method id "compute.instanceGroups.insert":
  67764. type InstanceGroupsInsertCall struct {
  67765. s *Service
  67766. project string
  67767. zone string
  67768. instancegroup *InstanceGroup
  67769. urlParams_ gensupport.URLParams
  67770. ctx_ context.Context
  67771. header_ http.Header
  67772. }
  67773. // Insert: Creates an instance group in the specified project using the
  67774. // parameters that are included in the request.
  67775. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  67776. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67777. c.project = project
  67778. c.zone = zone
  67779. c.instancegroup = instancegroup
  67780. return c
  67781. }
  67782. // RequestId sets the optional parameter "requestId": An optional
  67783. // request ID to identify requests. Specify a unique request ID so that
  67784. // if you must retry your request, the server will know to ignore the
  67785. // request if it has already been completed.
  67786. //
  67787. // For example, consider a situation where you make an initial request
  67788. // and the request times out. If you make the request again with the
  67789. // same request ID, the server can check if original operation with the
  67790. // same request ID was received, and if so, will ignore the second
  67791. // request. This prevents clients from accidentally creating duplicate
  67792. // commitments.
  67793. //
  67794. // The request ID must be a valid UUID with the exception that zero UUID
  67795. // is not supported (00000000-0000-0000-0000-000000000000).
  67796. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  67797. c.urlParams_.Set("requestId", requestId)
  67798. return c
  67799. }
  67800. // Fields allows partial responses to be retrieved. See
  67801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67802. // for more information.
  67803. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  67804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67805. return c
  67806. }
  67807. // Context sets the context to be used in this call's Do method. Any
  67808. // pending HTTP request will be aborted if the provided context is
  67809. // canceled.
  67810. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  67811. c.ctx_ = ctx
  67812. return c
  67813. }
  67814. // Header returns an http.Header that can be modified by the caller to
  67815. // add HTTP headers to the request.
  67816. func (c *InstanceGroupsInsertCall) Header() http.Header {
  67817. if c.header_ == nil {
  67818. c.header_ = make(http.Header)
  67819. }
  67820. return c.header_
  67821. }
  67822. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  67823. reqHeaders := make(http.Header)
  67824. for k, v := range c.header_ {
  67825. reqHeaders[k] = v
  67826. }
  67827. reqHeaders.Set("User-Agent", c.s.userAgent())
  67828. var body io.Reader = nil
  67829. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  67830. if err != nil {
  67831. return nil, err
  67832. }
  67833. reqHeaders.Set("Content-Type", "application/json")
  67834. c.urlParams_.Set("alt", alt)
  67835. c.urlParams_.Set("prettyPrint", "false")
  67836. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  67837. urls += "?" + c.urlParams_.Encode()
  67838. req, err := http.NewRequest("POST", urls, body)
  67839. if err != nil {
  67840. return nil, err
  67841. }
  67842. req.Header = reqHeaders
  67843. googleapi.Expand(req.URL, map[string]string{
  67844. "project": c.project,
  67845. "zone": c.zone,
  67846. })
  67847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67848. }
  67849. // Do executes the "compute.instanceGroups.insert" call.
  67850. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67851. // status code is an error. Response headers are in either
  67852. // *Operation.ServerResponse.Header or (if a response was returned at
  67853. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67854. // to check whether the returned error was because
  67855. // http.StatusNotModified was returned.
  67856. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67857. gensupport.SetOptions(c.urlParams_, opts...)
  67858. res, err := c.doRequest("json")
  67859. if res != nil && res.StatusCode == http.StatusNotModified {
  67860. if res.Body != nil {
  67861. res.Body.Close()
  67862. }
  67863. return nil, &googleapi.Error{
  67864. Code: res.StatusCode,
  67865. Header: res.Header,
  67866. }
  67867. }
  67868. if err != nil {
  67869. return nil, err
  67870. }
  67871. defer googleapi.CloseBody(res)
  67872. if err := googleapi.CheckResponse(res); err != nil {
  67873. return nil, err
  67874. }
  67875. ret := &Operation{
  67876. ServerResponse: googleapi.ServerResponse{
  67877. Header: res.Header,
  67878. HTTPStatusCode: res.StatusCode,
  67879. },
  67880. }
  67881. target := &ret
  67882. if err := gensupport.DecodeResponse(target, res); err != nil {
  67883. return nil, err
  67884. }
  67885. return ret, nil
  67886. // {
  67887. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  67888. // "httpMethod": "POST",
  67889. // "id": "compute.instanceGroups.insert",
  67890. // "parameterOrder": [
  67891. // "project",
  67892. // "zone"
  67893. // ],
  67894. // "parameters": {
  67895. // "project": {
  67896. // "description": "Project ID for this request.",
  67897. // "location": "path",
  67898. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67899. // "required": true,
  67900. // "type": "string"
  67901. // },
  67902. // "requestId": {
  67903. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67904. // "location": "query",
  67905. // "type": "string"
  67906. // },
  67907. // "zone": {
  67908. // "description": "The name of the zone where you want to create the instance group.",
  67909. // "location": "path",
  67910. // "required": true,
  67911. // "type": "string"
  67912. // }
  67913. // },
  67914. // "path": "{project}/zones/{zone}/instanceGroups",
  67915. // "request": {
  67916. // "$ref": "InstanceGroup"
  67917. // },
  67918. // "response": {
  67919. // "$ref": "Operation"
  67920. // },
  67921. // "scopes": [
  67922. // "https://www.googleapis.com/auth/cloud-platform",
  67923. // "https://www.googleapis.com/auth/compute"
  67924. // ]
  67925. // }
  67926. }
  67927. // method id "compute.instanceGroups.list":
  67928. type InstanceGroupsListCall struct {
  67929. s *Service
  67930. project string
  67931. zone string
  67932. urlParams_ gensupport.URLParams
  67933. ifNoneMatch_ string
  67934. ctx_ context.Context
  67935. header_ http.Header
  67936. }
  67937. // List: Retrieves the list of instance groups that are located in the
  67938. // specified project and zone.
  67939. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  67940. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67941. c.project = project
  67942. c.zone = zone
  67943. return c
  67944. }
  67945. // Filter sets the optional parameter "filter": A filter expression that
  67946. // filters resources listed in the response. The expression must specify
  67947. // the field name, a comparison operator, and the value that you want to
  67948. // use for filtering. The value must be a string, a number, or a
  67949. // boolean. The comparison operator must be either =, !=, >, or <.
  67950. //
  67951. // For example, if you are filtering Compute Engine instances, you can
  67952. // exclude instances named example-instance by specifying name !=
  67953. // example-instance.
  67954. //
  67955. // You can also filter nested fields. For example, you could specify
  67956. // scheduling.automaticRestart = false to include instances only if they
  67957. // are not scheduled for automatic restarts. You can use filtering on
  67958. // nested fields to filter based on resource labels.
  67959. //
  67960. // To filter on multiple expressions, provide each separate expression
  67961. // within parentheses. For example, (scheduling.automaticRestart = true)
  67962. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67963. // AND expression. However, you can include AND and OR expressions
  67964. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67965. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67966. // true).
  67967. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  67968. c.urlParams_.Set("filter", filter)
  67969. return c
  67970. }
  67971. // MaxResults sets the optional parameter "maxResults": The maximum
  67972. // number of results per page that should be returned. If the number of
  67973. // available results is larger than maxResults, Compute Engine returns a
  67974. // nextPageToken that can be used to get the next page of results in
  67975. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67976. // (Default: 500)
  67977. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  67978. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67979. return c
  67980. }
  67981. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67982. // a certain order. By default, results are returned in alphanumerical
  67983. // order based on the resource name.
  67984. //
  67985. // You can also sort results in descending order based on the creation
  67986. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67987. // based on the creationTimestamp field in reverse chronological order
  67988. // (newest result first). Use this to sort resources like operations so
  67989. // that the newest operation is returned first.
  67990. //
  67991. // Currently, only sorting by name or creationTimestamp desc is
  67992. // supported.
  67993. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  67994. c.urlParams_.Set("orderBy", orderBy)
  67995. return c
  67996. }
  67997. // PageToken sets the optional parameter "pageToken": Specifies a page
  67998. // token to use. Set pageToken to the nextPageToken returned by a
  67999. // previous list request to get the next page of results.
  68000. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  68001. c.urlParams_.Set("pageToken", pageToken)
  68002. return c
  68003. }
  68004. // Fields allows partial responses to be retrieved. See
  68005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68006. // for more information.
  68007. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  68008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68009. return c
  68010. }
  68011. // IfNoneMatch sets the optional parameter which makes the operation
  68012. // fail if the object's ETag matches the given value. This is useful for
  68013. // getting updates only after the object has changed since the last
  68014. // request. Use googleapi.IsNotModified to check whether the response
  68015. // error from Do is the result of In-None-Match.
  68016. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  68017. c.ifNoneMatch_ = entityTag
  68018. return c
  68019. }
  68020. // Context sets the context to be used in this call's Do method. Any
  68021. // pending HTTP request will be aborted if the provided context is
  68022. // canceled.
  68023. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  68024. c.ctx_ = ctx
  68025. return c
  68026. }
  68027. // Header returns an http.Header that can be modified by the caller to
  68028. // add HTTP headers to the request.
  68029. func (c *InstanceGroupsListCall) Header() http.Header {
  68030. if c.header_ == nil {
  68031. c.header_ = make(http.Header)
  68032. }
  68033. return c.header_
  68034. }
  68035. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  68036. reqHeaders := make(http.Header)
  68037. for k, v := range c.header_ {
  68038. reqHeaders[k] = v
  68039. }
  68040. reqHeaders.Set("User-Agent", c.s.userAgent())
  68041. if c.ifNoneMatch_ != "" {
  68042. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68043. }
  68044. var body io.Reader = nil
  68045. c.urlParams_.Set("alt", alt)
  68046. c.urlParams_.Set("prettyPrint", "false")
  68047. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  68048. urls += "?" + c.urlParams_.Encode()
  68049. req, err := http.NewRequest("GET", urls, body)
  68050. if err != nil {
  68051. return nil, err
  68052. }
  68053. req.Header = reqHeaders
  68054. googleapi.Expand(req.URL, map[string]string{
  68055. "project": c.project,
  68056. "zone": c.zone,
  68057. })
  68058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68059. }
  68060. // Do executes the "compute.instanceGroups.list" call.
  68061. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  68062. // non-2xx status code is an error. Response headers are in either
  68063. // *InstanceGroupList.ServerResponse.Header or (if a response was
  68064. // returned at all) in error.(*googleapi.Error).Header. Use
  68065. // googleapi.IsNotModified to check whether the returned error was
  68066. // because http.StatusNotModified was returned.
  68067. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  68068. gensupport.SetOptions(c.urlParams_, opts...)
  68069. res, err := c.doRequest("json")
  68070. if res != nil && res.StatusCode == http.StatusNotModified {
  68071. if res.Body != nil {
  68072. res.Body.Close()
  68073. }
  68074. return nil, &googleapi.Error{
  68075. Code: res.StatusCode,
  68076. Header: res.Header,
  68077. }
  68078. }
  68079. if err != nil {
  68080. return nil, err
  68081. }
  68082. defer googleapi.CloseBody(res)
  68083. if err := googleapi.CheckResponse(res); err != nil {
  68084. return nil, err
  68085. }
  68086. ret := &InstanceGroupList{
  68087. ServerResponse: googleapi.ServerResponse{
  68088. Header: res.Header,
  68089. HTTPStatusCode: res.StatusCode,
  68090. },
  68091. }
  68092. target := &ret
  68093. if err := gensupport.DecodeResponse(target, res); err != nil {
  68094. return nil, err
  68095. }
  68096. return ret, nil
  68097. // {
  68098. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  68099. // "httpMethod": "GET",
  68100. // "id": "compute.instanceGroups.list",
  68101. // "parameterOrder": [
  68102. // "project",
  68103. // "zone"
  68104. // ],
  68105. // "parameters": {
  68106. // "filter": {
  68107. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  68108. // "location": "query",
  68109. // "type": "string"
  68110. // },
  68111. // "maxResults": {
  68112. // "default": "500",
  68113. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  68114. // "format": "uint32",
  68115. // "location": "query",
  68116. // "minimum": "0",
  68117. // "type": "integer"
  68118. // },
  68119. // "orderBy": {
  68120. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  68121. // "location": "query",
  68122. // "type": "string"
  68123. // },
  68124. // "pageToken": {
  68125. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  68126. // "location": "query",
  68127. // "type": "string"
  68128. // },
  68129. // "project": {
  68130. // "description": "Project ID for this request.",
  68131. // "location": "path",
  68132. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68133. // "required": true,
  68134. // "type": "string"
  68135. // },
  68136. // "zone": {
  68137. // "description": "The name of the zone where the instance group is located.",
  68138. // "location": "path",
  68139. // "required": true,
  68140. // "type": "string"
  68141. // }
  68142. // },
  68143. // "path": "{project}/zones/{zone}/instanceGroups",
  68144. // "response": {
  68145. // "$ref": "InstanceGroupList"
  68146. // },
  68147. // "scopes": [
  68148. // "https://www.googleapis.com/auth/cloud-platform",
  68149. // "https://www.googleapis.com/auth/compute",
  68150. // "https://www.googleapis.com/auth/compute.readonly"
  68151. // ]
  68152. // }
  68153. }
  68154. // Pages invokes f for each page of results.
  68155. // A non-nil error returned from f will halt the iteration.
  68156. // The provided context supersedes any context provided to the Context method.
  68157. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  68158. c.ctx_ = ctx
  68159. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68160. for {
  68161. x, err := c.Do()
  68162. if err != nil {
  68163. return err
  68164. }
  68165. if err := f(x); err != nil {
  68166. return err
  68167. }
  68168. if x.NextPageToken == "" {
  68169. return nil
  68170. }
  68171. c.PageToken(x.NextPageToken)
  68172. }
  68173. }
  68174. // method id "compute.instanceGroups.listInstances":
  68175. type InstanceGroupsListInstancesCall struct {
  68176. s *Service
  68177. project string
  68178. zone string
  68179. instanceGroup string
  68180. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  68181. urlParams_ gensupport.URLParams
  68182. ctx_ context.Context
  68183. header_ http.Header
  68184. }
  68185. // ListInstances: Lists the instances in the specified instance group.
  68186. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  68187. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68188. c.project = project
  68189. c.zone = zone
  68190. c.instanceGroup = instanceGroup
  68191. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  68192. return c
  68193. }
  68194. // Filter sets the optional parameter "filter": A filter expression that
  68195. // filters resources listed in the response. The expression must specify
  68196. // the field name, a comparison operator, and the value that you want to
  68197. // use for filtering. The value must be a string, a number, or a
  68198. // boolean. The comparison operator must be either =, !=, >, or <.
  68199. //
  68200. // For example, if you are filtering Compute Engine instances, you can
  68201. // exclude instances named example-instance by specifying name !=
  68202. // example-instance.
  68203. //
  68204. // You can also filter nested fields. For example, you could specify
  68205. // scheduling.automaticRestart = false to include instances only if they
  68206. // are not scheduled for automatic restarts. You can use filtering on
  68207. // nested fields to filter based on resource labels.
  68208. //
  68209. // To filter on multiple expressions, provide each separate expression
  68210. // within parentheses. For example, (scheduling.automaticRestart = true)
  68211. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68212. // AND expression. However, you can include AND and OR expressions
  68213. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68214. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68215. // true).
  68216. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  68217. c.urlParams_.Set("filter", filter)
  68218. return c
  68219. }
  68220. // MaxResults sets the optional parameter "maxResults": The maximum
  68221. // number of results per page that should be returned. If the number of
  68222. // available results is larger than maxResults, Compute Engine returns a
  68223. // nextPageToken that can be used to get the next page of results in
  68224. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68225. // (Default: 500)
  68226. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  68227. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68228. return c
  68229. }
  68230. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68231. // a certain order. By default, results are returned in alphanumerical
  68232. // order based on the resource name.
  68233. //
  68234. // You can also sort results in descending order based on the creation
  68235. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68236. // based on the creationTimestamp field in reverse chronological order
  68237. // (newest result first). Use this to sort resources like operations so
  68238. // that the newest operation is returned first.
  68239. //
  68240. // Currently, only sorting by name or creationTimestamp desc is
  68241. // supported.
  68242. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  68243. c.urlParams_.Set("orderBy", orderBy)
  68244. return c
  68245. }
  68246. // PageToken sets the optional parameter "pageToken": Specifies a page
  68247. // token to use. Set pageToken to the nextPageToken returned by a
  68248. // previous list request to get the next page of results.
  68249. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  68250. c.urlParams_.Set("pageToken", pageToken)
  68251. return c
  68252. }
  68253. // Fields allows partial responses to be retrieved. See
  68254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68255. // for more information.
  68256. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  68257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68258. return c
  68259. }
  68260. // Context sets the context to be used in this call's Do method. Any
  68261. // pending HTTP request will be aborted if the provided context is
  68262. // canceled.
  68263. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  68264. c.ctx_ = ctx
  68265. return c
  68266. }
  68267. // Header returns an http.Header that can be modified by the caller to
  68268. // add HTTP headers to the request.
  68269. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  68270. if c.header_ == nil {
  68271. c.header_ = make(http.Header)
  68272. }
  68273. return c.header_
  68274. }
  68275. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  68276. reqHeaders := make(http.Header)
  68277. for k, v := range c.header_ {
  68278. reqHeaders[k] = v
  68279. }
  68280. reqHeaders.Set("User-Agent", c.s.userAgent())
  68281. var body io.Reader = nil
  68282. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  68283. if err != nil {
  68284. return nil, err
  68285. }
  68286. reqHeaders.Set("Content-Type", "application/json")
  68287. c.urlParams_.Set("alt", alt)
  68288. c.urlParams_.Set("prettyPrint", "false")
  68289. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  68290. urls += "?" + c.urlParams_.Encode()
  68291. req, err := http.NewRequest("POST", urls, body)
  68292. if err != nil {
  68293. return nil, err
  68294. }
  68295. req.Header = reqHeaders
  68296. googleapi.Expand(req.URL, map[string]string{
  68297. "project": c.project,
  68298. "zone": c.zone,
  68299. "instanceGroup": c.instanceGroup,
  68300. })
  68301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68302. }
  68303. // Do executes the "compute.instanceGroups.listInstances" call.
  68304. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  68305. // Any non-2xx status code is an error. Response headers are in either
  68306. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  68307. // was returned at all) in error.(*googleapi.Error).Header. Use
  68308. // googleapi.IsNotModified to check whether the returned error was
  68309. // because http.StatusNotModified was returned.
  68310. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  68311. gensupport.SetOptions(c.urlParams_, opts...)
  68312. res, err := c.doRequest("json")
  68313. if res != nil && res.StatusCode == http.StatusNotModified {
  68314. if res.Body != nil {
  68315. res.Body.Close()
  68316. }
  68317. return nil, &googleapi.Error{
  68318. Code: res.StatusCode,
  68319. Header: res.Header,
  68320. }
  68321. }
  68322. if err != nil {
  68323. return nil, err
  68324. }
  68325. defer googleapi.CloseBody(res)
  68326. if err := googleapi.CheckResponse(res); err != nil {
  68327. return nil, err
  68328. }
  68329. ret := &InstanceGroupsListInstances{
  68330. ServerResponse: googleapi.ServerResponse{
  68331. Header: res.Header,
  68332. HTTPStatusCode: res.StatusCode,
  68333. },
  68334. }
  68335. target := &ret
  68336. if err := gensupport.DecodeResponse(target, res); err != nil {
  68337. return nil, err
  68338. }
  68339. return ret, nil
  68340. // {
  68341. // "description": "Lists the instances in the specified instance group.",
  68342. // "httpMethod": "POST",
  68343. // "id": "compute.instanceGroups.listInstances",
  68344. // "parameterOrder": [
  68345. // "project",
  68346. // "zone",
  68347. // "instanceGroup"
  68348. // ],
  68349. // "parameters": {
  68350. // "filter": {
  68351. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  68352. // "location": "query",
  68353. // "type": "string"
  68354. // },
  68355. // "instanceGroup": {
  68356. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  68357. // "location": "path",
  68358. // "required": true,
  68359. // "type": "string"
  68360. // },
  68361. // "maxResults": {
  68362. // "default": "500",
  68363. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  68364. // "format": "uint32",
  68365. // "location": "query",
  68366. // "minimum": "0",
  68367. // "type": "integer"
  68368. // },
  68369. // "orderBy": {
  68370. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  68371. // "location": "query",
  68372. // "type": "string"
  68373. // },
  68374. // "pageToken": {
  68375. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  68376. // "location": "query",
  68377. // "type": "string"
  68378. // },
  68379. // "project": {
  68380. // "description": "Project ID for this request.",
  68381. // "location": "path",
  68382. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68383. // "required": true,
  68384. // "type": "string"
  68385. // },
  68386. // "zone": {
  68387. // "description": "The name of the zone where the instance group is located.",
  68388. // "location": "path",
  68389. // "required": true,
  68390. // "type": "string"
  68391. // }
  68392. // },
  68393. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  68394. // "request": {
  68395. // "$ref": "InstanceGroupsListInstancesRequest"
  68396. // },
  68397. // "response": {
  68398. // "$ref": "InstanceGroupsListInstances"
  68399. // },
  68400. // "scopes": [
  68401. // "https://www.googleapis.com/auth/cloud-platform",
  68402. // "https://www.googleapis.com/auth/compute",
  68403. // "https://www.googleapis.com/auth/compute.readonly"
  68404. // ]
  68405. // }
  68406. }
  68407. // Pages invokes f for each page of results.
  68408. // A non-nil error returned from f will halt the iteration.
  68409. // The provided context supersedes any context provided to the Context method.
  68410. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  68411. c.ctx_ = ctx
  68412. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68413. for {
  68414. x, err := c.Do()
  68415. if err != nil {
  68416. return err
  68417. }
  68418. if err := f(x); err != nil {
  68419. return err
  68420. }
  68421. if x.NextPageToken == "" {
  68422. return nil
  68423. }
  68424. c.PageToken(x.NextPageToken)
  68425. }
  68426. }
  68427. // method id "compute.instanceGroups.removeInstances":
  68428. type InstanceGroupsRemoveInstancesCall struct {
  68429. s *Service
  68430. project string
  68431. zone string
  68432. instanceGroup string
  68433. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  68434. urlParams_ gensupport.URLParams
  68435. ctx_ context.Context
  68436. header_ http.Header
  68437. }
  68438. // RemoveInstances: Removes one or more instances from the specified
  68439. // instance group, but does not delete those instances.
  68440. //
  68441. // If the group is part of a backend service that has enabled connection
  68442. // draining, it can take up to 60 seconds after the connection draining
  68443. // duration before the VM instance is removed or deleted.
  68444. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  68445. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68446. c.project = project
  68447. c.zone = zone
  68448. c.instanceGroup = instanceGroup
  68449. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  68450. return c
  68451. }
  68452. // RequestId sets the optional parameter "requestId": An optional
  68453. // request ID to identify requests. Specify a unique request ID so that
  68454. // if you must retry your request, the server will know to ignore the
  68455. // request if it has already been completed.
  68456. //
  68457. // For example, consider a situation where you make an initial request
  68458. // and the request times out. If you make the request again with the
  68459. // same request ID, the server can check if original operation with the
  68460. // same request ID was received, and if so, will ignore the second
  68461. // request. This prevents clients from accidentally creating duplicate
  68462. // commitments.
  68463. //
  68464. // The request ID must be a valid UUID with the exception that zero UUID
  68465. // is not supported (00000000-0000-0000-0000-000000000000).
  68466. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  68467. c.urlParams_.Set("requestId", requestId)
  68468. return c
  68469. }
  68470. // Fields allows partial responses to be retrieved. See
  68471. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68472. // for more information.
  68473. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  68474. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68475. return c
  68476. }
  68477. // Context sets the context to be used in this call's Do method. Any
  68478. // pending HTTP request will be aborted if the provided context is
  68479. // canceled.
  68480. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  68481. c.ctx_ = ctx
  68482. return c
  68483. }
  68484. // Header returns an http.Header that can be modified by the caller to
  68485. // add HTTP headers to the request.
  68486. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  68487. if c.header_ == nil {
  68488. c.header_ = make(http.Header)
  68489. }
  68490. return c.header_
  68491. }
  68492. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  68493. reqHeaders := make(http.Header)
  68494. for k, v := range c.header_ {
  68495. reqHeaders[k] = v
  68496. }
  68497. reqHeaders.Set("User-Agent", c.s.userAgent())
  68498. var body io.Reader = nil
  68499. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  68500. if err != nil {
  68501. return nil, err
  68502. }
  68503. reqHeaders.Set("Content-Type", "application/json")
  68504. c.urlParams_.Set("alt", alt)
  68505. c.urlParams_.Set("prettyPrint", "false")
  68506. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  68507. urls += "?" + c.urlParams_.Encode()
  68508. req, err := http.NewRequest("POST", urls, body)
  68509. if err != nil {
  68510. return nil, err
  68511. }
  68512. req.Header = reqHeaders
  68513. googleapi.Expand(req.URL, map[string]string{
  68514. "project": c.project,
  68515. "zone": c.zone,
  68516. "instanceGroup": c.instanceGroup,
  68517. })
  68518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68519. }
  68520. // Do executes the "compute.instanceGroups.removeInstances" call.
  68521. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68522. // status code is an error. Response headers are in either
  68523. // *Operation.ServerResponse.Header or (if a response was returned at
  68524. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68525. // to check whether the returned error was because
  68526. // http.StatusNotModified was returned.
  68527. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68528. gensupport.SetOptions(c.urlParams_, opts...)
  68529. res, err := c.doRequest("json")
  68530. if res != nil && res.StatusCode == http.StatusNotModified {
  68531. if res.Body != nil {
  68532. res.Body.Close()
  68533. }
  68534. return nil, &googleapi.Error{
  68535. Code: res.StatusCode,
  68536. Header: res.Header,
  68537. }
  68538. }
  68539. if err != nil {
  68540. return nil, err
  68541. }
  68542. defer googleapi.CloseBody(res)
  68543. if err := googleapi.CheckResponse(res); err != nil {
  68544. return nil, err
  68545. }
  68546. ret := &Operation{
  68547. ServerResponse: googleapi.ServerResponse{
  68548. Header: res.Header,
  68549. HTTPStatusCode: res.StatusCode,
  68550. },
  68551. }
  68552. target := &ret
  68553. if err := gensupport.DecodeResponse(target, res); err != nil {
  68554. return nil, err
  68555. }
  68556. return ret, nil
  68557. // {
  68558. // "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.",
  68559. // "httpMethod": "POST",
  68560. // "id": "compute.instanceGroups.removeInstances",
  68561. // "parameterOrder": [
  68562. // "project",
  68563. // "zone",
  68564. // "instanceGroup"
  68565. // ],
  68566. // "parameters": {
  68567. // "instanceGroup": {
  68568. // "description": "The name of the instance group where the specified instances will be removed.",
  68569. // "location": "path",
  68570. // "required": true,
  68571. // "type": "string"
  68572. // },
  68573. // "project": {
  68574. // "description": "Project ID for this request.",
  68575. // "location": "path",
  68576. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68577. // "required": true,
  68578. // "type": "string"
  68579. // },
  68580. // "requestId": {
  68581. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68582. // "location": "query",
  68583. // "type": "string"
  68584. // },
  68585. // "zone": {
  68586. // "description": "The name of the zone where the instance group is located.",
  68587. // "location": "path",
  68588. // "required": true,
  68589. // "type": "string"
  68590. // }
  68591. // },
  68592. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  68593. // "request": {
  68594. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  68595. // },
  68596. // "response": {
  68597. // "$ref": "Operation"
  68598. // },
  68599. // "scopes": [
  68600. // "https://www.googleapis.com/auth/cloud-platform",
  68601. // "https://www.googleapis.com/auth/compute"
  68602. // ]
  68603. // }
  68604. }
  68605. // method id "compute.instanceGroups.setNamedPorts":
  68606. type InstanceGroupsSetNamedPortsCall struct {
  68607. s *Service
  68608. project string
  68609. zone string
  68610. instanceGroup string
  68611. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  68612. urlParams_ gensupport.URLParams
  68613. ctx_ context.Context
  68614. header_ http.Header
  68615. }
  68616. // SetNamedPorts: Sets the named ports for the specified instance group.
  68617. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  68618. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68619. c.project = project
  68620. c.zone = zone
  68621. c.instanceGroup = instanceGroup
  68622. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  68623. return c
  68624. }
  68625. // RequestId sets the optional parameter "requestId": An optional
  68626. // request ID to identify requests. Specify a unique request ID so that
  68627. // if you must retry your request, the server will know to ignore the
  68628. // request if it has already been completed.
  68629. //
  68630. // For example, consider a situation where you make an initial request
  68631. // and the request times out. If you make the request again with the
  68632. // same request ID, the server can check if original operation with the
  68633. // same request ID was received, and if so, will ignore the second
  68634. // request. This prevents clients from accidentally creating duplicate
  68635. // commitments.
  68636. //
  68637. // The request ID must be a valid UUID with the exception that zero UUID
  68638. // is not supported (00000000-0000-0000-0000-000000000000).
  68639. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  68640. c.urlParams_.Set("requestId", requestId)
  68641. return c
  68642. }
  68643. // Fields allows partial responses to be retrieved. See
  68644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68645. // for more information.
  68646. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  68647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68648. return c
  68649. }
  68650. // Context sets the context to be used in this call's Do method. Any
  68651. // pending HTTP request will be aborted if the provided context is
  68652. // canceled.
  68653. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  68654. c.ctx_ = ctx
  68655. return c
  68656. }
  68657. // Header returns an http.Header that can be modified by the caller to
  68658. // add HTTP headers to the request.
  68659. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  68660. if c.header_ == nil {
  68661. c.header_ = make(http.Header)
  68662. }
  68663. return c.header_
  68664. }
  68665. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  68666. reqHeaders := make(http.Header)
  68667. for k, v := range c.header_ {
  68668. reqHeaders[k] = v
  68669. }
  68670. reqHeaders.Set("User-Agent", c.s.userAgent())
  68671. var body io.Reader = nil
  68672. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  68673. if err != nil {
  68674. return nil, err
  68675. }
  68676. reqHeaders.Set("Content-Type", "application/json")
  68677. c.urlParams_.Set("alt", alt)
  68678. c.urlParams_.Set("prettyPrint", "false")
  68679. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  68680. urls += "?" + c.urlParams_.Encode()
  68681. req, err := http.NewRequest("POST", urls, body)
  68682. if err != nil {
  68683. return nil, err
  68684. }
  68685. req.Header = reqHeaders
  68686. googleapi.Expand(req.URL, map[string]string{
  68687. "project": c.project,
  68688. "zone": c.zone,
  68689. "instanceGroup": c.instanceGroup,
  68690. })
  68691. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68692. }
  68693. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  68694. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68695. // status code is an error. Response headers are in either
  68696. // *Operation.ServerResponse.Header or (if a response was returned at
  68697. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68698. // to check whether the returned error was because
  68699. // http.StatusNotModified was returned.
  68700. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68701. gensupport.SetOptions(c.urlParams_, opts...)
  68702. res, err := c.doRequest("json")
  68703. if res != nil && res.StatusCode == http.StatusNotModified {
  68704. if res.Body != nil {
  68705. res.Body.Close()
  68706. }
  68707. return nil, &googleapi.Error{
  68708. Code: res.StatusCode,
  68709. Header: res.Header,
  68710. }
  68711. }
  68712. if err != nil {
  68713. return nil, err
  68714. }
  68715. defer googleapi.CloseBody(res)
  68716. if err := googleapi.CheckResponse(res); err != nil {
  68717. return nil, err
  68718. }
  68719. ret := &Operation{
  68720. ServerResponse: googleapi.ServerResponse{
  68721. Header: res.Header,
  68722. HTTPStatusCode: res.StatusCode,
  68723. },
  68724. }
  68725. target := &ret
  68726. if err := gensupport.DecodeResponse(target, res); err != nil {
  68727. return nil, err
  68728. }
  68729. return ret, nil
  68730. // {
  68731. // "description": "Sets the named ports for the specified instance group.",
  68732. // "httpMethod": "POST",
  68733. // "id": "compute.instanceGroups.setNamedPorts",
  68734. // "parameterOrder": [
  68735. // "project",
  68736. // "zone",
  68737. // "instanceGroup"
  68738. // ],
  68739. // "parameters": {
  68740. // "instanceGroup": {
  68741. // "description": "The name of the instance group where the named ports are updated.",
  68742. // "location": "path",
  68743. // "required": true,
  68744. // "type": "string"
  68745. // },
  68746. // "project": {
  68747. // "description": "Project ID for this request.",
  68748. // "location": "path",
  68749. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68750. // "required": true,
  68751. // "type": "string"
  68752. // },
  68753. // "requestId": {
  68754. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68755. // "location": "query",
  68756. // "type": "string"
  68757. // },
  68758. // "zone": {
  68759. // "description": "The name of the zone where the instance group is located.",
  68760. // "location": "path",
  68761. // "required": true,
  68762. // "type": "string"
  68763. // }
  68764. // },
  68765. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  68766. // "request": {
  68767. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  68768. // },
  68769. // "response": {
  68770. // "$ref": "Operation"
  68771. // },
  68772. // "scopes": [
  68773. // "https://www.googleapis.com/auth/cloud-platform",
  68774. // "https://www.googleapis.com/auth/compute"
  68775. // ]
  68776. // }
  68777. }
  68778. // method id "compute.instanceGroups.testIamPermissions":
  68779. type InstanceGroupsTestIamPermissionsCall struct {
  68780. s *Service
  68781. project string
  68782. zone string
  68783. resource string
  68784. testpermissionsrequest *TestPermissionsRequest
  68785. urlParams_ gensupport.URLParams
  68786. ctx_ context.Context
  68787. header_ http.Header
  68788. }
  68789. // TestIamPermissions: Returns permissions that a caller has on the
  68790. // specified resource.
  68791. func (r *InstanceGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupsTestIamPermissionsCall {
  68792. c := &InstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68793. c.project = project
  68794. c.zone = zone
  68795. c.resource = resource
  68796. c.testpermissionsrequest = testpermissionsrequest
  68797. return c
  68798. }
  68799. // Fields allows partial responses to be retrieved. See
  68800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68801. // for more information.
  68802. func (c *InstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupsTestIamPermissionsCall {
  68803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68804. return c
  68805. }
  68806. // Context sets the context to be used in this call's Do method. Any
  68807. // pending HTTP request will be aborted if the provided context is
  68808. // canceled.
  68809. func (c *InstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupsTestIamPermissionsCall {
  68810. c.ctx_ = ctx
  68811. return c
  68812. }
  68813. // Header returns an http.Header that can be modified by the caller to
  68814. // add HTTP headers to the request.
  68815. func (c *InstanceGroupsTestIamPermissionsCall) Header() http.Header {
  68816. if c.header_ == nil {
  68817. c.header_ = make(http.Header)
  68818. }
  68819. return c.header_
  68820. }
  68821. func (c *InstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  68822. reqHeaders := make(http.Header)
  68823. for k, v := range c.header_ {
  68824. reqHeaders[k] = v
  68825. }
  68826. reqHeaders.Set("User-Agent", c.s.userAgent())
  68827. var body io.Reader = nil
  68828. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  68829. if err != nil {
  68830. return nil, err
  68831. }
  68832. reqHeaders.Set("Content-Type", "application/json")
  68833. c.urlParams_.Set("alt", alt)
  68834. c.urlParams_.Set("prettyPrint", "false")
  68835. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions")
  68836. urls += "?" + c.urlParams_.Encode()
  68837. req, err := http.NewRequest("POST", urls, body)
  68838. if err != nil {
  68839. return nil, err
  68840. }
  68841. req.Header = reqHeaders
  68842. googleapi.Expand(req.URL, map[string]string{
  68843. "project": c.project,
  68844. "zone": c.zone,
  68845. "resource": c.resource,
  68846. })
  68847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68848. }
  68849. // Do executes the "compute.instanceGroups.testIamPermissions" call.
  68850. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  68851. // non-2xx status code is an error. Response headers are in either
  68852. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  68853. // returned at all) in error.(*googleapi.Error).Header. Use
  68854. // googleapi.IsNotModified to check whether the returned error was
  68855. // because http.StatusNotModified was returned.
  68856. func (c *InstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  68857. gensupport.SetOptions(c.urlParams_, opts...)
  68858. res, err := c.doRequest("json")
  68859. if res != nil && res.StatusCode == http.StatusNotModified {
  68860. if res.Body != nil {
  68861. res.Body.Close()
  68862. }
  68863. return nil, &googleapi.Error{
  68864. Code: res.StatusCode,
  68865. Header: res.Header,
  68866. }
  68867. }
  68868. if err != nil {
  68869. return nil, err
  68870. }
  68871. defer googleapi.CloseBody(res)
  68872. if err := googleapi.CheckResponse(res); err != nil {
  68873. return nil, err
  68874. }
  68875. ret := &TestPermissionsResponse{
  68876. ServerResponse: googleapi.ServerResponse{
  68877. Header: res.Header,
  68878. HTTPStatusCode: res.StatusCode,
  68879. },
  68880. }
  68881. target := &ret
  68882. if err := gensupport.DecodeResponse(target, res); err != nil {
  68883. return nil, err
  68884. }
  68885. return ret, nil
  68886. // {
  68887. // "description": "Returns permissions that a caller has on the specified resource.",
  68888. // "httpMethod": "POST",
  68889. // "id": "compute.instanceGroups.testIamPermissions",
  68890. // "parameterOrder": [
  68891. // "project",
  68892. // "zone",
  68893. // "resource"
  68894. // ],
  68895. // "parameters": {
  68896. // "project": {
  68897. // "description": "Project ID for this request.",
  68898. // "location": "path",
  68899. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68900. // "required": true,
  68901. // "type": "string"
  68902. // },
  68903. // "resource": {
  68904. // "description": "Name or id of the resource for this request.",
  68905. // "location": "path",
  68906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68907. // "required": true,
  68908. // "type": "string"
  68909. // },
  68910. // "zone": {
  68911. // "description": "The name of the zone for this request.",
  68912. // "location": "path",
  68913. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68914. // "required": true,
  68915. // "type": "string"
  68916. // }
  68917. // },
  68918. // "path": "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions",
  68919. // "request": {
  68920. // "$ref": "TestPermissionsRequest"
  68921. // },
  68922. // "response": {
  68923. // "$ref": "TestPermissionsResponse"
  68924. // },
  68925. // "scopes": [
  68926. // "https://www.googleapis.com/auth/cloud-platform",
  68927. // "https://www.googleapis.com/auth/compute",
  68928. // "https://www.googleapis.com/auth/compute.readonly"
  68929. // ]
  68930. // }
  68931. }
  68932. // method id "compute.instanceTemplates.delete":
  68933. type InstanceTemplatesDeleteCall struct {
  68934. s *Service
  68935. project string
  68936. instanceTemplate string
  68937. urlParams_ gensupport.URLParams
  68938. ctx_ context.Context
  68939. header_ http.Header
  68940. }
  68941. // Delete: Deletes the specified instance template. Deleting an instance
  68942. // template is permanent and cannot be undone. It is not possible to
  68943. // delete templates that are already in use by a managed instance group.
  68944. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  68945. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  68946. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68947. c.project = project
  68948. c.instanceTemplate = instanceTemplate
  68949. return c
  68950. }
  68951. // RequestId sets the optional parameter "requestId": An optional
  68952. // request ID to identify requests. Specify a unique request ID so that
  68953. // if you must retry your request, the server will know to ignore the
  68954. // request if it has already been completed.
  68955. //
  68956. // For example, consider a situation where you make an initial request
  68957. // and the request times out. If you make the request again with the
  68958. // same request ID, the server can check if original operation with the
  68959. // same request ID was received, and if so, will ignore the second
  68960. // request. This prevents clients from accidentally creating duplicate
  68961. // commitments.
  68962. //
  68963. // The request ID must be a valid UUID with the exception that zero UUID
  68964. // is not supported (00000000-0000-0000-0000-000000000000).
  68965. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  68966. c.urlParams_.Set("requestId", requestId)
  68967. return c
  68968. }
  68969. // Fields allows partial responses to be retrieved. See
  68970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68971. // for more information.
  68972. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  68973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68974. return c
  68975. }
  68976. // Context sets the context to be used in this call's Do method. Any
  68977. // pending HTTP request will be aborted if the provided context is
  68978. // canceled.
  68979. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  68980. c.ctx_ = ctx
  68981. return c
  68982. }
  68983. // Header returns an http.Header that can be modified by the caller to
  68984. // add HTTP headers to the request.
  68985. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  68986. if c.header_ == nil {
  68987. c.header_ = make(http.Header)
  68988. }
  68989. return c.header_
  68990. }
  68991. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  68992. reqHeaders := make(http.Header)
  68993. for k, v := range c.header_ {
  68994. reqHeaders[k] = v
  68995. }
  68996. reqHeaders.Set("User-Agent", c.s.userAgent())
  68997. var body io.Reader = nil
  68998. c.urlParams_.Set("alt", alt)
  68999. c.urlParams_.Set("prettyPrint", "false")
  69000. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  69001. urls += "?" + c.urlParams_.Encode()
  69002. req, err := http.NewRequest("DELETE", urls, body)
  69003. if err != nil {
  69004. return nil, err
  69005. }
  69006. req.Header = reqHeaders
  69007. googleapi.Expand(req.URL, map[string]string{
  69008. "project": c.project,
  69009. "instanceTemplate": c.instanceTemplate,
  69010. })
  69011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69012. }
  69013. // Do executes the "compute.instanceTemplates.delete" call.
  69014. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69015. // status code is an error. Response headers are in either
  69016. // *Operation.ServerResponse.Header or (if a response was returned at
  69017. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69018. // to check whether the returned error was because
  69019. // http.StatusNotModified was returned.
  69020. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69021. gensupport.SetOptions(c.urlParams_, opts...)
  69022. res, err := c.doRequest("json")
  69023. if res != nil && res.StatusCode == http.StatusNotModified {
  69024. if res.Body != nil {
  69025. res.Body.Close()
  69026. }
  69027. return nil, &googleapi.Error{
  69028. Code: res.StatusCode,
  69029. Header: res.Header,
  69030. }
  69031. }
  69032. if err != nil {
  69033. return nil, err
  69034. }
  69035. defer googleapi.CloseBody(res)
  69036. if err := googleapi.CheckResponse(res); err != nil {
  69037. return nil, err
  69038. }
  69039. ret := &Operation{
  69040. ServerResponse: googleapi.ServerResponse{
  69041. Header: res.Header,
  69042. HTTPStatusCode: res.StatusCode,
  69043. },
  69044. }
  69045. target := &ret
  69046. if err := gensupport.DecodeResponse(target, res); err != nil {
  69047. return nil, err
  69048. }
  69049. return ret, nil
  69050. // {
  69051. // "description": "Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.",
  69052. // "httpMethod": "DELETE",
  69053. // "id": "compute.instanceTemplates.delete",
  69054. // "parameterOrder": [
  69055. // "project",
  69056. // "instanceTemplate"
  69057. // ],
  69058. // "parameters": {
  69059. // "instanceTemplate": {
  69060. // "description": "The name of the instance template to delete.",
  69061. // "location": "path",
  69062. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69063. // "required": true,
  69064. // "type": "string"
  69065. // },
  69066. // "project": {
  69067. // "description": "Project ID for this request.",
  69068. // "location": "path",
  69069. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69070. // "required": true,
  69071. // "type": "string"
  69072. // },
  69073. // "requestId": {
  69074. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69075. // "location": "query",
  69076. // "type": "string"
  69077. // }
  69078. // },
  69079. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  69080. // "response": {
  69081. // "$ref": "Operation"
  69082. // },
  69083. // "scopes": [
  69084. // "https://www.googleapis.com/auth/cloud-platform",
  69085. // "https://www.googleapis.com/auth/compute"
  69086. // ]
  69087. // }
  69088. }
  69089. // method id "compute.instanceTemplates.get":
  69090. type InstanceTemplatesGetCall struct {
  69091. s *Service
  69092. project string
  69093. instanceTemplate string
  69094. urlParams_ gensupport.URLParams
  69095. ifNoneMatch_ string
  69096. ctx_ context.Context
  69097. header_ http.Header
  69098. }
  69099. // Get: Returns the specified instance template. Gets a list of
  69100. // available instance templates by making a list() request.
  69101. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  69102. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  69103. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69104. c.project = project
  69105. c.instanceTemplate = instanceTemplate
  69106. return c
  69107. }
  69108. // Fields allows partial responses to be retrieved. See
  69109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69110. // for more information.
  69111. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  69112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69113. return c
  69114. }
  69115. // IfNoneMatch sets the optional parameter which makes the operation
  69116. // fail if the object's ETag matches the given value. This is useful for
  69117. // getting updates only after the object has changed since the last
  69118. // request. Use googleapi.IsNotModified to check whether the response
  69119. // error from Do is the result of In-None-Match.
  69120. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  69121. c.ifNoneMatch_ = entityTag
  69122. return c
  69123. }
  69124. // Context sets the context to be used in this call's Do method. Any
  69125. // pending HTTP request will be aborted if the provided context is
  69126. // canceled.
  69127. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  69128. c.ctx_ = ctx
  69129. return c
  69130. }
  69131. // Header returns an http.Header that can be modified by the caller to
  69132. // add HTTP headers to the request.
  69133. func (c *InstanceTemplatesGetCall) Header() http.Header {
  69134. if c.header_ == nil {
  69135. c.header_ = make(http.Header)
  69136. }
  69137. return c.header_
  69138. }
  69139. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  69140. reqHeaders := make(http.Header)
  69141. for k, v := range c.header_ {
  69142. reqHeaders[k] = v
  69143. }
  69144. reqHeaders.Set("User-Agent", c.s.userAgent())
  69145. if c.ifNoneMatch_ != "" {
  69146. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69147. }
  69148. var body io.Reader = nil
  69149. c.urlParams_.Set("alt", alt)
  69150. c.urlParams_.Set("prettyPrint", "false")
  69151. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  69152. urls += "?" + c.urlParams_.Encode()
  69153. req, err := http.NewRequest("GET", urls, body)
  69154. if err != nil {
  69155. return nil, err
  69156. }
  69157. req.Header = reqHeaders
  69158. googleapi.Expand(req.URL, map[string]string{
  69159. "project": c.project,
  69160. "instanceTemplate": c.instanceTemplate,
  69161. })
  69162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69163. }
  69164. // Do executes the "compute.instanceTemplates.get" call.
  69165. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  69166. // non-2xx status code is an error. Response headers are in either
  69167. // *InstanceTemplate.ServerResponse.Header or (if a response was
  69168. // returned at all) in error.(*googleapi.Error).Header. Use
  69169. // googleapi.IsNotModified to check whether the returned error was
  69170. // because http.StatusNotModified was returned.
  69171. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  69172. gensupport.SetOptions(c.urlParams_, opts...)
  69173. res, err := c.doRequest("json")
  69174. if res != nil && res.StatusCode == http.StatusNotModified {
  69175. if res.Body != nil {
  69176. res.Body.Close()
  69177. }
  69178. return nil, &googleapi.Error{
  69179. Code: res.StatusCode,
  69180. Header: res.Header,
  69181. }
  69182. }
  69183. if err != nil {
  69184. return nil, err
  69185. }
  69186. defer googleapi.CloseBody(res)
  69187. if err := googleapi.CheckResponse(res); err != nil {
  69188. return nil, err
  69189. }
  69190. ret := &InstanceTemplate{
  69191. ServerResponse: googleapi.ServerResponse{
  69192. Header: res.Header,
  69193. HTTPStatusCode: res.StatusCode,
  69194. },
  69195. }
  69196. target := &ret
  69197. if err := gensupport.DecodeResponse(target, res); err != nil {
  69198. return nil, err
  69199. }
  69200. return ret, nil
  69201. // {
  69202. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  69203. // "httpMethod": "GET",
  69204. // "id": "compute.instanceTemplates.get",
  69205. // "parameterOrder": [
  69206. // "project",
  69207. // "instanceTemplate"
  69208. // ],
  69209. // "parameters": {
  69210. // "instanceTemplate": {
  69211. // "description": "The name of the instance template.",
  69212. // "location": "path",
  69213. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69214. // "required": true,
  69215. // "type": "string"
  69216. // },
  69217. // "project": {
  69218. // "description": "Project ID for this request.",
  69219. // "location": "path",
  69220. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69221. // "required": true,
  69222. // "type": "string"
  69223. // }
  69224. // },
  69225. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  69226. // "response": {
  69227. // "$ref": "InstanceTemplate"
  69228. // },
  69229. // "scopes": [
  69230. // "https://www.googleapis.com/auth/cloud-platform",
  69231. // "https://www.googleapis.com/auth/compute",
  69232. // "https://www.googleapis.com/auth/compute.readonly"
  69233. // ]
  69234. // }
  69235. }
  69236. // method id "compute.instanceTemplates.getIamPolicy":
  69237. type InstanceTemplatesGetIamPolicyCall struct {
  69238. s *Service
  69239. project string
  69240. resource string
  69241. urlParams_ gensupport.URLParams
  69242. ifNoneMatch_ string
  69243. ctx_ context.Context
  69244. header_ http.Header
  69245. }
  69246. // GetIamPolicy: Gets the access control policy for a resource. May be
  69247. // empty if no such policy or resource exists.
  69248. func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall {
  69249. c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69250. c.project = project
  69251. c.resource = resource
  69252. return c
  69253. }
  69254. // Fields allows partial responses to be retrieved. See
  69255. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69256. // for more information.
  69257. func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall {
  69258. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69259. return c
  69260. }
  69261. // IfNoneMatch sets the optional parameter which makes the operation
  69262. // fail if the object's ETag matches the given value. This is useful for
  69263. // getting updates only after the object has changed since the last
  69264. // request. Use googleapi.IsNotModified to check whether the response
  69265. // error from Do is the result of In-None-Match.
  69266. func (c *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall {
  69267. c.ifNoneMatch_ = entityTag
  69268. return c
  69269. }
  69270. // Context sets the context to be used in this call's Do method. Any
  69271. // pending HTTP request will be aborted if the provided context is
  69272. // canceled.
  69273. func (c *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall {
  69274. c.ctx_ = ctx
  69275. return c
  69276. }
  69277. // Header returns an http.Header that can be modified by the caller to
  69278. // add HTTP headers to the request.
  69279. func (c *InstanceTemplatesGetIamPolicyCall) Header() http.Header {
  69280. if c.header_ == nil {
  69281. c.header_ = make(http.Header)
  69282. }
  69283. return c.header_
  69284. }
  69285. func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  69286. reqHeaders := make(http.Header)
  69287. for k, v := range c.header_ {
  69288. reqHeaders[k] = v
  69289. }
  69290. reqHeaders.Set("User-Agent", c.s.userAgent())
  69291. if c.ifNoneMatch_ != "" {
  69292. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69293. }
  69294. var body io.Reader = nil
  69295. c.urlParams_.Set("alt", alt)
  69296. c.urlParams_.Set("prettyPrint", "false")
  69297. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/getIamPolicy")
  69298. urls += "?" + c.urlParams_.Encode()
  69299. req, err := http.NewRequest("GET", urls, body)
  69300. if err != nil {
  69301. return nil, err
  69302. }
  69303. req.Header = reqHeaders
  69304. googleapi.Expand(req.URL, map[string]string{
  69305. "project": c.project,
  69306. "resource": c.resource,
  69307. })
  69308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69309. }
  69310. // Do executes the "compute.instanceTemplates.getIamPolicy" call.
  69311. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  69312. // code is an error. Response headers are in either
  69313. // *Policy.ServerResponse.Header or (if a response was returned at all)
  69314. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  69315. // check whether the returned error was because http.StatusNotModified
  69316. // was returned.
  69317. func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  69318. gensupport.SetOptions(c.urlParams_, opts...)
  69319. res, err := c.doRequest("json")
  69320. if res != nil && res.StatusCode == http.StatusNotModified {
  69321. if res.Body != nil {
  69322. res.Body.Close()
  69323. }
  69324. return nil, &googleapi.Error{
  69325. Code: res.StatusCode,
  69326. Header: res.Header,
  69327. }
  69328. }
  69329. if err != nil {
  69330. return nil, err
  69331. }
  69332. defer googleapi.CloseBody(res)
  69333. if err := googleapi.CheckResponse(res); err != nil {
  69334. return nil, err
  69335. }
  69336. ret := &Policy{
  69337. ServerResponse: googleapi.ServerResponse{
  69338. Header: res.Header,
  69339. HTTPStatusCode: res.StatusCode,
  69340. },
  69341. }
  69342. target := &ret
  69343. if err := gensupport.DecodeResponse(target, res); err != nil {
  69344. return nil, err
  69345. }
  69346. return ret, nil
  69347. // {
  69348. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  69349. // "httpMethod": "GET",
  69350. // "id": "compute.instanceTemplates.getIamPolicy",
  69351. // "parameterOrder": [
  69352. // "project",
  69353. // "resource"
  69354. // ],
  69355. // "parameters": {
  69356. // "project": {
  69357. // "description": "Project ID for this request.",
  69358. // "location": "path",
  69359. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69360. // "required": true,
  69361. // "type": "string"
  69362. // },
  69363. // "resource": {
  69364. // "description": "Name or id of the resource for this request.",
  69365. // "location": "path",
  69366. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69367. // "required": true,
  69368. // "type": "string"
  69369. // }
  69370. // },
  69371. // "path": "{project}/global/instanceTemplates/{resource}/getIamPolicy",
  69372. // "response": {
  69373. // "$ref": "Policy"
  69374. // },
  69375. // "scopes": [
  69376. // "https://www.googleapis.com/auth/cloud-platform",
  69377. // "https://www.googleapis.com/auth/compute",
  69378. // "https://www.googleapis.com/auth/compute.readonly"
  69379. // ]
  69380. // }
  69381. }
  69382. // method id "compute.instanceTemplates.insert":
  69383. type InstanceTemplatesInsertCall struct {
  69384. s *Service
  69385. project string
  69386. instancetemplate *InstanceTemplate
  69387. urlParams_ gensupport.URLParams
  69388. ctx_ context.Context
  69389. header_ http.Header
  69390. }
  69391. // Insert: Creates an instance template in the specified project using
  69392. // the data that is included in the request. If you are creating a new
  69393. // template to update an existing instance group, your new instance
  69394. // template must use the same network or, if applicable, the same
  69395. // subnetwork as the original template.
  69396. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  69397. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  69398. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69399. c.project = project
  69400. c.instancetemplate = instancetemplate
  69401. return c
  69402. }
  69403. // RequestId sets the optional parameter "requestId": An optional
  69404. // request ID to identify requests. Specify a unique request ID so that
  69405. // if you must retry your request, the server will know to ignore the
  69406. // request if it has already been completed.
  69407. //
  69408. // For example, consider a situation where you make an initial request
  69409. // and the request times out. If you make the request again with the
  69410. // same request ID, the server can check if original operation with the
  69411. // same request ID was received, and if so, will ignore the second
  69412. // request. This prevents clients from accidentally creating duplicate
  69413. // commitments.
  69414. //
  69415. // The request ID must be a valid UUID with the exception that zero UUID
  69416. // is not supported (00000000-0000-0000-0000-000000000000).
  69417. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  69418. c.urlParams_.Set("requestId", requestId)
  69419. return c
  69420. }
  69421. // Fields allows partial responses to be retrieved. See
  69422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69423. // for more information.
  69424. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  69425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69426. return c
  69427. }
  69428. // Context sets the context to be used in this call's Do method. Any
  69429. // pending HTTP request will be aborted if the provided context is
  69430. // canceled.
  69431. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  69432. c.ctx_ = ctx
  69433. return c
  69434. }
  69435. // Header returns an http.Header that can be modified by the caller to
  69436. // add HTTP headers to the request.
  69437. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  69438. if c.header_ == nil {
  69439. c.header_ = make(http.Header)
  69440. }
  69441. return c.header_
  69442. }
  69443. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  69444. reqHeaders := make(http.Header)
  69445. for k, v := range c.header_ {
  69446. reqHeaders[k] = v
  69447. }
  69448. reqHeaders.Set("User-Agent", c.s.userAgent())
  69449. var body io.Reader = nil
  69450. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  69451. if err != nil {
  69452. return nil, err
  69453. }
  69454. reqHeaders.Set("Content-Type", "application/json")
  69455. c.urlParams_.Set("alt", alt)
  69456. c.urlParams_.Set("prettyPrint", "false")
  69457. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  69458. urls += "?" + c.urlParams_.Encode()
  69459. req, err := http.NewRequest("POST", urls, body)
  69460. if err != nil {
  69461. return nil, err
  69462. }
  69463. req.Header = reqHeaders
  69464. googleapi.Expand(req.URL, map[string]string{
  69465. "project": c.project,
  69466. })
  69467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69468. }
  69469. // Do executes the "compute.instanceTemplates.insert" call.
  69470. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69471. // status code is an error. Response headers are in either
  69472. // *Operation.ServerResponse.Header or (if a response was returned at
  69473. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69474. // to check whether the returned error was because
  69475. // http.StatusNotModified was returned.
  69476. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69477. gensupport.SetOptions(c.urlParams_, opts...)
  69478. res, err := c.doRequest("json")
  69479. if res != nil && res.StatusCode == http.StatusNotModified {
  69480. if res.Body != nil {
  69481. res.Body.Close()
  69482. }
  69483. return nil, &googleapi.Error{
  69484. Code: res.StatusCode,
  69485. Header: res.Header,
  69486. }
  69487. }
  69488. if err != nil {
  69489. return nil, err
  69490. }
  69491. defer googleapi.CloseBody(res)
  69492. if err := googleapi.CheckResponse(res); err != nil {
  69493. return nil, err
  69494. }
  69495. ret := &Operation{
  69496. ServerResponse: googleapi.ServerResponse{
  69497. Header: res.Header,
  69498. HTTPStatusCode: res.StatusCode,
  69499. },
  69500. }
  69501. target := &ret
  69502. if err := gensupport.DecodeResponse(target, res); err != nil {
  69503. return nil, err
  69504. }
  69505. return ret, nil
  69506. // {
  69507. // "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.",
  69508. // "httpMethod": "POST",
  69509. // "id": "compute.instanceTemplates.insert",
  69510. // "parameterOrder": [
  69511. // "project"
  69512. // ],
  69513. // "parameters": {
  69514. // "project": {
  69515. // "description": "Project ID for this request.",
  69516. // "location": "path",
  69517. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69518. // "required": true,
  69519. // "type": "string"
  69520. // },
  69521. // "requestId": {
  69522. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69523. // "location": "query",
  69524. // "type": "string"
  69525. // }
  69526. // },
  69527. // "path": "{project}/global/instanceTemplates",
  69528. // "request": {
  69529. // "$ref": "InstanceTemplate"
  69530. // },
  69531. // "response": {
  69532. // "$ref": "Operation"
  69533. // },
  69534. // "scopes": [
  69535. // "https://www.googleapis.com/auth/cloud-platform",
  69536. // "https://www.googleapis.com/auth/compute"
  69537. // ]
  69538. // }
  69539. }
  69540. // method id "compute.instanceTemplates.list":
  69541. type InstanceTemplatesListCall struct {
  69542. s *Service
  69543. project string
  69544. urlParams_ gensupport.URLParams
  69545. ifNoneMatch_ string
  69546. ctx_ context.Context
  69547. header_ http.Header
  69548. }
  69549. // List: Retrieves a list of instance templates that are contained
  69550. // within the specified project.
  69551. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  69552. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  69553. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69554. c.project = project
  69555. return c
  69556. }
  69557. // Filter sets the optional parameter "filter": A filter expression that
  69558. // filters resources listed in the response. The expression must specify
  69559. // the field name, a comparison operator, and the value that you want to
  69560. // use for filtering. The value must be a string, a number, or a
  69561. // boolean. The comparison operator must be either =, !=, >, or <.
  69562. //
  69563. // For example, if you are filtering Compute Engine instances, you can
  69564. // exclude instances named example-instance by specifying name !=
  69565. // example-instance.
  69566. //
  69567. // You can also filter nested fields. For example, you could specify
  69568. // scheduling.automaticRestart = false to include instances only if they
  69569. // are not scheduled for automatic restarts. You can use filtering on
  69570. // nested fields to filter based on resource labels.
  69571. //
  69572. // To filter on multiple expressions, provide each separate expression
  69573. // within parentheses. For example, (scheduling.automaticRestart = true)
  69574. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69575. // AND expression. However, you can include AND and OR expressions
  69576. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69577. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69578. // true).
  69579. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  69580. c.urlParams_.Set("filter", filter)
  69581. return c
  69582. }
  69583. // MaxResults sets the optional parameter "maxResults": The maximum
  69584. // number of results per page that should be returned. If the number of
  69585. // available results is larger than maxResults, Compute Engine returns a
  69586. // nextPageToken that can be used to get the next page of results in
  69587. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69588. // (Default: 500)
  69589. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  69590. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69591. return c
  69592. }
  69593. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  69594. // a certain order. By default, results are returned in alphanumerical
  69595. // order based on the resource name.
  69596. //
  69597. // You can also sort results in descending order based on the creation
  69598. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69599. // based on the creationTimestamp field in reverse chronological order
  69600. // (newest result first). Use this to sort resources like operations so
  69601. // that the newest operation is returned first.
  69602. //
  69603. // Currently, only sorting by name or creationTimestamp desc is
  69604. // supported.
  69605. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  69606. c.urlParams_.Set("orderBy", orderBy)
  69607. return c
  69608. }
  69609. // PageToken sets the optional parameter "pageToken": Specifies a page
  69610. // token to use. Set pageToken to the nextPageToken returned by a
  69611. // previous list request to get the next page of results.
  69612. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  69613. c.urlParams_.Set("pageToken", pageToken)
  69614. return c
  69615. }
  69616. // Fields allows partial responses to be retrieved. See
  69617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69618. // for more information.
  69619. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  69620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69621. return c
  69622. }
  69623. // IfNoneMatch sets the optional parameter which makes the operation
  69624. // fail if the object's ETag matches the given value. This is useful for
  69625. // getting updates only after the object has changed since the last
  69626. // request. Use googleapi.IsNotModified to check whether the response
  69627. // error from Do is the result of In-None-Match.
  69628. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  69629. c.ifNoneMatch_ = entityTag
  69630. return c
  69631. }
  69632. // Context sets the context to be used in this call's Do method. Any
  69633. // pending HTTP request will be aborted if the provided context is
  69634. // canceled.
  69635. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  69636. c.ctx_ = ctx
  69637. return c
  69638. }
  69639. // Header returns an http.Header that can be modified by the caller to
  69640. // add HTTP headers to the request.
  69641. func (c *InstanceTemplatesListCall) Header() http.Header {
  69642. if c.header_ == nil {
  69643. c.header_ = make(http.Header)
  69644. }
  69645. return c.header_
  69646. }
  69647. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  69648. reqHeaders := make(http.Header)
  69649. for k, v := range c.header_ {
  69650. reqHeaders[k] = v
  69651. }
  69652. reqHeaders.Set("User-Agent", c.s.userAgent())
  69653. if c.ifNoneMatch_ != "" {
  69654. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69655. }
  69656. var body io.Reader = nil
  69657. c.urlParams_.Set("alt", alt)
  69658. c.urlParams_.Set("prettyPrint", "false")
  69659. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  69660. urls += "?" + c.urlParams_.Encode()
  69661. req, err := http.NewRequest("GET", urls, body)
  69662. if err != nil {
  69663. return nil, err
  69664. }
  69665. req.Header = reqHeaders
  69666. googleapi.Expand(req.URL, map[string]string{
  69667. "project": c.project,
  69668. })
  69669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69670. }
  69671. // Do executes the "compute.instanceTemplates.list" call.
  69672. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  69673. // non-2xx status code is an error. Response headers are in either
  69674. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  69675. // returned at all) in error.(*googleapi.Error).Header. Use
  69676. // googleapi.IsNotModified to check whether the returned error was
  69677. // because http.StatusNotModified was returned.
  69678. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  69679. gensupport.SetOptions(c.urlParams_, opts...)
  69680. res, err := c.doRequest("json")
  69681. if res != nil && res.StatusCode == http.StatusNotModified {
  69682. if res.Body != nil {
  69683. res.Body.Close()
  69684. }
  69685. return nil, &googleapi.Error{
  69686. Code: res.StatusCode,
  69687. Header: res.Header,
  69688. }
  69689. }
  69690. if err != nil {
  69691. return nil, err
  69692. }
  69693. defer googleapi.CloseBody(res)
  69694. if err := googleapi.CheckResponse(res); err != nil {
  69695. return nil, err
  69696. }
  69697. ret := &InstanceTemplateList{
  69698. ServerResponse: googleapi.ServerResponse{
  69699. Header: res.Header,
  69700. HTTPStatusCode: res.StatusCode,
  69701. },
  69702. }
  69703. target := &ret
  69704. if err := gensupport.DecodeResponse(target, res); err != nil {
  69705. return nil, err
  69706. }
  69707. return ret, nil
  69708. // {
  69709. // "description": "Retrieves a list of instance templates that are contained within the specified project.",
  69710. // "httpMethod": "GET",
  69711. // "id": "compute.instanceTemplates.list",
  69712. // "parameterOrder": [
  69713. // "project"
  69714. // ],
  69715. // "parameters": {
  69716. // "filter": {
  69717. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  69718. // "location": "query",
  69719. // "type": "string"
  69720. // },
  69721. // "maxResults": {
  69722. // "default": "500",
  69723. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  69724. // "format": "uint32",
  69725. // "location": "query",
  69726. // "minimum": "0",
  69727. // "type": "integer"
  69728. // },
  69729. // "orderBy": {
  69730. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  69731. // "location": "query",
  69732. // "type": "string"
  69733. // },
  69734. // "pageToken": {
  69735. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  69736. // "location": "query",
  69737. // "type": "string"
  69738. // },
  69739. // "project": {
  69740. // "description": "Project ID for this request.",
  69741. // "location": "path",
  69742. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69743. // "required": true,
  69744. // "type": "string"
  69745. // }
  69746. // },
  69747. // "path": "{project}/global/instanceTemplates",
  69748. // "response": {
  69749. // "$ref": "InstanceTemplateList"
  69750. // },
  69751. // "scopes": [
  69752. // "https://www.googleapis.com/auth/cloud-platform",
  69753. // "https://www.googleapis.com/auth/compute",
  69754. // "https://www.googleapis.com/auth/compute.readonly"
  69755. // ]
  69756. // }
  69757. }
  69758. // Pages invokes f for each page of results.
  69759. // A non-nil error returned from f will halt the iteration.
  69760. // The provided context supersedes any context provided to the Context method.
  69761. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  69762. c.ctx_ = ctx
  69763. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69764. for {
  69765. x, err := c.Do()
  69766. if err != nil {
  69767. return err
  69768. }
  69769. if err := f(x); err != nil {
  69770. return err
  69771. }
  69772. if x.NextPageToken == "" {
  69773. return nil
  69774. }
  69775. c.PageToken(x.NextPageToken)
  69776. }
  69777. }
  69778. // method id "compute.instanceTemplates.setIamPolicy":
  69779. type InstanceTemplatesSetIamPolicyCall struct {
  69780. s *Service
  69781. project string
  69782. resource string
  69783. globalsetpolicyrequest *GlobalSetPolicyRequest
  69784. urlParams_ gensupport.URLParams
  69785. ctx_ context.Context
  69786. header_ http.Header
  69787. }
  69788. // SetIamPolicy: Sets the access control policy on the specified
  69789. // resource. Replaces any existing policy.
  69790. func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall {
  69791. c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69792. c.project = project
  69793. c.resource = resource
  69794. c.globalsetpolicyrequest = globalsetpolicyrequest
  69795. return c
  69796. }
  69797. // Fields allows partial responses to be retrieved. See
  69798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69799. // for more information.
  69800. func (c *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall {
  69801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69802. return c
  69803. }
  69804. // Context sets the context to be used in this call's Do method. Any
  69805. // pending HTTP request will be aborted if the provided context is
  69806. // canceled.
  69807. func (c *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall {
  69808. c.ctx_ = ctx
  69809. return c
  69810. }
  69811. // Header returns an http.Header that can be modified by the caller to
  69812. // add HTTP headers to the request.
  69813. func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header {
  69814. if c.header_ == nil {
  69815. c.header_ = make(http.Header)
  69816. }
  69817. return c.header_
  69818. }
  69819. func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  69820. reqHeaders := make(http.Header)
  69821. for k, v := range c.header_ {
  69822. reqHeaders[k] = v
  69823. }
  69824. reqHeaders.Set("User-Agent", c.s.userAgent())
  69825. var body io.Reader = nil
  69826. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  69827. if err != nil {
  69828. return nil, err
  69829. }
  69830. reqHeaders.Set("Content-Type", "application/json")
  69831. c.urlParams_.Set("alt", alt)
  69832. c.urlParams_.Set("prettyPrint", "false")
  69833. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/setIamPolicy")
  69834. urls += "?" + c.urlParams_.Encode()
  69835. req, err := http.NewRequest("POST", urls, body)
  69836. if err != nil {
  69837. return nil, err
  69838. }
  69839. req.Header = reqHeaders
  69840. googleapi.Expand(req.URL, map[string]string{
  69841. "project": c.project,
  69842. "resource": c.resource,
  69843. })
  69844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69845. }
  69846. // Do executes the "compute.instanceTemplates.setIamPolicy" call.
  69847. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  69848. // code is an error. Response headers are in either
  69849. // *Policy.ServerResponse.Header or (if a response was returned at all)
  69850. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  69851. // check whether the returned error was because http.StatusNotModified
  69852. // was returned.
  69853. func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  69854. gensupport.SetOptions(c.urlParams_, opts...)
  69855. res, err := c.doRequest("json")
  69856. if res != nil && res.StatusCode == http.StatusNotModified {
  69857. if res.Body != nil {
  69858. res.Body.Close()
  69859. }
  69860. return nil, &googleapi.Error{
  69861. Code: res.StatusCode,
  69862. Header: res.Header,
  69863. }
  69864. }
  69865. if err != nil {
  69866. return nil, err
  69867. }
  69868. defer googleapi.CloseBody(res)
  69869. if err := googleapi.CheckResponse(res); err != nil {
  69870. return nil, err
  69871. }
  69872. ret := &Policy{
  69873. ServerResponse: googleapi.ServerResponse{
  69874. Header: res.Header,
  69875. HTTPStatusCode: res.StatusCode,
  69876. },
  69877. }
  69878. target := &ret
  69879. if err := gensupport.DecodeResponse(target, res); err != nil {
  69880. return nil, err
  69881. }
  69882. return ret, nil
  69883. // {
  69884. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  69885. // "httpMethod": "POST",
  69886. // "id": "compute.instanceTemplates.setIamPolicy",
  69887. // "parameterOrder": [
  69888. // "project",
  69889. // "resource"
  69890. // ],
  69891. // "parameters": {
  69892. // "project": {
  69893. // "description": "Project ID for this request.",
  69894. // "location": "path",
  69895. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69896. // "required": true,
  69897. // "type": "string"
  69898. // },
  69899. // "resource": {
  69900. // "description": "Name or id of the resource for this request.",
  69901. // "location": "path",
  69902. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69903. // "required": true,
  69904. // "type": "string"
  69905. // }
  69906. // },
  69907. // "path": "{project}/global/instanceTemplates/{resource}/setIamPolicy",
  69908. // "request": {
  69909. // "$ref": "GlobalSetPolicyRequest"
  69910. // },
  69911. // "response": {
  69912. // "$ref": "Policy"
  69913. // },
  69914. // "scopes": [
  69915. // "https://www.googleapis.com/auth/cloud-platform",
  69916. // "https://www.googleapis.com/auth/compute"
  69917. // ]
  69918. // }
  69919. }
  69920. // method id "compute.instanceTemplates.testIamPermissions":
  69921. type InstanceTemplatesTestIamPermissionsCall struct {
  69922. s *Service
  69923. project string
  69924. resource string
  69925. testpermissionsrequest *TestPermissionsRequest
  69926. urlParams_ gensupport.URLParams
  69927. ctx_ context.Context
  69928. header_ http.Header
  69929. }
  69930. // TestIamPermissions: Returns permissions that a caller has on the
  69931. // specified resource.
  69932. func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
  69933. c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69934. c.project = project
  69935. c.resource = resource
  69936. c.testpermissionsrequest = testpermissionsrequest
  69937. return c
  69938. }
  69939. // Fields allows partial responses to be retrieved. See
  69940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69941. // for more information.
  69942. func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
  69943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69944. return c
  69945. }
  69946. // Context sets the context to be used in this call's Do method. Any
  69947. // pending HTTP request will be aborted if the provided context is
  69948. // canceled.
  69949. func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
  69950. c.ctx_ = ctx
  69951. return c
  69952. }
  69953. // Header returns an http.Header that can be modified by the caller to
  69954. // add HTTP headers to the request.
  69955. func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
  69956. if c.header_ == nil {
  69957. c.header_ = make(http.Header)
  69958. }
  69959. return c.header_
  69960. }
  69961. func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  69962. reqHeaders := make(http.Header)
  69963. for k, v := range c.header_ {
  69964. reqHeaders[k] = v
  69965. }
  69966. reqHeaders.Set("User-Agent", c.s.userAgent())
  69967. var body io.Reader = nil
  69968. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  69969. if err != nil {
  69970. return nil, err
  69971. }
  69972. reqHeaders.Set("Content-Type", "application/json")
  69973. c.urlParams_.Set("alt", alt)
  69974. c.urlParams_.Set("prettyPrint", "false")
  69975. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/testIamPermissions")
  69976. urls += "?" + c.urlParams_.Encode()
  69977. req, err := http.NewRequest("POST", urls, body)
  69978. if err != nil {
  69979. return nil, err
  69980. }
  69981. req.Header = reqHeaders
  69982. googleapi.Expand(req.URL, map[string]string{
  69983. "project": c.project,
  69984. "resource": c.resource,
  69985. })
  69986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69987. }
  69988. // Do executes the "compute.instanceTemplates.testIamPermissions" call.
  69989. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  69990. // non-2xx status code is an error. Response headers are in either
  69991. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  69992. // returned at all) in error.(*googleapi.Error).Header. Use
  69993. // googleapi.IsNotModified to check whether the returned error was
  69994. // because http.StatusNotModified was returned.
  69995. func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  69996. gensupport.SetOptions(c.urlParams_, opts...)
  69997. res, err := c.doRequest("json")
  69998. if res != nil && res.StatusCode == http.StatusNotModified {
  69999. if res.Body != nil {
  70000. res.Body.Close()
  70001. }
  70002. return nil, &googleapi.Error{
  70003. Code: res.StatusCode,
  70004. Header: res.Header,
  70005. }
  70006. }
  70007. if err != nil {
  70008. return nil, err
  70009. }
  70010. defer googleapi.CloseBody(res)
  70011. if err := googleapi.CheckResponse(res); err != nil {
  70012. return nil, err
  70013. }
  70014. ret := &TestPermissionsResponse{
  70015. ServerResponse: googleapi.ServerResponse{
  70016. Header: res.Header,
  70017. HTTPStatusCode: res.StatusCode,
  70018. },
  70019. }
  70020. target := &ret
  70021. if err := gensupport.DecodeResponse(target, res); err != nil {
  70022. return nil, err
  70023. }
  70024. return ret, nil
  70025. // {
  70026. // "description": "Returns permissions that a caller has on the specified resource.",
  70027. // "httpMethod": "POST",
  70028. // "id": "compute.instanceTemplates.testIamPermissions",
  70029. // "parameterOrder": [
  70030. // "project",
  70031. // "resource"
  70032. // ],
  70033. // "parameters": {
  70034. // "project": {
  70035. // "description": "Project ID for this request.",
  70036. // "location": "path",
  70037. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70038. // "required": true,
  70039. // "type": "string"
  70040. // },
  70041. // "resource": {
  70042. // "description": "Name or id of the resource for this request.",
  70043. // "location": "path",
  70044. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70045. // "required": true,
  70046. // "type": "string"
  70047. // }
  70048. // },
  70049. // "path": "{project}/global/instanceTemplates/{resource}/testIamPermissions",
  70050. // "request": {
  70051. // "$ref": "TestPermissionsRequest"
  70052. // },
  70053. // "response": {
  70054. // "$ref": "TestPermissionsResponse"
  70055. // },
  70056. // "scopes": [
  70057. // "https://www.googleapis.com/auth/cloud-platform",
  70058. // "https://www.googleapis.com/auth/compute",
  70059. // "https://www.googleapis.com/auth/compute.readonly"
  70060. // ]
  70061. // }
  70062. }
  70063. // method id "compute.instances.addAccessConfig":
  70064. type InstancesAddAccessConfigCall struct {
  70065. s *Service
  70066. project string
  70067. zone string
  70068. instance string
  70069. accessconfig *AccessConfig
  70070. urlParams_ gensupport.URLParams
  70071. ctx_ context.Context
  70072. header_ http.Header
  70073. }
  70074. // AddAccessConfig: Adds an access config to an instance's network
  70075. // interface.
  70076. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  70077. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  70078. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70079. c.project = project
  70080. c.zone = zone
  70081. c.instance = instance
  70082. c.urlParams_.Set("networkInterface", networkInterface)
  70083. c.accessconfig = accessconfig
  70084. return c
  70085. }
  70086. // RequestId sets the optional parameter "requestId": An optional
  70087. // request ID to identify requests. Specify a unique request ID so that
  70088. // if you must retry your request, the server will know to ignore the
  70089. // request if it has already been completed.
  70090. //
  70091. // For example, consider a situation where you make an initial request
  70092. // and the request times out. If you make the request again with the
  70093. // same request ID, the server can check if original operation with the
  70094. // same request ID was received, and if so, will ignore the second
  70095. // request. This prevents clients from accidentally creating duplicate
  70096. // commitments.
  70097. //
  70098. // The request ID must be a valid UUID with the exception that zero UUID
  70099. // is not supported (00000000-0000-0000-0000-000000000000).
  70100. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  70101. c.urlParams_.Set("requestId", requestId)
  70102. return c
  70103. }
  70104. // Fields allows partial responses to be retrieved. See
  70105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70106. // for more information.
  70107. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  70108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70109. return c
  70110. }
  70111. // Context sets the context to be used in this call's Do method. Any
  70112. // pending HTTP request will be aborted if the provided context is
  70113. // canceled.
  70114. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  70115. c.ctx_ = ctx
  70116. return c
  70117. }
  70118. // Header returns an http.Header that can be modified by the caller to
  70119. // add HTTP headers to the request.
  70120. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  70121. if c.header_ == nil {
  70122. c.header_ = make(http.Header)
  70123. }
  70124. return c.header_
  70125. }
  70126. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  70127. reqHeaders := make(http.Header)
  70128. for k, v := range c.header_ {
  70129. reqHeaders[k] = v
  70130. }
  70131. reqHeaders.Set("User-Agent", c.s.userAgent())
  70132. var body io.Reader = nil
  70133. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  70134. if err != nil {
  70135. return nil, err
  70136. }
  70137. reqHeaders.Set("Content-Type", "application/json")
  70138. c.urlParams_.Set("alt", alt)
  70139. c.urlParams_.Set("prettyPrint", "false")
  70140. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  70141. urls += "?" + c.urlParams_.Encode()
  70142. req, err := http.NewRequest("POST", urls, body)
  70143. if err != nil {
  70144. return nil, err
  70145. }
  70146. req.Header = reqHeaders
  70147. googleapi.Expand(req.URL, map[string]string{
  70148. "project": c.project,
  70149. "zone": c.zone,
  70150. "instance": c.instance,
  70151. })
  70152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70153. }
  70154. // Do executes the "compute.instances.addAccessConfig" call.
  70155. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70156. // status code is an error. Response headers are in either
  70157. // *Operation.ServerResponse.Header or (if a response was returned at
  70158. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70159. // to check whether the returned error was because
  70160. // http.StatusNotModified was returned.
  70161. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70162. gensupport.SetOptions(c.urlParams_, opts...)
  70163. res, err := c.doRequest("json")
  70164. if res != nil && res.StatusCode == http.StatusNotModified {
  70165. if res.Body != nil {
  70166. res.Body.Close()
  70167. }
  70168. return nil, &googleapi.Error{
  70169. Code: res.StatusCode,
  70170. Header: res.Header,
  70171. }
  70172. }
  70173. if err != nil {
  70174. return nil, err
  70175. }
  70176. defer googleapi.CloseBody(res)
  70177. if err := googleapi.CheckResponse(res); err != nil {
  70178. return nil, err
  70179. }
  70180. ret := &Operation{
  70181. ServerResponse: googleapi.ServerResponse{
  70182. Header: res.Header,
  70183. HTTPStatusCode: res.StatusCode,
  70184. },
  70185. }
  70186. target := &ret
  70187. if err := gensupport.DecodeResponse(target, res); err != nil {
  70188. return nil, err
  70189. }
  70190. return ret, nil
  70191. // {
  70192. // "description": "Adds an access config to an instance's network interface.",
  70193. // "httpMethod": "POST",
  70194. // "id": "compute.instances.addAccessConfig",
  70195. // "parameterOrder": [
  70196. // "project",
  70197. // "zone",
  70198. // "instance",
  70199. // "networkInterface"
  70200. // ],
  70201. // "parameters": {
  70202. // "instance": {
  70203. // "description": "The instance name for this request.",
  70204. // "location": "path",
  70205. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70206. // "required": true,
  70207. // "type": "string"
  70208. // },
  70209. // "networkInterface": {
  70210. // "description": "The name of the network interface to add to this instance.",
  70211. // "location": "query",
  70212. // "required": true,
  70213. // "type": "string"
  70214. // },
  70215. // "project": {
  70216. // "description": "Project ID for this request.",
  70217. // "location": "path",
  70218. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70219. // "required": true,
  70220. // "type": "string"
  70221. // },
  70222. // "requestId": {
  70223. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70224. // "location": "query",
  70225. // "type": "string"
  70226. // },
  70227. // "zone": {
  70228. // "description": "The name of the zone for this request.",
  70229. // "location": "path",
  70230. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70231. // "required": true,
  70232. // "type": "string"
  70233. // }
  70234. // },
  70235. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  70236. // "request": {
  70237. // "$ref": "AccessConfig"
  70238. // },
  70239. // "response": {
  70240. // "$ref": "Operation"
  70241. // },
  70242. // "scopes": [
  70243. // "https://www.googleapis.com/auth/cloud-platform",
  70244. // "https://www.googleapis.com/auth/compute"
  70245. // ]
  70246. // }
  70247. }
  70248. // method id "compute.instances.addResourcePolicies":
  70249. type InstancesAddResourcePoliciesCall struct {
  70250. s *Service
  70251. project string
  70252. zone string
  70253. instance string
  70254. instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest
  70255. urlParams_ gensupport.URLParams
  70256. ctx_ context.Context
  70257. header_ http.Header
  70258. }
  70259. // AddResourcePolicies: Adds existing resource policies to an instance.
  70260. // You can only add one policy right now which will be applied to this
  70261. // instance for scheduling live migrations.
  70262. func (r *InstancesService) AddResourcePolicies(project string, zone string, instance string, instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest) *InstancesAddResourcePoliciesCall {
  70263. c := &InstancesAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70264. c.project = project
  70265. c.zone = zone
  70266. c.instance = instance
  70267. c.instancesaddresourcepoliciesrequest = instancesaddresourcepoliciesrequest
  70268. return c
  70269. }
  70270. // RequestId sets the optional parameter "requestId": An optional
  70271. // request ID to identify requests. Specify a unique request ID so that
  70272. // if you must retry your request, the server will know to ignore the
  70273. // request if it has already been completed.
  70274. //
  70275. // For example, consider a situation where you make an initial request
  70276. // and the request times out. If you make the request again with the
  70277. // same request ID, the server can check if original operation with the
  70278. // same request ID was received, and if so, will ignore the second
  70279. // request. This prevents clients from accidentally creating duplicate
  70280. // commitments.
  70281. //
  70282. // The request ID must be a valid UUID with the exception that zero UUID
  70283. // is not supported (00000000-0000-0000-0000-000000000000).
  70284. func (c *InstancesAddResourcePoliciesCall) RequestId(requestId string) *InstancesAddResourcePoliciesCall {
  70285. c.urlParams_.Set("requestId", requestId)
  70286. return c
  70287. }
  70288. // Fields allows partial responses to be retrieved. See
  70289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70290. // for more information.
  70291. func (c *InstancesAddResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesAddResourcePoliciesCall {
  70292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70293. return c
  70294. }
  70295. // Context sets the context to be used in this call's Do method. Any
  70296. // pending HTTP request will be aborted if the provided context is
  70297. // canceled.
  70298. func (c *InstancesAddResourcePoliciesCall) Context(ctx context.Context) *InstancesAddResourcePoliciesCall {
  70299. c.ctx_ = ctx
  70300. return c
  70301. }
  70302. // Header returns an http.Header that can be modified by the caller to
  70303. // add HTTP headers to the request.
  70304. func (c *InstancesAddResourcePoliciesCall) Header() http.Header {
  70305. if c.header_ == nil {
  70306. c.header_ = make(http.Header)
  70307. }
  70308. return c.header_
  70309. }
  70310. func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  70311. reqHeaders := make(http.Header)
  70312. for k, v := range c.header_ {
  70313. reqHeaders[k] = v
  70314. }
  70315. reqHeaders.Set("User-Agent", c.s.userAgent())
  70316. var body io.Reader = nil
  70317. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesaddresourcepoliciesrequest)
  70318. if err != nil {
  70319. return nil, err
  70320. }
  70321. reqHeaders.Set("Content-Type", "application/json")
  70322. c.urlParams_.Set("alt", alt)
  70323. c.urlParams_.Set("prettyPrint", "false")
  70324. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addResourcePolicies")
  70325. urls += "?" + c.urlParams_.Encode()
  70326. req, err := http.NewRequest("POST", urls, body)
  70327. if err != nil {
  70328. return nil, err
  70329. }
  70330. req.Header = reqHeaders
  70331. googleapi.Expand(req.URL, map[string]string{
  70332. "project": c.project,
  70333. "zone": c.zone,
  70334. "instance": c.instance,
  70335. })
  70336. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70337. }
  70338. // Do executes the "compute.instances.addResourcePolicies" call.
  70339. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70340. // status code is an error. Response headers are in either
  70341. // *Operation.ServerResponse.Header or (if a response was returned at
  70342. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70343. // to check whether the returned error was because
  70344. // http.StatusNotModified was returned.
  70345. func (c *InstancesAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70346. gensupport.SetOptions(c.urlParams_, opts...)
  70347. res, err := c.doRequest("json")
  70348. if res != nil && res.StatusCode == http.StatusNotModified {
  70349. if res.Body != nil {
  70350. res.Body.Close()
  70351. }
  70352. return nil, &googleapi.Error{
  70353. Code: res.StatusCode,
  70354. Header: res.Header,
  70355. }
  70356. }
  70357. if err != nil {
  70358. return nil, err
  70359. }
  70360. defer googleapi.CloseBody(res)
  70361. if err := googleapi.CheckResponse(res); err != nil {
  70362. return nil, err
  70363. }
  70364. ret := &Operation{
  70365. ServerResponse: googleapi.ServerResponse{
  70366. Header: res.Header,
  70367. HTTPStatusCode: res.StatusCode,
  70368. },
  70369. }
  70370. target := &ret
  70371. if err := gensupport.DecodeResponse(target, res); err != nil {
  70372. return nil, err
  70373. }
  70374. return ret, nil
  70375. // {
  70376. // "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.",
  70377. // "httpMethod": "POST",
  70378. // "id": "compute.instances.addResourcePolicies",
  70379. // "parameterOrder": [
  70380. // "project",
  70381. // "zone",
  70382. // "instance"
  70383. // ],
  70384. // "parameters": {
  70385. // "instance": {
  70386. // "description": "The instance name for this request.",
  70387. // "location": "path",
  70388. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70389. // "required": true,
  70390. // "type": "string"
  70391. // },
  70392. // "project": {
  70393. // "description": "Project ID for this request.",
  70394. // "location": "path",
  70395. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70396. // "required": true,
  70397. // "type": "string"
  70398. // },
  70399. // "requestId": {
  70400. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70401. // "location": "query",
  70402. // "type": "string"
  70403. // },
  70404. // "zone": {
  70405. // "description": "The name of the zone for this request.",
  70406. // "location": "path",
  70407. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70408. // "required": true,
  70409. // "type": "string"
  70410. // }
  70411. // },
  70412. // "path": "{project}/zones/{zone}/instances/{instance}/addResourcePolicies",
  70413. // "request": {
  70414. // "$ref": "InstancesAddResourcePoliciesRequest"
  70415. // },
  70416. // "response": {
  70417. // "$ref": "Operation"
  70418. // },
  70419. // "scopes": [
  70420. // "https://www.googleapis.com/auth/cloud-platform",
  70421. // "https://www.googleapis.com/auth/compute"
  70422. // ]
  70423. // }
  70424. }
  70425. // method id "compute.instances.aggregatedList":
  70426. type InstancesAggregatedListCall struct {
  70427. s *Service
  70428. project string
  70429. urlParams_ gensupport.URLParams
  70430. ifNoneMatch_ string
  70431. ctx_ context.Context
  70432. header_ http.Header
  70433. }
  70434. // AggregatedList: Retrieves aggregated list of all of the instances in
  70435. // your project across all regions and zones.
  70436. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  70437. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  70438. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70439. c.project = project
  70440. return c
  70441. }
  70442. // Filter sets the optional parameter "filter": A filter expression that
  70443. // filters resources listed in the response. The expression must specify
  70444. // the field name, a comparison operator, and the value that you want to
  70445. // use for filtering. The value must be a string, a number, or a
  70446. // boolean. The comparison operator must be either =, !=, >, or <.
  70447. //
  70448. // For example, if you are filtering Compute Engine instances, you can
  70449. // exclude instances named example-instance by specifying name !=
  70450. // example-instance.
  70451. //
  70452. // You can also filter nested fields. For example, you could specify
  70453. // scheduling.automaticRestart = false to include instances only if they
  70454. // are not scheduled for automatic restarts. You can use filtering on
  70455. // nested fields to filter based on resource labels.
  70456. //
  70457. // To filter on multiple expressions, provide each separate expression
  70458. // within parentheses. For example, (scheduling.automaticRestart = true)
  70459. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  70460. // AND expression. However, you can include AND and OR expressions
  70461. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  70462. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  70463. // true).
  70464. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  70465. c.urlParams_.Set("filter", filter)
  70466. return c
  70467. }
  70468. // MaxResults sets the optional parameter "maxResults": The maximum
  70469. // number of results per page that should be returned. If the number of
  70470. // available results is larger than maxResults, Compute Engine returns a
  70471. // nextPageToken that can be used to get the next page of results in
  70472. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  70473. // (Default: 500)
  70474. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  70475. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  70476. return c
  70477. }
  70478. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  70479. // a certain order. By default, results are returned in alphanumerical
  70480. // order based on the resource name.
  70481. //
  70482. // You can also sort results in descending order based on the creation
  70483. // timestamp using orderBy="creationTimestamp desc". This sorts results
  70484. // based on the creationTimestamp field in reverse chronological order
  70485. // (newest result first). Use this to sort resources like operations so
  70486. // that the newest operation is returned first.
  70487. //
  70488. // Currently, only sorting by name or creationTimestamp desc is
  70489. // supported.
  70490. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  70491. c.urlParams_.Set("orderBy", orderBy)
  70492. return c
  70493. }
  70494. // PageToken sets the optional parameter "pageToken": Specifies a page
  70495. // token to use. Set pageToken to the nextPageToken returned by a
  70496. // previous list request to get the next page of results.
  70497. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  70498. c.urlParams_.Set("pageToken", pageToken)
  70499. return c
  70500. }
  70501. // Fields allows partial responses to be retrieved. See
  70502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70503. // for more information.
  70504. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  70505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70506. return c
  70507. }
  70508. // IfNoneMatch sets the optional parameter which makes the operation
  70509. // fail if the object's ETag matches the given value. This is useful for
  70510. // getting updates only after the object has changed since the last
  70511. // request. Use googleapi.IsNotModified to check whether the response
  70512. // error from Do is the result of In-None-Match.
  70513. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  70514. c.ifNoneMatch_ = entityTag
  70515. return c
  70516. }
  70517. // Context sets the context to be used in this call's Do method. Any
  70518. // pending HTTP request will be aborted if the provided context is
  70519. // canceled.
  70520. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  70521. c.ctx_ = ctx
  70522. return c
  70523. }
  70524. // Header returns an http.Header that can be modified by the caller to
  70525. // add HTTP headers to the request.
  70526. func (c *InstancesAggregatedListCall) Header() http.Header {
  70527. if c.header_ == nil {
  70528. c.header_ = make(http.Header)
  70529. }
  70530. return c.header_
  70531. }
  70532. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  70533. reqHeaders := make(http.Header)
  70534. for k, v := range c.header_ {
  70535. reqHeaders[k] = v
  70536. }
  70537. reqHeaders.Set("User-Agent", c.s.userAgent())
  70538. if c.ifNoneMatch_ != "" {
  70539. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70540. }
  70541. var body io.Reader = nil
  70542. c.urlParams_.Set("alt", alt)
  70543. c.urlParams_.Set("prettyPrint", "false")
  70544. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  70545. urls += "?" + c.urlParams_.Encode()
  70546. req, err := http.NewRequest("GET", urls, body)
  70547. if err != nil {
  70548. return nil, err
  70549. }
  70550. req.Header = reqHeaders
  70551. googleapi.Expand(req.URL, map[string]string{
  70552. "project": c.project,
  70553. })
  70554. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70555. }
  70556. // Do executes the "compute.instances.aggregatedList" call.
  70557. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  70558. // non-2xx status code is an error. Response headers are in either
  70559. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  70560. // returned at all) in error.(*googleapi.Error).Header. Use
  70561. // googleapi.IsNotModified to check whether the returned error was
  70562. // because http.StatusNotModified was returned.
  70563. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  70564. gensupport.SetOptions(c.urlParams_, opts...)
  70565. res, err := c.doRequest("json")
  70566. if res != nil && res.StatusCode == http.StatusNotModified {
  70567. if res.Body != nil {
  70568. res.Body.Close()
  70569. }
  70570. return nil, &googleapi.Error{
  70571. Code: res.StatusCode,
  70572. Header: res.Header,
  70573. }
  70574. }
  70575. if err != nil {
  70576. return nil, err
  70577. }
  70578. defer googleapi.CloseBody(res)
  70579. if err := googleapi.CheckResponse(res); err != nil {
  70580. return nil, err
  70581. }
  70582. ret := &InstanceAggregatedList{
  70583. ServerResponse: googleapi.ServerResponse{
  70584. Header: res.Header,
  70585. HTTPStatusCode: res.StatusCode,
  70586. },
  70587. }
  70588. target := &ret
  70589. if err := gensupport.DecodeResponse(target, res); err != nil {
  70590. return nil, err
  70591. }
  70592. return ret, nil
  70593. // {
  70594. // "description": "Retrieves aggregated list of all of the instances in your project across all regions and zones.",
  70595. // "httpMethod": "GET",
  70596. // "id": "compute.instances.aggregatedList",
  70597. // "parameterOrder": [
  70598. // "project"
  70599. // ],
  70600. // "parameters": {
  70601. // "filter": {
  70602. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  70603. // "location": "query",
  70604. // "type": "string"
  70605. // },
  70606. // "maxResults": {
  70607. // "default": "500",
  70608. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  70609. // "format": "uint32",
  70610. // "location": "query",
  70611. // "minimum": "0",
  70612. // "type": "integer"
  70613. // },
  70614. // "orderBy": {
  70615. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  70616. // "location": "query",
  70617. // "type": "string"
  70618. // },
  70619. // "pageToken": {
  70620. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  70621. // "location": "query",
  70622. // "type": "string"
  70623. // },
  70624. // "project": {
  70625. // "description": "Project ID for this request.",
  70626. // "location": "path",
  70627. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70628. // "required": true,
  70629. // "type": "string"
  70630. // }
  70631. // },
  70632. // "path": "{project}/aggregated/instances",
  70633. // "response": {
  70634. // "$ref": "InstanceAggregatedList"
  70635. // },
  70636. // "scopes": [
  70637. // "https://www.googleapis.com/auth/cloud-platform",
  70638. // "https://www.googleapis.com/auth/compute",
  70639. // "https://www.googleapis.com/auth/compute.readonly"
  70640. // ]
  70641. // }
  70642. }
  70643. // Pages invokes f for each page of results.
  70644. // A non-nil error returned from f will halt the iteration.
  70645. // The provided context supersedes any context provided to the Context method.
  70646. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  70647. c.ctx_ = ctx
  70648. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  70649. for {
  70650. x, err := c.Do()
  70651. if err != nil {
  70652. return err
  70653. }
  70654. if err := f(x); err != nil {
  70655. return err
  70656. }
  70657. if x.NextPageToken == "" {
  70658. return nil
  70659. }
  70660. c.PageToken(x.NextPageToken)
  70661. }
  70662. }
  70663. // method id "compute.instances.attachDisk":
  70664. type InstancesAttachDiskCall struct {
  70665. s *Service
  70666. project string
  70667. zone string
  70668. instance string
  70669. attacheddisk *AttachedDisk
  70670. urlParams_ gensupport.URLParams
  70671. ctx_ context.Context
  70672. header_ http.Header
  70673. }
  70674. // AttachDisk: Attaches an existing Disk resource to an instance. You
  70675. // must first create the disk before you can attach it. It is not
  70676. // possible to create and attach a disk at the same time. For more
  70677. // information, read Adding a persistent disk to your instance.
  70678. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  70679. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  70680. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70681. c.project = project
  70682. c.zone = zone
  70683. c.instance = instance
  70684. c.attacheddisk = attacheddisk
  70685. return c
  70686. }
  70687. // ForceAttach sets the optional parameter "forceAttach": Whether to
  70688. // force attach the disk even if it's currently attached to another
  70689. // instance.
  70690. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  70691. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  70692. return c
  70693. }
  70694. // RequestId sets the optional parameter "requestId": An optional
  70695. // request ID to identify requests. Specify a unique request ID so that
  70696. // if you must retry your request, the server will know to ignore the
  70697. // request if it has already been completed.
  70698. //
  70699. // For example, consider a situation where you make an initial request
  70700. // and the request times out. If you make the request again with the
  70701. // same request ID, the server can check if original operation with the
  70702. // same request ID was received, and if so, will ignore the second
  70703. // request. This prevents clients from accidentally creating duplicate
  70704. // commitments.
  70705. //
  70706. // The request ID must be a valid UUID with the exception that zero UUID
  70707. // is not supported (00000000-0000-0000-0000-000000000000).
  70708. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  70709. c.urlParams_.Set("requestId", requestId)
  70710. return c
  70711. }
  70712. // Fields allows partial responses to be retrieved. See
  70713. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70714. // for more information.
  70715. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  70716. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70717. return c
  70718. }
  70719. // Context sets the context to be used in this call's Do method. Any
  70720. // pending HTTP request will be aborted if the provided context is
  70721. // canceled.
  70722. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  70723. c.ctx_ = ctx
  70724. return c
  70725. }
  70726. // Header returns an http.Header that can be modified by the caller to
  70727. // add HTTP headers to the request.
  70728. func (c *InstancesAttachDiskCall) Header() http.Header {
  70729. if c.header_ == nil {
  70730. c.header_ = make(http.Header)
  70731. }
  70732. return c.header_
  70733. }
  70734. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  70735. reqHeaders := make(http.Header)
  70736. for k, v := range c.header_ {
  70737. reqHeaders[k] = v
  70738. }
  70739. reqHeaders.Set("User-Agent", c.s.userAgent())
  70740. var body io.Reader = nil
  70741. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  70742. if err != nil {
  70743. return nil, err
  70744. }
  70745. reqHeaders.Set("Content-Type", "application/json")
  70746. c.urlParams_.Set("alt", alt)
  70747. c.urlParams_.Set("prettyPrint", "false")
  70748. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  70749. urls += "?" + c.urlParams_.Encode()
  70750. req, err := http.NewRequest("POST", urls, body)
  70751. if err != nil {
  70752. return nil, err
  70753. }
  70754. req.Header = reqHeaders
  70755. googleapi.Expand(req.URL, map[string]string{
  70756. "project": c.project,
  70757. "zone": c.zone,
  70758. "instance": c.instance,
  70759. })
  70760. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70761. }
  70762. // Do executes the "compute.instances.attachDisk" call.
  70763. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70764. // status code is an error. Response headers are in either
  70765. // *Operation.ServerResponse.Header or (if a response was returned at
  70766. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70767. // to check whether the returned error was because
  70768. // http.StatusNotModified was returned.
  70769. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70770. gensupport.SetOptions(c.urlParams_, opts...)
  70771. res, err := c.doRequest("json")
  70772. if res != nil && res.StatusCode == http.StatusNotModified {
  70773. if res.Body != nil {
  70774. res.Body.Close()
  70775. }
  70776. return nil, &googleapi.Error{
  70777. Code: res.StatusCode,
  70778. Header: res.Header,
  70779. }
  70780. }
  70781. if err != nil {
  70782. return nil, err
  70783. }
  70784. defer googleapi.CloseBody(res)
  70785. if err := googleapi.CheckResponse(res); err != nil {
  70786. return nil, err
  70787. }
  70788. ret := &Operation{
  70789. ServerResponse: googleapi.ServerResponse{
  70790. Header: res.Header,
  70791. HTTPStatusCode: res.StatusCode,
  70792. },
  70793. }
  70794. target := &ret
  70795. if err := gensupport.DecodeResponse(target, res); err != nil {
  70796. return nil, err
  70797. }
  70798. return ret, nil
  70799. // {
  70800. // "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.",
  70801. // "httpMethod": "POST",
  70802. // "id": "compute.instances.attachDisk",
  70803. // "parameterOrder": [
  70804. // "project",
  70805. // "zone",
  70806. // "instance"
  70807. // ],
  70808. // "parameters": {
  70809. // "forceAttach": {
  70810. // "description": "Whether to force attach the disk even if it's currently attached to another instance.",
  70811. // "location": "query",
  70812. // "type": "boolean"
  70813. // },
  70814. // "instance": {
  70815. // "description": "The instance name for this request.",
  70816. // "location": "path",
  70817. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70818. // "required": true,
  70819. // "type": "string"
  70820. // },
  70821. // "project": {
  70822. // "description": "Project ID for this request.",
  70823. // "location": "path",
  70824. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70825. // "required": true,
  70826. // "type": "string"
  70827. // },
  70828. // "requestId": {
  70829. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70830. // "location": "query",
  70831. // "type": "string"
  70832. // },
  70833. // "zone": {
  70834. // "description": "The name of the zone for this request.",
  70835. // "location": "path",
  70836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70837. // "required": true,
  70838. // "type": "string"
  70839. // }
  70840. // },
  70841. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  70842. // "request": {
  70843. // "$ref": "AttachedDisk"
  70844. // },
  70845. // "response": {
  70846. // "$ref": "Operation"
  70847. // },
  70848. // "scopes": [
  70849. // "https://www.googleapis.com/auth/cloud-platform",
  70850. // "https://www.googleapis.com/auth/compute"
  70851. // ]
  70852. // }
  70853. }
  70854. // method id "compute.instances.delete":
  70855. type InstancesDeleteCall struct {
  70856. s *Service
  70857. project string
  70858. zone string
  70859. instance string
  70860. urlParams_ gensupport.URLParams
  70861. ctx_ context.Context
  70862. header_ http.Header
  70863. }
  70864. // Delete: Deletes the specified Instance resource. For more
  70865. // information, see Stopping or Deleting an Instance.
  70866. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  70867. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  70868. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70869. c.project = project
  70870. c.zone = zone
  70871. c.instance = instance
  70872. return c
  70873. }
  70874. // RequestId sets the optional parameter "requestId": An optional
  70875. // request ID to identify requests. Specify a unique request ID so that
  70876. // if you must retry your request, the server will know to ignore the
  70877. // request if it has already been completed.
  70878. //
  70879. // For example, consider a situation where you make an initial request
  70880. // and the request times out. If you make the request again with the
  70881. // same request ID, the server can check if original operation with the
  70882. // same request ID was received, and if so, will ignore the second
  70883. // request. This prevents clients from accidentally creating duplicate
  70884. // commitments.
  70885. //
  70886. // The request ID must be a valid UUID with the exception that zero UUID
  70887. // is not supported (00000000-0000-0000-0000-000000000000).
  70888. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  70889. c.urlParams_.Set("requestId", requestId)
  70890. return c
  70891. }
  70892. // Fields allows partial responses to be retrieved. See
  70893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70894. // for more information.
  70895. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  70896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70897. return c
  70898. }
  70899. // Context sets the context to be used in this call's Do method. Any
  70900. // pending HTTP request will be aborted if the provided context is
  70901. // canceled.
  70902. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  70903. c.ctx_ = ctx
  70904. return c
  70905. }
  70906. // Header returns an http.Header that can be modified by the caller to
  70907. // add HTTP headers to the request.
  70908. func (c *InstancesDeleteCall) Header() http.Header {
  70909. if c.header_ == nil {
  70910. c.header_ = make(http.Header)
  70911. }
  70912. return c.header_
  70913. }
  70914. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  70915. reqHeaders := make(http.Header)
  70916. for k, v := range c.header_ {
  70917. reqHeaders[k] = v
  70918. }
  70919. reqHeaders.Set("User-Agent", c.s.userAgent())
  70920. var body io.Reader = nil
  70921. c.urlParams_.Set("alt", alt)
  70922. c.urlParams_.Set("prettyPrint", "false")
  70923. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  70924. urls += "?" + c.urlParams_.Encode()
  70925. req, err := http.NewRequest("DELETE", urls, body)
  70926. if err != nil {
  70927. return nil, err
  70928. }
  70929. req.Header = reqHeaders
  70930. googleapi.Expand(req.URL, map[string]string{
  70931. "project": c.project,
  70932. "zone": c.zone,
  70933. "instance": c.instance,
  70934. })
  70935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70936. }
  70937. // Do executes the "compute.instances.delete" call.
  70938. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70939. // status code is an error. Response headers are in either
  70940. // *Operation.ServerResponse.Header or (if a response was returned at
  70941. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70942. // to check whether the returned error was because
  70943. // http.StatusNotModified was returned.
  70944. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70945. gensupport.SetOptions(c.urlParams_, opts...)
  70946. res, err := c.doRequest("json")
  70947. if res != nil && res.StatusCode == http.StatusNotModified {
  70948. if res.Body != nil {
  70949. res.Body.Close()
  70950. }
  70951. return nil, &googleapi.Error{
  70952. Code: res.StatusCode,
  70953. Header: res.Header,
  70954. }
  70955. }
  70956. if err != nil {
  70957. return nil, err
  70958. }
  70959. defer googleapi.CloseBody(res)
  70960. if err := googleapi.CheckResponse(res); err != nil {
  70961. return nil, err
  70962. }
  70963. ret := &Operation{
  70964. ServerResponse: googleapi.ServerResponse{
  70965. Header: res.Header,
  70966. HTTPStatusCode: res.StatusCode,
  70967. },
  70968. }
  70969. target := &ret
  70970. if err := gensupport.DecodeResponse(target, res); err != nil {
  70971. return nil, err
  70972. }
  70973. return ret, nil
  70974. // {
  70975. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  70976. // "httpMethod": "DELETE",
  70977. // "id": "compute.instances.delete",
  70978. // "parameterOrder": [
  70979. // "project",
  70980. // "zone",
  70981. // "instance"
  70982. // ],
  70983. // "parameters": {
  70984. // "instance": {
  70985. // "description": "Name of the instance resource to delete.",
  70986. // "location": "path",
  70987. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70988. // "required": true,
  70989. // "type": "string"
  70990. // },
  70991. // "project": {
  70992. // "description": "Project ID for this request.",
  70993. // "location": "path",
  70994. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70995. // "required": true,
  70996. // "type": "string"
  70997. // },
  70998. // "requestId": {
  70999. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71000. // "location": "query",
  71001. // "type": "string"
  71002. // },
  71003. // "zone": {
  71004. // "description": "The name of the zone for this request.",
  71005. // "location": "path",
  71006. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71007. // "required": true,
  71008. // "type": "string"
  71009. // }
  71010. // },
  71011. // "path": "{project}/zones/{zone}/instances/{instance}",
  71012. // "response": {
  71013. // "$ref": "Operation"
  71014. // },
  71015. // "scopes": [
  71016. // "https://www.googleapis.com/auth/cloud-platform",
  71017. // "https://www.googleapis.com/auth/compute"
  71018. // ]
  71019. // }
  71020. }
  71021. // method id "compute.instances.deleteAccessConfig":
  71022. type InstancesDeleteAccessConfigCall struct {
  71023. s *Service
  71024. project string
  71025. zone string
  71026. instance string
  71027. urlParams_ gensupport.URLParams
  71028. ctx_ context.Context
  71029. header_ http.Header
  71030. }
  71031. // DeleteAccessConfig: Deletes an access config from an instance's
  71032. // network interface.
  71033. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  71034. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  71035. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71036. c.project = project
  71037. c.zone = zone
  71038. c.instance = instance
  71039. c.urlParams_.Set("accessConfig", accessConfig)
  71040. c.urlParams_.Set("networkInterface", networkInterface)
  71041. return c
  71042. }
  71043. // RequestId sets the optional parameter "requestId": An optional
  71044. // request ID to identify requests. Specify a unique request ID so that
  71045. // if you must retry your request, the server will know to ignore the
  71046. // request if it has already been completed.
  71047. //
  71048. // For example, consider a situation where you make an initial request
  71049. // and the request times out. If you make the request again with the
  71050. // same request ID, the server can check if original operation with the
  71051. // same request ID was received, and if so, will ignore the second
  71052. // request. This prevents clients from accidentally creating duplicate
  71053. // commitments.
  71054. //
  71055. // The request ID must be a valid UUID with the exception that zero UUID
  71056. // is not supported (00000000-0000-0000-0000-000000000000).
  71057. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  71058. c.urlParams_.Set("requestId", requestId)
  71059. return c
  71060. }
  71061. // Fields allows partial responses to be retrieved. See
  71062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71063. // for more information.
  71064. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  71065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71066. return c
  71067. }
  71068. // Context sets the context to be used in this call's Do method. Any
  71069. // pending HTTP request will be aborted if the provided context is
  71070. // canceled.
  71071. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  71072. c.ctx_ = ctx
  71073. return c
  71074. }
  71075. // Header returns an http.Header that can be modified by the caller to
  71076. // add HTTP headers to the request.
  71077. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  71078. if c.header_ == nil {
  71079. c.header_ = make(http.Header)
  71080. }
  71081. return c.header_
  71082. }
  71083. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  71084. reqHeaders := make(http.Header)
  71085. for k, v := range c.header_ {
  71086. reqHeaders[k] = v
  71087. }
  71088. reqHeaders.Set("User-Agent", c.s.userAgent())
  71089. var body io.Reader = nil
  71090. c.urlParams_.Set("alt", alt)
  71091. c.urlParams_.Set("prettyPrint", "false")
  71092. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  71093. urls += "?" + c.urlParams_.Encode()
  71094. req, err := http.NewRequest("POST", urls, body)
  71095. if err != nil {
  71096. return nil, err
  71097. }
  71098. req.Header = reqHeaders
  71099. googleapi.Expand(req.URL, map[string]string{
  71100. "project": c.project,
  71101. "zone": c.zone,
  71102. "instance": c.instance,
  71103. })
  71104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71105. }
  71106. // Do executes the "compute.instances.deleteAccessConfig" call.
  71107. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71108. // status code is an error. Response headers are in either
  71109. // *Operation.ServerResponse.Header or (if a response was returned at
  71110. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71111. // to check whether the returned error was because
  71112. // http.StatusNotModified was returned.
  71113. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71114. gensupport.SetOptions(c.urlParams_, opts...)
  71115. res, err := c.doRequest("json")
  71116. if res != nil && res.StatusCode == http.StatusNotModified {
  71117. if res.Body != nil {
  71118. res.Body.Close()
  71119. }
  71120. return nil, &googleapi.Error{
  71121. Code: res.StatusCode,
  71122. Header: res.Header,
  71123. }
  71124. }
  71125. if err != nil {
  71126. return nil, err
  71127. }
  71128. defer googleapi.CloseBody(res)
  71129. if err := googleapi.CheckResponse(res); err != nil {
  71130. return nil, err
  71131. }
  71132. ret := &Operation{
  71133. ServerResponse: googleapi.ServerResponse{
  71134. Header: res.Header,
  71135. HTTPStatusCode: res.StatusCode,
  71136. },
  71137. }
  71138. target := &ret
  71139. if err := gensupport.DecodeResponse(target, res); err != nil {
  71140. return nil, err
  71141. }
  71142. return ret, nil
  71143. // {
  71144. // "description": "Deletes an access config from an instance's network interface.",
  71145. // "httpMethod": "POST",
  71146. // "id": "compute.instances.deleteAccessConfig",
  71147. // "parameterOrder": [
  71148. // "project",
  71149. // "zone",
  71150. // "instance",
  71151. // "accessConfig",
  71152. // "networkInterface"
  71153. // ],
  71154. // "parameters": {
  71155. // "accessConfig": {
  71156. // "description": "The name of the access config to delete.",
  71157. // "location": "query",
  71158. // "required": true,
  71159. // "type": "string"
  71160. // },
  71161. // "instance": {
  71162. // "description": "The instance name for this request.",
  71163. // "location": "path",
  71164. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71165. // "required": true,
  71166. // "type": "string"
  71167. // },
  71168. // "networkInterface": {
  71169. // "description": "The name of the network interface.",
  71170. // "location": "query",
  71171. // "required": true,
  71172. // "type": "string"
  71173. // },
  71174. // "project": {
  71175. // "description": "Project ID for this request.",
  71176. // "location": "path",
  71177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71178. // "required": true,
  71179. // "type": "string"
  71180. // },
  71181. // "requestId": {
  71182. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71183. // "location": "query",
  71184. // "type": "string"
  71185. // },
  71186. // "zone": {
  71187. // "description": "The name of the zone for this request.",
  71188. // "location": "path",
  71189. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71190. // "required": true,
  71191. // "type": "string"
  71192. // }
  71193. // },
  71194. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  71195. // "response": {
  71196. // "$ref": "Operation"
  71197. // },
  71198. // "scopes": [
  71199. // "https://www.googleapis.com/auth/cloud-platform",
  71200. // "https://www.googleapis.com/auth/compute"
  71201. // ]
  71202. // }
  71203. }
  71204. // method id "compute.instances.detachDisk":
  71205. type InstancesDetachDiskCall struct {
  71206. s *Service
  71207. project string
  71208. zone string
  71209. instance string
  71210. urlParams_ gensupport.URLParams
  71211. ctx_ context.Context
  71212. header_ http.Header
  71213. }
  71214. // DetachDisk: Detaches a disk from an instance.
  71215. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  71216. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  71217. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71218. c.project = project
  71219. c.zone = zone
  71220. c.instance = instance
  71221. c.urlParams_.Set("deviceName", deviceName)
  71222. return c
  71223. }
  71224. // RequestId sets the optional parameter "requestId": An optional
  71225. // request ID to identify requests. Specify a unique request ID so that
  71226. // if you must retry your request, the server will know to ignore the
  71227. // request if it has already been completed.
  71228. //
  71229. // For example, consider a situation where you make an initial request
  71230. // and the request times out. If you make the request again with the
  71231. // same request ID, the server can check if original operation with the
  71232. // same request ID was received, and if so, will ignore the second
  71233. // request. This prevents clients from accidentally creating duplicate
  71234. // commitments.
  71235. //
  71236. // The request ID must be a valid UUID with the exception that zero UUID
  71237. // is not supported (00000000-0000-0000-0000-000000000000).
  71238. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  71239. c.urlParams_.Set("requestId", requestId)
  71240. return c
  71241. }
  71242. // Fields allows partial responses to be retrieved. See
  71243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71244. // for more information.
  71245. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  71246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71247. return c
  71248. }
  71249. // Context sets the context to be used in this call's Do method. Any
  71250. // pending HTTP request will be aborted if the provided context is
  71251. // canceled.
  71252. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  71253. c.ctx_ = ctx
  71254. return c
  71255. }
  71256. // Header returns an http.Header that can be modified by the caller to
  71257. // add HTTP headers to the request.
  71258. func (c *InstancesDetachDiskCall) Header() http.Header {
  71259. if c.header_ == nil {
  71260. c.header_ = make(http.Header)
  71261. }
  71262. return c.header_
  71263. }
  71264. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  71265. reqHeaders := make(http.Header)
  71266. for k, v := range c.header_ {
  71267. reqHeaders[k] = v
  71268. }
  71269. reqHeaders.Set("User-Agent", c.s.userAgent())
  71270. var body io.Reader = nil
  71271. c.urlParams_.Set("alt", alt)
  71272. c.urlParams_.Set("prettyPrint", "false")
  71273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  71274. urls += "?" + c.urlParams_.Encode()
  71275. req, err := http.NewRequest("POST", urls, body)
  71276. if err != nil {
  71277. return nil, err
  71278. }
  71279. req.Header = reqHeaders
  71280. googleapi.Expand(req.URL, map[string]string{
  71281. "project": c.project,
  71282. "zone": c.zone,
  71283. "instance": c.instance,
  71284. })
  71285. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71286. }
  71287. // Do executes the "compute.instances.detachDisk" call.
  71288. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71289. // status code is an error. Response headers are in either
  71290. // *Operation.ServerResponse.Header or (if a response was returned at
  71291. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71292. // to check whether the returned error was because
  71293. // http.StatusNotModified was returned.
  71294. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71295. gensupport.SetOptions(c.urlParams_, opts...)
  71296. res, err := c.doRequest("json")
  71297. if res != nil && res.StatusCode == http.StatusNotModified {
  71298. if res.Body != nil {
  71299. res.Body.Close()
  71300. }
  71301. return nil, &googleapi.Error{
  71302. Code: res.StatusCode,
  71303. Header: res.Header,
  71304. }
  71305. }
  71306. if err != nil {
  71307. return nil, err
  71308. }
  71309. defer googleapi.CloseBody(res)
  71310. if err := googleapi.CheckResponse(res); err != nil {
  71311. return nil, err
  71312. }
  71313. ret := &Operation{
  71314. ServerResponse: googleapi.ServerResponse{
  71315. Header: res.Header,
  71316. HTTPStatusCode: res.StatusCode,
  71317. },
  71318. }
  71319. target := &ret
  71320. if err := gensupport.DecodeResponse(target, res); err != nil {
  71321. return nil, err
  71322. }
  71323. return ret, nil
  71324. // {
  71325. // "description": "Detaches a disk from an instance.",
  71326. // "httpMethod": "POST",
  71327. // "id": "compute.instances.detachDisk",
  71328. // "parameterOrder": [
  71329. // "project",
  71330. // "zone",
  71331. // "instance",
  71332. // "deviceName"
  71333. // ],
  71334. // "parameters": {
  71335. // "deviceName": {
  71336. // "description": "The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.",
  71337. // "location": "query",
  71338. // "required": true,
  71339. // "type": "string"
  71340. // },
  71341. // "instance": {
  71342. // "description": "Instance name for this request.",
  71343. // "location": "path",
  71344. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71345. // "required": true,
  71346. // "type": "string"
  71347. // },
  71348. // "project": {
  71349. // "description": "Project ID for this request.",
  71350. // "location": "path",
  71351. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71352. // "required": true,
  71353. // "type": "string"
  71354. // },
  71355. // "requestId": {
  71356. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71357. // "location": "query",
  71358. // "type": "string"
  71359. // },
  71360. // "zone": {
  71361. // "description": "The name of the zone for this request.",
  71362. // "location": "path",
  71363. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71364. // "required": true,
  71365. // "type": "string"
  71366. // }
  71367. // },
  71368. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  71369. // "response": {
  71370. // "$ref": "Operation"
  71371. // },
  71372. // "scopes": [
  71373. // "https://www.googleapis.com/auth/cloud-platform",
  71374. // "https://www.googleapis.com/auth/compute"
  71375. // ]
  71376. // }
  71377. }
  71378. // method id "compute.instances.get":
  71379. type InstancesGetCall struct {
  71380. s *Service
  71381. project string
  71382. zone string
  71383. instance string
  71384. urlParams_ gensupport.URLParams
  71385. ifNoneMatch_ string
  71386. ctx_ context.Context
  71387. header_ http.Header
  71388. }
  71389. // Get: Returns the specified Instance resource. Gets a list of
  71390. // available instances by making a list() request.
  71391. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  71392. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  71393. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71394. c.project = project
  71395. c.zone = zone
  71396. c.instance = instance
  71397. return c
  71398. }
  71399. // Fields allows partial responses to be retrieved. See
  71400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71401. // for more information.
  71402. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  71403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71404. return c
  71405. }
  71406. // IfNoneMatch sets the optional parameter which makes the operation
  71407. // fail if the object's ETag matches the given value. This is useful for
  71408. // getting updates only after the object has changed since the last
  71409. // request. Use googleapi.IsNotModified to check whether the response
  71410. // error from Do is the result of In-None-Match.
  71411. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  71412. c.ifNoneMatch_ = entityTag
  71413. return c
  71414. }
  71415. // Context sets the context to be used in this call's Do method. Any
  71416. // pending HTTP request will be aborted if the provided context is
  71417. // canceled.
  71418. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  71419. c.ctx_ = ctx
  71420. return c
  71421. }
  71422. // Header returns an http.Header that can be modified by the caller to
  71423. // add HTTP headers to the request.
  71424. func (c *InstancesGetCall) Header() http.Header {
  71425. if c.header_ == nil {
  71426. c.header_ = make(http.Header)
  71427. }
  71428. return c.header_
  71429. }
  71430. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  71431. reqHeaders := make(http.Header)
  71432. for k, v := range c.header_ {
  71433. reqHeaders[k] = v
  71434. }
  71435. reqHeaders.Set("User-Agent", c.s.userAgent())
  71436. if c.ifNoneMatch_ != "" {
  71437. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71438. }
  71439. var body io.Reader = nil
  71440. c.urlParams_.Set("alt", alt)
  71441. c.urlParams_.Set("prettyPrint", "false")
  71442. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  71443. urls += "?" + c.urlParams_.Encode()
  71444. req, err := http.NewRequest("GET", urls, body)
  71445. if err != nil {
  71446. return nil, err
  71447. }
  71448. req.Header = reqHeaders
  71449. googleapi.Expand(req.URL, map[string]string{
  71450. "project": c.project,
  71451. "zone": c.zone,
  71452. "instance": c.instance,
  71453. })
  71454. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71455. }
  71456. // Do executes the "compute.instances.get" call.
  71457. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  71458. // code is an error. Response headers are in either
  71459. // *Instance.ServerResponse.Header or (if a response was returned at
  71460. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71461. // to check whether the returned error was because
  71462. // http.StatusNotModified was returned.
  71463. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  71464. gensupport.SetOptions(c.urlParams_, opts...)
  71465. res, err := c.doRequest("json")
  71466. if res != nil && res.StatusCode == http.StatusNotModified {
  71467. if res.Body != nil {
  71468. res.Body.Close()
  71469. }
  71470. return nil, &googleapi.Error{
  71471. Code: res.StatusCode,
  71472. Header: res.Header,
  71473. }
  71474. }
  71475. if err != nil {
  71476. return nil, err
  71477. }
  71478. defer googleapi.CloseBody(res)
  71479. if err := googleapi.CheckResponse(res); err != nil {
  71480. return nil, err
  71481. }
  71482. ret := &Instance{
  71483. ServerResponse: googleapi.ServerResponse{
  71484. Header: res.Header,
  71485. HTTPStatusCode: res.StatusCode,
  71486. },
  71487. }
  71488. target := &ret
  71489. if err := gensupport.DecodeResponse(target, res); err != nil {
  71490. return nil, err
  71491. }
  71492. return ret, nil
  71493. // {
  71494. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  71495. // "httpMethod": "GET",
  71496. // "id": "compute.instances.get",
  71497. // "parameterOrder": [
  71498. // "project",
  71499. // "zone",
  71500. // "instance"
  71501. // ],
  71502. // "parameters": {
  71503. // "instance": {
  71504. // "description": "Name of the instance resource to return.",
  71505. // "location": "path",
  71506. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71507. // "required": true,
  71508. // "type": "string"
  71509. // },
  71510. // "project": {
  71511. // "description": "Project ID for this request.",
  71512. // "location": "path",
  71513. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71514. // "required": true,
  71515. // "type": "string"
  71516. // },
  71517. // "zone": {
  71518. // "description": "The name of the zone for this request.",
  71519. // "location": "path",
  71520. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71521. // "required": true,
  71522. // "type": "string"
  71523. // }
  71524. // },
  71525. // "path": "{project}/zones/{zone}/instances/{instance}",
  71526. // "response": {
  71527. // "$ref": "Instance"
  71528. // },
  71529. // "scopes": [
  71530. // "https://www.googleapis.com/auth/cloud-platform",
  71531. // "https://www.googleapis.com/auth/compute",
  71532. // "https://www.googleapis.com/auth/compute.readonly"
  71533. // ]
  71534. // }
  71535. }
  71536. // method id "compute.instances.getEffectiveFirewalls":
  71537. type InstancesGetEffectiveFirewallsCall struct {
  71538. s *Service
  71539. project string
  71540. zone string
  71541. instance string
  71542. urlParams_ gensupport.URLParams
  71543. ifNoneMatch_ string
  71544. ctx_ context.Context
  71545. header_ http.Header
  71546. }
  71547. // GetEffectiveFirewalls: Returns effective firewalls applied to an
  71548. // interface of the instance.
  71549. func (r *InstancesService) GetEffectiveFirewalls(project string, zone string, instance string, networkInterface string) *InstancesGetEffectiveFirewallsCall {
  71550. c := &InstancesGetEffectiveFirewallsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71551. c.project = project
  71552. c.zone = zone
  71553. c.instance = instance
  71554. c.urlParams_.Set("networkInterface", networkInterface)
  71555. return c
  71556. }
  71557. // Fields allows partial responses to be retrieved. See
  71558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71559. // for more information.
  71560. func (c *InstancesGetEffectiveFirewallsCall) Fields(s ...googleapi.Field) *InstancesGetEffectiveFirewallsCall {
  71561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71562. return c
  71563. }
  71564. // IfNoneMatch sets the optional parameter which makes the operation
  71565. // fail if the object's ETag matches the given value. This is useful for
  71566. // getting updates only after the object has changed since the last
  71567. // request. Use googleapi.IsNotModified to check whether the response
  71568. // error from Do is the result of In-None-Match.
  71569. func (c *InstancesGetEffectiveFirewallsCall) IfNoneMatch(entityTag string) *InstancesGetEffectiveFirewallsCall {
  71570. c.ifNoneMatch_ = entityTag
  71571. return c
  71572. }
  71573. // Context sets the context to be used in this call's Do method. Any
  71574. // pending HTTP request will be aborted if the provided context is
  71575. // canceled.
  71576. func (c *InstancesGetEffectiveFirewallsCall) Context(ctx context.Context) *InstancesGetEffectiveFirewallsCall {
  71577. c.ctx_ = ctx
  71578. return c
  71579. }
  71580. // Header returns an http.Header that can be modified by the caller to
  71581. // add HTTP headers to the request.
  71582. func (c *InstancesGetEffectiveFirewallsCall) Header() http.Header {
  71583. if c.header_ == nil {
  71584. c.header_ = make(http.Header)
  71585. }
  71586. return c.header_
  71587. }
  71588. func (c *InstancesGetEffectiveFirewallsCall) doRequest(alt string) (*http.Response, error) {
  71589. reqHeaders := make(http.Header)
  71590. for k, v := range c.header_ {
  71591. reqHeaders[k] = v
  71592. }
  71593. reqHeaders.Set("User-Agent", c.s.userAgent())
  71594. if c.ifNoneMatch_ != "" {
  71595. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71596. }
  71597. var body io.Reader = nil
  71598. c.urlParams_.Set("alt", alt)
  71599. c.urlParams_.Set("prettyPrint", "false")
  71600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls")
  71601. urls += "?" + c.urlParams_.Encode()
  71602. req, err := http.NewRequest("GET", urls, body)
  71603. if err != nil {
  71604. return nil, err
  71605. }
  71606. req.Header = reqHeaders
  71607. googleapi.Expand(req.URL, map[string]string{
  71608. "project": c.project,
  71609. "zone": c.zone,
  71610. "instance": c.instance,
  71611. })
  71612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71613. }
  71614. // Do executes the "compute.instances.getEffectiveFirewalls" call.
  71615. // Exactly one of *InstancesGetEffectiveFirewallsResponse or error will
  71616. // be non-nil. Any non-2xx status code is an error. Response headers are
  71617. // in either
  71618. // *InstancesGetEffectiveFirewallsResponse.ServerResponse.Header or (if
  71619. // a response was returned at all) in error.(*googleapi.Error).Header.
  71620. // Use googleapi.IsNotModified to check whether the returned error was
  71621. // because http.StatusNotModified was returned.
  71622. func (c *InstancesGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*InstancesGetEffectiveFirewallsResponse, error) {
  71623. gensupport.SetOptions(c.urlParams_, opts...)
  71624. res, err := c.doRequest("json")
  71625. if res != nil && res.StatusCode == http.StatusNotModified {
  71626. if res.Body != nil {
  71627. res.Body.Close()
  71628. }
  71629. return nil, &googleapi.Error{
  71630. Code: res.StatusCode,
  71631. Header: res.Header,
  71632. }
  71633. }
  71634. if err != nil {
  71635. return nil, err
  71636. }
  71637. defer googleapi.CloseBody(res)
  71638. if err := googleapi.CheckResponse(res); err != nil {
  71639. return nil, err
  71640. }
  71641. ret := &InstancesGetEffectiveFirewallsResponse{
  71642. ServerResponse: googleapi.ServerResponse{
  71643. Header: res.Header,
  71644. HTTPStatusCode: res.StatusCode,
  71645. },
  71646. }
  71647. target := &ret
  71648. if err := gensupport.DecodeResponse(target, res); err != nil {
  71649. return nil, err
  71650. }
  71651. return ret, nil
  71652. // {
  71653. // "description": "Returns effective firewalls applied to an interface of the instance.",
  71654. // "httpMethod": "GET",
  71655. // "id": "compute.instances.getEffectiveFirewalls",
  71656. // "parameterOrder": [
  71657. // "project",
  71658. // "zone",
  71659. // "instance",
  71660. // "networkInterface"
  71661. // ],
  71662. // "parameters": {
  71663. // "instance": {
  71664. // "description": "Name of the instance scoping this request.",
  71665. // "location": "path",
  71666. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71667. // "required": true,
  71668. // "type": "string"
  71669. // },
  71670. // "networkInterface": {
  71671. // "description": "The name of the network interface to get the effective firewalls.",
  71672. // "location": "query",
  71673. // "required": true,
  71674. // "type": "string"
  71675. // },
  71676. // "project": {
  71677. // "description": "Project ID for this request.",
  71678. // "location": "path",
  71679. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71680. // "required": true,
  71681. // "type": "string"
  71682. // },
  71683. // "zone": {
  71684. // "description": "The name of the zone for this request.",
  71685. // "location": "path",
  71686. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71687. // "required": true,
  71688. // "type": "string"
  71689. // }
  71690. // },
  71691. // "path": "{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls",
  71692. // "response": {
  71693. // "$ref": "InstancesGetEffectiveFirewallsResponse"
  71694. // },
  71695. // "scopes": [
  71696. // "https://www.googleapis.com/auth/cloud-platform",
  71697. // "https://www.googleapis.com/auth/compute",
  71698. // "https://www.googleapis.com/auth/compute.readonly"
  71699. // ]
  71700. // }
  71701. }
  71702. // method id "compute.instances.getGuestAttributes":
  71703. type InstancesGetGuestAttributesCall struct {
  71704. s *Service
  71705. project string
  71706. zone string
  71707. instance string
  71708. urlParams_ gensupport.URLParams
  71709. ifNoneMatch_ string
  71710. ctx_ context.Context
  71711. header_ http.Header
  71712. }
  71713. // GetGuestAttributes: Returns the specified guest attributes entry.
  71714. func (r *InstancesService) GetGuestAttributes(project string, zone string, instance string) *InstancesGetGuestAttributesCall {
  71715. c := &InstancesGetGuestAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71716. c.project = project
  71717. c.zone = zone
  71718. c.instance = instance
  71719. return c
  71720. }
  71721. // QueryPath sets the optional parameter "queryPath": Specifies the
  71722. // guest attributes path to be queried.
  71723. func (c *InstancesGetGuestAttributesCall) QueryPath(queryPath string) *InstancesGetGuestAttributesCall {
  71724. c.urlParams_.Set("queryPath", queryPath)
  71725. return c
  71726. }
  71727. // VariableKey sets the optional parameter "variableKey": Specifies the
  71728. // key for the guest attributes entry.
  71729. func (c *InstancesGetGuestAttributesCall) VariableKey(variableKey string) *InstancesGetGuestAttributesCall {
  71730. c.urlParams_.Set("variableKey", variableKey)
  71731. return c
  71732. }
  71733. // Fields allows partial responses to be retrieved. See
  71734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71735. // for more information.
  71736. func (c *InstancesGetGuestAttributesCall) Fields(s ...googleapi.Field) *InstancesGetGuestAttributesCall {
  71737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71738. return c
  71739. }
  71740. // IfNoneMatch sets the optional parameter which makes the operation
  71741. // fail if the object's ETag matches the given value. This is useful for
  71742. // getting updates only after the object has changed since the last
  71743. // request. Use googleapi.IsNotModified to check whether the response
  71744. // error from Do is the result of In-None-Match.
  71745. func (c *InstancesGetGuestAttributesCall) IfNoneMatch(entityTag string) *InstancesGetGuestAttributesCall {
  71746. c.ifNoneMatch_ = entityTag
  71747. return c
  71748. }
  71749. // Context sets the context to be used in this call's Do method. Any
  71750. // pending HTTP request will be aborted if the provided context is
  71751. // canceled.
  71752. func (c *InstancesGetGuestAttributesCall) Context(ctx context.Context) *InstancesGetGuestAttributesCall {
  71753. c.ctx_ = ctx
  71754. return c
  71755. }
  71756. // Header returns an http.Header that can be modified by the caller to
  71757. // add HTTP headers to the request.
  71758. func (c *InstancesGetGuestAttributesCall) Header() http.Header {
  71759. if c.header_ == nil {
  71760. c.header_ = make(http.Header)
  71761. }
  71762. return c.header_
  71763. }
  71764. func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) {
  71765. reqHeaders := make(http.Header)
  71766. for k, v := range c.header_ {
  71767. reqHeaders[k] = v
  71768. }
  71769. reqHeaders.Set("User-Agent", c.s.userAgent())
  71770. if c.ifNoneMatch_ != "" {
  71771. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71772. }
  71773. var body io.Reader = nil
  71774. c.urlParams_.Set("alt", alt)
  71775. c.urlParams_.Set("prettyPrint", "false")
  71776. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getGuestAttributes")
  71777. urls += "?" + c.urlParams_.Encode()
  71778. req, err := http.NewRequest("GET", urls, body)
  71779. if err != nil {
  71780. return nil, err
  71781. }
  71782. req.Header = reqHeaders
  71783. googleapi.Expand(req.URL, map[string]string{
  71784. "project": c.project,
  71785. "zone": c.zone,
  71786. "instance": c.instance,
  71787. })
  71788. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71789. }
  71790. // Do executes the "compute.instances.getGuestAttributes" call.
  71791. // Exactly one of *GuestAttributes or error will be non-nil. Any non-2xx
  71792. // status code is an error. Response headers are in either
  71793. // *GuestAttributes.ServerResponse.Header or (if a response was returned
  71794. // at all) in error.(*googleapi.Error).Header. Use
  71795. // googleapi.IsNotModified to check whether the returned error was
  71796. // because http.StatusNotModified was returned.
  71797. func (c *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*GuestAttributes, error) {
  71798. gensupport.SetOptions(c.urlParams_, opts...)
  71799. res, err := c.doRequest("json")
  71800. if res != nil && res.StatusCode == http.StatusNotModified {
  71801. if res.Body != nil {
  71802. res.Body.Close()
  71803. }
  71804. return nil, &googleapi.Error{
  71805. Code: res.StatusCode,
  71806. Header: res.Header,
  71807. }
  71808. }
  71809. if err != nil {
  71810. return nil, err
  71811. }
  71812. defer googleapi.CloseBody(res)
  71813. if err := googleapi.CheckResponse(res); err != nil {
  71814. return nil, err
  71815. }
  71816. ret := &GuestAttributes{
  71817. ServerResponse: googleapi.ServerResponse{
  71818. Header: res.Header,
  71819. HTTPStatusCode: res.StatusCode,
  71820. },
  71821. }
  71822. target := &ret
  71823. if err := gensupport.DecodeResponse(target, res); err != nil {
  71824. return nil, err
  71825. }
  71826. return ret, nil
  71827. // {
  71828. // "description": "Returns the specified guest attributes entry.",
  71829. // "httpMethod": "GET",
  71830. // "id": "compute.instances.getGuestAttributes",
  71831. // "parameterOrder": [
  71832. // "project",
  71833. // "zone",
  71834. // "instance"
  71835. // ],
  71836. // "parameters": {
  71837. // "instance": {
  71838. // "description": "Name of the instance scoping this request.",
  71839. // "location": "path",
  71840. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71841. // "required": true,
  71842. // "type": "string"
  71843. // },
  71844. // "project": {
  71845. // "description": "Project ID for this request.",
  71846. // "location": "path",
  71847. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71848. // "required": true,
  71849. // "type": "string"
  71850. // },
  71851. // "queryPath": {
  71852. // "description": "Specifies the guest attributes path to be queried.",
  71853. // "location": "query",
  71854. // "type": "string"
  71855. // },
  71856. // "variableKey": {
  71857. // "description": "Specifies the key for the guest attributes entry.",
  71858. // "location": "query",
  71859. // "type": "string"
  71860. // },
  71861. // "zone": {
  71862. // "description": "The name of the zone for this request.",
  71863. // "location": "path",
  71864. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71865. // "required": true,
  71866. // "type": "string"
  71867. // }
  71868. // },
  71869. // "path": "{project}/zones/{zone}/instances/{instance}/getGuestAttributes",
  71870. // "response": {
  71871. // "$ref": "GuestAttributes"
  71872. // },
  71873. // "scopes": [
  71874. // "https://www.googleapis.com/auth/cloud-platform",
  71875. // "https://www.googleapis.com/auth/compute",
  71876. // "https://www.googleapis.com/auth/compute.readonly"
  71877. // ]
  71878. // }
  71879. }
  71880. // method id "compute.instances.getIamPolicy":
  71881. type InstancesGetIamPolicyCall struct {
  71882. s *Service
  71883. project string
  71884. zone string
  71885. resource string
  71886. urlParams_ gensupport.URLParams
  71887. ifNoneMatch_ string
  71888. ctx_ context.Context
  71889. header_ http.Header
  71890. }
  71891. // GetIamPolicy: Gets the access control policy for a resource. May be
  71892. // empty if no such policy or resource exists.
  71893. func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall {
  71894. c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71895. c.project = project
  71896. c.zone = zone
  71897. c.resource = resource
  71898. return c
  71899. }
  71900. // Fields allows partial responses to be retrieved. See
  71901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71902. // for more information.
  71903. func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall {
  71904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71905. return c
  71906. }
  71907. // IfNoneMatch sets the optional parameter which makes the operation
  71908. // fail if the object's ETag matches the given value. This is useful for
  71909. // getting updates only after the object has changed since the last
  71910. // request. Use googleapi.IsNotModified to check whether the response
  71911. // error from Do is the result of In-None-Match.
  71912. func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall {
  71913. c.ifNoneMatch_ = entityTag
  71914. return c
  71915. }
  71916. // Context sets the context to be used in this call's Do method. Any
  71917. // pending HTTP request will be aborted if the provided context is
  71918. // canceled.
  71919. func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall {
  71920. c.ctx_ = ctx
  71921. return c
  71922. }
  71923. // Header returns an http.Header that can be modified by the caller to
  71924. // add HTTP headers to the request.
  71925. func (c *InstancesGetIamPolicyCall) Header() http.Header {
  71926. if c.header_ == nil {
  71927. c.header_ = make(http.Header)
  71928. }
  71929. return c.header_
  71930. }
  71931. func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  71932. reqHeaders := make(http.Header)
  71933. for k, v := range c.header_ {
  71934. reqHeaders[k] = v
  71935. }
  71936. reqHeaders.Set("User-Agent", c.s.userAgent())
  71937. if c.ifNoneMatch_ != "" {
  71938. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71939. }
  71940. var body io.Reader = nil
  71941. c.urlParams_.Set("alt", alt)
  71942. c.urlParams_.Set("prettyPrint", "false")
  71943. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/getIamPolicy")
  71944. urls += "?" + c.urlParams_.Encode()
  71945. req, err := http.NewRequest("GET", urls, body)
  71946. if err != nil {
  71947. return nil, err
  71948. }
  71949. req.Header = reqHeaders
  71950. googleapi.Expand(req.URL, map[string]string{
  71951. "project": c.project,
  71952. "zone": c.zone,
  71953. "resource": c.resource,
  71954. })
  71955. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71956. }
  71957. // Do executes the "compute.instances.getIamPolicy" call.
  71958. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  71959. // code is an error. Response headers are in either
  71960. // *Policy.ServerResponse.Header or (if a response was returned at all)
  71961. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  71962. // check whether the returned error was because http.StatusNotModified
  71963. // was returned.
  71964. func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  71965. gensupport.SetOptions(c.urlParams_, opts...)
  71966. res, err := c.doRequest("json")
  71967. if res != nil && res.StatusCode == http.StatusNotModified {
  71968. if res.Body != nil {
  71969. res.Body.Close()
  71970. }
  71971. return nil, &googleapi.Error{
  71972. Code: res.StatusCode,
  71973. Header: res.Header,
  71974. }
  71975. }
  71976. if err != nil {
  71977. return nil, err
  71978. }
  71979. defer googleapi.CloseBody(res)
  71980. if err := googleapi.CheckResponse(res); err != nil {
  71981. return nil, err
  71982. }
  71983. ret := &Policy{
  71984. ServerResponse: googleapi.ServerResponse{
  71985. Header: res.Header,
  71986. HTTPStatusCode: res.StatusCode,
  71987. },
  71988. }
  71989. target := &ret
  71990. if err := gensupport.DecodeResponse(target, res); err != nil {
  71991. return nil, err
  71992. }
  71993. return ret, nil
  71994. // {
  71995. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  71996. // "httpMethod": "GET",
  71997. // "id": "compute.instances.getIamPolicy",
  71998. // "parameterOrder": [
  71999. // "project",
  72000. // "zone",
  72001. // "resource"
  72002. // ],
  72003. // "parameters": {
  72004. // "project": {
  72005. // "description": "Project ID for this request.",
  72006. // "location": "path",
  72007. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72008. // "required": true,
  72009. // "type": "string"
  72010. // },
  72011. // "resource": {
  72012. // "description": "Name or id of the resource for this request.",
  72013. // "location": "path",
  72014. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72015. // "required": true,
  72016. // "type": "string"
  72017. // },
  72018. // "zone": {
  72019. // "description": "The name of the zone for this request.",
  72020. // "location": "path",
  72021. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72022. // "required": true,
  72023. // "type": "string"
  72024. // }
  72025. // },
  72026. // "path": "{project}/zones/{zone}/instances/{resource}/getIamPolicy",
  72027. // "response": {
  72028. // "$ref": "Policy"
  72029. // },
  72030. // "scopes": [
  72031. // "https://www.googleapis.com/auth/cloud-platform",
  72032. // "https://www.googleapis.com/auth/compute",
  72033. // "https://www.googleapis.com/auth/compute.readonly"
  72034. // ]
  72035. // }
  72036. }
  72037. // method id "compute.instances.getSerialPortOutput":
  72038. type InstancesGetSerialPortOutputCall struct {
  72039. s *Service
  72040. project string
  72041. zone string
  72042. instance string
  72043. urlParams_ gensupport.URLParams
  72044. ifNoneMatch_ string
  72045. ctx_ context.Context
  72046. header_ http.Header
  72047. }
  72048. // GetSerialPortOutput: Returns the last 1 MB of serial port output from
  72049. // the specified instance.
  72050. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  72051. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  72052. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72053. c.project = project
  72054. c.zone = zone
  72055. c.instance = instance
  72056. return c
  72057. }
  72058. // Port sets the optional parameter "port": Specifies which COM or
  72059. // serial port to retrieve data from.
  72060. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  72061. c.urlParams_.Set("port", fmt.Sprint(port))
  72062. return c
  72063. }
  72064. // Start sets the optional parameter "start": Returns output starting
  72065. // from a specific byte position. Use this to page through output when
  72066. // the output is too large to return in a single request. For the
  72067. // initial request, leave this field unspecified. For subsequent calls,
  72068. // this field should be set to the next value returned in the previous
  72069. // call.
  72070. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  72071. c.urlParams_.Set("start", fmt.Sprint(start))
  72072. return c
  72073. }
  72074. // Fields allows partial responses to be retrieved. See
  72075. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72076. // for more information.
  72077. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  72078. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72079. return c
  72080. }
  72081. // IfNoneMatch sets the optional parameter which makes the operation
  72082. // fail if the object's ETag matches the given value. This is useful for
  72083. // getting updates only after the object has changed since the last
  72084. // request. Use googleapi.IsNotModified to check whether the response
  72085. // error from Do is the result of In-None-Match.
  72086. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  72087. c.ifNoneMatch_ = entityTag
  72088. return c
  72089. }
  72090. // Context sets the context to be used in this call's Do method. Any
  72091. // pending HTTP request will be aborted if the provided context is
  72092. // canceled.
  72093. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  72094. c.ctx_ = ctx
  72095. return c
  72096. }
  72097. // Header returns an http.Header that can be modified by the caller to
  72098. // add HTTP headers to the request.
  72099. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  72100. if c.header_ == nil {
  72101. c.header_ = make(http.Header)
  72102. }
  72103. return c.header_
  72104. }
  72105. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  72106. reqHeaders := make(http.Header)
  72107. for k, v := range c.header_ {
  72108. reqHeaders[k] = v
  72109. }
  72110. reqHeaders.Set("User-Agent", c.s.userAgent())
  72111. if c.ifNoneMatch_ != "" {
  72112. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72113. }
  72114. var body io.Reader = nil
  72115. c.urlParams_.Set("alt", alt)
  72116. c.urlParams_.Set("prettyPrint", "false")
  72117. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  72118. urls += "?" + c.urlParams_.Encode()
  72119. req, err := http.NewRequest("GET", urls, body)
  72120. if err != nil {
  72121. return nil, err
  72122. }
  72123. req.Header = reqHeaders
  72124. googleapi.Expand(req.URL, map[string]string{
  72125. "project": c.project,
  72126. "zone": c.zone,
  72127. "instance": c.instance,
  72128. })
  72129. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72130. }
  72131. // Do executes the "compute.instances.getSerialPortOutput" call.
  72132. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  72133. // non-2xx status code is an error. Response headers are in either
  72134. // *SerialPortOutput.ServerResponse.Header or (if a response was
  72135. // returned at all) in error.(*googleapi.Error).Header. Use
  72136. // googleapi.IsNotModified to check whether the returned error was
  72137. // because http.StatusNotModified was returned.
  72138. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  72139. gensupport.SetOptions(c.urlParams_, opts...)
  72140. res, err := c.doRequest("json")
  72141. if res != nil && res.StatusCode == http.StatusNotModified {
  72142. if res.Body != nil {
  72143. res.Body.Close()
  72144. }
  72145. return nil, &googleapi.Error{
  72146. Code: res.StatusCode,
  72147. Header: res.Header,
  72148. }
  72149. }
  72150. if err != nil {
  72151. return nil, err
  72152. }
  72153. defer googleapi.CloseBody(res)
  72154. if err := googleapi.CheckResponse(res); err != nil {
  72155. return nil, err
  72156. }
  72157. ret := &SerialPortOutput{
  72158. ServerResponse: googleapi.ServerResponse{
  72159. Header: res.Header,
  72160. HTTPStatusCode: res.StatusCode,
  72161. },
  72162. }
  72163. target := &ret
  72164. if err := gensupport.DecodeResponse(target, res); err != nil {
  72165. return nil, err
  72166. }
  72167. return ret, nil
  72168. // {
  72169. // "description": "Returns the last 1 MB of serial port output from the specified instance.",
  72170. // "httpMethod": "GET",
  72171. // "id": "compute.instances.getSerialPortOutput",
  72172. // "parameterOrder": [
  72173. // "project",
  72174. // "zone",
  72175. // "instance"
  72176. // ],
  72177. // "parameters": {
  72178. // "instance": {
  72179. // "description": "Name of the instance scoping this request.",
  72180. // "location": "path",
  72181. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72182. // "required": true,
  72183. // "type": "string"
  72184. // },
  72185. // "port": {
  72186. // "default": "1",
  72187. // "description": "Specifies which COM or serial port to retrieve data from.",
  72188. // "format": "int32",
  72189. // "location": "query",
  72190. // "maximum": "4",
  72191. // "minimum": "1",
  72192. // "type": "integer"
  72193. // },
  72194. // "project": {
  72195. // "description": "Project ID for this request.",
  72196. // "location": "path",
  72197. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72198. // "required": true,
  72199. // "type": "string"
  72200. // },
  72201. // "start": {
  72202. // "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.",
  72203. // "format": "int64",
  72204. // "location": "query",
  72205. // "type": "string"
  72206. // },
  72207. // "zone": {
  72208. // "description": "The name of the zone for this request.",
  72209. // "location": "path",
  72210. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72211. // "required": true,
  72212. // "type": "string"
  72213. // }
  72214. // },
  72215. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  72216. // "response": {
  72217. // "$ref": "SerialPortOutput"
  72218. // },
  72219. // "scopes": [
  72220. // "https://www.googleapis.com/auth/cloud-platform",
  72221. // "https://www.googleapis.com/auth/compute",
  72222. // "https://www.googleapis.com/auth/compute.readonly"
  72223. // ]
  72224. // }
  72225. }
  72226. // method id "compute.instances.getShieldedInstanceIdentity":
  72227. type InstancesGetShieldedInstanceIdentityCall struct {
  72228. s *Service
  72229. project string
  72230. zone string
  72231. instance string
  72232. urlParams_ gensupport.URLParams
  72233. ifNoneMatch_ string
  72234. ctx_ context.Context
  72235. header_ http.Header
  72236. }
  72237. // GetShieldedInstanceIdentity: Returns the Shielded Instance Identity
  72238. // of an instance
  72239. func (r *InstancesService) GetShieldedInstanceIdentity(project string, zone string, instance string) *InstancesGetShieldedInstanceIdentityCall {
  72240. c := &InstancesGetShieldedInstanceIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72241. c.project = project
  72242. c.zone = zone
  72243. c.instance = instance
  72244. return c
  72245. }
  72246. // Fields allows partial responses to be retrieved. See
  72247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72248. // for more information.
  72249. func (c *InstancesGetShieldedInstanceIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedInstanceIdentityCall {
  72250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72251. return c
  72252. }
  72253. // IfNoneMatch sets the optional parameter which makes the operation
  72254. // fail if the object's ETag matches the given value. This is useful for
  72255. // getting updates only after the object has changed since the last
  72256. // request. Use googleapi.IsNotModified to check whether the response
  72257. // error from Do is the result of In-None-Match.
  72258. func (c *InstancesGetShieldedInstanceIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedInstanceIdentityCall {
  72259. c.ifNoneMatch_ = entityTag
  72260. return c
  72261. }
  72262. // Context sets the context to be used in this call's Do method. Any
  72263. // pending HTTP request will be aborted if the provided context is
  72264. // canceled.
  72265. func (c *InstancesGetShieldedInstanceIdentityCall) Context(ctx context.Context) *InstancesGetShieldedInstanceIdentityCall {
  72266. c.ctx_ = ctx
  72267. return c
  72268. }
  72269. // Header returns an http.Header that can be modified by the caller to
  72270. // add HTTP headers to the request.
  72271. func (c *InstancesGetShieldedInstanceIdentityCall) Header() http.Header {
  72272. if c.header_ == nil {
  72273. c.header_ = make(http.Header)
  72274. }
  72275. return c.header_
  72276. }
  72277. func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http.Response, error) {
  72278. reqHeaders := make(http.Header)
  72279. for k, v := range c.header_ {
  72280. reqHeaders[k] = v
  72281. }
  72282. reqHeaders.Set("User-Agent", c.s.userAgent())
  72283. if c.ifNoneMatch_ != "" {
  72284. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72285. }
  72286. var body io.Reader = nil
  72287. c.urlParams_.Set("alt", alt)
  72288. c.urlParams_.Set("prettyPrint", "false")
  72289. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity")
  72290. urls += "?" + c.urlParams_.Encode()
  72291. req, err := http.NewRequest("GET", urls, body)
  72292. if err != nil {
  72293. return nil, err
  72294. }
  72295. req.Header = reqHeaders
  72296. googleapi.Expand(req.URL, map[string]string{
  72297. "project": c.project,
  72298. "zone": c.zone,
  72299. "instance": c.instance,
  72300. })
  72301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72302. }
  72303. // Do executes the "compute.instances.getShieldedInstanceIdentity" call.
  72304. // Exactly one of *ShieldedInstanceIdentity or error will be non-nil.
  72305. // Any non-2xx status code is an error. Response headers are in either
  72306. // *ShieldedInstanceIdentity.ServerResponse.Header or (if a response was
  72307. // returned at all) in error.(*googleapi.Error).Header. Use
  72308. // googleapi.IsNotModified to check whether the returned error was
  72309. // because http.StatusNotModified was returned.
  72310. func (c *InstancesGetShieldedInstanceIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedInstanceIdentity, error) {
  72311. gensupport.SetOptions(c.urlParams_, opts...)
  72312. res, err := c.doRequest("json")
  72313. if res != nil && res.StatusCode == http.StatusNotModified {
  72314. if res.Body != nil {
  72315. res.Body.Close()
  72316. }
  72317. return nil, &googleapi.Error{
  72318. Code: res.StatusCode,
  72319. Header: res.Header,
  72320. }
  72321. }
  72322. if err != nil {
  72323. return nil, err
  72324. }
  72325. defer googleapi.CloseBody(res)
  72326. if err := googleapi.CheckResponse(res); err != nil {
  72327. return nil, err
  72328. }
  72329. ret := &ShieldedInstanceIdentity{
  72330. ServerResponse: googleapi.ServerResponse{
  72331. Header: res.Header,
  72332. HTTPStatusCode: res.StatusCode,
  72333. },
  72334. }
  72335. target := &ret
  72336. if err := gensupport.DecodeResponse(target, res); err != nil {
  72337. return nil, err
  72338. }
  72339. return ret, nil
  72340. // {
  72341. // "description": "Returns the Shielded Instance Identity of an instance",
  72342. // "httpMethod": "GET",
  72343. // "id": "compute.instances.getShieldedInstanceIdentity",
  72344. // "parameterOrder": [
  72345. // "project",
  72346. // "zone",
  72347. // "instance"
  72348. // ],
  72349. // "parameters": {
  72350. // "instance": {
  72351. // "description": "Name or id of the instance scoping this request.",
  72352. // "location": "path",
  72353. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72354. // "required": true,
  72355. // "type": "string"
  72356. // },
  72357. // "project": {
  72358. // "description": "Project ID for this request.",
  72359. // "location": "path",
  72360. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72361. // "required": true,
  72362. // "type": "string"
  72363. // },
  72364. // "zone": {
  72365. // "description": "The name of the zone for this request.",
  72366. // "location": "path",
  72367. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72368. // "required": true,
  72369. // "type": "string"
  72370. // }
  72371. // },
  72372. // "path": "{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity",
  72373. // "response": {
  72374. // "$ref": "ShieldedInstanceIdentity"
  72375. // },
  72376. // "scopes": [
  72377. // "https://www.googleapis.com/auth/cloud-platform",
  72378. // "https://www.googleapis.com/auth/compute",
  72379. // "https://www.googleapis.com/auth/compute.readonly"
  72380. // ]
  72381. // }
  72382. }
  72383. // method id "compute.instances.getShieldedVmIdentity":
  72384. type InstancesGetShieldedVmIdentityCall struct {
  72385. s *Service
  72386. project string
  72387. zone string
  72388. instance string
  72389. urlParams_ gensupport.URLParams
  72390. ifNoneMatch_ string
  72391. ctx_ context.Context
  72392. header_ http.Header
  72393. }
  72394. // GetShieldedVmIdentity: Returns the Shielded VM Identity of an
  72395. // instance
  72396. func (r *InstancesService) GetShieldedVmIdentity(project string, zone string, instance string) *InstancesGetShieldedVmIdentityCall {
  72397. c := &InstancesGetShieldedVmIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72398. c.project = project
  72399. c.zone = zone
  72400. c.instance = instance
  72401. return c
  72402. }
  72403. // Fields allows partial responses to be retrieved. See
  72404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72405. // for more information.
  72406. func (c *InstancesGetShieldedVmIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedVmIdentityCall {
  72407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72408. return c
  72409. }
  72410. // IfNoneMatch sets the optional parameter which makes the operation
  72411. // fail if the object's ETag matches the given value. This is useful for
  72412. // getting updates only after the object has changed since the last
  72413. // request. Use googleapi.IsNotModified to check whether the response
  72414. // error from Do is the result of In-None-Match.
  72415. func (c *InstancesGetShieldedVmIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedVmIdentityCall {
  72416. c.ifNoneMatch_ = entityTag
  72417. return c
  72418. }
  72419. // Context sets the context to be used in this call's Do method. Any
  72420. // pending HTTP request will be aborted if the provided context is
  72421. // canceled.
  72422. func (c *InstancesGetShieldedVmIdentityCall) Context(ctx context.Context) *InstancesGetShieldedVmIdentityCall {
  72423. c.ctx_ = ctx
  72424. return c
  72425. }
  72426. // Header returns an http.Header that can be modified by the caller to
  72427. // add HTTP headers to the request.
  72428. func (c *InstancesGetShieldedVmIdentityCall) Header() http.Header {
  72429. if c.header_ == nil {
  72430. c.header_ = make(http.Header)
  72431. }
  72432. return c.header_
  72433. }
  72434. func (c *InstancesGetShieldedVmIdentityCall) doRequest(alt string) (*http.Response, error) {
  72435. reqHeaders := make(http.Header)
  72436. for k, v := range c.header_ {
  72437. reqHeaders[k] = v
  72438. }
  72439. reqHeaders.Set("User-Agent", c.s.userAgent())
  72440. if c.ifNoneMatch_ != "" {
  72441. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72442. }
  72443. var body io.Reader = nil
  72444. c.urlParams_.Set("alt", alt)
  72445. c.urlParams_.Set("prettyPrint", "false")
  72446. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity")
  72447. urls += "?" + c.urlParams_.Encode()
  72448. req, err := http.NewRequest("GET", urls, body)
  72449. if err != nil {
  72450. return nil, err
  72451. }
  72452. req.Header = reqHeaders
  72453. googleapi.Expand(req.URL, map[string]string{
  72454. "project": c.project,
  72455. "zone": c.zone,
  72456. "instance": c.instance,
  72457. })
  72458. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72459. }
  72460. // Do executes the "compute.instances.getShieldedVmIdentity" call.
  72461. // Exactly one of *ShieldedVmIdentity or error will be non-nil. Any
  72462. // non-2xx status code is an error. Response headers are in either
  72463. // *ShieldedVmIdentity.ServerResponse.Header or (if a response was
  72464. // returned at all) in error.(*googleapi.Error).Header. Use
  72465. // googleapi.IsNotModified to check whether the returned error was
  72466. // because http.StatusNotModified was returned.
  72467. func (c *InstancesGetShieldedVmIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedVmIdentity, error) {
  72468. gensupport.SetOptions(c.urlParams_, opts...)
  72469. res, err := c.doRequest("json")
  72470. if res != nil && res.StatusCode == http.StatusNotModified {
  72471. if res.Body != nil {
  72472. res.Body.Close()
  72473. }
  72474. return nil, &googleapi.Error{
  72475. Code: res.StatusCode,
  72476. Header: res.Header,
  72477. }
  72478. }
  72479. if err != nil {
  72480. return nil, err
  72481. }
  72482. defer googleapi.CloseBody(res)
  72483. if err := googleapi.CheckResponse(res); err != nil {
  72484. return nil, err
  72485. }
  72486. ret := &ShieldedVmIdentity{
  72487. ServerResponse: googleapi.ServerResponse{
  72488. Header: res.Header,
  72489. HTTPStatusCode: res.StatusCode,
  72490. },
  72491. }
  72492. target := &ret
  72493. if err := gensupport.DecodeResponse(target, res); err != nil {
  72494. return nil, err
  72495. }
  72496. return ret, nil
  72497. // {
  72498. // "description": "Returns the Shielded VM Identity of an instance",
  72499. // "httpMethod": "GET",
  72500. // "id": "compute.instances.getShieldedVmIdentity",
  72501. // "parameterOrder": [
  72502. // "project",
  72503. // "zone",
  72504. // "instance"
  72505. // ],
  72506. // "parameters": {
  72507. // "instance": {
  72508. // "description": "Name of the instance scoping this request.",
  72509. // "location": "path",
  72510. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72511. // "required": true,
  72512. // "type": "string"
  72513. // },
  72514. // "project": {
  72515. // "description": "Project ID for this request.",
  72516. // "location": "path",
  72517. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72518. // "required": true,
  72519. // "type": "string"
  72520. // },
  72521. // "zone": {
  72522. // "description": "The name of the zone for this request.",
  72523. // "location": "path",
  72524. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72525. // "required": true,
  72526. // "type": "string"
  72527. // }
  72528. // },
  72529. // "path": "{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity",
  72530. // "response": {
  72531. // "$ref": "ShieldedVmIdentity"
  72532. // },
  72533. // "scopes": [
  72534. // "https://www.googleapis.com/auth/cloud-platform",
  72535. // "https://www.googleapis.com/auth/compute",
  72536. // "https://www.googleapis.com/auth/compute.readonly"
  72537. // ]
  72538. // }
  72539. }
  72540. // method id "compute.instances.insert":
  72541. type InstancesInsertCall struct {
  72542. s *Service
  72543. project string
  72544. zone string
  72545. instance *Instance
  72546. urlParams_ gensupport.URLParams
  72547. ctx_ context.Context
  72548. header_ http.Header
  72549. }
  72550. // Insert: Creates an instance resource in the specified project using
  72551. // the data included in the request.
  72552. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  72553. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  72554. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72555. c.project = project
  72556. c.zone = zone
  72557. c.instance = instance
  72558. return c
  72559. }
  72560. // RequestId sets the optional parameter "requestId": An optional
  72561. // request ID to identify requests. Specify a unique request ID so that
  72562. // if you must retry your request, the server will know to ignore the
  72563. // request if it has already been completed.
  72564. //
  72565. // For example, consider a situation where you make an initial request
  72566. // and the request times out. If you make the request again with the
  72567. // same request ID, the server can check if original operation with the
  72568. // same request ID was received, and if so, will ignore the second
  72569. // request. This prevents clients from accidentally creating duplicate
  72570. // commitments.
  72571. //
  72572. // The request ID must be a valid UUID with the exception that zero UUID
  72573. // is not supported (00000000-0000-0000-0000-000000000000).
  72574. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  72575. c.urlParams_.Set("requestId", requestId)
  72576. return c
  72577. }
  72578. // SourceInstanceTemplate sets the optional parameter
  72579. // "sourceInstanceTemplate": Specifies instance template to create the
  72580. // instance.
  72581. //
  72582. // This field is optional. It can be a full or partial URL. For example,
  72583. // the following are all valid URLs to an instance template:
  72584. // -
  72585. // https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
  72586. // - projects/project/global/instanceTemplates/instanceTemplate
  72587. // - global/instanceTemplates/instanceTemplate
  72588. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  72589. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  72590. return c
  72591. }
  72592. // SourceMachineImage sets the optional parameter "sourceMachineImage":
  72593. // Specifies instance machine to create the instance.
  72594. //
  72595. // This field is optional. It can be a full or partial URL. For example,
  72596. // the following are all valid URLs to an instance template:
  72597. // -
  72598. // https://www.googleapis.com/compute/v1/projects/project/global/global/machineImages/machineImage
  72599. // - projects/project/global/global/machineImages/machineImage
  72600. // - global/machineImages/machineImage
  72601. func (c *InstancesInsertCall) SourceMachineImage(sourceMachineImage string) *InstancesInsertCall {
  72602. c.urlParams_.Set("sourceMachineImage", sourceMachineImage)
  72603. return c
  72604. }
  72605. // Fields allows partial responses to be retrieved. See
  72606. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72607. // for more information.
  72608. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  72609. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72610. return c
  72611. }
  72612. // Context sets the context to be used in this call's Do method. Any
  72613. // pending HTTP request will be aborted if the provided context is
  72614. // canceled.
  72615. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  72616. c.ctx_ = ctx
  72617. return c
  72618. }
  72619. // Header returns an http.Header that can be modified by the caller to
  72620. // add HTTP headers to the request.
  72621. func (c *InstancesInsertCall) Header() http.Header {
  72622. if c.header_ == nil {
  72623. c.header_ = make(http.Header)
  72624. }
  72625. return c.header_
  72626. }
  72627. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  72628. reqHeaders := make(http.Header)
  72629. for k, v := range c.header_ {
  72630. reqHeaders[k] = v
  72631. }
  72632. reqHeaders.Set("User-Agent", c.s.userAgent())
  72633. var body io.Reader = nil
  72634. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  72635. if err != nil {
  72636. return nil, err
  72637. }
  72638. reqHeaders.Set("Content-Type", "application/json")
  72639. c.urlParams_.Set("alt", alt)
  72640. c.urlParams_.Set("prettyPrint", "false")
  72641. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  72642. urls += "?" + c.urlParams_.Encode()
  72643. req, err := http.NewRequest("POST", urls, body)
  72644. if err != nil {
  72645. return nil, err
  72646. }
  72647. req.Header = reqHeaders
  72648. googleapi.Expand(req.URL, map[string]string{
  72649. "project": c.project,
  72650. "zone": c.zone,
  72651. })
  72652. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72653. }
  72654. // Do executes the "compute.instances.insert" call.
  72655. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72656. // status code is an error. Response headers are in either
  72657. // *Operation.ServerResponse.Header or (if a response was returned at
  72658. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72659. // to check whether the returned error was because
  72660. // http.StatusNotModified was returned.
  72661. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72662. gensupport.SetOptions(c.urlParams_, opts...)
  72663. res, err := c.doRequest("json")
  72664. if res != nil && res.StatusCode == http.StatusNotModified {
  72665. if res.Body != nil {
  72666. res.Body.Close()
  72667. }
  72668. return nil, &googleapi.Error{
  72669. Code: res.StatusCode,
  72670. Header: res.Header,
  72671. }
  72672. }
  72673. if err != nil {
  72674. return nil, err
  72675. }
  72676. defer googleapi.CloseBody(res)
  72677. if err := googleapi.CheckResponse(res); err != nil {
  72678. return nil, err
  72679. }
  72680. ret := &Operation{
  72681. ServerResponse: googleapi.ServerResponse{
  72682. Header: res.Header,
  72683. HTTPStatusCode: res.StatusCode,
  72684. },
  72685. }
  72686. target := &ret
  72687. if err := gensupport.DecodeResponse(target, res); err != nil {
  72688. return nil, err
  72689. }
  72690. return ret, nil
  72691. // {
  72692. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  72693. // "httpMethod": "POST",
  72694. // "id": "compute.instances.insert",
  72695. // "parameterOrder": [
  72696. // "project",
  72697. // "zone"
  72698. // ],
  72699. // "parameters": {
  72700. // "project": {
  72701. // "description": "Project ID for this request.",
  72702. // "location": "path",
  72703. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72704. // "required": true,
  72705. // "type": "string"
  72706. // },
  72707. // "requestId": {
  72708. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72709. // "location": "query",
  72710. // "type": "string"
  72711. // },
  72712. // "sourceInstanceTemplate": {
  72713. // "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",
  72714. // "location": "query",
  72715. // "type": "string"
  72716. // },
  72717. // "sourceMachineImage": {
  72718. // "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",
  72719. // "location": "query",
  72720. // "type": "string"
  72721. // },
  72722. // "zone": {
  72723. // "description": "The name of the zone for this request.",
  72724. // "location": "path",
  72725. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72726. // "required": true,
  72727. // "type": "string"
  72728. // }
  72729. // },
  72730. // "path": "{project}/zones/{zone}/instances",
  72731. // "request": {
  72732. // "$ref": "Instance"
  72733. // },
  72734. // "response": {
  72735. // "$ref": "Operation"
  72736. // },
  72737. // "scopes": [
  72738. // "https://www.googleapis.com/auth/cloud-platform",
  72739. // "https://www.googleapis.com/auth/compute"
  72740. // ]
  72741. // }
  72742. }
  72743. // method id "compute.instances.list":
  72744. type InstancesListCall struct {
  72745. s *Service
  72746. project string
  72747. zone string
  72748. urlParams_ gensupport.URLParams
  72749. ifNoneMatch_ string
  72750. ctx_ context.Context
  72751. header_ http.Header
  72752. }
  72753. // List: Retrieves the list of instances contained within the specified
  72754. // zone.
  72755. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  72756. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  72757. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72758. c.project = project
  72759. c.zone = zone
  72760. return c
  72761. }
  72762. // Filter sets the optional parameter "filter": A filter expression that
  72763. // filters resources listed in the response. The expression must specify
  72764. // the field name, a comparison operator, and the value that you want to
  72765. // use for filtering. The value must be a string, a number, or a
  72766. // boolean. The comparison operator must be either =, !=, >, or <.
  72767. //
  72768. // For example, if you are filtering Compute Engine instances, you can
  72769. // exclude instances named example-instance by specifying name !=
  72770. // example-instance.
  72771. //
  72772. // You can also filter nested fields. For example, you could specify
  72773. // scheduling.automaticRestart = false to include instances only if they
  72774. // are not scheduled for automatic restarts. You can use filtering on
  72775. // nested fields to filter based on resource labels.
  72776. //
  72777. // To filter on multiple expressions, provide each separate expression
  72778. // within parentheses. For example, (scheduling.automaticRestart = true)
  72779. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72780. // AND expression. However, you can include AND and OR expressions
  72781. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72782. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72783. // true).
  72784. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  72785. c.urlParams_.Set("filter", filter)
  72786. return c
  72787. }
  72788. // MaxResults sets the optional parameter "maxResults": The maximum
  72789. // number of results per page that should be returned. If the number of
  72790. // available results is larger than maxResults, Compute Engine returns a
  72791. // nextPageToken that can be used to get the next page of results in
  72792. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72793. // (Default: 500)
  72794. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  72795. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72796. return c
  72797. }
  72798. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72799. // a certain order. By default, results are returned in alphanumerical
  72800. // order based on the resource name.
  72801. //
  72802. // You can also sort results in descending order based on the creation
  72803. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72804. // based on the creationTimestamp field in reverse chronological order
  72805. // (newest result first). Use this to sort resources like operations so
  72806. // that the newest operation is returned first.
  72807. //
  72808. // Currently, only sorting by name or creationTimestamp desc is
  72809. // supported.
  72810. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  72811. c.urlParams_.Set("orderBy", orderBy)
  72812. return c
  72813. }
  72814. // PageToken sets the optional parameter "pageToken": Specifies a page
  72815. // token to use. Set pageToken to the nextPageToken returned by a
  72816. // previous list request to get the next page of results.
  72817. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  72818. c.urlParams_.Set("pageToken", pageToken)
  72819. return c
  72820. }
  72821. // Fields allows partial responses to be retrieved. See
  72822. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72823. // for more information.
  72824. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  72825. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72826. return c
  72827. }
  72828. // IfNoneMatch sets the optional parameter which makes the operation
  72829. // fail if the object's ETag matches the given value. This is useful for
  72830. // getting updates only after the object has changed since the last
  72831. // request. Use googleapi.IsNotModified to check whether the response
  72832. // error from Do is the result of In-None-Match.
  72833. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  72834. c.ifNoneMatch_ = entityTag
  72835. return c
  72836. }
  72837. // Context sets the context to be used in this call's Do method. Any
  72838. // pending HTTP request will be aborted if the provided context is
  72839. // canceled.
  72840. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  72841. c.ctx_ = ctx
  72842. return c
  72843. }
  72844. // Header returns an http.Header that can be modified by the caller to
  72845. // add HTTP headers to the request.
  72846. func (c *InstancesListCall) Header() http.Header {
  72847. if c.header_ == nil {
  72848. c.header_ = make(http.Header)
  72849. }
  72850. return c.header_
  72851. }
  72852. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  72853. reqHeaders := make(http.Header)
  72854. for k, v := range c.header_ {
  72855. reqHeaders[k] = v
  72856. }
  72857. reqHeaders.Set("User-Agent", c.s.userAgent())
  72858. if c.ifNoneMatch_ != "" {
  72859. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72860. }
  72861. var body io.Reader = nil
  72862. c.urlParams_.Set("alt", alt)
  72863. c.urlParams_.Set("prettyPrint", "false")
  72864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  72865. urls += "?" + c.urlParams_.Encode()
  72866. req, err := http.NewRequest("GET", urls, body)
  72867. if err != nil {
  72868. return nil, err
  72869. }
  72870. req.Header = reqHeaders
  72871. googleapi.Expand(req.URL, map[string]string{
  72872. "project": c.project,
  72873. "zone": c.zone,
  72874. })
  72875. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72876. }
  72877. // Do executes the "compute.instances.list" call.
  72878. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  72879. // status code is an error. Response headers are in either
  72880. // *InstanceList.ServerResponse.Header or (if a response was returned at
  72881. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72882. // to check whether the returned error was because
  72883. // http.StatusNotModified was returned.
  72884. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  72885. gensupport.SetOptions(c.urlParams_, opts...)
  72886. res, err := c.doRequest("json")
  72887. if res != nil && res.StatusCode == http.StatusNotModified {
  72888. if res.Body != nil {
  72889. res.Body.Close()
  72890. }
  72891. return nil, &googleapi.Error{
  72892. Code: res.StatusCode,
  72893. Header: res.Header,
  72894. }
  72895. }
  72896. if err != nil {
  72897. return nil, err
  72898. }
  72899. defer googleapi.CloseBody(res)
  72900. if err := googleapi.CheckResponse(res); err != nil {
  72901. return nil, err
  72902. }
  72903. ret := &InstanceList{
  72904. ServerResponse: googleapi.ServerResponse{
  72905. Header: res.Header,
  72906. HTTPStatusCode: res.StatusCode,
  72907. },
  72908. }
  72909. target := &ret
  72910. if err := gensupport.DecodeResponse(target, res); err != nil {
  72911. return nil, err
  72912. }
  72913. return ret, nil
  72914. // {
  72915. // "description": "Retrieves the list of instances contained within the specified zone.",
  72916. // "httpMethod": "GET",
  72917. // "id": "compute.instances.list",
  72918. // "parameterOrder": [
  72919. // "project",
  72920. // "zone"
  72921. // ],
  72922. // "parameters": {
  72923. // "filter": {
  72924. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  72925. // "location": "query",
  72926. // "type": "string"
  72927. // },
  72928. // "maxResults": {
  72929. // "default": "500",
  72930. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  72931. // "format": "uint32",
  72932. // "location": "query",
  72933. // "minimum": "0",
  72934. // "type": "integer"
  72935. // },
  72936. // "orderBy": {
  72937. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  72938. // "location": "query",
  72939. // "type": "string"
  72940. // },
  72941. // "pageToken": {
  72942. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  72943. // "location": "query",
  72944. // "type": "string"
  72945. // },
  72946. // "project": {
  72947. // "description": "Project ID for this request.",
  72948. // "location": "path",
  72949. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72950. // "required": true,
  72951. // "type": "string"
  72952. // },
  72953. // "zone": {
  72954. // "description": "The name of the zone for this request.",
  72955. // "location": "path",
  72956. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72957. // "required": true,
  72958. // "type": "string"
  72959. // }
  72960. // },
  72961. // "path": "{project}/zones/{zone}/instances",
  72962. // "response": {
  72963. // "$ref": "InstanceList"
  72964. // },
  72965. // "scopes": [
  72966. // "https://www.googleapis.com/auth/cloud-platform",
  72967. // "https://www.googleapis.com/auth/compute",
  72968. // "https://www.googleapis.com/auth/compute.readonly"
  72969. // ]
  72970. // }
  72971. }
  72972. // Pages invokes f for each page of results.
  72973. // A non-nil error returned from f will halt the iteration.
  72974. // The provided context supersedes any context provided to the Context method.
  72975. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  72976. c.ctx_ = ctx
  72977. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72978. for {
  72979. x, err := c.Do()
  72980. if err != nil {
  72981. return err
  72982. }
  72983. if err := f(x); err != nil {
  72984. return err
  72985. }
  72986. if x.NextPageToken == "" {
  72987. return nil
  72988. }
  72989. c.PageToken(x.NextPageToken)
  72990. }
  72991. }
  72992. // method id "compute.instances.listReferrers":
  72993. type InstancesListReferrersCall struct {
  72994. s *Service
  72995. project string
  72996. zone string
  72997. instance string
  72998. urlParams_ gensupport.URLParams
  72999. ifNoneMatch_ string
  73000. ctx_ context.Context
  73001. header_ http.Header
  73002. }
  73003. // ListReferrers: Retrieves the list of referrers to instances contained
  73004. // within the specified zone. For more information, read Viewing
  73005. // Referrers to VM Instances.
  73006. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  73007. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73008. c.project = project
  73009. c.zone = zone
  73010. c.instance = instance
  73011. return c
  73012. }
  73013. // Filter sets the optional parameter "filter": A filter expression that
  73014. // filters resources listed in the response. The expression must specify
  73015. // the field name, a comparison operator, and the value that you want to
  73016. // use for filtering. The value must be a string, a number, or a
  73017. // boolean. The comparison operator must be either =, !=, >, or <.
  73018. //
  73019. // For example, if you are filtering Compute Engine instances, you can
  73020. // exclude instances named example-instance by specifying name !=
  73021. // example-instance.
  73022. //
  73023. // You can also filter nested fields. For example, you could specify
  73024. // scheduling.automaticRestart = false to include instances only if they
  73025. // are not scheduled for automatic restarts. You can use filtering on
  73026. // nested fields to filter based on resource labels.
  73027. //
  73028. // To filter on multiple expressions, provide each separate expression
  73029. // within parentheses. For example, (scheduling.automaticRestart = true)
  73030. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73031. // AND expression. However, you can include AND and OR expressions
  73032. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73033. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73034. // true).
  73035. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  73036. c.urlParams_.Set("filter", filter)
  73037. return c
  73038. }
  73039. // MaxResults sets the optional parameter "maxResults": The maximum
  73040. // number of results per page that should be returned. If the number of
  73041. // available results is larger than maxResults, Compute Engine returns a
  73042. // nextPageToken that can be used to get the next page of results in
  73043. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73044. // (Default: 500)
  73045. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  73046. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73047. return c
  73048. }
  73049. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73050. // a certain order. By default, results are returned in alphanumerical
  73051. // order based on the resource name.
  73052. //
  73053. // You can also sort results in descending order based on the creation
  73054. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73055. // based on the creationTimestamp field in reverse chronological order
  73056. // (newest result first). Use this to sort resources like operations so
  73057. // that the newest operation is returned first.
  73058. //
  73059. // Currently, only sorting by name or creationTimestamp desc is
  73060. // supported.
  73061. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  73062. c.urlParams_.Set("orderBy", orderBy)
  73063. return c
  73064. }
  73065. // PageToken sets the optional parameter "pageToken": Specifies a page
  73066. // token to use. Set pageToken to the nextPageToken returned by a
  73067. // previous list request to get the next page of results.
  73068. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  73069. c.urlParams_.Set("pageToken", pageToken)
  73070. return c
  73071. }
  73072. // Fields allows partial responses to be retrieved. See
  73073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73074. // for more information.
  73075. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  73076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73077. return c
  73078. }
  73079. // IfNoneMatch sets the optional parameter which makes the operation
  73080. // fail if the object's ETag matches the given value. This is useful for
  73081. // getting updates only after the object has changed since the last
  73082. // request. Use googleapi.IsNotModified to check whether the response
  73083. // error from Do is the result of In-None-Match.
  73084. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  73085. c.ifNoneMatch_ = entityTag
  73086. return c
  73087. }
  73088. // Context sets the context to be used in this call's Do method. Any
  73089. // pending HTTP request will be aborted if the provided context is
  73090. // canceled.
  73091. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  73092. c.ctx_ = ctx
  73093. return c
  73094. }
  73095. // Header returns an http.Header that can be modified by the caller to
  73096. // add HTTP headers to the request.
  73097. func (c *InstancesListReferrersCall) Header() http.Header {
  73098. if c.header_ == nil {
  73099. c.header_ = make(http.Header)
  73100. }
  73101. return c.header_
  73102. }
  73103. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  73104. reqHeaders := make(http.Header)
  73105. for k, v := range c.header_ {
  73106. reqHeaders[k] = v
  73107. }
  73108. reqHeaders.Set("User-Agent", c.s.userAgent())
  73109. if c.ifNoneMatch_ != "" {
  73110. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73111. }
  73112. var body io.Reader = nil
  73113. c.urlParams_.Set("alt", alt)
  73114. c.urlParams_.Set("prettyPrint", "false")
  73115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  73116. urls += "?" + c.urlParams_.Encode()
  73117. req, err := http.NewRequest("GET", urls, body)
  73118. if err != nil {
  73119. return nil, err
  73120. }
  73121. req.Header = reqHeaders
  73122. googleapi.Expand(req.URL, map[string]string{
  73123. "project": c.project,
  73124. "zone": c.zone,
  73125. "instance": c.instance,
  73126. })
  73127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73128. }
  73129. // Do executes the "compute.instances.listReferrers" call.
  73130. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  73131. // non-2xx status code is an error. Response headers are in either
  73132. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  73133. // returned at all) in error.(*googleapi.Error).Header. Use
  73134. // googleapi.IsNotModified to check whether the returned error was
  73135. // because http.StatusNotModified was returned.
  73136. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  73137. gensupport.SetOptions(c.urlParams_, opts...)
  73138. res, err := c.doRequest("json")
  73139. if res != nil && res.StatusCode == http.StatusNotModified {
  73140. if res.Body != nil {
  73141. res.Body.Close()
  73142. }
  73143. return nil, &googleapi.Error{
  73144. Code: res.StatusCode,
  73145. Header: res.Header,
  73146. }
  73147. }
  73148. if err != nil {
  73149. return nil, err
  73150. }
  73151. defer googleapi.CloseBody(res)
  73152. if err := googleapi.CheckResponse(res); err != nil {
  73153. return nil, err
  73154. }
  73155. ret := &InstanceListReferrers{
  73156. ServerResponse: googleapi.ServerResponse{
  73157. Header: res.Header,
  73158. HTTPStatusCode: res.StatusCode,
  73159. },
  73160. }
  73161. target := &ret
  73162. if err := gensupport.DecodeResponse(target, res); err != nil {
  73163. return nil, err
  73164. }
  73165. return ret, nil
  73166. // {
  73167. // "description": "Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances.",
  73168. // "httpMethod": "GET",
  73169. // "id": "compute.instances.listReferrers",
  73170. // "parameterOrder": [
  73171. // "project",
  73172. // "zone",
  73173. // "instance"
  73174. // ],
  73175. // "parameters": {
  73176. // "filter": {
  73177. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  73178. // "location": "query",
  73179. // "type": "string"
  73180. // },
  73181. // "instance": {
  73182. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  73183. // "location": "path",
  73184. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73185. // "required": true,
  73186. // "type": "string"
  73187. // },
  73188. // "maxResults": {
  73189. // "default": "500",
  73190. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  73191. // "format": "uint32",
  73192. // "location": "query",
  73193. // "minimum": "0",
  73194. // "type": "integer"
  73195. // },
  73196. // "orderBy": {
  73197. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  73198. // "location": "query",
  73199. // "type": "string"
  73200. // },
  73201. // "pageToken": {
  73202. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  73203. // "location": "query",
  73204. // "type": "string"
  73205. // },
  73206. // "project": {
  73207. // "description": "Project ID for this request.",
  73208. // "location": "path",
  73209. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73210. // "required": true,
  73211. // "type": "string"
  73212. // },
  73213. // "zone": {
  73214. // "description": "The name of the zone for this request.",
  73215. // "location": "path",
  73216. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73217. // "required": true,
  73218. // "type": "string"
  73219. // }
  73220. // },
  73221. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  73222. // "response": {
  73223. // "$ref": "InstanceListReferrers"
  73224. // },
  73225. // "scopes": [
  73226. // "https://www.googleapis.com/auth/cloud-platform",
  73227. // "https://www.googleapis.com/auth/compute",
  73228. // "https://www.googleapis.com/auth/compute.readonly"
  73229. // ]
  73230. // }
  73231. }
  73232. // Pages invokes f for each page of results.
  73233. // A non-nil error returned from f will halt the iteration.
  73234. // The provided context supersedes any context provided to the Context method.
  73235. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  73236. c.ctx_ = ctx
  73237. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73238. for {
  73239. x, err := c.Do()
  73240. if err != nil {
  73241. return err
  73242. }
  73243. if err := f(x); err != nil {
  73244. return err
  73245. }
  73246. if x.NextPageToken == "" {
  73247. return nil
  73248. }
  73249. c.PageToken(x.NextPageToken)
  73250. }
  73251. }
  73252. // method id "compute.instances.removeResourcePolicies":
  73253. type InstancesRemoveResourcePoliciesCall struct {
  73254. s *Service
  73255. project string
  73256. zone string
  73257. instance string
  73258. instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest
  73259. urlParams_ gensupport.URLParams
  73260. ctx_ context.Context
  73261. header_ http.Header
  73262. }
  73263. // RemoveResourcePolicies: Removes resource policies from an instance.
  73264. func (r *InstancesService) RemoveResourcePolicies(project string, zone string, instance string, instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest) *InstancesRemoveResourcePoliciesCall {
  73265. c := &InstancesRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73266. c.project = project
  73267. c.zone = zone
  73268. c.instance = instance
  73269. c.instancesremoveresourcepoliciesrequest = instancesremoveresourcepoliciesrequest
  73270. return c
  73271. }
  73272. // RequestId sets the optional parameter "requestId": An optional
  73273. // request ID to identify requests. Specify a unique request ID so that
  73274. // if you must retry your request, the server will know to ignore the
  73275. // request if it has already been completed.
  73276. //
  73277. // For example, consider a situation where you make an initial request
  73278. // and the request times out. If you make the request again with the
  73279. // same request ID, the server can check if original operation with the
  73280. // same request ID was received, and if so, will ignore the second
  73281. // request. This prevents clients from accidentally creating duplicate
  73282. // commitments.
  73283. //
  73284. // The request ID must be a valid UUID with the exception that zero UUID
  73285. // is not supported (00000000-0000-0000-0000-000000000000).
  73286. func (c *InstancesRemoveResourcePoliciesCall) RequestId(requestId string) *InstancesRemoveResourcePoliciesCall {
  73287. c.urlParams_.Set("requestId", requestId)
  73288. return c
  73289. }
  73290. // Fields allows partial responses to be retrieved. See
  73291. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73292. // for more information.
  73293. func (c *InstancesRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesRemoveResourcePoliciesCall {
  73294. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73295. return c
  73296. }
  73297. // Context sets the context to be used in this call's Do method. Any
  73298. // pending HTTP request will be aborted if the provided context is
  73299. // canceled.
  73300. func (c *InstancesRemoveResourcePoliciesCall) Context(ctx context.Context) *InstancesRemoveResourcePoliciesCall {
  73301. c.ctx_ = ctx
  73302. return c
  73303. }
  73304. // Header returns an http.Header that can be modified by the caller to
  73305. // add HTTP headers to the request.
  73306. func (c *InstancesRemoveResourcePoliciesCall) Header() http.Header {
  73307. if c.header_ == nil {
  73308. c.header_ = make(http.Header)
  73309. }
  73310. return c.header_
  73311. }
  73312. func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  73313. reqHeaders := make(http.Header)
  73314. for k, v := range c.header_ {
  73315. reqHeaders[k] = v
  73316. }
  73317. reqHeaders.Set("User-Agent", c.s.userAgent())
  73318. var body io.Reader = nil
  73319. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesremoveresourcepoliciesrequest)
  73320. if err != nil {
  73321. return nil, err
  73322. }
  73323. reqHeaders.Set("Content-Type", "application/json")
  73324. c.urlParams_.Set("alt", alt)
  73325. c.urlParams_.Set("prettyPrint", "false")
  73326. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/removeResourcePolicies")
  73327. urls += "?" + c.urlParams_.Encode()
  73328. req, err := http.NewRequest("POST", urls, body)
  73329. if err != nil {
  73330. return nil, err
  73331. }
  73332. req.Header = reqHeaders
  73333. googleapi.Expand(req.URL, map[string]string{
  73334. "project": c.project,
  73335. "zone": c.zone,
  73336. "instance": c.instance,
  73337. })
  73338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73339. }
  73340. // Do executes the "compute.instances.removeResourcePolicies" call.
  73341. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73342. // status code is an error. Response headers are in either
  73343. // *Operation.ServerResponse.Header or (if a response was returned at
  73344. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73345. // to check whether the returned error was because
  73346. // http.StatusNotModified was returned.
  73347. func (c *InstancesRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73348. gensupport.SetOptions(c.urlParams_, opts...)
  73349. res, err := c.doRequest("json")
  73350. if res != nil && res.StatusCode == http.StatusNotModified {
  73351. if res.Body != nil {
  73352. res.Body.Close()
  73353. }
  73354. return nil, &googleapi.Error{
  73355. Code: res.StatusCode,
  73356. Header: res.Header,
  73357. }
  73358. }
  73359. if err != nil {
  73360. return nil, err
  73361. }
  73362. defer googleapi.CloseBody(res)
  73363. if err := googleapi.CheckResponse(res); err != nil {
  73364. return nil, err
  73365. }
  73366. ret := &Operation{
  73367. ServerResponse: googleapi.ServerResponse{
  73368. Header: res.Header,
  73369. HTTPStatusCode: res.StatusCode,
  73370. },
  73371. }
  73372. target := &ret
  73373. if err := gensupport.DecodeResponse(target, res); err != nil {
  73374. return nil, err
  73375. }
  73376. return ret, nil
  73377. // {
  73378. // "description": "Removes resource policies from an instance.",
  73379. // "httpMethod": "POST",
  73380. // "id": "compute.instances.removeResourcePolicies",
  73381. // "parameterOrder": [
  73382. // "project",
  73383. // "zone",
  73384. // "instance"
  73385. // ],
  73386. // "parameters": {
  73387. // "instance": {
  73388. // "description": "The instance name for this request.",
  73389. // "location": "path",
  73390. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73391. // "required": true,
  73392. // "type": "string"
  73393. // },
  73394. // "project": {
  73395. // "description": "Project ID for this request.",
  73396. // "location": "path",
  73397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73398. // "required": true,
  73399. // "type": "string"
  73400. // },
  73401. // "requestId": {
  73402. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73403. // "location": "query",
  73404. // "type": "string"
  73405. // },
  73406. // "zone": {
  73407. // "description": "The name of the zone for this request.",
  73408. // "location": "path",
  73409. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73410. // "required": true,
  73411. // "type": "string"
  73412. // }
  73413. // },
  73414. // "path": "{project}/zones/{zone}/instances/{instance}/removeResourcePolicies",
  73415. // "request": {
  73416. // "$ref": "InstancesRemoveResourcePoliciesRequest"
  73417. // },
  73418. // "response": {
  73419. // "$ref": "Operation"
  73420. // },
  73421. // "scopes": [
  73422. // "https://www.googleapis.com/auth/cloud-platform",
  73423. // "https://www.googleapis.com/auth/compute"
  73424. // ]
  73425. // }
  73426. }
  73427. // method id "compute.instances.reset":
  73428. type InstancesResetCall struct {
  73429. s *Service
  73430. project string
  73431. zone string
  73432. instance string
  73433. urlParams_ gensupport.URLParams
  73434. ctx_ context.Context
  73435. header_ http.Header
  73436. }
  73437. // Reset: Performs a reset on the instance. This is a hard reset the VM
  73438. // does not do a graceful shutdown. For more information, see Resetting
  73439. // an instance.
  73440. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  73441. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  73442. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73443. c.project = project
  73444. c.zone = zone
  73445. c.instance = instance
  73446. return c
  73447. }
  73448. // RequestId sets the optional parameter "requestId": An optional
  73449. // request ID to identify requests. Specify a unique request ID so that
  73450. // if you must retry your request, the server will know to ignore the
  73451. // request if it has already been completed.
  73452. //
  73453. // For example, consider a situation where you make an initial request
  73454. // and the request times out. If you make the request again with the
  73455. // same request ID, the server can check if original operation with the
  73456. // same request ID was received, and if so, will ignore the second
  73457. // request. This prevents clients from accidentally creating duplicate
  73458. // commitments.
  73459. //
  73460. // The request ID must be a valid UUID with the exception that zero UUID
  73461. // is not supported (00000000-0000-0000-0000-000000000000).
  73462. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  73463. c.urlParams_.Set("requestId", requestId)
  73464. return c
  73465. }
  73466. // Fields allows partial responses to be retrieved. See
  73467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73468. // for more information.
  73469. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  73470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73471. return c
  73472. }
  73473. // Context sets the context to be used in this call's Do method. Any
  73474. // pending HTTP request will be aborted if the provided context is
  73475. // canceled.
  73476. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  73477. c.ctx_ = ctx
  73478. return c
  73479. }
  73480. // Header returns an http.Header that can be modified by the caller to
  73481. // add HTTP headers to the request.
  73482. func (c *InstancesResetCall) Header() http.Header {
  73483. if c.header_ == nil {
  73484. c.header_ = make(http.Header)
  73485. }
  73486. return c.header_
  73487. }
  73488. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  73489. reqHeaders := make(http.Header)
  73490. for k, v := range c.header_ {
  73491. reqHeaders[k] = v
  73492. }
  73493. reqHeaders.Set("User-Agent", c.s.userAgent())
  73494. var body io.Reader = nil
  73495. c.urlParams_.Set("alt", alt)
  73496. c.urlParams_.Set("prettyPrint", "false")
  73497. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  73498. urls += "?" + c.urlParams_.Encode()
  73499. req, err := http.NewRequest("POST", urls, body)
  73500. if err != nil {
  73501. return nil, err
  73502. }
  73503. req.Header = reqHeaders
  73504. googleapi.Expand(req.URL, map[string]string{
  73505. "project": c.project,
  73506. "zone": c.zone,
  73507. "instance": c.instance,
  73508. })
  73509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73510. }
  73511. // Do executes the "compute.instances.reset" call.
  73512. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73513. // status code is an error. Response headers are in either
  73514. // *Operation.ServerResponse.Header or (if a response was returned at
  73515. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73516. // to check whether the returned error was because
  73517. // http.StatusNotModified was returned.
  73518. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73519. gensupport.SetOptions(c.urlParams_, opts...)
  73520. res, err := c.doRequest("json")
  73521. if res != nil && res.StatusCode == http.StatusNotModified {
  73522. if res.Body != nil {
  73523. res.Body.Close()
  73524. }
  73525. return nil, &googleapi.Error{
  73526. Code: res.StatusCode,
  73527. Header: res.Header,
  73528. }
  73529. }
  73530. if err != nil {
  73531. return nil, err
  73532. }
  73533. defer googleapi.CloseBody(res)
  73534. if err := googleapi.CheckResponse(res); err != nil {
  73535. return nil, err
  73536. }
  73537. ret := &Operation{
  73538. ServerResponse: googleapi.ServerResponse{
  73539. Header: res.Header,
  73540. HTTPStatusCode: res.StatusCode,
  73541. },
  73542. }
  73543. target := &ret
  73544. if err := gensupport.DecodeResponse(target, res); err != nil {
  73545. return nil, err
  73546. }
  73547. return ret, nil
  73548. // {
  73549. // "description": "Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance.",
  73550. // "httpMethod": "POST",
  73551. // "id": "compute.instances.reset",
  73552. // "parameterOrder": [
  73553. // "project",
  73554. // "zone",
  73555. // "instance"
  73556. // ],
  73557. // "parameters": {
  73558. // "instance": {
  73559. // "description": "Name of the instance scoping this request.",
  73560. // "location": "path",
  73561. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73562. // "required": true,
  73563. // "type": "string"
  73564. // },
  73565. // "project": {
  73566. // "description": "Project ID for this request.",
  73567. // "location": "path",
  73568. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73569. // "required": true,
  73570. // "type": "string"
  73571. // },
  73572. // "requestId": {
  73573. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73574. // "location": "query",
  73575. // "type": "string"
  73576. // },
  73577. // "zone": {
  73578. // "description": "The name of the zone for this request.",
  73579. // "location": "path",
  73580. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73581. // "required": true,
  73582. // "type": "string"
  73583. // }
  73584. // },
  73585. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  73586. // "response": {
  73587. // "$ref": "Operation"
  73588. // },
  73589. // "scopes": [
  73590. // "https://www.googleapis.com/auth/cloud-platform",
  73591. // "https://www.googleapis.com/auth/compute"
  73592. // ]
  73593. // }
  73594. }
  73595. // method id "compute.instances.resume":
  73596. type InstancesResumeCall struct {
  73597. s *Service
  73598. project string
  73599. zone string
  73600. instance string
  73601. instancesresumerequest *InstancesResumeRequest
  73602. urlParams_ gensupport.URLParams
  73603. ctx_ context.Context
  73604. header_ http.Header
  73605. }
  73606. // Resume: Resumes an instance that was suspended using the
  73607. // instances().suspend method.
  73608. func (r *InstancesService) Resume(project string, zone string, instance string, instancesresumerequest *InstancesResumeRequest) *InstancesResumeCall {
  73609. c := &InstancesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73610. c.project = project
  73611. c.zone = zone
  73612. c.instance = instance
  73613. c.instancesresumerequest = instancesresumerequest
  73614. return c
  73615. }
  73616. // RequestId sets the optional parameter "requestId": An optional
  73617. // request ID to identify requests. Specify a unique request ID so that
  73618. // if you must retry your request, the server will know to ignore the
  73619. // request if it has already been completed.
  73620. //
  73621. // For example, consider a situation where you make an initial request
  73622. // and the request times out. If you make the request again with the
  73623. // same request ID, the server can check if original operation with the
  73624. // same request ID was received, and if so, will ignore the second
  73625. // request. This prevents clients from accidentally creating duplicate
  73626. // commitments.
  73627. //
  73628. // The request ID must be a valid UUID with the exception that zero UUID
  73629. // is not supported (00000000-0000-0000-0000-000000000000).
  73630. func (c *InstancesResumeCall) RequestId(requestId string) *InstancesResumeCall {
  73631. c.urlParams_.Set("requestId", requestId)
  73632. return c
  73633. }
  73634. // Fields allows partial responses to be retrieved. See
  73635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73636. // for more information.
  73637. func (c *InstancesResumeCall) Fields(s ...googleapi.Field) *InstancesResumeCall {
  73638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73639. return c
  73640. }
  73641. // Context sets the context to be used in this call's Do method. Any
  73642. // pending HTTP request will be aborted if the provided context is
  73643. // canceled.
  73644. func (c *InstancesResumeCall) Context(ctx context.Context) *InstancesResumeCall {
  73645. c.ctx_ = ctx
  73646. return c
  73647. }
  73648. // Header returns an http.Header that can be modified by the caller to
  73649. // add HTTP headers to the request.
  73650. func (c *InstancesResumeCall) Header() http.Header {
  73651. if c.header_ == nil {
  73652. c.header_ = make(http.Header)
  73653. }
  73654. return c.header_
  73655. }
  73656. func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) {
  73657. reqHeaders := make(http.Header)
  73658. for k, v := range c.header_ {
  73659. reqHeaders[k] = v
  73660. }
  73661. reqHeaders.Set("User-Agent", c.s.userAgent())
  73662. var body io.Reader = nil
  73663. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesresumerequest)
  73664. if err != nil {
  73665. return nil, err
  73666. }
  73667. reqHeaders.Set("Content-Type", "application/json")
  73668. c.urlParams_.Set("alt", alt)
  73669. c.urlParams_.Set("prettyPrint", "false")
  73670. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/resume")
  73671. urls += "?" + c.urlParams_.Encode()
  73672. req, err := http.NewRequest("POST", urls, body)
  73673. if err != nil {
  73674. return nil, err
  73675. }
  73676. req.Header = reqHeaders
  73677. googleapi.Expand(req.URL, map[string]string{
  73678. "project": c.project,
  73679. "zone": c.zone,
  73680. "instance": c.instance,
  73681. })
  73682. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73683. }
  73684. // Do executes the "compute.instances.resume" call.
  73685. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73686. // status code is an error. Response headers are in either
  73687. // *Operation.ServerResponse.Header or (if a response was returned at
  73688. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73689. // to check whether the returned error was because
  73690. // http.StatusNotModified was returned.
  73691. func (c *InstancesResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73692. gensupport.SetOptions(c.urlParams_, opts...)
  73693. res, err := c.doRequest("json")
  73694. if res != nil && res.StatusCode == http.StatusNotModified {
  73695. if res.Body != nil {
  73696. res.Body.Close()
  73697. }
  73698. return nil, &googleapi.Error{
  73699. Code: res.StatusCode,
  73700. Header: res.Header,
  73701. }
  73702. }
  73703. if err != nil {
  73704. return nil, err
  73705. }
  73706. defer googleapi.CloseBody(res)
  73707. if err := googleapi.CheckResponse(res); err != nil {
  73708. return nil, err
  73709. }
  73710. ret := &Operation{
  73711. ServerResponse: googleapi.ServerResponse{
  73712. Header: res.Header,
  73713. HTTPStatusCode: res.StatusCode,
  73714. },
  73715. }
  73716. target := &ret
  73717. if err := gensupport.DecodeResponse(target, res); err != nil {
  73718. return nil, err
  73719. }
  73720. return ret, nil
  73721. // {
  73722. // "description": "Resumes an instance that was suspended using the instances().suspend method.",
  73723. // "httpMethod": "POST",
  73724. // "id": "compute.instances.resume",
  73725. // "parameterOrder": [
  73726. // "project",
  73727. // "zone",
  73728. // "instance"
  73729. // ],
  73730. // "parameters": {
  73731. // "instance": {
  73732. // "description": "Name of the instance resource to resume.",
  73733. // "location": "path",
  73734. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73735. // "required": true,
  73736. // "type": "string"
  73737. // },
  73738. // "project": {
  73739. // "description": "Project ID for this request.",
  73740. // "location": "path",
  73741. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73742. // "required": true,
  73743. // "type": "string"
  73744. // },
  73745. // "requestId": {
  73746. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73747. // "location": "query",
  73748. // "type": "string"
  73749. // },
  73750. // "zone": {
  73751. // "description": "The name of the zone for this request.",
  73752. // "location": "path",
  73753. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73754. // "required": true,
  73755. // "type": "string"
  73756. // }
  73757. // },
  73758. // "path": "{project}/zones/{zone}/instances/{instance}/resume",
  73759. // "request": {
  73760. // "$ref": "InstancesResumeRequest"
  73761. // },
  73762. // "response": {
  73763. // "$ref": "Operation"
  73764. // },
  73765. // "scopes": [
  73766. // "https://www.googleapis.com/auth/cloud-platform",
  73767. // "https://www.googleapis.com/auth/compute"
  73768. // ]
  73769. // }
  73770. }
  73771. // method id "compute.instances.setDeletionProtection":
  73772. type InstancesSetDeletionProtectionCall struct {
  73773. s *Service
  73774. project string
  73775. zone string
  73776. resource string
  73777. urlParams_ gensupport.URLParams
  73778. ctx_ context.Context
  73779. header_ http.Header
  73780. }
  73781. // SetDeletionProtection: Sets deletion protection on the instance.
  73782. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  73783. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73784. c.project = project
  73785. c.zone = zone
  73786. c.resource = resource
  73787. return c
  73788. }
  73789. // DeletionProtection sets the optional parameter "deletionProtection":
  73790. // Whether the resource should be protected against deletion.
  73791. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  73792. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  73793. return c
  73794. }
  73795. // RequestId sets the optional parameter "requestId": An optional
  73796. // request ID to identify requests. Specify a unique request ID so that
  73797. // if you must retry your request, the server will know to ignore the
  73798. // request if it has already been completed.
  73799. //
  73800. // For example, consider a situation where you make an initial request
  73801. // and the request times out. If you make the request again with the
  73802. // same request ID, the server can check if original operation with the
  73803. // same request ID was received, and if so, will ignore the second
  73804. // request. This prevents clients from accidentally creating duplicate
  73805. // commitments.
  73806. //
  73807. // The request ID must be a valid UUID with the exception that zero UUID
  73808. // is not supported (00000000-0000-0000-0000-000000000000).
  73809. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  73810. c.urlParams_.Set("requestId", requestId)
  73811. return c
  73812. }
  73813. // Fields allows partial responses to be retrieved. See
  73814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73815. // for more information.
  73816. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  73817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73818. return c
  73819. }
  73820. // Context sets the context to be used in this call's Do method. Any
  73821. // pending HTTP request will be aborted if the provided context is
  73822. // canceled.
  73823. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  73824. c.ctx_ = ctx
  73825. return c
  73826. }
  73827. // Header returns an http.Header that can be modified by the caller to
  73828. // add HTTP headers to the request.
  73829. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  73830. if c.header_ == nil {
  73831. c.header_ = make(http.Header)
  73832. }
  73833. return c.header_
  73834. }
  73835. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  73836. reqHeaders := make(http.Header)
  73837. for k, v := range c.header_ {
  73838. reqHeaders[k] = v
  73839. }
  73840. reqHeaders.Set("User-Agent", c.s.userAgent())
  73841. var body io.Reader = nil
  73842. c.urlParams_.Set("alt", alt)
  73843. c.urlParams_.Set("prettyPrint", "false")
  73844. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  73845. urls += "?" + c.urlParams_.Encode()
  73846. req, err := http.NewRequest("POST", urls, body)
  73847. if err != nil {
  73848. return nil, err
  73849. }
  73850. req.Header = reqHeaders
  73851. googleapi.Expand(req.URL, map[string]string{
  73852. "project": c.project,
  73853. "zone": c.zone,
  73854. "resource": c.resource,
  73855. })
  73856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73857. }
  73858. // Do executes the "compute.instances.setDeletionProtection" call.
  73859. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73860. // status code is an error. Response headers are in either
  73861. // *Operation.ServerResponse.Header or (if a response was returned at
  73862. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73863. // to check whether the returned error was because
  73864. // http.StatusNotModified was returned.
  73865. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73866. gensupport.SetOptions(c.urlParams_, opts...)
  73867. res, err := c.doRequest("json")
  73868. if res != nil && res.StatusCode == http.StatusNotModified {
  73869. if res.Body != nil {
  73870. res.Body.Close()
  73871. }
  73872. return nil, &googleapi.Error{
  73873. Code: res.StatusCode,
  73874. Header: res.Header,
  73875. }
  73876. }
  73877. if err != nil {
  73878. return nil, err
  73879. }
  73880. defer googleapi.CloseBody(res)
  73881. if err := googleapi.CheckResponse(res); err != nil {
  73882. return nil, err
  73883. }
  73884. ret := &Operation{
  73885. ServerResponse: googleapi.ServerResponse{
  73886. Header: res.Header,
  73887. HTTPStatusCode: res.StatusCode,
  73888. },
  73889. }
  73890. target := &ret
  73891. if err := gensupport.DecodeResponse(target, res); err != nil {
  73892. return nil, err
  73893. }
  73894. return ret, nil
  73895. // {
  73896. // "description": "Sets deletion protection on the instance.",
  73897. // "httpMethod": "POST",
  73898. // "id": "compute.instances.setDeletionProtection",
  73899. // "parameterOrder": [
  73900. // "project",
  73901. // "zone",
  73902. // "resource"
  73903. // ],
  73904. // "parameters": {
  73905. // "deletionProtection": {
  73906. // "default": "true",
  73907. // "description": "Whether the resource should be protected against deletion.",
  73908. // "location": "query",
  73909. // "type": "boolean"
  73910. // },
  73911. // "project": {
  73912. // "description": "Project ID for this request.",
  73913. // "location": "path",
  73914. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73915. // "required": true,
  73916. // "type": "string"
  73917. // },
  73918. // "requestId": {
  73919. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73920. // "location": "query",
  73921. // "type": "string"
  73922. // },
  73923. // "resource": {
  73924. // "description": "Name or id of the resource for this request.",
  73925. // "location": "path",
  73926. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73927. // "required": true,
  73928. // "type": "string"
  73929. // },
  73930. // "zone": {
  73931. // "description": "The name of the zone for this request.",
  73932. // "location": "path",
  73933. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73934. // "required": true,
  73935. // "type": "string"
  73936. // }
  73937. // },
  73938. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  73939. // "response": {
  73940. // "$ref": "Operation"
  73941. // },
  73942. // "scopes": [
  73943. // "https://www.googleapis.com/auth/cloud-platform",
  73944. // "https://www.googleapis.com/auth/compute"
  73945. // ]
  73946. // }
  73947. }
  73948. // method id "compute.instances.setDiskAutoDelete":
  73949. type InstancesSetDiskAutoDeleteCall struct {
  73950. s *Service
  73951. project string
  73952. zone string
  73953. instance string
  73954. urlParams_ gensupport.URLParams
  73955. ctx_ context.Context
  73956. header_ http.Header
  73957. }
  73958. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  73959. // an instance.
  73960. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  73961. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  73962. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73963. c.project = project
  73964. c.zone = zone
  73965. c.instance = instance
  73966. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  73967. c.urlParams_.Set("deviceName", deviceName)
  73968. return c
  73969. }
  73970. // RequestId sets the optional parameter "requestId": An optional
  73971. // request ID to identify requests. Specify a unique request ID so that
  73972. // if you must retry your request, the server will know to ignore the
  73973. // request if it has already been completed.
  73974. //
  73975. // For example, consider a situation where you make an initial request
  73976. // and the request times out. If you make the request again with the
  73977. // same request ID, the server can check if original operation with the
  73978. // same request ID was received, and if so, will ignore the second
  73979. // request. This prevents clients from accidentally creating duplicate
  73980. // commitments.
  73981. //
  73982. // The request ID must be a valid UUID with the exception that zero UUID
  73983. // is not supported (00000000-0000-0000-0000-000000000000).
  73984. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  73985. c.urlParams_.Set("requestId", requestId)
  73986. return c
  73987. }
  73988. // Fields allows partial responses to be retrieved. See
  73989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73990. // for more information.
  73991. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  73992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73993. return c
  73994. }
  73995. // Context sets the context to be used in this call's Do method. Any
  73996. // pending HTTP request will be aborted if the provided context is
  73997. // canceled.
  73998. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  73999. c.ctx_ = ctx
  74000. return c
  74001. }
  74002. // Header returns an http.Header that can be modified by the caller to
  74003. // add HTTP headers to the request.
  74004. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  74005. if c.header_ == nil {
  74006. c.header_ = make(http.Header)
  74007. }
  74008. return c.header_
  74009. }
  74010. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  74011. reqHeaders := make(http.Header)
  74012. for k, v := range c.header_ {
  74013. reqHeaders[k] = v
  74014. }
  74015. reqHeaders.Set("User-Agent", c.s.userAgent())
  74016. var body io.Reader = nil
  74017. c.urlParams_.Set("alt", alt)
  74018. c.urlParams_.Set("prettyPrint", "false")
  74019. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  74020. urls += "?" + c.urlParams_.Encode()
  74021. req, err := http.NewRequest("POST", urls, body)
  74022. if err != nil {
  74023. return nil, err
  74024. }
  74025. req.Header = reqHeaders
  74026. googleapi.Expand(req.URL, map[string]string{
  74027. "project": c.project,
  74028. "zone": c.zone,
  74029. "instance": c.instance,
  74030. })
  74031. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74032. }
  74033. // Do executes the "compute.instances.setDiskAutoDelete" call.
  74034. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74035. // status code is an error. Response headers are in either
  74036. // *Operation.ServerResponse.Header or (if a response was returned at
  74037. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74038. // to check whether the returned error was because
  74039. // http.StatusNotModified was returned.
  74040. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74041. gensupport.SetOptions(c.urlParams_, opts...)
  74042. res, err := c.doRequest("json")
  74043. if res != nil && res.StatusCode == http.StatusNotModified {
  74044. if res.Body != nil {
  74045. res.Body.Close()
  74046. }
  74047. return nil, &googleapi.Error{
  74048. Code: res.StatusCode,
  74049. Header: res.Header,
  74050. }
  74051. }
  74052. if err != nil {
  74053. return nil, err
  74054. }
  74055. defer googleapi.CloseBody(res)
  74056. if err := googleapi.CheckResponse(res); err != nil {
  74057. return nil, err
  74058. }
  74059. ret := &Operation{
  74060. ServerResponse: googleapi.ServerResponse{
  74061. Header: res.Header,
  74062. HTTPStatusCode: res.StatusCode,
  74063. },
  74064. }
  74065. target := &ret
  74066. if err := gensupport.DecodeResponse(target, res); err != nil {
  74067. return nil, err
  74068. }
  74069. return ret, nil
  74070. // {
  74071. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  74072. // "httpMethod": "POST",
  74073. // "id": "compute.instances.setDiskAutoDelete",
  74074. // "parameterOrder": [
  74075. // "project",
  74076. // "zone",
  74077. // "instance",
  74078. // "autoDelete",
  74079. // "deviceName"
  74080. // ],
  74081. // "parameters": {
  74082. // "autoDelete": {
  74083. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  74084. // "location": "query",
  74085. // "required": true,
  74086. // "type": "boolean"
  74087. // },
  74088. // "deviceName": {
  74089. // "description": "The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.",
  74090. // "location": "query",
  74091. // "pattern": "\\w[\\w.-]{0,254}",
  74092. // "required": true,
  74093. // "type": "string"
  74094. // },
  74095. // "instance": {
  74096. // "description": "The instance name for this request.",
  74097. // "location": "path",
  74098. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74099. // "required": true,
  74100. // "type": "string"
  74101. // },
  74102. // "project": {
  74103. // "description": "Project ID for this request.",
  74104. // "location": "path",
  74105. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74106. // "required": true,
  74107. // "type": "string"
  74108. // },
  74109. // "requestId": {
  74110. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74111. // "location": "query",
  74112. // "type": "string"
  74113. // },
  74114. // "zone": {
  74115. // "description": "The name of the zone for this request.",
  74116. // "location": "path",
  74117. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74118. // "required": true,
  74119. // "type": "string"
  74120. // }
  74121. // },
  74122. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  74123. // "response": {
  74124. // "$ref": "Operation"
  74125. // },
  74126. // "scopes": [
  74127. // "https://www.googleapis.com/auth/cloud-platform",
  74128. // "https://www.googleapis.com/auth/compute"
  74129. // ]
  74130. // }
  74131. }
  74132. // method id "compute.instances.setIamPolicy":
  74133. type InstancesSetIamPolicyCall struct {
  74134. s *Service
  74135. project string
  74136. zone string
  74137. resource string
  74138. zonesetpolicyrequest *ZoneSetPolicyRequest
  74139. urlParams_ gensupport.URLParams
  74140. ctx_ context.Context
  74141. header_ http.Header
  74142. }
  74143. // SetIamPolicy: Sets the access control policy on the specified
  74144. // resource. Replaces any existing policy.
  74145. func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall {
  74146. c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74147. c.project = project
  74148. c.zone = zone
  74149. c.resource = resource
  74150. c.zonesetpolicyrequest = zonesetpolicyrequest
  74151. return c
  74152. }
  74153. // Fields allows partial responses to be retrieved. See
  74154. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74155. // for more information.
  74156. func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall {
  74157. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74158. return c
  74159. }
  74160. // Context sets the context to be used in this call's Do method. Any
  74161. // pending HTTP request will be aborted if the provided context is
  74162. // canceled.
  74163. func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall {
  74164. c.ctx_ = ctx
  74165. return c
  74166. }
  74167. // Header returns an http.Header that can be modified by the caller to
  74168. // add HTTP headers to the request.
  74169. func (c *InstancesSetIamPolicyCall) Header() http.Header {
  74170. if c.header_ == nil {
  74171. c.header_ = make(http.Header)
  74172. }
  74173. return c.header_
  74174. }
  74175. func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  74176. reqHeaders := make(http.Header)
  74177. for k, v := range c.header_ {
  74178. reqHeaders[k] = v
  74179. }
  74180. reqHeaders.Set("User-Agent", c.s.userAgent())
  74181. var body io.Reader = nil
  74182. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  74183. if err != nil {
  74184. return nil, err
  74185. }
  74186. reqHeaders.Set("Content-Type", "application/json")
  74187. c.urlParams_.Set("alt", alt)
  74188. c.urlParams_.Set("prettyPrint", "false")
  74189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setIamPolicy")
  74190. urls += "?" + c.urlParams_.Encode()
  74191. req, err := http.NewRequest("POST", urls, body)
  74192. if err != nil {
  74193. return nil, err
  74194. }
  74195. req.Header = reqHeaders
  74196. googleapi.Expand(req.URL, map[string]string{
  74197. "project": c.project,
  74198. "zone": c.zone,
  74199. "resource": c.resource,
  74200. })
  74201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74202. }
  74203. // Do executes the "compute.instances.setIamPolicy" call.
  74204. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  74205. // code is an error. Response headers are in either
  74206. // *Policy.ServerResponse.Header or (if a response was returned at all)
  74207. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  74208. // check whether the returned error was because http.StatusNotModified
  74209. // was returned.
  74210. func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  74211. gensupport.SetOptions(c.urlParams_, opts...)
  74212. res, err := c.doRequest("json")
  74213. if res != nil && res.StatusCode == http.StatusNotModified {
  74214. if res.Body != nil {
  74215. res.Body.Close()
  74216. }
  74217. return nil, &googleapi.Error{
  74218. Code: res.StatusCode,
  74219. Header: res.Header,
  74220. }
  74221. }
  74222. if err != nil {
  74223. return nil, err
  74224. }
  74225. defer googleapi.CloseBody(res)
  74226. if err := googleapi.CheckResponse(res); err != nil {
  74227. return nil, err
  74228. }
  74229. ret := &Policy{
  74230. ServerResponse: googleapi.ServerResponse{
  74231. Header: res.Header,
  74232. HTTPStatusCode: res.StatusCode,
  74233. },
  74234. }
  74235. target := &ret
  74236. if err := gensupport.DecodeResponse(target, res); err != nil {
  74237. return nil, err
  74238. }
  74239. return ret, nil
  74240. // {
  74241. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  74242. // "httpMethod": "POST",
  74243. // "id": "compute.instances.setIamPolicy",
  74244. // "parameterOrder": [
  74245. // "project",
  74246. // "zone",
  74247. // "resource"
  74248. // ],
  74249. // "parameters": {
  74250. // "project": {
  74251. // "description": "Project ID for this request.",
  74252. // "location": "path",
  74253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74254. // "required": true,
  74255. // "type": "string"
  74256. // },
  74257. // "resource": {
  74258. // "description": "Name or id of the resource for this request.",
  74259. // "location": "path",
  74260. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74261. // "required": true,
  74262. // "type": "string"
  74263. // },
  74264. // "zone": {
  74265. // "description": "The name of the zone for this request.",
  74266. // "location": "path",
  74267. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74268. // "required": true,
  74269. // "type": "string"
  74270. // }
  74271. // },
  74272. // "path": "{project}/zones/{zone}/instances/{resource}/setIamPolicy",
  74273. // "request": {
  74274. // "$ref": "ZoneSetPolicyRequest"
  74275. // },
  74276. // "response": {
  74277. // "$ref": "Policy"
  74278. // },
  74279. // "scopes": [
  74280. // "https://www.googleapis.com/auth/cloud-platform",
  74281. // "https://www.googleapis.com/auth/compute"
  74282. // ]
  74283. // }
  74284. }
  74285. // method id "compute.instances.setLabels":
  74286. type InstancesSetLabelsCall struct {
  74287. s *Service
  74288. project string
  74289. zone string
  74290. instance string
  74291. instancessetlabelsrequest *InstancesSetLabelsRequest
  74292. urlParams_ gensupport.URLParams
  74293. ctx_ context.Context
  74294. header_ http.Header
  74295. }
  74296. // SetLabels: Sets labels on an instance. To learn more about labels,
  74297. // read the Labeling Resources documentation.
  74298. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  74299. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74300. c.project = project
  74301. c.zone = zone
  74302. c.instance = instance
  74303. c.instancessetlabelsrequest = instancessetlabelsrequest
  74304. return c
  74305. }
  74306. // RequestId sets the optional parameter "requestId": An optional
  74307. // request ID to identify requests. Specify a unique request ID so that
  74308. // if you must retry your request, the server will know to ignore the
  74309. // request if it has already been completed.
  74310. //
  74311. // For example, consider a situation where you make an initial request
  74312. // and the request times out. If you make the request again with the
  74313. // same request ID, the server can check if original operation with the
  74314. // same request ID was received, and if so, will ignore the second
  74315. // request. This prevents clients from accidentally creating duplicate
  74316. // commitments.
  74317. //
  74318. // The request ID must be a valid UUID with the exception that zero UUID
  74319. // is not supported (00000000-0000-0000-0000-000000000000).
  74320. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  74321. c.urlParams_.Set("requestId", requestId)
  74322. return c
  74323. }
  74324. // Fields allows partial responses to be retrieved. See
  74325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74326. // for more information.
  74327. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  74328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74329. return c
  74330. }
  74331. // Context sets the context to be used in this call's Do method. Any
  74332. // pending HTTP request will be aborted if the provided context is
  74333. // canceled.
  74334. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  74335. c.ctx_ = ctx
  74336. return c
  74337. }
  74338. // Header returns an http.Header that can be modified by the caller to
  74339. // add HTTP headers to the request.
  74340. func (c *InstancesSetLabelsCall) Header() http.Header {
  74341. if c.header_ == nil {
  74342. c.header_ = make(http.Header)
  74343. }
  74344. return c.header_
  74345. }
  74346. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  74347. reqHeaders := make(http.Header)
  74348. for k, v := range c.header_ {
  74349. reqHeaders[k] = v
  74350. }
  74351. reqHeaders.Set("User-Agent", c.s.userAgent())
  74352. var body io.Reader = nil
  74353. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  74354. if err != nil {
  74355. return nil, err
  74356. }
  74357. reqHeaders.Set("Content-Type", "application/json")
  74358. c.urlParams_.Set("alt", alt)
  74359. c.urlParams_.Set("prettyPrint", "false")
  74360. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  74361. urls += "?" + c.urlParams_.Encode()
  74362. req, err := http.NewRequest("POST", urls, body)
  74363. if err != nil {
  74364. return nil, err
  74365. }
  74366. req.Header = reqHeaders
  74367. googleapi.Expand(req.URL, map[string]string{
  74368. "project": c.project,
  74369. "zone": c.zone,
  74370. "instance": c.instance,
  74371. })
  74372. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74373. }
  74374. // Do executes the "compute.instances.setLabels" call.
  74375. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74376. // status code is an error. Response headers are in either
  74377. // *Operation.ServerResponse.Header or (if a response was returned at
  74378. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74379. // to check whether the returned error was because
  74380. // http.StatusNotModified was returned.
  74381. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74382. gensupport.SetOptions(c.urlParams_, opts...)
  74383. res, err := c.doRequest("json")
  74384. if res != nil && res.StatusCode == http.StatusNotModified {
  74385. if res.Body != nil {
  74386. res.Body.Close()
  74387. }
  74388. return nil, &googleapi.Error{
  74389. Code: res.StatusCode,
  74390. Header: res.Header,
  74391. }
  74392. }
  74393. if err != nil {
  74394. return nil, err
  74395. }
  74396. defer googleapi.CloseBody(res)
  74397. if err := googleapi.CheckResponse(res); err != nil {
  74398. return nil, err
  74399. }
  74400. ret := &Operation{
  74401. ServerResponse: googleapi.ServerResponse{
  74402. Header: res.Header,
  74403. HTTPStatusCode: res.StatusCode,
  74404. },
  74405. }
  74406. target := &ret
  74407. if err := gensupport.DecodeResponse(target, res); err != nil {
  74408. return nil, err
  74409. }
  74410. return ret, nil
  74411. // {
  74412. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  74413. // "httpMethod": "POST",
  74414. // "id": "compute.instances.setLabels",
  74415. // "parameterOrder": [
  74416. // "project",
  74417. // "zone",
  74418. // "instance"
  74419. // ],
  74420. // "parameters": {
  74421. // "instance": {
  74422. // "description": "Name of the instance scoping this request.",
  74423. // "location": "path",
  74424. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74425. // "required": true,
  74426. // "type": "string"
  74427. // },
  74428. // "project": {
  74429. // "description": "Project ID for this request.",
  74430. // "location": "path",
  74431. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74432. // "required": true,
  74433. // "type": "string"
  74434. // },
  74435. // "requestId": {
  74436. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74437. // "location": "query",
  74438. // "type": "string"
  74439. // },
  74440. // "zone": {
  74441. // "description": "The name of the zone for this request.",
  74442. // "location": "path",
  74443. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74444. // "required": true,
  74445. // "type": "string"
  74446. // }
  74447. // },
  74448. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  74449. // "request": {
  74450. // "$ref": "InstancesSetLabelsRequest"
  74451. // },
  74452. // "response": {
  74453. // "$ref": "Operation"
  74454. // },
  74455. // "scopes": [
  74456. // "https://www.googleapis.com/auth/cloud-platform",
  74457. // "https://www.googleapis.com/auth/compute"
  74458. // ]
  74459. // }
  74460. }
  74461. // method id "compute.instances.setMachineResources":
  74462. type InstancesSetMachineResourcesCall struct {
  74463. s *Service
  74464. project string
  74465. zone string
  74466. instance string
  74467. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  74468. urlParams_ gensupport.URLParams
  74469. ctx_ context.Context
  74470. header_ http.Header
  74471. }
  74472. // SetMachineResources: Changes the number and/or type of accelerator
  74473. // for a stopped instance to the values specified in the request.
  74474. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  74475. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74476. c.project = project
  74477. c.zone = zone
  74478. c.instance = instance
  74479. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  74480. return c
  74481. }
  74482. // RequestId sets the optional parameter "requestId": An optional
  74483. // request ID to identify requests. Specify a unique request ID so that
  74484. // if you must retry your request, the server will know to ignore the
  74485. // request if it has already been completed.
  74486. //
  74487. // For example, consider a situation where you make an initial request
  74488. // and the request times out. If you make the request again with the
  74489. // same request ID, the server can check if original operation with the
  74490. // same request ID was received, and if so, will ignore the second
  74491. // request. This prevents clients from accidentally creating duplicate
  74492. // commitments.
  74493. //
  74494. // The request ID must be a valid UUID with the exception that zero UUID
  74495. // is not supported (00000000-0000-0000-0000-000000000000).
  74496. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  74497. c.urlParams_.Set("requestId", requestId)
  74498. return c
  74499. }
  74500. // Fields allows partial responses to be retrieved. See
  74501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74502. // for more information.
  74503. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  74504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74505. return c
  74506. }
  74507. // Context sets the context to be used in this call's Do method. Any
  74508. // pending HTTP request will be aborted if the provided context is
  74509. // canceled.
  74510. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  74511. c.ctx_ = ctx
  74512. return c
  74513. }
  74514. // Header returns an http.Header that can be modified by the caller to
  74515. // add HTTP headers to the request.
  74516. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  74517. if c.header_ == nil {
  74518. c.header_ = make(http.Header)
  74519. }
  74520. return c.header_
  74521. }
  74522. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  74523. reqHeaders := make(http.Header)
  74524. for k, v := range c.header_ {
  74525. reqHeaders[k] = v
  74526. }
  74527. reqHeaders.Set("User-Agent", c.s.userAgent())
  74528. var body io.Reader = nil
  74529. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  74530. if err != nil {
  74531. return nil, err
  74532. }
  74533. reqHeaders.Set("Content-Type", "application/json")
  74534. c.urlParams_.Set("alt", alt)
  74535. c.urlParams_.Set("prettyPrint", "false")
  74536. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  74537. urls += "?" + c.urlParams_.Encode()
  74538. req, err := http.NewRequest("POST", urls, body)
  74539. if err != nil {
  74540. return nil, err
  74541. }
  74542. req.Header = reqHeaders
  74543. googleapi.Expand(req.URL, map[string]string{
  74544. "project": c.project,
  74545. "zone": c.zone,
  74546. "instance": c.instance,
  74547. })
  74548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74549. }
  74550. // Do executes the "compute.instances.setMachineResources" call.
  74551. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74552. // status code is an error. Response headers are in either
  74553. // *Operation.ServerResponse.Header or (if a response was returned at
  74554. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74555. // to check whether the returned error was because
  74556. // http.StatusNotModified was returned.
  74557. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74558. gensupport.SetOptions(c.urlParams_, opts...)
  74559. res, err := c.doRequest("json")
  74560. if res != nil && res.StatusCode == http.StatusNotModified {
  74561. if res.Body != nil {
  74562. res.Body.Close()
  74563. }
  74564. return nil, &googleapi.Error{
  74565. Code: res.StatusCode,
  74566. Header: res.Header,
  74567. }
  74568. }
  74569. if err != nil {
  74570. return nil, err
  74571. }
  74572. defer googleapi.CloseBody(res)
  74573. if err := googleapi.CheckResponse(res); err != nil {
  74574. return nil, err
  74575. }
  74576. ret := &Operation{
  74577. ServerResponse: googleapi.ServerResponse{
  74578. Header: res.Header,
  74579. HTTPStatusCode: res.StatusCode,
  74580. },
  74581. }
  74582. target := &ret
  74583. if err := gensupport.DecodeResponse(target, res); err != nil {
  74584. return nil, err
  74585. }
  74586. return ret, nil
  74587. // {
  74588. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  74589. // "httpMethod": "POST",
  74590. // "id": "compute.instances.setMachineResources",
  74591. // "parameterOrder": [
  74592. // "project",
  74593. // "zone",
  74594. // "instance"
  74595. // ],
  74596. // "parameters": {
  74597. // "instance": {
  74598. // "description": "Name of the instance scoping this request.",
  74599. // "location": "path",
  74600. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74601. // "required": true,
  74602. // "type": "string"
  74603. // },
  74604. // "project": {
  74605. // "description": "Project ID for this request.",
  74606. // "location": "path",
  74607. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74608. // "required": true,
  74609. // "type": "string"
  74610. // },
  74611. // "requestId": {
  74612. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74613. // "location": "query",
  74614. // "type": "string"
  74615. // },
  74616. // "zone": {
  74617. // "description": "The name of the zone for this request.",
  74618. // "location": "path",
  74619. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74620. // "required": true,
  74621. // "type": "string"
  74622. // }
  74623. // },
  74624. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  74625. // "request": {
  74626. // "$ref": "InstancesSetMachineResourcesRequest"
  74627. // },
  74628. // "response": {
  74629. // "$ref": "Operation"
  74630. // },
  74631. // "scopes": [
  74632. // "https://www.googleapis.com/auth/cloud-platform",
  74633. // "https://www.googleapis.com/auth/compute"
  74634. // ]
  74635. // }
  74636. }
  74637. // method id "compute.instances.setMachineType":
  74638. type InstancesSetMachineTypeCall struct {
  74639. s *Service
  74640. project string
  74641. zone string
  74642. instance string
  74643. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  74644. urlParams_ gensupport.URLParams
  74645. ctx_ context.Context
  74646. header_ http.Header
  74647. }
  74648. // SetMachineType: Changes the machine type for a stopped instance to
  74649. // the machine type specified in the request.
  74650. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  74651. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74652. c.project = project
  74653. c.zone = zone
  74654. c.instance = instance
  74655. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  74656. return c
  74657. }
  74658. // RequestId sets the optional parameter "requestId": An optional
  74659. // request ID to identify requests. Specify a unique request ID so that
  74660. // if you must retry your request, the server will know to ignore the
  74661. // request if it has already been completed.
  74662. //
  74663. // For example, consider a situation where you make an initial request
  74664. // and the request times out. If you make the request again with the
  74665. // same request ID, the server can check if original operation with the
  74666. // same request ID was received, and if so, will ignore the second
  74667. // request. This prevents clients from accidentally creating duplicate
  74668. // commitments.
  74669. //
  74670. // The request ID must be a valid UUID with the exception that zero UUID
  74671. // is not supported (00000000-0000-0000-0000-000000000000).
  74672. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  74673. c.urlParams_.Set("requestId", requestId)
  74674. return c
  74675. }
  74676. // Fields allows partial responses to be retrieved. See
  74677. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74678. // for more information.
  74679. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  74680. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74681. return c
  74682. }
  74683. // Context sets the context to be used in this call's Do method. Any
  74684. // pending HTTP request will be aborted if the provided context is
  74685. // canceled.
  74686. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  74687. c.ctx_ = ctx
  74688. return c
  74689. }
  74690. // Header returns an http.Header that can be modified by the caller to
  74691. // add HTTP headers to the request.
  74692. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  74693. if c.header_ == nil {
  74694. c.header_ = make(http.Header)
  74695. }
  74696. return c.header_
  74697. }
  74698. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  74699. reqHeaders := make(http.Header)
  74700. for k, v := range c.header_ {
  74701. reqHeaders[k] = v
  74702. }
  74703. reqHeaders.Set("User-Agent", c.s.userAgent())
  74704. var body io.Reader = nil
  74705. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  74706. if err != nil {
  74707. return nil, err
  74708. }
  74709. reqHeaders.Set("Content-Type", "application/json")
  74710. c.urlParams_.Set("alt", alt)
  74711. c.urlParams_.Set("prettyPrint", "false")
  74712. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  74713. urls += "?" + c.urlParams_.Encode()
  74714. req, err := http.NewRequest("POST", urls, body)
  74715. if err != nil {
  74716. return nil, err
  74717. }
  74718. req.Header = reqHeaders
  74719. googleapi.Expand(req.URL, map[string]string{
  74720. "project": c.project,
  74721. "zone": c.zone,
  74722. "instance": c.instance,
  74723. })
  74724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74725. }
  74726. // Do executes the "compute.instances.setMachineType" call.
  74727. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74728. // status code is an error. Response headers are in either
  74729. // *Operation.ServerResponse.Header or (if a response was returned at
  74730. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74731. // to check whether the returned error was because
  74732. // http.StatusNotModified was returned.
  74733. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74734. gensupport.SetOptions(c.urlParams_, opts...)
  74735. res, err := c.doRequest("json")
  74736. if res != nil && res.StatusCode == http.StatusNotModified {
  74737. if res.Body != nil {
  74738. res.Body.Close()
  74739. }
  74740. return nil, &googleapi.Error{
  74741. Code: res.StatusCode,
  74742. Header: res.Header,
  74743. }
  74744. }
  74745. if err != nil {
  74746. return nil, err
  74747. }
  74748. defer googleapi.CloseBody(res)
  74749. if err := googleapi.CheckResponse(res); err != nil {
  74750. return nil, err
  74751. }
  74752. ret := &Operation{
  74753. ServerResponse: googleapi.ServerResponse{
  74754. Header: res.Header,
  74755. HTTPStatusCode: res.StatusCode,
  74756. },
  74757. }
  74758. target := &ret
  74759. if err := gensupport.DecodeResponse(target, res); err != nil {
  74760. return nil, err
  74761. }
  74762. return ret, nil
  74763. // {
  74764. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  74765. // "httpMethod": "POST",
  74766. // "id": "compute.instances.setMachineType",
  74767. // "parameterOrder": [
  74768. // "project",
  74769. // "zone",
  74770. // "instance"
  74771. // ],
  74772. // "parameters": {
  74773. // "instance": {
  74774. // "description": "Name of the instance scoping this request.",
  74775. // "location": "path",
  74776. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74777. // "required": true,
  74778. // "type": "string"
  74779. // },
  74780. // "project": {
  74781. // "description": "Project ID for this request.",
  74782. // "location": "path",
  74783. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74784. // "required": true,
  74785. // "type": "string"
  74786. // },
  74787. // "requestId": {
  74788. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74789. // "location": "query",
  74790. // "type": "string"
  74791. // },
  74792. // "zone": {
  74793. // "description": "The name of the zone for this request.",
  74794. // "location": "path",
  74795. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74796. // "required": true,
  74797. // "type": "string"
  74798. // }
  74799. // },
  74800. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  74801. // "request": {
  74802. // "$ref": "InstancesSetMachineTypeRequest"
  74803. // },
  74804. // "response": {
  74805. // "$ref": "Operation"
  74806. // },
  74807. // "scopes": [
  74808. // "https://www.googleapis.com/auth/cloud-platform",
  74809. // "https://www.googleapis.com/auth/compute"
  74810. // ]
  74811. // }
  74812. }
  74813. // method id "compute.instances.setMetadata":
  74814. type InstancesSetMetadataCall struct {
  74815. s *Service
  74816. project string
  74817. zone string
  74818. instance string
  74819. metadata *Metadata
  74820. urlParams_ gensupport.URLParams
  74821. ctx_ context.Context
  74822. header_ http.Header
  74823. }
  74824. // SetMetadata: Sets metadata for the specified instance to the data
  74825. // included in the request.
  74826. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  74827. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  74828. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74829. c.project = project
  74830. c.zone = zone
  74831. c.instance = instance
  74832. c.metadata = metadata
  74833. return c
  74834. }
  74835. // RequestId sets the optional parameter "requestId": An optional
  74836. // request ID to identify requests. Specify a unique request ID so that
  74837. // if you must retry your request, the server will know to ignore the
  74838. // request if it has already been completed.
  74839. //
  74840. // For example, consider a situation where you make an initial request
  74841. // and the request times out. If you make the request again with the
  74842. // same request ID, the server can check if original operation with the
  74843. // same request ID was received, and if so, will ignore the second
  74844. // request. This prevents clients from accidentally creating duplicate
  74845. // commitments.
  74846. //
  74847. // The request ID must be a valid UUID with the exception that zero UUID
  74848. // is not supported (00000000-0000-0000-0000-000000000000).
  74849. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  74850. c.urlParams_.Set("requestId", requestId)
  74851. return c
  74852. }
  74853. // Fields allows partial responses to be retrieved. See
  74854. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74855. // for more information.
  74856. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  74857. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74858. return c
  74859. }
  74860. // Context sets the context to be used in this call's Do method. Any
  74861. // pending HTTP request will be aborted if the provided context is
  74862. // canceled.
  74863. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  74864. c.ctx_ = ctx
  74865. return c
  74866. }
  74867. // Header returns an http.Header that can be modified by the caller to
  74868. // add HTTP headers to the request.
  74869. func (c *InstancesSetMetadataCall) Header() http.Header {
  74870. if c.header_ == nil {
  74871. c.header_ = make(http.Header)
  74872. }
  74873. return c.header_
  74874. }
  74875. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  74876. reqHeaders := make(http.Header)
  74877. for k, v := range c.header_ {
  74878. reqHeaders[k] = v
  74879. }
  74880. reqHeaders.Set("User-Agent", c.s.userAgent())
  74881. var body io.Reader = nil
  74882. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  74883. if err != nil {
  74884. return nil, err
  74885. }
  74886. reqHeaders.Set("Content-Type", "application/json")
  74887. c.urlParams_.Set("alt", alt)
  74888. c.urlParams_.Set("prettyPrint", "false")
  74889. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  74890. urls += "?" + c.urlParams_.Encode()
  74891. req, err := http.NewRequest("POST", urls, body)
  74892. if err != nil {
  74893. return nil, err
  74894. }
  74895. req.Header = reqHeaders
  74896. googleapi.Expand(req.URL, map[string]string{
  74897. "project": c.project,
  74898. "zone": c.zone,
  74899. "instance": c.instance,
  74900. })
  74901. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74902. }
  74903. // Do executes the "compute.instances.setMetadata" call.
  74904. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74905. // status code is an error. Response headers are in either
  74906. // *Operation.ServerResponse.Header or (if a response was returned at
  74907. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74908. // to check whether the returned error was because
  74909. // http.StatusNotModified was returned.
  74910. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74911. gensupport.SetOptions(c.urlParams_, opts...)
  74912. res, err := c.doRequest("json")
  74913. if res != nil && res.StatusCode == http.StatusNotModified {
  74914. if res.Body != nil {
  74915. res.Body.Close()
  74916. }
  74917. return nil, &googleapi.Error{
  74918. Code: res.StatusCode,
  74919. Header: res.Header,
  74920. }
  74921. }
  74922. if err != nil {
  74923. return nil, err
  74924. }
  74925. defer googleapi.CloseBody(res)
  74926. if err := googleapi.CheckResponse(res); err != nil {
  74927. return nil, err
  74928. }
  74929. ret := &Operation{
  74930. ServerResponse: googleapi.ServerResponse{
  74931. Header: res.Header,
  74932. HTTPStatusCode: res.StatusCode,
  74933. },
  74934. }
  74935. target := &ret
  74936. if err := gensupport.DecodeResponse(target, res); err != nil {
  74937. return nil, err
  74938. }
  74939. return ret, nil
  74940. // {
  74941. // "description": "Sets metadata for the specified instance to the data included in the request.",
  74942. // "httpMethod": "POST",
  74943. // "id": "compute.instances.setMetadata",
  74944. // "parameterOrder": [
  74945. // "project",
  74946. // "zone",
  74947. // "instance"
  74948. // ],
  74949. // "parameters": {
  74950. // "instance": {
  74951. // "description": "Name of the instance scoping this request.",
  74952. // "location": "path",
  74953. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74954. // "required": true,
  74955. // "type": "string"
  74956. // },
  74957. // "project": {
  74958. // "description": "Project ID for this request.",
  74959. // "location": "path",
  74960. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74961. // "required": true,
  74962. // "type": "string"
  74963. // },
  74964. // "requestId": {
  74965. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74966. // "location": "query",
  74967. // "type": "string"
  74968. // },
  74969. // "zone": {
  74970. // "description": "The name of the zone for this request.",
  74971. // "location": "path",
  74972. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74973. // "required": true,
  74974. // "type": "string"
  74975. // }
  74976. // },
  74977. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  74978. // "request": {
  74979. // "$ref": "Metadata"
  74980. // },
  74981. // "response": {
  74982. // "$ref": "Operation"
  74983. // },
  74984. // "scopes": [
  74985. // "https://www.googleapis.com/auth/cloud-platform",
  74986. // "https://www.googleapis.com/auth/compute"
  74987. // ]
  74988. // }
  74989. }
  74990. // method id "compute.instances.setMinCpuPlatform":
  74991. type InstancesSetMinCpuPlatformCall struct {
  74992. s *Service
  74993. project string
  74994. zone string
  74995. instance string
  74996. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  74997. urlParams_ gensupport.URLParams
  74998. ctx_ context.Context
  74999. header_ http.Header
  75000. }
  75001. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  75002. // instance should use. This method can only be called on a stopped
  75003. // instance. For more information, read Specifying a Minimum CPU
  75004. // Platform.
  75005. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  75006. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75007. c.project = project
  75008. c.zone = zone
  75009. c.instance = instance
  75010. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  75011. return c
  75012. }
  75013. // RequestId sets the optional parameter "requestId": An optional
  75014. // request ID to identify requests. Specify a unique request ID so that
  75015. // if you must retry your request, the server will know to ignore the
  75016. // request if it has already been completed.
  75017. //
  75018. // For example, consider a situation where you make an initial request
  75019. // and the request times out. If you make the request again with the
  75020. // same request ID, the server can check if original operation with the
  75021. // same request ID was received, and if so, will ignore the second
  75022. // request. This prevents clients from accidentally creating duplicate
  75023. // commitments.
  75024. //
  75025. // The request ID must be a valid UUID with the exception that zero UUID
  75026. // is not supported (00000000-0000-0000-0000-000000000000).
  75027. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  75028. c.urlParams_.Set("requestId", requestId)
  75029. return c
  75030. }
  75031. // Fields allows partial responses to be retrieved. See
  75032. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75033. // for more information.
  75034. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  75035. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75036. return c
  75037. }
  75038. // Context sets the context to be used in this call's Do method. Any
  75039. // pending HTTP request will be aborted if the provided context is
  75040. // canceled.
  75041. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  75042. c.ctx_ = ctx
  75043. return c
  75044. }
  75045. // Header returns an http.Header that can be modified by the caller to
  75046. // add HTTP headers to the request.
  75047. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  75048. if c.header_ == nil {
  75049. c.header_ = make(http.Header)
  75050. }
  75051. return c.header_
  75052. }
  75053. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  75054. reqHeaders := make(http.Header)
  75055. for k, v := range c.header_ {
  75056. reqHeaders[k] = v
  75057. }
  75058. reqHeaders.Set("User-Agent", c.s.userAgent())
  75059. var body io.Reader = nil
  75060. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  75061. if err != nil {
  75062. return nil, err
  75063. }
  75064. reqHeaders.Set("Content-Type", "application/json")
  75065. c.urlParams_.Set("alt", alt)
  75066. c.urlParams_.Set("prettyPrint", "false")
  75067. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  75068. urls += "?" + c.urlParams_.Encode()
  75069. req, err := http.NewRequest("POST", urls, body)
  75070. if err != nil {
  75071. return nil, err
  75072. }
  75073. req.Header = reqHeaders
  75074. googleapi.Expand(req.URL, map[string]string{
  75075. "project": c.project,
  75076. "zone": c.zone,
  75077. "instance": c.instance,
  75078. })
  75079. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75080. }
  75081. // Do executes the "compute.instances.setMinCpuPlatform" call.
  75082. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75083. // status code is an error. Response headers are in either
  75084. // *Operation.ServerResponse.Header or (if a response was returned at
  75085. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75086. // to check whether the returned error was because
  75087. // http.StatusNotModified was returned.
  75088. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75089. gensupport.SetOptions(c.urlParams_, opts...)
  75090. res, err := c.doRequest("json")
  75091. if res != nil && res.StatusCode == http.StatusNotModified {
  75092. if res.Body != nil {
  75093. res.Body.Close()
  75094. }
  75095. return nil, &googleapi.Error{
  75096. Code: res.StatusCode,
  75097. Header: res.Header,
  75098. }
  75099. }
  75100. if err != nil {
  75101. return nil, err
  75102. }
  75103. defer googleapi.CloseBody(res)
  75104. if err := googleapi.CheckResponse(res); err != nil {
  75105. return nil, err
  75106. }
  75107. ret := &Operation{
  75108. ServerResponse: googleapi.ServerResponse{
  75109. Header: res.Header,
  75110. HTTPStatusCode: res.StatusCode,
  75111. },
  75112. }
  75113. target := &ret
  75114. if err := gensupport.DecodeResponse(target, res); err != nil {
  75115. return nil, err
  75116. }
  75117. return ret, nil
  75118. // {
  75119. // "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.",
  75120. // "httpMethod": "POST",
  75121. // "id": "compute.instances.setMinCpuPlatform",
  75122. // "parameterOrder": [
  75123. // "project",
  75124. // "zone",
  75125. // "instance"
  75126. // ],
  75127. // "parameters": {
  75128. // "instance": {
  75129. // "description": "Name of the instance scoping this request.",
  75130. // "location": "path",
  75131. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75132. // "required": true,
  75133. // "type": "string"
  75134. // },
  75135. // "project": {
  75136. // "description": "Project ID for this request.",
  75137. // "location": "path",
  75138. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75139. // "required": true,
  75140. // "type": "string"
  75141. // },
  75142. // "requestId": {
  75143. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75144. // "location": "query",
  75145. // "type": "string"
  75146. // },
  75147. // "zone": {
  75148. // "description": "The name of the zone for this request.",
  75149. // "location": "path",
  75150. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75151. // "required": true,
  75152. // "type": "string"
  75153. // }
  75154. // },
  75155. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  75156. // "request": {
  75157. // "$ref": "InstancesSetMinCpuPlatformRequest"
  75158. // },
  75159. // "response": {
  75160. // "$ref": "Operation"
  75161. // },
  75162. // "scopes": [
  75163. // "https://www.googleapis.com/auth/cloud-platform",
  75164. // "https://www.googleapis.com/auth/compute"
  75165. // ]
  75166. // }
  75167. }
  75168. // method id "compute.instances.setScheduling":
  75169. type InstancesSetSchedulingCall struct {
  75170. s *Service
  75171. project string
  75172. zone string
  75173. instance string
  75174. scheduling *Scheduling
  75175. urlParams_ gensupport.URLParams
  75176. ctx_ context.Context
  75177. header_ http.Header
  75178. }
  75179. // SetScheduling: Sets an instance's scheduling options.
  75180. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  75181. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  75182. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75183. c.project = project
  75184. c.zone = zone
  75185. c.instance = instance
  75186. c.scheduling = scheduling
  75187. return c
  75188. }
  75189. // RequestId sets the optional parameter "requestId": An optional
  75190. // request ID to identify requests. Specify a unique request ID so that
  75191. // if you must retry your request, the server will know to ignore the
  75192. // request if it has already been completed.
  75193. //
  75194. // For example, consider a situation where you make an initial request
  75195. // and the request times out. If you make the request again with the
  75196. // same request ID, the server can check if original operation with the
  75197. // same request ID was received, and if so, will ignore the second
  75198. // request. This prevents clients from accidentally creating duplicate
  75199. // commitments.
  75200. //
  75201. // The request ID must be a valid UUID with the exception that zero UUID
  75202. // is not supported (00000000-0000-0000-0000-000000000000).
  75203. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  75204. c.urlParams_.Set("requestId", requestId)
  75205. return c
  75206. }
  75207. // Fields allows partial responses to be retrieved. See
  75208. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75209. // for more information.
  75210. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  75211. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75212. return c
  75213. }
  75214. // Context sets the context to be used in this call's Do method. Any
  75215. // pending HTTP request will be aborted if the provided context is
  75216. // canceled.
  75217. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  75218. c.ctx_ = ctx
  75219. return c
  75220. }
  75221. // Header returns an http.Header that can be modified by the caller to
  75222. // add HTTP headers to the request.
  75223. func (c *InstancesSetSchedulingCall) Header() http.Header {
  75224. if c.header_ == nil {
  75225. c.header_ = make(http.Header)
  75226. }
  75227. return c.header_
  75228. }
  75229. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  75230. reqHeaders := make(http.Header)
  75231. for k, v := range c.header_ {
  75232. reqHeaders[k] = v
  75233. }
  75234. reqHeaders.Set("User-Agent", c.s.userAgent())
  75235. var body io.Reader = nil
  75236. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  75237. if err != nil {
  75238. return nil, err
  75239. }
  75240. reqHeaders.Set("Content-Type", "application/json")
  75241. c.urlParams_.Set("alt", alt)
  75242. c.urlParams_.Set("prettyPrint", "false")
  75243. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  75244. urls += "?" + c.urlParams_.Encode()
  75245. req, err := http.NewRequest("POST", urls, body)
  75246. if err != nil {
  75247. return nil, err
  75248. }
  75249. req.Header = reqHeaders
  75250. googleapi.Expand(req.URL, map[string]string{
  75251. "project": c.project,
  75252. "zone": c.zone,
  75253. "instance": c.instance,
  75254. })
  75255. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75256. }
  75257. // Do executes the "compute.instances.setScheduling" call.
  75258. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75259. // status code is an error. Response headers are in either
  75260. // *Operation.ServerResponse.Header or (if a response was returned at
  75261. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75262. // to check whether the returned error was because
  75263. // http.StatusNotModified was returned.
  75264. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75265. gensupport.SetOptions(c.urlParams_, opts...)
  75266. res, err := c.doRequest("json")
  75267. if res != nil && res.StatusCode == http.StatusNotModified {
  75268. if res.Body != nil {
  75269. res.Body.Close()
  75270. }
  75271. return nil, &googleapi.Error{
  75272. Code: res.StatusCode,
  75273. Header: res.Header,
  75274. }
  75275. }
  75276. if err != nil {
  75277. return nil, err
  75278. }
  75279. defer googleapi.CloseBody(res)
  75280. if err := googleapi.CheckResponse(res); err != nil {
  75281. return nil, err
  75282. }
  75283. ret := &Operation{
  75284. ServerResponse: googleapi.ServerResponse{
  75285. Header: res.Header,
  75286. HTTPStatusCode: res.StatusCode,
  75287. },
  75288. }
  75289. target := &ret
  75290. if err := gensupport.DecodeResponse(target, res); err != nil {
  75291. return nil, err
  75292. }
  75293. return ret, nil
  75294. // {
  75295. // "description": "Sets an instance's scheduling options.",
  75296. // "httpMethod": "POST",
  75297. // "id": "compute.instances.setScheduling",
  75298. // "parameterOrder": [
  75299. // "project",
  75300. // "zone",
  75301. // "instance"
  75302. // ],
  75303. // "parameters": {
  75304. // "instance": {
  75305. // "description": "Instance name for this request.",
  75306. // "location": "path",
  75307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75308. // "required": true,
  75309. // "type": "string"
  75310. // },
  75311. // "project": {
  75312. // "description": "Project ID for this request.",
  75313. // "location": "path",
  75314. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75315. // "required": true,
  75316. // "type": "string"
  75317. // },
  75318. // "requestId": {
  75319. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75320. // "location": "query",
  75321. // "type": "string"
  75322. // },
  75323. // "zone": {
  75324. // "description": "The name of the zone for this request.",
  75325. // "location": "path",
  75326. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75327. // "required": true,
  75328. // "type": "string"
  75329. // }
  75330. // },
  75331. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  75332. // "request": {
  75333. // "$ref": "Scheduling"
  75334. // },
  75335. // "response": {
  75336. // "$ref": "Operation"
  75337. // },
  75338. // "scopes": [
  75339. // "https://www.googleapis.com/auth/cloud-platform",
  75340. // "https://www.googleapis.com/auth/compute"
  75341. // ]
  75342. // }
  75343. }
  75344. // method id "compute.instances.setServiceAccount":
  75345. type InstancesSetServiceAccountCall struct {
  75346. s *Service
  75347. project string
  75348. zone string
  75349. instance string
  75350. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  75351. urlParams_ gensupport.URLParams
  75352. ctx_ context.Context
  75353. header_ http.Header
  75354. }
  75355. // SetServiceAccount: Sets the service account on the instance. For more
  75356. // information, read Changing the service account and access scopes for
  75357. // an instance.
  75358. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  75359. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75360. c.project = project
  75361. c.zone = zone
  75362. c.instance = instance
  75363. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  75364. return c
  75365. }
  75366. // RequestId sets the optional parameter "requestId": An optional
  75367. // request ID to identify requests. Specify a unique request ID so that
  75368. // if you must retry your request, the server will know to ignore the
  75369. // request if it has already been completed.
  75370. //
  75371. // For example, consider a situation where you make an initial request
  75372. // and the request times out. If you make the request again with the
  75373. // same request ID, the server can check if original operation with the
  75374. // same request ID was received, and if so, will ignore the second
  75375. // request. This prevents clients from accidentally creating duplicate
  75376. // commitments.
  75377. //
  75378. // The request ID must be a valid UUID with the exception that zero UUID
  75379. // is not supported (00000000-0000-0000-0000-000000000000).
  75380. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  75381. c.urlParams_.Set("requestId", requestId)
  75382. return c
  75383. }
  75384. // Fields allows partial responses to be retrieved. See
  75385. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75386. // for more information.
  75387. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  75388. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75389. return c
  75390. }
  75391. // Context sets the context to be used in this call's Do method. Any
  75392. // pending HTTP request will be aborted if the provided context is
  75393. // canceled.
  75394. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  75395. c.ctx_ = ctx
  75396. return c
  75397. }
  75398. // Header returns an http.Header that can be modified by the caller to
  75399. // add HTTP headers to the request.
  75400. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  75401. if c.header_ == nil {
  75402. c.header_ = make(http.Header)
  75403. }
  75404. return c.header_
  75405. }
  75406. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  75407. reqHeaders := make(http.Header)
  75408. for k, v := range c.header_ {
  75409. reqHeaders[k] = v
  75410. }
  75411. reqHeaders.Set("User-Agent", c.s.userAgent())
  75412. var body io.Reader = nil
  75413. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  75414. if err != nil {
  75415. return nil, err
  75416. }
  75417. reqHeaders.Set("Content-Type", "application/json")
  75418. c.urlParams_.Set("alt", alt)
  75419. c.urlParams_.Set("prettyPrint", "false")
  75420. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  75421. urls += "?" + c.urlParams_.Encode()
  75422. req, err := http.NewRequest("POST", urls, body)
  75423. if err != nil {
  75424. return nil, err
  75425. }
  75426. req.Header = reqHeaders
  75427. googleapi.Expand(req.URL, map[string]string{
  75428. "project": c.project,
  75429. "zone": c.zone,
  75430. "instance": c.instance,
  75431. })
  75432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75433. }
  75434. // Do executes the "compute.instances.setServiceAccount" call.
  75435. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75436. // status code is an error. Response headers are in either
  75437. // *Operation.ServerResponse.Header or (if a response was returned at
  75438. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75439. // to check whether the returned error was because
  75440. // http.StatusNotModified was returned.
  75441. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75442. gensupport.SetOptions(c.urlParams_, opts...)
  75443. res, err := c.doRequest("json")
  75444. if res != nil && res.StatusCode == http.StatusNotModified {
  75445. if res.Body != nil {
  75446. res.Body.Close()
  75447. }
  75448. return nil, &googleapi.Error{
  75449. Code: res.StatusCode,
  75450. Header: res.Header,
  75451. }
  75452. }
  75453. if err != nil {
  75454. return nil, err
  75455. }
  75456. defer googleapi.CloseBody(res)
  75457. if err := googleapi.CheckResponse(res); err != nil {
  75458. return nil, err
  75459. }
  75460. ret := &Operation{
  75461. ServerResponse: googleapi.ServerResponse{
  75462. Header: res.Header,
  75463. HTTPStatusCode: res.StatusCode,
  75464. },
  75465. }
  75466. target := &ret
  75467. if err := gensupport.DecodeResponse(target, res); err != nil {
  75468. return nil, err
  75469. }
  75470. return ret, nil
  75471. // {
  75472. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  75473. // "httpMethod": "POST",
  75474. // "id": "compute.instances.setServiceAccount",
  75475. // "parameterOrder": [
  75476. // "project",
  75477. // "zone",
  75478. // "instance"
  75479. // ],
  75480. // "parameters": {
  75481. // "instance": {
  75482. // "description": "Name of the instance resource to start.",
  75483. // "location": "path",
  75484. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75485. // "required": true,
  75486. // "type": "string"
  75487. // },
  75488. // "project": {
  75489. // "description": "Project ID for this request.",
  75490. // "location": "path",
  75491. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75492. // "required": true,
  75493. // "type": "string"
  75494. // },
  75495. // "requestId": {
  75496. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75497. // "location": "query",
  75498. // "type": "string"
  75499. // },
  75500. // "zone": {
  75501. // "description": "The name of the zone for this request.",
  75502. // "location": "path",
  75503. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75504. // "required": true,
  75505. // "type": "string"
  75506. // }
  75507. // },
  75508. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  75509. // "request": {
  75510. // "$ref": "InstancesSetServiceAccountRequest"
  75511. // },
  75512. // "response": {
  75513. // "$ref": "Operation"
  75514. // },
  75515. // "scopes": [
  75516. // "https://www.googleapis.com/auth/cloud-platform",
  75517. // "https://www.googleapis.com/auth/compute"
  75518. // ]
  75519. // }
  75520. }
  75521. // method id "compute.instances.setShieldedInstanceIntegrityPolicy":
  75522. type InstancesSetShieldedInstanceIntegrityPolicyCall struct {
  75523. s *Service
  75524. project string
  75525. zone string
  75526. instance string
  75527. shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy
  75528. urlParams_ gensupport.URLParams
  75529. ctx_ context.Context
  75530. header_ http.Header
  75531. }
  75532. // SetShieldedInstanceIntegrityPolicy: Sets the Shielded Instance
  75533. // integrity policy for an instance. You can only use this method on a
  75534. // running instance. This method supports PATCH semantics and uses the
  75535. // JSON merge patch format and processing rules.
  75536. func (r *InstancesService) SetShieldedInstanceIntegrityPolicy(project string, zone string, instance string, shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  75537. c := &InstancesSetShieldedInstanceIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75538. c.project = project
  75539. c.zone = zone
  75540. c.instance = instance
  75541. c.shieldedinstanceintegritypolicy = shieldedinstanceintegritypolicy
  75542. return c
  75543. }
  75544. // RequestId sets the optional parameter "requestId": An optional
  75545. // request ID to identify requests. Specify a unique request ID so that
  75546. // if you must retry your request, the server will know to ignore the
  75547. // request if it has already been completed.
  75548. //
  75549. // For example, consider a situation where you make an initial request
  75550. // and the request times out. If you make the request again with the
  75551. // same request ID, the server can check if original operation with the
  75552. // same request ID was received, and if so, will ignore the second
  75553. // request. This prevents clients from accidentally creating duplicate
  75554. // commitments.
  75555. //
  75556. // The request ID must be a valid UUID with the exception that zero UUID
  75557. // is not supported (00000000-0000-0000-0000-000000000000).
  75558. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  75559. c.urlParams_.Set("requestId", requestId)
  75560. return c
  75561. }
  75562. // Fields allows partial responses to be retrieved. See
  75563. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75564. // for more information.
  75565. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  75566. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75567. return c
  75568. }
  75569. // Context sets the context to be used in this call's Do method. Any
  75570. // pending HTTP request will be aborted if the provided context is
  75571. // canceled.
  75572. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  75573. c.ctx_ = ctx
  75574. return c
  75575. }
  75576. // Header returns an http.Header that can be modified by the caller to
  75577. // add HTTP headers to the request.
  75578. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Header() http.Header {
  75579. if c.header_ == nil {
  75580. c.header_ = make(http.Header)
  75581. }
  75582. return c.header_
  75583. }
  75584. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  75585. reqHeaders := make(http.Header)
  75586. for k, v := range c.header_ {
  75587. reqHeaders[k] = v
  75588. }
  75589. reqHeaders.Set("User-Agent", c.s.userAgent())
  75590. var body io.Reader = nil
  75591. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceintegritypolicy)
  75592. if err != nil {
  75593. return nil, err
  75594. }
  75595. reqHeaders.Set("Content-Type", "application/json")
  75596. c.urlParams_.Set("alt", alt)
  75597. c.urlParams_.Set("prettyPrint", "false")
  75598. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy")
  75599. urls += "?" + c.urlParams_.Encode()
  75600. req, err := http.NewRequest("PATCH", urls, body)
  75601. if err != nil {
  75602. return nil, err
  75603. }
  75604. req.Header = reqHeaders
  75605. googleapi.Expand(req.URL, map[string]string{
  75606. "project": c.project,
  75607. "zone": c.zone,
  75608. "instance": c.instance,
  75609. })
  75610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75611. }
  75612. // Do executes the "compute.instances.setShieldedInstanceIntegrityPolicy" call.
  75613. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75614. // status code is an error. Response headers are in either
  75615. // *Operation.ServerResponse.Header or (if a response was returned at
  75616. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75617. // to check whether the returned error was because
  75618. // http.StatusNotModified was returned.
  75619. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75620. gensupport.SetOptions(c.urlParams_, opts...)
  75621. res, err := c.doRequest("json")
  75622. if res != nil && res.StatusCode == http.StatusNotModified {
  75623. if res.Body != nil {
  75624. res.Body.Close()
  75625. }
  75626. return nil, &googleapi.Error{
  75627. Code: res.StatusCode,
  75628. Header: res.Header,
  75629. }
  75630. }
  75631. if err != nil {
  75632. return nil, err
  75633. }
  75634. defer googleapi.CloseBody(res)
  75635. if err := googleapi.CheckResponse(res); err != nil {
  75636. return nil, err
  75637. }
  75638. ret := &Operation{
  75639. ServerResponse: googleapi.ServerResponse{
  75640. Header: res.Header,
  75641. HTTPStatusCode: res.StatusCode,
  75642. },
  75643. }
  75644. target := &ret
  75645. if err := gensupport.DecodeResponse(target, res); err != nil {
  75646. return nil, err
  75647. }
  75648. return ret, nil
  75649. // {
  75650. // "description": "Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  75651. // "httpMethod": "PATCH",
  75652. // "id": "compute.instances.setShieldedInstanceIntegrityPolicy",
  75653. // "parameterOrder": [
  75654. // "project",
  75655. // "zone",
  75656. // "instance"
  75657. // ],
  75658. // "parameters": {
  75659. // "instance": {
  75660. // "description": "Name or id of the instance scoping this request.",
  75661. // "location": "path",
  75662. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75663. // "required": true,
  75664. // "type": "string"
  75665. // },
  75666. // "project": {
  75667. // "description": "Project ID for this request.",
  75668. // "location": "path",
  75669. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75670. // "required": true,
  75671. // "type": "string"
  75672. // },
  75673. // "requestId": {
  75674. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75675. // "location": "query",
  75676. // "type": "string"
  75677. // },
  75678. // "zone": {
  75679. // "description": "The name of the zone for this request.",
  75680. // "location": "path",
  75681. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75682. // "required": true,
  75683. // "type": "string"
  75684. // }
  75685. // },
  75686. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy",
  75687. // "request": {
  75688. // "$ref": "ShieldedInstanceIntegrityPolicy"
  75689. // },
  75690. // "response": {
  75691. // "$ref": "Operation"
  75692. // },
  75693. // "scopes": [
  75694. // "https://www.googleapis.com/auth/cloud-platform",
  75695. // "https://www.googleapis.com/auth/compute"
  75696. // ]
  75697. // }
  75698. }
  75699. // method id "compute.instances.setShieldedVmIntegrityPolicy":
  75700. type InstancesSetShieldedVmIntegrityPolicyCall struct {
  75701. s *Service
  75702. project string
  75703. zone string
  75704. instance string
  75705. shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy
  75706. urlParams_ gensupport.URLParams
  75707. ctx_ context.Context
  75708. header_ http.Header
  75709. }
  75710. // SetShieldedVmIntegrityPolicy: Sets the Shielded VM integrity policy
  75711. // for a VM instance. You can only use this method on a running VM
  75712. // instance. This method supports PATCH semantics and uses the JSON
  75713. // merge patch format and processing rules.
  75714. func (r *InstancesService) SetShieldedVmIntegrityPolicy(project string, zone string, instance string, shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy) *InstancesSetShieldedVmIntegrityPolicyCall {
  75715. c := &InstancesSetShieldedVmIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75716. c.project = project
  75717. c.zone = zone
  75718. c.instance = instance
  75719. c.shieldedvmintegritypolicy = shieldedvmintegritypolicy
  75720. return c
  75721. }
  75722. // RequestId sets the optional parameter "requestId": An optional
  75723. // request ID to identify requests. Specify a unique request ID so that
  75724. // if you must retry your request, the server will know to ignore the
  75725. // request if it has already been completed.
  75726. //
  75727. // For example, consider a situation where you make an initial request
  75728. // and the request times out. If you make the request again with the
  75729. // same request ID, the server can check if original operation with the
  75730. // same request ID was received, and if so, will ignore the second
  75731. // request. This prevents clients from accidentally creating duplicate
  75732. // commitments.
  75733. //
  75734. // The request ID must be a valid UUID with the exception that zero UUID
  75735. // is not supported (00000000-0000-0000-0000-000000000000).
  75736. func (c *InstancesSetShieldedVmIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedVmIntegrityPolicyCall {
  75737. c.urlParams_.Set("requestId", requestId)
  75738. return c
  75739. }
  75740. // Fields allows partial responses to be retrieved. See
  75741. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75742. // for more information.
  75743. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedVmIntegrityPolicyCall {
  75744. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75745. return c
  75746. }
  75747. // Context sets the context to be used in this call's Do method. Any
  75748. // pending HTTP request will be aborted if the provided context is
  75749. // canceled.
  75750. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedVmIntegrityPolicyCall {
  75751. c.ctx_ = ctx
  75752. return c
  75753. }
  75754. // Header returns an http.Header that can be modified by the caller to
  75755. // add HTTP headers to the request.
  75756. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Header() http.Header {
  75757. if c.header_ == nil {
  75758. c.header_ = make(http.Header)
  75759. }
  75760. return c.header_
  75761. }
  75762. func (c *InstancesSetShieldedVmIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  75763. reqHeaders := make(http.Header)
  75764. for k, v := range c.header_ {
  75765. reqHeaders[k] = v
  75766. }
  75767. reqHeaders.Set("User-Agent", c.s.userAgent())
  75768. var body io.Reader = nil
  75769. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmintegritypolicy)
  75770. if err != nil {
  75771. return nil, err
  75772. }
  75773. reqHeaders.Set("Content-Type", "application/json")
  75774. c.urlParams_.Set("alt", alt)
  75775. c.urlParams_.Set("prettyPrint", "false")
  75776. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy")
  75777. urls += "?" + c.urlParams_.Encode()
  75778. req, err := http.NewRequest("PATCH", urls, body)
  75779. if err != nil {
  75780. return nil, err
  75781. }
  75782. req.Header = reqHeaders
  75783. googleapi.Expand(req.URL, map[string]string{
  75784. "project": c.project,
  75785. "zone": c.zone,
  75786. "instance": c.instance,
  75787. })
  75788. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75789. }
  75790. // Do executes the "compute.instances.setShieldedVmIntegrityPolicy" call.
  75791. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75792. // status code is an error. Response headers are in either
  75793. // *Operation.ServerResponse.Header or (if a response was returned at
  75794. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75795. // to check whether the returned error was because
  75796. // http.StatusNotModified was returned.
  75797. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75798. gensupport.SetOptions(c.urlParams_, opts...)
  75799. res, err := c.doRequest("json")
  75800. if res != nil && res.StatusCode == http.StatusNotModified {
  75801. if res.Body != nil {
  75802. res.Body.Close()
  75803. }
  75804. return nil, &googleapi.Error{
  75805. Code: res.StatusCode,
  75806. Header: res.Header,
  75807. }
  75808. }
  75809. if err != nil {
  75810. return nil, err
  75811. }
  75812. defer googleapi.CloseBody(res)
  75813. if err := googleapi.CheckResponse(res); err != nil {
  75814. return nil, err
  75815. }
  75816. ret := &Operation{
  75817. ServerResponse: googleapi.ServerResponse{
  75818. Header: res.Header,
  75819. HTTPStatusCode: res.StatusCode,
  75820. },
  75821. }
  75822. target := &ret
  75823. if err := gensupport.DecodeResponse(target, res); err != nil {
  75824. return nil, err
  75825. }
  75826. return ret, nil
  75827. // {
  75828. // "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.",
  75829. // "httpMethod": "PATCH",
  75830. // "id": "compute.instances.setShieldedVmIntegrityPolicy",
  75831. // "parameterOrder": [
  75832. // "project",
  75833. // "zone",
  75834. // "instance"
  75835. // ],
  75836. // "parameters": {
  75837. // "instance": {
  75838. // "description": "Name of the instance scoping this request.",
  75839. // "location": "path",
  75840. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75841. // "required": true,
  75842. // "type": "string"
  75843. // },
  75844. // "project": {
  75845. // "description": "Project ID for this request.",
  75846. // "location": "path",
  75847. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75848. // "required": true,
  75849. // "type": "string"
  75850. // },
  75851. // "requestId": {
  75852. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75853. // "location": "query",
  75854. // "type": "string"
  75855. // },
  75856. // "zone": {
  75857. // "description": "The name of the zone for this request.",
  75858. // "location": "path",
  75859. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75860. // "required": true,
  75861. // "type": "string"
  75862. // }
  75863. // },
  75864. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy",
  75865. // "request": {
  75866. // "$ref": "ShieldedVmIntegrityPolicy"
  75867. // },
  75868. // "response": {
  75869. // "$ref": "Operation"
  75870. // },
  75871. // "scopes": [
  75872. // "https://www.googleapis.com/auth/cloud-platform",
  75873. // "https://www.googleapis.com/auth/compute"
  75874. // ]
  75875. // }
  75876. }
  75877. // method id "compute.instances.setTags":
  75878. type InstancesSetTagsCall struct {
  75879. s *Service
  75880. project string
  75881. zone string
  75882. instance string
  75883. tags *Tags
  75884. urlParams_ gensupport.URLParams
  75885. ctx_ context.Context
  75886. header_ http.Header
  75887. }
  75888. // SetTags: Sets network tags for the specified instance to the data
  75889. // included in the request.
  75890. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  75891. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  75892. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75893. c.project = project
  75894. c.zone = zone
  75895. c.instance = instance
  75896. c.tags = tags
  75897. return c
  75898. }
  75899. // RequestId sets the optional parameter "requestId": An optional
  75900. // request ID to identify requests. Specify a unique request ID so that
  75901. // if you must retry your request, the server will know to ignore the
  75902. // request if it has already been completed.
  75903. //
  75904. // For example, consider a situation where you make an initial request
  75905. // and the request times out. If you make the request again with the
  75906. // same request ID, the server can check if original operation with the
  75907. // same request ID was received, and if so, will ignore the second
  75908. // request. This prevents clients from accidentally creating duplicate
  75909. // commitments.
  75910. //
  75911. // The request ID must be a valid UUID with the exception that zero UUID
  75912. // is not supported (00000000-0000-0000-0000-000000000000).
  75913. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  75914. c.urlParams_.Set("requestId", requestId)
  75915. return c
  75916. }
  75917. // Fields allows partial responses to be retrieved. See
  75918. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75919. // for more information.
  75920. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  75921. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75922. return c
  75923. }
  75924. // Context sets the context to be used in this call's Do method. Any
  75925. // pending HTTP request will be aborted if the provided context is
  75926. // canceled.
  75927. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  75928. c.ctx_ = ctx
  75929. return c
  75930. }
  75931. // Header returns an http.Header that can be modified by the caller to
  75932. // add HTTP headers to the request.
  75933. func (c *InstancesSetTagsCall) Header() http.Header {
  75934. if c.header_ == nil {
  75935. c.header_ = make(http.Header)
  75936. }
  75937. return c.header_
  75938. }
  75939. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  75940. reqHeaders := make(http.Header)
  75941. for k, v := range c.header_ {
  75942. reqHeaders[k] = v
  75943. }
  75944. reqHeaders.Set("User-Agent", c.s.userAgent())
  75945. var body io.Reader = nil
  75946. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  75947. if err != nil {
  75948. return nil, err
  75949. }
  75950. reqHeaders.Set("Content-Type", "application/json")
  75951. c.urlParams_.Set("alt", alt)
  75952. c.urlParams_.Set("prettyPrint", "false")
  75953. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  75954. urls += "?" + c.urlParams_.Encode()
  75955. req, err := http.NewRequest("POST", urls, body)
  75956. if err != nil {
  75957. return nil, err
  75958. }
  75959. req.Header = reqHeaders
  75960. googleapi.Expand(req.URL, map[string]string{
  75961. "project": c.project,
  75962. "zone": c.zone,
  75963. "instance": c.instance,
  75964. })
  75965. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75966. }
  75967. // Do executes the "compute.instances.setTags" call.
  75968. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75969. // status code is an error. Response headers are in either
  75970. // *Operation.ServerResponse.Header or (if a response was returned at
  75971. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75972. // to check whether the returned error was because
  75973. // http.StatusNotModified was returned.
  75974. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75975. gensupport.SetOptions(c.urlParams_, opts...)
  75976. res, err := c.doRequest("json")
  75977. if res != nil && res.StatusCode == http.StatusNotModified {
  75978. if res.Body != nil {
  75979. res.Body.Close()
  75980. }
  75981. return nil, &googleapi.Error{
  75982. Code: res.StatusCode,
  75983. Header: res.Header,
  75984. }
  75985. }
  75986. if err != nil {
  75987. return nil, err
  75988. }
  75989. defer googleapi.CloseBody(res)
  75990. if err := googleapi.CheckResponse(res); err != nil {
  75991. return nil, err
  75992. }
  75993. ret := &Operation{
  75994. ServerResponse: googleapi.ServerResponse{
  75995. Header: res.Header,
  75996. HTTPStatusCode: res.StatusCode,
  75997. },
  75998. }
  75999. target := &ret
  76000. if err := gensupport.DecodeResponse(target, res); err != nil {
  76001. return nil, err
  76002. }
  76003. return ret, nil
  76004. // {
  76005. // "description": "Sets network tags for the specified instance to the data included in the request.",
  76006. // "httpMethod": "POST",
  76007. // "id": "compute.instances.setTags",
  76008. // "parameterOrder": [
  76009. // "project",
  76010. // "zone",
  76011. // "instance"
  76012. // ],
  76013. // "parameters": {
  76014. // "instance": {
  76015. // "description": "Name of the instance scoping this request.",
  76016. // "location": "path",
  76017. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76018. // "required": true,
  76019. // "type": "string"
  76020. // },
  76021. // "project": {
  76022. // "description": "Project ID for this request.",
  76023. // "location": "path",
  76024. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76025. // "required": true,
  76026. // "type": "string"
  76027. // },
  76028. // "requestId": {
  76029. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76030. // "location": "query",
  76031. // "type": "string"
  76032. // },
  76033. // "zone": {
  76034. // "description": "The name of the zone for this request.",
  76035. // "location": "path",
  76036. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76037. // "required": true,
  76038. // "type": "string"
  76039. // }
  76040. // },
  76041. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  76042. // "request": {
  76043. // "$ref": "Tags"
  76044. // },
  76045. // "response": {
  76046. // "$ref": "Operation"
  76047. // },
  76048. // "scopes": [
  76049. // "https://www.googleapis.com/auth/cloud-platform",
  76050. // "https://www.googleapis.com/auth/compute"
  76051. // ]
  76052. // }
  76053. }
  76054. // method id "compute.instances.simulateMaintenanceEvent":
  76055. type InstancesSimulateMaintenanceEventCall struct {
  76056. s *Service
  76057. project string
  76058. zone string
  76059. instance string
  76060. urlParams_ gensupport.URLParams
  76061. ctx_ context.Context
  76062. header_ http.Header
  76063. }
  76064. // SimulateMaintenanceEvent: Simulates a maintenance event on the
  76065. // instance.
  76066. func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
  76067. c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76068. c.project = project
  76069. c.zone = zone
  76070. c.instance = instance
  76071. return c
  76072. }
  76073. // Fields allows partial responses to be retrieved. See
  76074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76075. // for more information.
  76076. func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
  76077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76078. return c
  76079. }
  76080. // Context sets the context to be used in this call's Do method. Any
  76081. // pending HTTP request will be aborted if the provided context is
  76082. // canceled.
  76083. func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
  76084. c.ctx_ = ctx
  76085. return c
  76086. }
  76087. // Header returns an http.Header that can be modified by the caller to
  76088. // add HTTP headers to the request.
  76089. func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header {
  76090. if c.header_ == nil {
  76091. c.header_ = make(http.Header)
  76092. }
  76093. return c.header_
  76094. }
  76095. func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  76096. reqHeaders := make(http.Header)
  76097. for k, v := range c.header_ {
  76098. reqHeaders[k] = v
  76099. }
  76100. reqHeaders.Set("User-Agent", c.s.userAgent())
  76101. var body io.Reader = nil
  76102. c.urlParams_.Set("alt", alt)
  76103. c.urlParams_.Set("prettyPrint", "false")
  76104. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
  76105. urls += "?" + c.urlParams_.Encode()
  76106. req, err := http.NewRequest("POST", urls, body)
  76107. if err != nil {
  76108. return nil, err
  76109. }
  76110. req.Header = reqHeaders
  76111. googleapi.Expand(req.URL, map[string]string{
  76112. "project": c.project,
  76113. "zone": c.zone,
  76114. "instance": c.instance,
  76115. })
  76116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76117. }
  76118. // Do executes the "compute.instances.simulateMaintenanceEvent" call.
  76119. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76120. // status code is an error. Response headers are in either
  76121. // *Operation.ServerResponse.Header or (if a response was returned at
  76122. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76123. // to check whether the returned error was because
  76124. // http.StatusNotModified was returned.
  76125. func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76126. gensupport.SetOptions(c.urlParams_, opts...)
  76127. res, err := c.doRequest("json")
  76128. if res != nil && res.StatusCode == http.StatusNotModified {
  76129. if res.Body != nil {
  76130. res.Body.Close()
  76131. }
  76132. return nil, &googleapi.Error{
  76133. Code: res.StatusCode,
  76134. Header: res.Header,
  76135. }
  76136. }
  76137. if err != nil {
  76138. return nil, err
  76139. }
  76140. defer googleapi.CloseBody(res)
  76141. if err := googleapi.CheckResponse(res); err != nil {
  76142. return nil, err
  76143. }
  76144. ret := &Operation{
  76145. ServerResponse: googleapi.ServerResponse{
  76146. Header: res.Header,
  76147. HTTPStatusCode: res.StatusCode,
  76148. },
  76149. }
  76150. target := &ret
  76151. if err := gensupport.DecodeResponse(target, res); err != nil {
  76152. return nil, err
  76153. }
  76154. return ret, nil
  76155. // {
  76156. // "description": "Simulates a maintenance event on the instance.",
  76157. // "httpMethod": "POST",
  76158. // "id": "compute.instances.simulateMaintenanceEvent",
  76159. // "parameterOrder": [
  76160. // "project",
  76161. // "zone",
  76162. // "instance"
  76163. // ],
  76164. // "parameters": {
  76165. // "instance": {
  76166. // "description": "Name of the instance scoping this request.",
  76167. // "location": "path",
  76168. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76169. // "required": true,
  76170. // "type": "string"
  76171. // },
  76172. // "project": {
  76173. // "description": "Project ID for this request.",
  76174. // "location": "path",
  76175. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76176. // "required": true,
  76177. // "type": "string"
  76178. // },
  76179. // "zone": {
  76180. // "description": "The name of the zone for this request.",
  76181. // "location": "path",
  76182. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76183. // "required": true,
  76184. // "type": "string"
  76185. // }
  76186. // },
  76187. // "path": "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
  76188. // "response": {
  76189. // "$ref": "Operation"
  76190. // },
  76191. // "scopes": [
  76192. // "https://www.googleapis.com/auth/cloud-platform",
  76193. // "https://www.googleapis.com/auth/compute"
  76194. // ]
  76195. // }
  76196. }
  76197. // method id "compute.instances.start":
  76198. type InstancesStartCall struct {
  76199. s *Service
  76200. project string
  76201. zone string
  76202. instance string
  76203. urlParams_ gensupport.URLParams
  76204. ctx_ context.Context
  76205. header_ http.Header
  76206. }
  76207. // Start: Starts an instance that was stopped using the instances().stop
  76208. // method. For more information, see Restart an instance.
  76209. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  76210. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  76211. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76212. c.project = project
  76213. c.zone = zone
  76214. c.instance = instance
  76215. return c
  76216. }
  76217. // RequestId sets the optional parameter "requestId": An optional
  76218. // request ID to identify requests. Specify a unique request ID so that
  76219. // if you must retry your request, the server will know to ignore the
  76220. // request if it has already been completed.
  76221. //
  76222. // For example, consider a situation where you make an initial request
  76223. // and the request times out. If you make the request again with the
  76224. // same request ID, the server can check if original operation with the
  76225. // same request ID was received, and if so, will ignore the second
  76226. // request. This prevents clients from accidentally creating duplicate
  76227. // commitments.
  76228. //
  76229. // The request ID must be a valid UUID with the exception that zero UUID
  76230. // is not supported (00000000-0000-0000-0000-000000000000).
  76231. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  76232. c.urlParams_.Set("requestId", requestId)
  76233. return c
  76234. }
  76235. // Fields allows partial responses to be retrieved. See
  76236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76237. // for more information.
  76238. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  76239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76240. return c
  76241. }
  76242. // Context sets the context to be used in this call's Do method. Any
  76243. // pending HTTP request will be aborted if the provided context is
  76244. // canceled.
  76245. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  76246. c.ctx_ = ctx
  76247. return c
  76248. }
  76249. // Header returns an http.Header that can be modified by the caller to
  76250. // add HTTP headers to the request.
  76251. func (c *InstancesStartCall) Header() http.Header {
  76252. if c.header_ == nil {
  76253. c.header_ = make(http.Header)
  76254. }
  76255. return c.header_
  76256. }
  76257. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  76258. reqHeaders := make(http.Header)
  76259. for k, v := range c.header_ {
  76260. reqHeaders[k] = v
  76261. }
  76262. reqHeaders.Set("User-Agent", c.s.userAgent())
  76263. var body io.Reader = nil
  76264. c.urlParams_.Set("alt", alt)
  76265. c.urlParams_.Set("prettyPrint", "false")
  76266. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  76267. urls += "?" + c.urlParams_.Encode()
  76268. req, err := http.NewRequest("POST", urls, body)
  76269. if err != nil {
  76270. return nil, err
  76271. }
  76272. req.Header = reqHeaders
  76273. googleapi.Expand(req.URL, map[string]string{
  76274. "project": c.project,
  76275. "zone": c.zone,
  76276. "instance": c.instance,
  76277. })
  76278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76279. }
  76280. // Do executes the "compute.instances.start" call.
  76281. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76282. // status code is an error. Response headers are in either
  76283. // *Operation.ServerResponse.Header or (if a response was returned at
  76284. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76285. // to check whether the returned error was because
  76286. // http.StatusNotModified was returned.
  76287. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76288. gensupport.SetOptions(c.urlParams_, opts...)
  76289. res, err := c.doRequest("json")
  76290. if res != nil && res.StatusCode == http.StatusNotModified {
  76291. if res.Body != nil {
  76292. res.Body.Close()
  76293. }
  76294. return nil, &googleapi.Error{
  76295. Code: res.StatusCode,
  76296. Header: res.Header,
  76297. }
  76298. }
  76299. if err != nil {
  76300. return nil, err
  76301. }
  76302. defer googleapi.CloseBody(res)
  76303. if err := googleapi.CheckResponse(res); err != nil {
  76304. return nil, err
  76305. }
  76306. ret := &Operation{
  76307. ServerResponse: googleapi.ServerResponse{
  76308. Header: res.Header,
  76309. HTTPStatusCode: res.StatusCode,
  76310. },
  76311. }
  76312. target := &ret
  76313. if err := gensupport.DecodeResponse(target, res); err != nil {
  76314. return nil, err
  76315. }
  76316. return ret, nil
  76317. // {
  76318. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  76319. // "httpMethod": "POST",
  76320. // "id": "compute.instances.start",
  76321. // "parameterOrder": [
  76322. // "project",
  76323. // "zone",
  76324. // "instance"
  76325. // ],
  76326. // "parameters": {
  76327. // "instance": {
  76328. // "description": "Name of the instance resource to start.",
  76329. // "location": "path",
  76330. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76331. // "required": true,
  76332. // "type": "string"
  76333. // },
  76334. // "project": {
  76335. // "description": "Project ID for this request.",
  76336. // "location": "path",
  76337. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76338. // "required": true,
  76339. // "type": "string"
  76340. // },
  76341. // "requestId": {
  76342. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76343. // "location": "query",
  76344. // "type": "string"
  76345. // },
  76346. // "zone": {
  76347. // "description": "The name of the zone for this request.",
  76348. // "location": "path",
  76349. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76350. // "required": true,
  76351. // "type": "string"
  76352. // }
  76353. // },
  76354. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  76355. // "response": {
  76356. // "$ref": "Operation"
  76357. // },
  76358. // "scopes": [
  76359. // "https://www.googleapis.com/auth/cloud-platform",
  76360. // "https://www.googleapis.com/auth/compute"
  76361. // ]
  76362. // }
  76363. }
  76364. // method id "compute.instances.startWithEncryptionKey":
  76365. type InstancesStartWithEncryptionKeyCall struct {
  76366. s *Service
  76367. project string
  76368. zone string
  76369. instance string
  76370. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  76371. urlParams_ gensupport.URLParams
  76372. ctx_ context.Context
  76373. header_ http.Header
  76374. }
  76375. // StartWithEncryptionKey: Starts an instance that was stopped using the
  76376. // instances().stop method. For more information, see Restart an
  76377. // instance.
  76378. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  76379. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76380. c.project = project
  76381. c.zone = zone
  76382. c.instance = instance
  76383. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  76384. return c
  76385. }
  76386. // RequestId sets the optional parameter "requestId": An optional
  76387. // request ID to identify requests. Specify a unique request ID so that
  76388. // if you must retry your request, the server will know to ignore the
  76389. // request if it has already been completed.
  76390. //
  76391. // For example, consider a situation where you make an initial request
  76392. // and the request times out. If you make the request again with the
  76393. // same request ID, the server can check if original operation with the
  76394. // same request ID was received, and if so, will ignore the second
  76395. // request. This prevents clients from accidentally creating duplicate
  76396. // commitments.
  76397. //
  76398. // The request ID must be a valid UUID with the exception that zero UUID
  76399. // is not supported (00000000-0000-0000-0000-000000000000).
  76400. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  76401. c.urlParams_.Set("requestId", requestId)
  76402. return c
  76403. }
  76404. // Fields allows partial responses to be retrieved. See
  76405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76406. // for more information.
  76407. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  76408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76409. return c
  76410. }
  76411. // Context sets the context to be used in this call's Do method. Any
  76412. // pending HTTP request will be aborted if the provided context is
  76413. // canceled.
  76414. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  76415. c.ctx_ = ctx
  76416. return c
  76417. }
  76418. // Header returns an http.Header that can be modified by the caller to
  76419. // add HTTP headers to the request.
  76420. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  76421. if c.header_ == nil {
  76422. c.header_ = make(http.Header)
  76423. }
  76424. return c.header_
  76425. }
  76426. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  76427. reqHeaders := make(http.Header)
  76428. for k, v := range c.header_ {
  76429. reqHeaders[k] = v
  76430. }
  76431. reqHeaders.Set("User-Agent", c.s.userAgent())
  76432. var body io.Reader = nil
  76433. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  76434. if err != nil {
  76435. return nil, err
  76436. }
  76437. reqHeaders.Set("Content-Type", "application/json")
  76438. c.urlParams_.Set("alt", alt)
  76439. c.urlParams_.Set("prettyPrint", "false")
  76440. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  76441. urls += "?" + c.urlParams_.Encode()
  76442. req, err := http.NewRequest("POST", urls, body)
  76443. if err != nil {
  76444. return nil, err
  76445. }
  76446. req.Header = reqHeaders
  76447. googleapi.Expand(req.URL, map[string]string{
  76448. "project": c.project,
  76449. "zone": c.zone,
  76450. "instance": c.instance,
  76451. })
  76452. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76453. }
  76454. // Do executes the "compute.instances.startWithEncryptionKey" call.
  76455. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76456. // status code is an error. Response headers are in either
  76457. // *Operation.ServerResponse.Header or (if a response was returned at
  76458. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76459. // to check whether the returned error was because
  76460. // http.StatusNotModified was returned.
  76461. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76462. gensupport.SetOptions(c.urlParams_, opts...)
  76463. res, err := c.doRequest("json")
  76464. if res != nil && res.StatusCode == http.StatusNotModified {
  76465. if res.Body != nil {
  76466. res.Body.Close()
  76467. }
  76468. return nil, &googleapi.Error{
  76469. Code: res.StatusCode,
  76470. Header: res.Header,
  76471. }
  76472. }
  76473. if err != nil {
  76474. return nil, err
  76475. }
  76476. defer googleapi.CloseBody(res)
  76477. if err := googleapi.CheckResponse(res); err != nil {
  76478. return nil, err
  76479. }
  76480. ret := &Operation{
  76481. ServerResponse: googleapi.ServerResponse{
  76482. Header: res.Header,
  76483. HTTPStatusCode: res.StatusCode,
  76484. },
  76485. }
  76486. target := &ret
  76487. if err := gensupport.DecodeResponse(target, res); err != nil {
  76488. return nil, err
  76489. }
  76490. return ret, nil
  76491. // {
  76492. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  76493. // "httpMethod": "POST",
  76494. // "id": "compute.instances.startWithEncryptionKey",
  76495. // "parameterOrder": [
  76496. // "project",
  76497. // "zone",
  76498. // "instance"
  76499. // ],
  76500. // "parameters": {
  76501. // "instance": {
  76502. // "description": "Name of the instance resource to start.",
  76503. // "location": "path",
  76504. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76505. // "required": true,
  76506. // "type": "string"
  76507. // },
  76508. // "project": {
  76509. // "description": "Project ID for this request.",
  76510. // "location": "path",
  76511. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76512. // "required": true,
  76513. // "type": "string"
  76514. // },
  76515. // "requestId": {
  76516. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76517. // "location": "query",
  76518. // "type": "string"
  76519. // },
  76520. // "zone": {
  76521. // "description": "The name of the zone for this request.",
  76522. // "location": "path",
  76523. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76524. // "required": true,
  76525. // "type": "string"
  76526. // }
  76527. // },
  76528. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  76529. // "request": {
  76530. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  76531. // },
  76532. // "response": {
  76533. // "$ref": "Operation"
  76534. // },
  76535. // "scopes": [
  76536. // "https://www.googleapis.com/auth/cloud-platform",
  76537. // "https://www.googleapis.com/auth/compute"
  76538. // ]
  76539. // }
  76540. }
  76541. // method id "compute.instances.stop":
  76542. type InstancesStopCall struct {
  76543. s *Service
  76544. project string
  76545. zone string
  76546. instance string
  76547. urlParams_ gensupport.URLParams
  76548. ctx_ context.Context
  76549. header_ http.Header
  76550. }
  76551. // Stop: Stops a running instance, shutting it down cleanly, and allows
  76552. // you to restart the instance at a later time. Stopped instances do not
  76553. // incur VM usage charges while they are stopped. However, resources
  76554. // that the VM is using, such as persistent disks and static IP
  76555. // addresses, will continue to be charged until they are deleted. For
  76556. // more information, see Stopping an instance.
  76557. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  76558. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  76559. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76560. c.project = project
  76561. c.zone = zone
  76562. c.instance = instance
  76563. return c
  76564. }
  76565. // DiscardLocalSsd sets the optional parameter "discardLocalSsd": If
  76566. // true, discard the contents of any attached localSSD partitions.
  76567. // Default value is false (== preserve localSSD data).
  76568. func (c *InstancesStopCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesStopCall {
  76569. c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
  76570. return c
  76571. }
  76572. // RequestId sets the optional parameter "requestId": An optional
  76573. // request ID to identify requests. Specify a unique request ID so that
  76574. // if you must retry your request, the server will know to ignore the
  76575. // request if it has already been completed.
  76576. //
  76577. // For example, consider a situation where you make an initial request
  76578. // and the request times out. If you make the request again with the
  76579. // same request ID, the server can check if original operation with the
  76580. // same request ID was received, and if so, will ignore the second
  76581. // request. This prevents clients from accidentally creating duplicate
  76582. // commitments.
  76583. //
  76584. // The request ID must be a valid UUID with the exception that zero UUID
  76585. // is not supported (00000000-0000-0000-0000-000000000000).
  76586. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  76587. c.urlParams_.Set("requestId", requestId)
  76588. return c
  76589. }
  76590. // Fields allows partial responses to be retrieved. See
  76591. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76592. // for more information.
  76593. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  76594. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76595. return c
  76596. }
  76597. // Context sets the context to be used in this call's Do method. Any
  76598. // pending HTTP request will be aborted if the provided context is
  76599. // canceled.
  76600. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  76601. c.ctx_ = ctx
  76602. return c
  76603. }
  76604. // Header returns an http.Header that can be modified by the caller to
  76605. // add HTTP headers to the request.
  76606. func (c *InstancesStopCall) Header() http.Header {
  76607. if c.header_ == nil {
  76608. c.header_ = make(http.Header)
  76609. }
  76610. return c.header_
  76611. }
  76612. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  76613. reqHeaders := make(http.Header)
  76614. for k, v := range c.header_ {
  76615. reqHeaders[k] = v
  76616. }
  76617. reqHeaders.Set("User-Agent", c.s.userAgent())
  76618. var body io.Reader = nil
  76619. c.urlParams_.Set("alt", alt)
  76620. c.urlParams_.Set("prettyPrint", "false")
  76621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  76622. urls += "?" + c.urlParams_.Encode()
  76623. req, err := http.NewRequest("POST", urls, body)
  76624. if err != nil {
  76625. return nil, err
  76626. }
  76627. req.Header = reqHeaders
  76628. googleapi.Expand(req.URL, map[string]string{
  76629. "project": c.project,
  76630. "zone": c.zone,
  76631. "instance": c.instance,
  76632. })
  76633. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76634. }
  76635. // Do executes the "compute.instances.stop" call.
  76636. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76637. // status code is an error. Response headers are in either
  76638. // *Operation.ServerResponse.Header or (if a response was returned at
  76639. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76640. // to check whether the returned error was because
  76641. // http.StatusNotModified was returned.
  76642. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76643. gensupport.SetOptions(c.urlParams_, opts...)
  76644. res, err := c.doRequest("json")
  76645. if res != nil && res.StatusCode == http.StatusNotModified {
  76646. if res.Body != nil {
  76647. res.Body.Close()
  76648. }
  76649. return nil, &googleapi.Error{
  76650. Code: res.StatusCode,
  76651. Header: res.Header,
  76652. }
  76653. }
  76654. if err != nil {
  76655. return nil, err
  76656. }
  76657. defer googleapi.CloseBody(res)
  76658. if err := googleapi.CheckResponse(res); err != nil {
  76659. return nil, err
  76660. }
  76661. ret := &Operation{
  76662. ServerResponse: googleapi.ServerResponse{
  76663. Header: res.Header,
  76664. HTTPStatusCode: res.StatusCode,
  76665. },
  76666. }
  76667. target := &ret
  76668. if err := gensupport.DecodeResponse(target, res); err != nil {
  76669. return nil, err
  76670. }
  76671. return ret, nil
  76672. // {
  76673. // "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.",
  76674. // "httpMethod": "POST",
  76675. // "id": "compute.instances.stop",
  76676. // "parameterOrder": [
  76677. // "project",
  76678. // "zone",
  76679. // "instance"
  76680. // ],
  76681. // "parameters": {
  76682. // "discardLocalSsd": {
  76683. // "description": "If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data).",
  76684. // "location": "query",
  76685. // "type": "boolean"
  76686. // },
  76687. // "instance": {
  76688. // "description": "Name of the instance resource to stop.",
  76689. // "location": "path",
  76690. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76691. // "required": true,
  76692. // "type": "string"
  76693. // },
  76694. // "project": {
  76695. // "description": "Project ID for this request.",
  76696. // "location": "path",
  76697. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76698. // "required": true,
  76699. // "type": "string"
  76700. // },
  76701. // "requestId": {
  76702. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76703. // "location": "query",
  76704. // "type": "string"
  76705. // },
  76706. // "zone": {
  76707. // "description": "The name of the zone for this request.",
  76708. // "location": "path",
  76709. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76710. // "required": true,
  76711. // "type": "string"
  76712. // }
  76713. // },
  76714. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  76715. // "response": {
  76716. // "$ref": "Operation"
  76717. // },
  76718. // "scopes": [
  76719. // "https://www.googleapis.com/auth/cloud-platform",
  76720. // "https://www.googleapis.com/auth/compute"
  76721. // ]
  76722. // }
  76723. }
  76724. // method id "compute.instances.suspend":
  76725. type InstancesSuspendCall struct {
  76726. s *Service
  76727. project string
  76728. zone string
  76729. instance string
  76730. urlParams_ gensupport.URLParams
  76731. ctx_ context.Context
  76732. header_ http.Header
  76733. }
  76734. // Suspend: This method suspends a running instance, saving its state to
  76735. // persistent storage, and allows you to resume the instance at a later
  76736. // time. Suspended instances incur reduced per-minute, virtual machine
  76737. // usage charges while they are suspended. Any resources the virtual
  76738. // machine is using, such as persistent disks and static IP addresses,
  76739. // will continue to be charged until they are deleted.
  76740. func (r *InstancesService) Suspend(project string, zone string, instance string) *InstancesSuspendCall {
  76741. c := &InstancesSuspendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76742. c.project = project
  76743. c.zone = zone
  76744. c.instance = instance
  76745. return c
  76746. }
  76747. // DiscardLocalSsd sets the optional parameter "discardLocalSsd": If
  76748. // true, discard the contents of any attached localSSD partitions.
  76749. // Default value is false (== preserve localSSD data).
  76750. func (c *InstancesSuspendCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesSuspendCall {
  76751. c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
  76752. return c
  76753. }
  76754. // RequestId sets the optional parameter "requestId": An optional
  76755. // request ID to identify requests. Specify a unique request ID so that
  76756. // if you must retry your request, the server will know to ignore the
  76757. // request if it has already been completed.
  76758. //
  76759. // For example, consider a situation where you make an initial request
  76760. // and the request times out. If you make the request again with the
  76761. // same request ID, the server can check if original operation with the
  76762. // same request ID was received, and if so, will ignore the second
  76763. // request. This prevents clients from accidentally creating duplicate
  76764. // commitments.
  76765. //
  76766. // The request ID must be a valid UUID with the exception that zero UUID
  76767. // is not supported (00000000-0000-0000-0000-000000000000).
  76768. func (c *InstancesSuspendCall) RequestId(requestId string) *InstancesSuspendCall {
  76769. c.urlParams_.Set("requestId", requestId)
  76770. return c
  76771. }
  76772. // Fields allows partial responses to be retrieved. See
  76773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76774. // for more information.
  76775. func (c *InstancesSuspendCall) Fields(s ...googleapi.Field) *InstancesSuspendCall {
  76776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76777. return c
  76778. }
  76779. // Context sets the context to be used in this call's Do method. Any
  76780. // pending HTTP request will be aborted if the provided context is
  76781. // canceled.
  76782. func (c *InstancesSuspendCall) Context(ctx context.Context) *InstancesSuspendCall {
  76783. c.ctx_ = ctx
  76784. return c
  76785. }
  76786. // Header returns an http.Header that can be modified by the caller to
  76787. // add HTTP headers to the request.
  76788. func (c *InstancesSuspendCall) Header() http.Header {
  76789. if c.header_ == nil {
  76790. c.header_ = make(http.Header)
  76791. }
  76792. return c.header_
  76793. }
  76794. func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) {
  76795. reqHeaders := make(http.Header)
  76796. for k, v := range c.header_ {
  76797. reqHeaders[k] = v
  76798. }
  76799. reqHeaders.Set("User-Agent", c.s.userAgent())
  76800. var body io.Reader = nil
  76801. c.urlParams_.Set("alt", alt)
  76802. c.urlParams_.Set("prettyPrint", "false")
  76803. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/suspend")
  76804. urls += "?" + c.urlParams_.Encode()
  76805. req, err := http.NewRequest("POST", urls, body)
  76806. if err != nil {
  76807. return nil, err
  76808. }
  76809. req.Header = reqHeaders
  76810. googleapi.Expand(req.URL, map[string]string{
  76811. "project": c.project,
  76812. "zone": c.zone,
  76813. "instance": c.instance,
  76814. })
  76815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76816. }
  76817. // Do executes the "compute.instances.suspend" call.
  76818. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76819. // status code is an error. Response headers are in either
  76820. // *Operation.ServerResponse.Header or (if a response was returned at
  76821. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76822. // to check whether the returned error was because
  76823. // http.StatusNotModified was returned.
  76824. func (c *InstancesSuspendCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76825. gensupport.SetOptions(c.urlParams_, opts...)
  76826. res, err := c.doRequest("json")
  76827. if res != nil && res.StatusCode == http.StatusNotModified {
  76828. if res.Body != nil {
  76829. res.Body.Close()
  76830. }
  76831. return nil, &googleapi.Error{
  76832. Code: res.StatusCode,
  76833. Header: res.Header,
  76834. }
  76835. }
  76836. if err != nil {
  76837. return nil, err
  76838. }
  76839. defer googleapi.CloseBody(res)
  76840. if err := googleapi.CheckResponse(res); err != nil {
  76841. return nil, err
  76842. }
  76843. ret := &Operation{
  76844. ServerResponse: googleapi.ServerResponse{
  76845. Header: res.Header,
  76846. HTTPStatusCode: res.StatusCode,
  76847. },
  76848. }
  76849. target := &ret
  76850. if err := gensupport.DecodeResponse(target, res); err != nil {
  76851. return nil, err
  76852. }
  76853. return ret, nil
  76854. // {
  76855. // "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.",
  76856. // "httpMethod": "POST",
  76857. // "id": "compute.instances.suspend",
  76858. // "parameterOrder": [
  76859. // "project",
  76860. // "zone",
  76861. // "instance"
  76862. // ],
  76863. // "parameters": {
  76864. // "discardLocalSsd": {
  76865. // "description": "If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data).",
  76866. // "location": "query",
  76867. // "type": "boolean"
  76868. // },
  76869. // "instance": {
  76870. // "description": "Name of the instance resource to suspend.",
  76871. // "location": "path",
  76872. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76873. // "required": true,
  76874. // "type": "string"
  76875. // },
  76876. // "project": {
  76877. // "description": "Project ID for this request.",
  76878. // "location": "path",
  76879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76880. // "required": true,
  76881. // "type": "string"
  76882. // },
  76883. // "requestId": {
  76884. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76885. // "location": "query",
  76886. // "type": "string"
  76887. // },
  76888. // "zone": {
  76889. // "description": "The name of the zone for this request.",
  76890. // "location": "path",
  76891. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76892. // "required": true,
  76893. // "type": "string"
  76894. // }
  76895. // },
  76896. // "path": "{project}/zones/{zone}/instances/{instance}/suspend",
  76897. // "response": {
  76898. // "$ref": "Operation"
  76899. // },
  76900. // "scopes": [
  76901. // "https://www.googleapis.com/auth/cloud-platform",
  76902. // "https://www.googleapis.com/auth/compute"
  76903. // ]
  76904. // }
  76905. }
  76906. // method id "compute.instances.testIamPermissions":
  76907. type InstancesTestIamPermissionsCall struct {
  76908. s *Service
  76909. project string
  76910. zone string
  76911. resource string
  76912. testpermissionsrequest *TestPermissionsRequest
  76913. urlParams_ gensupport.URLParams
  76914. ctx_ context.Context
  76915. header_ http.Header
  76916. }
  76917. // TestIamPermissions: Returns permissions that a caller has on the
  76918. // specified resource.
  76919. func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
  76920. c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76921. c.project = project
  76922. c.zone = zone
  76923. c.resource = resource
  76924. c.testpermissionsrequest = testpermissionsrequest
  76925. return c
  76926. }
  76927. // Fields allows partial responses to be retrieved. See
  76928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76929. // for more information.
  76930. func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
  76931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76932. return c
  76933. }
  76934. // Context sets the context to be used in this call's Do method. Any
  76935. // pending HTTP request will be aborted if the provided context is
  76936. // canceled.
  76937. func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
  76938. c.ctx_ = ctx
  76939. return c
  76940. }
  76941. // Header returns an http.Header that can be modified by the caller to
  76942. // add HTTP headers to the request.
  76943. func (c *InstancesTestIamPermissionsCall) Header() http.Header {
  76944. if c.header_ == nil {
  76945. c.header_ = make(http.Header)
  76946. }
  76947. return c.header_
  76948. }
  76949. func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  76950. reqHeaders := make(http.Header)
  76951. for k, v := range c.header_ {
  76952. reqHeaders[k] = v
  76953. }
  76954. reqHeaders.Set("User-Agent", c.s.userAgent())
  76955. var body io.Reader = nil
  76956. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  76957. if err != nil {
  76958. return nil, err
  76959. }
  76960. reqHeaders.Set("Content-Type", "application/json")
  76961. c.urlParams_.Set("alt", alt)
  76962. c.urlParams_.Set("prettyPrint", "false")
  76963. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/testIamPermissions")
  76964. urls += "?" + c.urlParams_.Encode()
  76965. req, err := http.NewRequest("POST", urls, body)
  76966. if err != nil {
  76967. return nil, err
  76968. }
  76969. req.Header = reqHeaders
  76970. googleapi.Expand(req.URL, map[string]string{
  76971. "project": c.project,
  76972. "zone": c.zone,
  76973. "resource": c.resource,
  76974. })
  76975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76976. }
  76977. // Do executes the "compute.instances.testIamPermissions" call.
  76978. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  76979. // non-2xx status code is an error. Response headers are in either
  76980. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  76981. // returned at all) in error.(*googleapi.Error).Header. Use
  76982. // googleapi.IsNotModified to check whether the returned error was
  76983. // because http.StatusNotModified was returned.
  76984. func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  76985. gensupport.SetOptions(c.urlParams_, opts...)
  76986. res, err := c.doRequest("json")
  76987. if res != nil && res.StatusCode == http.StatusNotModified {
  76988. if res.Body != nil {
  76989. res.Body.Close()
  76990. }
  76991. return nil, &googleapi.Error{
  76992. Code: res.StatusCode,
  76993. Header: res.Header,
  76994. }
  76995. }
  76996. if err != nil {
  76997. return nil, err
  76998. }
  76999. defer googleapi.CloseBody(res)
  77000. if err := googleapi.CheckResponse(res); err != nil {
  77001. return nil, err
  77002. }
  77003. ret := &TestPermissionsResponse{
  77004. ServerResponse: googleapi.ServerResponse{
  77005. Header: res.Header,
  77006. HTTPStatusCode: res.StatusCode,
  77007. },
  77008. }
  77009. target := &ret
  77010. if err := gensupport.DecodeResponse(target, res); err != nil {
  77011. return nil, err
  77012. }
  77013. return ret, nil
  77014. // {
  77015. // "description": "Returns permissions that a caller has on the specified resource.",
  77016. // "httpMethod": "POST",
  77017. // "id": "compute.instances.testIamPermissions",
  77018. // "parameterOrder": [
  77019. // "project",
  77020. // "zone",
  77021. // "resource"
  77022. // ],
  77023. // "parameters": {
  77024. // "project": {
  77025. // "description": "Project ID for this request.",
  77026. // "location": "path",
  77027. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77028. // "required": true,
  77029. // "type": "string"
  77030. // },
  77031. // "resource": {
  77032. // "description": "Name or id of the resource for this request.",
  77033. // "location": "path",
  77034. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77035. // "required": true,
  77036. // "type": "string"
  77037. // },
  77038. // "zone": {
  77039. // "description": "The name of the zone for this request.",
  77040. // "location": "path",
  77041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77042. // "required": true,
  77043. // "type": "string"
  77044. // }
  77045. // },
  77046. // "path": "{project}/zones/{zone}/instances/{resource}/testIamPermissions",
  77047. // "request": {
  77048. // "$ref": "TestPermissionsRequest"
  77049. // },
  77050. // "response": {
  77051. // "$ref": "TestPermissionsResponse"
  77052. // },
  77053. // "scopes": [
  77054. // "https://www.googleapis.com/auth/cloud-platform",
  77055. // "https://www.googleapis.com/auth/compute",
  77056. // "https://www.googleapis.com/auth/compute.readonly"
  77057. // ]
  77058. // }
  77059. }
  77060. // method id "compute.instances.updateAccessConfig":
  77061. type InstancesUpdateAccessConfigCall struct {
  77062. s *Service
  77063. project string
  77064. zone string
  77065. instance string
  77066. accessconfig *AccessConfig
  77067. urlParams_ gensupport.URLParams
  77068. ctx_ context.Context
  77069. header_ http.Header
  77070. }
  77071. // UpdateAccessConfig: Updates the specified access config from an
  77072. // instance's network interface with the data included in the request.
  77073. // This method supports PATCH semantics and uses the JSON merge patch
  77074. // format and processing rules.
  77075. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  77076. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77077. c.project = project
  77078. c.zone = zone
  77079. c.instance = instance
  77080. c.urlParams_.Set("networkInterface", networkInterface)
  77081. c.accessconfig = accessconfig
  77082. return c
  77083. }
  77084. // RequestId sets the optional parameter "requestId": An optional
  77085. // request ID to identify requests. Specify a unique request ID so that
  77086. // if you must retry your request, the server will know to ignore the
  77087. // request if it has already been completed.
  77088. //
  77089. // For example, consider a situation where you make an initial request
  77090. // and the request times out. If you make the request again with the
  77091. // same request ID, the server can check if original operation with the
  77092. // same request ID was received, and if so, will ignore the second
  77093. // request. This prevents clients from accidentally creating duplicate
  77094. // commitments.
  77095. //
  77096. // The request ID must be a valid UUID with the exception that zero UUID
  77097. // is not supported (00000000-0000-0000-0000-000000000000).
  77098. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  77099. c.urlParams_.Set("requestId", requestId)
  77100. return c
  77101. }
  77102. // Fields allows partial responses to be retrieved. See
  77103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77104. // for more information.
  77105. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  77106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77107. return c
  77108. }
  77109. // Context sets the context to be used in this call's Do method. Any
  77110. // pending HTTP request will be aborted if the provided context is
  77111. // canceled.
  77112. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  77113. c.ctx_ = ctx
  77114. return c
  77115. }
  77116. // Header returns an http.Header that can be modified by the caller to
  77117. // add HTTP headers to the request.
  77118. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  77119. if c.header_ == nil {
  77120. c.header_ = make(http.Header)
  77121. }
  77122. return c.header_
  77123. }
  77124. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  77125. reqHeaders := make(http.Header)
  77126. for k, v := range c.header_ {
  77127. reqHeaders[k] = v
  77128. }
  77129. reqHeaders.Set("User-Agent", c.s.userAgent())
  77130. var body io.Reader = nil
  77131. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  77132. if err != nil {
  77133. return nil, err
  77134. }
  77135. reqHeaders.Set("Content-Type", "application/json")
  77136. c.urlParams_.Set("alt", alt)
  77137. c.urlParams_.Set("prettyPrint", "false")
  77138. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  77139. urls += "?" + c.urlParams_.Encode()
  77140. req, err := http.NewRequest("POST", urls, body)
  77141. if err != nil {
  77142. return nil, err
  77143. }
  77144. req.Header = reqHeaders
  77145. googleapi.Expand(req.URL, map[string]string{
  77146. "project": c.project,
  77147. "zone": c.zone,
  77148. "instance": c.instance,
  77149. })
  77150. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77151. }
  77152. // Do executes the "compute.instances.updateAccessConfig" call.
  77153. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77154. // status code is an error. Response headers are in either
  77155. // *Operation.ServerResponse.Header or (if a response was returned at
  77156. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77157. // to check whether the returned error was because
  77158. // http.StatusNotModified was returned.
  77159. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77160. gensupport.SetOptions(c.urlParams_, opts...)
  77161. res, err := c.doRequest("json")
  77162. if res != nil && res.StatusCode == http.StatusNotModified {
  77163. if res.Body != nil {
  77164. res.Body.Close()
  77165. }
  77166. return nil, &googleapi.Error{
  77167. Code: res.StatusCode,
  77168. Header: res.Header,
  77169. }
  77170. }
  77171. if err != nil {
  77172. return nil, err
  77173. }
  77174. defer googleapi.CloseBody(res)
  77175. if err := googleapi.CheckResponse(res); err != nil {
  77176. return nil, err
  77177. }
  77178. ret := &Operation{
  77179. ServerResponse: googleapi.ServerResponse{
  77180. Header: res.Header,
  77181. HTTPStatusCode: res.StatusCode,
  77182. },
  77183. }
  77184. target := &ret
  77185. if err := gensupport.DecodeResponse(target, res); err != nil {
  77186. return nil, err
  77187. }
  77188. return ret, nil
  77189. // {
  77190. // "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.",
  77191. // "httpMethod": "POST",
  77192. // "id": "compute.instances.updateAccessConfig",
  77193. // "parameterOrder": [
  77194. // "project",
  77195. // "zone",
  77196. // "instance",
  77197. // "networkInterface"
  77198. // ],
  77199. // "parameters": {
  77200. // "instance": {
  77201. // "description": "The instance name for this request.",
  77202. // "location": "path",
  77203. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77204. // "required": true,
  77205. // "type": "string"
  77206. // },
  77207. // "networkInterface": {
  77208. // "description": "The name of the network interface where the access config is attached.",
  77209. // "location": "query",
  77210. // "required": true,
  77211. // "type": "string"
  77212. // },
  77213. // "project": {
  77214. // "description": "Project ID for this request.",
  77215. // "location": "path",
  77216. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77217. // "required": true,
  77218. // "type": "string"
  77219. // },
  77220. // "requestId": {
  77221. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77222. // "location": "query",
  77223. // "type": "string"
  77224. // },
  77225. // "zone": {
  77226. // "description": "The name of the zone for this request.",
  77227. // "location": "path",
  77228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77229. // "required": true,
  77230. // "type": "string"
  77231. // }
  77232. // },
  77233. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  77234. // "request": {
  77235. // "$ref": "AccessConfig"
  77236. // },
  77237. // "response": {
  77238. // "$ref": "Operation"
  77239. // },
  77240. // "scopes": [
  77241. // "https://www.googleapis.com/auth/cloud-platform",
  77242. // "https://www.googleapis.com/auth/compute"
  77243. // ]
  77244. // }
  77245. }
  77246. // method id "compute.instances.updateDisplayDevice":
  77247. type InstancesUpdateDisplayDeviceCall struct {
  77248. s *Service
  77249. project string
  77250. zone string
  77251. instance string
  77252. displaydevice *DisplayDevice
  77253. urlParams_ gensupport.URLParams
  77254. ctx_ context.Context
  77255. header_ http.Header
  77256. }
  77257. // UpdateDisplayDevice: Updates the Display config for a VM instance.
  77258. // You can only use this method on a stopped VM instance. This method
  77259. // supports PATCH semantics and uses the JSON merge patch format and
  77260. // processing rules.
  77261. func (r *InstancesService) UpdateDisplayDevice(project string, zone string, instance string, displaydevice *DisplayDevice) *InstancesUpdateDisplayDeviceCall {
  77262. c := &InstancesUpdateDisplayDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77263. c.project = project
  77264. c.zone = zone
  77265. c.instance = instance
  77266. c.displaydevice = displaydevice
  77267. return c
  77268. }
  77269. // RequestId sets the optional parameter "requestId": An optional
  77270. // request ID to identify requests. Specify a unique request ID so that
  77271. // if you must retry your request, the server will know to ignore the
  77272. // request if it has already been completed.
  77273. //
  77274. // For example, consider a situation where you make an initial request
  77275. // and the request times out. If you make the request again with the
  77276. // same request ID, the server can check if original operation with the
  77277. // same request ID was received, and if so, will ignore the second
  77278. // request. This prevents clients from accidentally creating duplicate
  77279. // commitments.
  77280. //
  77281. // The request ID must be a valid UUID with the exception that zero UUID
  77282. // is not supported (00000000-0000-0000-0000-000000000000).
  77283. func (c *InstancesUpdateDisplayDeviceCall) RequestId(requestId string) *InstancesUpdateDisplayDeviceCall {
  77284. c.urlParams_.Set("requestId", requestId)
  77285. return c
  77286. }
  77287. // Fields allows partial responses to be retrieved. See
  77288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77289. // for more information.
  77290. func (c *InstancesUpdateDisplayDeviceCall) Fields(s ...googleapi.Field) *InstancesUpdateDisplayDeviceCall {
  77291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77292. return c
  77293. }
  77294. // Context sets the context to be used in this call's Do method. Any
  77295. // pending HTTP request will be aborted if the provided context is
  77296. // canceled.
  77297. func (c *InstancesUpdateDisplayDeviceCall) Context(ctx context.Context) *InstancesUpdateDisplayDeviceCall {
  77298. c.ctx_ = ctx
  77299. return c
  77300. }
  77301. // Header returns an http.Header that can be modified by the caller to
  77302. // add HTTP headers to the request.
  77303. func (c *InstancesUpdateDisplayDeviceCall) Header() http.Header {
  77304. if c.header_ == nil {
  77305. c.header_ = make(http.Header)
  77306. }
  77307. return c.header_
  77308. }
  77309. func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) {
  77310. reqHeaders := make(http.Header)
  77311. for k, v := range c.header_ {
  77312. reqHeaders[k] = v
  77313. }
  77314. reqHeaders.Set("User-Agent", c.s.userAgent())
  77315. var body io.Reader = nil
  77316. body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice)
  77317. if err != nil {
  77318. return nil, err
  77319. }
  77320. reqHeaders.Set("Content-Type", "application/json")
  77321. c.urlParams_.Set("alt", alt)
  77322. c.urlParams_.Set("prettyPrint", "false")
  77323. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice")
  77324. urls += "?" + c.urlParams_.Encode()
  77325. req, err := http.NewRequest("PATCH", urls, body)
  77326. if err != nil {
  77327. return nil, err
  77328. }
  77329. req.Header = reqHeaders
  77330. googleapi.Expand(req.URL, map[string]string{
  77331. "project": c.project,
  77332. "zone": c.zone,
  77333. "instance": c.instance,
  77334. })
  77335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77336. }
  77337. // Do executes the "compute.instances.updateDisplayDevice" call.
  77338. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77339. // status code is an error. Response headers are in either
  77340. // *Operation.ServerResponse.Header or (if a response was returned at
  77341. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77342. // to check whether the returned error was because
  77343. // http.StatusNotModified was returned.
  77344. func (c *InstancesUpdateDisplayDeviceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77345. gensupport.SetOptions(c.urlParams_, opts...)
  77346. res, err := c.doRequest("json")
  77347. if res != nil && res.StatusCode == http.StatusNotModified {
  77348. if res.Body != nil {
  77349. res.Body.Close()
  77350. }
  77351. return nil, &googleapi.Error{
  77352. Code: res.StatusCode,
  77353. Header: res.Header,
  77354. }
  77355. }
  77356. if err != nil {
  77357. return nil, err
  77358. }
  77359. defer googleapi.CloseBody(res)
  77360. if err := googleapi.CheckResponse(res); err != nil {
  77361. return nil, err
  77362. }
  77363. ret := &Operation{
  77364. ServerResponse: googleapi.ServerResponse{
  77365. Header: res.Header,
  77366. HTTPStatusCode: res.StatusCode,
  77367. },
  77368. }
  77369. target := &ret
  77370. if err := gensupport.DecodeResponse(target, res); err != nil {
  77371. return nil, err
  77372. }
  77373. return ret, nil
  77374. // {
  77375. // "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.",
  77376. // "httpMethod": "PATCH",
  77377. // "id": "compute.instances.updateDisplayDevice",
  77378. // "parameterOrder": [
  77379. // "project",
  77380. // "zone",
  77381. // "instance"
  77382. // ],
  77383. // "parameters": {
  77384. // "instance": {
  77385. // "description": "Name of the instance scoping this request.",
  77386. // "location": "path",
  77387. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77388. // "required": true,
  77389. // "type": "string"
  77390. // },
  77391. // "project": {
  77392. // "description": "Project ID for this request.",
  77393. // "location": "path",
  77394. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77395. // "required": true,
  77396. // "type": "string"
  77397. // },
  77398. // "requestId": {
  77399. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77400. // "location": "query",
  77401. // "type": "string"
  77402. // },
  77403. // "zone": {
  77404. // "description": "The name of the zone for this request.",
  77405. // "location": "path",
  77406. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77407. // "required": true,
  77408. // "type": "string"
  77409. // }
  77410. // },
  77411. // "path": "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice",
  77412. // "request": {
  77413. // "$ref": "DisplayDevice"
  77414. // },
  77415. // "response": {
  77416. // "$ref": "Operation"
  77417. // },
  77418. // "scopes": [
  77419. // "https://www.googleapis.com/auth/cloud-platform",
  77420. // "https://www.googleapis.com/auth/compute"
  77421. // ]
  77422. // }
  77423. }
  77424. // method id "compute.instances.updateNetworkInterface":
  77425. type InstancesUpdateNetworkInterfaceCall struct {
  77426. s *Service
  77427. project string
  77428. zone string
  77429. instance string
  77430. networkinterface *NetworkInterface
  77431. urlParams_ gensupport.URLParams
  77432. ctx_ context.Context
  77433. header_ http.Header
  77434. }
  77435. // UpdateNetworkInterface: Updates an instance's network interface. This
  77436. // method follows PATCH semantics.
  77437. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  77438. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77439. c.project = project
  77440. c.zone = zone
  77441. c.instance = instance
  77442. c.urlParams_.Set("networkInterface", networkInterface)
  77443. c.networkinterface = networkinterface
  77444. return c
  77445. }
  77446. // RequestId sets the optional parameter "requestId": An optional
  77447. // request ID to identify requests. Specify a unique request ID so that
  77448. // if you must retry your request, the server will know to ignore the
  77449. // request if it has already been completed.
  77450. //
  77451. // For example, consider a situation where you make an initial request
  77452. // and the request times out. If you make the request again with the
  77453. // same request ID, the server can check if original operation with the
  77454. // same request ID was received, and if so, will ignore the second
  77455. // request. This prevents clients from accidentally creating duplicate
  77456. // commitments.
  77457. //
  77458. // The request ID must be a valid UUID with the exception that zero UUID
  77459. // is not supported (00000000-0000-0000-0000-000000000000).
  77460. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  77461. c.urlParams_.Set("requestId", requestId)
  77462. return c
  77463. }
  77464. // Fields allows partial responses to be retrieved. See
  77465. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77466. // for more information.
  77467. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  77468. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77469. return c
  77470. }
  77471. // Context sets the context to be used in this call's Do method. Any
  77472. // pending HTTP request will be aborted if the provided context is
  77473. // canceled.
  77474. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  77475. c.ctx_ = ctx
  77476. return c
  77477. }
  77478. // Header returns an http.Header that can be modified by the caller to
  77479. // add HTTP headers to the request.
  77480. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  77481. if c.header_ == nil {
  77482. c.header_ = make(http.Header)
  77483. }
  77484. return c.header_
  77485. }
  77486. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  77487. reqHeaders := make(http.Header)
  77488. for k, v := range c.header_ {
  77489. reqHeaders[k] = v
  77490. }
  77491. reqHeaders.Set("User-Agent", c.s.userAgent())
  77492. var body io.Reader = nil
  77493. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  77494. if err != nil {
  77495. return nil, err
  77496. }
  77497. reqHeaders.Set("Content-Type", "application/json")
  77498. c.urlParams_.Set("alt", alt)
  77499. c.urlParams_.Set("prettyPrint", "false")
  77500. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  77501. urls += "?" + c.urlParams_.Encode()
  77502. req, err := http.NewRequest("PATCH", urls, body)
  77503. if err != nil {
  77504. return nil, err
  77505. }
  77506. req.Header = reqHeaders
  77507. googleapi.Expand(req.URL, map[string]string{
  77508. "project": c.project,
  77509. "zone": c.zone,
  77510. "instance": c.instance,
  77511. })
  77512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77513. }
  77514. // Do executes the "compute.instances.updateNetworkInterface" call.
  77515. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77516. // status code is an error. Response headers are in either
  77517. // *Operation.ServerResponse.Header or (if a response was returned at
  77518. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77519. // to check whether the returned error was because
  77520. // http.StatusNotModified was returned.
  77521. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77522. gensupport.SetOptions(c.urlParams_, opts...)
  77523. res, err := c.doRequest("json")
  77524. if res != nil && res.StatusCode == http.StatusNotModified {
  77525. if res.Body != nil {
  77526. res.Body.Close()
  77527. }
  77528. return nil, &googleapi.Error{
  77529. Code: res.StatusCode,
  77530. Header: res.Header,
  77531. }
  77532. }
  77533. if err != nil {
  77534. return nil, err
  77535. }
  77536. defer googleapi.CloseBody(res)
  77537. if err := googleapi.CheckResponse(res); err != nil {
  77538. return nil, err
  77539. }
  77540. ret := &Operation{
  77541. ServerResponse: googleapi.ServerResponse{
  77542. Header: res.Header,
  77543. HTTPStatusCode: res.StatusCode,
  77544. },
  77545. }
  77546. target := &ret
  77547. if err := gensupport.DecodeResponse(target, res); err != nil {
  77548. return nil, err
  77549. }
  77550. return ret, nil
  77551. // {
  77552. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  77553. // "httpMethod": "PATCH",
  77554. // "id": "compute.instances.updateNetworkInterface",
  77555. // "parameterOrder": [
  77556. // "project",
  77557. // "zone",
  77558. // "instance",
  77559. // "networkInterface"
  77560. // ],
  77561. // "parameters": {
  77562. // "instance": {
  77563. // "description": "The instance name for this request.",
  77564. // "location": "path",
  77565. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77566. // "required": true,
  77567. // "type": "string"
  77568. // },
  77569. // "networkInterface": {
  77570. // "description": "The name of the network interface to update.",
  77571. // "location": "query",
  77572. // "required": true,
  77573. // "type": "string"
  77574. // },
  77575. // "project": {
  77576. // "description": "Project ID for this request.",
  77577. // "location": "path",
  77578. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77579. // "required": true,
  77580. // "type": "string"
  77581. // },
  77582. // "requestId": {
  77583. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77584. // "location": "query",
  77585. // "type": "string"
  77586. // },
  77587. // "zone": {
  77588. // "description": "The name of the zone for this request.",
  77589. // "location": "path",
  77590. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77591. // "required": true,
  77592. // "type": "string"
  77593. // }
  77594. // },
  77595. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  77596. // "request": {
  77597. // "$ref": "NetworkInterface"
  77598. // },
  77599. // "response": {
  77600. // "$ref": "Operation"
  77601. // },
  77602. // "scopes": [
  77603. // "https://www.googleapis.com/auth/cloud-platform",
  77604. // "https://www.googleapis.com/auth/compute"
  77605. // ]
  77606. // }
  77607. }
  77608. // method id "compute.instances.updateShieldedInstanceConfig":
  77609. type InstancesUpdateShieldedInstanceConfigCall struct {
  77610. s *Service
  77611. project string
  77612. zone string
  77613. instance string
  77614. shieldedinstanceconfig *ShieldedInstanceConfig
  77615. urlParams_ gensupport.URLParams
  77616. ctx_ context.Context
  77617. header_ http.Header
  77618. }
  77619. // UpdateShieldedInstanceConfig: Updates the Shielded Instance config
  77620. // for an instance. You can only use this method on a stopped instance.
  77621. // This method supports PATCH semantics and uses the JSON merge patch
  77622. // format and processing rules.
  77623. func (r *InstancesService) UpdateShieldedInstanceConfig(project string, zone string, instance string, shieldedinstanceconfig *ShieldedInstanceConfig) *InstancesUpdateShieldedInstanceConfigCall {
  77624. c := &InstancesUpdateShieldedInstanceConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77625. c.project = project
  77626. c.zone = zone
  77627. c.instance = instance
  77628. c.shieldedinstanceconfig = shieldedinstanceconfig
  77629. return c
  77630. }
  77631. // RequestId sets the optional parameter "requestId": An optional
  77632. // request ID to identify requests. Specify a unique request ID so that
  77633. // if you must retry your request, the server will know to ignore the
  77634. // request if it has already been completed.
  77635. //
  77636. // For example, consider a situation where you make an initial request
  77637. // and the request times out. If you make the request again with the
  77638. // same request ID, the server can check if original operation with the
  77639. // same request ID was received, and if so, will ignore the second
  77640. // request. This prevents clients from accidentally creating duplicate
  77641. // commitments.
  77642. //
  77643. // The request ID must be a valid UUID with the exception that zero UUID
  77644. // is not supported (00000000-0000-0000-0000-000000000000).
  77645. func (c *InstancesUpdateShieldedInstanceConfigCall) RequestId(requestId string) *InstancesUpdateShieldedInstanceConfigCall {
  77646. c.urlParams_.Set("requestId", requestId)
  77647. return c
  77648. }
  77649. // Fields allows partial responses to be retrieved. See
  77650. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77651. // for more information.
  77652. func (c *InstancesUpdateShieldedInstanceConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedInstanceConfigCall {
  77653. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77654. return c
  77655. }
  77656. // Context sets the context to be used in this call's Do method. Any
  77657. // pending HTTP request will be aborted if the provided context is
  77658. // canceled.
  77659. func (c *InstancesUpdateShieldedInstanceConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedInstanceConfigCall {
  77660. c.ctx_ = ctx
  77661. return c
  77662. }
  77663. // Header returns an http.Header that can be modified by the caller to
  77664. // add HTTP headers to the request.
  77665. func (c *InstancesUpdateShieldedInstanceConfigCall) Header() http.Header {
  77666. if c.header_ == nil {
  77667. c.header_ = make(http.Header)
  77668. }
  77669. return c.header_
  77670. }
  77671. func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) {
  77672. reqHeaders := make(http.Header)
  77673. for k, v := range c.header_ {
  77674. reqHeaders[k] = v
  77675. }
  77676. reqHeaders.Set("User-Agent", c.s.userAgent())
  77677. var body io.Reader = nil
  77678. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceconfig)
  77679. if err != nil {
  77680. return nil, err
  77681. }
  77682. reqHeaders.Set("Content-Type", "application/json")
  77683. c.urlParams_.Set("alt", alt)
  77684. c.urlParams_.Set("prettyPrint", "false")
  77685. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig")
  77686. urls += "?" + c.urlParams_.Encode()
  77687. req, err := http.NewRequest("PATCH", urls, body)
  77688. if err != nil {
  77689. return nil, err
  77690. }
  77691. req.Header = reqHeaders
  77692. googleapi.Expand(req.URL, map[string]string{
  77693. "project": c.project,
  77694. "zone": c.zone,
  77695. "instance": c.instance,
  77696. })
  77697. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77698. }
  77699. // Do executes the "compute.instances.updateShieldedInstanceConfig" call.
  77700. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77701. // status code is an error. Response headers are in either
  77702. // *Operation.ServerResponse.Header or (if a response was returned at
  77703. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77704. // to check whether the returned error was because
  77705. // http.StatusNotModified was returned.
  77706. func (c *InstancesUpdateShieldedInstanceConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77707. gensupport.SetOptions(c.urlParams_, opts...)
  77708. res, err := c.doRequest("json")
  77709. if res != nil && res.StatusCode == http.StatusNotModified {
  77710. if res.Body != nil {
  77711. res.Body.Close()
  77712. }
  77713. return nil, &googleapi.Error{
  77714. Code: res.StatusCode,
  77715. Header: res.Header,
  77716. }
  77717. }
  77718. if err != nil {
  77719. return nil, err
  77720. }
  77721. defer googleapi.CloseBody(res)
  77722. if err := googleapi.CheckResponse(res); err != nil {
  77723. return nil, err
  77724. }
  77725. ret := &Operation{
  77726. ServerResponse: googleapi.ServerResponse{
  77727. Header: res.Header,
  77728. HTTPStatusCode: res.StatusCode,
  77729. },
  77730. }
  77731. target := &ret
  77732. if err := gensupport.DecodeResponse(target, res); err != nil {
  77733. return nil, err
  77734. }
  77735. return ret, nil
  77736. // {
  77737. // "description": "Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  77738. // "httpMethod": "PATCH",
  77739. // "id": "compute.instances.updateShieldedInstanceConfig",
  77740. // "parameterOrder": [
  77741. // "project",
  77742. // "zone",
  77743. // "instance"
  77744. // ],
  77745. // "parameters": {
  77746. // "instance": {
  77747. // "description": "Name or id of the instance scoping this request.",
  77748. // "location": "path",
  77749. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77750. // "required": true,
  77751. // "type": "string"
  77752. // },
  77753. // "project": {
  77754. // "description": "Project ID for this request.",
  77755. // "location": "path",
  77756. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77757. // "required": true,
  77758. // "type": "string"
  77759. // },
  77760. // "requestId": {
  77761. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77762. // "location": "query",
  77763. // "type": "string"
  77764. // },
  77765. // "zone": {
  77766. // "description": "The name of the zone for this request.",
  77767. // "location": "path",
  77768. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77769. // "required": true,
  77770. // "type": "string"
  77771. // }
  77772. // },
  77773. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig",
  77774. // "request": {
  77775. // "$ref": "ShieldedInstanceConfig"
  77776. // },
  77777. // "response": {
  77778. // "$ref": "Operation"
  77779. // },
  77780. // "scopes": [
  77781. // "https://www.googleapis.com/auth/cloud-platform",
  77782. // "https://www.googleapis.com/auth/compute"
  77783. // ]
  77784. // }
  77785. }
  77786. // method id "compute.instances.updateShieldedVmConfig":
  77787. type InstancesUpdateShieldedVmConfigCall struct {
  77788. s *Service
  77789. project string
  77790. zone string
  77791. instance string
  77792. shieldedvmconfig *ShieldedVmConfig
  77793. urlParams_ gensupport.URLParams
  77794. ctx_ context.Context
  77795. header_ http.Header
  77796. }
  77797. // UpdateShieldedVmConfig: Updates the Shielded VM config for a VM
  77798. // instance. You can only use this method on a stopped VM instance. This
  77799. // method supports PATCH semantics and uses the JSON merge patch format
  77800. // and processing rules.
  77801. func (r *InstancesService) UpdateShieldedVmConfig(project string, zone string, instance string, shieldedvmconfig *ShieldedVmConfig) *InstancesUpdateShieldedVmConfigCall {
  77802. c := &InstancesUpdateShieldedVmConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77803. c.project = project
  77804. c.zone = zone
  77805. c.instance = instance
  77806. c.shieldedvmconfig = shieldedvmconfig
  77807. return c
  77808. }
  77809. // RequestId sets the optional parameter "requestId": An optional
  77810. // request ID to identify requests. Specify a unique request ID so that
  77811. // if you must retry your request, the server will know to ignore the
  77812. // request if it has already been completed.
  77813. //
  77814. // For example, consider a situation where you make an initial request
  77815. // and the request times out. If you make the request again with the
  77816. // same request ID, the server can check if original operation with the
  77817. // same request ID was received, and if so, will ignore the second
  77818. // request. This prevents clients from accidentally creating duplicate
  77819. // commitments.
  77820. //
  77821. // The request ID must be a valid UUID with the exception that zero UUID
  77822. // is not supported (00000000-0000-0000-0000-000000000000).
  77823. func (c *InstancesUpdateShieldedVmConfigCall) RequestId(requestId string) *InstancesUpdateShieldedVmConfigCall {
  77824. c.urlParams_.Set("requestId", requestId)
  77825. return c
  77826. }
  77827. // Fields allows partial responses to be retrieved. See
  77828. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77829. // for more information.
  77830. func (c *InstancesUpdateShieldedVmConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedVmConfigCall {
  77831. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77832. return c
  77833. }
  77834. // Context sets the context to be used in this call's Do method. Any
  77835. // pending HTTP request will be aborted if the provided context is
  77836. // canceled.
  77837. func (c *InstancesUpdateShieldedVmConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedVmConfigCall {
  77838. c.ctx_ = ctx
  77839. return c
  77840. }
  77841. // Header returns an http.Header that can be modified by the caller to
  77842. // add HTTP headers to the request.
  77843. func (c *InstancesUpdateShieldedVmConfigCall) Header() http.Header {
  77844. if c.header_ == nil {
  77845. c.header_ = make(http.Header)
  77846. }
  77847. return c.header_
  77848. }
  77849. func (c *InstancesUpdateShieldedVmConfigCall) doRequest(alt string) (*http.Response, error) {
  77850. reqHeaders := make(http.Header)
  77851. for k, v := range c.header_ {
  77852. reqHeaders[k] = v
  77853. }
  77854. reqHeaders.Set("User-Agent", c.s.userAgent())
  77855. var body io.Reader = nil
  77856. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmconfig)
  77857. if err != nil {
  77858. return nil, err
  77859. }
  77860. reqHeaders.Set("Content-Type", "application/json")
  77861. c.urlParams_.Set("alt", alt)
  77862. c.urlParams_.Set("prettyPrint", "false")
  77863. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig")
  77864. urls += "?" + c.urlParams_.Encode()
  77865. req, err := http.NewRequest("PATCH", urls, body)
  77866. if err != nil {
  77867. return nil, err
  77868. }
  77869. req.Header = reqHeaders
  77870. googleapi.Expand(req.URL, map[string]string{
  77871. "project": c.project,
  77872. "zone": c.zone,
  77873. "instance": c.instance,
  77874. })
  77875. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77876. }
  77877. // Do executes the "compute.instances.updateShieldedVmConfig" call.
  77878. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77879. // status code is an error. Response headers are in either
  77880. // *Operation.ServerResponse.Header or (if a response was returned at
  77881. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77882. // to check whether the returned error was because
  77883. // http.StatusNotModified was returned.
  77884. func (c *InstancesUpdateShieldedVmConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77885. gensupport.SetOptions(c.urlParams_, opts...)
  77886. res, err := c.doRequest("json")
  77887. if res != nil && res.StatusCode == http.StatusNotModified {
  77888. if res.Body != nil {
  77889. res.Body.Close()
  77890. }
  77891. return nil, &googleapi.Error{
  77892. Code: res.StatusCode,
  77893. Header: res.Header,
  77894. }
  77895. }
  77896. if err != nil {
  77897. return nil, err
  77898. }
  77899. defer googleapi.CloseBody(res)
  77900. if err := googleapi.CheckResponse(res); err != nil {
  77901. return nil, err
  77902. }
  77903. ret := &Operation{
  77904. ServerResponse: googleapi.ServerResponse{
  77905. Header: res.Header,
  77906. HTTPStatusCode: res.StatusCode,
  77907. },
  77908. }
  77909. target := &ret
  77910. if err := gensupport.DecodeResponse(target, res); err != nil {
  77911. return nil, err
  77912. }
  77913. return ret, nil
  77914. // {
  77915. // "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.",
  77916. // "httpMethod": "PATCH",
  77917. // "id": "compute.instances.updateShieldedVmConfig",
  77918. // "parameterOrder": [
  77919. // "project",
  77920. // "zone",
  77921. // "instance"
  77922. // ],
  77923. // "parameters": {
  77924. // "instance": {
  77925. // "description": "Name of the instance scoping this request.",
  77926. // "location": "path",
  77927. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77928. // "required": true,
  77929. // "type": "string"
  77930. // },
  77931. // "project": {
  77932. // "description": "Project ID for this request.",
  77933. // "location": "path",
  77934. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77935. // "required": true,
  77936. // "type": "string"
  77937. // },
  77938. // "requestId": {
  77939. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77940. // "location": "query",
  77941. // "type": "string"
  77942. // },
  77943. // "zone": {
  77944. // "description": "The name of the zone for this request.",
  77945. // "location": "path",
  77946. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77947. // "required": true,
  77948. // "type": "string"
  77949. // }
  77950. // },
  77951. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig",
  77952. // "request": {
  77953. // "$ref": "ShieldedVmConfig"
  77954. // },
  77955. // "response": {
  77956. // "$ref": "Operation"
  77957. // },
  77958. // "scopes": [
  77959. // "https://www.googleapis.com/auth/cloud-platform",
  77960. // "https://www.googleapis.com/auth/compute"
  77961. // ]
  77962. // }
  77963. }
  77964. // method id "compute.interconnectAttachments.aggregatedList":
  77965. type InterconnectAttachmentsAggregatedListCall struct {
  77966. s *Service
  77967. project string
  77968. urlParams_ gensupport.URLParams
  77969. ifNoneMatch_ string
  77970. ctx_ context.Context
  77971. header_ http.Header
  77972. }
  77973. // AggregatedList: Retrieves an aggregated list of interconnect
  77974. // attachments.
  77975. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  77976. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77977. c.project = project
  77978. return c
  77979. }
  77980. // Filter sets the optional parameter "filter": A filter expression that
  77981. // filters resources listed in the response. The expression must specify
  77982. // the field name, a comparison operator, and the value that you want to
  77983. // use for filtering. The value must be a string, a number, or a
  77984. // boolean. The comparison operator must be either =, !=, >, or <.
  77985. //
  77986. // For example, if you are filtering Compute Engine instances, you can
  77987. // exclude instances named example-instance by specifying name !=
  77988. // example-instance.
  77989. //
  77990. // You can also filter nested fields. For example, you could specify
  77991. // scheduling.automaticRestart = false to include instances only if they
  77992. // are not scheduled for automatic restarts. You can use filtering on
  77993. // nested fields to filter based on resource labels.
  77994. //
  77995. // To filter on multiple expressions, provide each separate expression
  77996. // within parentheses. For example, (scheduling.automaticRestart = true)
  77997. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  77998. // AND expression. However, you can include AND and OR expressions
  77999. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78000. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78001. // true).
  78002. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  78003. c.urlParams_.Set("filter", filter)
  78004. return c
  78005. }
  78006. // MaxResults sets the optional parameter "maxResults": The maximum
  78007. // number of results per page that should be returned. If the number of
  78008. // available results is larger than maxResults, Compute Engine returns a
  78009. // nextPageToken that can be used to get the next page of results in
  78010. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78011. // (Default: 500)
  78012. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  78013. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78014. return c
  78015. }
  78016. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78017. // a certain order. By default, results are returned in alphanumerical
  78018. // order based on the resource name.
  78019. //
  78020. // You can also sort results in descending order based on the creation
  78021. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78022. // based on the creationTimestamp field in reverse chronological order
  78023. // (newest result first). Use this to sort resources like operations so
  78024. // that the newest operation is returned first.
  78025. //
  78026. // Currently, only sorting by name or creationTimestamp desc is
  78027. // supported.
  78028. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  78029. c.urlParams_.Set("orderBy", orderBy)
  78030. return c
  78031. }
  78032. // PageToken sets the optional parameter "pageToken": Specifies a page
  78033. // token to use. Set pageToken to the nextPageToken returned by a
  78034. // previous list request to get the next page of results.
  78035. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  78036. c.urlParams_.Set("pageToken", pageToken)
  78037. return c
  78038. }
  78039. // Fields allows partial responses to be retrieved. See
  78040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78041. // for more information.
  78042. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  78043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78044. return c
  78045. }
  78046. // IfNoneMatch sets the optional parameter which makes the operation
  78047. // fail if the object's ETag matches the given value. This is useful for
  78048. // getting updates only after the object has changed since the last
  78049. // request. Use googleapi.IsNotModified to check whether the response
  78050. // error from Do is the result of In-None-Match.
  78051. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  78052. c.ifNoneMatch_ = entityTag
  78053. return c
  78054. }
  78055. // Context sets the context to be used in this call's Do method. Any
  78056. // pending HTTP request will be aborted if the provided context is
  78057. // canceled.
  78058. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  78059. c.ctx_ = ctx
  78060. return c
  78061. }
  78062. // Header returns an http.Header that can be modified by the caller to
  78063. // add HTTP headers to the request.
  78064. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  78065. if c.header_ == nil {
  78066. c.header_ = make(http.Header)
  78067. }
  78068. return c.header_
  78069. }
  78070. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  78071. reqHeaders := make(http.Header)
  78072. for k, v := range c.header_ {
  78073. reqHeaders[k] = v
  78074. }
  78075. reqHeaders.Set("User-Agent", c.s.userAgent())
  78076. if c.ifNoneMatch_ != "" {
  78077. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78078. }
  78079. var body io.Reader = nil
  78080. c.urlParams_.Set("alt", alt)
  78081. c.urlParams_.Set("prettyPrint", "false")
  78082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  78083. urls += "?" + c.urlParams_.Encode()
  78084. req, err := http.NewRequest("GET", urls, body)
  78085. if err != nil {
  78086. return nil, err
  78087. }
  78088. req.Header = reqHeaders
  78089. googleapi.Expand(req.URL, map[string]string{
  78090. "project": c.project,
  78091. })
  78092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78093. }
  78094. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  78095. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  78096. // non-nil. Any non-2xx status code is an error. Response headers are in
  78097. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  78098. // (if a response was returned at all) in
  78099. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  78100. // whether the returned error was because http.StatusNotModified was
  78101. // returned.
  78102. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  78103. gensupport.SetOptions(c.urlParams_, opts...)
  78104. res, err := c.doRequest("json")
  78105. if res != nil && res.StatusCode == http.StatusNotModified {
  78106. if res.Body != nil {
  78107. res.Body.Close()
  78108. }
  78109. return nil, &googleapi.Error{
  78110. Code: res.StatusCode,
  78111. Header: res.Header,
  78112. }
  78113. }
  78114. if err != nil {
  78115. return nil, err
  78116. }
  78117. defer googleapi.CloseBody(res)
  78118. if err := googleapi.CheckResponse(res); err != nil {
  78119. return nil, err
  78120. }
  78121. ret := &InterconnectAttachmentAggregatedList{
  78122. ServerResponse: googleapi.ServerResponse{
  78123. Header: res.Header,
  78124. HTTPStatusCode: res.StatusCode,
  78125. },
  78126. }
  78127. target := &ret
  78128. if err := gensupport.DecodeResponse(target, res); err != nil {
  78129. return nil, err
  78130. }
  78131. return ret, nil
  78132. // {
  78133. // "description": "Retrieves an aggregated list of interconnect attachments.",
  78134. // "httpMethod": "GET",
  78135. // "id": "compute.interconnectAttachments.aggregatedList",
  78136. // "parameterOrder": [
  78137. // "project"
  78138. // ],
  78139. // "parameters": {
  78140. // "filter": {
  78141. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  78142. // "location": "query",
  78143. // "type": "string"
  78144. // },
  78145. // "maxResults": {
  78146. // "default": "500",
  78147. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  78148. // "format": "uint32",
  78149. // "location": "query",
  78150. // "minimum": "0",
  78151. // "type": "integer"
  78152. // },
  78153. // "orderBy": {
  78154. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  78155. // "location": "query",
  78156. // "type": "string"
  78157. // },
  78158. // "pageToken": {
  78159. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  78160. // "location": "query",
  78161. // "type": "string"
  78162. // },
  78163. // "project": {
  78164. // "description": "Project ID for this request.",
  78165. // "location": "path",
  78166. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78167. // "required": true,
  78168. // "type": "string"
  78169. // }
  78170. // },
  78171. // "path": "{project}/aggregated/interconnectAttachments",
  78172. // "response": {
  78173. // "$ref": "InterconnectAttachmentAggregatedList"
  78174. // },
  78175. // "scopes": [
  78176. // "https://www.googleapis.com/auth/cloud-platform",
  78177. // "https://www.googleapis.com/auth/compute",
  78178. // "https://www.googleapis.com/auth/compute.readonly"
  78179. // ]
  78180. // }
  78181. }
  78182. // Pages invokes f for each page of results.
  78183. // A non-nil error returned from f will halt the iteration.
  78184. // The provided context supersedes any context provided to the Context method.
  78185. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  78186. c.ctx_ = ctx
  78187. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78188. for {
  78189. x, err := c.Do()
  78190. if err != nil {
  78191. return err
  78192. }
  78193. if err := f(x); err != nil {
  78194. return err
  78195. }
  78196. if x.NextPageToken == "" {
  78197. return nil
  78198. }
  78199. c.PageToken(x.NextPageToken)
  78200. }
  78201. }
  78202. // method id "compute.interconnectAttachments.delete":
  78203. type InterconnectAttachmentsDeleteCall struct {
  78204. s *Service
  78205. project string
  78206. region string
  78207. interconnectAttachment string
  78208. urlParams_ gensupport.URLParams
  78209. ctx_ context.Context
  78210. header_ http.Header
  78211. }
  78212. // Delete: Deletes the specified interconnect attachment.
  78213. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  78214. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78215. c.project = project
  78216. c.region = region
  78217. c.interconnectAttachment = interconnectAttachment
  78218. return c
  78219. }
  78220. // RequestId sets the optional parameter "requestId": An optional
  78221. // request ID to identify requests. Specify a unique request ID so that
  78222. // if you must retry your request, the server will know to ignore the
  78223. // request if it has already been completed.
  78224. //
  78225. // For example, consider a situation where you make an initial request
  78226. // and the request times out. If you make the request again with the
  78227. // same request ID, the server can check if original operation with the
  78228. // same request ID was received, and if so, will ignore the second
  78229. // request. This prevents clients from accidentally creating duplicate
  78230. // commitments.
  78231. //
  78232. // The request ID must be a valid UUID with the exception that zero UUID
  78233. // is not supported (00000000-0000-0000-0000-000000000000).
  78234. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  78235. c.urlParams_.Set("requestId", requestId)
  78236. return c
  78237. }
  78238. // Fields allows partial responses to be retrieved. See
  78239. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78240. // for more information.
  78241. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  78242. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78243. return c
  78244. }
  78245. // Context sets the context to be used in this call's Do method. Any
  78246. // pending HTTP request will be aborted if the provided context is
  78247. // canceled.
  78248. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  78249. c.ctx_ = ctx
  78250. return c
  78251. }
  78252. // Header returns an http.Header that can be modified by the caller to
  78253. // add HTTP headers to the request.
  78254. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  78255. if c.header_ == nil {
  78256. c.header_ = make(http.Header)
  78257. }
  78258. return c.header_
  78259. }
  78260. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  78261. reqHeaders := make(http.Header)
  78262. for k, v := range c.header_ {
  78263. reqHeaders[k] = v
  78264. }
  78265. reqHeaders.Set("User-Agent", c.s.userAgent())
  78266. var body io.Reader = nil
  78267. c.urlParams_.Set("alt", alt)
  78268. c.urlParams_.Set("prettyPrint", "false")
  78269. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  78270. urls += "?" + c.urlParams_.Encode()
  78271. req, err := http.NewRequest("DELETE", urls, body)
  78272. if err != nil {
  78273. return nil, err
  78274. }
  78275. req.Header = reqHeaders
  78276. googleapi.Expand(req.URL, map[string]string{
  78277. "project": c.project,
  78278. "region": c.region,
  78279. "interconnectAttachment": c.interconnectAttachment,
  78280. })
  78281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78282. }
  78283. // Do executes the "compute.interconnectAttachments.delete" call.
  78284. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78285. // status code is an error. Response headers are in either
  78286. // *Operation.ServerResponse.Header or (if a response was returned at
  78287. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78288. // to check whether the returned error was because
  78289. // http.StatusNotModified was returned.
  78290. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78291. gensupport.SetOptions(c.urlParams_, opts...)
  78292. res, err := c.doRequest("json")
  78293. if res != nil && res.StatusCode == http.StatusNotModified {
  78294. if res.Body != nil {
  78295. res.Body.Close()
  78296. }
  78297. return nil, &googleapi.Error{
  78298. Code: res.StatusCode,
  78299. Header: res.Header,
  78300. }
  78301. }
  78302. if err != nil {
  78303. return nil, err
  78304. }
  78305. defer googleapi.CloseBody(res)
  78306. if err := googleapi.CheckResponse(res); err != nil {
  78307. return nil, err
  78308. }
  78309. ret := &Operation{
  78310. ServerResponse: googleapi.ServerResponse{
  78311. Header: res.Header,
  78312. HTTPStatusCode: res.StatusCode,
  78313. },
  78314. }
  78315. target := &ret
  78316. if err := gensupport.DecodeResponse(target, res); err != nil {
  78317. return nil, err
  78318. }
  78319. return ret, nil
  78320. // {
  78321. // "description": "Deletes the specified interconnect attachment.",
  78322. // "httpMethod": "DELETE",
  78323. // "id": "compute.interconnectAttachments.delete",
  78324. // "parameterOrder": [
  78325. // "project",
  78326. // "region",
  78327. // "interconnectAttachment"
  78328. // ],
  78329. // "parameters": {
  78330. // "interconnectAttachment": {
  78331. // "description": "Name of the interconnect attachment to delete.",
  78332. // "location": "path",
  78333. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78334. // "required": true,
  78335. // "type": "string"
  78336. // },
  78337. // "project": {
  78338. // "description": "Project ID for this request.",
  78339. // "location": "path",
  78340. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78341. // "required": true,
  78342. // "type": "string"
  78343. // },
  78344. // "region": {
  78345. // "description": "Name of the region for this request.",
  78346. // "location": "path",
  78347. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78348. // "required": true,
  78349. // "type": "string"
  78350. // },
  78351. // "requestId": {
  78352. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78353. // "location": "query",
  78354. // "type": "string"
  78355. // }
  78356. // },
  78357. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  78358. // "response": {
  78359. // "$ref": "Operation"
  78360. // },
  78361. // "scopes": [
  78362. // "https://www.googleapis.com/auth/cloud-platform",
  78363. // "https://www.googleapis.com/auth/compute"
  78364. // ]
  78365. // }
  78366. }
  78367. // method id "compute.interconnectAttachments.get":
  78368. type InterconnectAttachmentsGetCall struct {
  78369. s *Service
  78370. project string
  78371. region string
  78372. interconnectAttachment string
  78373. urlParams_ gensupport.URLParams
  78374. ifNoneMatch_ string
  78375. ctx_ context.Context
  78376. header_ http.Header
  78377. }
  78378. // Get: Returns the specified interconnect attachment.
  78379. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  78380. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78381. c.project = project
  78382. c.region = region
  78383. c.interconnectAttachment = interconnectAttachment
  78384. return c
  78385. }
  78386. // Fields allows partial responses to be retrieved. See
  78387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78388. // for more information.
  78389. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  78390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78391. return c
  78392. }
  78393. // IfNoneMatch sets the optional parameter which makes the operation
  78394. // fail if the object's ETag matches the given value. This is useful for
  78395. // getting updates only after the object has changed since the last
  78396. // request. Use googleapi.IsNotModified to check whether the response
  78397. // error from Do is the result of In-None-Match.
  78398. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  78399. c.ifNoneMatch_ = entityTag
  78400. return c
  78401. }
  78402. // Context sets the context to be used in this call's Do method. Any
  78403. // pending HTTP request will be aborted if the provided context is
  78404. // canceled.
  78405. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  78406. c.ctx_ = ctx
  78407. return c
  78408. }
  78409. // Header returns an http.Header that can be modified by the caller to
  78410. // add HTTP headers to the request.
  78411. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  78412. if c.header_ == nil {
  78413. c.header_ = make(http.Header)
  78414. }
  78415. return c.header_
  78416. }
  78417. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  78418. reqHeaders := make(http.Header)
  78419. for k, v := range c.header_ {
  78420. reqHeaders[k] = v
  78421. }
  78422. reqHeaders.Set("User-Agent", c.s.userAgent())
  78423. if c.ifNoneMatch_ != "" {
  78424. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78425. }
  78426. var body io.Reader = nil
  78427. c.urlParams_.Set("alt", alt)
  78428. c.urlParams_.Set("prettyPrint", "false")
  78429. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  78430. urls += "?" + c.urlParams_.Encode()
  78431. req, err := http.NewRequest("GET", urls, body)
  78432. if err != nil {
  78433. return nil, err
  78434. }
  78435. req.Header = reqHeaders
  78436. googleapi.Expand(req.URL, map[string]string{
  78437. "project": c.project,
  78438. "region": c.region,
  78439. "interconnectAttachment": c.interconnectAttachment,
  78440. })
  78441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78442. }
  78443. // Do executes the "compute.interconnectAttachments.get" call.
  78444. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  78445. // non-2xx status code is an error. Response headers are in either
  78446. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  78447. // returned at all) in error.(*googleapi.Error).Header. Use
  78448. // googleapi.IsNotModified to check whether the returned error was
  78449. // because http.StatusNotModified was returned.
  78450. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  78451. gensupport.SetOptions(c.urlParams_, opts...)
  78452. res, err := c.doRequest("json")
  78453. if res != nil && res.StatusCode == http.StatusNotModified {
  78454. if res.Body != nil {
  78455. res.Body.Close()
  78456. }
  78457. return nil, &googleapi.Error{
  78458. Code: res.StatusCode,
  78459. Header: res.Header,
  78460. }
  78461. }
  78462. if err != nil {
  78463. return nil, err
  78464. }
  78465. defer googleapi.CloseBody(res)
  78466. if err := googleapi.CheckResponse(res); err != nil {
  78467. return nil, err
  78468. }
  78469. ret := &InterconnectAttachment{
  78470. ServerResponse: googleapi.ServerResponse{
  78471. Header: res.Header,
  78472. HTTPStatusCode: res.StatusCode,
  78473. },
  78474. }
  78475. target := &ret
  78476. if err := gensupport.DecodeResponse(target, res); err != nil {
  78477. return nil, err
  78478. }
  78479. return ret, nil
  78480. // {
  78481. // "description": "Returns the specified interconnect attachment.",
  78482. // "httpMethod": "GET",
  78483. // "id": "compute.interconnectAttachments.get",
  78484. // "parameterOrder": [
  78485. // "project",
  78486. // "region",
  78487. // "interconnectAttachment"
  78488. // ],
  78489. // "parameters": {
  78490. // "interconnectAttachment": {
  78491. // "description": "Name of the interconnect attachment to return.",
  78492. // "location": "path",
  78493. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78494. // "required": true,
  78495. // "type": "string"
  78496. // },
  78497. // "project": {
  78498. // "description": "Project ID for this request.",
  78499. // "location": "path",
  78500. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78501. // "required": true,
  78502. // "type": "string"
  78503. // },
  78504. // "region": {
  78505. // "description": "Name of the region for this request.",
  78506. // "location": "path",
  78507. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78508. // "required": true,
  78509. // "type": "string"
  78510. // }
  78511. // },
  78512. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  78513. // "response": {
  78514. // "$ref": "InterconnectAttachment"
  78515. // },
  78516. // "scopes": [
  78517. // "https://www.googleapis.com/auth/cloud-platform",
  78518. // "https://www.googleapis.com/auth/compute",
  78519. // "https://www.googleapis.com/auth/compute.readonly"
  78520. // ]
  78521. // }
  78522. }
  78523. // method id "compute.interconnectAttachments.getIamPolicy":
  78524. type InterconnectAttachmentsGetIamPolicyCall struct {
  78525. s *Service
  78526. project string
  78527. region string
  78528. resource string
  78529. urlParams_ gensupport.URLParams
  78530. ifNoneMatch_ string
  78531. ctx_ context.Context
  78532. header_ http.Header
  78533. }
  78534. // GetIamPolicy: Gets the access control policy for a resource. May be
  78535. // empty if no such policy or resource exists.
  78536. func (r *InterconnectAttachmentsService) GetIamPolicy(project string, region string, resource string) *InterconnectAttachmentsGetIamPolicyCall {
  78537. c := &InterconnectAttachmentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78538. c.project = project
  78539. c.region = region
  78540. c.resource = resource
  78541. return c
  78542. }
  78543. // Fields allows partial responses to be retrieved. See
  78544. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78545. // for more information.
  78546. func (c *InterconnectAttachmentsGetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetIamPolicyCall {
  78547. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78548. return c
  78549. }
  78550. // IfNoneMatch sets the optional parameter which makes the operation
  78551. // fail if the object's ETag matches the given value. This is useful for
  78552. // getting updates only after the object has changed since the last
  78553. // request. Use googleapi.IsNotModified to check whether the response
  78554. // error from Do is the result of In-None-Match.
  78555. func (c *InterconnectAttachmentsGetIamPolicyCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetIamPolicyCall {
  78556. c.ifNoneMatch_ = entityTag
  78557. return c
  78558. }
  78559. // Context sets the context to be used in this call's Do method. Any
  78560. // pending HTTP request will be aborted if the provided context is
  78561. // canceled.
  78562. func (c *InterconnectAttachmentsGetIamPolicyCall) Context(ctx context.Context) *InterconnectAttachmentsGetIamPolicyCall {
  78563. c.ctx_ = ctx
  78564. return c
  78565. }
  78566. // Header returns an http.Header that can be modified by the caller to
  78567. // add HTTP headers to the request.
  78568. func (c *InterconnectAttachmentsGetIamPolicyCall) Header() http.Header {
  78569. if c.header_ == nil {
  78570. c.header_ = make(http.Header)
  78571. }
  78572. return c.header_
  78573. }
  78574. func (c *InterconnectAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  78575. reqHeaders := make(http.Header)
  78576. for k, v := range c.header_ {
  78577. reqHeaders[k] = v
  78578. }
  78579. reqHeaders.Set("User-Agent", c.s.userAgent())
  78580. if c.ifNoneMatch_ != "" {
  78581. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78582. }
  78583. var body io.Reader = nil
  78584. c.urlParams_.Set("alt", alt)
  78585. c.urlParams_.Set("prettyPrint", "false")
  78586. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy")
  78587. urls += "?" + c.urlParams_.Encode()
  78588. req, err := http.NewRequest("GET", urls, body)
  78589. if err != nil {
  78590. return nil, err
  78591. }
  78592. req.Header = reqHeaders
  78593. googleapi.Expand(req.URL, map[string]string{
  78594. "project": c.project,
  78595. "region": c.region,
  78596. "resource": c.resource,
  78597. })
  78598. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78599. }
  78600. // Do executes the "compute.interconnectAttachments.getIamPolicy" call.
  78601. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  78602. // code is an error. Response headers are in either
  78603. // *Policy.ServerResponse.Header or (if a response was returned at all)
  78604. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  78605. // check whether the returned error was because http.StatusNotModified
  78606. // was returned.
  78607. func (c *InterconnectAttachmentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  78608. gensupport.SetOptions(c.urlParams_, opts...)
  78609. res, err := c.doRequest("json")
  78610. if res != nil && res.StatusCode == http.StatusNotModified {
  78611. if res.Body != nil {
  78612. res.Body.Close()
  78613. }
  78614. return nil, &googleapi.Error{
  78615. Code: res.StatusCode,
  78616. Header: res.Header,
  78617. }
  78618. }
  78619. if err != nil {
  78620. return nil, err
  78621. }
  78622. defer googleapi.CloseBody(res)
  78623. if err := googleapi.CheckResponse(res); err != nil {
  78624. return nil, err
  78625. }
  78626. ret := &Policy{
  78627. ServerResponse: googleapi.ServerResponse{
  78628. Header: res.Header,
  78629. HTTPStatusCode: res.StatusCode,
  78630. },
  78631. }
  78632. target := &ret
  78633. if err := gensupport.DecodeResponse(target, res); err != nil {
  78634. return nil, err
  78635. }
  78636. return ret, nil
  78637. // {
  78638. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  78639. // "httpMethod": "GET",
  78640. // "id": "compute.interconnectAttachments.getIamPolicy",
  78641. // "parameterOrder": [
  78642. // "project",
  78643. // "region",
  78644. // "resource"
  78645. // ],
  78646. // "parameters": {
  78647. // "project": {
  78648. // "description": "Project ID for this request.",
  78649. // "location": "path",
  78650. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78651. // "required": true,
  78652. // "type": "string"
  78653. // },
  78654. // "region": {
  78655. // "description": "The name of the region for this request.",
  78656. // "location": "path",
  78657. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78658. // "required": true,
  78659. // "type": "string"
  78660. // },
  78661. // "resource": {
  78662. // "description": "Name or id of the resource for this request.",
  78663. // "location": "path",
  78664. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78665. // "required": true,
  78666. // "type": "string"
  78667. // }
  78668. // },
  78669. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy",
  78670. // "response": {
  78671. // "$ref": "Policy"
  78672. // },
  78673. // "scopes": [
  78674. // "https://www.googleapis.com/auth/cloud-platform",
  78675. // "https://www.googleapis.com/auth/compute",
  78676. // "https://www.googleapis.com/auth/compute.readonly"
  78677. // ]
  78678. // }
  78679. }
  78680. // method id "compute.interconnectAttachments.insert":
  78681. type InterconnectAttachmentsInsertCall struct {
  78682. s *Service
  78683. project string
  78684. region string
  78685. interconnectattachment *InterconnectAttachment
  78686. urlParams_ gensupport.URLParams
  78687. ctx_ context.Context
  78688. header_ http.Header
  78689. }
  78690. // Insert: Creates an InterconnectAttachment in the specified project
  78691. // using the data included in the request.
  78692. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  78693. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78694. c.project = project
  78695. c.region = region
  78696. c.interconnectattachment = interconnectattachment
  78697. return c
  78698. }
  78699. // RequestId sets the optional parameter "requestId": An optional
  78700. // request ID to identify requests. Specify a unique request ID so that
  78701. // if you must retry your request, the server will know to ignore the
  78702. // request if it has already been completed.
  78703. //
  78704. // For example, consider a situation where you make an initial request
  78705. // and the request times out. If you make the request again with the
  78706. // same request ID, the server can check if original operation with the
  78707. // same request ID was received, and if so, will ignore the second
  78708. // request. This prevents clients from accidentally creating duplicate
  78709. // commitments.
  78710. //
  78711. // The request ID must be a valid UUID with the exception that zero UUID
  78712. // is not supported (00000000-0000-0000-0000-000000000000).
  78713. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  78714. c.urlParams_.Set("requestId", requestId)
  78715. return c
  78716. }
  78717. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  78718. // request will not be committed.
  78719. func (c *InterconnectAttachmentsInsertCall) ValidateOnly(validateOnly bool) *InterconnectAttachmentsInsertCall {
  78720. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  78721. return c
  78722. }
  78723. // Fields allows partial responses to be retrieved. See
  78724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78725. // for more information.
  78726. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  78727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78728. return c
  78729. }
  78730. // Context sets the context to be used in this call's Do method. Any
  78731. // pending HTTP request will be aborted if the provided context is
  78732. // canceled.
  78733. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  78734. c.ctx_ = ctx
  78735. return c
  78736. }
  78737. // Header returns an http.Header that can be modified by the caller to
  78738. // add HTTP headers to the request.
  78739. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  78740. if c.header_ == nil {
  78741. c.header_ = make(http.Header)
  78742. }
  78743. return c.header_
  78744. }
  78745. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  78746. reqHeaders := make(http.Header)
  78747. for k, v := range c.header_ {
  78748. reqHeaders[k] = v
  78749. }
  78750. reqHeaders.Set("User-Agent", c.s.userAgent())
  78751. var body io.Reader = nil
  78752. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  78753. if err != nil {
  78754. return nil, err
  78755. }
  78756. reqHeaders.Set("Content-Type", "application/json")
  78757. c.urlParams_.Set("alt", alt)
  78758. c.urlParams_.Set("prettyPrint", "false")
  78759. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  78760. urls += "?" + c.urlParams_.Encode()
  78761. req, err := http.NewRequest("POST", urls, body)
  78762. if err != nil {
  78763. return nil, err
  78764. }
  78765. req.Header = reqHeaders
  78766. googleapi.Expand(req.URL, map[string]string{
  78767. "project": c.project,
  78768. "region": c.region,
  78769. })
  78770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78771. }
  78772. // Do executes the "compute.interconnectAttachments.insert" call.
  78773. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78774. // status code is an error. Response headers are in either
  78775. // *Operation.ServerResponse.Header or (if a response was returned at
  78776. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78777. // to check whether the returned error was because
  78778. // http.StatusNotModified was returned.
  78779. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78780. gensupport.SetOptions(c.urlParams_, opts...)
  78781. res, err := c.doRequest("json")
  78782. if res != nil && res.StatusCode == http.StatusNotModified {
  78783. if res.Body != nil {
  78784. res.Body.Close()
  78785. }
  78786. return nil, &googleapi.Error{
  78787. Code: res.StatusCode,
  78788. Header: res.Header,
  78789. }
  78790. }
  78791. if err != nil {
  78792. return nil, err
  78793. }
  78794. defer googleapi.CloseBody(res)
  78795. if err := googleapi.CheckResponse(res); err != nil {
  78796. return nil, err
  78797. }
  78798. ret := &Operation{
  78799. ServerResponse: googleapi.ServerResponse{
  78800. Header: res.Header,
  78801. HTTPStatusCode: res.StatusCode,
  78802. },
  78803. }
  78804. target := &ret
  78805. if err := gensupport.DecodeResponse(target, res); err != nil {
  78806. return nil, err
  78807. }
  78808. return ret, nil
  78809. // {
  78810. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  78811. // "httpMethod": "POST",
  78812. // "id": "compute.interconnectAttachments.insert",
  78813. // "parameterOrder": [
  78814. // "project",
  78815. // "region"
  78816. // ],
  78817. // "parameters": {
  78818. // "project": {
  78819. // "description": "Project ID for this request.",
  78820. // "location": "path",
  78821. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78822. // "required": true,
  78823. // "type": "string"
  78824. // },
  78825. // "region": {
  78826. // "description": "Name of the region for this request.",
  78827. // "location": "path",
  78828. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78829. // "required": true,
  78830. // "type": "string"
  78831. // },
  78832. // "requestId": {
  78833. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78834. // "location": "query",
  78835. // "type": "string"
  78836. // },
  78837. // "validateOnly": {
  78838. // "description": "If true, the request will not be committed.",
  78839. // "location": "query",
  78840. // "type": "boolean"
  78841. // }
  78842. // },
  78843. // "path": "{project}/regions/{region}/interconnectAttachments",
  78844. // "request": {
  78845. // "$ref": "InterconnectAttachment"
  78846. // },
  78847. // "response": {
  78848. // "$ref": "Operation"
  78849. // },
  78850. // "scopes": [
  78851. // "https://www.googleapis.com/auth/cloud-platform",
  78852. // "https://www.googleapis.com/auth/compute"
  78853. // ]
  78854. // }
  78855. }
  78856. // method id "compute.interconnectAttachments.list":
  78857. type InterconnectAttachmentsListCall struct {
  78858. s *Service
  78859. project string
  78860. region string
  78861. urlParams_ gensupport.URLParams
  78862. ifNoneMatch_ string
  78863. ctx_ context.Context
  78864. header_ http.Header
  78865. }
  78866. // List: Retrieves the list of interconnect attachments contained within
  78867. // the specified region.
  78868. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  78869. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78870. c.project = project
  78871. c.region = region
  78872. return c
  78873. }
  78874. // Filter sets the optional parameter "filter": A filter expression that
  78875. // filters resources listed in the response. The expression must specify
  78876. // the field name, a comparison operator, and the value that you want to
  78877. // use for filtering. The value must be a string, a number, or a
  78878. // boolean. The comparison operator must be either =, !=, >, or <.
  78879. //
  78880. // For example, if you are filtering Compute Engine instances, you can
  78881. // exclude instances named example-instance by specifying name !=
  78882. // example-instance.
  78883. //
  78884. // You can also filter nested fields. For example, you could specify
  78885. // scheduling.automaticRestart = false to include instances only if they
  78886. // are not scheduled for automatic restarts. You can use filtering on
  78887. // nested fields to filter based on resource labels.
  78888. //
  78889. // To filter on multiple expressions, provide each separate expression
  78890. // within parentheses. For example, (scheduling.automaticRestart = true)
  78891. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78892. // AND expression. However, you can include AND and OR expressions
  78893. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78894. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78895. // true).
  78896. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  78897. c.urlParams_.Set("filter", filter)
  78898. return c
  78899. }
  78900. // MaxResults sets the optional parameter "maxResults": The maximum
  78901. // number of results per page that should be returned. If the number of
  78902. // available results is larger than maxResults, Compute Engine returns a
  78903. // nextPageToken that can be used to get the next page of results in
  78904. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78905. // (Default: 500)
  78906. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  78907. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78908. return c
  78909. }
  78910. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78911. // a certain order. By default, results are returned in alphanumerical
  78912. // order based on the resource name.
  78913. //
  78914. // You can also sort results in descending order based on the creation
  78915. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78916. // based on the creationTimestamp field in reverse chronological order
  78917. // (newest result first). Use this to sort resources like operations so
  78918. // that the newest operation is returned first.
  78919. //
  78920. // Currently, only sorting by name or creationTimestamp desc is
  78921. // supported.
  78922. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  78923. c.urlParams_.Set("orderBy", orderBy)
  78924. return c
  78925. }
  78926. // PageToken sets the optional parameter "pageToken": Specifies a page
  78927. // token to use. Set pageToken to the nextPageToken returned by a
  78928. // previous list request to get the next page of results.
  78929. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  78930. c.urlParams_.Set("pageToken", pageToken)
  78931. return c
  78932. }
  78933. // Fields allows partial responses to be retrieved. See
  78934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78935. // for more information.
  78936. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  78937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78938. return c
  78939. }
  78940. // IfNoneMatch sets the optional parameter which makes the operation
  78941. // fail if the object's ETag matches the given value. This is useful for
  78942. // getting updates only after the object has changed since the last
  78943. // request. Use googleapi.IsNotModified to check whether the response
  78944. // error from Do is the result of In-None-Match.
  78945. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  78946. c.ifNoneMatch_ = entityTag
  78947. return c
  78948. }
  78949. // Context sets the context to be used in this call's Do method. Any
  78950. // pending HTTP request will be aborted if the provided context is
  78951. // canceled.
  78952. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  78953. c.ctx_ = ctx
  78954. return c
  78955. }
  78956. // Header returns an http.Header that can be modified by the caller to
  78957. // add HTTP headers to the request.
  78958. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  78959. if c.header_ == nil {
  78960. c.header_ = make(http.Header)
  78961. }
  78962. return c.header_
  78963. }
  78964. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  78965. reqHeaders := make(http.Header)
  78966. for k, v := range c.header_ {
  78967. reqHeaders[k] = v
  78968. }
  78969. reqHeaders.Set("User-Agent", c.s.userAgent())
  78970. if c.ifNoneMatch_ != "" {
  78971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78972. }
  78973. var body io.Reader = nil
  78974. c.urlParams_.Set("alt", alt)
  78975. c.urlParams_.Set("prettyPrint", "false")
  78976. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  78977. urls += "?" + c.urlParams_.Encode()
  78978. req, err := http.NewRequest("GET", urls, body)
  78979. if err != nil {
  78980. return nil, err
  78981. }
  78982. req.Header = reqHeaders
  78983. googleapi.Expand(req.URL, map[string]string{
  78984. "project": c.project,
  78985. "region": c.region,
  78986. })
  78987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78988. }
  78989. // Do executes the "compute.interconnectAttachments.list" call.
  78990. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  78991. // Any non-2xx status code is an error. Response headers are in either
  78992. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  78993. // was returned at all) in error.(*googleapi.Error).Header. Use
  78994. // googleapi.IsNotModified to check whether the returned error was
  78995. // because http.StatusNotModified was returned.
  78996. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  78997. gensupport.SetOptions(c.urlParams_, opts...)
  78998. res, err := c.doRequest("json")
  78999. if res != nil && res.StatusCode == http.StatusNotModified {
  79000. if res.Body != nil {
  79001. res.Body.Close()
  79002. }
  79003. return nil, &googleapi.Error{
  79004. Code: res.StatusCode,
  79005. Header: res.Header,
  79006. }
  79007. }
  79008. if err != nil {
  79009. return nil, err
  79010. }
  79011. defer googleapi.CloseBody(res)
  79012. if err := googleapi.CheckResponse(res); err != nil {
  79013. return nil, err
  79014. }
  79015. ret := &InterconnectAttachmentList{
  79016. ServerResponse: googleapi.ServerResponse{
  79017. Header: res.Header,
  79018. HTTPStatusCode: res.StatusCode,
  79019. },
  79020. }
  79021. target := &ret
  79022. if err := gensupport.DecodeResponse(target, res); err != nil {
  79023. return nil, err
  79024. }
  79025. return ret, nil
  79026. // {
  79027. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  79028. // "httpMethod": "GET",
  79029. // "id": "compute.interconnectAttachments.list",
  79030. // "parameterOrder": [
  79031. // "project",
  79032. // "region"
  79033. // ],
  79034. // "parameters": {
  79035. // "filter": {
  79036. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  79037. // "location": "query",
  79038. // "type": "string"
  79039. // },
  79040. // "maxResults": {
  79041. // "default": "500",
  79042. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  79043. // "format": "uint32",
  79044. // "location": "query",
  79045. // "minimum": "0",
  79046. // "type": "integer"
  79047. // },
  79048. // "orderBy": {
  79049. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  79050. // "location": "query",
  79051. // "type": "string"
  79052. // },
  79053. // "pageToken": {
  79054. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  79055. // "location": "query",
  79056. // "type": "string"
  79057. // },
  79058. // "project": {
  79059. // "description": "Project ID for this request.",
  79060. // "location": "path",
  79061. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79062. // "required": true,
  79063. // "type": "string"
  79064. // },
  79065. // "region": {
  79066. // "description": "Name of the region for this request.",
  79067. // "location": "path",
  79068. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79069. // "required": true,
  79070. // "type": "string"
  79071. // }
  79072. // },
  79073. // "path": "{project}/regions/{region}/interconnectAttachments",
  79074. // "response": {
  79075. // "$ref": "InterconnectAttachmentList"
  79076. // },
  79077. // "scopes": [
  79078. // "https://www.googleapis.com/auth/cloud-platform",
  79079. // "https://www.googleapis.com/auth/compute",
  79080. // "https://www.googleapis.com/auth/compute.readonly"
  79081. // ]
  79082. // }
  79083. }
  79084. // Pages invokes f for each page of results.
  79085. // A non-nil error returned from f will halt the iteration.
  79086. // The provided context supersedes any context provided to the Context method.
  79087. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  79088. c.ctx_ = ctx
  79089. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79090. for {
  79091. x, err := c.Do()
  79092. if err != nil {
  79093. return err
  79094. }
  79095. if err := f(x); err != nil {
  79096. return err
  79097. }
  79098. if x.NextPageToken == "" {
  79099. return nil
  79100. }
  79101. c.PageToken(x.NextPageToken)
  79102. }
  79103. }
  79104. // method id "compute.interconnectAttachments.patch":
  79105. type InterconnectAttachmentsPatchCall struct {
  79106. s *Service
  79107. project string
  79108. region string
  79109. interconnectAttachment string
  79110. interconnectattachment *InterconnectAttachment
  79111. urlParams_ gensupport.URLParams
  79112. ctx_ context.Context
  79113. header_ http.Header
  79114. }
  79115. // Patch: Updates the specified interconnect attachment with the data
  79116. // included in the request. This method supports PATCH semantics and
  79117. // uses the JSON merge patch format and processing rules.
  79118. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  79119. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79120. c.project = project
  79121. c.region = region
  79122. c.interconnectAttachment = interconnectAttachment
  79123. c.interconnectattachment = interconnectattachment
  79124. return c
  79125. }
  79126. // RequestId sets the optional parameter "requestId": An optional
  79127. // request ID to identify requests. Specify a unique request ID so that
  79128. // if you must retry your request, the server will know to ignore the
  79129. // request if it has already been completed.
  79130. //
  79131. // For example, consider a situation where you make an initial request
  79132. // and the request times out. If you make the request again with the
  79133. // same request ID, the server can check if original operation with the
  79134. // same request ID was received, and if so, will ignore the second
  79135. // request. This prevents clients from accidentally creating duplicate
  79136. // commitments.
  79137. //
  79138. // The request ID must be a valid UUID with the exception that zero UUID
  79139. // is not supported (00000000-0000-0000-0000-000000000000).
  79140. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  79141. c.urlParams_.Set("requestId", requestId)
  79142. return c
  79143. }
  79144. // Fields allows partial responses to be retrieved. See
  79145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79146. // for more information.
  79147. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  79148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79149. return c
  79150. }
  79151. // Context sets the context to be used in this call's Do method. Any
  79152. // pending HTTP request will be aborted if the provided context is
  79153. // canceled.
  79154. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  79155. c.ctx_ = ctx
  79156. return c
  79157. }
  79158. // Header returns an http.Header that can be modified by the caller to
  79159. // add HTTP headers to the request.
  79160. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  79161. if c.header_ == nil {
  79162. c.header_ = make(http.Header)
  79163. }
  79164. return c.header_
  79165. }
  79166. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  79167. reqHeaders := make(http.Header)
  79168. for k, v := range c.header_ {
  79169. reqHeaders[k] = v
  79170. }
  79171. reqHeaders.Set("User-Agent", c.s.userAgent())
  79172. var body io.Reader = nil
  79173. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  79174. if err != nil {
  79175. return nil, err
  79176. }
  79177. reqHeaders.Set("Content-Type", "application/json")
  79178. c.urlParams_.Set("alt", alt)
  79179. c.urlParams_.Set("prettyPrint", "false")
  79180. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  79181. urls += "?" + c.urlParams_.Encode()
  79182. req, err := http.NewRequest("PATCH", urls, body)
  79183. if err != nil {
  79184. return nil, err
  79185. }
  79186. req.Header = reqHeaders
  79187. googleapi.Expand(req.URL, map[string]string{
  79188. "project": c.project,
  79189. "region": c.region,
  79190. "interconnectAttachment": c.interconnectAttachment,
  79191. })
  79192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79193. }
  79194. // Do executes the "compute.interconnectAttachments.patch" call.
  79195. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79196. // status code is an error. Response headers are in either
  79197. // *Operation.ServerResponse.Header or (if a response was returned at
  79198. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79199. // to check whether the returned error was because
  79200. // http.StatusNotModified was returned.
  79201. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79202. gensupport.SetOptions(c.urlParams_, opts...)
  79203. res, err := c.doRequest("json")
  79204. if res != nil && res.StatusCode == http.StatusNotModified {
  79205. if res.Body != nil {
  79206. res.Body.Close()
  79207. }
  79208. return nil, &googleapi.Error{
  79209. Code: res.StatusCode,
  79210. Header: res.Header,
  79211. }
  79212. }
  79213. if err != nil {
  79214. return nil, err
  79215. }
  79216. defer googleapi.CloseBody(res)
  79217. if err := googleapi.CheckResponse(res); err != nil {
  79218. return nil, err
  79219. }
  79220. ret := &Operation{
  79221. ServerResponse: googleapi.ServerResponse{
  79222. Header: res.Header,
  79223. HTTPStatusCode: res.StatusCode,
  79224. },
  79225. }
  79226. target := &ret
  79227. if err := gensupport.DecodeResponse(target, res); err != nil {
  79228. return nil, err
  79229. }
  79230. return ret, nil
  79231. // {
  79232. // "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.",
  79233. // "httpMethod": "PATCH",
  79234. // "id": "compute.interconnectAttachments.patch",
  79235. // "parameterOrder": [
  79236. // "project",
  79237. // "region",
  79238. // "interconnectAttachment"
  79239. // ],
  79240. // "parameters": {
  79241. // "interconnectAttachment": {
  79242. // "description": "Name of the interconnect attachment to patch.",
  79243. // "location": "path",
  79244. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79245. // "required": true,
  79246. // "type": "string"
  79247. // },
  79248. // "project": {
  79249. // "description": "Project ID for this request.",
  79250. // "location": "path",
  79251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79252. // "required": true,
  79253. // "type": "string"
  79254. // },
  79255. // "region": {
  79256. // "description": "Name of the region scoping this request.",
  79257. // "location": "path",
  79258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79259. // "required": true,
  79260. // "type": "string"
  79261. // },
  79262. // "requestId": {
  79263. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79264. // "location": "query",
  79265. // "type": "string"
  79266. // }
  79267. // },
  79268. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  79269. // "request": {
  79270. // "$ref": "InterconnectAttachment"
  79271. // },
  79272. // "response": {
  79273. // "$ref": "Operation"
  79274. // },
  79275. // "scopes": [
  79276. // "https://www.googleapis.com/auth/cloud-platform",
  79277. // "https://www.googleapis.com/auth/compute"
  79278. // ]
  79279. // }
  79280. }
  79281. // method id "compute.interconnectAttachments.setIamPolicy":
  79282. type InterconnectAttachmentsSetIamPolicyCall struct {
  79283. s *Service
  79284. project string
  79285. region string
  79286. resource string
  79287. regionsetpolicyrequest *RegionSetPolicyRequest
  79288. urlParams_ gensupport.URLParams
  79289. ctx_ context.Context
  79290. header_ http.Header
  79291. }
  79292. // SetIamPolicy: Sets the access control policy on the specified
  79293. // resource. Replaces any existing policy.
  79294. func (r *InterconnectAttachmentsService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *InterconnectAttachmentsSetIamPolicyCall {
  79295. c := &InterconnectAttachmentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79296. c.project = project
  79297. c.region = region
  79298. c.resource = resource
  79299. c.regionsetpolicyrequest = regionsetpolicyrequest
  79300. return c
  79301. }
  79302. // Fields allows partial responses to be retrieved. See
  79303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79304. // for more information.
  79305. func (c *InterconnectAttachmentsSetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetIamPolicyCall {
  79306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79307. return c
  79308. }
  79309. // Context sets the context to be used in this call's Do method. Any
  79310. // pending HTTP request will be aborted if the provided context is
  79311. // canceled.
  79312. func (c *InterconnectAttachmentsSetIamPolicyCall) Context(ctx context.Context) *InterconnectAttachmentsSetIamPolicyCall {
  79313. c.ctx_ = ctx
  79314. return c
  79315. }
  79316. // Header returns an http.Header that can be modified by the caller to
  79317. // add HTTP headers to the request.
  79318. func (c *InterconnectAttachmentsSetIamPolicyCall) Header() http.Header {
  79319. if c.header_ == nil {
  79320. c.header_ = make(http.Header)
  79321. }
  79322. return c.header_
  79323. }
  79324. func (c *InterconnectAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  79325. reqHeaders := make(http.Header)
  79326. for k, v := range c.header_ {
  79327. reqHeaders[k] = v
  79328. }
  79329. reqHeaders.Set("User-Agent", c.s.userAgent())
  79330. var body io.Reader = nil
  79331. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  79332. if err != nil {
  79333. return nil, err
  79334. }
  79335. reqHeaders.Set("Content-Type", "application/json")
  79336. c.urlParams_.Set("alt", alt)
  79337. c.urlParams_.Set("prettyPrint", "false")
  79338. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy")
  79339. urls += "?" + c.urlParams_.Encode()
  79340. req, err := http.NewRequest("POST", urls, body)
  79341. if err != nil {
  79342. return nil, err
  79343. }
  79344. req.Header = reqHeaders
  79345. googleapi.Expand(req.URL, map[string]string{
  79346. "project": c.project,
  79347. "region": c.region,
  79348. "resource": c.resource,
  79349. })
  79350. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79351. }
  79352. // Do executes the "compute.interconnectAttachments.setIamPolicy" call.
  79353. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  79354. // code is an error. Response headers are in either
  79355. // *Policy.ServerResponse.Header or (if a response was returned at all)
  79356. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  79357. // check whether the returned error was because http.StatusNotModified
  79358. // was returned.
  79359. func (c *InterconnectAttachmentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  79360. gensupport.SetOptions(c.urlParams_, opts...)
  79361. res, err := c.doRequest("json")
  79362. if res != nil && res.StatusCode == http.StatusNotModified {
  79363. if res.Body != nil {
  79364. res.Body.Close()
  79365. }
  79366. return nil, &googleapi.Error{
  79367. Code: res.StatusCode,
  79368. Header: res.Header,
  79369. }
  79370. }
  79371. if err != nil {
  79372. return nil, err
  79373. }
  79374. defer googleapi.CloseBody(res)
  79375. if err := googleapi.CheckResponse(res); err != nil {
  79376. return nil, err
  79377. }
  79378. ret := &Policy{
  79379. ServerResponse: googleapi.ServerResponse{
  79380. Header: res.Header,
  79381. HTTPStatusCode: res.StatusCode,
  79382. },
  79383. }
  79384. target := &ret
  79385. if err := gensupport.DecodeResponse(target, res); err != nil {
  79386. return nil, err
  79387. }
  79388. return ret, nil
  79389. // {
  79390. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  79391. // "httpMethod": "POST",
  79392. // "id": "compute.interconnectAttachments.setIamPolicy",
  79393. // "parameterOrder": [
  79394. // "project",
  79395. // "region",
  79396. // "resource"
  79397. // ],
  79398. // "parameters": {
  79399. // "project": {
  79400. // "description": "Project ID for this request.",
  79401. // "location": "path",
  79402. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79403. // "required": true,
  79404. // "type": "string"
  79405. // },
  79406. // "region": {
  79407. // "description": "The name of the region for this request.",
  79408. // "location": "path",
  79409. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79410. // "required": true,
  79411. // "type": "string"
  79412. // },
  79413. // "resource": {
  79414. // "description": "Name or id of the resource for this request.",
  79415. // "location": "path",
  79416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79417. // "required": true,
  79418. // "type": "string"
  79419. // }
  79420. // },
  79421. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy",
  79422. // "request": {
  79423. // "$ref": "RegionSetPolicyRequest"
  79424. // },
  79425. // "response": {
  79426. // "$ref": "Policy"
  79427. // },
  79428. // "scopes": [
  79429. // "https://www.googleapis.com/auth/cloud-platform",
  79430. // "https://www.googleapis.com/auth/compute"
  79431. // ]
  79432. // }
  79433. }
  79434. // method id "compute.interconnectAttachments.setLabels":
  79435. type InterconnectAttachmentsSetLabelsCall struct {
  79436. s *Service
  79437. project string
  79438. region string
  79439. resource string
  79440. regionsetlabelsrequest *RegionSetLabelsRequest
  79441. urlParams_ gensupport.URLParams
  79442. ctx_ context.Context
  79443. header_ http.Header
  79444. }
  79445. // SetLabels: Sets the labels on an InterconnectAttachment. To learn
  79446. // more about labels, read the Labeling Resources documentation.
  79447. func (r *InterconnectAttachmentsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *InterconnectAttachmentsSetLabelsCall {
  79448. c := &InterconnectAttachmentsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79449. c.project = project
  79450. c.region = region
  79451. c.resource = resource
  79452. c.regionsetlabelsrequest = regionsetlabelsrequest
  79453. return c
  79454. }
  79455. // RequestId sets the optional parameter "requestId": An optional
  79456. // request ID to identify requests. Specify a unique request ID so that
  79457. // if you must retry your request, the server will know to ignore the
  79458. // request if it has already been completed.
  79459. //
  79460. // For example, consider a situation where you make an initial request
  79461. // and the request times out. If you make the request again with the
  79462. // same request ID, the server can check if original operation with the
  79463. // same request ID was received, and if so, will ignore the second
  79464. // request. This prevents clients from accidentally creating duplicate
  79465. // commitments.
  79466. //
  79467. // The request ID must be a valid UUID with the exception that zero UUID
  79468. // is not supported (00000000-0000-0000-0000-000000000000).
  79469. func (c *InterconnectAttachmentsSetLabelsCall) RequestId(requestId string) *InterconnectAttachmentsSetLabelsCall {
  79470. c.urlParams_.Set("requestId", requestId)
  79471. return c
  79472. }
  79473. // Fields allows partial responses to be retrieved. See
  79474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79475. // for more information.
  79476. func (c *InterconnectAttachmentsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetLabelsCall {
  79477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79478. return c
  79479. }
  79480. // Context sets the context to be used in this call's Do method. Any
  79481. // pending HTTP request will be aborted if the provided context is
  79482. // canceled.
  79483. func (c *InterconnectAttachmentsSetLabelsCall) Context(ctx context.Context) *InterconnectAttachmentsSetLabelsCall {
  79484. c.ctx_ = ctx
  79485. return c
  79486. }
  79487. // Header returns an http.Header that can be modified by the caller to
  79488. // add HTTP headers to the request.
  79489. func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header {
  79490. if c.header_ == nil {
  79491. c.header_ = make(http.Header)
  79492. }
  79493. return c.header_
  79494. }
  79495. func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  79496. reqHeaders := make(http.Header)
  79497. for k, v := range c.header_ {
  79498. reqHeaders[k] = v
  79499. }
  79500. reqHeaders.Set("User-Agent", c.s.userAgent())
  79501. var body io.Reader = nil
  79502. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  79503. if err != nil {
  79504. return nil, err
  79505. }
  79506. reqHeaders.Set("Content-Type", "application/json")
  79507. c.urlParams_.Set("alt", alt)
  79508. c.urlParams_.Set("prettyPrint", "false")
  79509. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels")
  79510. urls += "?" + c.urlParams_.Encode()
  79511. req, err := http.NewRequest("POST", urls, body)
  79512. if err != nil {
  79513. return nil, err
  79514. }
  79515. req.Header = reqHeaders
  79516. googleapi.Expand(req.URL, map[string]string{
  79517. "project": c.project,
  79518. "region": c.region,
  79519. "resource": c.resource,
  79520. })
  79521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79522. }
  79523. // Do executes the "compute.interconnectAttachments.setLabels" call.
  79524. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79525. // status code is an error. Response headers are in either
  79526. // *Operation.ServerResponse.Header or (if a response was returned at
  79527. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79528. // to check whether the returned error was because
  79529. // http.StatusNotModified was returned.
  79530. func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79531. gensupport.SetOptions(c.urlParams_, opts...)
  79532. res, err := c.doRequest("json")
  79533. if res != nil && res.StatusCode == http.StatusNotModified {
  79534. if res.Body != nil {
  79535. res.Body.Close()
  79536. }
  79537. return nil, &googleapi.Error{
  79538. Code: res.StatusCode,
  79539. Header: res.Header,
  79540. }
  79541. }
  79542. if err != nil {
  79543. return nil, err
  79544. }
  79545. defer googleapi.CloseBody(res)
  79546. if err := googleapi.CheckResponse(res); err != nil {
  79547. return nil, err
  79548. }
  79549. ret := &Operation{
  79550. ServerResponse: googleapi.ServerResponse{
  79551. Header: res.Header,
  79552. HTTPStatusCode: res.StatusCode,
  79553. },
  79554. }
  79555. target := &ret
  79556. if err := gensupport.DecodeResponse(target, res); err != nil {
  79557. return nil, err
  79558. }
  79559. return ret, nil
  79560. // {
  79561. // "description": "Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.",
  79562. // "httpMethod": "POST",
  79563. // "id": "compute.interconnectAttachments.setLabels",
  79564. // "parameterOrder": [
  79565. // "project",
  79566. // "region",
  79567. // "resource"
  79568. // ],
  79569. // "parameters": {
  79570. // "project": {
  79571. // "description": "Project ID for this request.",
  79572. // "location": "path",
  79573. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79574. // "required": true,
  79575. // "type": "string"
  79576. // },
  79577. // "region": {
  79578. // "description": "The region for this request.",
  79579. // "location": "path",
  79580. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79581. // "required": true,
  79582. // "type": "string"
  79583. // },
  79584. // "requestId": {
  79585. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79586. // "location": "query",
  79587. // "type": "string"
  79588. // },
  79589. // "resource": {
  79590. // "description": "Name or id of the resource for this request.",
  79591. // "location": "path",
  79592. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79593. // "required": true,
  79594. // "type": "string"
  79595. // }
  79596. // },
  79597. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels",
  79598. // "request": {
  79599. // "$ref": "RegionSetLabelsRequest"
  79600. // },
  79601. // "response": {
  79602. // "$ref": "Operation"
  79603. // },
  79604. // "scopes": [
  79605. // "https://www.googleapis.com/auth/cloud-platform",
  79606. // "https://www.googleapis.com/auth/compute"
  79607. // ]
  79608. // }
  79609. }
  79610. // method id "compute.interconnectAttachments.testIamPermissions":
  79611. type InterconnectAttachmentsTestIamPermissionsCall struct {
  79612. s *Service
  79613. project string
  79614. region string
  79615. resource string
  79616. testpermissionsrequest *TestPermissionsRequest
  79617. urlParams_ gensupport.URLParams
  79618. ctx_ context.Context
  79619. header_ http.Header
  79620. }
  79621. // TestIamPermissions: Returns permissions that a caller has on the
  79622. // specified resource.
  79623. func (r *InterconnectAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectAttachmentsTestIamPermissionsCall {
  79624. c := &InterconnectAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79625. c.project = project
  79626. c.region = region
  79627. c.resource = resource
  79628. c.testpermissionsrequest = testpermissionsrequest
  79629. return c
  79630. }
  79631. // Fields allows partial responses to be retrieved. See
  79632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79633. // for more information.
  79634. func (c *InterconnectAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsTestIamPermissionsCall {
  79635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79636. return c
  79637. }
  79638. // Context sets the context to be used in this call's Do method. Any
  79639. // pending HTTP request will be aborted if the provided context is
  79640. // canceled.
  79641. func (c *InterconnectAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectAttachmentsTestIamPermissionsCall {
  79642. c.ctx_ = ctx
  79643. return c
  79644. }
  79645. // Header returns an http.Header that can be modified by the caller to
  79646. // add HTTP headers to the request.
  79647. func (c *InterconnectAttachmentsTestIamPermissionsCall) Header() http.Header {
  79648. if c.header_ == nil {
  79649. c.header_ = make(http.Header)
  79650. }
  79651. return c.header_
  79652. }
  79653. func (c *InterconnectAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  79654. reqHeaders := make(http.Header)
  79655. for k, v := range c.header_ {
  79656. reqHeaders[k] = v
  79657. }
  79658. reqHeaders.Set("User-Agent", c.s.userAgent())
  79659. var body io.Reader = nil
  79660. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  79661. if err != nil {
  79662. return nil, err
  79663. }
  79664. reqHeaders.Set("Content-Type", "application/json")
  79665. c.urlParams_.Set("alt", alt)
  79666. c.urlParams_.Set("prettyPrint", "false")
  79667. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions")
  79668. urls += "?" + c.urlParams_.Encode()
  79669. req, err := http.NewRequest("POST", urls, body)
  79670. if err != nil {
  79671. return nil, err
  79672. }
  79673. req.Header = reqHeaders
  79674. googleapi.Expand(req.URL, map[string]string{
  79675. "project": c.project,
  79676. "region": c.region,
  79677. "resource": c.resource,
  79678. })
  79679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79680. }
  79681. // Do executes the "compute.interconnectAttachments.testIamPermissions" call.
  79682. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  79683. // non-2xx status code is an error. Response headers are in either
  79684. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  79685. // returned at all) in error.(*googleapi.Error).Header. Use
  79686. // googleapi.IsNotModified to check whether the returned error was
  79687. // because http.StatusNotModified was returned.
  79688. func (c *InterconnectAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  79689. gensupport.SetOptions(c.urlParams_, opts...)
  79690. res, err := c.doRequest("json")
  79691. if res != nil && res.StatusCode == http.StatusNotModified {
  79692. if res.Body != nil {
  79693. res.Body.Close()
  79694. }
  79695. return nil, &googleapi.Error{
  79696. Code: res.StatusCode,
  79697. Header: res.Header,
  79698. }
  79699. }
  79700. if err != nil {
  79701. return nil, err
  79702. }
  79703. defer googleapi.CloseBody(res)
  79704. if err := googleapi.CheckResponse(res); err != nil {
  79705. return nil, err
  79706. }
  79707. ret := &TestPermissionsResponse{
  79708. ServerResponse: googleapi.ServerResponse{
  79709. Header: res.Header,
  79710. HTTPStatusCode: res.StatusCode,
  79711. },
  79712. }
  79713. target := &ret
  79714. if err := gensupport.DecodeResponse(target, res); err != nil {
  79715. return nil, err
  79716. }
  79717. return ret, nil
  79718. // {
  79719. // "description": "Returns permissions that a caller has on the specified resource.",
  79720. // "httpMethod": "POST",
  79721. // "id": "compute.interconnectAttachments.testIamPermissions",
  79722. // "parameterOrder": [
  79723. // "project",
  79724. // "region",
  79725. // "resource"
  79726. // ],
  79727. // "parameters": {
  79728. // "project": {
  79729. // "description": "Project ID for this request.",
  79730. // "location": "path",
  79731. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79732. // "required": true,
  79733. // "type": "string"
  79734. // },
  79735. // "region": {
  79736. // "description": "The name of the region for this request.",
  79737. // "location": "path",
  79738. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79739. // "required": true,
  79740. // "type": "string"
  79741. // },
  79742. // "resource": {
  79743. // "description": "Name or id of the resource for this request.",
  79744. // "location": "path",
  79745. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79746. // "required": true,
  79747. // "type": "string"
  79748. // }
  79749. // },
  79750. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions",
  79751. // "request": {
  79752. // "$ref": "TestPermissionsRequest"
  79753. // },
  79754. // "response": {
  79755. // "$ref": "TestPermissionsResponse"
  79756. // },
  79757. // "scopes": [
  79758. // "https://www.googleapis.com/auth/cloud-platform",
  79759. // "https://www.googleapis.com/auth/compute",
  79760. // "https://www.googleapis.com/auth/compute.readonly"
  79761. // ]
  79762. // }
  79763. }
  79764. // method id "compute.interconnectLocations.get":
  79765. type InterconnectLocationsGetCall struct {
  79766. s *Service
  79767. project string
  79768. interconnectLocation string
  79769. urlParams_ gensupport.URLParams
  79770. ifNoneMatch_ string
  79771. ctx_ context.Context
  79772. header_ http.Header
  79773. }
  79774. // Get: Returns the details for the specified interconnect location.
  79775. // Gets a list of available interconnect locations by making a list()
  79776. // request.
  79777. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  79778. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79779. c.project = project
  79780. c.interconnectLocation = interconnectLocation
  79781. return c
  79782. }
  79783. // Fields allows partial responses to be retrieved. See
  79784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79785. // for more information.
  79786. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  79787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79788. return c
  79789. }
  79790. // IfNoneMatch sets the optional parameter which makes the operation
  79791. // fail if the object's ETag matches the given value. This is useful for
  79792. // getting updates only after the object has changed since the last
  79793. // request. Use googleapi.IsNotModified to check whether the response
  79794. // error from Do is the result of In-None-Match.
  79795. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  79796. c.ifNoneMatch_ = entityTag
  79797. return c
  79798. }
  79799. // Context sets the context to be used in this call's Do method. Any
  79800. // pending HTTP request will be aborted if the provided context is
  79801. // canceled.
  79802. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  79803. c.ctx_ = ctx
  79804. return c
  79805. }
  79806. // Header returns an http.Header that can be modified by the caller to
  79807. // add HTTP headers to the request.
  79808. func (c *InterconnectLocationsGetCall) Header() http.Header {
  79809. if c.header_ == nil {
  79810. c.header_ = make(http.Header)
  79811. }
  79812. return c.header_
  79813. }
  79814. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  79815. reqHeaders := make(http.Header)
  79816. for k, v := range c.header_ {
  79817. reqHeaders[k] = v
  79818. }
  79819. reqHeaders.Set("User-Agent", c.s.userAgent())
  79820. if c.ifNoneMatch_ != "" {
  79821. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79822. }
  79823. var body io.Reader = nil
  79824. c.urlParams_.Set("alt", alt)
  79825. c.urlParams_.Set("prettyPrint", "false")
  79826. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  79827. urls += "?" + c.urlParams_.Encode()
  79828. req, err := http.NewRequest("GET", urls, body)
  79829. if err != nil {
  79830. return nil, err
  79831. }
  79832. req.Header = reqHeaders
  79833. googleapi.Expand(req.URL, map[string]string{
  79834. "project": c.project,
  79835. "interconnectLocation": c.interconnectLocation,
  79836. })
  79837. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79838. }
  79839. // Do executes the "compute.interconnectLocations.get" call.
  79840. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  79841. // non-2xx status code is an error. Response headers are in either
  79842. // *InterconnectLocation.ServerResponse.Header or (if a response was
  79843. // returned at all) in error.(*googleapi.Error).Header. Use
  79844. // googleapi.IsNotModified to check whether the returned error was
  79845. // because http.StatusNotModified was returned.
  79846. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  79847. gensupport.SetOptions(c.urlParams_, opts...)
  79848. res, err := c.doRequest("json")
  79849. if res != nil && res.StatusCode == http.StatusNotModified {
  79850. if res.Body != nil {
  79851. res.Body.Close()
  79852. }
  79853. return nil, &googleapi.Error{
  79854. Code: res.StatusCode,
  79855. Header: res.Header,
  79856. }
  79857. }
  79858. if err != nil {
  79859. return nil, err
  79860. }
  79861. defer googleapi.CloseBody(res)
  79862. if err := googleapi.CheckResponse(res); err != nil {
  79863. return nil, err
  79864. }
  79865. ret := &InterconnectLocation{
  79866. ServerResponse: googleapi.ServerResponse{
  79867. Header: res.Header,
  79868. HTTPStatusCode: res.StatusCode,
  79869. },
  79870. }
  79871. target := &ret
  79872. if err := gensupport.DecodeResponse(target, res); err != nil {
  79873. return nil, err
  79874. }
  79875. return ret, nil
  79876. // {
  79877. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  79878. // "httpMethod": "GET",
  79879. // "id": "compute.interconnectLocations.get",
  79880. // "parameterOrder": [
  79881. // "project",
  79882. // "interconnectLocation"
  79883. // ],
  79884. // "parameters": {
  79885. // "interconnectLocation": {
  79886. // "description": "Name of the interconnect location to return.",
  79887. // "location": "path",
  79888. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79889. // "required": true,
  79890. // "type": "string"
  79891. // },
  79892. // "project": {
  79893. // "description": "Project ID for this request.",
  79894. // "location": "path",
  79895. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79896. // "required": true,
  79897. // "type": "string"
  79898. // }
  79899. // },
  79900. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  79901. // "response": {
  79902. // "$ref": "InterconnectLocation"
  79903. // },
  79904. // "scopes": [
  79905. // "https://www.googleapis.com/auth/cloud-platform",
  79906. // "https://www.googleapis.com/auth/compute",
  79907. // "https://www.googleapis.com/auth/compute.readonly"
  79908. // ]
  79909. // }
  79910. }
  79911. // method id "compute.interconnectLocations.list":
  79912. type InterconnectLocationsListCall struct {
  79913. s *Service
  79914. project string
  79915. urlParams_ gensupport.URLParams
  79916. ifNoneMatch_ string
  79917. ctx_ context.Context
  79918. header_ http.Header
  79919. }
  79920. // List: Retrieves the list of interconnect locations available to the
  79921. // specified project.
  79922. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  79923. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79924. c.project = project
  79925. return c
  79926. }
  79927. // Filter sets the optional parameter "filter": A filter expression that
  79928. // filters resources listed in the response. The expression must specify
  79929. // the field name, a comparison operator, and the value that you want to
  79930. // use for filtering. The value must be a string, a number, or a
  79931. // boolean. The comparison operator must be either =, !=, >, or <.
  79932. //
  79933. // For example, if you are filtering Compute Engine instances, you can
  79934. // exclude instances named example-instance by specifying name !=
  79935. // example-instance.
  79936. //
  79937. // You can also filter nested fields. For example, you could specify
  79938. // scheduling.automaticRestart = false to include instances only if they
  79939. // are not scheduled for automatic restarts. You can use filtering on
  79940. // nested fields to filter based on resource labels.
  79941. //
  79942. // To filter on multiple expressions, provide each separate expression
  79943. // within parentheses. For example, (scheduling.automaticRestart = true)
  79944. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79945. // AND expression. However, you can include AND and OR expressions
  79946. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79947. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79948. // true).
  79949. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  79950. c.urlParams_.Set("filter", filter)
  79951. return c
  79952. }
  79953. // MaxResults sets the optional parameter "maxResults": The maximum
  79954. // number of results per page that should be returned. If the number of
  79955. // available results is larger than maxResults, Compute Engine returns a
  79956. // nextPageToken that can be used to get the next page of results in
  79957. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79958. // (Default: 500)
  79959. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  79960. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79961. return c
  79962. }
  79963. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79964. // a certain order. By default, results are returned in alphanumerical
  79965. // order based on the resource name.
  79966. //
  79967. // You can also sort results in descending order based on the creation
  79968. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79969. // based on the creationTimestamp field in reverse chronological order
  79970. // (newest result first). Use this to sort resources like operations so
  79971. // that the newest operation is returned first.
  79972. //
  79973. // Currently, only sorting by name or creationTimestamp desc is
  79974. // supported.
  79975. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  79976. c.urlParams_.Set("orderBy", orderBy)
  79977. return c
  79978. }
  79979. // PageToken sets the optional parameter "pageToken": Specifies a page
  79980. // token to use. Set pageToken to the nextPageToken returned by a
  79981. // previous list request to get the next page of results.
  79982. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  79983. c.urlParams_.Set("pageToken", pageToken)
  79984. return c
  79985. }
  79986. // Fields allows partial responses to be retrieved. See
  79987. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79988. // for more information.
  79989. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  79990. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79991. return c
  79992. }
  79993. // IfNoneMatch sets the optional parameter which makes the operation
  79994. // fail if the object's ETag matches the given value. This is useful for
  79995. // getting updates only after the object has changed since the last
  79996. // request. Use googleapi.IsNotModified to check whether the response
  79997. // error from Do is the result of In-None-Match.
  79998. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  79999. c.ifNoneMatch_ = entityTag
  80000. return c
  80001. }
  80002. // Context sets the context to be used in this call's Do method. Any
  80003. // pending HTTP request will be aborted if the provided context is
  80004. // canceled.
  80005. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  80006. c.ctx_ = ctx
  80007. return c
  80008. }
  80009. // Header returns an http.Header that can be modified by the caller to
  80010. // add HTTP headers to the request.
  80011. func (c *InterconnectLocationsListCall) Header() http.Header {
  80012. if c.header_ == nil {
  80013. c.header_ = make(http.Header)
  80014. }
  80015. return c.header_
  80016. }
  80017. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  80018. reqHeaders := make(http.Header)
  80019. for k, v := range c.header_ {
  80020. reqHeaders[k] = v
  80021. }
  80022. reqHeaders.Set("User-Agent", c.s.userAgent())
  80023. if c.ifNoneMatch_ != "" {
  80024. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80025. }
  80026. var body io.Reader = nil
  80027. c.urlParams_.Set("alt", alt)
  80028. c.urlParams_.Set("prettyPrint", "false")
  80029. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  80030. urls += "?" + c.urlParams_.Encode()
  80031. req, err := http.NewRequest("GET", urls, body)
  80032. if err != nil {
  80033. return nil, err
  80034. }
  80035. req.Header = reqHeaders
  80036. googleapi.Expand(req.URL, map[string]string{
  80037. "project": c.project,
  80038. })
  80039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80040. }
  80041. // Do executes the "compute.interconnectLocations.list" call.
  80042. // Exactly one of *InterconnectLocationList or error will be non-nil.
  80043. // Any non-2xx status code is an error. Response headers are in either
  80044. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  80045. // returned at all) in error.(*googleapi.Error).Header. Use
  80046. // googleapi.IsNotModified to check whether the returned error was
  80047. // because http.StatusNotModified was returned.
  80048. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  80049. gensupport.SetOptions(c.urlParams_, opts...)
  80050. res, err := c.doRequest("json")
  80051. if res != nil && res.StatusCode == http.StatusNotModified {
  80052. if res.Body != nil {
  80053. res.Body.Close()
  80054. }
  80055. return nil, &googleapi.Error{
  80056. Code: res.StatusCode,
  80057. Header: res.Header,
  80058. }
  80059. }
  80060. if err != nil {
  80061. return nil, err
  80062. }
  80063. defer googleapi.CloseBody(res)
  80064. if err := googleapi.CheckResponse(res); err != nil {
  80065. return nil, err
  80066. }
  80067. ret := &InterconnectLocationList{
  80068. ServerResponse: googleapi.ServerResponse{
  80069. Header: res.Header,
  80070. HTTPStatusCode: res.StatusCode,
  80071. },
  80072. }
  80073. target := &ret
  80074. if err := gensupport.DecodeResponse(target, res); err != nil {
  80075. return nil, err
  80076. }
  80077. return ret, nil
  80078. // {
  80079. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  80080. // "httpMethod": "GET",
  80081. // "id": "compute.interconnectLocations.list",
  80082. // "parameterOrder": [
  80083. // "project"
  80084. // ],
  80085. // "parameters": {
  80086. // "filter": {
  80087. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  80088. // "location": "query",
  80089. // "type": "string"
  80090. // },
  80091. // "maxResults": {
  80092. // "default": "500",
  80093. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  80094. // "format": "uint32",
  80095. // "location": "query",
  80096. // "minimum": "0",
  80097. // "type": "integer"
  80098. // },
  80099. // "orderBy": {
  80100. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  80101. // "location": "query",
  80102. // "type": "string"
  80103. // },
  80104. // "pageToken": {
  80105. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  80106. // "location": "query",
  80107. // "type": "string"
  80108. // },
  80109. // "project": {
  80110. // "description": "Project ID for this request.",
  80111. // "location": "path",
  80112. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80113. // "required": true,
  80114. // "type": "string"
  80115. // }
  80116. // },
  80117. // "path": "{project}/global/interconnectLocations",
  80118. // "response": {
  80119. // "$ref": "InterconnectLocationList"
  80120. // },
  80121. // "scopes": [
  80122. // "https://www.googleapis.com/auth/cloud-platform",
  80123. // "https://www.googleapis.com/auth/compute",
  80124. // "https://www.googleapis.com/auth/compute.readonly"
  80125. // ]
  80126. // }
  80127. }
  80128. // Pages invokes f for each page of results.
  80129. // A non-nil error returned from f will halt the iteration.
  80130. // The provided context supersedes any context provided to the Context method.
  80131. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  80132. c.ctx_ = ctx
  80133. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80134. for {
  80135. x, err := c.Do()
  80136. if err != nil {
  80137. return err
  80138. }
  80139. if err := f(x); err != nil {
  80140. return err
  80141. }
  80142. if x.NextPageToken == "" {
  80143. return nil
  80144. }
  80145. c.PageToken(x.NextPageToken)
  80146. }
  80147. }
  80148. // method id "compute.interconnectLocations.testIamPermissions":
  80149. type InterconnectLocationsTestIamPermissionsCall struct {
  80150. s *Service
  80151. project string
  80152. resource string
  80153. testpermissionsrequest *TestPermissionsRequest
  80154. urlParams_ gensupport.URLParams
  80155. ctx_ context.Context
  80156. header_ http.Header
  80157. }
  80158. // TestIamPermissions: Returns permissions that a caller has on the
  80159. // specified resource.
  80160. func (r *InterconnectLocationsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectLocationsTestIamPermissionsCall {
  80161. c := &InterconnectLocationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80162. c.project = project
  80163. c.resource = resource
  80164. c.testpermissionsrequest = testpermissionsrequest
  80165. return c
  80166. }
  80167. // Fields allows partial responses to be retrieved. See
  80168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80169. // for more information.
  80170. func (c *InterconnectLocationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectLocationsTestIamPermissionsCall {
  80171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80172. return c
  80173. }
  80174. // Context sets the context to be used in this call's Do method. Any
  80175. // pending HTTP request will be aborted if the provided context is
  80176. // canceled.
  80177. func (c *InterconnectLocationsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectLocationsTestIamPermissionsCall {
  80178. c.ctx_ = ctx
  80179. return c
  80180. }
  80181. // Header returns an http.Header that can be modified by the caller to
  80182. // add HTTP headers to the request.
  80183. func (c *InterconnectLocationsTestIamPermissionsCall) Header() http.Header {
  80184. if c.header_ == nil {
  80185. c.header_ = make(http.Header)
  80186. }
  80187. return c.header_
  80188. }
  80189. func (c *InterconnectLocationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  80190. reqHeaders := make(http.Header)
  80191. for k, v := range c.header_ {
  80192. reqHeaders[k] = v
  80193. }
  80194. reqHeaders.Set("User-Agent", c.s.userAgent())
  80195. var body io.Reader = nil
  80196. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  80197. if err != nil {
  80198. return nil, err
  80199. }
  80200. reqHeaders.Set("Content-Type", "application/json")
  80201. c.urlParams_.Set("alt", alt)
  80202. c.urlParams_.Set("prettyPrint", "false")
  80203. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{resource}/testIamPermissions")
  80204. urls += "?" + c.urlParams_.Encode()
  80205. req, err := http.NewRequest("POST", urls, body)
  80206. if err != nil {
  80207. return nil, err
  80208. }
  80209. req.Header = reqHeaders
  80210. googleapi.Expand(req.URL, map[string]string{
  80211. "project": c.project,
  80212. "resource": c.resource,
  80213. })
  80214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80215. }
  80216. // Do executes the "compute.interconnectLocations.testIamPermissions" call.
  80217. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  80218. // non-2xx status code is an error. Response headers are in either
  80219. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  80220. // returned at all) in error.(*googleapi.Error).Header. Use
  80221. // googleapi.IsNotModified to check whether the returned error was
  80222. // because http.StatusNotModified was returned.
  80223. func (c *InterconnectLocationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  80224. gensupport.SetOptions(c.urlParams_, opts...)
  80225. res, err := c.doRequest("json")
  80226. if res != nil && res.StatusCode == http.StatusNotModified {
  80227. if res.Body != nil {
  80228. res.Body.Close()
  80229. }
  80230. return nil, &googleapi.Error{
  80231. Code: res.StatusCode,
  80232. Header: res.Header,
  80233. }
  80234. }
  80235. if err != nil {
  80236. return nil, err
  80237. }
  80238. defer googleapi.CloseBody(res)
  80239. if err := googleapi.CheckResponse(res); err != nil {
  80240. return nil, err
  80241. }
  80242. ret := &TestPermissionsResponse{
  80243. ServerResponse: googleapi.ServerResponse{
  80244. Header: res.Header,
  80245. HTTPStatusCode: res.StatusCode,
  80246. },
  80247. }
  80248. target := &ret
  80249. if err := gensupport.DecodeResponse(target, res); err != nil {
  80250. return nil, err
  80251. }
  80252. return ret, nil
  80253. // {
  80254. // "description": "Returns permissions that a caller has on the specified resource.",
  80255. // "httpMethod": "POST",
  80256. // "id": "compute.interconnectLocations.testIamPermissions",
  80257. // "parameterOrder": [
  80258. // "project",
  80259. // "resource"
  80260. // ],
  80261. // "parameters": {
  80262. // "project": {
  80263. // "description": "Project ID for this request.",
  80264. // "location": "path",
  80265. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80266. // "required": true,
  80267. // "type": "string"
  80268. // },
  80269. // "resource": {
  80270. // "description": "Name or id of the resource for this request.",
  80271. // "location": "path",
  80272. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80273. // "required": true,
  80274. // "type": "string"
  80275. // }
  80276. // },
  80277. // "path": "{project}/global/interconnectLocations/{resource}/testIamPermissions",
  80278. // "request": {
  80279. // "$ref": "TestPermissionsRequest"
  80280. // },
  80281. // "response": {
  80282. // "$ref": "TestPermissionsResponse"
  80283. // },
  80284. // "scopes": [
  80285. // "https://www.googleapis.com/auth/cloud-platform",
  80286. // "https://www.googleapis.com/auth/compute",
  80287. // "https://www.googleapis.com/auth/compute.readonly"
  80288. // ]
  80289. // }
  80290. }
  80291. // method id "compute.interconnects.delete":
  80292. type InterconnectsDeleteCall struct {
  80293. s *Service
  80294. project string
  80295. interconnect string
  80296. urlParams_ gensupport.URLParams
  80297. ctx_ context.Context
  80298. header_ http.Header
  80299. }
  80300. // Delete: Deletes the specified interconnect.
  80301. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  80302. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80303. c.project = project
  80304. c.interconnect = interconnect
  80305. return c
  80306. }
  80307. // RequestId sets the optional parameter "requestId": An optional
  80308. // request ID to identify requests. Specify a unique request ID so that
  80309. // if you must retry your request, the server will know to ignore the
  80310. // request if it has already been completed.
  80311. //
  80312. // For example, consider a situation where you make an initial request
  80313. // and the request times out. If you make the request again with the
  80314. // same request ID, the server can check if original operation with the
  80315. // same request ID was received, and if so, will ignore the second
  80316. // request. This prevents clients from accidentally creating duplicate
  80317. // commitments.
  80318. //
  80319. // The request ID must be a valid UUID with the exception that zero UUID
  80320. // is not supported (00000000-0000-0000-0000-000000000000).
  80321. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  80322. c.urlParams_.Set("requestId", requestId)
  80323. return c
  80324. }
  80325. // Fields allows partial responses to be retrieved. See
  80326. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80327. // for more information.
  80328. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  80329. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80330. return c
  80331. }
  80332. // Context sets the context to be used in this call's Do method. Any
  80333. // pending HTTP request will be aborted if the provided context is
  80334. // canceled.
  80335. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  80336. c.ctx_ = ctx
  80337. return c
  80338. }
  80339. // Header returns an http.Header that can be modified by the caller to
  80340. // add HTTP headers to the request.
  80341. func (c *InterconnectsDeleteCall) Header() http.Header {
  80342. if c.header_ == nil {
  80343. c.header_ = make(http.Header)
  80344. }
  80345. return c.header_
  80346. }
  80347. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  80348. reqHeaders := make(http.Header)
  80349. for k, v := range c.header_ {
  80350. reqHeaders[k] = v
  80351. }
  80352. reqHeaders.Set("User-Agent", c.s.userAgent())
  80353. var body io.Reader = nil
  80354. c.urlParams_.Set("alt", alt)
  80355. c.urlParams_.Set("prettyPrint", "false")
  80356. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  80357. urls += "?" + c.urlParams_.Encode()
  80358. req, err := http.NewRequest("DELETE", urls, body)
  80359. if err != nil {
  80360. return nil, err
  80361. }
  80362. req.Header = reqHeaders
  80363. googleapi.Expand(req.URL, map[string]string{
  80364. "project": c.project,
  80365. "interconnect": c.interconnect,
  80366. })
  80367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80368. }
  80369. // Do executes the "compute.interconnects.delete" call.
  80370. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80371. // status code is an error. Response headers are in either
  80372. // *Operation.ServerResponse.Header or (if a response was returned at
  80373. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80374. // to check whether the returned error was because
  80375. // http.StatusNotModified was returned.
  80376. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80377. gensupport.SetOptions(c.urlParams_, opts...)
  80378. res, err := c.doRequest("json")
  80379. if res != nil && res.StatusCode == http.StatusNotModified {
  80380. if res.Body != nil {
  80381. res.Body.Close()
  80382. }
  80383. return nil, &googleapi.Error{
  80384. Code: res.StatusCode,
  80385. Header: res.Header,
  80386. }
  80387. }
  80388. if err != nil {
  80389. return nil, err
  80390. }
  80391. defer googleapi.CloseBody(res)
  80392. if err := googleapi.CheckResponse(res); err != nil {
  80393. return nil, err
  80394. }
  80395. ret := &Operation{
  80396. ServerResponse: googleapi.ServerResponse{
  80397. Header: res.Header,
  80398. HTTPStatusCode: res.StatusCode,
  80399. },
  80400. }
  80401. target := &ret
  80402. if err := gensupport.DecodeResponse(target, res); err != nil {
  80403. return nil, err
  80404. }
  80405. return ret, nil
  80406. // {
  80407. // "description": "Deletes the specified interconnect.",
  80408. // "httpMethod": "DELETE",
  80409. // "id": "compute.interconnects.delete",
  80410. // "parameterOrder": [
  80411. // "project",
  80412. // "interconnect"
  80413. // ],
  80414. // "parameters": {
  80415. // "interconnect": {
  80416. // "description": "Name of the interconnect to delete.",
  80417. // "location": "path",
  80418. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80419. // "required": true,
  80420. // "type": "string"
  80421. // },
  80422. // "project": {
  80423. // "description": "Project ID for this request.",
  80424. // "location": "path",
  80425. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80426. // "required": true,
  80427. // "type": "string"
  80428. // },
  80429. // "requestId": {
  80430. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80431. // "location": "query",
  80432. // "type": "string"
  80433. // }
  80434. // },
  80435. // "path": "{project}/global/interconnects/{interconnect}",
  80436. // "response": {
  80437. // "$ref": "Operation"
  80438. // },
  80439. // "scopes": [
  80440. // "https://www.googleapis.com/auth/cloud-platform",
  80441. // "https://www.googleapis.com/auth/compute"
  80442. // ]
  80443. // }
  80444. }
  80445. // method id "compute.interconnects.get":
  80446. type InterconnectsGetCall struct {
  80447. s *Service
  80448. project string
  80449. interconnect string
  80450. urlParams_ gensupport.URLParams
  80451. ifNoneMatch_ string
  80452. ctx_ context.Context
  80453. header_ http.Header
  80454. }
  80455. // Get: Returns the specified interconnect. Get a list of available
  80456. // interconnects by making a list() request.
  80457. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  80458. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80459. c.project = project
  80460. c.interconnect = interconnect
  80461. return c
  80462. }
  80463. // Fields allows partial responses to be retrieved. See
  80464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80465. // for more information.
  80466. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  80467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80468. return c
  80469. }
  80470. // IfNoneMatch sets the optional parameter which makes the operation
  80471. // fail if the object's ETag matches the given value. This is useful for
  80472. // getting updates only after the object has changed since the last
  80473. // request. Use googleapi.IsNotModified to check whether the response
  80474. // error from Do is the result of In-None-Match.
  80475. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  80476. c.ifNoneMatch_ = entityTag
  80477. return c
  80478. }
  80479. // Context sets the context to be used in this call's Do method. Any
  80480. // pending HTTP request will be aborted if the provided context is
  80481. // canceled.
  80482. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  80483. c.ctx_ = ctx
  80484. return c
  80485. }
  80486. // Header returns an http.Header that can be modified by the caller to
  80487. // add HTTP headers to the request.
  80488. func (c *InterconnectsGetCall) Header() http.Header {
  80489. if c.header_ == nil {
  80490. c.header_ = make(http.Header)
  80491. }
  80492. return c.header_
  80493. }
  80494. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  80495. reqHeaders := make(http.Header)
  80496. for k, v := range c.header_ {
  80497. reqHeaders[k] = v
  80498. }
  80499. reqHeaders.Set("User-Agent", c.s.userAgent())
  80500. if c.ifNoneMatch_ != "" {
  80501. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80502. }
  80503. var body io.Reader = nil
  80504. c.urlParams_.Set("alt", alt)
  80505. c.urlParams_.Set("prettyPrint", "false")
  80506. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  80507. urls += "?" + c.urlParams_.Encode()
  80508. req, err := http.NewRequest("GET", urls, body)
  80509. if err != nil {
  80510. return nil, err
  80511. }
  80512. req.Header = reqHeaders
  80513. googleapi.Expand(req.URL, map[string]string{
  80514. "project": c.project,
  80515. "interconnect": c.interconnect,
  80516. })
  80517. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80518. }
  80519. // Do executes the "compute.interconnects.get" call.
  80520. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  80521. // status code is an error. Response headers are in either
  80522. // *Interconnect.ServerResponse.Header or (if a response was returned at
  80523. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80524. // to check whether the returned error was because
  80525. // http.StatusNotModified was returned.
  80526. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  80527. gensupport.SetOptions(c.urlParams_, opts...)
  80528. res, err := c.doRequest("json")
  80529. if res != nil && res.StatusCode == http.StatusNotModified {
  80530. if res.Body != nil {
  80531. res.Body.Close()
  80532. }
  80533. return nil, &googleapi.Error{
  80534. Code: res.StatusCode,
  80535. Header: res.Header,
  80536. }
  80537. }
  80538. if err != nil {
  80539. return nil, err
  80540. }
  80541. defer googleapi.CloseBody(res)
  80542. if err := googleapi.CheckResponse(res); err != nil {
  80543. return nil, err
  80544. }
  80545. ret := &Interconnect{
  80546. ServerResponse: googleapi.ServerResponse{
  80547. Header: res.Header,
  80548. HTTPStatusCode: res.StatusCode,
  80549. },
  80550. }
  80551. target := &ret
  80552. if err := gensupport.DecodeResponse(target, res); err != nil {
  80553. return nil, err
  80554. }
  80555. return ret, nil
  80556. // {
  80557. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  80558. // "httpMethod": "GET",
  80559. // "id": "compute.interconnects.get",
  80560. // "parameterOrder": [
  80561. // "project",
  80562. // "interconnect"
  80563. // ],
  80564. // "parameters": {
  80565. // "interconnect": {
  80566. // "description": "Name of the interconnect to return.",
  80567. // "location": "path",
  80568. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80569. // "required": true,
  80570. // "type": "string"
  80571. // },
  80572. // "project": {
  80573. // "description": "Project ID for this request.",
  80574. // "location": "path",
  80575. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80576. // "required": true,
  80577. // "type": "string"
  80578. // }
  80579. // },
  80580. // "path": "{project}/global/interconnects/{interconnect}",
  80581. // "response": {
  80582. // "$ref": "Interconnect"
  80583. // },
  80584. // "scopes": [
  80585. // "https://www.googleapis.com/auth/cloud-platform",
  80586. // "https://www.googleapis.com/auth/compute",
  80587. // "https://www.googleapis.com/auth/compute.readonly"
  80588. // ]
  80589. // }
  80590. }
  80591. // method id "compute.interconnects.getDiagnostics":
  80592. type InterconnectsGetDiagnosticsCall struct {
  80593. s *Service
  80594. project string
  80595. interconnect string
  80596. urlParams_ gensupport.URLParams
  80597. ifNoneMatch_ string
  80598. ctx_ context.Context
  80599. header_ http.Header
  80600. }
  80601. // GetDiagnostics: Returns the interconnectDiagnostics for the specified
  80602. // interconnect.
  80603. func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall {
  80604. c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80605. c.project = project
  80606. c.interconnect = interconnect
  80607. return c
  80608. }
  80609. // Fields allows partial responses to be retrieved. See
  80610. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80611. // for more information.
  80612. func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall {
  80613. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80614. return c
  80615. }
  80616. // IfNoneMatch sets the optional parameter which makes the operation
  80617. // fail if the object's ETag matches the given value. This is useful for
  80618. // getting updates only after the object has changed since the last
  80619. // request. Use googleapi.IsNotModified to check whether the response
  80620. // error from Do is the result of In-None-Match.
  80621. func (c *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall {
  80622. c.ifNoneMatch_ = entityTag
  80623. return c
  80624. }
  80625. // Context sets the context to be used in this call's Do method. Any
  80626. // pending HTTP request will be aborted if the provided context is
  80627. // canceled.
  80628. func (c *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall {
  80629. c.ctx_ = ctx
  80630. return c
  80631. }
  80632. // Header returns an http.Header that can be modified by the caller to
  80633. // add HTTP headers to the request.
  80634. func (c *InterconnectsGetDiagnosticsCall) Header() http.Header {
  80635. if c.header_ == nil {
  80636. c.header_ = make(http.Header)
  80637. }
  80638. return c.header_
  80639. }
  80640. func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) {
  80641. reqHeaders := make(http.Header)
  80642. for k, v := range c.header_ {
  80643. reqHeaders[k] = v
  80644. }
  80645. reqHeaders.Set("User-Agent", c.s.userAgent())
  80646. if c.ifNoneMatch_ != "" {
  80647. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80648. }
  80649. var body io.Reader = nil
  80650. c.urlParams_.Set("alt", alt)
  80651. c.urlParams_.Set("prettyPrint", "false")
  80652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}/getDiagnostics")
  80653. urls += "?" + c.urlParams_.Encode()
  80654. req, err := http.NewRequest("GET", urls, body)
  80655. if err != nil {
  80656. return nil, err
  80657. }
  80658. req.Header = reqHeaders
  80659. googleapi.Expand(req.URL, map[string]string{
  80660. "project": c.project,
  80661. "interconnect": c.interconnect,
  80662. })
  80663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80664. }
  80665. // Do executes the "compute.interconnects.getDiagnostics" call.
  80666. // Exactly one of *InterconnectsGetDiagnosticsResponse or error will be
  80667. // non-nil. Any non-2xx status code is an error. Response headers are in
  80668. // either *InterconnectsGetDiagnosticsResponse.ServerResponse.Header or
  80669. // (if a response was returned at all) in
  80670. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  80671. // whether the returned error was because http.StatusNotModified was
  80672. // returned.
  80673. func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, error) {
  80674. gensupport.SetOptions(c.urlParams_, opts...)
  80675. res, err := c.doRequest("json")
  80676. if res != nil && res.StatusCode == http.StatusNotModified {
  80677. if res.Body != nil {
  80678. res.Body.Close()
  80679. }
  80680. return nil, &googleapi.Error{
  80681. Code: res.StatusCode,
  80682. Header: res.Header,
  80683. }
  80684. }
  80685. if err != nil {
  80686. return nil, err
  80687. }
  80688. defer googleapi.CloseBody(res)
  80689. if err := googleapi.CheckResponse(res); err != nil {
  80690. return nil, err
  80691. }
  80692. ret := &InterconnectsGetDiagnosticsResponse{
  80693. ServerResponse: googleapi.ServerResponse{
  80694. Header: res.Header,
  80695. HTTPStatusCode: res.StatusCode,
  80696. },
  80697. }
  80698. target := &ret
  80699. if err := gensupport.DecodeResponse(target, res); err != nil {
  80700. return nil, err
  80701. }
  80702. return ret, nil
  80703. // {
  80704. // "description": "Returns the interconnectDiagnostics for the specified interconnect.",
  80705. // "httpMethod": "GET",
  80706. // "id": "compute.interconnects.getDiagnostics",
  80707. // "parameterOrder": [
  80708. // "project",
  80709. // "interconnect"
  80710. // ],
  80711. // "parameters": {
  80712. // "interconnect": {
  80713. // "description": "Name of the interconnect resource to query.",
  80714. // "location": "path",
  80715. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80716. // "required": true,
  80717. // "type": "string"
  80718. // },
  80719. // "project": {
  80720. // "description": "Project ID for this request.",
  80721. // "location": "path",
  80722. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80723. // "required": true,
  80724. // "type": "string"
  80725. // }
  80726. // },
  80727. // "path": "{project}/global/interconnects/{interconnect}/getDiagnostics",
  80728. // "response": {
  80729. // "$ref": "InterconnectsGetDiagnosticsResponse"
  80730. // },
  80731. // "scopes": [
  80732. // "https://www.googleapis.com/auth/cloud-platform",
  80733. // "https://www.googleapis.com/auth/compute",
  80734. // "https://www.googleapis.com/auth/compute.readonly"
  80735. // ]
  80736. // }
  80737. }
  80738. // method id "compute.interconnects.getIamPolicy":
  80739. type InterconnectsGetIamPolicyCall struct {
  80740. s *Service
  80741. project string
  80742. resource string
  80743. urlParams_ gensupport.URLParams
  80744. ifNoneMatch_ string
  80745. ctx_ context.Context
  80746. header_ http.Header
  80747. }
  80748. // GetIamPolicy: Gets the access control policy for a resource. May be
  80749. // empty if no such policy or resource exists.
  80750. func (r *InterconnectsService) GetIamPolicy(project string, resource string) *InterconnectsGetIamPolicyCall {
  80751. c := &InterconnectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80752. c.project = project
  80753. c.resource = resource
  80754. return c
  80755. }
  80756. // Fields allows partial responses to be retrieved. See
  80757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80758. // for more information.
  80759. func (c *InterconnectsGetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectsGetIamPolicyCall {
  80760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80761. return c
  80762. }
  80763. // IfNoneMatch sets the optional parameter which makes the operation
  80764. // fail if the object's ETag matches the given value. This is useful for
  80765. // getting updates only after the object has changed since the last
  80766. // request. Use googleapi.IsNotModified to check whether the response
  80767. // error from Do is the result of In-None-Match.
  80768. func (c *InterconnectsGetIamPolicyCall) IfNoneMatch(entityTag string) *InterconnectsGetIamPolicyCall {
  80769. c.ifNoneMatch_ = entityTag
  80770. return c
  80771. }
  80772. // Context sets the context to be used in this call's Do method. Any
  80773. // pending HTTP request will be aborted if the provided context is
  80774. // canceled.
  80775. func (c *InterconnectsGetIamPolicyCall) Context(ctx context.Context) *InterconnectsGetIamPolicyCall {
  80776. c.ctx_ = ctx
  80777. return c
  80778. }
  80779. // Header returns an http.Header that can be modified by the caller to
  80780. // add HTTP headers to the request.
  80781. func (c *InterconnectsGetIamPolicyCall) Header() http.Header {
  80782. if c.header_ == nil {
  80783. c.header_ = make(http.Header)
  80784. }
  80785. return c.header_
  80786. }
  80787. func (c *InterconnectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  80788. reqHeaders := make(http.Header)
  80789. for k, v := range c.header_ {
  80790. reqHeaders[k] = v
  80791. }
  80792. reqHeaders.Set("User-Agent", c.s.userAgent())
  80793. if c.ifNoneMatch_ != "" {
  80794. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80795. }
  80796. var body io.Reader = nil
  80797. c.urlParams_.Set("alt", alt)
  80798. c.urlParams_.Set("prettyPrint", "false")
  80799. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/getIamPolicy")
  80800. urls += "?" + c.urlParams_.Encode()
  80801. req, err := http.NewRequest("GET", urls, body)
  80802. if err != nil {
  80803. return nil, err
  80804. }
  80805. req.Header = reqHeaders
  80806. googleapi.Expand(req.URL, map[string]string{
  80807. "project": c.project,
  80808. "resource": c.resource,
  80809. })
  80810. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80811. }
  80812. // Do executes the "compute.interconnects.getIamPolicy" call.
  80813. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  80814. // code is an error. Response headers are in either
  80815. // *Policy.ServerResponse.Header or (if a response was returned at all)
  80816. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  80817. // check whether the returned error was because http.StatusNotModified
  80818. // was returned.
  80819. func (c *InterconnectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  80820. gensupport.SetOptions(c.urlParams_, opts...)
  80821. res, err := c.doRequest("json")
  80822. if res != nil && res.StatusCode == http.StatusNotModified {
  80823. if res.Body != nil {
  80824. res.Body.Close()
  80825. }
  80826. return nil, &googleapi.Error{
  80827. Code: res.StatusCode,
  80828. Header: res.Header,
  80829. }
  80830. }
  80831. if err != nil {
  80832. return nil, err
  80833. }
  80834. defer googleapi.CloseBody(res)
  80835. if err := googleapi.CheckResponse(res); err != nil {
  80836. return nil, err
  80837. }
  80838. ret := &Policy{
  80839. ServerResponse: googleapi.ServerResponse{
  80840. Header: res.Header,
  80841. HTTPStatusCode: res.StatusCode,
  80842. },
  80843. }
  80844. target := &ret
  80845. if err := gensupport.DecodeResponse(target, res); err != nil {
  80846. return nil, err
  80847. }
  80848. return ret, nil
  80849. // {
  80850. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  80851. // "httpMethod": "GET",
  80852. // "id": "compute.interconnects.getIamPolicy",
  80853. // "parameterOrder": [
  80854. // "project",
  80855. // "resource"
  80856. // ],
  80857. // "parameters": {
  80858. // "project": {
  80859. // "description": "Project ID for this request.",
  80860. // "location": "path",
  80861. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80862. // "required": true,
  80863. // "type": "string"
  80864. // },
  80865. // "resource": {
  80866. // "description": "Name or id of the resource for this request.",
  80867. // "location": "path",
  80868. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80869. // "required": true,
  80870. // "type": "string"
  80871. // }
  80872. // },
  80873. // "path": "{project}/global/interconnects/{resource}/getIamPolicy",
  80874. // "response": {
  80875. // "$ref": "Policy"
  80876. // },
  80877. // "scopes": [
  80878. // "https://www.googleapis.com/auth/cloud-platform",
  80879. // "https://www.googleapis.com/auth/compute",
  80880. // "https://www.googleapis.com/auth/compute.readonly"
  80881. // ]
  80882. // }
  80883. }
  80884. // method id "compute.interconnects.insert":
  80885. type InterconnectsInsertCall struct {
  80886. s *Service
  80887. project string
  80888. interconnect *Interconnect
  80889. urlParams_ gensupport.URLParams
  80890. ctx_ context.Context
  80891. header_ http.Header
  80892. }
  80893. // Insert: Creates a Interconnect in the specified project using the
  80894. // data included in the request.
  80895. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  80896. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80897. c.project = project
  80898. c.interconnect = interconnect
  80899. return c
  80900. }
  80901. // RequestId sets the optional parameter "requestId": An optional
  80902. // request ID to identify requests. Specify a unique request ID so that
  80903. // if you must retry your request, the server will know to ignore the
  80904. // request if it has already been completed.
  80905. //
  80906. // For example, consider a situation where you make an initial request
  80907. // and the request times out. If you make the request again with the
  80908. // same request ID, the server can check if original operation with the
  80909. // same request ID was received, and if so, will ignore the second
  80910. // request. This prevents clients from accidentally creating duplicate
  80911. // commitments.
  80912. //
  80913. // The request ID must be a valid UUID with the exception that zero UUID
  80914. // is not supported (00000000-0000-0000-0000-000000000000).
  80915. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  80916. c.urlParams_.Set("requestId", requestId)
  80917. return c
  80918. }
  80919. // Fields allows partial responses to be retrieved. See
  80920. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80921. // for more information.
  80922. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  80923. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80924. return c
  80925. }
  80926. // Context sets the context to be used in this call's Do method. Any
  80927. // pending HTTP request will be aborted if the provided context is
  80928. // canceled.
  80929. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  80930. c.ctx_ = ctx
  80931. return c
  80932. }
  80933. // Header returns an http.Header that can be modified by the caller to
  80934. // add HTTP headers to the request.
  80935. func (c *InterconnectsInsertCall) Header() http.Header {
  80936. if c.header_ == nil {
  80937. c.header_ = make(http.Header)
  80938. }
  80939. return c.header_
  80940. }
  80941. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  80942. reqHeaders := make(http.Header)
  80943. for k, v := range c.header_ {
  80944. reqHeaders[k] = v
  80945. }
  80946. reqHeaders.Set("User-Agent", c.s.userAgent())
  80947. var body io.Reader = nil
  80948. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  80949. if err != nil {
  80950. return nil, err
  80951. }
  80952. reqHeaders.Set("Content-Type", "application/json")
  80953. c.urlParams_.Set("alt", alt)
  80954. c.urlParams_.Set("prettyPrint", "false")
  80955. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  80956. urls += "?" + c.urlParams_.Encode()
  80957. req, err := http.NewRequest("POST", urls, body)
  80958. if err != nil {
  80959. return nil, err
  80960. }
  80961. req.Header = reqHeaders
  80962. googleapi.Expand(req.URL, map[string]string{
  80963. "project": c.project,
  80964. })
  80965. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80966. }
  80967. // Do executes the "compute.interconnects.insert" call.
  80968. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80969. // status code is an error. Response headers are in either
  80970. // *Operation.ServerResponse.Header or (if a response was returned at
  80971. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80972. // to check whether the returned error was because
  80973. // http.StatusNotModified was returned.
  80974. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80975. gensupport.SetOptions(c.urlParams_, opts...)
  80976. res, err := c.doRequest("json")
  80977. if res != nil && res.StatusCode == http.StatusNotModified {
  80978. if res.Body != nil {
  80979. res.Body.Close()
  80980. }
  80981. return nil, &googleapi.Error{
  80982. Code: res.StatusCode,
  80983. Header: res.Header,
  80984. }
  80985. }
  80986. if err != nil {
  80987. return nil, err
  80988. }
  80989. defer googleapi.CloseBody(res)
  80990. if err := googleapi.CheckResponse(res); err != nil {
  80991. return nil, err
  80992. }
  80993. ret := &Operation{
  80994. ServerResponse: googleapi.ServerResponse{
  80995. Header: res.Header,
  80996. HTTPStatusCode: res.StatusCode,
  80997. },
  80998. }
  80999. target := &ret
  81000. if err := gensupport.DecodeResponse(target, res); err != nil {
  81001. return nil, err
  81002. }
  81003. return ret, nil
  81004. // {
  81005. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  81006. // "httpMethod": "POST",
  81007. // "id": "compute.interconnects.insert",
  81008. // "parameterOrder": [
  81009. // "project"
  81010. // ],
  81011. // "parameters": {
  81012. // "project": {
  81013. // "description": "Project ID for this request.",
  81014. // "location": "path",
  81015. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81016. // "required": true,
  81017. // "type": "string"
  81018. // },
  81019. // "requestId": {
  81020. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81021. // "location": "query",
  81022. // "type": "string"
  81023. // }
  81024. // },
  81025. // "path": "{project}/global/interconnects",
  81026. // "request": {
  81027. // "$ref": "Interconnect"
  81028. // },
  81029. // "response": {
  81030. // "$ref": "Operation"
  81031. // },
  81032. // "scopes": [
  81033. // "https://www.googleapis.com/auth/cloud-platform",
  81034. // "https://www.googleapis.com/auth/compute"
  81035. // ]
  81036. // }
  81037. }
  81038. // method id "compute.interconnects.list":
  81039. type InterconnectsListCall struct {
  81040. s *Service
  81041. project string
  81042. urlParams_ gensupport.URLParams
  81043. ifNoneMatch_ string
  81044. ctx_ context.Context
  81045. header_ http.Header
  81046. }
  81047. // List: Retrieves the list of interconnect available to the specified
  81048. // project.
  81049. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  81050. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81051. c.project = project
  81052. return c
  81053. }
  81054. // Filter sets the optional parameter "filter": A filter expression that
  81055. // filters resources listed in the response. The expression must specify
  81056. // the field name, a comparison operator, and the value that you want to
  81057. // use for filtering. The value must be a string, a number, or a
  81058. // boolean. The comparison operator must be either =, !=, >, or <.
  81059. //
  81060. // For example, if you are filtering Compute Engine instances, you can
  81061. // exclude instances named example-instance by specifying name !=
  81062. // example-instance.
  81063. //
  81064. // You can also filter nested fields. For example, you could specify
  81065. // scheduling.automaticRestart = false to include instances only if they
  81066. // are not scheduled for automatic restarts. You can use filtering on
  81067. // nested fields to filter based on resource labels.
  81068. //
  81069. // To filter on multiple expressions, provide each separate expression
  81070. // within parentheses. For example, (scheduling.automaticRestart = true)
  81071. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  81072. // AND expression. However, you can include AND and OR expressions
  81073. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  81074. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  81075. // true).
  81076. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  81077. c.urlParams_.Set("filter", filter)
  81078. return c
  81079. }
  81080. // MaxResults sets the optional parameter "maxResults": The maximum
  81081. // number of results per page that should be returned. If the number of
  81082. // available results is larger than maxResults, Compute Engine returns a
  81083. // nextPageToken that can be used to get the next page of results in
  81084. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  81085. // (Default: 500)
  81086. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  81087. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  81088. return c
  81089. }
  81090. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  81091. // a certain order. By default, results are returned in alphanumerical
  81092. // order based on the resource name.
  81093. //
  81094. // You can also sort results in descending order based on the creation
  81095. // timestamp using orderBy="creationTimestamp desc". This sorts results
  81096. // based on the creationTimestamp field in reverse chronological order
  81097. // (newest result first). Use this to sort resources like operations so
  81098. // that the newest operation is returned first.
  81099. //
  81100. // Currently, only sorting by name or creationTimestamp desc is
  81101. // supported.
  81102. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  81103. c.urlParams_.Set("orderBy", orderBy)
  81104. return c
  81105. }
  81106. // PageToken sets the optional parameter "pageToken": Specifies a page
  81107. // token to use. Set pageToken to the nextPageToken returned by a
  81108. // previous list request to get the next page of results.
  81109. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  81110. c.urlParams_.Set("pageToken", pageToken)
  81111. return c
  81112. }
  81113. // Fields allows partial responses to be retrieved. See
  81114. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81115. // for more information.
  81116. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  81117. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81118. return c
  81119. }
  81120. // IfNoneMatch sets the optional parameter which makes the operation
  81121. // fail if the object's ETag matches the given value. This is useful for
  81122. // getting updates only after the object has changed since the last
  81123. // request. Use googleapi.IsNotModified to check whether the response
  81124. // error from Do is the result of In-None-Match.
  81125. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  81126. c.ifNoneMatch_ = entityTag
  81127. return c
  81128. }
  81129. // Context sets the context to be used in this call's Do method. Any
  81130. // pending HTTP request will be aborted if the provided context is
  81131. // canceled.
  81132. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  81133. c.ctx_ = ctx
  81134. return c
  81135. }
  81136. // Header returns an http.Header that can be modified by the caller to
  81137. // add HTTP headers to the request.
  81138. func (c *InterconnectsListCall) Header() http.Header {
  81139. if c.header_ == nil {
  81140. c.header_ = make(http.Header)
  81141. }
  81142. return c.header_
  81143. }
  81144. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  81145. reqHeaders := make(http.Header)
  81146. for k, v := range c.header_ {
  81147. reqHeaders[k] = v
  81148. }
  81149. reqHeaders.Set("User-Agent", c.s.userAgent())
  81150. if c.ifNoneMatch_ != "" {
  81151. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81152. }
  81153. var body io.Reader = nil
  81154. c.urlParams_.Set("alt", alt)
  81155. c.urlParams_.Set("prettyPrint", "false")
  81156. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  81157. urls += "?" + c.urlParams_.Encode()
  81158. req, err := http.NewRequest("GET", urls, body)
  81159. if err != nil {
  81160. return nil, err
  81161. }
  81162. req.Header = reqHeaders
  81163. googleapi.Expand(req.URL, map[string]string{
  81164. "project": c.project,
  81165. })
  81166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81167. }
  81168. // Do executes the "compute.interconnects.list" call.
  81169. // Exactly one of *InterconnectList or error will be non-nil. Any
  81170. // non-2xx status code is an error. Response headers are in either
  81171. // *InterconnectList.ServerResponse.Header or (if a response was
  81172. // returned at all) in error.(*googleapi.Error).Header. Use
  81173. // googleapi.IsNotModified to check whether the returned error was
  81174. // because http.StatusNotModified was returned.
  81175. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  81176. gensupport.SetOptions(c.urlParams_, opts...)
  81177. res, err := c.doRequest("json")
  81178. if res != nil && res.StatusCode == http.StatusNotModified {
  81179. if res.Body != nil {
  81180. res.Body.Close()
  81181. }
  81182. return nil, &googleapi.Error{
  81183. Code: res.StatusCode,
  81184. Header: res.Header,
  81185. }
  81186. }
  81187. if err != nil {
  81188. return nil, err
  81189. }
  81190. defer googleapi.CloseBody(res)
  81191. if err := googleapi.CheckResponse(res); err != nil {
  81192. return nil, err
  81193. }
  81194. ret := &InterconnectList{
  81195. ServerResponse: googleapi.ServerResponse{
  81196. Header: res.Header,
  81197. HTTPStatusCode: res.StatusCode,
  81198. },
  81199. }
  81200. target := &ret
  81201. if err := gensupport.DecodeResponse(target, res); err != nil {
  81202. return nil, err
  81203. }
  81204. return ret, nil
  81205. // {
  81206. // "description": "Retrieves the list of interconnect available to the specified project.",
  81207. // "httpMethod": "GET",
  81208. // "id": "compute.interconnects.list",
  81209. // "parameterOrder": [
  81210. // "project"
  81211. // ],
  81212. // "parameters": {
  81213. // "filter": {
  81214. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  81215. // "location": "query",
  81216. // "type": "string"
  81217. // },
  81218. // "maxResults": {
  81219. // "default": "500",
  81220. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  81221. // "format": "uint32",
  81222. // "location": "query",
  81223. // "minimum": "0",
  81224. // "type": "integer"
  81225. // },
  81226. // "orderBy": {
  81227. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  81228. // "location": "query",
  81229. // "type": "string"
  81230. // },
  81231. // "pageToken": {
  81232. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  81233. // "location": "query",
  81234. // "type": "string"
  81235. // },
  81236. // "project": {
  81237. // "description": "Project ID for this request.",
  81238. // "location": "path",
  81239. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81240. // "required": true,
  81241. // "type": "string"
  81242. // }
  81243. // },
  81244. // "path": "{project}/global/interconnects",
  81245. // "response": {
  81246. // "$ref": "InterconnectList"
  81247. // },
  81248. // "scopes": [
  81249. // "https://www.googleapis.com/auth/cloud-platform",
  81250. // "https://www.googleapis.com/auth/compute",
  81251. // "https://www.googleapis.com/auth/compute.readonly"
  81252. // ]
  81253. // }
  81254. }
  81255. // Pages invokes f for each page of results.
  81256. // A non-nil error returned from f will halt the iteration.
  81257. // The provided context supersedes any context provided to the Context method.
  81258. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  81259. c.ctx_ = ctx
  81260. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  81261. for {
  81262. x, err := c.Do()
  81263. if err != nil {
  81264. return err
  81265. }
  81266. if err := f(x); err != nil {
  81267. return err
  81268. }
  81269. if x.NextPageToken == "" {
  81270. return nil
  81271. }
  81272. c.PageToken(x.NextPageToken)
  81273. }
  81274. }
  81275. // method id "compute.interconnects.patch":
  81276. type InterconnectsPatchCall struct {
  81277. s *Service
  81278. project string
  81279. interconnect string
  81280. interconnect2 *Interconnect
  81281. urlParams_ gensupport.URLParams
  81282. ctx_ context.Context
  81283. header_ http.Header
  81284. }
  81285. // Patch: Updates the specified interconnect with the data included in
  81286. // the request. This method supports PATCH semantics and uses the JSON
  81287. // merge patch format and processing rules.
  81288. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  81289. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81290. c.project = project
  81291. c.interconnect = interconnect
  81292. c.interconnect2 = interconnect2
  81293. return c
  81294. }
  81295. // RequestId sets the optional parameter "requestId": An optional
  81296. // request ID to identify requests. Specify a unique request ID so that
  81297. // if you must retry your request, the server will know to ignore the
  81298. // request if it has already been completed.
  81299. //
  81300. // For example, consider a situation where you make an initial request
  81301. // and the request times out. If you make the request again with the
  81302. // same request ID, the server can check if original operation with the
  81303. // same request ID was received, and if so, will ignore the second
  81304. // request. This prevents clients from accidentally creating duplicate
  81305. // commitments.
  81306. //
  81307. // The request ID must be a valid UUID with the exception that zero UUID
  81308. // is not supported (00000000-0000-0000-0000-000000000000).
  81309. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  81310. c.urlParams_.Set("requestId", requestId)
  81311. return c
  81312. }
  81313. // Fields allows partial responses to be retrieved. See
  81314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81315. // for more information.
  81316. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  81317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81318. return c
  81319. }
  81320. // Context sets the context to be used in this call's Do method. Any
  81321. // pending HTTP request will be aborted if the provided context is
  81322. // canceled.
  81323. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  81324. c.ctx_ = ctx
  81325. return c
  81326. }
  81327. // Header returns an http.Header that can be modified by the caller to
  81328. // add HTTP headers to the request.
  81329. func (c *InterconnectsPatchCall) Header() http.Header {
  81330. if c.header_ == nil {
  81331. c.header_ = make(http.Header)
  81332. }
  81333. return c.header_
  81334. }
  81335. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  81336. reqHeaders := make(http.Header)
  81337. for k, v := range c.header_ {
  81338. reqHeaders[k] = v
  81339. }
  81340. reqHeaders.Set("User-Agent", c.s.userAgent())
  81341. var body io.Reader = nil
  81342. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  81343. if err != nil {
  81344. return nil, err
  81345. }
  81346. reqHeaders.Set("Content-Type", "application/json")
  81347. c.urlParams_.Set("alt", alt)
  81348. c.urlParams_.Set("prettyPrint", "false")
  81349. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  81350. urls += "?" + c.urlParams_.Encode()
  81351. req, err := http.NewRequest("PATCH", urls, body)
  81352. if err != nil {
  81353. return nil, err
  81354. }
  81355. req.Header = reqHeaders
  81356. googleapi.Expand(req.URL, map[string]string{
  81357. "project": c.project,
  81358. "interconnect": c.interconnect,
  81359. })
  81360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81361. }
  81362. // Do executes the "compute.interconnects.patch" call.
  81363. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81364. // status code is an error. Response headers are in either
  81365. // *Operation.ServerResponse.Header or (if a response was returned at
  81366. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81367. // to check whether the returned error was because
  81368. // http.StatusNotModified was returned.
  81369. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81370. gensupport.SetOptions(c.urlParams_, opts...)
  81371. res, err := c.doRequest("json")
  81372. if res != nil && res.StatusCode == http.StatusNotModified {
  81373. if res.Body != nil {
  81374. res.Body.Close()
  81375. }
  81376. return nil, &googleapi.Error{
  81377. Code: res.StatusCode,
  81378. Header: res.Header,
  81379. }
  81380. }
  81381. if err != nil {
  81382. return nil, err
  81383. }
  81384. defer googleapi.CloseBody(res)
  81385. if err := googleapi.CheckResponse(res); err != nil {
  81386. return nil, err
  81387. }
  81388. ret := &Operation{
  81389. ServerResponse: googleapi.ServerResponse{
  81390. Header: res.Header,
  81391. HTTPStatusCode: res.StatusCode,
  81392. },
  81393. }
  81394. target := &ret
  81395. if err := gensupport.DecodeResponse(target, res); err != nil {
  81396. return nil, err
  81397. }
  81398. return ret, nil
  81399. // {
  81400. // "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.",
  81401. // "httpMethod": "PATCH",
  81402. // "id": "compute.interconnects.patch",
  81403. // "parameterOrder": [
  81404. // "project",
  81405. // "interconnect"
  81406. // ],
  81407. // "parameters": {
  81408. // "interconnect": {
  81409. // "description": "Name of the interconnect to update.",
  81410. // "location": "path",
  81411. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81412. // "required": true,
  81413. // "type": "string"
  81414. // },
  81415. // "project": {
  81416. // "description": "Project ID for this request.",
  81417. // "location": "path",
  81418. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81419. // "required": true,
  81420. // "type": "string"
  81421. // },
  81422. // "requestId": {
  81423. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81424. // "location": "query",
  81425. // "type": "string"
  81426. // }
  81427. // },
  81428. // "path": "{project}/global/interconnects/{interconnect}",
  81429. // "request": {
  81430. // "$ref": "Interconnect"
  81431. // },
  81432. // "response": {
  81433. // "$ref": "Operation"
  81434. // },
  81435. // "scopes": [
  81436. // "https://www.googleapis.com/auth/cloud-platform",
  81437. // "https://www.googleapis.com/auth/compute"
  81438. // ]
  81439. // }
  81440. }
  81441. // method id "compute.interconnects.setIamPolicy":
  81442. type InterconnectsSetIamPolicyCall struct {
  81443. s *Service
  81444. project string
  81445. resource string
  81446. globalsetpolicyrequest *GlobalSetPolicyRequest
  81447. urlParams_ gensupport.URLParams
  81448. ctx_ context.Context
  81449. header_ http.Header
  81450. }
  81451. // SetIamPolicy: Sets the access control policy on the specified
  81452. // resource. Replaces any existing policy.
  81453. func (r *InterconnectsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InterconnectsSetIamPolicyCall {
  81454. c := &InterconnectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81455. c.project = project
  81456. c.resource = resource
  81457. c.globalsetpolicyrequest = globalsetpolicyrequest
  81458. return c
  81459. }
  81460. // Fields allows partial responses to be retrieved. See
  81461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81462. // for more information.
  81463. func (c *InterconnectsSetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectsSetIamPolicyCall {
  81464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81465. return c
  81466. }
  81467. // Context sets the context to be used in this call's Do method. Any
  81468. // pending HTTP request will be aborted if the provided context is
  81469. // canceled.
  81470. func (c *InterconnectsSetIamPolicyCall) Context(ctx context.Context) *InterconnectsSetIamPolicyCall {
  81471. c.ctx_ = ctx
  81472. return c
  81473. }
  81474. // Header returns an http.Header that can be modified by the caller to
  81475. // add HTTP headers to the request.
  81476. func (c *InterconnectsSetIamPolicyCall) Header() http.Header {
  81477. if c.header_ == nil {
  81478. c.header_ = make(http.Header)
  81479. }
  81480. return c.header_
  81481. }
  81482. func (c *InterconnectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  81483. reqHeaders := make(http.Header)
  81484. for k, v := range c.header_ {
  81485. reqHeaders[k] = v
  81486. }
  81487. reqHeaders.Set("User-Agent", c.s.userAgent())
  81488. var body io.Reader = nil
  81489. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  81490. if err != nil {
  81491. return nil, err
  81492. }
  81493. reqHeaders.Set("Content-Type", "application/json")
  81494. c.urlParams_.Set("alt", alt)
  81495. c.urlParams_.Set("prettyPrint", "false")
  81496. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setIamPolicy")
  81497. urls += "?" + c.urlParams_.Encode()
  81498. req, err := http.NewRequest("POST", urls, body)
  81499. if err != nil {
  81500. return nil, err
  81501. }
  81502. req.Header = reqHeaders
  81503. googleapi.Expand(req.URL, map[string]string{
  81504. "project": c.project,
  81505. "resource": c.resource,
  81506. })
  81507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81508. }
  81509. // Do executes the "compute.interconnects.setIamPolicy" call.
  81510. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  81511. // code is an error. Response headers are in either
  81512. // *Policy.ServerResponse.Header or (if a response was returned at all)
  81513. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81514. // check whether the returned error was because http.StatusNotModified
  81515. // was returned.
  81516. func (c *InterconnectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  81517. gensupport.SetOptions(c.urlParams_, opts...)
  81518. res, err := c.doRequest("json")
  81519. if res != nil && res.StatusCode == http.StatusNotModified {
  81520. if res.Body != nil {
  81521. res.Body.Close()
  81522. }
  81523. return nil, &googleapi.Error{
  81524. Code: res.StatusCode,
  81525. Header: res.Header,
  81526. }
  81527. }
  81528. if err != nil {
  81529. return nil, err
  81530. }
  81531. defer googleapi.CloseBody(res)
  81532. if err := googleapi.CheckResponse(res); err != nil {
  81533. return nil, err
  81534. }
  81535. ret := &Policy{
  81536. ServerResponse: googleapi.ServerResponse{
  81537. Header: res.Header,
  81538. HTTPStatusCode: res.StatusCode,
  81539. },
  81540. }
  81541. target := &ret
  81542. if err := gensupport.DecodeResponse(target, res); err != nil {
  81543. return nil, err
  81544. }
  81545. return ret, nil
  81546. // {
  81547. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  81548. // "httpMethod": "POST",
  81549. // "id": "compute.interconnects.setIamPolicy",
  81550. // "parameterOrder": [
  81551. // "project",
  81552. // "resource"
  81553. // ],
  81554. // "parameters": {
  81555. // "project": {
  81556. // "description": "Project ID for this request.",
  81557. // "location": "path",
  81558. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81559. // "required": true,
  81560. // "type": "string"
  81561. // },
  81562. // "resource": {
  81563. // "description": "Name or id of the resource for this request.",
  81564. // "location": "path",
  81565. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81566. // "required": true,
  81567. // "type": "string"
  81568. // }
  81569. // },
  81570. // "path": "{project}/global/interconnects/{resource}/setIamPolicy",
  81571. // "request": {
  81572. // "$ref": "GlobalSetPolicyRequest"
  81573. // },
  81574. // "response": {
  81575. // "$ref": "Policy"
  81576. // },
  81577. // "scopes": [
  81578. // "https://www.googleapis.com/auth/cloud-platform",
  81579. // "https://www.googleapis.com/auth/compute"
  81580. // ]
  81581. // }
  81582. }
  81583. // method id "compute.interconnects.setLabels":
  81584. type InterconnectsSetLabelsCall struct {
  81585. s *Service
  81586. project string
  81587. resource string
  81588. globalsetlabelsrequest *GlobalSetLabelsRequest
  81589. urlParams_ gensupport.URLParams
  81590. ctx_ context.Context
  81591. header_ http.Header
  81592. }
  81593. // SetLabels: Sets the labels on an Interconnect. To learn more about
  81594. // labels, read the Labeling Resources documentation.
  81595. func (r *InterconnectsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *InterconnectsSetLabelsCall {
  81596. c := &InterconnectsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81597. c.project = project
  81598. c.resource = resource
  81599. c.globalsetlabelsrequest = globalsetlabelsrequest
  81600. return c
  81601. }
  81602. // Fields allows partial responses to be retrieved. See
  81603. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81604. // for more information.
  81605. func (c *InterconnectsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectsSetLabelsCall {
  81606. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81607. return c
  81608. }
  81609. // Context sets the context to be used in this call's Do method. Any
  81610. // pending HTTP request will be aborted if the provided context is
  81611. // canceled.
  81612. func (c *InterconnectsSetLabelsCall) Context(ctx context.Context) *InterconnectsSetLabelsCall {
  81613. c.ctx_ = ctx
  81614. return c
  81615. }
  81616. // Header returns an http.Header that can be modified by the caller to
  81617. // add HTTP headers to the request.
  81618. func (c *InterconnectsSetLabelsCall) Header() http.Header {
  81619. if c.header_ == nil {
  81620. c.header_ = make(http.Header)
  81621. }
  81622. return c.header_
  81623. }
  81624. func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  81625. reqHeaders := make(http.Header)
  81626. for k, v := range c.header_ {
  81627. reqHeaders[k] = v
  81628. }
  81629. reqHeaders.Set("User-Agent", c.s.userAgent())
  81630. var body io.Reader = nil
  81631. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  81632. if err != nil {
  81633. return nil, err
  81634. }
  81635. reqHeaders.Set("Content-Type", "application/json")
  81636. c.urlParams_.Set("alt", alt)
  81637. c.urlParams_.Set("prettyPrint", "false")
  81638. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setLabels")
  81639. urls += "?" + c.urlParams_.Encode()
  81640. req, err := http.NewRequest("POST", urls, body)
  81641. if err != nil {
  81642. return nil, err
  81643. }
  81644. req.Header = reqHeaders
  81645. googleapi.Expand(req.URL, map[string]string{
  81646. "project": c.project,
  81647. "resource": c.resource,
  81648. })
  81649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81650. }
  81651. // Do executes the "compute.interconnects.setLabels" call.
  81652. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81653. // status code is an error. Response headers are in either
  81654. // *Operation.ServerResponse.Header or (if a response was returned at
  81655. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81656. // to check whether the returned error was because
  81657. // http.StatusNotModified was returned.
  81658. func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81659. gensupport.SetOptions(c.urlParams_, opts...)
  81660. res, err := c.doRequest("json")
  81661. if res != nil && res.StatusCode == http.StatusNotModified {
  81662. if res.Body != nil {
  81663. res.Body.Close()
  81664. }
  81665. return nil, &googleapi.Error{
  81666. Code: res.StatusCode,
  81667. Header: res.Header,
  81668. }
  81669. }
  81670. if err != nil {
  81671. return nil, err
  81672. }
  81673. defer googleapi.CloseBody(res)
  81674. if err := googleapi.CheckResponse(res); err != nil {
  81675. return nil, err
  81676. }
  81677. ret := &Operation{
  81678. ServerResponse: googleapi.ServerResponse{
  81679. Header: res.Header,
  81680. HTTPStatusCode: res.StatusCode,
  81681. },
  81682. }
  81683. target := &ret
  81684. if err := gensupport.DecodeResponse(target, res); err != nil {
  81685. return nil, err
  81686. }
  81687. return ret, nil
  81688. // {
  81689. // "description": "Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.",
  81690. // "httpMethod": "POST",
  81691. // "id": "compute.interconnects.setLabels",
  81692. // "parameterOrder": [
  81693. // "project",
  81694. // "resource"
  81695. // ],
  81696. // "parameters": {
  81697. // "project": {
  81698. // "description": "Project ID for this request.",
  81699. // "location": "path",
  81700. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81701. // "required": true,
  81702. // "type": "string"
  81703. // },
  81704. // "resource": {
  81705. // "description": "Name or id of the resource for this request.",
  81706. // "location": "path",
  81707. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81708. // "required": true,
  81709. // "type": "string"
  81710. // }
  81711. // },
  81712. // "path": "{project}/global/interconnects/{resource}/setLabels",
  81713. // "request": {
  81714. // "$ref": "GlobalSetLabelsRequest"
  81715. // },
  81716. // "response": {
  81717. // "$ref": "Operation"
  81718. // },
  81719. // "scopes": [
  81720. // "https://www.googleapis.com/auth/cloud-platform",
  81721. // "https://www.googleapis.com/auth/compute"
  81722. // ]
  81723. // }
  81724. }
  81725. // method id "compute.interconnects.testIamPermissions":
  81726. type InterconnectsTestIamPermissionsCall struct {
  81727. s *Service
  81728. project string
  81729. resource string
  81730. testpermissionsrequest *TestPermissionsRequest
  81731. urlParams_ gensupport.URLParams
  81732. ctx_ context.Context
  81733. header_ http.Header
  81734. }
  81735. // TestIamPermissions: Returns permissions that a caller has on the
  81736. // specified resource.
  81737. func (r *InterconnectsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectsTestIamPermissionsCall {
  81738. c := &InterconnectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81739. c.project = project
  81740. c.resource = resource
  81741. c.testpermissionsrequest = testpermissionsrequest
  81742. return c
  81743. }
  81744. // Fields allows partial responses to be retrieved. See
  81745. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81746. // for more information.
  81747. func (c *InterconnectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectsTestIamPermissionsCall {
  81748. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81749. return c
  81750. }
  81751. // Context sets the context to be used in this call's Do method. Any
  81752. // pending HTTP request will be aborted if the provided context is
  81753. // canceled.
  81754. func (c *InterconnectsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectsTestIamPermissionsCall {
  81755. c.ctx_ = ctx
  81756. return c
  81757. }
  81758. // Header returns an http.Header that can be modified by the caller to
  81759. // add HTTP headers to the request.
  81760. func (c *InterconnectsTestIamPermissionsCall) Header() http.Header {
  81761. if c.header_ == nil {
  81762. c.header_ = make(http.Header)
  81763. }
  81764. return c.header_
  81765. }
  81766. func (c *InterconnectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  81767. reqHeaders := make(http.Header)
  81768. for k, v := range c.header_ {
  81769. reqHeaders[k] = v
  81770. }
  81771. reqHeaders.Set("User-Agent", c.s.userAgent())
  81772. var body io.Reader = nil
  81773. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  81774. if err != nil {
  81775. return nil, err
  81776. }
  81777. reqHeaders.Set("Content-Type", "application/json")
  81778. c.urlParams_.Set("alt", alt)
  81779. c.urlParams_.Set("prettyPrint", "false")
  81780. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/testIamPermissions")
  81781. urls += "?" + c.urlParams_.Encode()
  81782. req, err := http.NewRequest("POST", urls, body)
  81783. if err != nil {
  81784. return nil, err
  81785. }
  81786. req.Header = reqHeaders
  81787. googleapi.Expand(req.URL, map[string]string{
  81788. "project": c.project,
  81789. "resource": c.resource,
  81790. })
  81791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81792. }
  81793. // Do executes the "compute.interconnects.testIamPermissions" call.
  81794. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  81795. // non-2xx status code is an error. Response headers are in either
  81796. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  81797. // returned at all) in error.(*googleapi.Error).Header. Use
  81798. // googleapi.IsNotModified to check whether the returned error was
  81799. // because http.StatusNotModified was returned.
  81800. func (c *InterconnectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  81801. gensupport.SetOptions(c.urlParams_, opts...)
  81802. res, err := c.doRequest("json")
  81803. if res != nil && res.StatusCode == http.StatusNotModified {
  81804. if res.Body != nil {
  81805. res.Body.Close()
  81806. }
  81807. return nil, &googleapi.Error{
  81808. Code: res.StatusCode,
  81809. Header: res.Header,
  81810. }
  81811. }
  81812. if err != nil {
  81813. return nil, err
  81814. }
  81815. defer googleapi.CloseBody(res)
  81816. if err := googleapi.CheckResponse(res); err != nil {
  81817. return nil, err
  81818. }
  81819. ret := &TestPermissionsResponse{
  81820. ServerResponse: googleapi.ServerResponse{
  81821. Header: res.Header,
  81822. HTTPStatusCode: res.StatusCode,
  81823. },
  81824. }
  81825. target := &ret
  81826. if err := gensupport.DecodeResponse(target, res); err != nil {
  81827. return nil, err
  81828. }
  81829. return ret, nil
  81830. // {
  81831. // "description": "Returns permissions that a caller has on the specified resource.",
  81832. // "httpMethod": "POST",
  81833. // "id": "compute.interconnects.testIamPermissions",
  81834. // "parameterOrder": [
  81835. // "project",
  81836. // "resource"
  81837. // ],
  81838. // "parameters": {
  81839. // "project": {
  81840. // "description": "Project ID for this request.",
  81841. // "location": "path",
  81842. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81843. // "required": true,
  81844. // "type": "string"
  81845. // },
  81846. // "resource": {
  81847. // "description": "Name or id of the resource for this request.",
  81848. // "location": "path",
  81849. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81850. // "required": true,
  81851. // "type": "string"
  81852. // }
  81853. // },
  81854. // "path": "{project}/global/interconnects/{resource}/testIamPermissions",
  81855. // "request": {
  81856. // "$ref": "TestPermissionsRequest"
  81857. // },
  81858. // "response": {
  81859. // "$ref": "TestPermissionsResponse"
  81860. // },
  81861. // "scopes": [
  81862. // "https://www.googleapis.com/auth/cloud-platform",
  81863. // "https://www.googleapis.com/auth/compute",
  81864. // "https://www.googleapis.com/auth/compute.readonly"
  81865. // ]
  81866. // }
  81867. }
  81868. // method id "compute.licenseCodes.get":
  81869. type LicenseCodesGetCall struct {
  81870. s *Service
  81871. project string
  81872. licenseCode string
  81873. urlParams_ gensupport.URLParams
  81874. ifNoneMatch_ string
  81875. ctx_ context.Context
  81876. header_ http.Header
  81877. }
  81878. // Get: Return a specified license code. License codes are mirrored
  81879. // across all projects that have permissions to read the License Code.
  81880. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  81881. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81882. c.project = project
  81883. c.licenseCode = licenseCode
  81884. return c
  81885. }
  81886. // Fields allows partial responses to be retrieved. See
  81887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81888. // for more information.
  81889. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  81890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81891. return c
  81892. }
  81893. // IfNoneMatch sets the optional parameter which makes the operation
  81894. // fail if the object's ETag matches the given value. This is useful for
  81895. // getting updates only after the object has changed since the last
  81896. // request. Use googleapi.IsNotModified to check whether the response
  81897. // error from Do is the result of In-None-Match.
  81898. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  81899. c.ifNoneMatch_ = entityTag
  81900. return c
  81901. }
  81902. // Context sets the context to be used in this call's Do method. Any
  81903. // pending HTTP request will be aborted if the provided context is
  81904. // canceled.
  81905. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  81906. c.ctx_ = ctx
  81907. return c
  81908. }
  81909. // Header returns an http.Header that can be modified by the caller to
  81910. // add HTTP headers to the request.
  81911. func (c *LicenseCodesGetCall) Header() http.Header {
  81912. if c.header_ == nil {
  81913. c.header_ = make(http.Header)
  81914. }
  81915. return c.header_
  81916. }
  81917. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  81918. reqHeaders := make(http.Header)
  81919. for k, v := range c.header_ {
  81920. reqHeaders[k] = v
  81921. }
  81922. reqHeaders.Set("User-Agent", c.s.userAgent())
  81923. if c.ifNoneMatch_ != "" {
  81924. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81925. }
  81926. var body io.Reader = nil
  81927. c.urlParams_.Set("alt", alt)
  81928. c.urlParams_.Set("prettyPrint", "false")
  81929. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  81930. urls += "?" + c.urlParams_.Encode()
  81931. req, err := http.NewRequest("GET", urls, body)
  81932. if err != nil {
  81933. return nil, err
  81934. }
  81935. req.Header = reqHeaders
  81936. googleapi.Expand(req.URL, map[string]string{
  81937. "project": c.project,
  81938. "licenseCode": c.licenseCode,
  81939. })
  81940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81941. }
  81942. // Do executes the "compute.licenseCodes.get" call.
  81943. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  81944. // status code is an error. Response headers are in either
  81945. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  81946. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81947. // to check whether the returned error was because
  81948. // http.StatusNotModified was returned.
  81949. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  81950. gensupport.SetOptions(c.urlParams_, opts...)
  81951. res, err := c.doRequest("json")
  81952. if res != nil && res.StatusCode == http.StatusNotModified {
  81953. if res.Body != nil {
  81954. res.Body.Close()
  81955. }
  81956. return nil, &googleapi.Error{
  81957. Code: res.StatusCode,
  81958. Header: res.Header,
  81959. }
  81960. }
  81961. if err != nil {
  81962. return nil, err
  81963. }
  81964. defer googleapi.CloseBody(res)
  81965. if err := googleapi.CheckResponse(res); err != nil {
  81966. return nil, err
  81967. }
  81968. ret := &LicenseCode{
  81969. ServerResponse: googleapi.ServerResponse{
  81970. Header: res.Header,
  81971. HTTPStatusCode: res.StatusCode,
  81972. },
  81973. }
  81974. target := &ret
  81975. if err := gensupport.DecodeResponse(target, res); err != nil {
  81976. return nil, err
  81977. }
  81978. return ret, nil
  81979. // {
  81980. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  81981. // "httpMethod": "GET",
  81982. // "id": "compute.licenseCodes.get",
  81983. // "parameterOrder": [
  81984. // "project",
  81985. // "licenseCode"
  81986. // ],
  81987. // "parameters": {
  81988. // "licenseCode": {
  81989. // "description": "Number corresponding to the License code resource to return.",
  81990. // "location": "path",
  81991. // "pattern": "[0-9]{0,61}?",
  81992. // "required": true,
  81993. // "type": "string"
  81994. // },
  81995. // "project": {
  81996. // "description": "Project ID for this request.",
  81997. // "location": "path",
  81998. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81999. // "required": true,
  82000. // "type": "string"
  82001. // }
  82002. // },
  82003. // "path": "{project}/global/licenseCodes/{licenseCode}",
  82004. // "response": {
  82005. // "$ref": "LicenseCode"
  82006. // },
  82007. // "scopes": [
  82008. // "https://www.googleapis.com/auth/cloud-platform",
  82009. // "https://www.googleapis.com/auth/compute",
  82010. // "https://www.googleapis.com/auth/compute.readonly"
  82011. // ]
  82012. // }
  82013. }
  82014. // method id "compute.licenseCodes.getIamPolicy":
  82015. type LicenseCodesGetIamPolicyCall struct {
  82016. s *Service
  82017. project string
  82018. resource string
  82019. urlParams_ gensupport.URLParams
  82020. ifNoneMatch_ string
  82021. ctx_ context.Context
  82022. header_ http.Header
  82023. }
  82024. // GetIamPolicy: Gets the access control policy for a resource. May be
  82025. // empty if no such policy or resource exists.
  82026. func (r *LicenseCodesService) GetIamPolicy(project string, resource string) *LicenseCodesGetIamPolicyCall {
  82027. c := &LicenseCodesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82028. c.project = project
  82029. c.resource = resource
  82030. return c
  82031. }
  82032. // Fields allows partial responses to be retrieved. See
  82033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82034. // for more information.
  82035. func (c *LicenseCodesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicenseCodesGetIamPolicyCall {
  82036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82037. return c
  82038. }
  82039. // IfNoneMatch sets the optional parameter which makes the operation
  82040. // fail if the object's ETag matches the given value. This is useful for
  82041. // getting updates only after the object has changed since the last
  82042. // request. Use googleapi.IsNotModified to check whether the response
  82043. // error from Do is the result of In-None-Match.
  82044. func (c *LicenseCodesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicenseCodesGetIamPolicyCall {
  82045. c.ifNoneMatch_ = entityTag
  82046. return c
  82047. }
  82048. // Context sets the context to be used in this call's Do method. Any
  82049. // pending HTTP request will be aborted if the provided context is
  82050. // canceled.
  82051. func (c *LicenseCodesGetIamPolicyCall) Context(ctx context.Context) *LicenseCodesGetIamPolicyCall {
  82052. c.ctx_ = ctx
  82053. return c
  82054. }
  82055. // Header returns an http.Header that can be modified by the caller to
  82056. // add HTTP headers to the request.
  82057. func (c *LicenseCodesGetIamPolicyCall) Header() http.Header {
  82058. if c.header_ == nil {
  82059. c.header_ = make(http.Header)
  82060. }
  82061. return c.header_
  82062. }
  82063. func (c *LicenseCodesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  82064. reqHeaders := make(http.Header)
  82065. for k, v := range c.header_ {
  82066. reqHeaders[k] = v
  82067. }
  82068. reqHeaders.Set("User-Agent", c.s.userAgent())
  82069. if c.ifNoneMatch_ != "" {
  82070. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82071. }
  82072. var body io.Reader = nil
  82073. c.urlParams_.Set("alt", alt)
  82074. c.urlParams_.Set("prettyPrint", "false")
  82075. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/getIamPolicy")
  82076. urls += "?" + c.urlParams_.Encode()
  82077. req, err := http.NewRequest("GET", urls, body)
  82078. if err != nil {
  82079. return nil, err
  82080. }
  82081. req.Header = reqHeaders
  82082. googleapi.Expand(req.URL, map[string]string{
  82083. "project": c.project,
  82084. "resource": c.resource,
  82085. })
  82086. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82087. }
  82088. // Do executes the "compute.licenseCodes.getIamPolicy" call.
  82089. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  82090. // code is an error. Response headers are in either
  82091. // *Policy.ServerResponse.Header or (if a response was returned at all)
  82092. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  82093. // check whether the returned error was because http.StatusNotModified
  82094. // was returned.
  82095. func (c *LicenseCodesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  82096. gensupport.SetOptions(c.urlParams_, opts...)
  82097. res, err := c.doRequest("json")
  82098. if res != nil && res.StatusCode == http.StatusNotModified {
  82099. if res.Body != nil {
  82100. res.Body.Close()
  82101. }
  82102. return nil, &googleapi.Error{
  82103. Code: res.StatusCode,
  82104. Header: res.Header,
  82105. }
  82106. }
  82107. if err != nil {
  82108. return nil, err
  82109. }
  82110. defer googleapi.CloseBody(res)
  82111. if err := googleapi.CheckResponse(res); err != nil {
  82112. return nil, err
  82113. }
  82114. ret := &Policy{
  82115. ServerResponse: googleapi.ServerResponse{
  82116. Header: res.Header,
  82117. HTTPStatusCode: res.StatusCode,
  82118. },
  82119. }
  82120. target := &ret
  82121. if err := gensupport.DecodeResponse(target, res); err != nil {
  82122. return nil, err
  82123. }
  82124. return ret, nil
  82125. // {
  82126. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  82127. // "httpMethod": "GET",
  82128. // "id": "compute.licenseCodes.getIamPolicy",
  82129. // "parameterOrder": [
  82130. // "project",
  82131. // "resource"
  82132. // ],
  82133. // "parameters": {
  82134. // "project": {
  82135. // "description": "Project ID for this request.",
  82136. // "location": "path",
  82137. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82138. // "required": true,
  82139. // "type": "string"
  82140. // },
  82141. // "resource": {
  82142. // "description": "Name or id of the resource for this request.",
  82143. // "location": "path",
  82144. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82145. // "required": true,
  82146. // "type": "string"
  82147. // }
  82148. // },
  82149. // "path": "{project}/global/licenseCodes/{resource}/getIamPolicy",
  82150. // "response": {
  82151. // "$ref": "Policy"
  82152. // },
  82153. // "scopes": [
  82154. // "https://www.googleapis.com/auth/cloud-platform",
  82155. // "https://www.googleapis.com/auth/compute",
  82156. // "https://www.googleapis.com/auth/compute.readonly"
  82157. // ]
  82158. // }
  82159. }
  82160. // method id "compute.licenseCodes.setIamPolicy":
  82161. type LicenseCodesSetIamPolicyCall struct {
  82162. s *Service
  82163. project string
  82164. resource string
  82165. globalsetpolicyrequest *GlobalSetPolicyRequest
  82166. urlParams_ gensupport.URLParams
  82167. ctx_ context.Context
  82168. header_ http.Header
  82169. }
  82170. // SetIamPolicy: Sets the access control policy on the specified
  82171. // resource. Replaces any existing policy.
  82172. func (r *LicenseCodesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicenseCodesSetIamPolicyCall {
  82173. c := &LicenseCodesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82174. c.project = project
  82175. c.resource = resource
  82176. c.globalsetpolicyrequest = globalsetpolicyrequest
  82177. return c
  82178. }
  82179. // Fields allows partial responses to be retrieved. See
  82180. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82181. // for more information.
  82182. func (c *LicenseCodesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicenseCodesSetIamPolicyCall {
  82183. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82184. return c
  82185. }
  82186. // Context sets the context to be used in this call's Do method. Any
  82187. // pending HTTP request will be aborted if the provided context is
  82188. // canceled.
  82189. func (c *LicenseCodesSetIamPolicyCall) Context(ctx context.Context) *LicenseCodesSetIamPolicyCall {
  82190. c.ctx_ = ctx
  82191. return c
  82192. }
  82193. // Header returns an http.Header that can be modified by the caller to
  82194. // add HTTP headers to the request.
  82195. func (c *LicenseCodesSetIamPolicyCall) Header() http.Header {
  82196. if c.header_ == nil {
  82197. c.header_ = make(http.Header)
  82198. }
  82199. return c.header_
  82200. }
  82201. func (c *LicenseCodesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  82202. reqHeaders := make(http.Header)
  82203. for k, v := range c.header_ {
  82204. reqHeaders[k] = v
  82205. }
  82206. reqHeaders.Set("User-Agent", c.s.userAgent())
  82207. var body io.Reader = nil
  82208. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  82209. if err != nil {
  82210. return nil, err
  82211. }
  82212. reqHeaders.Set("Content-Type", "application/json")
  82213. c.urlParams_.Set("alt", alt)
  82214. c.urlParams_.Set("prettyPrint", "false")
  82215. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/setIamPolicy")
  82216. urls += "?" + c.urlParams_.Encode()
  82217. req, err := http.NewRequest("POST", urls, body)
  82218. if err != nil {
  82219. return nil, err
  82220. }
  82221. req.Header = reqHeaders
  82222. googleapi.Expand(req.URL, map[string]string{
  82223. "project": c.project,
  82224. "resource": c.resource,
  82225. })
  82226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82227. }
  82228. // Do executes the "compute.licenseCodes.setIamPolicy" call.
  82229. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  82230. // code is an error. Response headers are in either
  82231. // *Policy.ServerResponse.Header or (if a response was returned at all)
  82232. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  82233. // check whether the returned error was because http.StatusNotModified
  82234. // was returned.
  82235. func (c *LicenseCodesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  82236. gensupport.SetOptions(c.urlParams_, opts...)
  82237. res, err := c.doRequest("json")
  82238. if res != nil && res.StatusCode == http.StatusNotModified {
  82239. if res.Body != nil {
  82240. res.Body.Close()
  82241. }
  82242. return nil, &googleapi.Error{
  82243. Code: res.StatusCode,
  82244. Header: res.Header,
  82245. }
  82246. }
  82247. if err != nil {
  82248. return nil, err
  82249. }
  82250. defer googleapi.CloseBody(res)
  82251. if err := googleapi.CheckResponse(res); err != nil {
  82252. return nil, err
  82253. }
  82254. ret := &Policy{
  82255. ServerResponse: googleapi.ServerResponse{
  82256. Header: res.Header,
  82257. HTTPStatusCode: res.StatusCode,
  82258. },
  82259. }
  82260. target := &ret
  82261. if err := gensupport.DecodeResponse(target, res); err != nil {
  82262. return nil, err
  82263. }
  82264. return ret, nil
  82265. // {
  82266. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  82267. // "httpMethod": "POST",
  82268. // "id": "compute.licenseCodes.setIamPolicy",
  82269. // "parameterOrder": [
  82270. // "project",
  82271. // "resource"
  82272. // ],
  82273. // "parameters": {
  82274. // "project": {
  82275. // "description": "Project ID for this request.",
  82276. // "location": "path",
  82277. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82278. // "required": true,
  82279. // "type": "string"
  82280. // },
  82281. // "resource": {
  82282. // "description": "Name or id of the resource for this request.",
  82283. // "location": "path",
  82284. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82285. // "required": true,
  82286. // "type": "string"
  82287. // }
  82288. // },
  82289. // "path": "{project}/global/licenseCodes/{resource}/setIamPolicy",
  82290. // "request": {
  82291. // "$ref": "GlobalSetPolicyRequest"
  82292. // },
  82293. // "response": {
  82294. // "$ref": "Policy"
  82295. // },
  82296. // "scopes": [
  82297. // "https://www.googleapis.com/auth/cloud-platform",
  82298. // "https://www.googleapis.com/auth/compute"
  82299. // ]
  82300. // }
  82301. }
  82302. // method id "compute.licenseCodes.testIamPermissions":
  82303. type LicenseCodesTestIamPermissionsCall struct {
  82304. s *Service
  82305. project string
  82306. resource string
  82307. testpermissionsrequest *TestPermissionsRequest
  82308. urlParams_ gensupport.URLParams
  82309. ctx_ context.Context
  82310. header_ http.Header
  82311. }
  82312. // TestIamPermissions: Returns permissions that a caller has on the
  82313. // specified resource.
  82314. func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall {
  82315. c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82316. c.project = project
  82317. c.resource = resource
  82318. c.testpermissionsrequest = testpermissionsrequest
  82319. return c
  82320. }
  82321. // Fields allows partial responses to be retrieved. See
  82322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82323. // for more information.
  82324. func (c *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall {
  82325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82326. return c
  82327. }
  82328. // Context sets the context to be used in this call's Do method. Any
  82329. // pending HTTP request will be aborted if the provided context is
  82330. // canceled.
  82331. func (c *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall {
  82332. c.ctx_ = ctx
  82333. return c
  82334. }
  82335. // Header returns an http.Header that can be modified by the caller to
  82336. // add HTTP headers to the request.
  82337. func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header {
  82338. if c.header_ == nil {
  82339. c.header_ = make(http.Header)
  82340. }
  82341. return c.header_
  82342. }
  82343. func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  82344. reqHeaders := make(http.Header)
  82345. for k, v := range c.header_ {
  82346. reqHeaders[k] = v
  82347. }
  82348. reqHeaders.Set("User-Agent", c.s.userAgent())
  82349. var body io.Reader = nil
  82350. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  82351. if err != nil {
  82352. return nil, err
  82353. }
  82354. reqHeaders.Set("Content-Type", "application/json")
  82355. c.urlParams_.Set("alt", alt)
  82356. c.urlParams_.Set("prettyPrint", "false")
  82357. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/testIamPermissions")
  82358. urls += "?" + c.urlParams_.Encode()
  82359. req, err := http.NewRequest("POST", urls, body)
  82360. if err != nil {
  82361. return nil, err
  82362. }
  82363. req.Header = reqHeaders
  82364. googleapi.Expand(req.URL, map[string]string{
  82365. "project": c.project,
  82366. "resource": c.resource,
  82367. })
  82368. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82369. }
  82370. // Do executes the "compute.licenseCodes.testIamPermissions" call.
  82371. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  82372. // non-2xx status code is an error. Response headers are in either
  82373. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  82374. // returned at all) in error.(*googleapi.Error).Header. Use
  82375. // googleapi.IsNotModified to check whether the returned error was
  82376. // because http.StatusNotModified was returned.
  82377. func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  82378. gensupport.SetOptions(c.urlParams_, opts...)
  82379. res, err := c.doRequest("json")
  82380. if res != nil && res.StatusCode == http.StatusNotModified {
  82381. if res.Body != nil {
  82382. res.Body.Close()
  82383. }
  82384. return nil, &googleapi.Error{
  82385. Code: res.StatusCode,
  82386. Header: res.Header,
  82387. }
  82388. }
  82389. if err != nil {
  82390. return nil, err
  82391. }
  82392. defer googleapi.CloseBody(res)
  82393. if err := googleapi.CheckResponse(res); err != nil {
  82394. return nil, err
  82395. }
  82396. ret := &TestPermissionsResponse{
  82397. ServerResponse: googleapi.ServerResponse{
  82398. Header: res.Header,
  82399. HTTPStatusCode: res.StatusCode,
  82400. },
  82401. }
  82402. target := &ret
  82403. if err := gensupport.DecodeResponse(target, res); err != nil {
  82404. return nil, err
  82405. }
  82406. return ret, nil
  82407. // {
  82408. // "description": "Returns permissions that a caller has on the specified resource.",
  82409. // "httpMethod": "POST",
  82410. // "id": "compute.licenseCodes.testIamPermissions",
  82411. // "parameterOrder": [
  82412. // "project",
  82413. // "resource"
  82414. // ],
  82415. // "parameters": {
  82416. // "project": {
  82417. // "description": "Project ID for this request.",
  82418. // "location": "path",
  82419. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82420. // "required": true,
  82421. // "type": "string"
  82422. // },
  82423. // "resource": {
  82424. // "description": "Name or id of the resource for this request.",
  82425. // "location": "path",
  82426. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82427. // "required": true,
  82428. // "type": "string"
  82429. // }
  82430. // },
  82431. // "path": "{project}/global/licenseCodes/{resource}/testIamPermissions",
  82432. // "request": {
  82433. // "$ref": "TestPermissionsRequest"
  82434. // },
  82435. // "response": {
  82436. // "$ref": "TestPermissionsResponse"
  82437. // },
  82438. // "scopes": [
  82439. // "https://www.googleapis.com/auth/cloud-platform",
  82440. // "https://www.googleapis.com/auth/compute",
  82441. // "https://www.googleapis.com/auth/compute.readonly"
  82442. // ]
  82443. // }
  82444. }
  82445. // method id "compute.licenses.delete":
  82446. type LicensesDeleteCall struct {
  82447. s *Service
  82448. project string
  82449. license string
  82450. urlParams_ gensupport.URLParams
  82451. ctx_ context.Context
  82452. header_ http.Header
  82453. }
  82454. // Delete: Deletes the specified license.
  82455. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  82456. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82457. c.project = project
  82458. c.license = license
  82459. return c
  82460. }
  82461. // RequestId sets the optional parameter "requestId": An optional
  82462. // request ID to identify requests. Specify a unique request ID so that
  82463. // if you must retry your request, the server will know to ignore the
  82464. // request if it has already been completed.
  82465. //
  82466. // For example, consider a situation where you make an initial request
  82467. // and the request times out. If you make the request again with the
  82468. // same request ID, the server can check if original operation with the
  82469. // same request ID was received, and if so, will ignore the second
  82470. // request. This prevents clients from accidentally creating duplicate
  82471. // commitments.
  82472. //
  82473. // The request ID must be a valid UUID with the exception that zero UUID
  82474. // is not supported (00000000-0000-0000-0000-000000000000).
  82475. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  82476. c.urlParams_.Set("requestId", requestId)
  82477. return c
  82478. }
  82479. // Fields allows partial responses to be retrieved. See
  82480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82481. // for more information.
  82482. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  82483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82484. return c
  82485. }
  82486. // Context sets the context to be used in this call's Do method. Any
  82487. // pending HTTP request will be aborted if the provided context is
  82488. // canceled.
  82489. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  82490. c.ctx_ = ctx
  82491. return c
  82492. }
  82493. // Header returns an http.Header that can be modified by the caller to
  82494. // add HTTP headers to the request.
  82495. func (c *LicensesDeleteCall) Header() http.Header {
  82496. if c.header_ == nil {
  82497. c.header_ = make(http.Header)
  82498. }
  82499. return c.header_
  82500. }
  82501. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  82502. reqHeaders := make(http.Header)
  82503. for k, v := range c.header_ {
  82504. reqHeaders[k] = v
  82505. }
  82506. reqHeaders.Set("User-Agent", c.s.userAgent())
  82507. var body io.Reader = nil
  82508. c.urlParams_.Set("alt", alt)
  82509. c.urlParams_.Set("prettyPrint", "false")
  82510. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  82511. urls += "?" + c.urlParams_.Encode()
  82512. req, err := http.NewRequest("DELETE", urls, body)
  82513. if err != nil {
  82514. return nil, err
  82515. }
  82516. req.Header = reqHeaders
  82517. googleapi.Expand(req.URL, map[string]string{
  82518. "project": c.project,
  82519. "license": c.license,
  82520. })
  82521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82522. }
  82523. // Do executes the "compute.licenses.delete" call.
  82524. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82525. // status code is an error. Response headers are in either
  82526. // *Operation.ServerResponse.Header or (if a response was returned at
  82527. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82528. // to check whether the returned error was because
  82529. // http.StatusNotModified was returned.
  82530. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82531. gensupport.SetOptions(c.urlParams_, opts...)
  82532. res, err := c.doRequest("json")
  82533. if res != nil && res.StatusCode == http.StatusNotModified {
  82534. if res.Body != nil {
  82535. res.Body.Close()
  82536. }
  82537. return nil, &googleapi.Error{
  82538. Code: res.StatusCode,
  82539. Header: res.Header,
  82540. }
  82541. }
  82542. if err != nil {
  82543. return nil, err
  82544. }
  82545. defer googleapi.CloseBody(res)
  82546. if err := googleapi.CheckResponse(res); err != nil {
  82547. return nil, err
  82548. }
  82549. ret := &Operation{
  82550. ServerResponse: googleapi.ServerResponse{
  82551. Header: res.Header,
  82552. HTTPStatusCode: res.StatusCode,
  82553. },
  82554. }
  82555. target := &ret
  82556. if err := gensupport.DecodeResponse(target, res); err != nil {
  82557. return nil, err
  82558. }
  82559. return ret, nil
  82560. // {
  82561. // "description": "Deletes the specified license.",
  82562. // "httpMethod": "DELETE",
  82563. // "id": "compute.licenses.delete",
  82564. // "parameterOrder": [
  82565. // "project",
  82566. // "license"
  82567. // ],
  82568. // "parameters": {
  82569. // "license": {
  82570. // "description": "Name of the license resource to delete.",
  82571. // "location": "path",
  82572. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82573. // "required": true,
  82574. // "type": "string"
  82575. // },
  82576. // "project": {
  82577. // "description": "Project ID for this request.",
  82578. // "location": "path",
  82579. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82580. // "required": true,
  82581. // "type": "string"
  82582. // },
  82583. // "requestId": {
  82584. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82585. // "location": "query",
  82586. // "type": "string"
  82587. // }
  82588. // },
  82589. // "path": "{project}/global/licenses/{license}",
  82590. // "response": {
  82591. // "$ref": "Operation"
  82592. // },
  82593. // "scopes": [
  82594. // "https://www.googleapis.com/auth/cloud-platform",
  82595. // "https://www.googleapis.com/auth/compute"
  82596. // ]
  82597. // }
  82598. }
  82599. // method id "compute.licenses.get":
  82600. type LicensesGetCall struct {
  82601. s *Service
  82602. project string
  82603. license string
  82604. urlParams_ gensupport.URLParams
  82605. ifNoneMatch_ string
  82606. ctx_ context.Context
  82607. header_ http.Header
  82608. }
  82609. // Get: Returns the specified License resource.
  82610. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  82611. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  82612. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82613. c.project = project
  82614. c.license = license
  82615. return c
  82616. }
  82617. // Fields allows partial responses to be retrieved. See
  82618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82619. // for more information.
  82620. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  82621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82622. return c
  82623. }
  82624. // IfNoneMatch sets the optional parameter which makes the operation
  82625. // fail if the object's ETag matches the given value. This is useful for
  82626. // getting updates only after the object has changed since the last
  82627. // request. Use googleapi.IsNotModified to check whether the response
  82628. // error from Do is the result of In-None-Match.
  82629. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  82630. c.ifNoneMatch_ = entityTag
  82631. return c
  82632. }
  82633. // Context sets the context to be used in this call's Do method. Any
  82634. // pending HTTP request will be aborted if the provided context is
  82635. // canceled.
  82636. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  82637. c.ctx_ = ctx
  82638. return c
  82639. }
  82640. // Header returns an http.Header that can be modified by the caller to
  82641. // add HTTP headers to the request.
  82642. func (c *LicensesGetCall) Header() http.Header {
  82643. if c.header_ == nil {
  82644. c.header_ = make(http.Header)
  82645. }
  82646. return c.header_
  82647. }
  82648. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  82649. reqHeaders := make(http.Header)
  82650. for k, v := range c.header_ {
  82651. reqHeaders[k] = v
  82652. }
  82653. reqHeaders.Set("User-Agent", c.s.userAgent())
  82654. if c.ifNoneMatch_ != "" {
  82655. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82656. }
  82657. var body io.Reader = nil
  82658. c.urlParams_.Set("alt", alt)
  82659. c.urlParams_.Set("prettyPrint", "false")
  82660. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  82661. urls += "?" + c.urlParams_.Encode()
  82662. req, err := http.NewRequest("GET", urls, body)
  82663. if err != nil {
  82664. return nil, err
  82665. }
  82666. req.Header = reqHeaders
  82667. googleapi.Expand(req.URL, map[string]string{
  82668. "project": c.project,
  82669. "license": c.license,
  82670. })
  82671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82672. }
  82673. // Do executes the "compute.licenses.get" call.
  82674. // Exactly one of *License or error will be non-nil. Any non-2xx status
  82675. // code is an error. Response headers are in either
  82676. // *License.ServerResponse.Header or (if a response was returned at all)
  82677. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  82678. // check whether the returned error was because http.StatusNotModified
  82679. // was returned.
  82680. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  82681. gensupport.SetOptions(c.urlParams_, opts...)
  82682. res, err := c.doRequest("json")
  82683. if res != nil && res.StatusCode == http.StatusNotModified {
  82684. if res.Body != nil {
  82685. res.Body.Close()
  82686. }
  82687. return nil, &googleapi.Error{
  82688. Code: res.StatusCode,
  82689. Header: res.Header,
  82690. }
  82691. }
  82692. if err != nil {
  82693. return nil, err
  82694. }
  82695. defer googleapi.CloseBody(res)
  82696. if err := googleapi.CheckResponse(res); err != nil {
  82697. return nil, err
  82698. }
  82699. ret := &License{
  82700. ServerResponse: googleapi.ServerResponse{
  82701. Header: res.Header,
  82702. HTTPStatusCode: res.StatusCode,
  82703. },
  82704. }
  82705. target := &ret
  82706. if err := gensupport.DecodeResponse(target, res); err != nil {
  82707. return nil, err
  82708. }
  82709. return ret, nil
  82710. // {
  82711. // "description": "Returns the specified License resource.",
  82712. // "httpMethod": "GET",
  82713. // "id": "compute.licenses.get",
  82714. // "parameterOrder": [
  82715. // "project",
  82716. // "license"
  82717. // ],
  82718. // "parameters": {
  82719. // "license": {
  82720. // "description": "Name of the License resource to return.",
  82721. // "location": "path",
  82722. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82723. // "required": true,
  82724. // "type": "string"
  82725. // },
  82726. // "project": {
  82727. // "description": "Project ID for this request.",
  82728. // "location": "path",
  82729. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82730. // "required": true,
  82731. // "type": "string"
  82732. // }
  82733. // },
  82734. // "path": "{project}/global/licenses/{license}",
  82735. // "response": {
  82736. // "$ref": "License"
  82737. // },
  82738. // "scopes": [
  82739. // "https://www.googleapis.com/auth/cloud-platform",
  82740. // "https://www.googleapis.com/auth/compute",
  82741. // "https://www.googleapis.com/auth/compute.readonly"
  82742. // ]
  82743. // }
  82744. }
  82745. // method id "compute.licenses.getIamPolicy":
  82746. type LicensesGetIamPolicyCall struct {
  82747. s *Service
  82748. project string
  82749. resource string
  82750. urlParams_ gensupport.URLParams
  82751. ifNoneMatch_ string
  82752. ctx_ context.Context
  82753. header_ http.Header
  82754. }
  82755. // GetIamPolicy: Gets the access control policy for a resource. May be
  82756. // empty if no such policy or resource exists.
  82757. func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall {
  82758. c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82759. c.project = project
  82760. c.resource = resource
  82761. return c
  82762. }
  82763. // Fields allows partial responses to be retrieved. See
  82764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82765. // for more information.
  82766. func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall {
  82767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82768. return c
  82769. }
  82770. // IfNoneMatch sets the optional parameter which makes the operation
  82771. // fail if the object's ETag matches the given value. This is useful for
  82772. // getting updates only after the object has changed since the last
  82773. // request. Use googleapi.IsNotModified to check whether the response
  82774. // error from Do is the result of In-None-Match.
  82775. func (c *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall {
  82776. c.ifNoneMatch_ = entityTag
  82777. return c
  82778. }
  82779. // Context sets the context to be used in this call's Do method. Any
  82780. // pending HTTP request will be aborted if the provided context is
  82781. // canceled.
  82782. func (c *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall {
  82783. c.ctx_ = ctx
  82784. return c
  82785. }
  82786. // Header returns an http.Header that can be modified by the caller to
  82787. // add HTTP headers to the request.
  82788. func (c *LicensesGetIamPolicyCall) Header() http.Header {
  82789. if c.header_ == nil {
  82790. c.header_ = make(http.Header)
  82791. }
  82792. return c.header_
  82793. }
  82794. func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  82795. reqHeaders := make(http.Header)
  82796. for k, v := range c.header_ {
  82797. reqHeaders[k] = v
  82798. }
  82799. reqHeaders.Set("User-Agent", c.s.userAgent())
  82800. if c.ifNoneMatch_ != "" {
  82801. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82802. }
  82803. var body io.Reader = nil
  82804. c.urlParams_.Set("alt", alt)
  82805. c.urlParams_.Set("prettyPrint", "false")
  82806. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/getIamPolicy")
  82807. urls += "?" + c.urlParams_.Encode()
  82808. req, err := http.NewRequest("GET", urls, body)
  82809. if err != nil {
  82810. return nil, err
  82811. }
  82812. req.Header = reqHeaders
  82813. googleapi.Expand(req.URL, map[string]string{
  82814. "project": c.project,
  82815. "resource": c.resource,
  82816. })
  82817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82818. }
  82819. // Do executes the "compute.licenses.getIamPolicy" call.
  82820. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  82821. // code is an error. Response headers are in either
  82822. // *Policy.ServerResponse.Header or (if a response was returned at all)
  82823. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  82824. // check whether the returned error was because http.StatusNotModified
  82825. // was returned.
  82826. func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  82827. gensupport.SetOptions(c.urlParams_, opts...)
  82828. res, err := c.doRequest("json")
  82829. if res != nil && res.StatusCode == http.StatusNotModified {
  82830. if res.Body != nil {
  82831. res.Body.Close()
  82832. }
  82833. return nil, &googleapi.Error{
  82834. Code: res.StatusCode,
  82835. Header: res.Header,
  82836. }
  82837. }
  82838. if err != nil {
  82839. return nil, err
  82840. }
  82841. defer googleapi.CloseBody(res)
  82842. if err := googleapi.CheckResponse(res); err != nil {
  82843. return nil, err
  82844. }
  82845. ret := &Policy{
  82846. ServerResponse: googleapi.ServerResponse{
  82847. Header: res.Header,
  82848. HTTPStatusCode: res.StatusCode,
  82849. },
  82850. }
  82851. target := &ret
  82852. if err := gensupport.DecodeResponse(target, res); err != nil {
  82853. return nil, err
  82854. }
  82855. return ret, nil
  82856. // {
  82857. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  82858. // "httpMethod": "GET",
  82859. // "id": "compute.licenses.getIamPolicy",
  82860. // "parameterOrder": [
  82861. // "project",
  82862. // "resource"
  82863. // ],
  82864. // "parameters": {
  82865. // "project": {
  82866. // "description": "Project ID for this request.",
  82867. // "location": "path",
  82868. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82869. // "required": true,
  82870. // "type": "string"
  82871. // },
  82872. // "resource": {
  82873. // "description": "Name or id of the resource for this request.",
  82874. // "location": "path",
  82875. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82876. // "required": true,
  82877. // "type": "string"
  82878. // }
  82879. // },
  82880. // "path": "{project}/global/licenses/{resource}/getIamPolicy",
  82881. // "response": {
  82882. // "$ref": "Policy"
  82883. // },
  82884. // "scopes": [
  82885. // "https://www.googleapis.com/auth/cloud-platform",
  82886. // "https://www.googleapis.com/auth/compute",
  82887. // "https://www.googleapis.com/auth/compute.readonly"
  82888. // ]
  82889. // }
  82890. }
  82891. // method id "compute.licenses.insert":
  82892. type LicensesInsertCall struct {
  82893. s *Service
  82894. project string
  82895. license *License
  82896. urlParams_ gensupport.URLParams
  82897. ctx_ context.Context
  82898. header_ http.Header
  82899. }
  82900. // Insert: Create a License resource in the specified project.
  82901. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  82902. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82903. c.project = project
  82904. c.license = license
  82905. return c
  82906. }
  82907. // RequestId sets the optional parameter "requestId": An optional
  82908. // request ID to identify requests. Specify a unique request ID so that
  82909. // if you must retry your request, the server will know to ignore the
  82910. // request if it has already been completed.
  82911. //
  82912. // For example, consider a situation where you make an initial request
  82913. // and the request times out. If you make the request again with the
  82914. // same request ID, the server can check if original operation with the
  82915. // same request ID was received, and if so, will ignore the second
  82916. // request. This prevents clients from accidentally creating duplicate
  82917. // commitments.
  82918. //
  82919. // The request ID must be a valid UUID with the exception that zero UUID
  82920. // is not supported (00000000-0000-0000-0000-000000000000).
  82921. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  82922. c.urlParams_.Set("requestId", requestId)
  82923. return c
  82924. }
  82925. // Fields allows partial responses to be retrieved. See
  82926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82927. // for more information.
  82928. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  82929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82930. return c
  82931. }
  82932. // Context sets the context to be used in this call's Do method. Any
  82933. // pending HTTP request will be aborted if the provided context is
  82934. // canceled.
  82935. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  82936. c.ctx_ = ctx
  82937. return c
  82938. }
  82939. // Header returns an http.Header that can be modified by the caller to
  82940. // add HTTP headers to the request.
  82941. func (c *LicensesInsertCall) Header() http.Header {
  82942. if c.header_ == nil {
  82943. c.header_ = make(http.Header)
  82944. }
  82945. return c.header_
  82946. }
  82947. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  82948. reqHeaders := make(http.Header)
  82949. for k, v := range c.header_ {
  82950. reqHeaders[k] = v
  82951. }
  82952. reqHeaders.Set("User-Agent", c.s.userAgent())
  82953. var body io.Reader = nil
  82954. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  82955. if err != nil {
  82956. return nil, err
  82957. }
  82958. reqHeaders.Set("Content-Type", "application/json")
  82959. c.urlParams_.Set("alt", alt)
  82960. c.urlParams_.Set("prettyPrint", "false")
  82961. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  82962. urls += "?" + c.urlParams_.Encode()
  82963. req, err := http.NewRequest("POST", urls, body)
  82964. if err != nil {
  82965. return nil, err
  82966. }
  82967. req.Header = reqHeaders
  82968. googleapi.Expand(req.URL, map[string]string{
  82969. "project": c.project,
  82970. })
  82971. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82972. }
  82973. // Do executes the "compute.licenses.insert" call.
  82974. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82975. // status code is an error. Response headers are in either
  82976. // *Operation.ServerResponse.Header or (if a response was returned at
  82977. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82978. // to check whether the returned error was because
  82979. // http.StatusNotModified was returned.
  82980. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82981. gensupport.SetOptions(c.urlParams_, opts...)
  82982. res, err := c.doRequest("json")
  82983. if res != nil && res.StatusCode == http.StatusNotModified {
  82984. if res.Body != nil {
  82985. res.Body.Close()
  82986. }
  82987. return nil, &googleapi.Error{
  82988. Code: res.StatusCode,
  82989. Header: res.Header,
  82990. }
  82991. }
  82992. if err != nil {
  82993. return nil, err
  82994. }
  82995. defer googleapi.CloseBody(res)
  82996. if err := googleapi.CheckResponse(res); err != nil {
  82997. return nil, err
  82998. }
  82999. ret := &Operation{
  83000. ServerResponse: googleapi.ServerResponse{
  83001. Header: res.Header,
  83002. HTTPStatusCode: res.StatusCode,
  83003. },
  83004. }
  83005. target := &ret
  83006. if err := gensupport.DecodeResponse(target, res); err != nil {
  83007. return nil, err
  83008. }
  83009. return ret, nil
  83010. // {
  83011. // "description": "Create a License resource in the specified project.",
  83012. // "httpMethod": "POST",
  83013. // "id": "compute.licenses.insert",
  83014. // "parameterOrder": [
  83015. // "project"
  83016. // ],
  83017. // "parameters": {
  83018. // "project": {
  83019. // "description": "Project ID for this request.",
  83020. // "location": "path",
  83021. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83022. // "required": true,
  83023. // "type": "string"
  83024. // },
  83025. // "requestId": {
  83026. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83027. // "location": "query",
  83028. // "type": "string"
  83029. // }
  83030. // },
  83031. // "path": "{project}/global/licenses",
  83032. // "request": {
  83033. // "$ref": "License"
  83034. // },
  83035. // "response": {
  83036. // "$ref": "Operation"
  83037. // },
  83038. // "scopes": [
  83039. // "https://www.googleapis.com/auth/cloud-platform",
  83040. // "https://www.googleapis.com/auth/compute",
  83041. // "https://www.googleapis.com/auth/devstorage.full_control",
  83042. // "https://www.googleapis.com/auth/devstorage.read_only",
  83043. // "https://www.googleapis.com/auth/devstorage.read_write"
  83044. // ]
  83045. // }
  83046. }
  83047. // method id "compute.licenses.list":
  83048. type LicensesListCall struct {
  83049. s *Service
  83050. project string
  83051. urlParams_ gensupport.URLParams
  83052. ifNoneMatch_ string
  83053. ctx_ context.Context
  83054. header_ http.Header
  83055. }
  83056. // List: Retrieves the list of licenses available in the specified
  83057. // project. This method does not get any licenses that belong to other
  83058. // projects, including licenses attached to publicly-available images,
  83059. // like Debian 9. If you want to get a list of publicly-available
  83060. // licenses, use this method to make a request to the respective image
  83061. // project, such as debian-cloud or windows-cloud.
  83062. func (r *LicensesService) List(project string) *LicensesListCall {
  83063. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83064. c.project = project
  83065. return c
  83066. }
  83067. // Filter sets the optional parameter "filter": A filter expression that
  83068. // filters resources listed in the response. The expression must specify
  83069. // the field name, a comparison operator, and the value that you want to
  83070. // use for filtering. The value must be a string, a number, or a
  83071. // boolean. The comparison operator must be either =, !=, >, or <.
  83072. //
  83073. // For example, if you are filtering Compute Engine instances, you can
  83074. // exclude instances named example-instance by specifying name !=
  83075. // example-instance.
  83076. //
  83077. // You can also filter nested fields. For example, you could specify
  83078. // scheduling.automaticRestart = false to include instances only if they
  83079. // are not scheduled for automatic restarts. You can use filtering on
  83080. // nested fields to filter based on resource labels.
  83081. //
  83082. // To filter on multiple expressions, provide each separate expression
  83083. // within parentheses. For example, (scheduling.automaticRestart = true)
  83084. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83085. // AND expression. However, you can include AND and OR expressions
  83086. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83087. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83088. // true).
  83089. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  83090. c.urlParams_.Set("filter", filter)
  83091. return c
  83092. }
  83093. // MaxResults sets the optional parameter "maxResults": The maximum
  83094. // number of results per page that should be returned. If the number of
  83095. // available results is larger than maxResults, Compute Engine returns a
  83096. // nextPageToken that can be used to get the next page of results in
  83097. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83098. // (Default: 500)
  83099. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  83100. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83101. return c
  83102. }
  83103. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83104. // a certain order. By default, results are returned in alphanumerical
  83105. // order based on the resource name.
  83106. //
  83107. // You can also sort results in descending order based on the creation
  83108. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83109. // based on the creationTimestamp field in reverse chronological order
  83110. // (newest result first). Use this to sort resources like operations so
  83111. // that the newest operation is returned first.
  83112. //
  83113. // Currently, only sorting by name or creationTimestamp desc is
  83114. // supported.
  83115. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  83116. c.urlParams_.Set("orderBy", orderBy)
  83117. return c
  83118. }
  83119. // PageToken sets the optional parameter "pageToken": Specifies a page
  83120. // token to use. Set pageToken to the nextPageToken returned by a
  83121. // previous list request to get the next page of results.
  83122. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  83123. c.urlParams_.Set("pageToken", pageToken)
  83124. return c
  83125. }
  83126. // Fields allows partial responses to be retrieved. See
  83127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83128. // for more information.
  83129. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  83130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83131. return c
  83132. }
  83133. // IfNoneMatch sets the optional parameter which makes the operation
  83134. // fail if the object's ETag matches the given value. This is useful for
  83135. // getting updates only after the object has changed since the last
  83136. // request. Use googleapi.IsNotModified to check whether the response
  83137. // error from Do is the result of In-None-Match.
  83138. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  83139. c.ifNoneMatch_ = entityTag
  83140. return c
  83141. }
  83142. // Context sets the context to be used in this call's Do method. Any
  83143. // pending HTTP request will be aborted if the provided context is
  83144. // canceled.
  83145. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  83146. c.ctx_ = ctx
  83147. return c
  83148. }
  83149. // Header returns an http.Header that can be modified by the caller to
  83150. // add HTTP headers to the request.
  83151. func (c *LicensesListCall) Header() http.Header {
  83152. if c.header_ == nil {
  83153. c.header_ = make(http.Header)
  83154. }
  83155. return c.header_
  83156. }
  83157. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  83158. reqHeaders := make(http.Header)
  83159. for k, v := range c.header_ {
  83160. reqHeaders[k] = v
  83161. }
  83162. reqHeaders.Set("User-Agent", c.s.userAgent())
  83163. if c.ifNoneMatch_ != "" {
  83164. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83165. }
  83166. var body io.Reader = nil
  83167. c.urlParams_.Set("alt", alt)
  83168. c.urlParams_.Set("prettyPrint", "false")
  83169. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  83170. urls += "?" + c.urlParams_.Encode()
  83171. req, err := http.NewRequest("GET", urls, body)
  83172. if err != nil {
  83173. return nil, err
  83174. }
  83175. req.Header = reqHeaders
  83176. googleapi.Expand(req.URL, map[string]string{
  83177. "project": c.project,
  83178. })
  83179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83180. }
  83181. // Do executes the "compute.licenses.list" call.
  83182. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  83183. // non-2xx status code is an error. Response headers are in either
  83184. // *LicensesListResponse.ServerResponse.Header or (if a response was
  83185. // returned at all) in error.(*googleapi.Error).Header. Use
  83186. // googleapi.IsNotModified to check whether the returned error was
  83187. // because http.StatusNotModified was returned.
  83188. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  83189. gensupport.SetOptions(c.urlParams_, opts...)
  83190. res, err := c.doRequest("json")
  83191. if res != nil && res.StatusCode == http.StatusNotModified {
  83192. if res.Body != nil {
  83193. res.Body.Close()
  83194. }
  83195. return nil, &googleapi.Error{
  83196. Code: res.StatusCode,
  83197. Header: res.Header,
  83198. }
  83199. }
  83200. if err != nil {
  83201. return nil, err
  83202. }
  83203. defer googleapi.CloseBody(res)
  83204. if err := googleapi.CheckResponse(res); err != nil {
  83205. return nil, err
  83206. }
  83207. ret := &LicensesListResponse{
  83208. ServerResponse: googleapi.ServerResponse{
  83209. Header: res.Header,
  83210. HTTPStatusCode: res.StatusCode,
  83211. },
  83212. }
  83213. target := &ret
  83214. if err := gensupport.DecodeResponse(target, res); err != nil {
  83215. return nil, err
  83216. }
  83217. return ret, nil
  83218. // {
  83219. // "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.",
  83220. // "httpMethod": "GET",
  83221. // "id": "compute.licenses.list",
  83222. // "parameterOrder": [
  83223. // "project"
  83224. // ],
  83225. // "parameters": {
  83226. // "filter": {
  83227. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  83228. // "location": "query",
  83229. // "type": "string"
  83230. // },
  83231. // "maxResults": {
  83232. // "default": "500",
  83233. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  83234. // "format": "uint32",
  83235. // "location": "query",
  83236. // "minimum": "0",
  83237. // "type": "integer"
  83238. // },
  83239. // "orderBy": {
  83240. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  83241. // "location": "query",
  83242. // "type": "string"
  83243. // },
  83244. // "pageToken": {
  83245. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  83246. // "location": "query",
  83247. // "type": "string"
  83248. // },
  83249. // "project": {
  83250. // "description": "Project ID for this request.",
  83251. // "location": "path",
  83252. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83253. // "required": true,
  83254. // "type": "string"
  83255. // }
  83256. // },
  83257. // "path": "{project}/global/licenses",
  83258. // "response": {
  83259. // "$ref": "LicensesListResponse"
  83260. // },
  83261. // "scopes": [
  83262. // "https://www.googleapis.com/auth/cloud-platform",
  83263. // "https://www.googleapis.com/auth/compute",
  83264. // "https://www.googleapis.com/auth/compute.readonly"
  83265. // ]
  83266. // }
  83267. }
  83268. // Pages invokes f for each page of results.
  83269. // A non-nil error returned from f will halt the iteration.
  83270. // The provided context supersedes any context provided to the Context method.
  83271. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  83272. c.ctx_ = ctx
  83273. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  83274. for {
  83275. x, err := c.Do()
  83276. if err != nil {
  83277. return err
  83278. }
  83279. if err := f(x); err != nil {
  83280. return err
  83281. }
  83282. if x.NextPageToken == "" {
  83283. return nil
  83284. }
  83285. c.PageToken(x.NextPageToken)
  83286. }
  83287. }
  83288. // method id "compute.licenses.setIamPolicy":
  83289. type LicensesSetIamPolicyCall struct {
  83290. s *Service
  83291. project string
  83292. resource string
  83293. globalsetpolicyrequest *GlobalSetPolicyRequest
  83294. urlParams_ gensupport.URLParams
  83295. ctx_ context.Context
  83296. header_ http.Header
  83297. }
  83298. // SetIamPolicy: Sets the access control policy on the specified
  83299. // resource. Replaces any existing policy.
  83300. func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall {
  83301. c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83302. c.project = project
  83303. c.resource = resource
  83304. c.globalsetpolicyrequest = globalsetpolicyrequest
  83305. return c
  83306. }
  83307. // Fields allows partial responses to be retrieved. See
  83308. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83309. // for more information.
  83310. func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall {
  83311. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83312. return c
  83313. }
  83314. // Context sets the context to be used in this call's Do method. Any
  83315. // pending HTTP request will be aborted if the provided context is
  83316. // canceled.
  83317. func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall {
  83318. c.ctx_ = ctx
  83319. return c
  83320. }
  83321. // Header returns an http.Header that can be modified by the caller to
  83322. // add HTTP headers to the request.
  83323. func (c *LicensesSetIamPolicyCall) Header() http.Header {
  83324. if c.header_ == nil {
  83325. c.header_ = make(http.Header)
  83326. }
  83327. return c.header_
  83328. }
  83329. func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  83330. reqHeaders := make(http.Header)
  83331. for k, v := range c.header_ {
  83332. reqHeaders[k] = v
  83333. }
  83334. reqHeaders.Set("User-Agent", c.s.userAgent())
  83335. var body io.Reader = nil
  83336. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  83337. if err != nil {
  83338. return nil, err
  83339. }
  83340. reqHeaders.Set("Content-Type", "application/json")
  83341. c.urlParams_.Set("alt", alt)
  83342. c.urlParams_.Set("prettyPrint", "false")
  83343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/setIamPolicy")
  83344. urls += "?" + c.urlParams_.Encode()
  83345. req, err := http.NewRequest("POST", urls, body)
  83346. if err != nil {
  83347. return nil, err
  83348. }
  83349. req.Header = reqHeaders
  83350. googleapi.Expand(req.URL, map[string]string{
  83351. "project": c.project,
  83352. "resource": c.resource,
  83353. })
  83354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83355. }
  83356. // Do executes the "compute.licenses.setIamPolicy" call.
  83357. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  83358. // code is an error. Response headers are in either
  83359. // *Policy.ServerResponse.Header or (if a response was returned at all)
  83360. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  83361. // check whether the returned error was because http.StatusNotModified
  83362. // was returned.
  83363. func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  83364. gensupport.SetOptions(c.urlParams_, opts...)
  83365. res, err := c.doRequest("json")
  83366. if res != nil && res.StatusCode == http.StatusNotModified {
  83367. if res.Body != nil {
  83368. res.Body.Close()
  83369. }
  83370. return nil, &googleapi.Error{
  83371. Code: res.StatusCode,
  83372. Header: res.Header,
  83373. }
  83374. }
  83375. if err != nil {
  83376. return nil, err
  83377. }
  83378. defer googleapi.CloseBody(res)
  83379. if err := googleapi.CheckResponse(res); err != nil {
  83380. return nil, err
  83381. }
  83382. ret := &Policy{
  83383. ServerResponse: googleapi.ServerResponse{
  83384. Header: res.Header,
  83385. HTTPStatusCode: res.StatusCode,
  83386. },
  83387. }
  83388. target := &ret
  83389. if err := gensupport.DecodeResponse(target, res); err != nil {
  83390. return nil, err
  83391. }
  83392. return ret, nil
  83393. // {
  83394. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  83395. // "httpMethod": "POST",
  83396. // "id": "compute.licenses.setIamPolicy",
  83397. // "parameterOrder": [
  83398. // "project",
  83399. // "resource"
  83400. // ],
  83401. // "parameters": {
  83402. // "project": {
  83403. // "description": "Project ID for this request.",
  83404. // "location": "path",
  83405. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83406. // "required": true,
  83407. // "type": "string"
  83408. // },
  83409. // "resource": {
  83410. // "description": "Name or id of the resource for this request.",
  83411. // "location": "path",
  83412. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83413. // "required": true,
  83414. // "type": "string"
  83415. // }
  83416. // },
  83417. // "path": "{project}/global/licenses/{resource}/setIamPolicy",
  83418. // "request": {
  83419. // "$ref": "GlobalSetPolicyRequest"
  83420. // },
  83421. // "response": {
  83422. // "$ref": "Policy"
  83423. // },
  83424. // "scopes": [
  83425. // "https://www.googleapis.com/auth/cloud-platform",
  83426. // "https://www.googleapis.com/auth/compute"
  83427. // ]
  83428. // }
  83429. }
  83430. // method id "compute.licenses.testIamPermissions":
  83431. type LicensesTestIamPermissionsCall struct {
  83432. s *Service
  83433. project string
  83434. resource string
  83435. testpermissionsrequest *TestPermissionsRequest
  83436. urlParams_ gensupport.URLParams
  83437. ctx_ context.Context
  83438. header_ http.Header
  83439. }
  83440. // TestIamPermissions: Returns permissions that a caller has on the
  83441. // specified resource.
  83442. func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall {
  83443. c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83444. c.project = project
  83445. c.resource = resource
  83446. c.testpermissionsrequest = testpermissionsrequest
  83447. return c
  83448. }
  83449. // Fields allows partial responses to be retrieved. See
  83450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83451. // for more information.
  83452. func (c *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall {
  83453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83454. return c
  83455. }
  83456. // Context sets the context to be used in this call's Do method. Any
  83457. // pending HTTP request will be aborted if the provided context is
  83458. // canceled.
  83459. func (c *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall {
  83460. c.ctx_ = ctx
  83461. return c
  83462. }
  83463. // Header returns an http.Header that can be modified by the caller to
  83464. // add HTTP headers to the request.
  83465. func (c *LicensesTestIamPermissionsCall) Header() http.Header {
  83466. if c.header_ == nil {
  83467. c.header_ = make(http.Header)
  83468. }
  83469. return c.header_
  83470. }
  83471. func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  83472. reqHeaders := make(http.Header)
  83473. for k, v := range c.header_ {
  83474. reqHeaders[k] = v
  83475. }
  83476. reqHeaders.Set("User-Agent", c.s.userAgent())
  83477. var body io.Reader = nil
  83478. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  83479. if err != nil {
  83480. return nil, err
  83481. }
  83482. reqHeaders.Set("Content-Type", "application/json")
  83483. c.urlParams_.Set("alt", alt)
  83484. c.urlParams_.Set("prettyPrint", "false")
  83485. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/testIamPermissions")
  83486. urls += "?" + c.urlParams_.Encode()
  83487. req, err := http.NewRequest("POST", urls, body)
  83488. if err != nil {
  83489. return nil, err
  83490. }
  83491. req.Header = reqHeaders
  83492. googleapi.Expand(req.URL, map[string]string{
  83493. "project": c.project,
  83494. "resource": c.resource,
  83495. })
  83496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83497. }
  83498. // Do executes the "compute.licenses.testIamPermissions" call.
  83499. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  83500. // non-2xx status code is an error. Response headers are in either
  83501. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  83502. // returned at all) in error.(*googleapi.Error).Header. Use
  83503. // googleapi.IsNotModified to check whether the returned error was
  83504. // because http.StatusNotModified was returned.
  83505. func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  83506. gensupport.SetOptions(c.urlParams_, opts...)
  83507. res, err := c.doRequest("json")
  83508. if res != nil && res.StatusCode == http.StatusNotModified {
  83509. if res.Body != nil {
  83510. res.Body.Close()
  83511. }
  83512. return nil, &googleapi.Error{
  83513. Code: res.StatusCode,
  83514. Header: res.Header,
  83515. }
  83516. }
  83517. if err != nil {
  83518. return nil, err
  83519. }
  83520. defer googleapi.CloseBody(res)
  83521. if err := googleapi.CheckResponse(res); err != nil {
  83522. return nil, err
  83523. }
  83524. ret := &TestPermissionsResponse{
  83525. ServerResponse: googleapi.ServerResponse{
  83526. Header: res.Header,
  83527. HTTPStatusCode: res.StatusCode,
  83528. },
  83529. }
  83530. target := &ret
  83531. if err := gensupport.DecodeResponse(target, res); err != nil {
  83532. return nil, err
  83533. }
  83534. return ret, nil
  83535. // {
  83536. // "description": "Returns permissions that a caller has on the specified resource.",
  83537. // "httpMethod": "POST",
  83538. // "id": "compute.licenses.testIamPermissions",
  83539. // "parameterOrder": [
  83540. // "project",
  83541. // "resource"
  83542. // ],
  83543. // "parameters": {
  83544. // "project": {
  83545. // "description": "Project ID for this request.",
  83546. // "location": "path",
  83547. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83548. // "required": true,
  83549. // "type": "string"
  83550. // },
  83551. // "resource": {
  83552. // "description": "Name or id of the resource for this request.",
  83553. // "location": "path",
  83554. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83555. // "required": true,
  83556. // "type": "string"
  83557. // }
  83558. // },
  83559. // "path": "{project}/global/licenses/{resource}/testIamPermissions",
  83560. // "request": {
  83561. // "$ref": "TestPermissionsRequest"
  83562. // },
  83563. // "response": {
  83564. // "$ref": "TestPermissionsResponse"
  83565. // },
  83566. // "scopes": [
  83567. // "https://www.googleapis.com/auth/cloud-platform",
  83568. // "https://www.googleapis.com/auth/compute",
  83569. // "https://www.googleapis.com/auth/compute.readonly"
  83570. // ]
  83571. // }
  83572. }
  83573. // method id "compute.machineImages.delete":
  83574. type MachineImagesDeleteCall struct {
  83575. s *Service
  83576. project string
  83577. machineImage string
  83578. urlParams_ gensupport.URLParams
  83579. ctx_ context.Context
  83580. header_ http.Header
  83581. }
  83582. // Delete: Deletes the specified machine image. Deleting a machine image
  83583. // is permanent and cannot be undone.
  83584. func (r *MachineImagesService) Delete(project string, machineImage string) *MachineImagesDeleteCall {
  83585. c := &MachineImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83586. c.project = project
  83587. c.machineImage = machineImage
  83588. return c
  83589. }
  83590. // RequestId sets the optional parameter "requestId": An optional
  83591. // request ID to identify requests. Specify a unique request ID so that
  83592. // if you must retry your request, the server will know to ignore the
  83593. // request if it has already been completed.
  83594. //
  83595. // For example, consider a situation where you make an initial request
  83596. // and the request times out. If you make the request again with the
  83597. // same request ID, the server can check if original operation with the
  83598. // same request ID was received, and if so, will ignore the second
  83599. // request. This prevents clients from accidentally creating duplicate
  83600. // commitments.
  83601. //
  83602. // The request ID must be a valid UUID with the exception that zero UUID
  83603. // is not supported (00000000-0000-0000-0000-000000000000).
  83604. func (c *MachineImagesDeleteCall) RequestId(requestId string) *MachineImagesDeleteCall {
  83605. c.urlParams_.Set("requestId", requestId)
  83606. return c
  83607. }
  83608. // Fields allows partial responses to be retrieved. See
  83609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83610. // for more information.
  83611. func (c *MachineImagesDeleteCall) Fields(s ...googleapi.Field) *MachineImagesDeleteCall {
  83612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83613. return c
  83614. }
  83615. // Context sets the context to be used in this call's Do method. Any
  83616. // pending HTTP request will be aborted if the provided context is
  83617. // canceled.
  83618. func (c *MachineImagesDeleteCall) Context(ctx context.Context) *MachineImagesDeleteCall {
  83619. c.ctx_ = ctx
  83620. return c
  83621. }
  83622. // Header returns an http.Header that can be modified by the caller to
  83623. // add HTTP headers to the request.
  83624. func (c *MachineImagesDeleteCall) Header() http.Header {
  83625. if c.header_ == nil {
  83626. c.header_ = make(http.Header)
  83627. }
  83628. return c.header_
  83629. }
  83630. func (c *MachineImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  83631. reqHeaders := make(http.Header)
  83632. for k, v := range c.header_ {
  83633. reqHeaders[k] = v
  83634. }
  83635. reqHeaders.Set("User-Agent", c.s.userAgent())
  83636. var body io.Reader = nil
  83637. c.urlParams_.Set("alt", alt)
  83638. c.urlParams_.Set("prettyPrint", "false")
  83639. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{machineImage}")
  83640. urls += "?" + c.urlParams_.Encode()
  83641. req, err := http.NewRequest("DELETE", urls, body)
  83642. if err != nil {
  83643. return nil, err
  83644. }
  83645. req.Header = reqHeaders
  83646. googleapi.Expand(req.URL, map[string]string{
  83647. "project": c.project,
  83648. "machineImage": c.machineImage,
  83649. })
  83650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83651. }
  83652. // Do executes the "compute.machineImages.delete" call.
  83653. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83654. // status code is an error. Response headers are in either
  83655. // *Operation.ServerResponse.Header or (if a response was returned at
  83656. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83657. // to check whether the returned error was because
  83658. // http.StatusNotModified was returned.
  83659. func (c *MachineImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83660. gensupport.SetOptions(c.urlParams_, opts...)
  83661. res, err := c.doRequest("json")
  83662. if res != nil && res.StatusCode == http.StatusNotModified {
  83663. if res.Body != nil {
  83664. res.Body.Close()
  83665. }
  83666. return nil, &googleapi.Error{
  83667. Code: res.StatusCode,
  83668. Header: res.Header,
  83669. }
  83670. }
  83671. if err != nil {
  83672. return nil, err
  83673. }
  83674. defer googleapi.CloseBody(res)
  83675. if err := googleapi.CheckResponse(res); err != nil {
  83676. return nil, err
  83677. }
  83678. ret := &Operation{
  83679. ServerResponse: googleapi.ServerResponse{
  83680. Header: res.Header,
  83681. HTTPStatusCode: res.StatusCode,
  83682. },
  83683. }
  83684. target := &ret
  83685. if err := gensupport.DecodeResponse(target, res); err != nil {
  83686. return nil, err
  83687. }
  83688. return ret, nil
  83689. // {
  83690. // "description": "Deletes the specified machine image. Deleting a machine image is permanent and cannot be undone.",
  83691. // "httpMethod": "DELETE",
  83692. // "id": "compute.machineImages.delete",
  83693. // "parameterOrder": [
  83694. // "project",
  83695. // "machineImage"
  83696. // ],
  83697. // "parameters": {
  83698. // "machineImage": {
  83699. // "description": "The name of the machine image to delete.",
  83700. // "location": "path",
  83701. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83702. // "required": true,
  83703. // "type": "string"
  83704. // },
  83705. // "project": {
  83706. // "description": "Project ID for this request.",
  83707. // "location": "path",
  83708. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83709. // "required": true,
  83710. // "type": "string"
  83711. // },
  83712. // "requestId": {
  83713. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83714. // "location": "query",
  83715. // "type": "string"
  83716. // }
  83717. // },
  83718. // "path": "{project}/global/machineImages/{machineImage}",
  83719. // "response": {
  83720. // "$ref": "Operation"
  83721. // },
  83722. // "scopes": [
  83723. // "https://www.googleapis.com/auth/cloud-platform",
  83724. // "https://www.googleapis.com/auth/compute"
  83725. // ]
  83726. // }
  83727. }
  83728. // method id "compute.machineImages.get":
  83729. type MachineImagesGetCall struct {
  83730. s *Service
  83731. project string
  83732. machineImage string
  83733. urlParams_ gensupport.URLParams
  83734. ifNoneMatch_ string
  83735. ctx_ context.Context
  83736. header_ http.Header
  83737. }
  83738. // Get: Returns the specified machine image. Gets a list of available
  83739. // machine images by making a list() request.
  83740. func (r *MachineImagesService) Get(project string, machineImage string) *MachineImagesGetCall {
  83741. c := &MachineImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83742. c.project = project
  83743. c.machineImage = machineImage
  83744. return c
  83745. }
  83746. // Fields allows partial responses to be retrieved. See
  83747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83748. // for more information.
  83749. func (c *MachineImagesGetCall) Fields(s ...googleapi.Field) *MachineImagesGetCall {
  83750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83751. return c
  83752. }
  83753. // IfNoneMatch sets the optional parameter which makes the operation
  83754. // fail if the object's ETag matches the given value. This is useful for
  83755. // getting updates only after the object has changed since the last
  83756. // request. Use googleapi.IsNotModified to check whether the response
  83757. // error from Do is the result of In-None-Match.
  83758. func (c *MachineImagesGetCall) IfNoneMatch(entityTag string) *MachineImagesGetCall {
  83759. c.ifNoneMatch_ = entityTag
  83760. return c
  83761. }
  83762. // Context sets the context to be used in this call's Do method. Any
  83763. // pending HTTP request will be aborted if the provided context is
  83764. // canceled.
  83765. func (c *MachineImagesGetCall) Context(ctx context.Context) *MachineImagesGetCall {
  83766. c.ctx_ = ctx
  83767. return c
  83768. }
  83769. // Header returns an http.Header that can be modified by the caller to
  83770. // add HTTP headers to the request.
  83771. func (c *MachineImagesGetCall) Header() http.Header {
  83772. if c.header_ == nil {
  83773. c.header_ = make(http.Header)
  83774. }
  83775. return c.header_
  83776. }
  83777. func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) {
  83778. reqHeaders := make(http.Header)
  83779. for k, v := range c.header_ {
  83780. reqHeaders[k] = v
  83781. }
  83782. reqHeaders.Set("User-Agent", c.s.userAgent())
  83783. if c.ifNoneMatch_ != "" {
  83784. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83785. }
  83786. var body io.Reader = nil
  83787. c.urlParams_.Set("alt", alt)
  83788. c.urlParams_.Set("prettyPrint", "false")
  83789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{machineImage}")
  83790. urls += "?" + c.urlParams_.Encode()
  83791. req, err := http.NewRequest("GET", urls, body)
  83792. if err != nil {
  83793. return nil, err
  83794. }
  83795. req.Header = reqHeaders
  83796. googleapi.Expand(req.URL, map[string]string{
  83797. "project": c.project,
  83798. "machineImage": c.machineImage,
  83799. })
  83800. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83801. }
  83802. // Do executes the "compute.machineImages.get" call.
  83803. // Exactly one of *MachineImage or error will be non-nil. Any non-2xx
  83804. // status code is an error. Response headers are in either
  83805. // *MachineImage.ServerResponse.Header or (if a response was returned at
  83806. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83807. // to check whether the returned error was because
  83808. // http.StatusNotModified was returned.
  83809. func (c *MachineImagesGetCall) Do(opts ...googleapi.CallOption) (*MachineImage, error) {
  83810. gensupport.SetOptions(c.urlParams_, opts...)
  83811. res, err := c.doRequest("json")
  83812. if res != nil && res.StatusCode == http.StatusNotModified {
  83813. if res.Body != nil {
  83814. res.Body.Close()
  83815. }
  83816. return nil, &googleapi.Error{
  83817. Code: res.StatusCode,
  83818. Header: res.Header,
  83819. }
  83820. }
  83821. if err != nil {
  83822. return nil, err
  83823. }
  83824. defer googleapi.CloseBody(res)
  83825. if err := googleapi.CheckResponse(res); err != nil {
  83826. return nil, err
  83827. }
  83828. ret := &MachineImage{
  83829. ServerResponse: googleapi.ServerResponse{
  83830. Header: res.Header,
  83831. HTTPStatusCode: res.StatusCode,
  83832. },
  83833. }
  83834. target := &ret
  83835. if err := gensupport.DecodeResponse(target, res); err != nil {
  83836. return nil, err
  83837. }
  83838. return ret, nil
  83839. // {
  83840. // "description": "Returns the specified machine image. Gets a list of available machine images by making a list() request.",
  83841. // "httpMethod": "GET",
  83842. // "id": "compute.machineImages.get",
  83843. // "parameterOrder": [
  83844. // "project",
  83845. // "machineImage"
  83846. // ],
  83847. // "parameters": {
  83848. // "machineImage": {
  83849. // "description": "The name of the machine image.",
  83850. // "location": "path",
  83851. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83852. // "required": true,
  83853. // "type": "string"
  83854. // },
  83855. // "project": {
  83856. // "description": "Project ID for this request.",
  83857. // "location": "path",
  83858. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83859. // "required": true,
  83860. // "type": "string"
  83861. // }
  83862. // },
  83863. // "path": "{project}/global/machineImages/{machineImage}",
  83864. // "response": {
  83865. // "$ref": "MachineImage"
  83866. // },
  83867. // "scopes": [
  83868. // "https://www.googleapis.com/auth/cloud-platform",
  83869. // "https://www.googleapis.com/auth/compute",
  83870. // "https://www.googleapis.com/auth/compute.readonly"
  83871. // ]
  83872. // }
  83873. }
  83874. // method id "compute.machineImages.getIamPolicy":
  83875. type MachineImagesGetIamPolicyCall struct {
  83876. s *Service
  83877. project string
  83878. resource string
  83879. urlParams_ gensupport.URLParams
  83880. ifNoneMatch_ string
  83881. ctx_ context.Context
  83882. header_ http.Header
  83883. }
  83884. // GetIamPolicy: Gets the access control policy for a resource. May be
  83885. // empty if no such policy or resource exists.
  83886. func (r *MachineImagesService) GetIamPolicy(project string, resource string) *MachineImagesGetIamPolicyCall {
  83887. c := &MachineImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83888. c.project = project
  83889. c.resource = resource
  83890. return c
  83891. }
  83892. // Fields allows partial responses to be retrieved. See
  83893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83894. // for more information.
  83895. func (c *MachineImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesGetIamPolicyCall {
  83896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83897. return c
  83898. }
  83899. // IfNoneMatch sets the optional parameter which makes the operation
  83900. // fail if the object's ETag matches the given value. This is useful for
  83901. // getting updates only after the object has changed since the last
  83902. // request. Use googleapi.IsNotModified to check whether the response
  83903. // error from Do is the result of In-None-Match.
  83904. func (c *MachineImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *MachineImagesGetIamPolicyCall {
  83905. c.ifNoneMatch_ = entityTag
  83906. return c
  83907. }
  83908. // Context sets the context to be used in this call's Do method. Any
  83909. // pending HTTP request will be aborted if the provided context is
  83910. // canceled.
  83911. func (c *MachineImagesGetIamPolicyCall) Context(ctx context.Context) *MachineImagesGetIamPolicyCall {
  83912. c.ctx_ = ctx
  83913. return c
  83914. }
  83915. // Header returns an http.Header that can be modified by the caller to
  83916. // add HTTP headers to the request.
  83917. func (c *MachineImagesGetIamPolicyCall) Header() http.Header {
  83918. if c.header_ == nil {
  83919. c.header_ = make(http.Header)
  83920. }
  83921. return c.header_
  83922. }
  83923. func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  83924. reqHeaders := make(http.Header)
  83925. for k, v := range c.header_ {
  83926. reqHeaders[k] = v
  83927. }
  83928. reqHeaders.Set("User-Agent", c.s.userAgent())
  83929. if c.ifNoneMatch_ != "" {
  83930. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83931. }
  83932. var body io.Reader = nil
  83933. c.urlParams_.Set("alt", alt)
  83934. c.urlParams_.Set("prettyPrint", "false")
  83935. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{resource}/getIamPolicy")
  83936. urls += "?" + c.urlParams_.Encode()
  83937. req, err := http.NewRequest("GET", urls, body)
  83938. if err != nil {
  83939. return nil, err
  83940. }
  83941. req.Header = reqHeaders
  83942. googleapi.Expand(req.URL, map[string]string{
  83943. "project": c.project,
  83944. "resource": c.resource,
  83945. })
  83946. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83947. }
  83948. // Do executes the "compute.machineImages.getIamPolicy" call.
  83949. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  83950. // code is an error. Response headers are in either
  83951. // *Policy.ServerResponse.Header or (if a response was returned at all)
  83952. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  83953. // check whether the returned error was because http.StatusNotModified
  83954. // was returned.
  83955. func (c *MachineImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  83956. gensupport.SetOptions(c.urlParams_, opts...)
  83957. res, err := c.doRequest("json")
  83958. if res != nil && res.StatusCode == http.StatusNotModified {
  83959. if res.Body != nil {
  83960. res.Body.Close()
  83961. }
  83962. return nil, &googleapi.Error{
  83963. Code: res.StatusCode,
  83964. Header: res.Header,
  83965. }
  83966. }
  83967. if err != nil {
  83968. return nil, err
  83969. }
  83970. defer googleapi.CloseBody(res)
  83971. if err := googleapi.CheckResponse(res); err != nil {
  83972. return nil, err
  83973. }
  83974. ret := &Policy{
  83975. ServerResponse: googleapi.ServerResponse{
  83976. Header: res.Header,
  83977. HTTPStatusCode: res.StatusCode,
  83978. },
  83979. }
  83980. target := &ret
  83981. if err := gensupport.DecodeResponse(target, res); err != nil {
  83982. return nil, err
  83983. }
  83984. return ret, nil
  83985. // {
  83986. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  83987. // "httpMethod": "GET",
  83988. // "id": "compute.machineImages.getIamPolicy",
  83989. // "parameterOrder": [
  83990. // "project",
  83991. // "resource"
  83992. // ],
  83993. // "parameters": {
  83994. // "project": {
  83995. // "description": "Project ID for this request.",
  83996. // "location": "path",
  83997. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83998. // "required": true,
  83999. // "type": "string"
  84000. // },
  84001. // "resource": {
  84002. // "description": "Name or id of the resource for this request.",
  84003. // "location": "path",
  84004. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84005. // "required": true,
  84006. // "type": "string"
  84007. // }
  84008. // },
  84009. // "path": "{project}/global/machineImages/{resource}/getIamPolicy",
  84010. // "response": {
  84011. // "$ref": "Policy"
  84012. // },
  84013. // "scopes": [
  84014. // "https://www.googleapis.com/auth/cloud-platform",
  84015. // "https://www.googleapis.com/auth/compute",
  84016. // "https://www.googleapis.com/auth/compute.readonly"
  84017. // ]
  84018. // }
  84019. }
  84020. // method id "compute.machineImages.insert":
  84021. type MachineImagesInsertCall struct {
  84022. s *Service
  84023. project string
  84024. machineimage *MachineImage
  84025. urlParams_ gensupport.URLParams
  84026. ctx_ context.Context
  84027. header_ http.Header
  84028. }
  84029. // Insert: Creates a machine image in the specified project using the
  84030. // data that is included in the request. If you are creating a new
  84031. // machine image to update an existing instance, your new machine image
  84032. // should use the same network or, if applicable, the same subnetwork as
  84033. // the original instance.
  84034. func (r *MachineImagesService) Insert(project string, machineimage *MachineImage) *MachineImagesInsertCall {
  84035. c := &MachineImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84036. c.project = project
  84037. c.machineimage = machineimage
  84038. return c
  84039. }
  84040. // RequestId sets the optional parameter "requestId": An optional
  84041. // request ID to identify requests. Specify a unique request ID so that
  84042. // if you must retry your request, the server will know to ignore the
  84043. // request if it has already been completed.
  84044. //
  84045. // For example, consider a situation where you make an initial request
  84046. // and the request times out. If you make the request again with the
  84047. // same request ID, the server can check if original operation with the
  84048. // same request ID was received, and if so, will ignore the second
  84049. // request. This prevents clients from accidentally creating duplicate
  84050. // commitments.
  84051. //
  84052. // The request ID must be a valid UUID with the exception that zero UUID
  84053. // is not supported (00000000-0000-0000-0000-000000000000).
  84054. func (c *MachineImagesInsertCall) RequestId(requestId string) *MachineImagesInsertCall {
  84055. c.urlParams_.Set("requestId", requestId)
  84056. return c
  84057. }
  84058. // SourceInstance sets the optional parameter "sourceInstance":
  84059. // Required. Source instance that is used to create the machine image
  84060. // from.
  84061. func (c *MachineImagesInsertCall) SourceInstance(sourceInstance string) *MachineImagesInsertCall {
  84062. c.urlParams_.Set("sourceInstance", sourceInstance)
  84063. return c
  84064. }
  84065. // Fields allows partial responses to be retrieved. See
  84066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84067. // for more information.
  84068. func (c *MachineImagesInsertCall) Fields(s ...googleapi.Field) *MachineImagesInsertCall {
  84069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84070. return c
  84071. }
  84072. // Context sets the context to be used in this call's Do method. Any
  84073. // pending HTTP request will be aborted if the provided context is
  84074. // canceled.
  84075. func (c *MachineImagesInsertCall) Context(ctx context.Context) *MachineImagesInsertCall {
  84076. c.ctx_ = ctx
  84077. return c
  84078. }
  84079. // Header returns an http.Header that can be modified by the caller to
  84080. // add HTTP headers to the request.
  84081. func (c *MachineImagesInsertCall) Header() http.Header {
  84082. if c.header_ == nil {
  84083. c.header_ = make(http.Header)
  84084. }
  84085. return c.header_
  84086. }
  84087. func (c *MachineImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  84088. reqHeaders := make(http.Header)
  84089. for k, v := range c.header_ {
  84090. reqHeaders[k] = v
  84091. }
  84092. reqHeaders.Set("User-Agent", c.s.userAgent())
  84093. var body io.Reader = nil
  84094. body, err := googleapi.WithoutDataWrapper.JSONReader(c.machineimage)
  84095. if err != nil {
  84096. return nil, err
  84097. }
  84098. reqHeaders.Set("Content-Type", "application/json")
  84099. c.urlParams_.Set("alt", alt)
  84100. c.urlParams_.Set("prettyPrint", "false")
  84101. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages")
  84102. urls += "?" + c.urlParams_.Encode()
  84103. req, err := http.NewRequest("POST", urls, body)
  84104. if err != nil {
  84105. return nil, err
  84106. }
  84107. req.Header = reqHeaders
  84108. googleapi.Expand(req.URL, map[string]string{
  84109. "project": c.project,
  84110. })
  84111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84112. }
  84113. // Do executes the "compute.machineImages.insert" call.
  84114. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84115. // status code is an error. Response headers are in either
  84116. // *Operation.ServerResponse.Header or (if a response was returned at
  84117. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84118. // to check whether the returned error was because
  84119. // http.StatusNotModified was returned.
  84120. func (c *MachineImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84121. gensupport.SetOptions(c.urlParams_, opts...)
  84122. res, err := c.doRequest("json")
  84123. if res != nil && res.StatusCode == http.StatusNotModified {
  84124. if res.Body != nil {
  84125. res.Body.Close()
  84126. }
  84127. return nil, &googleapi.Error{
  84128. Code: res.StatusCode,
  84129. Header: res.Header,
  84130. }
  84131. }
  84132. if err != nil {
  84133. return nil, err
  84134. }
  84135. defer googleapi.CloseBody(res)
  84136. if err := googleapi.CheckResponse(res); err != nil {
  84137. return nil, err
  84138. }
  84139. ret := &Operation{
  84140. ServerResponse: googleapi.ServerResponse{
  84141. Header: res.Header,
  84142. HTTPStatusCode: res.StatusCode,
  84143. },
  84144. }
  84145. target := &ret
  84146. if err := gensupport.DecodeResponse(target, res); err != nil {
  84147. return nil, err
  84148. }
  84149. return ret, nil
  84150. // {
  84151. // "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.",
  84152. // "httpMethod": "POST",
  84153. // "id": "compute.machineImages.insert",
  84154. // "parameterOrder": [
  84155. // "project"
  84156. // ],
  84157. // "parameters": {
  84158. // "project": {
  84159. // "description": "Project ID for this request.",
  84160. // "location": "path",
  84161. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84162. // "required": true,
  84163. // "type": "string"
  84164. // },
  84165. // "requestId": {
  84166. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84167. // "location": "query",
  84168. // "type": "string"
  84169. // },
  84170. // "sourceInstance": {
  84171. // "description": "Required. Source instance that is used to create the machine image from.",
  84172. // "location": "query",
  84173. // "type": "string"
  84174. // }
  84175. // },
  84176. // "path": "{project}/global/machineImages",
  84177. // "request": {
  84178. // "$ref": "MachineImage"
  84179. // },
  84180. // "response": {
  84181. // "$ref": "Operation"
  84182. // },
  84183. // "scopes": [
  84184. // "https://www.googleapis.com/auth/cloud-platform",
  84185. // "https://www.googleapis.com/auth/compute"
  84186. // ]
  84187. // }
  84188. }
  84189. // method id "compute.machineImages.list":
  84190. type MachineImagesListCall struct {
  84191. s *Service
  84192. project string
  84193. urlParams_ gensupport.URLParams
  84194. ifNoneMatch_ string
  84195. ctx_ context.Context
  84196. header_ http.Header
  84197. }
  84198. // List: Retrieves a list of machine images that are contained within
  84199. // the specified project.
  84200. func (r *MachineImagesService) List(project string) *MachineImagesListCall {
  84201. c := &MachineImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84202. c.project = project
  84203. return c
  84204. }
  84205. // Filter sets the optional parameter "filter": A filter expression that
  84206. // filters resources listed in the response. The expression must specify
  84207. // the field name, a comparison operator, and the value that you want to
  84208. // use for filtering. The value must be a string, a number, or a
  84209. // boolean. The comparison operator must be either =, !=, >, or <.
  84210. //
  84211. // For example, if you are filtering Compute Engine instances, you can
  84212. // exclude instances named example-instance by specifying name !=
  84213. // example-instance.
  84214. //
  84215. // You can also filter nested fields. For example, you could specify
  84216. // scheduling.automaticRestart = false to include instances only if they
  84217. // are not scheduled for automatic restarts. You can use filtering on
  84218. // nested fields to filter based on resource labels.
  84219. //
  84220. // To filter on multiple expressions, provide each separate expression
  84221. // within parentheses. For example, (scheduling.automaticRestart = true)
  84222. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84223. // AND expression. However, you can include AND and OR expressions
  84224. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84225. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84226. // true).
  84227. func (c *MachineImagesListCall) Filter(filter string) *MachineImagesListCall {
  84228. c.urlParams_.Set("filter", filter)
  84229. return c
  84230. }
  84231. // MaxResults sets the optional parameter "maxResults": The maximum
  84232. // number of results per page that should be returned. If the number of
  84233. // available results is larger than maxResults, Compute Engine returns a
  84234. // nextPageToken that can be used to get the next page of results in
  84235. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84236. // (Default: 500)
  84237. func (c *MachineImagesListCall) MaxResults(maxResults int64) *MachineImagesListCall {
  84238. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84239. return c
  84240. }
  84241. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84242. // a certain order. By default, results are returned in alphanumerical
  84243. // order based on the resource name.
  84244. //
  84245. // You can also sort results in descending order based on the creation
  84246. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84247. // based on the creationTimestamp field in reverse chronological order
  84248. // (newest result first). Use this to sort resources like operations so
  84249. // that the newest operation is returned first.
  84250. //
  84251. // Currently, only sorting by name or creationTimestamp desc is
  84252. // supported.
  84253. func (c *MachineImagesListCall) OrderBy(orderBy string) *MachineImagesListCall {
  84254. c.urlParams_.Set("orderBy", orderBy)
  84255. return c
  84256. }
  84257. // PageToken sets the optional parameter "pageToken": Specifies a page
  84258. // token to use. Set pageToken to the nextPageToken returned by a
  84259. // previous list request to get the next page of results.
  84260. func (c *MachineImagesListCall) PageToken(pageToken string) *MachineImagesListCall {
  84261. c.urlParams_.Set("pageToken", pageToken)
  84262. return c
  84263. }
  84264. // Fields allows partial responses to be retrieved. See
  84265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84266. // for more information.
  84267. func (c *MachineImagesListCall) Fields(s ...googleapi.Field) *MachineImagesListCall {
  84268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84269. return c
  84270. }
  84271. // IfNoneMatch sets the optional parameter which makes the operation
  84272. // fail if the object's ETag matches the given value. This is useful for
  84273. // getting updates only after the object has changed since the last
  84274. // request. Use googleapi.IsNotModified to check whether the response
  84275. // error from Do is the result of In-None-Match.
  84276. func (c *MachineImagesListCall) IfNoneMatch(entityTag string) *MachineImagesListCall {
  84277. c.ifNoneMatch_ = entityTag
  84278. return c
  84279. }
  84280. // Context sets the context to be used in this call's Do method. Any
  84281. // pending HTTP request will be aborted if the provided context is
  84282. // canceled.
  84283. func (c *MachineImagesListCall) Context(ctx context.Context) *MachineImagesListCall {
  84284. c.ctx_ = ctx
  84285. return c
  84286. }
  84287. // Header returns an http.Header that can be modified by the caller to
  84288. // add HTTP headers to the request.
  84289. func (c *MachineImagesListCall) Header() http.Header {
  84290. if c.header_ == nil {
  84291. c.header_ = make(http.Header)
  84292. }
  84293. return c.header_
  84294. }
  84295. func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) {
  84296. reqHeaders := make(http.Header)
  84297. for k, v := range c.header_ {
  84298. reqHeaders[k] = v
  84299. }
  84300. reqHeaders.Set("User-Agent", c.s.userAgent())
  84301. if c.ifNoneMatch_ != "" {
  84302. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84303. }
  84304. var body io.Reader = nil
  84305. c.urlParams_.Set("alt", alt)
  84306. c.urlParams_.Set("prettyPrint", "false")
  84307. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages")
  84308. urls += "?" + c.urlParams_.Encode()
  84309. req, err := http.NewRequest("GET", urls, body)
  84310. if err != nil {
  84311. return nil, err
  84312. }
  84313. req.Header = reqHeaders
  84314. googleapi.Expand(req.URL, map[string]string{
  84315. "project": c.project,
  84316. })
  84317. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84318. }
  84319. // Do executes the "compute.machineImages.list" call.
  84320. // Exactly one of *MachineImageList or error will be non-nil. Any
  84321. // non-2xx status code is an error. Response headers are in either
  84322. // *MachineImageList.ServerResponse.Header or (if a response was
  84323. // returned at all) in error.(*googleapi.Error).Header. Use
  84324. // googleapi.IsNotModified to check whether the returned error was
  84325. // because http.StatusNotModified was returned.
  84326. func (c *MachineImagesListCall) Do(opts ...googleapi.CallOption) (*MachineImageList, error) {
  84327. gensupport.SetOptions(c.urlParams_, opts...)
  84328. res, err := c.doRequest("json")
  84329. if res != nil && res.StatusCode == http.StatusNotModified {
  84330. if res.Body != nil {
  84331. res.Body.Close()
  84332. }
  84333. return nil, &googleapi.Error{
  84334. Code: res.StatusCode,
  84335. Header: res.Header,
  84336. }
  84337. }
  84338. if err != nil {
  84339. return nil, err
  84340. }
  84341. defer googleapi.CloseBody(res)
  84342. if err := googleapi.CheckResponse(res); err != nil {
  84343. return nil, err
  84344. }
  84345. ret := &MachineImageList{
  84346. ServerResponse: googleapi.ServerResponse{
  84347. Header: res.Header,
  84348. HTTPStatusCode: res.StatusCode,
  84349. },
  84350. }
  84351. target := &ret
  84352. if err := gensupport.DecodeResponse(target, res); err != nil {
  84353. return nil, err
  84354. }
  84355. return ret, nil
  84356. // {
  84357. // "description": "Retrieves a list of machine images that are contained within the specified project.",
  84358. // "httpMethod": "GET",
  84359. // "id": "compute.machineImages.list",
  84360. // "parameterOrder": [
  84361. // "project"
  84362. // ],
  84363. // "parameters": {
  84364. // "filter": {
  84365. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  84366. // "location": "query",
  84367. // "type": "string"
  84368. // },
  84369. // "maxResults": {
  84370. // "default": "500",
  84371. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  84372. // "format": "uint32",
  84373. // "location": "query",
  84374. // "minimum": "0",
  84375. // "type": "integer"
  84376. // },
  84377. // "orderBy": {
  84378. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  84379. // "location": "query",
  84380. // "type": "string"
  84381. // },
  84382. // "pageToken": {
  84383. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  84384. // "location": "query",
  84385. // "type": "string"
  84386. // },
  84387. // "project": {
  84388. // "description": "Project ID for this request.",
  84389. // "location": "path",
  84390. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84391. // "required": true,
  84392. // "type": "string"
  84393. // }
  84394. // },
  84395. // "path": "{project}/global/machineImages",
  84396. // "response": {
  84397. // "$ref": "MachineImageList"
  84398. // },
  84399. // "scopes": [
  84400. // "https://www.googleapis.com/auth/cloud-platform",
  84401. // "https://www.googleapis.com/auth/compute",
  84402. // "https://www.googleapis.com/auth/compute.readonly"
  84403. // ]
  84404. // }
  84405. }
  84406. // Pages invokes f for each page of results.
  84407. // A non-nil error returned from f will halt the iteration.
  84408. // The provided context supersedes any context provided to the Context method.
  84409. func (c *MachineImagesListCall) Pages(ctx context.Context, f func(*MachineImageList) error) error {
  84410. c.ctx_ = ctx
  84411. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84412. for {
  84413. x, err := c.Do()
  84414. if err != nil {
  84415. return err
  84416. }
  84417. if err := f(x); err != nil {
  84418. return err
  84419. }
  84420. if x.NextPageToken == "" {
  84421. return nil
  84422. }
  84423. c.PageToken(x.NextPageToken)
  84424. }
  84425. }
  84426. // method id "compute.machineImages.setIamPolicy":
  84427. type MachineImagesSetIamPolicyCall struct {
  84428. s *Service
  84429. project string
  84430. resource string
  84431. globalsetpolicyrequest *GlobalSetPolicyRequest
  84432. urlParams_ gensupport.URLParams
  84433. ctx_ context.Context
  84434. header_ http.Header
  84435. }
  84436. // SetIamPolicy: Sets the access control policy on the specified
  84437. // resource. Replaces any existing policy.
  84438. func (r *MachineImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *MachineImagesSetIamPolicyCall {
  84439. c := &MachineImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84440. c.project = project
  84441. c.resource = resource
  84442. c.globalsetpolicyrequest = globalsetpolicyrequest
  84443. return c
  84444. }
  84445. // Fields allows partial responses to be retrieved. See
  84446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84447. // for more information.
  84448. func (c *MachineImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesSetIamPolicyCall {
  84449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84450. return c
  84451. }
  84452. // Context sets the context to be used in this call's Do method. Any
  84453. // pending HTTP request will be aborted if the provided context is
  84454. // canceled.
  84455. func (c *MachineImagesSetIamPolicyCall) Context(ctx context.Context) *MachineImagesSetIamPolicyCall {
  84456. c.ctx_ = ctx
  84457. return c
  84458. }
  84459. // Header returns an http.Header that can be modified by the caller to
  84460. // add HTTP headers to the request.
  84461. func (c *MachineImagesSetIamPolicyCall) Header() http.Header {
  84462. if c.header_ == nil {
  84463. c.header_ = make(http.Header)
  84464. }
  84465. return c.header_
  84466. }
  84467. func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  84468. reqHeaders := make(http.Header)
  84469. for k, v := range c.header_ {
  84470. reqHeaders[k] = v
  84471. }
  84472. reqHeaders.Set("User-Agent", c.s.userAgent())
  84473. var body io.Reader = nil
  84474. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  84475. if err != nil {
  84476. return nil, err
  84477. }
  84478. reqHeaders.Set("Content-Type", "application/json")
  84479. c.urlParams_.Set("alt", alt)
  84480. c.urlParams_.Set("prettyPrint", "false")
  84481. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{resource}/setIamPolicy")
  84482. urls += "?" + c.urlParams_.Encode()
  84483. req, err := http.NewRequest("POST", urls, body)
  84484. if err != nil {
  84485. return nil, err
  84486. }
  84487. req.Header = reqHeaders
  84488. googleapi.Expand(req.URL, map[string]string{
  84489. "project": c.project,
  84490. "resource": c.resource,
  84491. })
  84492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84493. }
  84494. // Do executes the "compute.machineImages.setIamPolicy" call.
  84495. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  84496. // code is an error. Response headers are in either
  84497. // *Policy.ServerResponse.Header or (if a response was returned at all)
  84498. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  84499. // check whether the returned error was because http.StatusNotModified
  84500. // was returned.
  84501. func (c *MachineImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  84502. gensupport.SetOptions(c.urlParams_, opts...)
  84503. res, err := c.doRequest("json")
  84504. if res != nil && res.StatusCode == http.StatusNotModified {
  84505. if res.Body != nil {
  84506. res.Body.Close()
  84507. }
  84508. return nil, &googleapi.Error{
  84509. Code: res.StatusCode,
  84510. Header: res.Header,
  84511. }
  84512. }
  84513. if err != nil {
  84514. return nil, err
  84515. }
  84516. defer googleapi.CloseBody(res)
  84517. if err := googleapi.CheckResponse(res); err != nil {
  84518. return nil, err
  84519. }
  84520. ret := &Policy{
  84521. ServerResponse: googleapi.ServerResponse{
  84522. Header: res.Header,
  84523. HTTPStatusCode: res.StatusCode,
  84524. },
  84525. }
  84526. target := &ret
  84527. if err := gensupport.DecodeResponse(target, res); err != nil {
  84528. return nil, err
  84529. }
  84530. return ret, nil
  84531. // {
  84532. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  84533. // "httpMethod": "POST",
  84534. // "id": "compute.machineImages.setIamPolicy",
  84535. // "parameterOrder": [
  84536. // "project",
  84537. // "resource"
  84538. // ],
  84539. // "parameters": {
  84540. // "project": {
  84541. // "description": "Project ID for this request.",
  84542. // "location": "path",
  84543. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84544. // "required": true,
  84545. // "type": "string"
  84546. // },
  84547. // "resource": {
  84548. // "description": "Name or id of the resource for this request.",
  84549. // "location": "path",
  84550. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84551. // "required": true,
  84552. // "type": "string"
  84553. // }
  84554. // },
  84555. // "path": "{project}/global/machineImages/{resource}/setIamPolicy",
  84556. // "request": {
  84557. // "$ref": "GlobalSetPolicyRequest"
  84558. // },
  84559. // "response": {
  84560. // "$ref": "Policy"
  84561. // },
  84562. // "scopes": [
  84563. // "https://www.googleapis.com/auth/cloud-platform",
  84564. // "https://www.googleapis.com/auth/compute"
  84565. // ]
  84566. // }
  84567. }
  84568. // method id "compute.machineImages.testIamPermissions":
  84569. type MachineImagesTestIamPermissionsCall struct {
  84570. s *Service
  84571. project string
  84572. resource string
  84573. testpermissionsrequest *TestPermissionsRequest
  84574. urlParams_ gensupport.URLParams
  84575. ctx_ context.Context
  84576. header_ http.Header
  84577. }
  84578. // TestIamPermissions: Returns permissions that a caller has on the
  84579. // specified resource.
  84580. func (r *MachineImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *MachineImagesTestIamPermissionsCall {
  84581. c := &MachineImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84582. c.project = project
  84583. c.resource = resource
  84584. c.testpermissionsrequest = testpermissionsrequest
  84585. return c
  84586. }
  84587. // Fields allows partial responses to be retrieved. See
  84588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84589. // for more information.
  84590. func (c *MachineImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *MachineImagesTestIamPermissionsCall {
  84591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84592. return c
  84593. }
  84594. // Context sets the context to be used in this call's Do method. Any
  84595. // pending HTTP request will be aborted if the provided context is
  84596. // canceled.
  84597. func (c *MachineImagesTestIamPermissionsCall) Context(ctx context.Context) *MachineImagesTestIamPermissionsCall {
  84598. c.ctx_ = ctx
  84599. return c
  84600. }
  84601. // Header returns an http.Header that can be modified by the caller to
  84602. // add HTTP headers to the request.
  84603. func (c *MachineImagesTestIamPermissionsCall) Header() http.Header {
  84604. if c.header_ == nil {
  84605. c.header_ = make(http.Header)
  84606. }
  84607. return c.header_
  84608. }
  84609. func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  84610. reqHeaders := make(http.Header)
  84611. for k, v := range c.header_ {
  84612. reqHeaders[k] = v
  84613. }
  84614. reqHeaders.Set("User-Agent", c.s.userAgent())
  84615. var body io.Reader = nil
  84616. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  84617. if err != nil {
  84618. return nil, err
  84619. }
  84620. reqHeaders.Set("Content-Type", "application/json")
  84621. c.urlParams_.Set("alt", alt)
  84622. c.urlParams_.Set("prettyPrint", "false")
  84623. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{resource}/testIamPermissions")
  84624. urls += "?" + c.urlParams_.Encode()
  84625. req, err := http.NewRequest("POST", urls, body)
  84626. if err != nil {
  84627. return nil, err
  84628. }
  84629. req.Header = reqHeaders
  84630. googleapi.Expand(req.URL, map[string]string{
  84631. "project": c.project,
  84632. "resource": c.resource,
  84633. })
  84634. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84635. }
  84636. // Do executes the "compute.machineImages.testIamPermissions" call.
  84637. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  84638. // non-2xx status code is an error. Response headers are in either
  84639. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  84640. // returned at all) in error.(*googleapi.Error).Header. Use
  84641. // googleapi.IsNotModified to check whether the returned error was
  84642. // because http.StatusNotModified was returned.
  84643. func (c *MachineImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  84644. gensupport.SetOptions(c.urlParams_, opts...)
  84645. res, err := c.doRequest("json")
  84646. if res != nil && res.StatusCode == http.StatusNotModified {
  84647. if res.Body != nil {
  84648. res.Body.Close()
  84649. }
  84650. return nil, &googleapi.Error{
  84651. Code: res.StatusCode,
  84652. Header: res.Header,
  84653. }
  84654. }
  84655. if err != nil {
  84656. return nil, err
  84657. }
  84658. defer googleapi.CloseBody(res)
  84659. if err := googleapi.CheckResponse(res); err != nil {
  84660. return nil, err
  84661. }
  84662. ret := &TestPermissionsResponse{
  84663. ServerResponse: googleapi.ServerResponse{
  84664. Header: res.Header,
  84665. HTTPStatusCode: res.StatusCode,
  84666. },
  84667. }
  84668. target := &ret
  84669. if err := gensupport.DecodeResponse(target, res); err != nil {
  84670. return nil, err
  84671. }
  84672. return ret, nil
  84673. // {
  84674. // "description": "Returns permissions that a caller has on the specified resource.",
  84675. // "httpMethod": "POST",
  84676. // "id": "compute.machineImages.testIamPermissions",
  84677. // "parameterOrder": [
  84678. // "project",
  84679. // "resource"
  84680. // ],
  84681. // "parameters": {
  84682. // "project": {
  84683. // "description": "Project ID for this request.",
  84684. // "location": "path",
  84685. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84686. // "required": true,
  84687. // "type": "string"
  84688. // },
  84689. // "resource": {
  84690. // "description": "Name or id of the resource for this request.",
  84691. // "location": "path",
  84692. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84693. // "required": true,
  84694. // "type": "string"
  84695. // }
  84696. // },
  84697. // "path": "{project}/global/machineImages/{resource}/testIamPermissions",
  84698. // "request": {
  84699. // "$ref": "TestPermissionsRequest"
  84700. // },
  84701. // "response": {
  84702. // "$ref": "TestPermissionsResponse"
  84703. // },
  84704. // "scopes": [
  84705. // "https://www.googleapis.com/auth/cloud-platform",
  84706. // "https://www.googleapis.com/auth/compute",
  84707. // "https://www.googleapis.com/auth/compute.readonly"
  84708. // ]
  84709. // }
  84710. }
  84711. // method id "compute.machineTypes.aggregatedList":
  84712. type MachineTypesAggregatedListCall struct {
  84713. s *Service
  84714. project string
  84715. urlParams_ gensupport.URLParams
  84716. ifNoneMatch_ string
  84717. ctx_ context.Context
  84718. header_ http.Header
  84719. }
  84720. // AggregatedList: Retrieves an aggregated list of machine types.
  84721. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  84722. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  84723. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84724. c.project = project
  84725. return c
  84726. }
  84727. // Filter sets the optional parameter "filter": A filter expression that
  84728. // filters resources listed in the response. The expression must specify
  84729. // the field name, a comparison operator, and the value that you want to
  84730. // use for filtering. The value must be a string, a number, or a
  84731. // boolean. The comparison operator must be either =, !=, >, or <.
  84732. //
  84733. // For example, if you are filtering Compute Engine instances, you can
  84734. // exclude instances named example-instance by specifying name !=
  84735. // example-instance.
  84736. //
  84737. // You can also filter nested fields. For example, you could specify
  84738. // scheduling.automaticRestart = false to include instances only if they
  84739. // are not scheduled for automatic restarts. You can use filtering on
  84740. // nested fields to filter based on resource labels.
  84741. //
  84742. // To filter on multiple expressions, provide each separate expression
  84743. // within parentheses. For example, (scheduling.automaticRestart = true)
  84744. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84745. // AND expression. However, you can include AND and OR expressions
  84746. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84747. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84748. // true).
  84749. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  84750. c.urlParams_.Set("filter", filter)
  84751. return c
  84752. }
  84753. // MaxResults sets the optional parameter "maxResults": The maximum
  84754. // number of results per page that should be returned. If the number of
  84755. // available results is larger than maxResults, Compute Engine returns a
  84756. // nextPageToken that can be used to get the next page of results in
  84757. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84758. // (Default: 500)
  84759. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  84760. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84761. return c
  84762. }
  84763. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84764. // a certain order. By default, results are returned in alphanumerical
  84765. // order based on the resource name.
  84766. //
  84767. // You can also sort results in descending order based on the creation
  84768. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84769. // based on the creationTimestamp field in reverse chronological order
  84770. // (newest result first). Use this to sort resources like operations so
  84771. // that the newest operation is returned first.
  84772. //
  84773. // Currently, only sorting by name or creationTimestamp desc is
  84774. // supported.
  84775. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  84776. c.urlParams_.Set("orderBy", orderBy)
  84777. return c
  84778. }
  84779. // PageToken sets the optional parameter "pageToken": Specifies a page
  84780. // token to use. Set pageToken to the nextPageToken returned by a
  84781. // previous list request to get the next page of results.
  84782. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  84783. c.urlParams_.Set("pageToken", pageToken)
  84784. return c
  84785. }
  84786. // Fields allows partial responses to be retrieved. See
  84787. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84788. // for more information.
  84789. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  84790. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84791. return c
  84792. }
  84793. // IfNoneMatch sets the optional parameter which makes the operation
  84794. // fail if the object's ETag matches the given value. This is useful for
  84795. // getting updates only after the object has changed since the last
  84796. // request. Use googleapi.IsNotModified to check whether the response
  84797. // error from Do is the result of In-None-Match.
  84798. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  84799. c.ifNoneMatch_ = entityTag
  84800. return c
  84801. }
  84802. // Context sets the context to be used in this call's Do method. Any
  84803. // pending HTTP request will be aborted if the provided context is
  84804. // canceled.
  84805. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  84806. c.ctx_ = ctx
  84807. return c
  84808. }
  84809. // Header returns an http.Header that can be modified by the caller to
  84810. // add HTTP headers to the request.
  84811. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  84812. if c.header_ == nil {
  84813. c.header_ = make(http.Header)
  84814. }
  84815. return c.header_
  84816. }
  84817. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  84818. reqHeaders := make(http.Header)
  84819. for k, v := range c.header_ {
  84820. reqHeaders[k] = v
  84821. }
  84822. reqHeaders.Set("User-Agent", c.s.userAgent())
  84823. if c.ifNoneMatch_ != "" {
  84824. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84825. }
  84826. var body io.Reader = nil
  84827. c.urlParams_.Set("alt", alt)
  84828. c.urlParams_.Set("prettyPrint", "false")
  84829. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  84830. urls += "?" + c.urlParams_.Encode()
  84831. req, err := http.NewRequest("GET", urls, body)
  84832. if err != nil {
  84833. return nil, err
  84834. }
  84835. req.Header = reqHeaders
  84836. googleapi.Expand(req.URL, map[string]string{
  84837. "project": c.project,
  84838. })
  84839. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84840. }
  84841. // Do executes the "compute.machineTypes.aggregatedList" call.
  84842. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  84843. // Any non-2xx status code is an error. Response headers are in either
  84844. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  84845. // was returned at all) in error.(*googleapi.Error).Header. Use
  84846. // googleapi.IsNotModified to check whether the returned error was
  84847. // because http.StatusNotModified was returned.
  84848. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  84849. gensupport.SetOptions(c.urlParams_, opts...)
  84850. res, err := c.doRequest("json")
  84851. if res != nil && res.StatusCode == http.StatusNotModified {
  84852. if res.Body != nil {
  84853. res.Body.Close()
  84854. }
  84855. return nil, &googleapi.Error{
  84856. Code: res.StatusCode,
  84857. Header: res.Header,
  84858. }
  84859. }
  84860. if err != nil {
  84861. return nil, err
  84862. }
  84863. defer googleapi.CloseBody(res)
  84864. if err := googleapi.CheckResponse(res); err != nil {
  84865. return nil, err
  84866. }
  84867. ret := &MachineTypeAggregatedList{
  84868. ServerResponse: googleapi.ServerResponse{
  84869. Header: res.Header,
  84870. HTTPStatusCode: res.StatusCode,
  84871. },
  84872. }
  84873. target := &ret
  84874. if err := gensupport.DecodeResponse(target, res); err != nil {
  84875. return nil, err
  84876. }
  84877. return ret, nil
  84878. // {
  84879. // "description": "Retrieves an aggregated list of machine types.",
  84880. // "httpMethod": "GET",
  84881. // "id": "compute.machineTypes.aggregatedList",
  84882. // "parameterOrder": [
  84883. // "project"
  84884. // ],
  84885. // "parameters": {
  84886. // "filter": {
  84887. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  84888. // "location": "query",
  84889. // "type": "string"
  84890. // },
  84891. // "maxResults": {
  84892. // "default": "500",
  84893. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  84894. // "format": "uint32",
  84895. // "location": "query",
  84896. // "minimum": "0",
  84897. // "type": "integer"
  84898. // },
  84899. // "orderBy": {
  84900. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  84901. // "location": "query",
  84902. // "type": "string"
  84903. // },
  84904. // "pageToken": {
  84905. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  84906. // "location": "query",
  84907. // "type": "string"
  84908. // },
  84909. // "project": {
  84910. // "description": "Project ID for this request.",
  84911. // "location": "path",
  84912. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84913. // "required": true,
  84914. // "type": "string"
  84915. // }
  84916. // },
  84917. // "path": "{project}/aggregated/machineTypes",
  84918. // "response": {
  84919. // "$ref": "MachineTypeAggregatedList"
  84920. // },
  84921. // "scopes": [
  84922. // "https://www.googleapis.com/auth/cloud-platform",
  84923. // "https://www.googleapis.com/auth/compute",
  84924. // "https://www.googleapis.com/auth/compute.readonly"
  84925. // ]
  84926. // }
  84927. }
  84928. // Pages invokes f for each page of results.
  84929. // A non-nil error returned from f will halt the iteration.
  84930. // The provided context supersedes any context provided to the Context method.
  84931. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  84932. c.ctx_ = ctx
  84933. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84934. for {
  84935. x, err := c.Do()
  84936. if err != nil {
  84937. return err
  84938. }
  84939. if err := f(x); err != nil {
  84940. return err
  84941. }
  84942. if x.NextPageToken == "" {
  84943. return nil
  84944. }
  84945. c.PageToken(x.NextPageToken)
  84946. }
  84947. }
  84948. // method id "compute.machineTypes.get":
  84949. type MachineTypesGetCall struct {
  84950. s *Service
  84951. project string
  84952. zone string
  84953. machineType string
  84954. urlParams_ gensupport.URLParams
  84955. ifNoneMatch_ string
  84956. ctx_ context.Context
  84957. header_ http.Header
  84958. }
  84959. // Get: Returns the specified machine type. Gets a list of available
  84960. // machine types by making a list() request.
  84961. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  84962. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  84963. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84964. c.project = project
  84965. c.zone = zone
  84966. c.machineType = machineType
  84967. return c
  84968. }
  84969. // Fields allows partial responses to be retrieved. See
  84970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84971. // for more information.
  84972. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  84973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84974. return c
  84975. }
  84976. // IfNoneMatch sets the optional parameter which makes the operation
  84977. // fail if the object's ETag matches the given value. This is useful for
  84978. // getting updates only after the object has changed since the last
  84979. // request. Use googleapi.IsNotModified to check whether the response
  84980. // error from Do is the result of In-None-Match.
  84981. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  84982. c.ifNoneMatch_ = entityTag
  84983. return c
  84984. }
  84985. // Context sets the context to be used in this call's Do method. Any
  84986. // pending HTTP request will be aborted if the provided context is
  84987. // canceled.
  84988. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  84989. c.ctx_ = ctx
  84990. return c
  84991. }
  84992. // Header returns an http.Header that can be modified by the caller to
  84993. // add HTTP headers to the request.
  84994. func (c *MachineTypesGetCall) Header() http.Header {
  84995. if c.header_ == nil {
  84996. c.header_ = make(http.Header)
  84997. }
  84998. return c.header_
  84999. }
  85000. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  85001. reqHeaders := make(http.Header)
  85002. for k, v := range c.header_ {
  85003. reqHeaders[k] = v
  85004. }
  85005. reqHeaders.Set("User-Agent", c.s.userAgent())
  85006. if c.ifNoneMatch_ != "" {
  85007. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85008. }
  85009. var body io.Reader = nil
  85010. c.urlParams_.Set("alt", alt)
  85011. c.urlParams_.Set("prettyPrint", "false")
  85012. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  85013. urls += "?" + c.urlParams_.Encode()
  85014. req, err := http.NewRequest("GET", urls, body)
  85015. if err != nil {
  85016. return nil, err
  85017. }
  85018. req.Header = reqHeaders
  85019. googleapi.Expand(req.URL, map[string]string{
  85020. "project": c.project,
  85021. "zone": c.zone,
  85022. "machineType": c.machineType,
  85023. })
  85024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85025. }
  85026. // Do executes the "compute.machineTypes.get" call.
  85027. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  85028. // status code is an error. Response headers are in either
  85029. // *MachineType.ServerResponse.Header or (if a response was returned at
  85030. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85031. // to check whether the returned error was because
  85032. // http.StatusNotModified was returned.
  85033. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  85034. gensupport.SetOptions(c.urlParams_, opts...)
  85035. res, err := c.doRequest("json")
  85036. if res != nil && res.StatusCode == http.StatusNotModified {
  85037. if res.Body != nil {
  85038. res.Body.Close()
  85039. }
  85040. return nil, &googleapi.Error{
  85041. Code: res.StatusCode,
  85042. Header: res.Header,
  85043. }
  85044. }
  85045. if err != nil {
  85046. return nil, err
  85047. }
  85048. defer googleapi.CloseBody(res)
  85049. if err := googleapi.CheckResponse(res); err != nil {
  85050. return nil, err
  85051. }
  85052. ret := &MachineType{
  85053. ServerResponse: googleapi.ServerResponse{
  85054. Header: res.Header,
  85055. HTTPStatusCode: res.StatusCode,
  85056. },
  85057. }
  85058. target := &ret
  85059. if err := gensupport.DecodeResponse(target, res); err != nil {
  85060. return nil, err
  85061. }
  85062. return ret, nil
  85063. // {
  85064. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  85065. // "httpMethod": "GET",
  85066. // "id": "compute.machineTypes.get",
  85067. // "parameterOrder": [
  85068. // "project",
  85069. // "zone",
  85070. // "machineType"
  85071. // ],
  85072. // "parameters": {
  85073. // "machineType": {
  85074. // "description": "Name of the machine type to return.",
  85075. // "location": "path",
  85076. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  85077. // "required": true,
  85078. // "type": "string"
  85079. // },
  85080. // "project": {
  85081. // "description": "Project ID for this request.",
  85082. // "location": "path",
  85083. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85084. // "required": true,
  85085. // "type": "string"
  85086. // },
  85087. // "zone": {
  85088. // "description": "The name of the zone for this request.",
  85089. // "location": "path",
  85090. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85091. // "required": true,
  85092. // "type": "string"
  85093. // }
  85094. // },
  85095. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  85096. // "response": {
  85097. // "$ref": "MachineType"
  85098. // },
  85099. // "scopes": [
  85100. // "https://www.googleapis.com/auth/cloud-platform",
  85101. // "https://www.googleapis.com/auth/compute",
  85102. // "https://www.googleapis.com/auth/compute.readonly"
  85103. // ]
  85104. // }
  85105. }
  85106. // method id "compute.machineTypes.list":
  85107. type MachineTypesListCall struct {
  85108. s *Service
  85109. project string
  85110. zone string
  85111. urlParams_ gensupport.URLParams
  85112. ifNoneMatch_ string
  85113. ctx_ context.Context
  85114. header_ http.Header
  85115. }
  85116. // List: Retrieves a list of machine types available to the specified
  85117. // project.
  85118. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  85119. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  85120. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85121. c.project = project
  85122. c.zone = zone
  85123. return c
  85124. }
  85125. // Filter sets the optional parameter "filter": A filter expression that
  85126. // filters resources listed in the response. The expression must specify
  85127. // the field name, a comparison operator, and the value that you want to
  85128. // use for filtering. The value must be a string, a number, or a
  85129. // boolean. The comparison operator must be either =, !=, >, or <.
  85130. //
  85131. // For example, if you are filtering Compute Engine instances, you can
  85132. // exclude instances named example-instance by specifying name !=
  85133. // example-instance.
  85134. //
  85135. // You can also filter nested fields. For example, you could specify
  85136. // scheduling.automaticRestart = false to include instances only if they
  85137. // are not scheduled for automatic restarts. You can use filtering on
  85138. // nested fields to filter based on resource labels.
  85139. //
  85140. // To filter on multiple expressions, provide each separate expression
  85141. // within parentheses. For example, (scheduling.automaticRestart = true)
  85142. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85143. // AND expression. However, you can include AND and OR expressions
  85144. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85145. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85146. // true).
  85147. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  85148. c.urlParams_.Set("filter", filter)
  85149. return c
  85150. }
  85151. // MaxResults sets the optional parameter "maxResults": The maximum
  85152. // number of results per page that should be returned. If the number of
  85153. // available results is larger than maxResults, Compute Engine returns a
  85154. // nextPageToken that can be used to get the next page of results in
  85155. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85156. // (Default: 500)
  85157. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  85158. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85159. return c
  85160. }
  85161. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85162. // a certain order. By default, results are returned in alphanumerical
  85163. // order based on the resource name.
  85164. //
  85165. // You can also sort results in descending order based on the creation
  85166. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85167. // based on the creationTimestamp field in reverse chronological order
  85168. // (newest result first). Use this to sort resources like operations so
  85169. // that the newest operation is returned first.
  85170. //
  85171. // Currently, only sorting by name or creationTimestamp desc is
  85172. // supported.
  85173. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  85174. c.urlParams_.Set("orderBy", orderBy)
  85175. return c
  85176. }
  85177. // PageToken sets the optional parameter "pageToken": Specifies a page
  85178. // token to use. Set pageToken to the nextPageToken returned by a
  85179. // previous list request to get the next page of results.
  85180. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  85181. c.urlParams_.Set("pageToken", pageToken)
  85182. return c
  85183. }
  85184. // Fields allows partial responses to be retrieved. See
  85185. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85186. // for more information.
  85187. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  85188. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85189. return c
  85190. }
  85191. // IfNoneMatch sets the optional parameter which makes the operation
  85192. // fail if the object's ETag matches the given value. This is useful for
  85193. // getting updates only after the object has changed since the last
  85194. // request. Use googleapi.IsNotModified to check whether the response
  85195. // error from Do is the result of In-None-Match.
  85196. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  85197. c.ifNoneMatch_ = entityTag
  85198. return c
  85199. }
  85200. // Context sets the context to be used in this call's Do method. Any
  85201. // pending HTTP request will be aborted if the provided context is
  85202. // canceled.
  85203. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  85204. c.ctx_ = ctx
  85205. return c
  85206. }
  85207. // Header returns an http.Header that can be modified by the caller to
  85208. // add HTTP headers to the request.
  85209. func (c *MachineTypesListCall) Header() http.Header {
  85210. if c.header_ == nil {
  85211. c.header_ = make(http.Header)
  85212. }
  85213. return c.header_
  85214. }
  85215. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  85216. reqHeaders := make(http.Header)
  85217. for k, v := range c.header_ {
  85218. reqHeaders[k] = v
  85219. }
  85220. reqHeaders.Set("User-Agent", c.s.userAgent())
  85221. if c.ifNoneMatch_ != "" {
  85222. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85223. }
  85224. var body io.Reader = nil
  85225. c.urlParams_.Set("alt", alt)
  85226. c.urlParams_.Set("prettyPrint", "false")
  85227. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  85228. urls += "?" + c.urlParams_.Encode()
  85229. req, err := http.NewRequest("GET", urls, body)
  85230. if err != nil {
  85231. return nil, err
  85232. }
  85233. req.Header = reqHeaders
  85234. googleapi.Expand(req.URL, map[string]string{
  85235. "project": c.project,
  85236. "zone": c.zone,
  85237. })
  85238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85239. }
  85240. // Do executes the "compute.machineTypes.list" call.
  85241. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  85242. // status code is an error. Response headers are in either
  85243. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  85244. // at all) in error.(*googleapi.Error).Header. Use
  85245. // googleapi.IsNotModified to check whether the returned error was
  85246. // because http.StatusNotModified was returned.
  85247. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  85248. gensupport.SetOptions(c.urlParams_, opts...)
  85249. res, err := c.doRequest("json")
  85250. if res != nil && res.StatusCode == http.StatusNotModified {
  85251. if res.Body != nil {
  85252. res.Body.Close()
  85253. }
  85254. return nil, &googleapi.Error{
  85255. Code: res.StatusCode,
  85256. Header: res.Header,
  85257. }
  85258. }
  85259. if err != nil {
  85260. return nil, err
  85261. }
  85262. defer googleapi.CloseBody(res)
  85263. if err := googleapi.CheckResponse(res); err != nil {
  85264. return nil, err
  85265. }
  85266. ret := &MachineTypeList{
  85267. ServerResponse: googleapi.ServerResponse{
  85268. Header: res.Header,
  85269. HTTPStatusCode: res.StatusCode,
  85270. },
  85271. }
  85272. target := &ret
  85273. if err := gensupport.DecodeResponse(target, res); err != nil {
  85274. return nil, err
  85275. }
  85276. return ret, nil
  85277. // {
  85278. // "description": "Retrieves a list of machine types available to the specified project.",
  85279. // "httpMethod": "GET",
  85280. // "id": "compute.machineTypes.list",
  85281. // "parameterOrder": [
  85282. // "project",
  85283. // "zone"
  85284. // ],
  85285. // "parameters": {
  85286. // "filter": {
  85287. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  85288. // "location": "query",
  85289. // "type": "string"
  85290. // },
  85291. // "maxResults": {
  85292. // "default": "500",
  85293. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  85294. // "format": "uint32",
  85295. // "location": "query",
  85296. // "minimum": "0",
  85297. // "type": "integer"
  85298. // },
  85299. // "orderBy": {
  85300. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  85301. // "location": "query",
  85302. // "type": "string"
  85303. // },
  85304. // "pageToken": {
  85305. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  85306. // "location": "query",
  85307. // "type": "string"
  85308. // },
  85309. // "project": {
  85310. // "description": "Project ID for this request.",
  85311. // "location": "path",
  85312. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85313. // "required": true,
  85314. // "type": "string"
  85315. // },
  85316. // "zone": {
  85317. // "description": "The name of the zone for this request.",
  85318. // "location": "path",
  85319. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85320. // "required": true,
  85321. // "type": "string"
  85322. // }
  85323. // },
  85324. // "path": "{project}/zones/{zone}/machineTypes",
  85325. // "response": {
  85326. // "$ref": "MachineTypeList"
  85327. // },
  85328. // "scopes": [
  85329. // "https://www.googleapis.com/auth/cloud-platform",
  85330. // "https://www.googleapis.com/auth/compute",
  85331. // "https://www.googleapis.com/auth/compute.readonly"
  85332. // ]
  85333. // }
  85334. }
  85335. // Pages invokes f for each page of results.
  85336. // A non-nil error returned from f will halt the iteration.
  85337. // The provided context supersedes any context provided to the Context method.
  85338. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  85339. c.ctx_ = ctx
  85340. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85341. for {
  85342. x, err := c.Do()
  85343. if err != nil {
  85344. return err
  85345. }
  85346. if err := f(x); err != nil {
  85347. return err
  85348. }
  85349. if x.NextPageToken == "" {
  85350. return nil
  85351. }
  85352. c.PageToken(x.NextPageToken)
  85353. }
  85354. }
  85355. // method id "compute.networkEndpointGroups.aggregatedList":
  85356. type NetworkEndpointGroupsAggregatedListCall struct {
  85357. s *Service
  85358. project string
  85359. urlParams_ gensupport.URLParams
  85360. ifNoneMatch_ string
  85361. ctx_ context.Context
  85362. header_ http.Header
  85363. }
  85364. // AggregatedList: Retrieves the list of network endpoint groups and
  85365. // sorts them by zone.
  85366. func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall {
  85367. c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85368. c.project = project
  85369. return c
  85370. }
  85371. // Filter sets the optional parameter "filter": A filter expression that
  85372. // filters resources listed in the response. The expression must specify
  85373. // the field name, a comparison operator, and the value that you want to
  85374. // use for filtering. The value must be a string, a number, or a
  85375. // boolean. The comparison operator must be either =, !=, >, or <.
  85376. //
  85377. // For example, if you are filtering Compute Engine instances, you can
  85378. // exclude instances named example-instance by specifying name !=
  85379. // example-instance.
  85380. //
  85381. // You can also filter nested fields. For example, you could specify
  85382. // scheduling.automaticRestart = false to include instances only if they
  85383. // are not scheduled for automatic restarts. You can use filtering on
  85384. // nested fields to filter based on resource labels.
  85385. //
  85386. // To filter on multiple expressions, provide each separate expression
  85387. // within parentheses. For example, (scheduling.automaticRestart = true)
  85388. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85389. // AND expression. However, you can include AND and OR expressions
  85390. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85391. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85392. // true).
  85393. func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall {
  85394. c.urlParams_.Set("filter", filter)
  85395. return c
  85396. }
  85397. // MaxResults sets the optional parameter "maxResults": The maximum
  85398. // number of results per page that should be returned. If the number of
  85399. // available results is larger than maxResults, Compute Engine returns a
  85400. // nextPageToken that can be used to get the next page of results in
  85401. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85402. // (Default: 500)
  85403. func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall {
  85404. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85405. return c
  85406. }
  85407. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85408. // a certain order. By default, results are returned in alphanumerical
  85409. // order based on the resource name.
  85410. //
  85411. // You can also sort results in descending order based on the creation
  85412. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85413. // based on the creationTimestamp field in reverse chronological order
  85414. // (newest result first). Use this to sort resources like operations so
  85415. // that the newest operation is returned first.
  85416. //
  85417. // Currently, only sorting by name or creationTimestamp desc is
  85418. // supported.
  85419. func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall {
  85420. c.urlParams_.Set("orderBy", orderBy)
  85421. return c
  85422. }
  85423. // PageToken sets the optional parameter "pageToken": Specifies a page
  85424. // token to use. Set pageToken to the nextPageToken returned by a
  85425. // previous list request to get the next page of results.
  85426. func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall {
  85427. c.urlParams_.Set("pageToken", pageToken)
  85428. return c
  85429. }
  85430. // Fields allows partial responses to be retrieved. See
  85431. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85432. // for more information.
  85433. func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall {
  85434. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85435. return c
  85436. }
  85437. // IfNoneMatch sets the optional parameter which makes the operation
  85438. // fail if the object's ETag matches the given value. This is useful for
  85439. // getting updates only after the object has changed since the last
  85440. // request. Use googleapi.IsNotModified to check whether the response
  85441. // error from Do is the result of In-None-Match.
  85442. func (c *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall {
  85443. c.ifNoneMatch_ = entityTag
  85444. return c
  85445. }
  85446. // Context sets the context to be used in this call's Do method. Any
  85447. // pending HTTP request will be aborted if the provided context is
  85448. // canceled.
  85449. func (c *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall {
  85450. c.ctx_ = ctx
  85451. return c
  85452. }
  85453. // Header returns an http.Header that can be modified by the caller to
  85454. // add HTTP headers to the request.
  85455. func (c *NetworkEndpointGroupsAggregatedListCall) Header() http.Header {
  85456. if c.header_ == nil {
  85457. c.header_ = make(http.Header)
  85458. }
  85459. return c.header_
  85460. }
  85461. func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  85462. reqHeaders := make(http.Header)
  85463. for k, v := range c.header_ {
  85464. reqHeaders[k] = v
  85465. }
  85466. reqHeaders.Set("User-Agent", c.s.userAgent())
  85467. if c.ifNoneMatch_ != "" {
  85468. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85469. }
  85470. var body io.Reader = nil
  85471. c.urlParams_.Set("alt", alt)
  85472. c.urlParams_.Set("prettyPrint", "false")
  85473. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/networkEndpointGroups")
  85474. urls += "?" + c.urlParams_.Encode()
  85475. req, err := http.NewRequest("GET", urls, body)
  85476. if err != nil {
  85477. return nil, err
  85478. }
  85479. req.Header = reqHeaders
  85480. googleapi.Expand(req.URL, map[string]string{
  85481. "project": c.project,
  85482. })
  85483. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85484. }
  85485. // Do executes the "compute.networkEndpointGroups.aggregatedList" call.
  85486. // Exactly one of *NetworkEndpointGroupAggregatedList or error will be
  85487. // non-nil. Any non-2xx status code is an error. Response headers are in
  85488. // either *NetworkEndpointGroupAggregatedList.ServerResponse.Header or
  85489. // (if a response was returned at all) in
  85490. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  85491. // whether the returned error was because http.StatusNotModified was
  85492. // returned.
  85493. func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, error) {
  85494. gensupport.SetOptions(c.urlParams_, opts...)
  85495. res, err := c.doRequest("json")
  85496. if res != nil && res.StatusCode == http.StatusNotModified {
  85497. if res.Body != nil {
  85498. res.Body.Close()
  85499. }
  85500. return nil, &googleapi.Error{
  85501. Code: res.StatusCode,
  85502. Header: res.Header,
  85503. }
  85504. }
  85505. if err != nil {
  85506. return nil, err
  85507. }
  85508. defer googleapi.CloseBody(res)
  85509. if err := googleapi.CheckResponse(res); err != nil {
  85510. return nil, err
  85511. }
  85512. ret := &NetworkEndpointGroupAggregatedList{
  85513. ServerResponse: googleapi.ServerResponse{
  85514. Header: res.Header,
  85515. HTTPStatusCode: res.StatusCode,
  85516. },
  85517. }
  85518. target := &ret
  85519. if err := gensupport.DecodeResponse(target, res); err != nil {
  85520. return nil, err
  85521. }
  85522. return ret, nil
  85523. // {
  85524. // "description": "Retrieves the list of network endpoint groups and sorts them by zone.",
  85525. // "httpMethod": "GET",
  85526. // "id": "compute.networkEndpointGroups.aggregatedList",
  85527. // "parameterOrder": [
  85528. // "project"
  85529. // ],
  85530. // "parameters": {
  85531. // "filter": {
  85532. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  85533. // "location": "query",
  85534. // "type": "string"
  85535. // },
  85536. // "maxResults": {
  85537. // "default": "500",
  85538. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  85539. // "format": "uint32",
  85540. // "location": "query",
  85541. // "minimum": "0",
  85542. // "type": "integer"
  85543. // },
  85544. // "orderBy": {
  85545. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  85546. // "location": "query",
  85547. // "type": "string"
  85548. // },
  85549. // "pageToken": {
  85550. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  85551. // "location": "query",
  85552. // "type": "string"
  85553. // },
  85554. // "project": {
  85555. // "description": "Project ID for this request.",
  85556. // "location": "path",
  85557. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85558. // "required": true,
  85559. // "type": "string"
  85560. // }
  85561. // },
  85562. // "path": "{project}/aggregated/networkEndpointGroups",
  85563. // "response": {
  85564. // "$ref": "NetworkEndpointGroupAggregatedList"
  85565. // },
  85566. // "scopes": [
  85567. // "https://www.googleapis.com/auth/cloud-platform",
  85568. // "https://www.googleapis.com/auth/compute",
  85569. // "https://www.googleapis.com/auth/compute.readonly"
  85570. // ]
  85571. // }
  85572. }
  85573. // Pages invokes f for each page of results.
  85574. // A non-nil error returned from f will halt the iteration.
  85575. // The provided context supersedes any context provided to the Context method.
  85576. func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) error) error {
  85577. c.ctx_ = ctx
  85578. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85579. for {
  85580. x, err := c.Do()
  85581. if err != nil {
  85582. return err
  85583. }
  85584. if err := f(x); err != nil {
  85585. return err
  85586. }
  85587. if x.NextPageToken == "" {
  85588. return nil
  85589. }
  85590. c.PageToken(x.NextPageToken)
  85591. }
  85592. }
  85593. // method id "compute.networkEndpointGroups.attachNetworkEndpoints":
  85594. type NetworkEndpointGroupsAttachNetworkEndpointsCall struct {
  85595. s *Service
  85596. project string
  85597. zone string
  85598. networkEndpointGroup string
  85599. networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest
  85600. urlParams_ gensupport.URLParams
  85601. ctx_ context.Context
  85602. header_ http.Header
  85603. }
  85604. // AttachNetworkEndpoints: Attach a list of network endpoints to the
  85605. // specified network endpoint group.
  85606. func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  85607. c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85608. c.project = project
  85609. c.zone = zone
  85610. c.networkEndpointGroup = networkEndpointGroup
  85611. c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest
  85612. return c
  85613. }
  85614. // RequestId sets the optional parameter "requestId": An optional
  85615. // request ID to identify requests. Specify a unique request ID so that
  85616. // if you must retry your request, the server will know to ignore the
  85617. // request if it has already been completed.
  85618. //
  85619. // For example, consider a situation where you make an initial request
  85620. // and the request times out. If you make the request again with the
  85621. // same request ID, the server can check if original operation with the
  85622. // same request ID was received, and if so, will ignore the second
  85623. // request. This prevents clients from accidentally creating duplicate
  85624. // commitments.
  85625. //
  85626. // The request ID must be a valid UUID with the exception that zero UUID
  85627. // is not supported (00000000-0000-0000-0000-000000000000).
  85628. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  85629. c.urlParams_.Set("requestId", requestId)
  85630. return c
  85631. }
  85632. // Fields allows partial responses to be retrieved. See
  85633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85634. // for more information.
  85635. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  85636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85637. return c
  85638. }
  85639. // Context sets the context to be used in this call's Do method. Any
  85640. // pending HTTP request will be aborted if the provided context is
  85641. // canceled.
  85642. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  85643. c.ctx_ = ctx
  85644. return c
  85645. }
  85646. // Header returns an http.Header that can be modified by the caller to
  85647. // add HTTP headers to the request.
  85648. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
  85649. if c.header_ == nil {
  85650. c.header_ = make(http.Header)
  85651. }
  85652. return c.header_
  85653. }
  85654. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  85655. reqHeaders := make(http.Header)
  85656. for k, v := range c.header_ {
  85657. reqHeaders[k] = v
  85658. }
  85659. reqHeaders.Set("User-Agent", c.s.userAgent())
  85660. var body io.Reader = nil
  85661. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest)
  85662. if err != nil {
  85663. return nil, err
  85664. }
  85665. reqHeaders.Set("Content-Type", "application/json")
  85666. c.urlParams_.Set("alt", alt)
  85667. c.urlParams_.Set("prettyPrint", "false")
  85668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
  85669. urls += "?" + c.urlParams_.Encode()
  85670. req, err := http.NewRequest("POST", urls, body)
  85671. if err != nil {
  85672. return nil, err
  85673. }
  85674. req.Header = reqHeaders
  85675. googleapi.Expand(req.URL, map[string]string{
  85676. "project": c.project,
  85677. "zone": c.zone,
  85678. "networkEndpointGroup": c.networkEndpointGroup,
  85679. })
  85680. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85681. }
  85682. // Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call.
  85683. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85684. // status code is an error. Response headers are in either
  85685. // *Operation.ServerResponse.Header or (if a response was returned at
  85686. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85687. // to check whether the returned error was because
  85688. // http.StatusNotModified was returned.
  85689. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85690. gensupport.SetOptions(c.urlParams_, opts...)
  85691. res, err := c.doRequest("json")
  85692. if res != nil && res.StatusCode == http.StatusNotModified {
  85693. if res.Body != nil {
  85694. res.Body.Close()
  85695. }
  85696. return nil, &googleapi.Error{
  85697. Code: res.StatusCode,
  85698. Header: res.Header,
  85699. }
  85700. }
  85701. if err != nil {
  85702. return nil, err
  85703. }
  85704. defer googleapi.CloseBody(res)
  85705. if err := googleapi.CheckResponse(res); err != nil {
  85706. return nil, err
  85707. }
  85708. ret := &Operation{
  85709. ServerResponse: googleapi.ServerResponse{
  85710. Header: res.Header,
  85711. HTTPStatusCode: res.StatusCode,
  85712. },
  85713. }
  85714. target := &ret
  85715. if err := gensupport.DecodeResponse(target, res); err != nil {
  85716. return nil, err
  85717. }
  85718. return ret, nil
  85719. // {
  85720. // "description": "Attach a list of network endpoints to the specified network endpoint group.",
  85721. // "httpMethod": "POST",
  85722. // "id": "compute.networkEndpointGroups.attachNetworkEndpoints",
  85723. // "parameterOrder": [
  85724. // "project",
  85725. // "zone",
  85726. // "networkEndpointGroup"
  85727. // ],
  85728. // "parameters": {
  85729. // "networkEndpointGroup": {
  85730. // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
  85731. // "location": "path",
  85732. // "required": true,
  85733. // "type": "string"
  85734. // },
  85735. // "project": {
  85736. // "description": "Project ID for this request.",
  85737. // "location": "path",
  85738. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85739. // "required": true,
  85740. // "type": "string"
  85741. // },
  85742. // "requestId": {
  85743. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85744. // "location": "query",
  85745. // "type": "string"
  85746. // },
  85747. // "zone": {
  85748. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  85749. // "location": "path",
  85750. // "required": true,
  85751. // "type": "string"
  85752. // }
  85753. // },
  85754. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
  85755. // "request": {
  85756. // "$ref": "NetworkEndpointGroupsAttachEndpointsRequest"
  85757. // },
  85758. // "response": {
  85759. // "$ref": "Operation"
  85760. // },
  85761. // "scopes": [
  85762. // "https://www.googleapis.com/auth/cloud-platform",
  85763. // "https://www.googleapis.com/auth/compute"
  85764. // ]
  85765. // }
  85766. }
  85767. // method id "compute.networkEndpointGroups.delete":
  85768. type NetworkEndpointGroupsDeleteCall struct {
  85769. s *Service
  85770. project string
  85771. zone string
  85772. networkEndpointGroup string
  85773. urlParams_ gensupport.URLParams
  85774. ctx_ context.Context
  85775. header_ http.Header
  85776. }
  85777. // Delete: Deletes the specified network endpoint group. The network
  85778. // endpoints in the NEG and the VM instances they belong to are not
  85779. // terminated when the NEG is deleted. Note that the NEG cannot be
  85780. // deleted if there are backend services referencing it.
  85781. func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall {
  85782. c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85783. c.project = project
  85784. c.zone = zone
  85785. c.networkEndpointGroup = networkEndpointGroup
  85786. return c
  85787. }
  85788. // RequestId sets the optional parameter "requestId": An optional
  85789. // request ID to identify requests. Specify a unique request ID so that
  85790. // if you must retry your request, the server will know to ignore the
  85791. // request if it has already been completed.
  85792. //
  85793. // For example, consider a situation where you make an initial request
  85794. // and the request times out. If you make the request again with the
  85795. // same request ID, the server can check if original operation with the
  85796. // same request ID was received, and if so, will ignore the second
  85797. // request. This prevents clients from accidentally creating duplicate
  85798. // commitments.
  85799. //
  85800. // The request ID must be a valid UUID with the exception that zero UUID
  85801. // is not supported (00000000-0000-0000-0000-000000000000).
  85802. func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall {
  85803. c.urlParams_.Set("requestId", requestId)
  85804. return c
  85805. }
  85806. // Fields allows partial responses to be retrieved. See
  85807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85808. // for more information.
  85809. func (c *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall {
  85810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85811. return c
  85812. }
  85813. // Context sets the context to be used in this call's Do method. Any
  85814. // pending HTTP request will be aborted if the provided context is
  85815. // canceled.
  85816. func (c *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall {
  85817. c.ctx_ = ctx
  85818. return c
  85819. }
  85820. // Header returns an http.Header that can be modified by the caller to
  85821. // add HTTP headers to the request.
  85822. func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header {
  85823. if c.header_ == nil {
  85824. c.header_ = make(http.Header)
  85825. }
  85826. return c.header_
  85827. }
  85828. func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  85829. reqHeaders := make(http.Header)
  85830. for k, v := range c.header_ {
  85831. reqHeaders[k] = v
  85832. }
  85833. reqHeaders.Set("User-Agent", c.s.userAgent())
  85834. var body io.Reader = nil
  85835. c.urlParams_.Set("alt", alt)
  85836. c.urlParams_.Set("prettyPrint", "false")
  85837. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  85838. urls += "?" + c.urlParams_.Encode()
  85839. req, err := http.NewRequest("DELETE", urls, body)
  85840. if err != nil {
  85841. return nil, err
  85842. }
  85843. req.Header = reqHeaders
  85844. googleapi.Expand(req.URL, map[string]string{
  85845. "project": c.project,
  85846. "zone": c.zone,
  85847. "networkEndpointGroup": c.networkEndpointGroup,
  85848. })
  85849. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85850. }
  85851. // Do executes the "compute.networkEndpointGroups.delete" call.
  85852. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85853. // status code is an error. Response headers are in either
  85854. // *Operation.ServerResponse.Header or (if a response was returned at
  85855. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85856. // to check whether the returned error was because
  85857. // http.StatusNotModified was returned.
  85858. func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85859. gensupport.SetOptions(c.urlParams_, opts...)
  85860. res, err := c.doRequest("json")
  85861. if res != nil && res.StatusCode == http.StatusNotModified {
  85862. if res.Body != nil {
  85863. res.Body.Close()
  85864. }
  85865. return nil, &googleapi.Error{
  85866. Code: res.StatusCode,
  85867. Header: res.Header,
  85868. }
  85869. }
  85870. if err != nil {
  85871. return nil, err
  85872. }
  85873. defer googleapi.CloseBody(res)
  85874. if err := googleapi.CheckResponse(res); err != nil {
  85875. return nil, err
  85876. }
  85877. ret := &Operation{
  85878. ServerResponse: googleapi.ServerResponse{
  85879. Header: res.Header,
  85880. HTTPStatusCode: res.StatusCode,
  85881. },
  85882. }
  85883. target := &ret
  85884. if err := gensupport.DecodeResponse(target, res); err != nil {
  85885. return nil, err
  85886. }
  85887. return ret, nil
  85888. // {
  85889. // "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.",
  85890. // "httpMethod": "DELETE",
  85891. // "id": "compute.networkEndpointGroups.delete",
  85892. // "parameterOrder": [
  85893. // "project",
  85894. // "zone",
  85895. // "networkEndpointGroup"
  85896. // ],
  85897. // "parameters": {
  85898. // "networkEndpointGroup": {
  85899. // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
  85900. // "location": "path",
  85901. // "required": true,
  85902. // "type": "string"
  85903. // },
  85904. // "project": {
  85905. // "description": "Project ID for this request.",
  85906. // "location": "path",
  85907. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85908. // "required": true,
  85909. // "type": "string"
  85910. // },
  85911. // "requestId": {
  85912. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85913. // "location": "query",
  85914. // "type": "string"
  85915. // },
  85916. // "zone": {
  85917. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  85918. // "location": "path",
  85919. // "required": true,
  85920. // "type": "string"
  85921. // }
  85922. // },
  85923. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  85924. // "response": {
  85925. // "$ref": "Operation"
  85926. // },
  85927. // "scopes": [
  85928. // "https://www.googleapis.com/auth/cloud-platform",
  85929. // "https://www.googleapis.com/auth/compute"
  85930. // ]
  85931. // }
  85932. }
  85933. // method id "compute.networkEndpointGroups.detachNetworkEndpoints":
  85934. type NetworkEndpointGroupsDetachNetworkEndpointsCall struct {
  85935. s *Service
  85936. project string
  85937. zone string
  85938. networkEndpointGroup string
  85939. networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest
  85940. urlParams_ gensupport.URLParams
  85941. ctx_ context.Context
  85942. header_ http.Header
  85943. }
  85944. // DetachNetworkEndpoints: Detach a list of network endpoints from the
  85945. // specified network endpoint group.
  85946. func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  85947. c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85948. c.project = project
  85949. c.zone = zone
  85950. c.networkEndpointGroup = networkEndpointGroup
  85951. c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest
  85952. return c
  85953. }
  85954. // RequestId sets the optional parameter "requestId": An optional
  85955. // request ID to identify requests. Specify a unique request ID so that
  85956. // if you must retry your request, the server will know to ignore the
  85957. // request if it has already been completed.
  85958. //
  85959. // For example, consider a situation where you make an initial request
  85960. // and the request times out. If you make the request again with the
  85961. // same request ID, the server can check if original operation with the
  85962. // same request ID was received, and if so, will ignore the second
  85963. // request. This prevents clients from accidentally creating duplicate
  85964. // commitments.
  85965. //
  85966. // The request ID must be a valid UUID with the exception that zero UUID
  85967. // is not supported (00000000-0000-0000-0000-000000000000).
  85968. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  85969. c.urlParams_.Set("requestId", requestId)
  85970. return c
  85971. }
  85972. // Fields allows partial responses to be retrieved. See
  85973. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85974. // for more information.
  85975. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  85976. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85977. return c
  85978. }
  85979. // Context sets the context to be used in this call's Do method. Any
  85980. // pending HTTP request will be aborted if the provided context is
  85981. // canceled.
  85982. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  85983. c.ctx_ = ctx
  85984. return c
  85985. }
  85986. // Header returns an http.Header that can be modified by the caller to
  85987. // add HTTP headers to the request.
  85988. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
  85989. if c.header_ == nil {
  85990. c.header_ = make(http.Header)
  85991. }
  85992. return c.header_
  85993. }
  85994. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  85995. reqHeaders := make(http.Header)
  85996. for k, v := range c.header_ {
  85997. reqHeaders[k] = v
  85998. }
  85999. reqHeaders.Set("User-Agent", c.s.userAgent())
  86000. var body io.Reader = nil
  86001. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest)
  86002. if err != nil {
  86003. return nil, err
  86004. }
  86005. reqHeaders.Set("Content-Type", "application/json")
  86006. c.urlParams_.Set("alt", alt)
  86007. c.urlParams_.Set("prettyPrint", "false")
  86008. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
  86009. urls += "?" + c.urlParams_.Encode()
  86010. req, err := http.NewRequest("POST", urls, body)
  86011. if err != nil {
  86012. return nil, err
  86013. }
  86014. req.Header = reqHeaders
  86015. googleapi.Expand(req.URL, map[string]string{
  86016. "project": c.project,
  86017. "zone": c.zone,
  86018. "networkEndpointGroup": c.networkEndpointGroup,
  86019. })
  86020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86021. }
  86022. // Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call.
  86023. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86024. // status code is an error. Response headers are in either
  86025. // *Operation.ServerResponse.Header or (if a response was returned at
  86026. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86027. // to check whether the returned error was because
  86028. // http.StatusNotModified was returned.
  86029. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86030. gensupport.SetOptions(c.urlParams_, opts...)
  86031. res, err := c.doRequest("json")
  86032. if res != nil && res.StatusCode == http.StatusNotModified {
  86033. if res.Body != nil {
  86034. res.Body.Close()
  86035. }
  86036. return nil, &googleapi.Error{
  86037. Code: res.StatusCode,
  86038. Header: res.Header,
  86039. }
  86040. }
  86041. if err != nil {
  86042. return nil, err
  86043. }
  86044. defer googleapi.CloseBody(res)
  86045. if err := googleapi.CheckResponse(res); err != nil {
  86046. return nil, err
  86047. }
  86048. ret := &Operation{
  86049. ServerResponse: googleapi.ServerResponse{
  86050. Header: res.Header,
  86051. HTTPStatusCode: res.StatusCode,
  86052. },
  86053. }
  86054. target := &ret
  86055. if err := gensupport.DecodeResponse(target, res); err != nil {
  86056. return nil, err
  86057. }
  86058. return ret, nil
  86059. // {
  86060. // "description": "Detach a list of network endpoints from the specified network endpoint group.",
  86061. // "httpMethod": "POST",
  86062. // "id": "compute.networkEndpointGroups.detachNetworkEndpoints",
  86063. // "parameterOrder": [
  86064. // "project",
  86065. // "zone",
  86066. // "networkEndpointGroup"
  86067. // ],
  86068. // "parameters": {
  86069. // "networkEndpointGroup": {
  86070. // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
  86071. // "location": "path",
  86072. // "required": true,
  86073. // "type": "string"
  86074. // },
  86075. // "project": {
  86076. // "description": "Project ID for this request.",
  86077. // "location": "path",
  86078. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86079. // "required": true,
  86080. // "type": "string"
  86081. // },
  86082. // "requestId": {
  86083. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86084. // "location": "query",
  86085. // "type": "string"
  86086. // },
  86087. // "zone": {
  86088. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  86089. // "location": "path",
  86090. // "required": true,
  86091. // "type": "string"
  86092. // }
  86093. // },
  86094. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
  86095. // "request": {
  86096. // "$ref": "NetworkEndpointGroupsDetachEndpointsRequest"
  86097. // },
  86098. // "response": {
  86099. // "$ref": "Operation"
  86100. // },
  86101. // "scopes": [
  86102. // "https://www.googleapis.com/auth/cloud-platform",
  86103. // "https://www.googleapis.com/auth/compute"
  86104. // ]
  86105. // }
  86106. }
  86107. // method id "compute.networkEndpointGroups.get":
  86108. type NetworkEndpointGroupsGetCall struct {
  86109. s *Service
  86110. project string
  86111. zone string
  86112. networkEndpointGroup string
  86113. urlParams_ gensupport.URLParams
  86114. ifNoneMatch_ string
  86115. ctx_ context.Context
  86116. header_ http.Header
  86117. }
  86118. // Get: Returns the specified network endpoint group. Gets a list of
  86119. // available network endpoint groups by making a list() request.
  86120. func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall {
  86121. c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86122. c.project = project
  86123. c.zone = zone
  86124. c.networkEndpointGroup = networkEndpointGroup
  86125. return c
  86126. }
  86127. // Fields allows partial responses to be retrieved. See
  86128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86129. // for more information.
  86130. func (c *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall {
  86131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86132. return c
  86133. }
  86134. // IfNoneMatch sets the optional parameter which makes the operation
  86135. // fail if the object's ETag matches the given value. This is useful for
  86136. // getting updates only after the object has changed since the last
  86137. // request. Use googleapi.IsNotModified to check whether the response
  86138. // error from Do is the result of In-None-Match.
  86139. func (c *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall {
  86140. c.ifNoneMatch_ = entityTag
  86141. return c
  86142. }
  86143. // Context sets the context to be used in this call's Do method. Any
  86144. // pending HTTP request will be aborted if the provided context is
  86145. // canceled.
  86146. func (c *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall {
  86147. c.ctx_ = ctx
  86148. return c
  86149. }
  86150. // Header returns an http.Header that can be modified by the caller to
  86151. // add HTTP headers to the request.
  86152. func (c *NetworkEndpointGroupsGetCall) Header() http.Header {
  86153. if c.header_ == nil {
  86154. c.header_ = make(http.Header)
  86155. }
  86156. return c.header_
  86157. }
  86158. func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  86159. reqHeaders := make(http.Header)
  86160. for k, v := range c.header_ {
  86161. reqHeaders[k] = v
  86162. }
  86163. reqHeaders.Set("User-Agent", c.s.userAgent())
  86164. if c.ifNoneMatch_ != "" {
  86165. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86166. }
  86167. var body io.Reader = nil
  86168. c.urlParams_.Set("alt", alt)
  86169. c.urlParams_.Set("prettyPrint", "false")
  86170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  86171. urls += "?" + c.urlParams_.Encode()
  86172. req, err := http.NewRequest("GET", urls, body)
  86173. if err != nil {
  86174. return nil, err
  86175. }
  86176. req.Header = reqHeaders
  86177. googleapi.Expand(req.URL, map[string]string{
  86178. "project": c.project,
  86179. "zone": c.zone,
  86180. "networkEndpointGroup": c.networkEndpointGroup,
  86181. })
  86182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86183. }
  86184. // Do executes the "compute.networkEndpointGroups.get" call.
  86185. // Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
  86186. // non-2xx status code is an error. Response headers are in either
  86187. // *NetworkEndpointGroup.ServerResponse.Header or (if a response was
  86188. // returned at all) in error.(*googleapi.Error).Header. Use
  86189. // googleapi.IsNotModified to check whether the returned error was
  86190. // because http.StatusNotModified was returned.
  86191. func (c *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) {
  86192. gensupport.SetOptions(c.urlParams_, opts...)
  86193. res, err := c.doRequest("json")
  86194. if res != nil && res.StatusCode == http.StatusNotModified {
  86195. if res.Body != nil {
  86196. res.Body.Close()
  86197. }
  86198. return nil, &googleapi.Error{
  86199. Code: res.StatusCode,
  86200. Header: res.Header,
  86201. }
  86202. }
  86203. if err != nil {
  86204. return nil, err
  86205. }
  86206. defer googleapi.CloseBody(res)
  86207. if err := googleapi.CheckResponse(res); err != nil {
  86208. return nil, err
  86209. }
  86210. ret := &NetworkEndpointGroup{
  86211. ServerResponse: googleapi.ServerResponse{
  86212. Header: res.Header,
  86213. HTTPStatusCode: res.StatusCode,
  86214. },
  86215. }
  86216. target := &ret
  86217. if err := gensupport.DecodeResponse(target, res); err != nil {
  86218. return nil, err
  86219. }
  86220. return ret, nil
  86221. // {
  86222. // "description": "Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.",
  86223. // "httpMethod": "GET",
  86224. // "id": "compute.networkEndpointGroups.get",
  86225. // "parameterOrder": [
  86226. // "project",
  86227. // "zone",
  86228. // "networkEndpointGroup"
  86229. // ],
  86230. // "parameters": {
  86231. // "networkEndpointGroup": {
  86232. // "description": "The name of the network endpoint group. It should comply with RFC1035.",
  86233. // "location": "path",
  86234. // "required": true,
  86235. // "type": "string"
  86236. // },
  86237. // "project": {
  86238. // "description": "Project ID for this request.",
  86239. // "location": "path",
  86240. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86241. // "required": true,
  86242. // "type": "string"
  86243. // },
  86244. // "zone": {
  86245. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  86246. // "location": "path",
  86247. // "required": true,
  86248. // "type": "string"
  86249. // }
  86250. // },
  86251. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  86252. // "response": {
  86253. // "$ref": "NetworkEndpointGroup"
  86254. // },
  86255. // "scopes": [
  86256. // "https://www.googleapis.com/auth/cloud-platform",
  86257. // "https://www.googleapis.com/auth/compute",
  86258. // "https://www.googleapis.com/auth/compute.readonly"
  86259. // ]
  86260. // }
  86261. }
  86262. // method id "compute.networkEndpointGroups.insert":
  86263. type NetworkEndpointGroupsInsertCall struct {
  86264. s *Service
  86265. project string
  86266. zone string
  86267. networkendpointgroup *NetworkEndpointGroup
  86268. urlParams_ gensupport.URLParams
  86269. ctx_ context.Context
  86270. header_ http.Header
  86271. }
  86272. // Insert: Creates a network endpoint group in the specified project
  86273. // using the parameters that are included in the request.
  86274. func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall {
  86275. c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86276. c.project = project
  86277. c.zone = zone
  86278. c.networkendpointgroup = networkendpointgroup
  86279. return c
  86280. }
  86281. // RequestId sets the optional parameter "requestId": An optional
  86282. // request ID to identify requests. Specify a unique request ID so that
  86283. // if you must retry your request, the server will know to ignore the
  86284. // request if it has already been completed.
  86285. //
  86286. // For example, consider a situation where you make an initial request
  86287. // and the request times out. If you make the request again with the
  86288. // same request ID, the server can check if original operation with the
  86289. // same request ID was received, and if so, will ignore the second
  86290. // request. This prevents clients from accidentally creating duplicate
  86291. // commitments.
  86292. //
  86293. // The request ID must be a valid UUID with the exception that zero UUID
  86294. // is not supported (00000000-0000-0000-0000-000000000000).
  86295. func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall {
  86296. c.urlParams_.Set("requestId", requestId)
  86297. return c
  86298. }
  86299. // Fields allows partial responses to be retrieved. See
  86300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86301. // for more information.
  86302. func (c *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall {
  86303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86304. return c
  86305. }
  86306. // Context sets the context to be used in this call's Do method. Any
  86307. // pending HTTP request will be aborted if the provided context is
  86308. // canceled.
  86309. func (c *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall {
  86310. c.ctx_ = ctx
  86311. return c
  86312. }
  86313. // Header returns an http.Header that can be modified by the caller to
  86314. // add HTTP headers to the request.
  86315. func (c *NetworkEndpointGroupsInsertCall) Header() http.Header {
  86316. if c.header_ == nil {
  86317. c.header_ = make(http.Header)
  86318. }
  86319. return c.header_
  86320. }
  86321. func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  86322. reqHeaders := make(http.Header)
  86323. for k, v := range c.header_ {
  86324. reqHeaders[k] = v
  86325. }
  86326. reqHeaders.Set("User-Agent", c.s.userAgent())
  86327. var body io.Reader = nil
  86328. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
  86329. if err != nil {
  86330. return nil, err
  86331. }
  86332. reqHeaders.Set("Content-Type", "application/json")
  86333. c.urlParams_.Set("alt", alt)
  86334. c.urlParams_.Set("prettyPrint", "false")
  86335. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  86336. urls += "?" + c.urlParams_.Encode()
  86337. req, err := http.NewRequest("POST", urls, body)
  86338. if err != nil {
  86339. return nil, err
  86340. }
  86341. req.Header = reqHeaders
  86342. googleapi.Expand(req.URL, map[string]string{
  86343. "project": c.project,
  86344. "zone": c.zone,
  86345. })
  86346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86347. }
  86348. // Do executes the "compute.networkEndpointGroups.insert" call.
  86349. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86350. // status code is an error. Response headers are in either
  86351. // *Operation.ServerResponse.Header or (if a response was returned at
  86352. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86353. // to check whether the returned error was because
  86354. // http.StatusNotModified was returned.
  86355. func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86356. gensupport.SetOptions(c.urlParams_, opts...)
  86357. res, err := c.doRequest("json")
  86358. if res != nil && res.StatusCode == http.StatusNotModified {
  86359. if res.Body != nil {
  86360. res.Body.Close()
  86361. }
  86362. return nil, &googleapi.Error{
  86363. Code: res.StatusCode,
  86364. Header: res.Header,
  86365. }
  86366. }
  86367. if err != nil {
  86368. return nil, err
  86369. }
  86370. defer googleapi.CloseBody(res)
  86371. if err := googleapi.CheckResponse(res); err != nil {
  86372. return nil, err
  86373. }
  86374. ret := &Operation{
  86375. ServerResponse: googleapi.ServerResponse{
  86376. Header: res.Header,
  86377. HTTPStatusCode: res.StatusCode,
  86378. },
  86379. }
  86380. target := &ret
  86381. if err := gensupport.DecodeResponse(target, res); err != nil {
  86382. return nil, err
  86383. }
  86384. return ret, nil
  86385. // {
  86386. // "description": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
  86387. // "httpMethod": "POST",
  86388. // "id": "compute.networkEndpointGroups.insert",
  86389. // "parameterOrder": [
  86390. // "project",
  86391. // "zone"
  86392. // ],
  86393. // "parameters": {
  86394. // "project": {
  86395. // "description": "Project ID for this request.",
  86396. // "location": "path",
  86397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86398. // "required": true,
  86399. // "type": "string"
  86400. // },
  86401. // "requestId": {
  86402. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86403. // "location": "query",
  86404. // "type": "string"
  86405. // },
  86406. // "zone": {
  86407. // "description": "The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.",
  86408. // "location": "path",
  86409. // "required": true,
  86410. // "type": "string"
  86411. // }
  86412. // },
  86413. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  86414. // "request": {
  86415. // "$ref": "NetworkEndpointGroup"
  86416. // },
  86417. // "response": {
  86418. // "$ref": "Operation"
  86419. // },
  86420. // "scopes": [
  86421. // "https://www.googleapis.com/auth/cloud-platform",
  86422. // "https://www.googleapis.com/auth/compute"
  86423. // ]
  86424. // }
  86425. }
  86426. // method id "compute.networkEndpointGroups.list":
  86427. type NetworkEndpointGroupsListCall struct {
  86428. s *Service
  86429. project string
  86430. zone string
  86431. urlParams_ gensupport.URLParams
  86432. ifNoneMatch_ string
  86433. ctx_ context.Context
  86434. header_ http.Header
  86435. }
  86436. // List: Retrieves the list of network endpoint groups that are located
  86437. // in the specified project and zone.
  86438. func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall {
  86439. c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86440. c.project = project
  86441. c.zone = zone
  86442. return c
  86443. }
  86444. // Filter sets the optional parameter "filter": A filter expression that
  86445. // filters resources listed in the response. The expression must specify
  86446. // the field name, a comparison operator, and the value that you want to
  86447. // use for filtering. The value must be a string, a number, or a
  86448. // boolean. The comparison operator must be either =, !=, >, or <.
  86449. //
  86450. // For example, if you are filtering Compute Engine instances, you can
  86451. // exclude instances named example-instance by specifying name !=
  86452. // example-instance.
  86453. //
  86454. // You can also filter nested fields. For example, you could specify
  86455. // scheduling.automaticRestart = false to include instances only if they
  86456. // are not scheduled for automatic restarts. You can use filtering on
  86457. // nested fields to filter based on resource labels.
  86458. //
  86459. // To filter on multiple expressions, provide each separate expression
  86460. // within parentheses. For example, (scheduling.automaticRestart = true)
  86461. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86462. // AND expression. However, you can include AND and OR expressions
  86463. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86464. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86465. // true).
  86466. func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall {
  86467. c.urlParams_.Set("filter", filter)
  86468. return c
  86469. }
  86470. // MaxResults sets the optional parameter "maxResults": The maximum
  86471. // number of results per page that should be returned. If the number of
  86472. // available results is larger than maxResults, Compute Engine returns a
  86473. // nextPageToken that can be used to get the next page of results in
  86474. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86475. // (Default: 500)
  86476. func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall {
  86477. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86478. return c
  86479. }
  86480. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86481. // a certain order. By default, results are returned in alphanumerical
  86482. // order based on the resource name.
  86483. //
  86484. // You can also sort results in descending order based on the creation
  86485. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86486. // based on the creationTimestamp field in reverse chronological order
  86487. // (newest result first). Use this to sort resources like operations so
  86488. // that the newest operation is returned first.
  86489. //
  86490. // Currently, only sorting by name or creationTimestamp desc is
  86491. // supported.
  86492. func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall {
  86493. c.urlParams_.Set("orderBy", orderBy)
  86494. return c
  86495. }
  86496. // PageToken sets the optional parameter "pageToken": Specifies a page
  86497. // token to use. Set pageToken to the nextPageToken returned by a
  86498. // previous list request to get the next page of results.
  86499. func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall {
  86500. c.urlParams_.Set("pageToken", pageToken)
  86501. return c
  86502. }
  86503. // Fields allows partial responses to be retrieved. See
  86504. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86505. // for more information.
  86506. func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall {
  86507. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86508. return c
  86509. }
  86510. // IfNoneMatch sets the optional parameter which makes the operation
  86511. // fail if the object's ETag matches the given value. This is useful for
  86512. // getting updates only after the object has changed since the last
  86513. // request. Use googleapi.IsNotModified to check whether the response
  86514. // error from Do is the result of In-None-Match.
  86515. func (c *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall {
  86516. c.ifNoneMatch_ = entityTag
  86517. return c
  86518. }
  86519. // Context sets the context to be used in this call's Do method. Any
  86520. // pending HTTP request will be aborted if the provided context is
  86521. // canceled.
  86522. func (c *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall {
  86523. c.ctx_ = ctx
  86524. return c
  86525. }
  86526. // Header returns an http.Header that can be modified by the caller to
  86527. // add HTTP headers to the request.
  86528. func (c *NetworkEndpointGroupsListCall) Header() http.Header {
  86529. if c.header_ == nil {
  86530. c.header_ = make(http.Header)
  86531. }
  86532. return c.header_
  86533. }
  86534. func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
  86535. reqHeaders := make(http.Header)
  86536. for k, v := range c.header_ {
  86537. reqHeaders[k] = v
  86538. }
  86539. reqHeaders.Set("User-Agent", c.s.userAgent())
  86540. if c.ifNoneMatch_ != "" {
  86541. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86542. }
  86543. var body io.Reader = nil
  86544. c.urlParams_.Set("alt", alt)
  86545. c.urlParams_.Set("prettyPrint", "false")
  86546. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  86547. urls += "?" + c.urlParams_.Encode()
  86548. req, err := http.NewRequest("GET", urls, body)
  86549. if err != nil {
  86550. return nil, err
  86551. }
  86552. req.Header = reqHeaders
  86553. googleapi.Expand(req.URL, map[string]string{
  86554. "project": c.project,
  86555. "zone": c.zone,
  86556. })
  86557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86558. }
  86559. // Do executes the "compute.networkEndpointGroups.list" call.
  86560. // Exactly one of *NetworkEndpointGroupList or error will be non-nil.
  86561. // Any non-2xx status code is an error. Response headers are in either
  86562. // *NetworkEndpointGroupList.ServerResponse.Header or (if a response was
  86563. // returned at all) in error.(*googleapi.Error).Header. Use
  86564. // googleapi.IsNotModified to check whether the returned error was
  86565. // because http.StatusNotModified was returned.
  86566. func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) {
  86567. gensupport.SetOptions(c.urlParams_, opts...)
  86568. res, err := c.doRequest("json")
  86569. if res != nil && res.StatusCode == http.StatusNotModified {
  86570. if res.Body != nil {
  86571. res.Body.Close()
  86572. }
  86573. return nil, &googleapi.Error{
  86574. Code: res.StatusCode,
  86575. Header: res.Header,
  86576. }
  86577. }
  86578. if err != nil {
  86579. return nil, err
  86580. }
  86581. defer googleapi.CloseBody(res)
  86582. if err := googleapi.CheckResponse(res); err != nil {
  86583. return nil, err
  86584. }
  86585. ret := &NetworkEndpointGroupList{
  86586. ServerResponse: googleapi.ServerResponse{
  86587. Header: res.Header,
  86588. HTTPStatusCode: res.StatusCode,
  86589. },
  86590. }
  86591. target := &ret
  86592. if err := gensupport.DecodeResponse(target, res); err != nil {
  86593. return nil, err
  86594. }
  86595. return ret, nil
  86596. // {
  86597. // "description": "Retrieves the list of network endpoint groups that are located in the specified project and zone.",
  86598. // "httpMethod": "GET",
  86599. // "id": "compute.networkEndpointGroups.list",
  86600. // "parameterOrder": [
  86601. // "project",
  86602. // "zone"
  86603. // ],
  86604. // "parameters": {
  86605. // "filter": {
  86606. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  86607. // "location": "query",
  86608. // "type": "string"
  86609. // },
  86610. // "maxResults": {
  86611. // "default": "500",
  86612. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  86613. // "format": "uint32",
  86614. // "location": "query",
  86615. // "minimum": "0",
  86616. // "type": "integer"
  86617. // },
  86618. // "orderBy": {
  86619. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  86620. // "location": "query",
  86621. // "type": "string"
  86622. // },
  86623. // "pageToken": {
  86624. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  86625. // "location": "query",
  86626. // "type": "string"
  86627. // },
  86628. // "project": {
  86629. // "description": "Project ID for this request.",
  86630. // "location": "path",
  86631. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86632. // "required": true,
  86633. // "type": "string"
  86634. // },
  86635. // "zone": {
  86636. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  86637. // "location": "path",
  86638. // "required": true,
  86639. // "type": "string"
  86640. // }
  86641. // },
  86642. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  86643. // "response": {
  86644. // "$ref": "NetworkEndpointGroupList"
  86645. // },
  86646. // "scopes": [
  86647. // "https://www.googleapis.com/auth/cloud-platform",
  86648. // "https://www.googleapis.com/auth/compute",
  86649. // "https://www.googleapis.com/auth/compute.readonly"
  86650. // ]
  86651. // }
  86652. }
  86653. // Pages invokes f for each page of results.
  86654. // A non-nil error returned from f will halt the iteration.
  86655. // The provided context supersedes any context provided to the Context method.
  86656. func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error {
  86657. c.ctx_ = ctx
  86658. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86659. for {
  86660. x, err := c.Do()
  86661. if err != nil {
  86662. return err
  86663. }
  86664. if err := f(x); err != nil {
  86665. return err
  86666. }
  86667. if x.NextPageToken == "" {
  86668. return nil
  86669. }
  86670. c.PageToken(x.NextPageToken)
  86671. }
  86672. }
  86673. // method id "compute.networkEndpointGroups.listNetworkEndpoints":
  86674. type NetworkEndpointGroupsListNetworkEndpointsCall struct {
  86675. s *Service
  86676. project string
  86677. zone string
  86678. networkEndpointGroup string
  86679. networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest
  86680. urlParams_ gensupport.URLParams
  86681. ctx_ context.Context
  86682. header_ http.Header
  86683. }
  86684. // ListNetworkEndpoints: Lists the network endpoints in the specified
  86685. // network endpoint group.
  86686. func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall {
  86687. c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86688. c.project = project
  86689. c.zone = zone
  86690. c.networkEndpointGroup = networkEndpointGroup
  86691. c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest
  86692. return c
  86693. }
  86694. // Filter sets the optional parameter "filter": A filter expression that
  86695. // filters resources listed in the response. The expression must specify
  86696. // the field name, a comparison operator, and the value that you want to
  86697. // use for filtering. The value must be a string, a number, or a
  86698. // boolean. The comparison operator must be either =, !=, >, or <.
  86699. //
  86700. // For example, if you are filtering Compute Engine instances, you can
  86701. // exclude instances named example-instance by specifying name !=
  86702. // example-instance.
  86703. //
  86704. // You can also filter nested fields. For example, you could specify
  86705. // scheduling.automaticRestart = false to include instances only if they
  86706. // are not scheduled for automatic restarts. You can use filtering on
  86707. // nested fields to filter based on resource labels.
  86708. //
  86709. // To filter on multiple expressions, provide each separate expression
  86710. // within parentheses. For example, (scheduling.automaticRestart = true)
  86711. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86712. // AND expression. However, you can include AND and OR expressions
  86713. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86714. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86715. // true).
  86716. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  86717. c.urlParams_.Set("filter", filter)
  86718. return c
  86719. }
  86720. // MaxResults sets the optional parameter "maxResults": The maximum
  86721. // number of results per page that should be returned. If the number of
  86722. // available results is larger than maxResults, Compute Engine returns a
  86723. // nextPageToken that can be used to get the next page of results in
  86724. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86725. // (Default: 500)
  86726. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall {
  86727. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86728. return c
  86729. }
  86730. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86731. // a certain order. By default, results are returned in alphanumerical
  86732. // order based on the resource name.
  86733. //
  86734. // You can also sort results in descending order based on the creation
  86735. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86736. // based on the creationTimestamp field in reverse chronological order
  86737. // (newest result first). Use this to sort resources like operations so
  86738. // that the newest operation is returned first.
  86739. //
  86740. // Currently, only sorting by name or creationTimestamp desc is
  86741. // supported.
  86742. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  86743. c.urlParams_.Set("orderBy", orderBy)
  86744. return c
  86745. }
  86746. // PageToken sets the optional parameter "pageToken": Specifies a page
  86747. // token to use. Set pageToken to the nextPageToken returned by a
  86748. // previous list request to get the next page of results.
  86749. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  86750. c.urlParams_.Set("pageToken", pageToken)
  86751. return c
  86752. }
  86753. // Fields allows partial responses to be retrieved. See
  86754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86755. // for more information.
  86756. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall {
  86757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86758. return c
  86759. }
  86760. // Context sets the context to be used in this call's Do method. Any
  86761. // pending HTTP request will be aborted if the provided context is
  86762. // canceled.
  86763. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall {
  86764. c.ctx_ = ctx
  86765. return c
  86766. }
  86767. // Header returns an http.Header that can be modified by the caller to
  86768. // add HTTP headers to the request.
  86769. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
  86770. if c.header_ == nil {
  86771. c.header_ = make(http.Header)
  86772. }
  86773. return c.header_
  86774. }
  86775. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  86776. reqHeaders := make(http.Header)
  86777. for k, v := range c.header_ {
  86778. reqHeaders[k] = v
  86779. }
  86780. reqHeaders.Set("User-Agent", c.s.userAgent())
  86781. var body io.Reader = nil
  86782. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest)
  86783. if err != nil {
  86784. return nil, err
  86785. }
  86786. reqHeaders.Set("Content-Type", "application/json")
  86787. c.urlParams_.Set("alt", alt)
  86788. c.urlParams_.Set("prettyPrint", "false")
  86789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
  86790. urls += "?" + c.urlParams_.Encode()
  86791. req, err := http.NewRequest("POST", urls, body)
  86792. if err != nil {
  86793. return nil, err
  86794. }
  86795. req.Header = reqHeaders
  86796. googleapi.Expand(req.URL, map[string]string{
  86797. "project": c.project,
  86798. "zone": c.zone,
  86799. "networkEndpointGroup": c.networkEndpointGroup,
  86800. })
  86801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86802. }
  86803. // Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call.
  86804. // Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
  86805. // will be non-nil. Any non-2xx status code is an error. Response
  86806. // headers are in either
  86807. // *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or
  86808. // (if a response was returned at all) in
  86809. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  86810. // whether the returned error was because http.StatusNotModified was
  86811. // returned.
  86812. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) {
  86813. gensupport.SetOptions(c.urlParams_, opts...)
  86814. res, err := c.doRequest("json")
  86815. if res != nil && res.StatusCode == http.StatusNotModified {
  86816. if res.Body != nil {
  86817. res.Body.Close()
  86818. }
  86819. return nil, &googleapi.Error{
  86820. Code: res.StatusCode,
  86821. Header: res.Header,
  86822. }
  86823. }
  86824. if err != nil {
  86825. return nil, err
  86826. }
  86827. defer googleapi.CloseBody(res)
  86828. if err := googleapi.CheckResponse(res); err != nil {
  86829. return nil, err
  86830. }
  86831. ret := &NetworkEndpointGroupsListNetworkEndpoints{
  86832. ServerResponse: googleapi.ServerResponse{
  86833. Header: res.Header,
  86834. HTTPStatusCode: res.StatusCode,
  86835. },
  86836. }
  86837. target := &ret
  86838. if err := gensupport.DecodeResponse(target, res); err != nil {
  86839. return nil, err
  86840. }
  86841. return ret, nil
  86842. // {
  86843. // "description": "Lists the network endpoints in the specified network endpoint group.",
  86844. // "httpMethod": "POST",
  86845. // "id": "compute.networkEndpointGroups.listNetworkEndpoints",
  86846. // "parameterOrder": [
  86847. // "project",
  86848. // "zone",
  86849. // "networkEndpointGroup"
  86850. // ],
  86851. // "parameters": {
  86852. // "filter": {
  86853. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  86854. // "location": "query",
  86855. // "type": "string"
  86856. // },
  86857. // "maxResults": {
  86858. // "default": "500",
  86859. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  86860. // "format": "uint32",
  86861. // "location": "query",
  86862. // "minimum": "0",
  86863. // "type": "integer"
  86864. // },
  86865. // "networkEndpointGroup": {
  86866. // "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.",
  86867. // "location": "path",
  86868. // "required": true,
  86869. // "type": "string"
  86870. // },
  86871. // "orderBy": {
  86872. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  86873. // "location": "query",
  86874. // "type": "string"
  86875. // },
  86876. // "pageToken": {
  86877. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  86878. // "location": "query",
  86879. // "type": "string"
  86880. // },
  86881. // "project": {
  86882. // "description": "Project ID for this request.",
  86883. // "location": "path",
  86884. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86885. // "required": true,
  86886. // "type": "string"
  86887. // },
  86888. // "zone": {
  86889. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  86890. // "location": "path",
  86891. // "required": true,
  86892. // "type": "string"
  86893. // }
  86894. // },
  86895. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
  86896. // "request": {
  86897. // "$ref": "NetworkEndpointGroupsListEndpointsRequest"
  86898. // },
  86899. // "response": {
  86900. // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
  86901. // },
  86902. // "scopes": [
  86903. // "https://www.googleapis.com/auth/cloud-platform",
  86904. // "https://www.googleapis.com/auth/compute",
  86905. // "https://www.googleapis.com/auth/compute.readonly"
  86906. // ]
  86907. // }
  86908. }
  86909. // Pages invokes f for each page of results.
  86910. // A non-nil error returned from f will halt the iteration.
  86911. // The provided context supersedes any context provided to the Context method.
  86912. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error {
  86913. c.ctx_ = ctx
  86914. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86915. for {
  86916. x, err := c.Do()
  86917. if err != nil {
  86918. return err
  86919. }
  86920. if err := f(x); err != nil {
  86921. return err
  86922. }
  86923. if x.NextPageToken == "" {
  86924. return nil
  86925. }
  86926. c.PageToken(x.NextPageToken)
  86927. }
  86928. }
  86929. // method id "compute.networkEndpointGroups.testIamPermissions":
  86930. type NetworkEndpointGroupsTestIamPermissionsCall struct {
  86931. s *Service
  86932. project string
  86933. zone string
  86934. resource string
  86935. testpermissionsrequest *TestPermissionsRequest
  86936. urlParams_ gensupport.URLParams
  86937. ctx_ context.Context
  86938. header_ http.Header
  86939. }
  86940. // TestIamPermissions: Returns permissions that a caller has on the
  86941. // specified resource.
  86942. func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall {
  86943. c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86944. c.project = project
  86945. c.zone = zone
  86946. c.resource = resource
  86947. c.testpermissionsrequest = testpermissionsrequest
  86948. return c
  86949. }
  86950. // Fields allows partial responses to be retrieved. See
  86951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86952. // for more information.
  86953. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall {
  86954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86955. return c
  86956. }
  86957. // Context sets the context to be used in this call's Do method. Any
  86958. // pending HTTP request will be aborted if the provided context is
  86959. // canceled.
  86960. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall {
  86961. c.ctx_ = ctx
  86962. return c
  86963. }
  86964. // Header returns an http.Header that can be modified by the caller to
  86965. // add HTTP headers to the request.
  86966. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header {
  86967. if c.header_ == nil {
  86968. c.header_ = make(http.Header)
  86969. }
  86970. return c.header_
  86971. }
  86972. func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  86973. reqHeaders := make(http.Header)
  86974. for k, v := range c.header_ {
  86975. reqHeaders[k] = v
  86976. }
  86977. reqHeaders.Set("User-Agent", c.s.userAgent())
  86978. var body io.Reader = nil
  86979. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  86980. if err != nil {
  86981. return nil, err
  86982. }
  86983. reqHeaders.Set("Content-Type", "application/json")
  86984. c.urlParams_.Set("alt", alt)
  86985. c.urlParams_.Set("prettyPrint", "false")
  86986. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions")
  86987. urls += "?" + c.urlParams_.Encode()
  86988. req, err := http.NewRequest("POST", urls, body)
  86989. if err != nil {
  86990. return nil, err
  86991. }
  86992. req.Header = reqHeaders
  86993. googleapi.Expand(req.URL, map[string]string{
  86994. "project": c.project,
  86995. "zone": c.zone,
  86996. "resource": c.resource,
  86997. })
  86998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86999. }
  87000. // Do executes the "compute.networkEndpointGroups.testIamPermissions" call.
  87001. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  87002. // non-2xx status code is an error. Response headers are in either
  87003. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  87004. // returned at all) in error.(*googleapi.Error).Header. Use
  87005. // googleapi.IsNotModified to check whether the returned error was
  87006. // because http.StatusNotModified was returned.
  87007. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  87008. gensupport.SetOptions(c.urlParams_, opts...)
  87009. res, err := c.doRequest("json")
  87010. if res != nil && res.StatusCode == http.StatusNotModified {
  87011. if res.Body != nil {
  87012. res.Body.Close()
  87013. }
  87014. return nil, &googleapi.Error{
  87015. Code: res.StatusCode,
  87016. Header: res.Header,
  87017. }
  87018. }
  87019. if err != nil {
  87020. return nil, err
  87021. }
  87022. defer googleapi.CloseBody(res)
  87023. if err := googleapi.CheckResponse(res); err != nil {
  87024. return nil, err
  87025. }
  87026. ret := &TestPermissionsResponse{
  87027. ServerResponse: googleapi.ServerResponse{
  87028. Header: res.Header,
  87029. HTTPStatusCode: res.StatusCode,
  87030. },
  87031. }
  87032. target := &ret
  87033. if err := gensupport.DecodeResponse(target, res); err != nil {
  87034. return nil, err
  87035. }
  87036. return ret, nil
  87037. // {
  87038. // "description": "Returns permissions that a caller has on the specified resource.",
  87039. // "httpMethod": "POST",
  87040. // "id": "compute.networkEndpointGroups.testIamPermissions",
  87041. // "parameterOrder": [
  87042. // "project",
  87043. // "zone",
  87044. // "resource"
  87045. // ],
  87046. // "parameters": {
  87047. // "project": {
  87048. // "description": "Project ID for this request.",
  87049. // "location": "path",
  87050. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87051. // "required": true,
  87052. // "type": "string"
  87053. // },
  87054. // "resource": {
  87055. // "description": "Name or id of the resource for this request.",
  87056. // "location": "path",
  87057. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87058. // "required": true,
  87059. // "type": "string"
  87060. // },
  87061. // "zone": {
  87062. // "description": "The name of the zone for this request.",
  87063. // "location": "path",
  87064. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87065. // "required": true,
  87066. // "type": "string"
  87067. // }
  87068. // },
  87069. // "path": "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions",
  87070. // "request": {
  87071. // "$ref": "TestPermissionsRequest"
  87072. // },
  87073. // "response": {
  87074. // "$ref": "TestPermissionsResponse"
  87075. // },
  87076. // "scopes": [
  87077. // "https://www.googleapis.com/auth/cloud-platform",
  87078. // "https://www.googleapis.com/auth/compute",
  87079. // "https://www.googleapis.com/auth/compute.readonly"
  87080. // ]
  87081. // }
  87082. }
  87083. // method id "compute.networks.addPeering":
  87084. type NetworksAddPeeringCall struct {
  87085. s *Service
  87086. project string
  87087. network string
  87088. networksaddpeeringrequest *NetworksAddPeeringRequest
  87089. urlParams_ gensupport.URLParams
  87090. ctx_ context.Context
  87091. header_ http.Header
  87092. }
  87093. // AddPeering: Adds a peering to the specified network.
  87094. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  87095. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87096. c.project = project
  87097. c.network = network
  87098. c.networksaddpeeringrequest = networksaddpeeringrequest
  87099. return c
  87100. }
  87101. // RequestId sets the optional parameter "requestId": An optional
  87102. // request ID to identify requests. Specify a unique request ID so that
  87103. // if you must retry your request, the server will know to ignore the
  87104. // request if it has already been completed.
  87105. //
  87106. // For example, consider a situation where you make an initial request
  87107. // and the request times out. If you make the request again with the
  87108. // same request ID, the server can check if original operation with the
  87109. // same request ID was received, and if so, will ignore the second
  87110. // request. This prevents clients from accidentally creating duplicate
  87111. // commitments.
  87112. //
  87113. // The request ID must be a valid UUID with the exception that zero UUID
  87114. // is not supported (00000000-0000-0000-0000-000000000000).
  87115. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  87116. c.urlParams_.Set("requestId", requestId)
  87117. return c
  87118. }
  87119. // Fields allows partial responses to be retrieved. See
  87120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87121. // for more information.
  87122. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  87123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87124. return c
  87125. }
  87126. // Context sets the context to be used in this call's Do method. Any
  87127. // pending HTTP request will be aborted if the provided context is
  87128. // canceled.
  87129. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  87130. c.ctx_ = ctx
  87131. return c
  87132. }
  87133. // Header returns an http.Header that can be modified by the caller to
  87134. // add HTTP headers to the request.
  87135. func (c *NetworksAddPeeringCall) Header() http.Header {
  87136. if c.header_ == nil {
  87137. c.header_ = make(http.Header)
  87138. }
  87139. return c.header_
  87140. }
  87141. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  87142. reqHeaders := make(http.Header)
  87143. for k, v := range c.header_ {
  87144. reqHeaders[k] = v
  87145. }
  87146. reqHeaders.Set("User-Agent", c.s.userAgent())
  87147. var body io.Reader = nil
  87148. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  87149. if err != nil {
  87150. return nil, err
  87151. }
  87152. reqHeaders.Set("Content-Type", "application/json")
  87153. c.urlParams_.Set("alt", alt)
  87154. c.urlParams_.Set("prettyPrint", "false")
  87155. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  87156. urls += "?" + c.urlParams_.Encode()
  87157. req, err := http.NewRequest("POST", urls, body)
  87158. if err != nil {
  87159. return nil, err
  87160. }
  87161. req.Header = reqHeaders
  87162. googleapi.Expand(req.URL, map[string]string{
  87163. "project": c.project,
  87164. "network": c.network,
  87165. })
  87166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87167. }
  87168. // Do executes the "compute.networks.addPeering" call.
  87169. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87170. // status code is an error. Response headers are in either
  87171. // *Operation.ServerResponse.Header or (if a response was returned at
  87172. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87173. // to check whether the returned error was because
  87174. // http.StatusNotModified was returned.
  87175. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87176. gensupport.SetOptions(c.urlParams_, opts...)
  87177. res, err := c.doRequest("json")
  87178. if res != nil && res.StatusCode == http.StatusNotModified {
  87179. if res.Body != nil {
  87180. res.Body.Close()
  87181. }
  87182. return nil, &googleapi.Error{
  87183. Code: res.StatusCode,
  87184. Header: res.Header,
  87185. }
  87186. }
  87187. if err != nil {
  87188. return nil, err
  87189. }
  87190. defer googleapi.CloseBody(res)
  87191. if err := googleapi.CheckResponse(res); err != nil {
  87192. return nil, err
  87193. }
  87194. ret := &Operation{
  87195. ServerResponse: googleapi.ServerResponse{
  87196. Header: res.Header,
  87197. HTTPStatusCode: res.StatusCode,
  87198. },
  87199. }
  87200. target := &ret
  87201. if err := gensupport.DecodeResponse(target, res); err != nil {
  87202. return nil, err
  87203. }
  87204. return ret, nil
  87205. // {
  87206. // "description": "Adds a peering to the specified network.",
  87207. // "httpMethod": "POST",
  87208. // "id": "compute.networks.addPeering",
  87209. // "parameterOrder": [
  87210. // "project",
  87211. // "network"
  87212. // ],
  87213. // "parameters": {
  87214. // "network": {
  87215. // "description": "Name of the network resource to add peering to.",
  87216. // "location": "path",
  87217. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87218. // "required": true,
  87219. // "type": "string"
  87220. // },
  87221. // "project": {
  87222. // "description": "Project ID for this request.",
  87223. // "location": "path",
  87224. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87225. // "required": true,
  87226. // "type": "string"
  87227. // },
  87228. // "requestId": {
  87229. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87230. // "location": "query",
  87231. // "type": "string"
  87232. // }
  87233. // },
  87234. // "path": "{project}/global/networks/{network}/addPeering",
  87235. // "request": {
  87236. // "$ref": "NetworksAddPeeringRequest"
  87237. // },
  87238. // "response": {
  87239. // "$ref": "Operation"
  87240. // },
  87241. // "scopes": [
  87242. // "https://www.googleapis.com/auth/cloud-platform",
  87243. // "https://www.googleapis.com/auth/compute"
  87244. // ]
  87245. // }
  87246. }
  87247. // method id "compute.networks.delete":
  87248. type NetworksDeleteCall struct {
  87249. s *Service
  87250. project string
  87251. network string
  87252. urlParams_ gensupport.URLParams
  87253. ctx_ context.Context
  87254. header_ http.Header
  87255. }
  87256. // Delete: Deletes the specified network.
  87257. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  87258. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  87259. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87260. c.project = project
  87261. c.network = network
  87262. return c
  87263. }
  87264. // RequestId sets the optional parameter "requestId": An optional
  87265. // request ID to identify requests. Specify a unique request ID so that
  87266. // if you must retry your request, the server will know to ignore the
  87267. // request if it has already been completed.
  87268. //
  87269. // For example, consider a situation where you make an initial request
  87270. // and the request times out. If you make the request again with the
  87271. // same request ID, the server can check if original operation with the
  87272. // same request ID was received, and if so, will ignore the second
  87273. // request. This prevents clients from accidentally creating duplicate
  87274. // commitments.
  87275. //
  87276. // The request ID must be a valid UUID with the exception that zero UUID
  87277. // is not supported (00000000-0000-0000-0000-000000000000).
  87278. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  87279. c.urlParams_.Set("requestId", requestId)
  87280. return c
  87281. }
  87282. // Fields allows partial responses to be retrieved. See
  87283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87284. // for more information.
  87285. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  87286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87287. return c
  87288. }
  87289. // Context sets the context to be used in this call's Do method. Any
  87290. // pending HTTP request will be aborted if the provided context is
  87291. // canceled.
  87292. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  87293. c.ctx_ = ctx
  87294. return c
  87295. }
  87296. // Header returns an http.Header that can be modified by the caller to
  87297. // add HTTP headers to the request.
  87298. func (c *NetworksDeleteCall) Header() http.Header {
  87299. if c.header_ == nil {
  87300. c.header_ = make(http.Header)
  87301. }
  87302. return c.header_
  87303. }
  87304. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  87305. reqHeaders := make(http.Header)
  87306. for k, v := range c.header_ {
  87307. reqHeaders[k] = v
  87308. }
  87309. reqHeaders.Set("User-Agent", c.s.userAgent())
  87310. var body io.Reader = nil
  87311. c.urlParams_.Set("alt", alt)
  87312. c.urlParams_.Set("prettyPrint", "false")
  87313. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  87314. urls += "?" + c.urlParams_.Encode()
  87315. req, err := http.NewRequest("DELETE", urls, body)
  87316. if err != nil {
  87317. return nil, err
  87318. }
  87319. req.Header = reqHeaders
  87320. googleapi.Expand(req.URL, map[string]string{
  87321. "project": c.project,
  87322. "network": c.network,
  87323. })
  87324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87325. }
  87326. // Do executes the "compute.networks.delete" call.
  87327. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87328. // status code is an error. Response headers are in either
  87329. // *Operation.ServerResponse.Header or (if a response was returned at
  87330. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87331. // to check whether the returned error was because
  87332. // http.StatusNotModified was returned.
  87333. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87334. gensupport.SetOptions(c.urlParams_, opts...)
  87335. res, err := c.doRequest("json")
  87336. if res != nil && res.StatusCode == http.StatusNotModified {
  87337. if res.Body != nil {
  87338. res.Body.Close()
  87339. }
  87340. return nil, &googleapi.Error{
  87341. Code: res.StatusCode,
  87342. Header: res.Header,
  87343. }
  87344. }
  87345. if err != nil {
  87346. return nil, err
  87347. }
  87348. defer googleapi.CloseBody(res)
  87349. if err := googleapi.CheckResponse(res); err != nil {
  87350. return nil, err
  87351. }
  87352. ret := &Operation{
  87353. ServerResponse: googleapi.ServerResponse{
  87354. Header: res.Header,
  87355. HTTPStatusCode: res.StatusCode,
  87356. },
  87357. }
  87358. target := &ret
  87359. if err := gensupport.DecodeResponse(target, res); err != nil {
  87360. return nil, err
  87361. }
  87362. return ret, nil
  87363. // {
  87364. // "description": "Deletes the specified network.",
  87365. // "httpMethod": "DELETE",
  87366. // "id": "compute.networks.delete",
  87367. // "parameterOrder": [
  87368. // "project",
  87369. // "network"
  87370. // ],
  87371. // "parameters": {
  87372. // "network": {
  87373. // "description": "Name of the network to delete.",
  87374. // "location": "path",
  87375. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87376. // "required": true,
  87377. // "type": "string"
  87378. // },
  87379. // "project": {
  87380. // "description": "Project ID for this request.",
  87381. // "location": "path",
  87382. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87383. // "required": true,
  87384. // "type": "string"
  87385. // },
  87386. // "requestId": {
  87387. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87388. // "location": "query",
  87389. // "type": "string"
  87390. // }
  87391. // },
  87392. // "path": "{project}/global/networks/{network}",
  87393. // "response": {
  87394. // "$ref": "Operation"
  87395. // },
  87396. // "scopes": [
  87397. // "https://www.googleapis.com/auth/cloud-platform",
  87398. // "https://www.googleapis.com/auth/compute"
  87399. // ]
  87400. // }
  87401. }
  87402. // method id "compute.networks.get":
  87403. type NetworksGetCall struct {
  87404. s *Service
  87405. project string
  87406. network string
  87407. urlParams_ gensupport.URLParams
  87408. ifNoneMatch_ string
  87409. ctx_ context.Context
  87410. header_ http.Header
  87411. }
  87412. // Get: Returns the specified network. Gets a list of available networks
  87413. // by making a list() request.
  87414. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  87415. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  87416. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87417. c.project = project
  87418. c.network = network
  87419. return c
  87420. }
  87421. // Fields allows partial responses to be retrieved. See
  87422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87423. // for more information.
  87424. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  87425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87426. return c
  87427. }
  87428. // IfNoneMatch sets the optional parameter which makes the operation
  87429. // fail if the object's ETag matches the given value. This is useful for
  87430. // getting updates only after the object has changed since the last
  87431. // request. Use googleapi.IsNotModified to check whether the response
  87432. // error from Do is the result of In-None-Match.
  87433. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  87434. c.ifNoneMatch_ = entityTag
  87435. return c
  87436. }
  87437. // Context sets the context to be used in this call's Do method. Any
  87438. // pending HTTP request will be aborted if the provided context is
  87439. // canceled.
  87440. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  87441. c.ctx_ = ctx
  87442. return c
  87443. }
  87444. // Header returns an http.Header that can be modified by the caller to
  87445. // add HTTP headers to the request.
  87446. func (c *NetworksGetCall) Header() http.Header {
  87447. if c.header_ == nil {
  87448. c.header_ = make(http.Header)
  87449. }
  87450. return c.header_
  87451. }
  87452. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  87453. reqHeaders := make(http.Header)
  87454. for k, v := range c.header_ {
  87455. reqHeaders[k] = v
  87456. }
  87457. reqHeaders.Set("User-Agent", c.s.userAgent())
  87458. if c.ifNoneMatch_ != "" {
  87459. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87460. }
  87461. var body io.Reader = nil
  87462. c.urlParams_.Set("alt", alt)
  87463. c.urlParams_.Set("prettyPrint", "false")
  87464. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  87465. urls += "?" + c.urlParams_.Encode()
  87466. req, err := http.NewRequest("GET", urls, body)
  87467. if err != nil {
  87468. return nil, err
  87469. }
  87470. req.Header = reqHeaders
  87471. googleapi.Expand(req.URL, map[string]string{
  87472. "project": c.project,
  87473. "network": c.network,
  87474. })
  87475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87476. }
  87477. // Do executes the "compute.networks.get" call.
  87478. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  87479. // code is an error. Response headers are in either
  87480. // *Network.ServerResponse.Header or (if a response was returned at all)
  87481. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  87482. // check whether the returned error was because http.StatusNotModified
  87483. // was returned.
  87484. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  87485. gensupport.SetOptions(c.urlParams_, opts...)
  87486. res, err := c.doRequest("json")
  87487. if res != nil && res.StatusCode == http.StatusNotModified {
  87488. if res.Body != nil {
  87489. res.Body.Close()
  87490. }
  87491. return nil, &googleapi.Error{
  87492. Code: res.StatusCode,
  87493. Header: res.Header,
  87494. }
  87495. }
  87496. if err != nil {
  87497. return nil, err
  87498. }
  87499. defer googleapi.CloseBody(res)
  87500. if err := googleapi.CheckResponse(res); err != nil {
  87501. return nil, err
  87502. }
  87503. ret := &Network{
  87504. ServerResponse: googleapi.ServerResponse{
  87505. Header: res.Header,
  87506. HTTPStatusCode: res.StatusCode,
  87507. },
  87508. }
  87509. target := &ret
  87510. if err := gensupport.DecodeResponse(target, res); err != nil {
  87511. return nil, err
  87512. }
  87513. return ret, nil
  87514. // {
  87515. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  87516. // "httpMethod": "GET",
  87517. // "id": "compute.networks.get",
  87518. // "parameterOrder": [
  87519. // "project",
  87520. // "network"
  87521. // ],
  87522. // "parameters": {
  87523. // "network": {
  87524. // "description": "Name of the network to return.",
  87525. // "location": "path",
  87526. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87527. // "required": true,
  87528. // "type": "string"
  87529. // },
  87530. // "project": {
  87531. // "description": "Project ID for this request.",
  87532. // "location": "path",
  87533. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87534. // "required": true,
  87535. // "type": "string"
  87536. // }
  87537. // },
  87538. // "path": "{project}/global/networks/{network}",
  87539. // "response": {
  87540. // "$ref": "Network"
  87541. // },
  87542. // "scopes": [
  87543. // "https://www.googleapis.com/auth/cloud-platform",
  87544. // "https://www.googleapis.com/auth/compute",
  87545. // "https://www.googleapis.com/auth/compute.readonly"
  87546. // ]
  87547. // }
  87548. }
  87549. // method id "compute.networks.getEffectiveFirewalls":
  87550. type NetworksGetEffectiveFirewallsCall struct {
  87551. s *Service
  87552. project string
  87553. network string
  87554. urlParams_ gensupport.URLParams
  87555. ifNoneMatch_ string
  87556. ctx_ context.Context
  87557. header_ http.Header
  87558. }
  87559. // GetEffectiveFirewalls: Returns the effective firewalls on a given
  87560. // network.
  87561. func (r *NetworksService) GetEffectiveFirewalls(project string, network string) *NetworksGetEffectiveFirewallsCall {
  87562. c := &NetworksGetEffectiveFirewallsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87563. c.project = project
  87564. c.network = network
  87565. return c
  87566. }
  87567. // Fields allows partial responses to be retrieved. See
  87568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87569. // for more information.
  87570. func (c *NetworksGetEffectiveFirewallsCall) Fields(s ...googleapi.Field) *NetworksGetEffectiveFirewallsCall {
  87571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87572. return c
  87573. }
  87574. // IfNoneMatch sets the optional parameter which makes the operation
  87575. // fail if the object's ETag matches the given value. This is useful for
  87576. // getting updates only after the object has changed since the last
  87577. // request. Use googleapi.IsNotModified to check whether the response
  87578. // error from Do is the result of In-None-Match.
  87579. func (c *NetworksGetEffectiveFirewallsCall) IfNoneMatch(entityTag string) *NetworksGetEffectiveFirewallsCall {
  87580. c.ifNoneMatch_ = entityTag
  87581. return c
  87582. }
  87583. // Context sets the context to be used in this call's Do method. Any
  87584. // pending HTTP request will be aborted if the provided context is
  87585. // canceled.
  87586. func (c *NetworksGetEffectiveFirewallsCall) Context(ctx context.Context) *NetworksGetEffectiveFirewallsCall {
  87587. c.ctx_ = ctx
  87588. return c
  87589. }
  87590. // Header returns an http.Header that can be modified by the caller to
  87591. // add HTTP headers to the request.
  87592. func (c *NetworksGetEffectiveFirewallsCall) Header() http.Header {
  87593. if c.header_ == nil {
  87594. c.header_ = make(http.Header)
  87595. }
  87596. return c.header_
  87597. }
  87598. func (c *NetworksGetEffectiveFirewallsCall) doRequest(alt string) (*http.Response, error) {
  87599. reqHeaders := make(http.Header)
  87600. for k, v := range c.header_ {
  87601. reqHeaders[k] = v
  87602. }
  87603. reqHeaders.Set("User-Agent", c.s.userAgent())
  87604. if c.ifNoneMatch_ != "" {
  87605. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87606. }
  87607. var body io.Reader = nil
  87608. c.urlParams_.Set("alt", alt)
  87609. c.urlParams_.Set("prettyPrint", "false")
  87610. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/getEffectiveFirewalls")
  87611. urls += "?" + c.urlParams_.Encode()
  87612. req, err := http.NewRequest("GET", urls, body)
  87613. if err != nil {
  87614. return nil, err
  87615. }
  87616. req.Header = reqHeaders
  87617. googleapi.Expand(req.URL, map[string]string{
  87618. "project": c.project,
  87619. "network": c.network,
  87620. })
  87621. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87622. }
  87623. // Do executes the "compute.networks.getEffectiveFirewalls" call.
  87624. // Exactly one of *NetworksGetEffectiveFirewallsResponse or error will
  87625. // be non-nil. Any non-2xx status code is an error. Response headers are
  87626. // in either
  87627. // *NetworksGetEffectiveFirewallsResponse.ServerResponse.Header or (if a
  87628. // response was returned at all) in error.(*googleapi.Error).Header. Use
  87629. // googleapi.IsNotModified to check whether the returned error was
  87630. // because http.StatusNotModified was returned.
  87631. func (c *NetworksGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*NetworksGetEffectiveFirewallsResponse, error) {
  87632. gensupport.SetOptions(c.urlParams_, opts...)
  87633. res, err := c.doRequest("json")
  87634. if res != nil && res.StatusCode == http.StatusNotModified {
  87635. if res.Body != nil {
  87636. res.Body.Close()
  87637. }
  87638. return nil, &googleapi.Error{
  87639. Code: res.StatusCode,
  87640. Header: res.Header,
  87641. }
  87642. }
  87643. if err != nil {
  87644. return nil, err
  87645. }
  87646. defer googleapi.CloseBody(res)
  87647. if err := googleapi.CheckResponse(res); err != nil {
  87648. return nil, err
  87649. }
  87650. ret := &NetworksGetEffectiveFirewallsResponse{
  87651. ServerResponse: googleapi.ServerResponse{
  87652. Header: res.Header,
  87653. HTTPStatusCode: res.StatusCode,
  87654. },
  87655. }
  87656. target := &ret
  87657. if err := gensupport.DecodeResponse(target, res); err != nil {
  87658. return nil, err
  87659. }
  87660. return ret, nil
  87661. // {
  87662. // "description": "Returns the effective firewalls on a given network.",
  87663. // "httpMethod": "GET",
  87664. // "id": "compute.networks.getEffectiveFirewalls",
  87665. // "parameterOrder": [
  87666. // "project",
  87667. // "network"
  87668. // ],
  87669. // "parameters": {
  87670. // "network": {
  87671. // "description": "Name of the network for this request.",
  87672. // "location": "path",
  87673. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87674. // "required": true,
  87675. // "type": "string"
  87676. // },
  87677. // "project": {
  87678. // "description": "Project ID for this request.",
  87679. // "location": "path",
  87680. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87681. // "required": true,
  87682. // "type": "string"
  87683. // }
  87684. // },
  87685. // "path": "{project}/global/networks/{network}/getEffectiveFirewalls",
  87686. // "response": {
  87687. // "$ref": "NetworksGetEffectiveFirewallsResponse"
  87688. // },
  87689. // "scopes": [
  87690. // "https://www.googleapis.com/auth/cloud-platform",
  87691. // "https://www.googleapis.com/auth/compute",
  87692. // "https://www.googleapis.com/auth/compute.readonly"
  87693. // ]
  87694. // }
  87695. }
  87696. // method id "compute.networks.insert":
  87697. type NetworksInsertCall struct {
  87698. s *Service
  87699. project string
  87700. network *Network
  87701. urlParams_ gensupport.URLParams
  87702. ctx_ context.Context
  87703. header_ http.Header
  87704. }
  87705. // Insert: Creates a network in the specified project using the data
  87706. // included in the request.
  87707. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  87708. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  87709. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87710. c.project = project
  87711. c.network = network
  87712. return c
  87713. }
  87714. // RequestId sets the optional parameter "requestId": An optional
  87715. // request ID to identify requests. Specify a unique request ID so that
  87716. // if you must retry your request, the server will know to ignore the
  87717. // request if it has already been completed.
  87718. //
  87719. // For example, consider a situation where you make an initial request
  87720. // and the request times out. If you make the request again with the
  87721. // same request ID, the server can check if original operation with the
  87722. // same request ID was received, and if so, will ignore the second
  87723. // request. This prevents clients from accidentally creating duplicate
  87724. // commitments.
  87725. //
  87726. // The request ID must be a valid UUID with the exception that zero UUID
  87727. // is not supported (00000000-0000-0000-0000-000000000000).
  87728. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  87729. c.urlParams_.Set("requestId", requestId)
  87730. return c
  87731. }
  87732. // Fields allows partial responses to be retrieved. See
  87733. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87734. // for more information.
  87735. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  87736. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87737. return c
  87738. }
  87739. // Context sets the context to be used in this call's Do method. Any
  87740. // pending HTTP request will be aborted if the provided context is
  87741. // canceled.
  87742. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  87743. c.ctx_ = ctx
  87744. return c
  87745. }
  87746. // Header returns an http.Header that can be modified by the caller to
  87747. // add HTTP headers to the request.
  87748. func (c *NetworksInsertCall) Header() http.Header {
  87749. if c.header_ == nil {
  87750. c.header_ = make(http.Header)
  87751. }
  87752. return c.header_
  87753. }
  87754. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  87755. reqHeaders := make(http.Header)
  87756. for k, v := range c.header_ {
  87757. reqHeaders[k] = v
  87758. }
  87759. reqHeaders.Set("User-Agent", c.s.userAgent())
  87760. var body io.Reader = nil
  87761. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  87762. if err != nil {
  87763. return nil, err
  87764. }
  87765. reqHeaders.Set("Content-Type", "application/json")
  87766. c.urlParams_.Set("alt", alt)
  87767. c.urlParams_.Set("prettyPrint", "false")
  87768. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  87769. urls += "?" + c.urlParams_.Encode()
  87770. req, err := http.NewRequest("POST", 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. })
  87778. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87779. }
  87780. // Do executes the "compute.networks.insert" call.
  87781. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87782. // status code is an error. Response headers are in either
  87783. // *Operation.ServerResponse.Header or (if a response was returned at
  87784. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87785. // to check whether the returned error was because
  87786. // http.StatusNotModified was returned.
  87787. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87788. gensupport.SetOptions(c.urlParams_, opts...)
  87789. res, err := c.doRequest("json")
  87790. if res != nil && res.StatusCode == http.StatusNotModified {
  87791. if res.Body != nil {
  87792. res.Body.Close()
  87793. }
  87794. return nil, &googleapi.Error{
  87795. Code: res.StatusCode,
  87796. Header: res.Header,
  87797. }
  87798. }
  87799. if err != nil {
  87800. return nil, err
  87801. }
  87802. defer googleapi.CloseBody(res)
  87803. if err := googleapi.CheckResponse(res); err != nil {
  87804. return nil, err
  87805. }
  87806. ret := &Operation{
  87807. ServerResponse: googleapi.ServerResponse{
  87808. Header: res.Header,
  87809. HTTPStatusCode: res.StatusCode,
  87810. },
  87811. }
  87812. target := &ret
  87813. if err := gensupport.DecodeResponse(target, res); err != nil {
  87814. return nil, err
  87815. }
  87816. return ret, nil
  87817. // {
  87818. // "description": "Creates a network in the specified project using the data included in the request.",
  87819. // "httpMethod": "POST",
  87820. // "id": "compute.networks.insert",
  87821. // "parameterOrder": [
  87822. // "project"
  87823. // ],
  87824. // "parameters": {
  87825. // "project": {
  87826. // "description": "Project ID for this request.",
  87827. // "location": "path",
  87828. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87829. // "required": true,
  87830. // "type": "string"
  87831. // },
  87832. // "requestId": {
  87833. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87834. // "location": "query",
  87835. // "type": "string"
  87836. // }
  87837. // },
  87838. // "path": "{project}/global/networks",
  87839. // "request": {
  87840. // "$ref": "Network"
  87841. // },
  87842. // "response": {
  87843. // "$ref": "Operation"
  87844. // },
  87845. // "scopes": [
  87846. // "https://www.googleapis.com/auth/cloud-platform",
  87847. // "https://www.googleapis.com/auth/compute"
  87848. // ]
  87849. // }
  87850. }
  87851. // method id "compute.networks.list":
  87852. type NetworksListCall struct {
  87853. s *Service
  87854. project string
  87855. urlParams_ gensupport.URLParams
  87856. ifNoneMatch_ string
  87857. ctx_ context.Context
  87858. header_ http.Header
  87859. }
  87860. // List: Retrieves the list of networks available to the specified
  87861. // project.
  87862. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  87863. func (r *NetworksService) List(project string) *NetworksListCall {
  87864. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87865. c.project = project
  87866. return c
  87867. }
  87868. // Filter sets the optional parameter "filter": A filter expression that
  87869. // filters resources listed in the response. The expression must specify
  87870. // the field name, a comparison operator, and the value that you want to
  87871. // use for filtering. The value must be a string, a number, or a
  87872. // boolean. The comparison operator must be either =, !=, >, or <.
  87873. //
  87874. // For example, if you are filtering Compute Engine instances, you can
  87875. // exclude instances named example-instance by specifying name !=
  87876. // example-instance.
  87877. //
  87878. // You can also filter nested fields. For example, you could specify
  87879. // scheduling.automaticRestart = false to include instances only if they
  87880. // are not scheduled for automatic restarts. You can use filtering on
  87881. // nested fields to filter based on resource labels.
  87882. //
  87883. // To filter on multiple expressions, provide each separate expression
  87884. // within parentheses. For example, (scheduling.automaticRestart = true)
  87885. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87886. // AND expression. However, you can include AND and OR expressions
  87887. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87888. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87889. // true).
  87890. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  87891. c.urlParams_.Set("filter", filter)
  87892. return c
  87893. }
  87894. // MaxResults sets the optional parameter "maxResults": The maximum
  87895. // number of results per page that should be returned. If the number of
  87896. // available results is larger than maxResults, Compute Engine returns a
  87897. // nextPageToken that can be used to get the next page of results in
  87898. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87899. // (Default: 500)
  87900. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  87901. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87902. return c
  87903. }
  87904. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87905. // a certain order. By default, results are returned in alphanumerical
  87906. // order based on the resource name.
  87907. //
  87908. // You can also sort results in descending order based on the creation
  87909. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87910. // based on the creationTimestamp field in reverse chronological order
  87911. // (newest result first). Use this to sort resources like operations so
  87912. // that the newest operation is returned first.
  87913. //
  87914. // Currently, only sorting by name or creationTimestamp desc is
  87915. // supported.
  87916. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  87917. c.urlParams_.Set("orderBy", orderBy)
  87918. return c
  87919. }
  87920. // PageToken sets the optional parameter "pageToken": Specifies a page
  87921. // token to use. Set pageToken to the nextPageToken returned by a
  87922. // previous list request to get the next page of results.
  87923. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  87924. c.urlParams_.Set("pageToken", pageToken)
  87925. return c
  87926. }
  87927. // Fields allows partial responses to be retrieved. See
  87928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87929. // for more information.
  87930. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  87931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87932. return c
  87933. }
  87934. // IfNoneMatch sets the optional parameter which makes the operation
  87935. // fail if the object's ETag matches the given value. This is useful for
  87936. // getting updates only after the object has changed since the last
  87937. // request. Use googleapi.IsNotModified to check whether the response
  87938. // error from Do is the result of In-None-Match.
  87939. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  87940. c.ifNoneMatch_ = entityTag
  87941. return c
  87942. }
  87943. // Context sets the context to be used in this call's Do method. Any
  87944. // pending HTTP request will be aborted if the provided context is
  87945. // canceled.
  87946. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  87947. c.ctx_ = ctx
  87948. return c
  87949. }
  87950. // Header returns an http.Header that can be modified by the caller to
  87951. // add HTTP headers to the request.
  87952. func (c *NetworksListCall) Header() http.Header {
  87953. if c.header_ == nil {
  87954. c.header_ = make(http.Header)
  87955. }
  87956. return c.header_
  87957. }
  87958. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  87959. reqHeaders := make(http.Header)
  87960. for k, v := range c.header_ {
  87961. reqHeaders[k] = v
  87962. }
  87963. reqHeaders.Set("User-Agent", c.s.userAgent())
  87964. if c.ifNoneMatch_ != "" {
  87965. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87966. }
  87967. var body io.Reader = nil
  87968. c.urlParams_.Set("alt", alt)
  87969. c.urlParams_.Set("prettyPrint", "false")
  87970. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  87971. urls += "?" + c.urlParams_.Encode()
  87972. req, err := http.NewRequest("GET", urls, body)
  87973. if err != nil {
  87974. return nil, err
  87975. }
  87976. req.Header = reqHeaders
  87977. googleapi.Expand(req.URL, map[string]string{
  87978. "project": c.project,
  87979. })
  87980. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87981. }
  87982. // Do executes the "compute.networks.list" call.
  87983. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  87984. // status code is an error. Response headers are in either
  87985. // *NetworkList.ServerResponse.Header or (if a response was returned at
  87986. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87987. // to check whether the returned error was because
  87988. // http.StatusNotModified was returned.
  87989. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  87990. gensupport.SetOptions(c.urlParams_, opts...)
  87991. res, err := c.doRequest("json")
  87992. if res != nil && res.StatusCode == http.StatusNotModified {
  87993. if res.Body != nil {
  87994. res.Body.Close()
  87995. }
  87996. return nil, &googleapi.Error{
  87997. Code: res.StatusCode,
  87998. Header: res.Header,
  87999. }
  88000. }
  88001. if err != nil {
  88002. return nil, err
  88003. }
  88004. defer googleapi.CloseBody(res)
  88005. if err := googleapi.CheckResponse(res); err != nil {
  88006. return nil, err
  88007. }
  88008. ret := &NetworkList{
  88009. ServerResponse: googleapi.ServerResponse{
  88010. Header: res.Header,
  88011. HTTPStatusCode: res.StatusCode,
  88012. },
  88013. }
  88014. target := &ret
  88015. if err := gensupport.DecodeResponse(target, res); err != nil {
  88016. return nil, err
  88017. }
  88018. return ret, nil
  88019. // {
  88020. // "description": "Retrieves the list of networks available to the specified project.",
  88021. // "httpMethod": "GET",
  88022. // "id": "compute.networks.list",
  88023. // "parameterOrder": [
  88024. // "project"
  88025. // ],
  88026. // "parameters": {
  88027. // "filter": {
  88028. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  88029. // "location": "query",
  88030. // "type": "string"
  88031. // },
  88032. // "maxResults": {
  88033. // "default": "500",
  88034. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  88035. // "format": "uint32",
  88036. // "location": "query",
  88037. // "minimum": "0",
  88038. // "type": "integer"
  88039. // },
  88040. // "orderBy": {
  88041. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  88042. // "location": "query",
  88043. // "type": "string"
  88044. // },
  88045. // "pageToken": {
  88046. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  88047. // "location": "query",
  88048. // "type": "string"
  88049. // },
  88050. // "project": {
  88051. // "description": "Project ID for this request.",
  88052. // "location": "path",
  88053. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88054. // "required": true,
  88055. // "type": "string"
  88056. // }
  88057. // },
  88058. // "path": "{project}/global/networks",
  88059. // "response": {
  88060. // "$ref": "NetworkList"
  88061. // },
  88062. // "scopes": [
  88063. // "https://www.googleapis.com/auth/cloud-platform",
  88064. // "https://www.googleapis.com/auth/compute",
  88065. // "https://www.googleapis.com/auth/compute.readonly"
  88066. // ]
  88067. // }
  88068. }
  88069. // Pages invokes f for each page of results.
  88070. // A non-nil error returned from f will halt the iteration.
  88071. // The provided context supersedes any context provided to the Context method.
  88072. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  88073. c.ctx_ = ctx
  88074. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88075. for {
  88076. x, err := c.Do()
  88077. if err != nil {
  88078. return err
  88079. }
  88080. if err := f(x); err != nil {
  88081. return err
  88082. }
  88083. if x.NextPageToken == "" {
  88084. return nil
  88085. }
  88086. c.PageToken(x.NextPageToken)
  88087. }
  88088. }
  88089. // method id "compute.networks.listIpAddresses":
  88090. type NetworksListIpAddressesCall struct {
  88091. s *Service
  88092. project string
  88093. network string
  88094. urlParams_ gensupport.URLParams
  88095. ifNoneMatch_ string
  88096. ctx_ context.Context
  88097. header_ http.Header
  88098. }
  88099. // ListIpAddresses: Lists the internal IP addresses in the specified
  88100. // network.
  88101. func (r *NetworksService) ListIpAddresses(project string, network string) *NetworksListIpAddressesCall {
  88102. c := &NetworksListIpAddressesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88103. c.project = project
  88104. c.network = network
  88105. return c
  88106. }
  88107. // Filter sets the optional parameter "filter": A filter expression that
  88108. // filters resources listed in the response. The expression must specify
  88109. // the field name, a comparison operator, and the value that you want to
  88110. // use for filtering. The value must be a string, a number, or a
  88111. // boolean. The comparison operator must be either =, !=, >, or <.
  88112. //
  88113. // For example, if you are filtering Compute Engine instances, you can
  88114. // exclude instances named example-instance by specifying name !=
  88115. // example-instance.
  88116. //
  88117. // You can also filter nested fields. For example, you could specify
  88118. // scheduling.automaticRestart = false to include instances only if they
  88119. // are not scheduled for automatic restarts. You can use filtering on
  88120. // nested fields to filter based on resource labels.
  88121. //
  88122. // To filter on multiple expressions, provide each separate expression
  88123. // within parentheses. For example, (scheduling.automaticRestart = true)
  88124. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88125. // AND expression. However, you can include AND and OR expressions
  88126. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88127. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88128. // true).
  88129. func (c *NetworksListIpAddressesCall) Filter(filter string) *NetworksListIpAddressesCall {
  88130. c.urlParams_.Set("filter", filter)
  88131. return c
  88132. }
  88133. // MaxResults sets the optional parameter "maxResults": The maximum
  88134. // number of results per page that should be returned. If the number of
  88135. // available results is larger than maxResults, Compute Engine returns a
  88136. // nextPageToken that can be used to get the next page of results in
  88137. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88138. // (Default: 500)
  88139. func (c *NetworksListIpAddressesCall) MaxResults(maxResults int64) *NetworksListIpAddressesCall {
  88140. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88141. return c
  88142. }
  88143. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88144. // a certain order. By default, results are returned in alphanumerical
  88145. // order based on the resource name.
  88146. //
  88147. // You can also sort results in descending order based on the creation
  88148. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88149. // based on the creationTimestamp field in reverse chronological order
  88150. // (newest result first). Use this to sort resources like operations so
  88151. // that the newest operation is returned first.
  88152. //
  88153. // Currently, only sorting by name or creationTimestamp desc is
  88154. // supported.
  88155. func (c *NetworksListIpAddressesCall) OrderBy(orderBy string) *NetworksListIpAddressesCall {
  88156. c.urlParams_.Set("orderBy", orderBy)
  88157. return c
  88158. }
  88159. // PageToken sets the optional parameter "pageToken": Specifies a page
  88160. // token to use. Set pageToken to the nextPageToken returned by a
  88161. // previous list request to get the next page of results.
  88162. func (c *NetworksListIpAddressesCall) PageToken(pageToken string) *NetworksListIpAddressesCall {
  88163. c.urlParams_.Set("pageToken", pageToken)
  88164. return c
  88165. }
  88166. // Types sets the optional parameter "types": (Optional) types filter
  88167. // separate by comma, valid values are: SUBNETWORK, RESERVED, PEER_USED,
  88168. // PEER_RESERVED, REMOTE_USED, REMOTE_RESERVED.
  88169. func (c *NetworksListIpAddressesCall) Types(types string) *NetworksListIpAddressesCall {
  88170. c.urlParams_.Set("types", types)
  88171. return c
  88172. }
  88173. // Fields allows partial responses to be retrieved. See
  88174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88175. // for more information.
  88176. func (c *NetworksListIpAddressesCall) Fields(s ...googleapi.Field) *NetworksListIpAddressesCall {
  88177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88178. return c
  88179. }
  88180. // IfNoneMatch sets the optional parameter which makes the operation
  88181. // fail if the object's ETag matches the given value. This is useful for
  88182. // getting updates only after the object has changed since the last
  88183. // request. Use googleapi.IsNotModified to check whether the response
  88184. // error from Do is the result of In-None-Match.
  88185. func (c *NetworksListIpAddressesCall) IfNoneMatch(entityTag string) *NetworksListIpAddressesCall {
  88186. c.ifNoneMatch_ = entityTag
  88187. return c
  88188. }
  88189. // Context sets the context to be used in this call's Do method. Any
  88190. // pending HTTP request will be aborted if the provided context is
  88191. // canceled.
  88192. func (c *NetworksListIpAddressesCall) Context(ctx context.Context) *NetworksListIpAddressesCall {
  88193. c.ctx_ = ctx
  88194. return c
  88195. }
  88196. // Header returns an http.Header that can be modified by the caller to
  88197. // add HTTP headers to the request.
  88198. func (c *NetworksListIpAddressesCall) Header() http.Header {
  88199. if c.header_ == nil {
  88200. c.header_ = make(http.Header)
  88201. }
  88202. return c.header_
  88203. }
  88204. func (c *NetworksListIpAddressesCall) doRequest(alt string) (*http.Response, error) {
  88205. reqHeaders := make(http.Header)
  88206. for k, v := range c.header_ {
  88207. reqHeaders[k] = v
  88208. }
  88209. reqHeaders.Set("User-Agent", c.s.userAgent())
  88210. if c.ifNoneMatch_ != "" {
  88211. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88212. }
  88213. var body io.Reader = nil
  88214. c.urlParams_.Set("alt", alt)
  88215. c.urlParams_.Set("prettyPrint", "false")
  88216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listIpAddresses")
  88217. urls += "?" + c.urlParams_.Encode()
  88218. req, err := http.NewRequest("GET", urls, body)
  88219. if err != nil {
  88220. return nil, err
  88221. }
  88222. req.Header = reqHeaders
  88223. googleapi.Expand(req.URL, map[string]string{
  88224. "project": c.project,
  88225. "network": c.network,
  88226. })
  88227. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88228. }
  88229. // Do executes the "compute.networks.listIpAddresses" call.
  88230. // Exactly one of *IpAddressesList or error will be non-nil. Any non-2xx
  88231. // status code is an error. Response headers are in either
  88232. // *IpAddressesList.ServerResponse.Header or (if a response was returned
  88233. // at all) in error.(*googleapi.Error).Header. Use
  88234. // googleapi.IsNotModified to check whether the returned error was
  88235. // because http.StatusNotModified was returned.
  88236. func (c *NetworksListIpAddressesCall) Do(opts ...googleapi.CallOption) (*IpAddressesList, error) {
  88237. gensupport.SetOptions(c.urlParams_, opts...)
  88238. res, err := c.doRequest("json")
  88239. if res != nil && res.StatusCode == http.StatusNotModified {
  88240. if res.Body != nil {
  88241. res.Body.Close()
  88242. }
  88243. return nil, &googleapi.Error{
  88244. Code: res.StatusCode,
  88245. Header: res.Header,
  88246. }
  88247. }
  88248. if err != nil {
  88249. return nil, err
  88250. }
  88251. defer googleapi.CloseBody(res)
  88252. if err := googleapi.CheckResponse(res); err != nil {
  88253. return nil, err
  88254. }
  88255. ret := &IpAddressesList{
  88256. ServerResponse: googleapi.ServerResponse{
  88257. Header: res.Header,
  88258. HTTPStatusCode: res.StatusCode,
  88259. },
  88260. }
  88261. target := &ret
  88262. if err := gensupport.DecodeResponse(target, res); err != nil {
  88263. return nil, err
  88264. }
  88265. return ret, nil
  88266. // {
  88267. // "description": "Lists the internal IP addresses in the specified network.",
  88268. // "httpMethod": "GET",
  88269. // "id": "compute.networks.listIpAddresses",
  88270. // "parameterOrder": [
  88271. // "project",
  88272. // "network"
  88273. // ],
  88274. // "parameters": {
  88275. // "filter": {
  88276. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  88277. // "location": "query",
  88278. // "type": "string"
  88279. // },
  88280. // "maxResults": {
  88281. // "default": "500",
  88282. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  88283. // "format": "uint32",
  88284. // "location": "query",
  88285. // "minimum": "0",
  88286. // "type": "integer"
  88287. // },
  88288. // "network": {
  88289. // "description": "Name of the network for this request.",
  88290. // "location": "path",
  88291. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88292. // "required": true,
  88293. // "type": "string"
  88294. // },
  88295. // "orderBy": {
  88296. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  88297. // "location": "query",
  88298. // "type": "string"
  88299. // },
  88300. // "pageToken": {
  88301. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  88302. // "location": "query",
  88303. // "type": "string"
  88304. // },
  88305. // "project": {
  88306. // "description": "Project ID for this request.",
  88307. // "location": "path",
  88308. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88309. // "required": true,
  88310. // "type": "string"
  88311. // },
  88312. // "types": {
  88313. // "description": "(Optional) types filter separate by comma, valid values are: SUBNETWORK, RESERVED, PEER_USED, PEER_RESERVED, REMOTE_USED, REMOTE_RESERVED.",
  88314. // "location": "query",
  88315. // "type": "string"
  88316. // }
  88317. // },
  88318. // "path": "{project}/global/networks/{network}/listIpAddresses",
  88319. // "response": {
  88320. // "$ref": "IpAddressesList"
  88321. // },
  88322. // "scopes": [
  88323. // "https://www.googleapis.com/auth/cloud-platform",
  88324. // "https://www.googleapis.com/auth/compute",
  88325. // "https://www.googleapis.com/auth/compute.readonly"
  88326. // ]
  88327. // }
  88328. }
  88329. // Pages invokes f for each page of results.
  88330. // A non-nil error returned from f will halt the iteration.
  88331. // The provided context supersedes any context provided to the Context method.
  88332. func (c *NetworksListIpAddressesCall) Pages(ctx context.Context, f func(*IpAddressesList) error) error {
  88333. c.ctx_ = ctx
  88334. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88335. for {
  88336. x, err := c.Do()
  88337. if err != nil {
  88338. return err
  88339. }
  88340. if err := f(x); err != nil {
  88341. return err
  88342. }
  88343. if x.NextPageToken == "" {
  88344. return nil
  88345. }
  88346. c.PageToken(x.NextPageToken)
  88347. }
  88348. }
  88349. // method id "compute.networks.listIpOwners":
  88350. type NetworksListIpOwnersCall struct {
  88351. s *Service
  88352. project string
  88353. network string
  88354. urlParams_ gensupport.URLParams
  88355. ifNoneMatch_ string
  88356. ctx_ context.Context
  88357. header_ http.Header
  88358. }
  88359. // ListIpOwners: Lists the internal IP owners in the specified network.
  88360. func (r *NetworksService) ListIpOwners(project string, network string) *NetworksListIpOwnersCall {
  88361. c := &NetworksListIpOwnersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88362. c.project = project
  88363. c.network = network
  88364. return c
  88365. }
  88366. // Filter sets the optional parameter "filter": A filter expression that
  88367. // filters resources listed in the response. The expression must specify
  88368. // the field name, a comparison operator, and the value that you want to
  88369. // use for filtering. The value must be a string, a number, or a
  88370. // boolean. The comparison operator must be either =, !=, >, or <.
  88371. //
  88372. // For example, if you are filtering Compute Engine instances, you can
  88373. // exclude instances named example-instance by specifying name !=
  88374. // example-instance.
  88375. //
  88376. // You can also filter nested fields. For example, you could specify
  88377. // scheduling.automaticRestart = false to include instances only if they
  88378. // are not scheduled for automatic restarts. You can use filtering on
  88379. // nested fields to filter based on resource labels.
  88380. //
  88381. // To filter on multiple expressions, provide each separate expression
  88382. // within parentheses. For example, (scheduling.automaticRestart = true)
  88383. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88384. // AND expression. However, you can include AND and OR expressions
  88385. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88386. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88387. // true).
  88388. func (c *NetworksListIpOwnersCall) Filter(filter string) *NetworksListIpOwnersCall {
  88389. c.urlParams_.Set("filter", filter)
  88390. return c
  88391. }
  88392. // IpCidrRange sets the optional parameter "ipCidrRange": (Optional) IP
  88393. // CIDR range filter, example: "10.128.10.0/30".
  88394. func (c *NetworksListIpOwnersCall) IpCidrRange(ipCidrRange string) *NetworksListIpOwnersCall {
  88395. c.urlParams_.Set("ipCidrRange", ipCidrRange)
  88396. return c
  88397. }
  88398. // MaxResults sets the optional parameter "maxResults": The maximum
  88399. // number of results per page that should be returned. If the number of
  88400. // available results is larger than maxResults, Compute Engine returns a
  88401. // nextPageToken that can be used to get the next page of results in
  88402. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88403. // (Default: 500)
  88404. func (c *NetworksListIpOwnersCall) MaxResults(maxResults int64) *NetworksListIpOwnersCall {
  88405. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88406. return c
  88407. }
  88408. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88409. // a certain order. By default, results are returned in alphanumerical
  88410. // order based on the resource name.
  88411. //
  88412. // You can also sort results in descending order based on the creation
  88413. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88414. // based on the creationTimestamp field in reverse chronological order
  88415. // (newest result first). Use this to sort resources like operations so
  88416. // that the newest operation is returned first.
  88417. //
  88418. // Currently, only sorting by name or creationTimestamp desc is
  88419. // supported.
  88420. func (c *NetworksListIpOwnersCall) OrderBy(orderBy string) *NetworksListIpOwnersCall {
  88421. c.urlParams_.Set("orderBy", orderBy)
  88422. return c
  88423. }
  88424. // OwnerProjects sets the optional parameter "ownerProjects": (Optional)
  88425. // Project IDs filter, example: "project-1,project-2".
  88426. func (c *NetworksListIpOwnersCall) OwnerProjects(ownerProjects string) *NetworksListIpOwnersCall {
  88427. c.urlParams_.Set("ownerProjects", ownerProjects)
  88428. return c
  88429. }
  88430. // OwnerTypes sets the optional parameter "ownerTypes": (Optional) Owner
  88431. // types filter, example: "instance,forwardingRule".
  88432. func (c *NetworksListIpOwnersCall) OwnerTypes(ownerTypes string) *NetworksListIpOwnersCall {
  88433. c.urlParams_.Set("ownerTypes", ownerTypes)
  88434. return c
  88435. }
  88436. // PageToken sets the optional parameter "pageToken": Specifies a page
  88437. // token to use. Set pageToken to the nextPageToken returned by a
  88438. // previous list request to get the next page of results.
  88439. func (c *NetworksListIpOwnersCall) PageToken(pageToken string) *NetworksListIpOwnersCall {
  88440. c.urlParams_.Set("pageToken", pageToken)
  88441. return c
  88442. }
  88443. // SubnetName sets the optional parameter "subnetName": (Optional)
  88444. // Subnetwork name filter.
  88445. func (c *NetworksListIpOwnersCall) SubnetName(subnetName string) *NetworksListIpOwnersCall {
  88446. c.urlParams_.Set("subnetName", subnetName)
  88447. return c
  88448. }
  88449. // SubnetRegion sets the optional parameter "subnetRegion": (Optional)
  88450. // Subnetwork region filter.
  88451. func (c *NetworksListIpOwnersCall) SubnetRegion(subnetRegion string) *NetworksListIpOwnersCall {
  88452. c.urlParams_.Set("subnetRegion", subnetRegion)
  88453. return c
  88454. }
  88455. // Fields allows partial responses to be retrieved. See
  88456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88457. // for more information.
  88458. func (c *NetworksListIpOwnersCall) Fields(s ...googleapi.Field) *NetworksListIpOwnersCall {
  88459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88460. return c
  88461. }
  88462. // IfNoneMatch sets the optional parameter which makes the operation
  88463. // fail if the object's ETag matches the given value. This is useful for
  88464. // getting updates only after the object has changed since the last
  88465. // request. Use googleapi.IsNotModified to check whether the response
  88466. // error from Do is the result of In-None-Match.
  88467. func (c *NetworksListIpOwnersCall) IfNoneMatch(entityTag string) *NetworksListIpOwnersCall {
  88468. c.ifNoneMatch_ = entityTag
  88469. return c
  88470. }
  88471. // Context sets the context to be used in this call's Do method. Any
  88472. // pending HTTP request will be aborted if the provided context is
  88473. // canceled.
  88474. func (c *NetworksListIpOwnersCall) Context(ctx context.Context) *NetworksListIpOwnersCall {
  88475. c.ctx_ = ctx
  88476. return c
  88477. }
  88478. // Header returns an http.Header that can be modified by the caller to
  88479. // add HTTP headers to the request.
  88480. func (c *NetworksListIpOwnersCall) Header() http.Header {
  88481. if c.header_ == nil {
  88482. c.header_ = make(http.Header)
  88483. }
  88484. return c.header_
  88485. }
  88486. func (c *NetworksListIpOwnersCall) doRequest(alt string) (*http.Response, error) {
  88487. reqHeaders := make(http.Header)
  88488. for k, v := range c.header_ {
  88489. reqHeaders[k] = v
  88490. }
  88491. reqHeaders.Set("User-Agent", c.s.userAgent())
  88492. if c.ifNoneMatch_ != "" {
  88493. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88494. }
  88495. var body io.Reader = nil
  88496. c.urlParams_.Set("alt", alt)
  88497. c.urlParams_.Set("prettyPrint", "false")
  88498. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listIpOwners")
  88499. urls += "?" + c.urlParams_.Encode()
  88500. req, err := http.NewRequest("GET", urls, body)
  88501. if err != nil {
  88502. return nil, err
  88503. }
  88504. req.Header = reqHeaders
  88505. googleapi.Expand(req.URL, map[string]string{
  88506. "project": c.project,
  88507. "network": c.network,
  88508. })
  88509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88510. }
  88511. // Do executes the "compute.networks.listIpOwners" call.
  88512. // Exactly one of *IpOwnerList or error will be non-nil. Any non-2xx
  88513. // status code is an error. Response headers are in either
  88514. // *IpOwnerList.ServerResponse.Header or (if a response was returned at
  88515. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88516. // to check whether the returned error was because
  88517. // http.StatusNotModified was returned.
  88518. func (c *NetworksListIpOwnersCall) Do(opts ...googleapi.CallOption) (*IpOwnerList, error) {
  88519. gensupport.SetOptions(c.urlParams_, opts...)
  88520. res, err := c.doRequest("json")
  88521. if res != nil && res.StatusCode == http.StatusNotModified {
  88522. if res.Body != nil {
  88523. res.Body.Close()
  88524. }
  88525. return nil, &googleapi.Error{
  88526. Code: res.StatusCode,
  88527. Header: res.Header,
  88528. }
  88529. }
  88530. if err != nil {
  88531. return nil, err
  88532. }
  88533. defer googleapi.CloseBody(res)
  88534. if err := googleapi.CheckResponse(res); err != nil {
  88535. return nil, err
  88536. }
  88537. ret := &IpOwnerList{
  88538. ServerResponse: googleapi.ServerResponse{
  88539. Header: res.Header,
  88540. HTTPStatusCode: res.StatusCode,
  88541. },
  88542. }
  88543. target := &ret
  88544. if err := gensupport.DecodeResponse(target, res); err != nil {
  88545. return nil, err
  88546. }
  88547. return ret, nil
  88548. // {
  88549. // "description": "Lists the internal IP owners in the specified network.",
  88550. // "httpMethod": "GET",
  88551. // "id": "compute.networks.listIpOwners",
  88552. // "parameterOrder": [
  88553. // "project",
  88554. // "network"
  88555. // ],
  88556. // "parameters": {
  88557. // "filter": {
  88558. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  88559. // "location": "query",
  88560. // "type": "string"
  88561. // },
  88562. // "ipCidrRange": {
  88563. // "description": "(Optional) IP CIDR range filter, example: \"10.128.10.0/30\".",
  88564. // "location": "query",
  88565. // "type": "string"
  88566. // },
  88567. // "maxResults": {
  88568. // "default": "500",
  88569. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  88570. // "format": "uint32",
  88571. // "location": "query",
  88572. // "minimum": "0",
  88573. // "type": "integer"
  88574. // },
  88575. // "network": {
  88576. // "description": "Name of the network to return.",
  88577. // "location": "path",
  88578. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88579. // "required": true,
  88580. // "type": "string"
  88581. // },
  88582. // "orderBy": {
  88583. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  88584. // "location": "query",
  88585. // "type": "string"
  88586. // },
  88587. // "ownerProjects": {
  88588. // "description": "(Optional) Project IDs filter, example: \"project-1,project-2\".",
  88589. // "location": "query",
  88590. // "type": "string"
  88591. // },
  88592. // "ownerTypes": {
  88593. // "description": "(Optional) Owner types filter, example: \"instance,forwardingRule\".",
  88594. // "location": "query",
  88595. // "type": "string"
  88596. // },
  88597. // "pageToken": {
  88598. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  88599. // "location": "query",
  88600. // "type": "string"
  88601. // },
  88602. // "project": {
  88603. // "description": "Project ID for this request.",
  88604. // "location": "path",
  88605. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88606. // "required": true,
  88607. // "type": "string"
  88608. // },
  88609. // "subnetName": {
  88610. // "description": "(Optional) Subnetwork name filter.",
  88611. // "location": "query",
  88612. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88613. // "type": "string"
  88614. // },
  88615. // "subnetRegion": {
  88616. // "description": "(Optional) Subnetwork region filter.",
  88617. // "location": "query",
  88618. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88619. // "type": "string"
  88620. // }
  88621. // },
  88622. // "path": "{project}/global/networks/{network}/listIpOwners",
  88623. // "response": {
  88624. // "$ref": "IpOwnerList"
  88625. // },
  88626. // "scopes": [
  88627. // "https://www.googleapis.com/auth/cloud-platform",
  88628. // "https://www.googleapis.com/auth/compute",
  88629. // "https://www.googleapis.com/auth/compute.readonly"
  88630. // ]
  88631. // }
  88632. }
  88633. // Pages invokes f for each page of results.
  88634. // A non-nil error returned from f will halt the iteration.
  88635. // The provided context supersedes any context provided to the Context method.
  88636. func (c *NetworksListIpOwnersCall) Pages(ctx context.Context, f func(*IpOwnerList) error) error {
  88637. c.ctx_ = ctx
  88638. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88639. for {
  88640. x, err := c.Do()
  88641. if err != nil {
  88642. return err
  88643. }
  88644. if err := f(x); err != nil {
  88645. return err
  88646. }
  88647. if x.NextPageToken == "" {
  88648. return nil
  88649. }
  88650. c.PageToken(x.NextPageToken)
  88651. }
  88652. }
  88653. // method id "compute.networks.listPeeringRoutes":
  88654. type NetworksListPeeringRoutesCall struct {
  88655. s *Service
  88656. project string
  88657. network string
  88658. urlParams_ gensupport.URLParams
  88659. ifNoneMatch_ string
  88660. ctx_ context.Context
  88661. header_ http.Header
  88662. }
  88663. // ListPeeringRoutes: Lists the peering routes exchanged over peering
  88664. // connection.
  88665. func (r *NetworksService) ListPeeringRoutes(project string, network string) *NetworksListPeeringRoutesCall {
  88666. c := &NetworksListPeeringRoutesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88667. c.project = project
  88668. c.network = network
  88669. return c
  88670. }
  88671. // Direction sets the optional parameter "direction": The direction of
  88672. // the exchanged routes.
  88673. //
  88674. // Possible values:
  88675. // "INCOMING"
  88676. // "OUTGOING"
  88677. func (c *NetworksListPeeringRoutesCall) Direction(direction string) *NetworksListPeeringRoutesCall {
  88678. c.urlParams_.Set("direction", direction)
  88679. return c
  88680. }
  88681. // Filter sets the optional parameter "filter": A filter expression that
  88682. // filters resources listed in the response. The expression must specify
  88683. // the field name, a comparison operator, and the value that you want to
  88684. // use for filtering. The value must be a string, a number, or a
  88685. // boolean. The comparison operator must be either =, !=, >, or <.
  88686. //
  88687. // For example, if you are filtering Compute Engine instances, you can
  88688. // exclude instances named example-instance by specifying name !=
  88689. // example-instance.
  88690. //
  88691. // You can also filter nested fields. For example, you could specify
  88692. // scheduling.automaticRestart = false to include instances only if they
  88693. // are not scheduled for automatic restarts. You can use filtering on
  88694. // nested fields to filter based on resource labels.
  88695. //
  88696. // To filter on multiple expressions, provide each separate expression
  88697. // within parentheses. For example, (scheduling.automaticRestart = true)
  88698. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88699. // AND expression. However, you can include AND and OR expressions
  88700. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88701. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88702. // true).
  88703. func (c *NetworksListPeeringRoutesCall) Filter(filter string) *NetworksListPeeringRoutesCall {
  88704. c.urlParams_.Set("filter", filter)
  88705. return c
  88706. }
  88707. // MaxResults sets the optional parameter "maxResults": The maximum
  88708. // number of results per page that should be returned. If the number of
  88709. // available results is larger than maxResults, Compute Engine returns a
  88710. // nextPageToken that can be used to get the next page of results in
  88711. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88712. // (Default: 500)
  88713. func (c *NetworksListPeeringRoutesCall) MaxResults(maxResults int64) *NetworksListPeeringRoutesCall {
  88714. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88715. return c
  88716. }
  88717. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88718. // a certain order. By default, results are returned in alphanumerical
  88719. // order based on the resource name.
  88720. //
  88721. // You can also sort results in descending order based on the creation
  88722. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88723. // based on the creationTimestamp field in reverse chronological order
  88724. // (newest result first). Use this to sort resources like operations so
  88725. // that the newest operation is returned first.
  88726. //
  88727. // Currently, only sorting by name or creationTimestamp desc is
  88728. // supported.
  88729. func (c *NetworksListPeeringRoutesCall) OrderBy(orderBy string) *NetworksListPeeringRoutesCall {
  88730. c.urlParams_.Set("orderBy", orderBy)
  88731. return c
  88732. }
  88733. // PageToken sets the optional parameter "pageToken": Specifies a page
  88734. // token to use. Set pageToken to the nextPageToken returned by a
  88735. // previous list request to get the next page of results.
  88736. func (c *NetworksListPeeringRoutesCall) PageToken(pageToken string) *NetworksListPeeringRoutesCall {
  88737. c.urlParams_.Set("pageToken", pageToken)
  88738. return c
  88739. }
  88740. // PeeringName sets the optional parameter "peeringName": The response
  88741. // will show routes exchanged over the given peering connection.
  88742. func (c *NetworksListPeeringRoutesCall) PeeringName(peeringName string) *NetworksListPeeringRoutesCall {
  88743. c.urlParams_.Set("peeringName", peeringName)
  88744. return c
  88745. }
  88746. // Region sets the optional parameter "region": The region of the
  88747. // request. The response will include all subnet routes, static routes
  88748. // and dynamic routes in the region.
  88749. func (c *NetworksListPeeringRoutesCall) Region(region string) *NetworksListPeeringRoutesCall {
  88750. c.urlParams_.Set("region", region)
  88751. return c
  88752. }
  88753. // Fields allows partial responses to be retrieved. See
  88754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88755. // for more information.
  88756. func (c *NetworksListPeeringRoutesCall) Fields(s ...googleapi.Field) *NetworksListPeeringRoutesCall {
  88757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88758. return c
  88759. }
  88760. // IfNoneMatch sets the optional parameter which makes the operation
  88761. // fail if the object's ETag matches the given value. This is useful for
  88762. // getting updates only after the object has changed since the last
  88763. // request. Use googleapi.IsNotModified to check whether the response
  88764. // error from Do is the result of In-None-Match.
  88765. func (c *NetworksListPeeringRoutesCall) IfNoneMatch(entityTag string) *NetworksListPeeringRoutesCall {
  88766. c.ifNoneMatch_ = entityTag
  88767. return c
  88768. }
  88769. // Context sets the context to be used in this call's Do method. Any
  88770. // pending HTTP request will be aborted if the provided context is
  88771. // canceled.
  88772. func (c *NetworksListPeeringRoutesCall) Context(ctx context.Context) *NetworksListPeeringRoutesCall {
  88773. c.ctx_ = ctx
  88774. return c
  88775. }
  88776. // Header returns an http.Header that can be modified by the caller to
  88777. // add HTTP headers to the request.
  88778. func (c *NetworksListPeeringRoutesCall) Header() http.Header {
  88779. if c.header_ == nil {
  88780. c.header_ = make(http.Header)
  88781. }
  88782. return c.header_
  88783. }
  88784. func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, error) {
  88785. reqHeaders := make(http.Header)
  88786. for k, v := range c.header_ {
  88787. reqHeaders[k] = v
  88788. }
  88789. reqHeaders.Set("User-Agent", c.s.userAgent())
  88790. if c.ifNoneMatch_ != "" {
  88791. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88792. }
  88793. var body io.Reader = nil
  88794. c.urlParams_.Set("alt", alt)
  88795. c.urlParams_.Set("prettyPrint", "false")
  88796. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listPeeringRoutes")
  88797. urls += "?" + c.urlParams_.Encode()
  88798. req, err := http.NewRequest("GET", urls, body)
  88799. if err != nil {
  88800. return nil, err
  88801. }
  88802. req.Header = reqHeaders
  88803. googleapi.Expand(req.URL, map[string]string{
  88804. "project": c.project,
  88805. "network": c.network,
  88806. })
  88807. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88808. }
  88809. // Do executes the "compute.networks.listPeeringRoutes" call.
  88810. // Exactly one of *ExchangedPeeringRoutesList or error will be non-nil.
  88811. // Any non-2xx status code is an error. Response headers are in either
  88812. // *ExchangedPeeringRoutesList.ServerResponse.Header or (if a response
  88813. // was returned at all) in error.(*googleapi.Error).Header. Use
  88814. // googleapi.IsNotModified to check whether the returned error was
  88815. // because http.StatusNotModified was returned.
  88816. func (c *NetworksListPeeringRoutesCall) Do(opts ...googleapi.CallOption) (*ExchangedPeeringRoutesList, error) {
  88817. gensupport.SetOptions(c.urlParams_, opts...)
  88818. res, err := c.doRequest("json")
  88819. if res != nil && res.StatusCode == http.StatusNotModified {
  88820. if res.Body != nil {
  88821. res.Body.Close()
  88822. }
  88823. return nil, &googleapi.Error{
  88824. Code: res.StatusCode,
  88825. Header: res.Header,
  88826. }
  88827. }
  88828. if err != nil {
  88829. return nil, err
  88830. }
  88831. defer googleapi.CloseBody(res)
  88832. if err := googleapi.CheckResponse(res); err != nil {
  88833. return nil, err
  88834. }
  88835. ret := &ExchangedPeeringRoutesList{
  88836. ServerResponse: googleapi.ServerResponse{
  88837. Header: res.Header,
  88838. HTTPStatusCode: res.StatusCode,
  88839. },
  88840. }
  88841. target := &ret
  88842. if err := gensupport.DecodeResponse(target, res); err != nil {
  88843. return nil, err
  88844. }
  88845. return ret, nil
  88846. // {
  88847. // "description": "Lists the peering routes exchanged over peering connection.",
  88848. // "httpMethod": "GET",
  88849. // "id": "compute.networks.listPeeringRoutes",
  88850. // "parameterOrder": [
  88851. // "project",
  88852. // "network"
  88853. // ],
  88854. // "parameters": {
  88855. // "direction": {
  88856. // "description": "The direction of the exchanged routes.",
  88857. // "enum": [
  88858. // "INCOMING",
  88859. // "OUTGOING"
  88860. // ],
  88861. // "enumDescriptions": [
  88862. // "",
  88863. // ""
  88864. // ],
  88865. // "location": "query",
  88866. // "type": "string"
  88867. // },
  88868. // "filter": {
  88869. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  88870. // "location": "query",
  88871. // "type": "string"
  88872. // },
  88873. // "maxResults": {
  88874. // "default": "500",
  88875. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  88876. // "format": "uint32",
  88877. // "location": "query",
  88878. // "minimum": "0",
  88879. // "type": "integer"
  88880. // },
  88881. // "network": {
  88882. // "description": "Name of the network for this request.",
  88883. // "location": "path",
  88884. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88885. // "required": true,
  88886. // "type": "string"
  88887. // },
  88888. // "orderBy": {
  88889. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  88890. // "location": "query",
  88891. // "type": "string"
  88892. // },
  88893. // "pageToken": {
  88894. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  88895. // "location": "query",
  88896. // "type": "string"
  88897. // },
  88898. // "peeringName": {
  88899. // "description": "The response will show routes exchanged over the given peering connection.",
  88900. // "location": "query",
  88901. // "type": "string"
  88902. // },
  88903. // "project": {
  88904. // "description": "Project ID for this request.",
  88905. // "location": "path",
  88906. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88907. // "required": true,
  88908. // "type": "string"
  88909. // },
  88910. // "region": {
  88911. // "description": "The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region.",
  88912. // "location": "query",
  88913. // "type": "string"
  88914. // }
  88915. // },
  88916. // "path": "{project}/global/networks/{network}/listPeeringRoutes",
  88917. // "response": {
  88918. // "$ref": "ExchangedPeeringRoutesList"
  88919. // },
  88920. // "scopes": [
  88921. // "https://www.googleapis.com/auth/cloud-platform",
  88922. // "https://www.googleapis.com/auth/compute",
  88923. // "https://www.googleapis.com/auth/compute.readonly"
  88924. // ]
  88925. // }
  88926. }
  88927. // Pages invokes f for each page of results.
  88928. // A non-nil error returned from f will halt the iteration.
  88929. // The provided context supersedes any context provided to the Context method.
  88930. func (c *NetworksListPeeringRoutesCall) Pages(ctx context.Context, f func(*ExchangedPeeringRoutesList) error) error {
  88931. c.ctx_ = ctx
  88932. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88933. for {
  88934. x, err := c.Do()
  88935. if err != nil {
  88936. return err
  88937. }
  88938. if err := f(x); err != nil {
  88939. return err
  88940. }
  88941. if x.NextPageToken == "" {
  88942. return nil
  88943. }
  88944. c.PageToken(x.NextPageToken)
  88945. }
  88946. }
  88947. // method id "compute.networks.patch":
  88948. type NetworksPatchCall struct {
  88949. s *Service
  88950. project string
  88951. network string
  88952. network2 *Network
  88953. urlParams_ gensupport.URLParams
  88954. ctx_ context.Context
  88955. header_ http.Header
  88956. }
  88957. // Patch: Patches the specified network with the data included in the
  88958. // request. Only the following fields can be modified:
  88959. // routingConfig.routingMode.
  88960. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  88961. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88962. c.project = project
  88963. c.network = network
  88964. c.network2 = network2
  88965. return c
  88966. }
  88967. // RequestId sets the optional parameter "requestId": An optional
  88968. // request ID to identify requests. Specify a unique request ID so that
  88969. // if you must retry your request, the server will know to ignore the
  88970. // request if it has already been completed.
  88971. //
  88972. // For example, consider a situation where you make an initial request
  88973. // and the request times out. If you make the request again with the
  88974. // same request ID, the server can check if original operation with the
  88975. // same request ID was received, and if so, will ignore the second
  88976. // request. This prevents clients from accidentally creating duplicate
  88977. // commitments.
  88978. //
  88979. // The request ID must be a valid UUID with the exception that zero UUID
  88980. // is not supported (00000000-0000-0000-0000-000000000000).
  88981. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  88982. c.urlParams_.Set("requestId", requestId)
  88983. return c
  88984. }
  88985. // Fields allows partial responses to be retrieved. See
  88986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88987. // for more information.
  88988. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  88989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88990. return c
  88991. }
  88992. // Context sets the context to be used in this call's Do method. Any
  88993. // pending HTTP request will be aborted if the provided context is
  88994. // canceled.
  88995. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  88996. c.ctx_ = ctx
  88997. return c
  88998. }
  88999. // Header returns an http.Header that can be modified by the caller to
  89000. // add HTTP headers to the request.
  89001. func (c *NetworksPatchCall) Header() http.Header {
  89002. if c.header_ == nil {
  89003. c.header_ = make(http.Header)
  89004. }
  89005. return c.header_
  89006. }
  89007. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  89008. reqHeaders := make(http.Header)
  89009. for k, v := range c.header_ {
  89010. reqHeaders[k] = v
  89011. }
  89012. reqHeaders.Set("User-Agent", c.s.userAgent())
  89013. var body io.Reader = nil
  89014. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  89015. if err != nil {
  89016. return nil, err
  89017. }
  89018. reqHeaders.Set("Content-Type", "application/json")
  89019. c.urlParams_.Set("alt", alt)
  89020. c.urlParams_.Set("prettyPrint", "false")
  89021. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  89022. urls += "?" + c.urlParams_.Encode()
  89023. req, err := http.NewRequest("PATCH", urls, body)
  89024. if err != nil {
  89025. return nil, err
  89026. }
  89027. req.Header = reqHeaders
  89028. googleapi.Expand(req.URL, map[string]string{
  89029. "project": c.project,
  89030. "network": c.network,
  89031. })
  89032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89033. }
  89034. // Do executes the "compute.networks.patch" call.
  89035. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89036. // status code is an error. Response headers are in either
  89037. // *Operation.ServerResponse.Header or (if a response was returned at
  89038. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89039. // to check whether the returned error was because
  89040. // http.StatusNotModified was returned.
  89041. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89042. gensupport.SetOptions(c.urlParams_, opts...)
  89043. res, err := c.doRequest("json")
  89044. if res != nil && res.StatusCode == http.StatusNotModified {
  89045. if res.Body != nil {
  89046. res.Body.Close()
  89047. }
  89048. return nil, &googleapi.Error{
  89049. Code: res.StatusCode,
  89050. Header: res.Header,
  89051. }
  89052. }
  89053. if err != nil {
  89054. return nil, err
  89055. }
  89056. defer googleapi.CloseBody(res)
  89057. if err := googleapi.CheckResponse(res); err != nil {
  89058. return nil, err
  89059. }
  89060. ret := &Operation{
  89061. ServerResponse: googleapi.ServerResponse{
  89062. Header: res.Header,
  89063. HTTPStatusCode: res.StatusCode,
  89064. },
  89065. }
  89066. target := &ret
  89067. if err := gensupport.DecodeResponse(target, res); err != nil {
  89068. return nil, err
  89069. }
  89070. return ret, nil
  89071. // {
  89072. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  89073. // "httpMethod": "PATCH",
  89074. // "id": "compute.networks.patch",
  89075. // "parameterOrder": [
  89076. // "project",
  89077. // "network"
  89078. // ],
  89079. // "parameters": {
  89080. // "network": {
  89081. // "description": "Name of the network to update.",
  89082. // "location": "path",
  89083. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89084. // "required": true,
  89085. // "type": "string"
  89086. // },
  89087. // "project": {
  89088. // "description": "Project ID for this request.",
  89089. // "location": "path",
  89090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89091. // "required": true,
  89092. // "type": "string"
  89093. // },
  89094. // "requestId": {
  89095. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89096. // "location": "query",
  89097. // "type": "string"
  89098. // }
  89099. // },
  89100. // "path": "{project}/global/networks/{network}",
  89101. // "request": {
  89102. // "$ref": "Network"
  89103. // },
  89104. // "response": {
  89105. // "$ref": "Operation"
  89106. // },
  89107. // "scopes": [
  89108. // "https://www.googleapis.com/auth/cloud-platform",
  89109. // "https://www.googleapis.com/auth/compute"
  89110. // ]
  89111. // }
  89112. }
  89113. // method id "compute.networks.removePeering":
  89114. type NetworksRemovePeeringCall struct {
  89115. s *Service
  89116. project string
  89117. network string
  89118. networksremovepeeringrequest *NetworksRemovePeeringRequest
  89119. urlParams_ gensupport.URLParams
  89120. ctx_ context.Context
  89121. header_ http.Header
  89122. }
  89123. // RemovePeering: Removes a peering from the specified network.
  89124. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  89125. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89126. c.project = project
  89127. c.network = network
  89128. c.networksremovepeeringrequest = networksremovepeeringrequest
  89129. return c
  89130. }
  89131. // RequestId sets the optional parameter "requestId": An optional
  89132. // request ID to identify requests. Specify a unique request ID so that
  89133. // if you must retry your request, the server will know to ignore the
  89134. // request if it has already been completed.
  89135. //
  89136. // For example, consider a situation where you make an initial request
  89137. // and the request times out. If you make the request again with the
  89138. // same request ID, the server can check if original operation with the
  89139. // same request ID was received, and if so, will ignore the second
  89140. // request. This prevents clients from accidentally creating duplicate
  89141. // commitments.
  89142. //
  89143. // The request ID must be a valid UUID with the exception that zero UUID
  89144. // is not supported (00000000-0000-0000-0000-000000000000).
  89145. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  89146. c.urlParams_.Set("requestId", requestId)
  89147. return c
  89148. }
  89149. // Fields allows partial responses to be retrieved. See
  89150. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89151. // for more information.
  89152. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  89153. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89154. return c
  89155. }
  89156. // Context sets the context to be used in this call's Do method. Any
  89157. // pending HTTP request will be aborted if the provided context is
  89158. // canceled.
  89159. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  89160. c.ctx_ = ctx
  89161. return c
  89162. }
  89163. // Header returns an http.Header that can be modified by the caller to
  89164. // add HTTP headers to the request.
  89165. func (c *NetworksRemovePeeringCall) Header() http.Header {
  89166. if c.header_ == nil {
  89167. c.header_ = make(http.Header)
  89168. }
  89169. return c.header_
  89170. }
  89171. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  89172. reqHeaders := make(http.Header)
  89173. for k, v := range c.header_ {
  89174. reqHeaders[k] = v
  89175. }
  89176. reqHeaders.Set("User-Agent", c.s.userAgent())
  89177. var body io.Reader = nil
  89178. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  89179. if err != nil {
  89180. return nil, err
  89181. }
  89182. reqHeaders.Set("Content-Type", "application/json")
  89183. c.urlParams_.Set("alt", alt)
  89184. c.urlParams_.Set("prettyPrint", "false")
  89185. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  89186. urls += "?" + c.urlParams_.Encode()
  89187. req, err := http.NewRequest("POST", urls, body)
  89188. if err != nil {
  89189. return nil, err
  89190. }
  89191. req.Header = reqHeaders
  89192. googleapi.Expand(req.URL, map[string]string{
  89193. "project": c.project,
  89194. "network": c.network,
  89195. })
  89196. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89197. }
  89198. // Do executes the "compute.networks.removePeering" call.
  89199. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89200. // status code is an error. Response headers are in either
  89201. // *Operation.ServerResponse.Header or (if a response was returned at
  89202. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89203. // to check whether the returned error was because
  89204. // http.StatusNotModified was returned.
  89205. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89206. gensupport.SetOptions(c.urlParams_, opts...)
  89207. res, err := c.doRequest("json")
  89208. if res != nil && res.StatusCode == http.StatusNotModified {
  89209. if res.Body != nil {
  89210. res.Body.Close()
  89211. }
  89212. return nil, &googleapi.Error{
  89213. Code: res.StatusCode,
  89214. Header: res.Header,
  89215. }
  89216. }
  89217. if err != nil {
  89218. return nil, err
  89219. }
  89220. defer googleapi.CloseBody(res)
  89221. if err := googleapi.CheckResponse(res); err != nil {
  89222. return nil, err
  89223. }
  89224. ret := &Operation{
  89225. ServerResponse: googleapi.ServerResponse{
  89226. Header: res.Header,
  89227. HTTPStatusCode: res.StatusCode,
  89228. },
  89229. }
  89230. target := &ret
  89231. if err := gensupport.DecodeResponse(target, res); err != nil {
  89232. return nil, err
  89233. }
  89234. return ret, nil
  89235. // {
  89236. // "description": "Removes a peering from the specified network.",
  89237. // "httpMethod": "POST",
  89238. // "id": "compute.networks.removePeering",
  89239. // "parameterOrder": [
  89240. // "project",
  89241. // "network"
  89242. // ],
  89243. // "parameters": {
  89244. // "network": {
  89245. // "description": "Name of the network resource to remove peering from.",
  89246. // "location": "path",
  89247. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89248. // "required": true,
  89249. // "type": "string"
  89250. // },
  89251. // "project": {
  89252. // "description": "Project ID for this request.",
  89253. // "location": "path",
  89254. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89255. // "required": true,
  89256. // "type": "string"
  89257. // },
  89258. // "requestId": {
  89259. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89260. // "location": "query",
  89261. // "type": "string"
  89262. // }
  89263. // },
  89264. // "path": "{project}/global/networks/{network}/removePeering",
  89265. // "request": {
  89266. // "$ref": "NetworksRemovePeeringRequest"
  89267. // },
  89268. // "response": {
  89269. // "$ref": "Operation"
  89270. // },
  89271. // "scopes": [
  89272. // "https://www.googleapis.com/auth/cloud-platform",
  89273. // "https://www.googleapis.com/auth/compute"
  89274. // ]
  89275. // }
  89276. }
  89277. // method id "compute.networks.switchToCustomMode":
  89278. type NetworksSwitchToCustomModeCall struct {
  89279. s *Service
  89280. project string
  89281. network string
  89282. urlParams_ gensupport.URLParams
  89283. ctx_ context.Context
  89284. header_ http.Header
  89285. }
  89286. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  89287. // to custom subnet mode.
  89288. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  89289. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89290. c.project = project
  89291. c.network = network
  89292. return c
  89293. }
  89294. // RequestId sets the optional parameter "requestId": An optional
  89295. // request ID to identify requests. Specify a unique request ID so that
  89296. // if you must retry your request, the server will know to ignore the
  89297. // request if it has already been completed.
  89298. //
  89299. // For example, consider a situation where you make an initial request
  89300. // and the request times out. If you make the request again with the
  89301. // same request ID, the server can check if original operation with the
  89302. // same request ID was received, and if so, will ignore the second
  89303. // request. This prevents clients from accidentally creating duplicate
  89304. // commitments.
  89305. //
  89306. // The request ID must be a valid UUID with the exception that zero UUID
  89307. // is not supported (00000000-0000-0000-0000-000000000000).
  89308. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  89309. c.urlParams_.Set("requestId", requestId)
  89310. return c
  89311. }
  89312. // Fields allows partial responses to be retrieved. See
  89313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89314. // for more information.
  89315. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  89316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89317. return c
  89318. }
  89319. // Context sets the context to be used in this call's Do method. Any
  89320. // pending HTTP request will be aborted if the provided context is
  89321. // canceled.
  89322. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  89323. c.ctx_ = ctx
  89324. return c
  89325. }
  89326. // Header returns an http.Header that can be modified by the caller to
  89327. // add HTTP headers to the request.
  89328. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  89329. if c.header_ == nil {
  89330. c.header_ = make(http.Header)
  89331. }
  89332. return c.header_
  89333. }
  89334. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  89335. reqHeaders := make(http.Header)
  89336. for k, v := range c.header_ {
  89337. reqHeaders[k] = v
  89338. }
  89339. reqHeaders.Set("User-Agent", c.s.userAgent())
  89340. var body io.Reader = nil
  89341. c.urlParams_.Set("alt", alt)
  89342. c.urlParams_.Set("prettyPrint", "false")
  89343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  89344. urls += "?" + c.urlParams_.Encode()
  89345. req, err := http.NewRequest("POST", urls, body)
  89346. if err != nil {
  89347. return nil, err
  89348. }
  89349. req.Header = reqHeaders
  89350. googleapi.Expand(req.URL, map[string]string{
  89351. "project": c.project,
  89352. "network": c.network,
  89353. })
  89354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89355. }
  89356. // Do executes the "compute.networks.switchToCustomMode" call.
  89357. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89358. // status code is an error. Response headers are in either
  89359. // *Operation.ServerResponse.Header or (if a response was returned at
  89360. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89361. // to check whether the returned error was because
  89362. // http.StatusNotModified was returned.
  89363. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89364. gensupport.SetOptions(c.urlParams_, opts...)
  89365. res, err := c.doRequest("json")
  89366. if res != nil && res.StatusCode == http.StatusNotModified {
  89367. if res.Body != nil {
  89368. res.Body.Close()
  89369. }
  89370. return nil, &googleapi.Error{
  89371. Code: res.StatusCode,
  89372. Header: res.Header,
  89373. }
  89374. }
  89375. if err != nil {
  89376. return nil, err
  89377. }
  89378. defer googleapi.CloseBody(res)
  89379. if err := googleapi.CheckResponse(res); err != nil {
  89380. return nil, err
  89381. }
  89382. ret := &Operation{
  89383. ServerResponse: googleapi.ServerResponse{
  89384. Header: res.Header,
  89385. HTTPStatusCode: res.StatusCode,
  89386. },
  89387. }
  89388. target := &ret
  89389. if err := gensupport.DecodeResponse(target, res); err != nil {
  89390. return nil, err
  89391. }
  89392. return ret, nil
  89393. // {
  89394. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  89395. // "httpMethod": "POST",
  89396. // "id": "compute.networks.switchToCustomMode",
  89397. // "parameterOrder": [
  89398. // "project",
  89399. // "network"
  89400. // ],
  89401. // "parameters": {
  89402. // "network": {
  89403. // "description": "Name of the network to be updated.",
  89404. // "location": "path",
  89405. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89406. // "required": true,
  89407. // "type": "string"
  89408. // },
  89409. // "project": {
  89410. // "description": "Project ID for this request.",
  89411. // "location": "path",
  89412. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89413. // "required": true,
  89414. // "type": "string"
  89415. // },
  89416. // "requestId": {
  89417. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89418. // "location": "query",
  89419. // "type": "string"
  89420. // }
  89421. // },
  89422. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  89423. // "response": {
  89424. // "$ref": "Operation"
  89425. // },
  89426. // "scopes": [
  89427. // "https://www.googleapis.com/auth/cloud-platform",
  89428. // "https://www.googleapis.com/auth/compute"
  89429. // ]
  89430. // }
  89431. }
  89432. // method id "compute.networks.testIamPermissions":
  89433. type NetworksTestIamPermissionsCall struct {
  89434. s *Service
  89435. project string
  89436. resource string
  89437. testpermissionsrequest *TestPermissionsRequest
  89438. urlParams_ gensupport.URLParams
  89439. ctx_ context.Context
  89440. header_ http.Header
  89441. }
  89442. // TestIamPermissions: Returns permissions that a caller has on the
  89443. // specified resource.
  89444. func (r *NetworksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworksTestIamPermissionsCall {
  89445. c := &NetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89446. c.project = project
  89447. c.resource = resource
  89448. c.testpermissionsrequest = testpermissionsrequest
  89449. return c
  89450. }
  89451. // Fields allows partial responses to be retrieved. See
  89452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89453. // for more information.
  89454. func (c *NetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworksTestIamPermissionsCall {
  89455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89456. return c
  89457. }
  89458. // Context sets the context to be used in this call's Do method. Any
  89459. // pending HTTP request will be aborted if the provided context is
  89460. // canceled.
  89461. func (c *NetworksTestIamPermissionsCall) Context(ctx context.Context) *NetworksTestIamPermissionsCall {
  89462. c.ctx_ = ctx
  89463. return c
  89464. }
  89465. // Header returns an http.Header that can be modified by the caller to
  89466. // add HTTP headers to the request.
  89467. func (c *NetworksTestIamPermissionsCall) Header() http.Header {
  89468. if c.header_ == nil {
  89469. c.header_ = make(http.Header)
  89470. }
  89471. return c.header_
  89472. }
  89473. func (c *NetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  89474. reqHeaders := make(http.Header)
  89475. for k, v := range c.header_ {
  89476. reqHeaders[k] = v
  89477. }
  89478. reqHeaders.Set("User-Agent", c.s.userAgent())
  89479. var body io.Reader = nil
  89480. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  89481. if err != nil {
  89482. return nil, err
  89483. }
  89484. reqHeaders.Set("Content-Type", "application/json")
  89485. c.urlParams_.Set("alt", alt)
  89486. c.urlParams_.Set("prettyPrint", "false")
  89487. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{resource}/testIamPermissions")
  89488. urls += "?" + c.urlParams_.Encode()
  89489. req, err := http.NewRequest("POST", urls, body)
  89490. if err != nil {
  89491. return nil, err
  89492. }
  89493. req.Header = reqHeaders
  89494. googleapi.Expand(req.URL, map[string]string{
  89495. "project": c.project,
  89496. "resource": c.resource,
  89497. })
  89498. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89499. }
  89500. // Do executes the "compute.networks.testIamPermissions" call.
  89501. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  89502. // non-2xx status code is an error. Response headers are in either
  89503. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  89504. // returned at all) in error.(*googleapi.Error).Header. Use
  89505. // googleapi.IsNotModified to check whether the returned error was
  89506. // because http.StatusNotModified was returned.
  89507. func (c *NetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  89508. gensupport.SetOptions(c.urlParams_, opts...)
  89509. res, err := c.doRequest("json")
  89510. if res != nil && res.StatusCode == http.StatusNotModified {
  89511. if res.Body != nil {
  89512. res.Body.Close()
  89513. }
  89514. return nil, &googleapi.Error{
  89515. Code: res.StatusCode,
  89516. Header: res.Header,
  89517. }
  89518. }
  89519. if err != nil {
  89520. return nil, err
  89521. }
  89522. defer googleapi.CloseBody(res)
  89523. if err := googleapi.CheckResponse(res); err != nil {
  89524. return nil, err
  89525. }
  89526. ret := &TestPermissionsResponse{
  89527. ServerResponse: googleapi.ServerResponse{
  89528. Header: res.Header,
  89529. HTTPStatusCode: res.StatusCode,
  89530. },
  89531. }
  89532. target := &ret
  89533. if err := gensupport.DecodeResponse(target, res); err != nil {
  89534. return nil, err
  89535. }
  89536. return ret, nil
  89537. // {
  89538. // "description": "Returns permissions that a caller has on the specified resource.",
  89539. // "httpMethod": "POST",
  89540. // "id": "compute.networks.testIamPermissions",
  89541. // "parameterOrder": [
  89542. // "project",
  89543. // "resource"
  89544. // ],
  89545. // "parameters": {
  89546. // "project": {
  89547. // "description": "Project ID for this request.",
  89548. // "location": "path",
  89549. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89550. // "required": true,
  89551. // "type": "string"
  89552. // },
  89553. // "resource": {
  89554. // "description": "Name or id of the resource for this request.",
  89555. // "location": "path",
  89556. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89557. // "required": true,
  89558. // "type": "string"
  89559. // }
  89560. // },
  89561. // "path": "{project}/global/networks/{resource}/testIamPermissions",
  89562. // "request": {
  89563. // "$ref": "TestPermissionsRequest"
  89564. // },
  89565. // "response": {
  89566. // "$ref": "TestPermissionsResponse"
  89567. // },
  89568. // "scopes": [
  89569. // "https://www.googleapis.com/auth/cloud-platform",
  89570. // "https://www.googleapis.com/auth/compute",
  89571. // "https://www.googleapis.com/auth/compute.readonly"
  89572. // ]
  89573. // }
  89574. }
  89575. // method id "compute.networks.updatePeering":
  89576. type NetworksUpdatePeeringCall struct {
  89577. s *Service
  89578. project string
  89579. network string
  89580. networksupdatepeeringrequest *NetworksUpdatePeeringRequest
  89581. urlParams_ gensupport.URLParams
  89582. ctx_ context.Context
  89583. header_ http.Header
  89584. }
  89585. // UpdatePeering: Updates the specified network peering with the data
  89586. // included in the request Only the following fields can be modified:
  89587. // NetworkPeering.export_custom_routes, and
  89588. // NetworkPeering.import_custom_routes
  89589. func (r *NetworksService) UpdatePeering(project string, network string, networksupdatepeeringrequest *NetworksUpdatePeeringRequest) *NetworksUpdatePeeringCall {
  89590. c := &NetworksUpdatePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89591. c.project = project
  89592. c.network = network
  89593. c.networksupdatepeeringrequest = networksupdatepeeringrequest
  89594. return c
  89595. }
  89596. // RequestId sets the optional parameter "requestId": An optional
  89597. // request ID to identify requests. Specify a unique request ID so that
  89598. // if you must retry your request, the server will know to ignore the
  89599. // request if it has already been completed.
  89600. //
  89601. // For example, consider a situation where you make an initial request
  89602. // and the request times out. If you make the request again with the
  89603. // same request ID, the server can check if original operation with the
  89604. // same request ID was received, and if so, will ignore the second
  89605. // request. This prevents clients from accidentally creating duplicate
  89606. // commitments.
  89607. //
  89608. // The request ID must be a valid UUID with the exception that zero UUID
  89609. // is not supported (00000000-0000-0000-0000-000000000000).
  89610. func (c *NetworksUpdatePeeringCall) RequestId(requestId string) *NetworksUpdatePeeringCall {
  89611. c.urlParams_.Set("requestId", requestId)
  89612. return c
  89613. }
  89614. // Fields allows partial responses to be retrieved. See
  89615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89616. // for more information.
  89617. func (c *NetworksUpdatePeeringCall) Fields(s ...googleapi.Field) *NetworksUpdatePeeringCall {
  89618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89619. return c
  89620. }
  89621. // Context sets the context to be used in this call's Do method. Any
  89622. // pending HTTP request will be aborted if the provided context is
  89623. // canceled.
  89624. func (c *NetworksUpdatePeeringCall) Context(ctx context.Context) *NetworksUpdatePeeringCall {
  89625. c.ctx_ = ctx
  89626. return c
  89627. }
  89628. // Header returns an http.Header that can be modified by the caller to
  89629. // add HTTP headers to the request.
  89630. func (c *NetworksUpdatePeeringCall) Header() http.Header {
  89631. if c.header_ == nil {
  89632. c.header_ = make(http.Header)
  89633. }
  89634. return c.header_
  89635. }
  89636. func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) {
  89637. reqHeaders := make(http.Header)
  89638. for k, v := range c.header_ {
  89639. reqHeaders[k] = v
  89640. }
  89641. reqHeaders.Set("User-Agent", c.s.userAgent())
  89642. var body io.Reader = nil
  89643. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest)
  89644. if err != nil {
  89645. return nil, err
  89646. }
  89647. reqHeaders.Set("Content-Type", "application/json")
  89648. c.urlParams_.Set("alt", alt)
  89649. c.urlParams_.Set("prettyPrint", "false")
  89650. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/updatePeering")
  89651. urls += "?" + c.urlParams_.Encode()
  89652. req, err := http.NewRequest("PATCH", urls, body)
  89653. if err != nil {
  89654. return nil, err
  89655. }
  89656. req.Header = reqHeaders
  89657. googleapi.Expand(req.URL, map[string]string{
  89658. "project": c.project,
  89659. "network": c.network,
  89660. })
  89661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89662. }
  89663. // Do executes the "compute.networks.updatePeering" call.
  89664. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89665. // status code is an error. Response headers are in either
  89666. // *Operation.ServerResponse.Header or (if a response was returned at
  89667. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89668. // to check whether the returned error was because
  89669. // http.StatusNotModified was returned.
  89670. func (c *NetworksUpdatePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89671. gensupport.SetOptions(c.urlParams_, opts...)
  89672. res, err := c.doRequest("json")
  89673. if res != nil && res.StatusCode == http.StatusNotModified {
  89674. if res.Body != nil {
  89675. res.Body.Close()
  89676. }
  89677. return nil, &googleapi.Error{
  89678. Code: res.StatusCode,
  89679. Header: res.Header,
  89680. }
  89681. }
  89682. if err != nil {
  89683. return nil, err
  89684. }
  89685. defer googleapi.CloseBody(res)
  89686. if err := googleapi.CheckResponse(res); err != nil {
  89687. return nil, err
  89688. }
  89689. ret := &Operation{
  89690. ServerResponse: googleapi.ServerResponse{
  89691. Header: res.Header,
  89692. HTTPStatusCode: res.StatusCode,
  89693. },
  89694. }
  89695. target := &ret
  89696. if err := gensupport.DecodeResponse(target, res); err != nil {
  89697. return nil, err
  89698. }
  89699. return ret, nil
  89700. // {
  89701. // "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",
  89702. // "httpMethod": "PATCH",
  89703. // "id": "compute.networks.updatePeering",
  89704. // "parameterOrder": [
  89705. // "project",
  89706. // "network"
  89707. // ],
  89708. // "parameters": {
  89709. // "network": {
  89710. // "description": "Name of the network resource which the updated peering is belonging to.",
  89711. // "location": "path",
  89712. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89713. // "required": true,
  89714. // "type": "string"
  89715. // },
  89716. // "project": {
  89717. // "description": "Project ID for this request.",
  89718. // "location": "path",
  89719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89720. // "required": true,
  89721. // "type": "string"
  89722. // },
  89723. // "requestId": {
  89724. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89725. // "location": "query",
  89726. // "type": "string"
  89727. // }
  89728. // },
  89729. // "path": "{project}/global/networks/{network}/updatePeering",
  89730. // "request": {
  89731. // "$ref": "NetworksUpdatePeeringRequest"
  89732. // },
  89733. // "response": {
  89734. // "$ref": "Operation"
  89735. // },
  89736. // "scopes": [
  89737. // "https://www.googleapis.com/auth/cloud-platform",
  89738. // "https://www.googleapis.com/auth/compute"
  89739. // ]
  89740. // }
  89741. }
  89742. // method id "compute.nodeGroups.addNodes":
  89743. type NodeGroupsAddNodesCall struct {
  89744. s *Service
  89745. project string
  89746. zone string
  89747. nodeGroup string
  89748. nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
  89749. urlParams_ gensupport.URLParams
  89750. ctx_ context.Context
  89751. header_ http.Header
  89752. }
  89753. // AddNodes: Adds specified number of nodes to the node group.
  89754. func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
  89755. c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89756. c.project = project
  89757. c.zone = zone
  89758. c.nodeGroup = nodeGroup
  89759. c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
  89760. return c
  89761. }
  89762. // RequestId sets the optional parameter "requestId": An optional
  89763. // request ID to identify requests. Specify a unique request ID so that
  89764. // if you must retry your request, the server will know to ignore the
  89765. // request if it has already been completed.
  89766. //
  89767. // For example, consider a situation where you make an initial request
  89768. // and the request times out. If you make the request again with the
  89769. // same request ID, the server can check if original operation with the
  89770. // same request ID was received, and if so, will ignore the second
  89771. // request. This prevents clients from accidentally creating duplicate
  89772. // commitments.
  89773. //
  89774. // The request ID must be a valid UUID with the exception that zero UUID
  89775. // is not supported (00000000-0000-0000-0000-000000000000).
  89776. func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
  89777. c.urlParams_.Set("requestId", requestId)
  89778. return c
  89779. }
  89780. // Fields allows partial responses to be retrieved. See
  89781. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89782. // for more information.
  89783. func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
  89784. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89785. return c
  89786. }
  89787. // Context sets the context to be used in this call's Do method. Any
  89788. // pending HTTP request will be aborted if the provided context is
  89789. // canceled.
  89790. func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
  89791. c.ctx_ = ctx
  89792. return c
  89793. }
  89794. // Header returns an http.Header that can be modified by the caller to
  89795. // add HTTP headers to the request.
  89796. func (c *NodeGroupsAddNodesCall) Header() http.Header {
  89797. if c.header_ == nil {
  89798. c.header_ = make(http.Header)
  89799. }
  89800. return c.header_
  89801. }
  89802. func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
  89803. reqHeaders := make(http.Header)
  89804. for k, v := range c.header_ {
  89805. reqHeaders[k] = v
  89806. }
  89807. reqHeaders.Set("User-Agent", c.s.userAgent())
  89808. var body io.Reader = nil
  89809. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
  89810. if err != nil {
  89811. return nil, err
  89812. }
  89813. reqHeaders.Set("Content-Type", "application/json")
  89814. c.urlParams_.Set("alt", alt)
  89815. c.urlParams_.Set("prettyPrint", "false")
  89816. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
  89817. urls += "?" + c.urlParams_.Encode()
  89818. req, err := http.NewRequest("POST", urls, body)
  89819. if err != nil {
  89820. return nil, err
  89821. }
  89822. req.Header = reqHeaders
  89823. googleapi.Expand(req.URL, map[string]string{
  89824. "project": c.project,
  89825. "zone": c.zone,
  89826. "nodeGroup": c.nodeGroup,
  89827. })
  89828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89829. }
  89830. // Do executes the "compute.nodeGroups.addNodes" call.
  89831. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89832. // status code is an error. Response headers are in either
  89833. // *Operation.ServerResponse.Header or (if a response was returned at
  89834. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89835. // to check whether the returned error was because
  89836. // http.StatusNotModified was returned.
  89837. func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89838. gensupport.SetOptions(c.urlParams_, opts...)
  89839. res, err := c.doRequest("json")
  89840. if res != nil && res.StatusCode == http.StatusNotModified {
  89841. if res.Body != nil {
  89842. res.Body.Close()
  89843. }
  89844. return nil, &googleapi.Error{
  89845. Code: res.StatusCode,
  89846. Header: res.Header,
  89847. }
  89848. }
  89849. if err != nil {
  89850. return nil, err
  89851. }
  89852. defer googleapi.CloseBody(res)
  89853. if err := googleapi.CheckResponse(res); err != nil {
  89854. return nil, err
  89855. }
  89856. ret := &Operation{
  89857. ServerResponse: googleapi.ServerResponse{
  89858. Header: res.Header,
  89859. HTTPStatusCode: res.StatusCode,
  89860. },
  89861. }
  89862. target := &ret
  89863. if err := gensupport.DecodeResponse(target, res); err != nil {
  89864. return nil, err
  89865. }
  89866. return ret, nil
  89867. // {
  89868. // "description": "Adds specified number of nodes to the node group.",
  89869. // "httpMethod": "POST",
  89870. // "id": "compute.nodeGroups.addNodes",
  89871. // "parameterOrder": [
  89872. // "project",
  89873. // "zone",
  89874. // "nodeGroup"
  89875. // ],
  89876. // "parameters": {
  89877. // "nodeGroup": {
  89878. // "description": "Name of the NodeGroup resource.",
  89879. // "location": "path",
  89880. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89881. // "required": true,
  89882. // "type": "string"
  89883. // },
  89884. // "project": {
  89885. // "description": "Project ID for this request.",
  89886. // "location": "path",
  89887. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89888. // "required": true,
  89889. // "type": "string"
  89890. // },
  89891. // "requestId": {
  89892. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89893. // "location": "query",
  89894. // "type": "string"
  89895. // },
  89896. // "zone": {
  89897. // "description": "The name of the zone for this request.",
  89898. // "location": "path",
  89899. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89900. // "required": true,
  89901. // "type": "string"
  89902. // }
  89903. // },
  89904. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
  89905. // "request": {
  89906. // "$ref": "NodeGroupsAddNodesRequest"
  89907. // },
  89908. // "response": {
  89909. // "$ref": "Operation"
  89910. // },
  89911. // "scopes": [
  89912. // "https://www.googleapis.com/auth/cloud-platform",
  89913. // "https://www.googleapis.com/auth/compute"
  89914. // ]
  89915. // }
  89916. }
  89917. // method id "compute.nodeGroups.aggregatedList":
  89918. type NodeGroupsAggregatedListCall struct {
  89919. s *Service
  89920. project string
  89921. urlParams_ gensupport.URLParams
  89922. ifNoneMatch_ string
  89923. ctx_ context.Context
  89924. header_ http.Header
  89925. }
  89926. // AggregatedList: Retrieves an aggregated list of node groups. Note:
  89927. // use nodeGroups.listNodes for more details about each group.
  89928. func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
  89929. c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89930. c.project = project
  89931. return c
  89932. }
  89933. // Filter sets the optional parameter "filter": A filter expression that
  89934. // filters resources listed in the response. The expression must specify
  89935. // the field name, a comparison operator, and the value that you want to
  89936. // use for filtering. The value must be a string, a number, or a
  89937. // boolean. The comparison operator must be either =, !=, >, or <.
  89938. //
  89939. // For example, if you are filtering Compute Engine instances, you can
  89940. // exclude instances named example-instance by specifying name !=
  89941. // example-instance.
  89942. //
  89943. // You can also filter nested fields. For example, you could specify
  89944. // scheduling.automaticRestart = false to include instances only if they
  89945. // are not scheduled for automatic restarts. You can use filtering on
  89946. // nested fields to filter based on resource labels.
  89947. //
  89948. // To filter on multiple expressions, provide each separate expression
  89949. // within parentheses. For example, (scheduling.automaticRestart = true)
  89950. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  89951. // AND expression. However, you can include AND and OR expressions
  89952. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  89953. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  89954. // true).
  89955. func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
  89956. c.urlParams_.Set("filter", filter)
  89957. return c
  89958. }
  89959. // MaxResults sets the optional parameter "maxResults": The maximum
  89960. // number of results per page that should be returned. If the number of
  89961. // available results is larger than maxResults, Compute Engine returns a
  89962. // nextPageToken that can be used to get the next page of results in
  89963. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  89964. // (Default: 500)
  89965. func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
  89966. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  89967. return c
  89968. }
  89969. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  89970. // a certain order. By default, results are returned in alphanumerical
  89971. // order based on the resource name.
  89972. //
  89973. // You can also sort results in descending order based on the creation
  89974. // timestamp using orderBy="creationTimestamp desc". This sorts results
  89975. // based on the creationTimestamp field in reverse chronological order
  89976. // (newest result first). Use this to sort resources like operations so
  89977. // that the newest operation is returned first.
  89978. //
  89979. // Currently, only sorting by name or creationTimestamp desc is
  89980. // supported.
  89981. func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
  89982. c.urlParams_.Set("orderBy", orderBy)
  89983. return c
  89984. }
  89985. // PageToken sets the optional parameter "pageToken": Specifies a page
  89986. // token to use. Set pageToken to the nextPageToken returned by a
  89987. // previous list request to get the next page of results.
  89988. func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
  89989. c.urlParams_.Set("pageToken", pageToken)
  89990. return c
  89991. }
  89992. // Fields allows partial responses to be retrieved. See
  89993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89994. // for more information.
  89995. func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
  89996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89997. return c
  89998. }
  89999. // IfNoneMatch sets the optional parameter which makes the operation
  90000. // fail if the object's ETag matches the given value. This is useful for
  90001. // getting updates only after the object has changed since the last
  90002. // request. Use googleapi.IsNotModified to check whether the response
  90003. // error from Do is the result of In-None-Match.
  90004. func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
  90005. c.ifNoneMatch_ = entityTag
  90006. return c
  90007. }
  90008. // Context sets the context to be used in this call's Do method. Any
  90009. // pending HTTP request will be aborted if the provided context is
  90010. // canceled.
  90011. func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
  90012. c.ctx_ = ctx
  90013. return c
  90014. }
  90015. // Header returns an http.Header that can be modified by the caller to
  90016. // add HTTP headers to the request.
  90017. func (c *NodeGroupsAggregatedListCall) Header() http.Header {
  90018. if c.header_ == nil {
  90019. c.header_ = make(http.Header)
  90020. }
  90021. return c.header_
  90022. }
  90023. func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  90024. reqHeaders := make(http.Header)
  90025. for k, v := range c.header_ {
  90026. reqHeaders[k] = v
  90027. }
  90028. reqHeaders.Set("User-Agent", c.s.userAgent())
  90029. if c.ifNoneMatch_ != "" {
  90030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90031. }
  90032. var body io.Reader = nil
  90033. c.urlParams_.Set("alt", alt)
  90034. c.urlParams_.Set("prettyPrint", "false")
  90035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeGroups")
  90036. urls += "?" + c.urlParams_.Encode()
  90037. req, err := http.NewRequest("GET", urls, body)
  90038. if err != nil {
  90039. return nil, err
  90040. }
  90041. req.Header = reqHeaders
  90042. googleapi.Expand(req.URL, map[string]string{
  90043. "project": c.project,
  90044. })
  90045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90046. }
  90047. // Do executes the "compute.nodeGroups.aggregatedList" call.
  90048. // Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
  90049. // non-2xx status code is an error. Response headers are in either
  90050. // *NodeGroupAggregatedList.ServerResponse.Header or (if a response was
  90051. // returned at all) in error.(*googleapi.Error).Header. Use
  90052. // googleapi.IsNotModified to check whether the returned error was
  90053. // because http.StatusNotModified was returned.
  90054. func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) {
  90055. gensupport.SetOptions(c.urlParams_, opts...)
  90056. res, err := c.doRequest("json")
  90057. if res != nil && res.StatusCode == http.StatusNotModified {
  90058. if res.Body != nil {
  90059. res.Body.Close()
  90060. }
  90061. return nil, &googleapi.Error{
  90062. Code: res.StatusCode,
  90063. Header: res.Header,
  90064. }
  90065. }
  90066. if err != nil {
  90067. return nil, err
  90068. }
  90069. defer googleapi.CloseBody(res)
  90070. if err := googleapi.CheckResponse(res); err != nil {
  90071. return nil, err
  90072. }
  90073. ret := &NodeGroupAggregatedList{
  90074. ServerResponse: googleapi.ServerResponse{
  90075. Header: res.Header,
  90076. HTTPStatusCode: res.StatusCode,
  90077. },
  90078. }
  90079. target := &ret
  90080. if err := gensupport.DecodeResponse(target, res); err != nil {
  90081. return nil, err
  90082. }
  90083. return ret, nil
  90084. // {
  90085. // "description": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.",
  90086. // "httpMethod": "GET",
  90087. // "id": "compute.nodeGroups.aggregatedList",
  90088. // "parameterOrder": [
  90089. // "project"
  90090. // ],
  90091. // "parameters": {
  90092. // "filter": {
  90093. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  90094. // "location": "query",
  90095. // "type": "string"
  90096. // },
  90097. // "maxResults": {
  90098. // "default": "500",
  90099. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  90100. // "format": "uint32",
  90101. // "location": "query",
  90102. // "minimum": "0",
  90103. // "type": "integer"
  90104. // },
  90105. // "orderBy": {
  90106. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  90107. // "location": "query",
  90108. // "type": "string"
  90109. // },
  90110. // "pageToken": {
  90111. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  90112. // "location": "query",
  90113. // "type": "string"
  90114. // },
  90115. // "project": {
  90116. // "description": "Project ID for this request.",
  90117. // "location": "path",
  90118. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90119. // "required": true,
  90120. // "type": "string"
  90121. // }
  90122. // },
  90123. // "path": "{project}/aggregated/nodeGroups",
  90124. // "response": {
  90125. // "$ref": "NodeGroupAggregatedList"
  90126. // },
  90127. // "scopes": [
  90128. // "https://www.googleapis.com/auth/cloud-platform",
  90129. // "https://www.googleapis.com/auth/compute",
  90130. // "https://www.googleapis.com/auth/compute.readonly"
  90131. // ]
  90132. // }
  90133. }
  90134. // Pages invokes f for each page of results.
  90135. // A non-nil error returned from f will halt the iteration.
  90136. // The provided context supersedes any context provided to the Context method.
  90137. func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error {
  90138. c.ctx_ = ctx
  90139. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90140. for {
  90141. x, err := c.Do()
  90142. if err != nil {
  90143. return err
  90144. }
  90145. if err := f(x); err != nil {
  90146. return err
  90147. }
  90148. if x.NextPageToken == "" {
  90149. return nil
  90150. }
  90151. c.PageToken(x.NextPageToken)
  90152. }
  90153. }
  90154. // method id "compute.nodeGroups.delete":
  90155. type NodeGroupsDeleteCall struct {
  90156. s *Service
  90157. project string
  90158. zone string
  90159. nodeGroup string
  90160. urlParams_ gensupport.URLParams
  90161. ctx_ context.Context
  90162. header_ http.Header
  90163. }
  90164. // Delete: Deletes the specified NodeGroup resource.
  90165. func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
  90166. c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90167. c.project = project
  90168. c.zone = zone
  90169. c.nodeGroup = nodeGroup
  90170. return c
  90171. }
  90172. // RequestId sets the optional parameter "requestId": An optional
  90173. // request ID to identify requests. Specify a unique request ID so that
  90174. // if you must retry your request, the server will know to ignore the
  90175. // request if it has already been completed.
  90176. //
  90177. // For example, consider a situation where you make an initial request
  90178. // and the request times out. If you make the request again with the
  90179. // same request ID, the server can check if original operation with the
  90180. // same request ID was received, and if so, will ignore the second
  90181. // request. This prevents clients from accidentally creating duplicate
  90182. // commitments.
  90183. //
  90184. // The request ID must be a valid UUID with the exception that zero UUID
  90185. // is not supported (00000000-0000-0000-0000-000000000000).
  90186. func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
  90187. c.urlParams_.Set("requestId", requestId)
  90188. return c
  90189. }
  90190. // Fields allows partial responses to be retrieved. See
  90191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90192. // for more information.
  90193. func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
  90194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90195. return c
  90196. }
  90197. // Context sets the context to be used in this call's Do method. Any
  90198. // pending HTTP request will be aborted if the provided context is
  90199. // canceled.
  90200. func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
  90201. c.ctx_ = ctx
  90202. return c
  90203. }
  90204. // Header returns an http.Header that can be modified by the caller to
  90205. // add HTTP headers to the request.
  90206. func (c *NodeGroupsDeleteCall) Header() http.Header {
  90207. if c.header_ == nil {
  90208. c.header_ = make(http.Header)
  90209. }
  90210. return c.header_
  90211. }
  90212. func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  90213. reqHeaders := make(http.Header)
  90214. for k, v := range c.header_ {
  90215. reqHeaders[k] = v
  90216. }
  90217. reqHeaders.Set("User-Agent", c.s.userAgent())
  90218. var body io.Reader = nil
  90219. c.urlParams_.Set("alt", alt)
  90220. c.urlParams_.Set("prettyPrint", "false")
  90221. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  90222. urls += "?" + c.urlParams_.Encode()
  90223. req, err := http.NewRequest("DELETE", urls, body)
  90224. if err != nil {
  90225. return nil, err
  90226. }
  90227. req.Header = reqHeaders
  90228. googleapi.Expand(req.URL, map[string]string{
  90229. "project": c.project,
  90230. "zone": c.zone,
  90231. "nodeGroup": c.nodeGroup,
  90232. })
  90233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90234. }
  90235. // Do executes the "compute.nodeGroups.delete" call.
  90236. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90237. // status code is an error. Response headers are in either
  90238. // *Operation.ServerResponse.Header or (if a response was returned at
  90239. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90240. // to check whether the returned error was because
  90241. // http.StatusNotModified was returned.
  90242. func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90243. gensupport.SetOptions(c.urlParams_, opts...)
  90244. res, err := c.doRequest("json")
  90245. if res != nil && res.StatusCode == http.StatusNotModified {
  90246. if res.Body != nil {
  90247. res.Body.Close()
  90248. }
  90249. return nil, &googleapi.Error{
  90250. Code: res.StatusCode,
  90251. Header: res.Header,
  90252. }
  90253. }
  90254. if err != nil {
  90255. return nil, err
  90256. }
  90257. defer googleapi.CloseBody(res)
  90258. if err := googleapi.CheckResponse(res); err != nil {
  90259. return nil, err
  90260. }
  90261. ret := &Operation{
  90262. ServerResponse: googleapi.ServerResponse{
  90263. Header: res.Header,
  90264. HTTPStatusCode: res.StatusCode,
  90265. },
  90266. }
  90267. target := &ret
  90268. if err := gensupport.DecodeResponse(target, res); err != nil {
  90269. return nil, err
  90270. }
  90271. return ret, nil
  90272. // {
  90273. // "description": "Deletes the specified NodeGroup resource.",
  90274. // "httpMethod": "DELETE",
  90275. // "id": "compute.nodeGroups.delete",
  90276. // "parameterOrder": [
  90277. // "project",
  90278. // "zone",
  90279. // "nodeGroup"
  90280. // ],
  90281. // "parameters": {
  90282. // "nodeGroup": {
  90283. // "description": "Name of the NodeGroup resource to delete.",
  90284. // "location": "path",
  90285. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90286. // "required": true,
  90287. // "type": "string"
  90288. // },
  90289. // "project": {
  90290. // "description": "Project ID for this request.",
  90291. // "location": "path",
  90292. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90293. // "required": true,
  90294. // "type": "string"
  90295. // },
  90296. // "requestId": {
  90297. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90298. // "location": "query",
  90299. // "type": "string"
  90300. // },
  90301. // "zone": {
  90302. // "description": "The name of the zone for this request.",
  90303. // "location": "path",
  90304. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90305. // "required": true,
  90306. // "type": "string"
  90307. // }
  90308. // },
  90309. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  90310. // "response": {
  90311. // "$ref": "Operation"
  90312. // },
  90313. // "scopes": [
  90314. // "https://www.googleapis.com/auth/cloud-platform",
  90315. // "https://www.googleapis.com/auth/compute"
  90316. // ]
  90317. // }
  90318. }
  90319. // method id "compute.nodeGroups.deleteNodes":
  90320. type NodeGroupsDeleteNodesCall struct {
  90321. s *Service
  90322. project string
  90323. zone string
  90324. nodeGroup string
  90325. nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
  90326. urlParams_ gensupport.URLParams
  90327. ctx_ context.Context
  90328. header_ http.Header
  90329. }
  90330. // DeleteNodes: Deletes specified nodes from the node group.
  90331. func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
  90332. c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90333. c.project = project
  90334. c.zone = zone
  90335. c.nodeGroup = nodeGroup
  90336. c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
  90337. return c
  90338. }
  90339. // RequestId sets the optional parameter "requestId": An optional
  90340. // request ID to identify requests. Specify a unique request ID so that
  90341. // if you must retry your request, the server will know to ignore the
  90342. // request if it has already been completed.
  90343. //
  90344. // For example, consider a situation where you make an initial request
  90345. // and the request times out. If you make the request again with the
  90346. // same request ID, the server can check if original operation with the
  90347. // same request ID was received, and if so, will ignore the second
  90348. // request. This prevents clients from accidentally creating duplicate
  90349. // commitments.
  90350. //
  90351. // The request ID must be a valid UUID with the exception that zero UUID
  90352. // is not supported (00000000-0000-0000-0000-000000000000).
  90353. func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
  90354. c.urlParams_.Set("requestId", requestId)
  90355. return c
  90356. }
  90357. // Fields allows partial responses to be retrieved. See
  90358. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90359. // for more information.
  90360. func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
  90361. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90362. return c
  90363. }
  90364. // Context sets the context to be used in this call's Do method. Any
  90365. // pending HTTP request will be aborted if the provided context is
  90366. // canceled.
  90367. func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
  90368. c.ctx_ = ctx
  90369. return c
  90370. }
  90371. // Header returns an http.Header that can be modified by the caller to
  90372. // add HTTP headers to the request.
  90373. func (c *NodeGroupsDeleteNodesCall) Header() http.Header {
  90374. if c.header_ == nil {
  90375. c.header_ = make(http.Header)
  90376. }
  90377. return c.header_
  90378. }
  90379. func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
  90380. reqHeaders := make(http.Header)
  90381. for k, v := range c.header_ {
  90382. reqHeaders[k] = v
  90383. }
  90384. reqHeaders.Set("User-Agent", c.s.userAgent())
  90385. var body io.Reader = nil
  90386. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
  90387. if err != nil {
  90388. return nil, err
  90389. }
  90390. reqHeaders.Set("Content-Type", "application/json")
  90391. c.urlParams_.Set("alt", alt)
  90392. c.urlParams_.Set("prettyPrint", "false")
  90393. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
  90394. urls += "?" + c.urlParams_.Encode()
  90395. req, err := http.NewRequest("POST", urls, body)
  90396. if err != nil {
  90397. return nil, err
  90398. }
  90399. req.Header = reqHeaders
  90400. googleapi.Expand(req.URL, map[string]string{
  90401. "project": c.project,
  90402. "zone": c.zone,
  90403. "nodeGroup": c.nodeGroup,
  90404. })
  90405. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90406. }
  90407. // Do executes the "compute.nodeGroups.deleteNodes" call.
  90408. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90409. // status code is an error. Response headers are in either
  90410. // *Operation.ServerResponse.Header or (if a response was returned at
  90411. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90412. // to check whether the returned error was because
  90413. // http.StatusNotModified was returned.
  90414. func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90415. gensupport.SetOptions(c.urlParams_, opts...)
  90416. res, err := c.doRequest("json")
  90417. if res != nil && res.StatusCode == http.StatusNotModified {
  90418. if res.Body != nil {
  90419. res.Body.Close()
  90420. }
  90421. return nil, &googleapi.Error{
  90422. Code: res.StatusCode,
  90423. Header: res.Header,
  90424. }
  90425. }
  90426. if err != nil {
  90427. return nil, err
  90428. }
  90429. defer googleapi.CloseBody(res)
  90430. if err := googleapi.CheckResponse(res); err != nil {
  90431. return nil, err
  90432. }
  90433. ret := &Operation{
  90434. ServerResponse: googleapi.ServerResponse{
  90435. Header: res.Header,
  90436. HTTPStatusCode: res.StatusCode,
  90437. },
  90438. }
  90439. target := &ret
  90440. if err := gensupport.DecodeResponse(target, res); err != nil {
  90441. return nil, err
  90442. }
  90443. return ret, nil
  90444. // {
  90445. // "description": "Deletes specified nodes from the node group.",
  90446. // "httpMethod": "POST",
  90447. // "id": "compute.nodeGroups.deleteNodes",
  90448. // "parameterOrder": [
  90449. // "project",
  90450. // "zone",
  90451. // "nodeGroup"
  90452. // ],
  90453. // "parameters": {
  90454. // "nodeGroup": {
  90455. // "description": "Name of the NodeGroup resource to delete.",
  90456. // "location": "path",
  90457. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90458. // "required": true,
  90459. // "type": "string"
  90460. // },
  90461. // "project": {
  90462. // "description": "Project ID for this request.",
  90463. // "location": "path",
  90464. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90465. // "required": true,
  90466. // "type": "string"
  90467. // },
  90468. // "requestId": {
  90469. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90470. // "location": "query",
  90471. // "type": "string"
  90472. // },
  90473. // "zone": {
  90474. // "description": "The name of the zone for this request.",
  90475. // "location": "path",
  90476. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90477. // "required": true,
  90478. // "type": "string"
  90479. // }
  90480. // },
  90481. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
  90482. // "request": {
  90483. // "$ref": "NodeGroupsDeleteNodesRequest"
  90484. // },
  90485. // "response": {
  90486. // "$ref": "Operation"
  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.nodeGroups.get":
  90495. type NodeGroupsGetCall struct {
  90496. s *Service
  90497. project string
  90498. zone string
  90499. nodeGroup string
  90500. urlParams_ gensupport.URLParams
  90501. ifNoneMatch_ string
  90502. ctx_ context.Context
  90503. header_ http.Header
  90504. }
  90505. // Get: Returns the specified NodeGroup. Get a list of available
  90506. // NodeGroups by making a list() request. Note: the "nodes" field should
  90507. // not be used. Use nodeGroups.listNodes instead.
  90508. func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
  90509. c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90510. c.project = project
  90511. c.zone = zone
  90512. c.nodeGroup = nodeGroup
  90513. return c
  90514. }
  90515. // Fields allows partial responses to be retrieved. See
  90516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90517. // for more information.
  90518. func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
  90519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90520. return c
  90521. }
  90522. // IfNoneMatch sets the optional parameter which makes the operation
  90523. // fail if the object's ETag matches the given value. This is useful for
  90524. // getting updates only after the object has changed since the last
  90525. // request. Use googleapi.IsNotModified to check whether the response
  90526. // error from Do is the result of In-None-Match.
  90527. func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
  90528. c.ifNoneMatch_ = entityTag
  90529. return c
  90530. }
  90531. // Context sets the context to be used in this call's Do method. Any
  90532. // pending HTTP request will be aborted if the provided context is
  90533. // canceled.
  90534. func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
  90535. c.ctx_ = ctx
  90536. return c
  90537. }
  90538. // Header returns an http.Header that can be modified by the caller to
  90539. // add HTTP headers to the request.
  90540. func (c *NodeGroupsGetCall) Header() http.Header {
  90541. if c.header_ == nil {
  90542. c.header_ = make(http.Header)
  90543. }
  90544. return c.header_
  90545. }
  90546. func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  90547. reqHeaders := make(http.Header)
  90548. for k, v := range c.header_ {
  90549. reqHeaders[k] = v
  90550. }
  90551. reqHeaders.Set("User-Agent", c.s.userAgent())
  90552. if c.ifNoneMatch_ != "" {
  90553. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90554. }
  90555. var body io.Reader = nil
  90556. c.urlParams_.Set("alt", alt)
  90557. c.urlParams_.Set("prettyPrint", "false")
  90558. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  90559. urls += "?" + c.urlParams_.Encode()
  90560. req, err := http.NewRequest("GET", urls, body)
  90561. if err != nil {
  90562. return nil, err
  90563. }
  90564. req.Header = reqHeaders
  90565. googleapi.Expand(req.URL, map[string]string{
  90566. "project": c.project,
  90567. "zone": c.zone,
  90568. "nodeGroup": c.nodeGroup,
  90569. })
  90570. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90571. }
  90572. // Do executes the "compute.nodeGroups.get" call.
  90573. // Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
  90574. // status code is an error. Response headers are in either
  90575. // *NodeGroup.ServerResponse.Header or (if a response was returned at
  90576. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90577. // to check whether the returned error was because
  90578. // http.StatusNotModified was returned.
  90579. func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) {
  90580. gensupport.SetOptions(c.urlParams_, opts...)
  90581. res, err := c.doRequest("json")
  90582. if res != nil && res.StatusCode == http.StatusNotModified {
  90583. if res.Body != nil {
  90584. res.Body.Close()
  90585. }
  90586. return nil, &googleapi.Error{
  90587. Code: res.StatusCode,
  90588. Header: res.Header,
  90589. }
  90590. }
  90591. if err != nil {
  90592. return nil, err
  90593. }
  90594. defer googleapi.CloseBody(res)
  90595. if err := googleapi.CheckResponse(res); err != nil {
  90596. return nil, err
  90597. }
  90598. ret := &NodeGroup{
  90599. ServerResponse: googleapi.ServerResponse{
  90600. Header: res.Header,
  90601. HTTPStatusCode: res.StatusCode,
  90602. },
  90603. }
  90604. target := &ret
  90605. if err := gensupport.DecodeResponse(target, res); err != nil {
  90606. return nil, err
  90607. }
  90608. return ret, nil
  90609. // {
  90610. // "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.",
  90611. // "httpMethod": "GET",
  90612. // "id": "compute.nodeGroups.get",
  90613. // "parameterOrder": [
  90614. // "project",
  90615. // "zone",
  90616. // "nodeGroup"
  90617. // ],
  90618. // "parameters": {
  90619. // "nodeGroup": {
  90620. // "description": "Name of the node group to return.",
  90621. // "location": "path",
  90622. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90623. // "required": true,
  90624. // "type": "string"
  90625. // },
  90626. // "project": {
  90627. // "description": "Project ID for this request.",
  90628. // "location": "path",
  90629. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90630. // "required": true,
  90631. // "type": "string"
  90632. // },
  90633. // "zone": {
  90634. // "description": "The name of the zone for this request.",
  90635. // "location": "path",
  90636. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90637. // "required": true,
  90638. // "type": "string"
  90639. // }
  90640. // },
  90641. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  90642. // "response": {
  90643. // "$ref": "NodeGroup"
  90644. // },
  90645. // "scopes": [
  90646. // "https://www.googleapis.com/auth/cloud-platform",
  90647. // "https://www.googleapis.com/auth/compute",
  90648. // "https://www.googleapis.com/auth/compute.readonly"
  90649. // ]
  90650. // }
  90651. }
  90652. // method id "compute.nodeGroups.getIamPolicy":
  90653. type NodeGroupsGetIamPolicyCall struct {
  90654. s *Service
  90655. project string
  90656. zone string
  90657. resource string
  90658. urlParams_ gensupport.URLParams
  90659. ifNoneMatch_ string
  90660. ctx_ context.Context
  90661. header_ http.Header
  90662. }
  90663. // GetIamPolicy: Gets the access control policy for a resource. May be
  90664. // empty if no such policy or resource exists.
  90665. func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
  90666. c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90667. c.project = project
  90668. c.zone = zone
  90669. c.resource = resource
  90670. return c
  90671. }
  90672. // Fields allows partial responses to be retrieved. See
  90673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90674. // for more information.
  90675. func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
  90676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90677. return c
  90678. }
  90679. // IfNoneMatch sets the optional parameter which makes the operation
  90680. // fail if the object's ETag matches the given value. This is useful for
  90681. // getting updates only after the object has changed since the last
  90682. // request. Use googleapi.IsNotModified to check whether the response
  90683. // error from Do is the result of In-None-Match.
  90684. func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
  90685. c.ifNoneMatch_ = entityTag
  90686. return c
  90687. }
  90688. // Context sets the context to be used in this call's Do method. Any
  90689. // pending HTTP request will be aborted if the provided context is
  90690. // canceled.
  90691. func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
  90692. c.ctx_ = ctx
  90693. return c
  90694. }
  90695. // Header returns an http.Header that can be modified by the caller to
  90696. // add HTTP headers to the request.
  90697. func (c *NodeGroupsGetIamPolicyCall) Header() http.Header {
  90698. if c.header_ == nil {
  90699. c.header_ = make(http.Header)
  90700. }
  90701. return c.header_
  90702. }
  90703. func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  90704. reqHeaders := make(http.Header)
  90705. for k, v := range c.header_ {
  90706. reqHeaders[k] = v
  90707. }
  90708. reqHeaders.Set("User-Agent", c.s.userAgent())
  90709. if c.ifNoneMatch_ != "" {
  90710. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90711. }
  90712. var body io.Reader = nil
  90713. c.urlParams_.Set("alt", alt)
  90714. c.urlParams_.Set("prettyPrint", "false")
  90715. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
  90716. urls += "?" + c.urlParams_.Encode()
  90717. req, err := http.NewRequest("GET", urls, body)
  90718. if err != nil {
  90719. return nil, err
  90720. }
  90721. req.Header = reqHeaders
  90722. googleapi.Expand(req.URL, map[string]string{
  90723. "project": c.project,
  90724. "zone": c.zone,
  90725. "resource": c.resource,
  90726. })
  90727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90728. }
  90729. // Do executes the "compute.nodeGroups.getIamPolicy" call.
  90730. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  90731. // code is an error. Response headers are in either
  90732. // *Policy.ServerResponse.Header or (if a response was returned at all)
  90733. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  90734. // check whether the returned error was because http.StatusNotModified
  90735. // was returned.
  90736. func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  90737. gensupport.SetOptions(c.urlParams_, opts...)
  90738. res, err := c.doRequest("json")
  90739. if res != nil && res.StatusCode == http.StatusNotModified {
  90740. if res.Body != nil {
  90741. res.Body.Close()
  90742. }
  90743. return nil, &googleapi.Error{
  90744. Code: res.StatusCode,
  90745. Header: res.Header,
  90746. }
  90747. }
  90748. if err != nil {
  90749. return nil, err
  90750. }
  90751. defer googleapi.CloseBody(res)
  90752. if err := googleapi.CheckResponse(res); err != nil {
  90753. return nil, err
  90754. }
  90755. ret := &Policy{
  90756. ServerResponse: googleapi.ServerResponse{
  90757. Header: res.Header,
  90758. HTTPStatusCode: res.StatusCode,
  90759. },
  90760. }
  90761. target := &ret
  90762. if err := gensupport.DecodeResponse(target, res); err != nil {
  90763. return nil, err
  90764. }
  90765. return ret, nil
  90766. // {
  90767. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  90768. // "httpMethod": "GET",
  90769. // "id": "compute.nodeGroups.getIamPolicy",
  90770. // "parameterOrder": [
  90771. // "project",
  90772. // "zone",
  90773. // "resource"
  90774. // ],
  90775. // "parameters": {
  90776. // "project": {
  90777. // "description": "Project ID for this request.",
  90778. // "location": "path",
  90779. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90780. // "required": true,
  90781. // "type": "string"
  90782. // },
  90783. // "resource": {
  90784. // "description": "Name or id of the resource for this request.",
  90785. // "location": "path",
  90786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90787. // "required": true,
  90788. // "type": "string"
  90789. // },
  90790. // "zone": {
  90791. // "description": "The name of the zone for this request.",
  90792. // "location": "path",
  90793. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90794. // "required": true,
  90795. // "type": "string"
  90796. // }
  90797. // },
  90798. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
  90799. // "response": {
  90800. // "$ref": "Policy"
  90801. // },
  90802. // "scopes": [
  90803. // "https://www.googleapis.com/auth/cloud-platform",
  90804. // "https://www.googleapis.com/auth/compute",
  90805. // "https://www.googleapis.com/auth/compute.readonly"
  90806. // ]
  90807. // }
  90808. }
  90809. // method id "compute.nodeGroups.insert":
  90810. type NodeGroupsInsertCall struct {
  90811. s *Service
  90812. project string
  90813. zone string
  90814. nodegroup *NodeGroup
  90815. urlParams_ gensupport.URLParams
  90816. ctx_ context.Context
  90817. header_ http.Header
  90818. }
  90819. // Insert: Creates a NodeGroup resource in the specified project using
  90820. // the data included in the request.
  90821. func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
  90822. c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90823. c.project = project
  90824. c.zone = zone
  90825. c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
  90826. c.nodegroup = nodegroup
  90827. return c
  90828. }
  90829. // RequestId sets the optional parameter "requestId": An optional
  90830. // request ID to identify requests. Specify a unique request ID so that
  90831. // if you must retry your request, the server will know to ignore the
  90832. // request if it has already been completed.
  90833. //
  90834. // For example, consider a situation where you make an initial request
  90835. // and the request times out. If you make the request again with the
  90836. // same request ID, the server can check if original operation with the
  90837. // same request ID was received, and if so, will ignore the second
  90838. // request. This prevents clients from accidentally creating duplicate
  90839. // commitments.
  90840. //
  90841. // The request ID must be a valid UUID with the exception that zero UUID
  90842. // is not supported (00000000-0000-0000-0000-000000000000).
  90843. func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
  90844. c.urlParams_.Set("requestId", requestId)
  90845. return c
  90846. }
  90847. // Fields allows partial responses to be retrieved. See
  90848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90849. // for more information.
  90850. func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
  90851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90852. return c
  90853. }
  90854. // Context sets the context to be used in this call's Do method. Any
  90855. // pending HTTP request will be aborted if the provided context is
  90856. // canceled.
  90857. func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
  90858. c.ctx_ = ctx
  90859. return c
  90860. }
  90861. // Header returns an http.Header that can be modified by the caller to
  90862. // add HTTP headers to the request.
  90863. func (c *NodeGroupsInsertCall) Header() http.Header {
  90864. if c.header_ == nil {
  90865. c.header_ = make(http.Header)
  90866. }
  90867. return c.header_
  90868. }
  90869. func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  90870. reqHeaders := make(http.Header)
  90871. for k, v := range c.header_ {
  90872. reqHeaders[k] = v
  90873. }
  90874. reqHeaders.Set("User-Agent", c.s.userAgent())
  90875. var body io.Reader = nil
  90876. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
  90877. if err != nil {
  90878. return nil, err
  90879. }
  90880. reqHeaders.Set("Content-Type", "application/json")
  90881. c.urlParams_.Set("alt", alt)
  90882. c.urlParams_.Set("prettyPrint", "false")
  90883. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  90884. urls += "?" + c.urlParams_.Encode()
  90885. req, err := http.NewRequest("POST", urls, body)
  90886. if err != nil {
  90887. return nil, err
  90888. }
  90889. req.Header = reqHeaders
  90890. googleapi.Expand(req.URL, map[string]string{
  90891. "project": c.project,
  90892. "zone": c.zone,
  90893. })
  90894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90895. }
  90896. // Do executes the "compute.nodeGroups.insert" call.
  90897. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90898. // status code is an error. Response headers are in either
  90899. // *Operation.ServerResponse.Header or (if a response was returned at
  90900. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90901. // to check whether the returned error was because
  90902. // http.StatusNotModified was returned.
  90903. func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90904. gensupport.SetOptions(c.urlParams_, opts...)
  90905. res, err := c.doRequest("json")
  90906. if res != nil && res.StatusCode == http.StatusNotModified {
  90907. if res.Body != nil {
  90908. res.Body.Close()
  90909. }
  90910. return nil, &googleapi.Error{
  90911. Code: res.StatusCode,
  90912. Header: res.Header,
  90913. }
  90914. }
  90915. if err != nil {
  90916. return nil, err
  90917. }
  90918. defer googleapi.CloseBody(res)
  90919. if err := googleapi.CheckResponse(res); err != nil {
  90920. return nil, err
  90921. }
  90922. ret := &Operation{
  90923. ServerResponse: googleapi.ServerResponse{
  90924. Header: res.Header,
  90925. HTTPStatusCode: res.StatusCode,
  90926. },
  90927. }
  90928. target := &ret
  90929. if err := gensupport.DecodeResponse(target, res); err != nil {
  90930. return nil, err
  90931. }
  90932. return ret, nil
  90933. // {
  90934. // "description": "Creates a NodeGroup resource in the specified project using the data included in the request.",
  90935. // "httpMethod": "POST",
  90936. // "id": "compute.nodeGroups.insert",
  90937. // "parameterOrder": [
  90938. // "project",
  90939. // "zone",
  90940. // "initialNodeCount"
  90941. // ],
  90942. // "parameters": {
  90943. // "initialNodeCount": {
  90944. // "description": "Initial count of nodes in the node group.",
  90945. // "format": "int32",
  90946. // "location": "query",
  90947. // "required": true,
  90948. // "type": "integer"
  90949. // },
  90950. // "project": {
  90951. // "description": "Project ID for this request.",
  90952. // "location": "path",
  90953. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90954. // "required": true,
  90955. // "type": "string"
  90956. // },
  90957. // "requestId": {
  90958. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90959. // "location": "query",
  90960. // "type": "string"
  90961. // },
  90962. // "zone": {
  90963. // "description": "The name of the zone for this request.",
  90964. // "location": "path",
  90965. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90966. // "required": true,
  90967. // "type": "string"
  90968. // }
  90969. // },
  90970. // "path": "{project}/zones/{zone}/nodeGroups",
  90971. // "request": {
  90972. // "$ref": "NodeGroup"
  90973. // },
  90974. // "response": {
  90975. // "$ref": "Operation"
  90976. // },
  90977. // "scopes": [
  90978. // "https://www.googleapis.com/auth/cloud-platform",
  90979. // "https://www.googleapis.com/auth/compute"
  90980. // ]
  90981. // }
  90982. }
  90983. // method id "compute.nodeGroups.list":
  90984. type NodeGroupsListCall struct {
  90985. s *Service
  90986. project string
  90987. zone string
  90988. urlParams_ gensupport.URLParams
  90989. ifNoneMatch_ string
  90990. ctx_ context.Context
  90991. header_ http.Header
  90992. }
  90993. // List: Retrieves a list of node groups available to the specified
  90994. // project. Note: use nodeGroups.listNodes for more details about each
  90995. // group.
  90996. func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
  90997. c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90998. c.project = project
  90999. c.zone = zone
  91000. return c
  91001. }
  91002. // Filter sets the optional parameter "filter": A filter expression that
  91003. // filters resources listed in the response. The expression must specify
  91004. // the field name, a comparison operator, and the value that you want to
  91005. // use for filtering. The value must be a string, a number, or a
  91006. // boolean. The comparison operator must be either =, !=, >, or <.
  91007. //
  91008. // For example, if you are filtering Compute Engine instances, you can
  91009. // exclude instances named example-instance by specifying name !=
  91010. // example-instance.
  91011. //
  91012. // You can also filter nested fields. For example, you could specify
  91013. // scheduling.automaticRestart = false to include instances only if they
  91014. // are not scheduled for automatic restarts. You can use filtering on
  91015. // nested fields to filter based on resource labels.
  91016. //
  91017. // To filter on multiple expressions, provide each separate expression
  91018. // within parentheses. For example, (scheduling.automaticRestart = true)
  91019. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  91020. // AND expression. However, you can include AND and OR expressions
  91021. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  91022. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  91023. // true).
  91024. func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
  91025. c.urlParams_.Set("filter", filter)
  91026. return c
  91027. }
  91028. // MaxResults sets the optional parameter "maxResults": The maximum
  91029. // number of results per page that should be returned. If the number of
  91030. // available results is larger than maxResults, Compute Engine returns a
  91031. // nextPageToken that can be used to get the next page of results in
  91032. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  91033. // (Default: 500)
  91034. func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
  91035. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  91036. return c
  91037. }
  91038. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91039. // a certain order. By default, results are returned in alphanumerical
  91040. // order based on the resource name.
  91041. //
  91042. // You can also sort results in descending order based on the creation
  91043. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91044. // based on the creationTimestamp field in reverse chronological order
  91045. // (newest result first). Use this to sort resources like operations so
  91046. // that the newest operation is returned first.
  91047. //
  91048. // Currently, only sorting by name or creationTimestamp desc is
  91049. // supported.
  91050. func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
  91051. c.urlParams_.Set("orderBy", orderBy)
  91052. return c
  91053. }
  91054. // PageToken sets the optional parameter "pageToken": Specifies a page
  91055. // token to use. Set pageToken to the nextPageToken returned by a
  91056. // previous list request to get the next page of results.
  91057. func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
  91058. c.urlParams_.Set("pageToken", pageToken)
  91059. return c
  91060. }
  91061. // Fields allows partial responses to be retrieved. See
  91062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91063. // for more information.
  91064. func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
  91065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91066. return c
  91067. }
  91068. // IfNoneMatch sets the optional parameter which makes the operation
  91069. // fail if the object's ETag matches the given value. This is useful for
  91070. // getting updates only after the object has changed since the last
  91071. // request. Use googleapi.IsNotModified to check whether the response
  91072. // error from Do is the result of In-None-Match.
  91073. func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
  91074. c.ifNoneMatch_ = entityTag
  91075. return c
  91076. }
  91077. // Context sets the context to be used in this call's Do method. Any
  91078. // pending HTTP request will be aborted if the provided context is
  91079. // canceled.
  91080. func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
  91081. c.ctx_ = ctx
  91082. return c
  91083. }
  91084. // Header returns an http.Header that can be modified by the caller to
  91085. // add HTTP headers to the request.
  91086. func (c *NodeGroupsListCall) Header() http.Header {
  91087. if c.header_ == nil {
  91088. c.header_ = make(http.Header)
  91089. }
  91090. return c.header_
  91091. }
  91092. func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  91093. reqHeaders := make(http.Header)
  91094. for k, v := range c.header_ {
  91095. reqHeaders[k] = v
  91096. }
  91097. reqHeaders.Set("User-Agent", c.s.userAgent())
  91098. if c.ifNoneMatch_ != "" {
  91099. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91100. }
  91101. var body io.Reader = nil
  91102. c.urlParams_.Set("alt", alt)
  91103. c.urlParams_.Set("prettyPrint", "false")
  91104. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  91105. urls += "?" + c.urlParams_.Encode()
  91106. req, err := http.NewRequest("GET", urls, body)
  91107. if err != nil {
  91108. return nil, err
  91109. }
  91110. req.Header = reqHeaders
  91111. googleapi.Expand(req.URL, map[string]string{
  91112. "project": c.project,
  91113. "zone": c.zone,
  91114. })
  91115. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91116. }
  91117. // Do executes the "compute.nodeGroups.list" call.
  91118. // Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
  91119. // status code is an error. Response headers are in either
  91120. // *NodeGroupList.ServerResponse.Header or (if a response was returned
  91121. // at all) in error.(*googleapi.Error).Header. Use
  91122. // googleapi.IsNotModified to check whether the returned error was
  91123. // because http.StatusNotModified was returned.
  91124. func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) {
  91125. gensupport.SetOptions(c.urlParams_, opts...)
  91126. res, err := c.doRequest("json")
  91127. if res != nil && res.StatusCode == http.StatusNotModified {
  91128. if res.Body != nil {
  91129. res.Body.Close()
  91130. }
  91131. return nil, &googleapi.Error{
  91132. Code: res.StatusCode,
  91133. Header: res.Header,
  91134. }
  91135. }
  91136. if err != nil {
  91137. return nil, err
  91138. }
  91139. defer googleapi.CloseBody(res)
  91140. if err := googleapi.CheckResponse(res); err != nil {
  91141. return nil, err
  91142. }
  91143. ret := &NodeGroupList{
  91144. ServerResponse: googleapi.ServerResponse{
  91145. Header: res.Header,
  91146. HTTPStatusCode: res.StatusCode,
  91147. },
  91148. }
  91149. target := &ret
  91150. if err := gensupport.DecodeResponse(target, res); err != nil {
  91151. return nil, err
  91152. }
  91153. return ret, nil
  91154. // {
  91155. // "description": "Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.",
  91156. // "httpMethod": "GET",
  91157. // "id": "compute.nodeGroups.list",
  91158. // "parameterOrder": [
  91159. // "project",
  91160. // "zone"
  91161. // ],
  91162. // "parameters": {
  91163. // "filter": {
  91164. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  91165. // "location": "query",
  91166. // "type": "string"
  91167. // },
  91168. // "maxResults": {
  91169. // "default": "500",
  91170. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  91171. // "format": "uint32",
  91172. // "location": "query",
  91173. // "minimum": "0",
  91174. // "type": "integer"
  91175. // },
  91176. // "orderBy": {
  91177. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  91178. // "location": "query",
  91179. // "type": "string"
  91180. // },
  91181. // "pageToken": {
  91182. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  91183. // "location": "query",
  91184. // "type": "string"
  91185. // },
  91186. // "project": {
  91187. // "description": "Project ID for this request.",
  91188. // "location": "path",
  91189. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91190. // "required": true,
  91191. // "type": "string"
  91192. // },
  91193. // "zone": {
  91194. // "description": "The name of the zone for this request.",
  91195. // "location": "path",
  91196. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91197. // "required": true,
  91198. // "type": "string"
  91199. // }
  91200. // },
  91201. // "path": "{project}/zones/{zone}/nodeGroups",
  91202. // "response": {
  91203. // "$ref": "NodeGroupList"
  91204. // },
  91205. // "scopes": [
  91206. // "https://www.googleapis.com/auth/cloud-platform",
  91207. // "https://www.googleapis.com/auth/compute",
  91208. // "https://www.googleapis.com/auth/compute.readonly"
  91209. // ]
  91210. // }
  91211. }
  91212. // Pages invokes f for each page of results.
  91213. // A non-nil error returned from f will halt the iteration.
  91214. // The provided context supersedes any context provided to the Context method.
  91215. func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error {
  91216. c.ctx_ = ctx
  91217. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91218. for {
  91219. x, err := c.Do()
  91220. if err != nil {
  91221. return err
  91222. }
  91223. if err := f(x); err != nil {
  91224. return err
  91225. }
  91226. if x.NextPageToken == "" {
  91227. return nil
  91228. }
  91229. c.PageToken(x.NextPageToken)
  91230. }
  91231. }
  91232. // method id "compute.nodeGroups.listNodes":
  91233. type NodeGroupsListNodesCall struct {
  91234. s *Service
  91235. project string
  91236. zone string
  91237. nodeGroup string
  91238. urlParams_ gensupport.URLParams
  91239. ctx_ context.Context
  91240. header_ http.Header
  91241. }
  91242. // ListNodes: Lists nodes in the node group.
  91243. func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall {
  91244. c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91245. c.project = project
  91246. c.zone = zone
  91247. c.nodeGroup = nodeGroup
  91248. return c
  91249. }
  91250. // Filter sets the optional parameter "filter": A filter expression that
  91251. // filters resources listed in the response. The expression must specify
  91252. // the field name, a comparison operator, and the value that you want to
  91253. // use for filtering. The value must be a string, a number, or a
  91254. // boolean. The comparison operator must be either =, !=, >, or <.
  91255. //
  91256. // For example, if you are filtering Compute Engine instances, you can
  91257. // exclude instances named example-instance by specifying name !=
  91258. // example-instance.
  91259. //
  91260. // You can also filter nested fields. For example, you could specify
  91261. // scheduling.automaticRestart = false to include instances only if they
  91262. // are not scheduled for automatic restarts. You can use filtering on
  91263. // nested fields to filter based on resource labels.
  91264. //
  91265. // To filter on multiple expressions, provide each separate expression
  91266. // within parentheses. For example, (scheduling.automaticRestart = true)
  91267. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  91268. // AND expression. However, you can include AND and OR expressions
  91269. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  91270. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  91271. // true).
  91272. func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall {
  91273. c.urlParams_.Set("filter", filter)
  91274. return c
  91275. }
  91276. // MaxResults sets the optional parameter "maxResults": The maximum
  91277. // number of results per page that should be returned. If the number of
  91278. // available results is larger than maxResults, Compute Engine returns a
  91279. // nextPageToken that can be used to get the next page of results in
  91280. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  91281. // (Default: 500)
  91282. func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall {
  91283. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  91284. return c
  91285. }
  91286. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91287. // a certain order. By default, results are returned in alphanumerical
  91288. // order based on the resource name.
  91289. //
  91290. // You can also sort results in descending order based on the creation
  91291. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91292. // based on the creationTimestamp field in reverse chronological order
  91293. // (newest result first). Use this to sort resources like operations so
  91294. // that the newest operation is returned first.
  91295. //
  91296. // Currently, only sorting by name or creationTimestamp desc is
  91297. // supported.
  91298. func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall {
  91299. c.urlParams_.Set("orderBy", orderBy)
  91300. return c
  91301. }
  91302. // PageToken sets the optional parameter "pageToken": Specifies a page
  91303. // token to use. Set pageToken to the nextPageToken returned by a
  91304. // previous list request to get the next page of results.
  91305. func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall {
  91306. c.urlParams_.Set("pageToken", pageToken)
  91307. return c
  91308. }
  91309. // Fields allows partial responses to be retrieved. See
  91310. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91311. // for more information.
  91312. func (c *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall {
  91313. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91314. return c
  91315. }
  91316. // Context sets the context to be used in this call's Do method. Any
  91317. // pending HTTP request will be aborted if the provided context is
  91318. // canceled.
  91319. func (c *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall {
  91320. c.ctx_ = ctx
  91321. return c
  91322. }
  91323. // Header returns an http.Header that can be modified by the caller to
  91324. // add HTTP headers to the request.
  91325. func (c *NodeGroupsListNodesCall) Header() http.Header {
  91326. if c.header_ == nil {
  91327. c.header_ = make(http.Header)
  91328. }
  91329. return c.header_
  91330. }
  91331. func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) {
  91332. reqHeaders := make(http.Header)
  91333. for k, v := range c.header_ {
  91334. reqHeaders[k] = v
  91335. }
  91336. reqHeaders.Set("User-Agent", c.s.userAgent())
  91337. var body io.Reader = nil
  91338. c.urlParams_.Set("alt", alt)
  91339. c.urlParams_.Set("prettyPrint", "false")
  91340. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes")
  91341. urls += "?" + c.urlParams_.Encode()
  91342. req, err := http.NewRequest("POST", urls, body)
  91343. if err != nil {
  91344. return nil, err
  91345. }
  91346. req.Header = reqHeaders
  91347. googleapi.Expand(req.URL, map[string]string{
  91348. "project": c.project,
  91349. "zone": c.zone,
  91350. "nodeGroup": c.nodeGroup,
  91351. })
  91352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91353. }
  91354. // Do executes the "compute.nodeGroups.listNodes" call.
  91355. // Exactly one of *NodeGroupsListNodes or error will be non-nil. Any
  91356. // non-2xx status code is an error. Response headers are in either
  91357. // *NodeGroupsListNodes.ServerResponse.Header or (if a response was
  91358. // returned at all) in error.(*googleapi.Error).Header. Use
  91359. // googleapi.IsNotModified to check whether the returned error was
  91360. // because http.StatusNotModified was returned.
  91361. func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, 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 := &NodeGroupsListNodes{
  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": "Lists nodes in the node group.",
  91393. // "httpMethod": "POST",
  91394. // "id": "compute.nodeGroups.listNodes",
  91395. // "parameterOrder": [
  91396. // "project",
  91397. // "zone",
  91398. // "nodeGroup"
  91399. // ],
  91400. // "parameters": {
  91401. // "filter": {
  91402. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  91403. // "location": "query",
  91404. // "type": "string"
  91405. // },
  91406. // "maxResults": {
  91407. // "default": "500",
  91408. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  91409. // "format": "uint32",
  91410. // "location": "query",
  91411. // "minimum": "0",
  91412. // "type": "integer"
  91413. // },
  91414. // "nodeGroup": {
  91415. // "description": "Name of the NodeGroup resource whose nodes you want to list.",
  91416. // "location": "path",
  91417. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91418. // "required": true,
  91419. // "type": "string"
  91420. // },
  91421. // "orderBy": {
  91422. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  91423. // "location": "query",
  91424. // "type": "string"
  91425. // },
  91426. // "pageToken": {
  91427. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  91428. // "location": "query",
  91429. // "type": "string"
  91430. // },
  91431. // "project": {
  91432. // "description": "Project ID for this request.",
  91433. // "location": "path",
  91434. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91435. // "required": true,
  91436. // "type": "string"
  91437. // },
  91438. // "zone": {
  91439. // "description": "The name of the zone for this request.",
  91440. // "location": "path",
  91441. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91442. // "required": true,
  91443. // "type": "string"
  91444. // }
  91445. // },
  91446. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes",
  91447. // "response": {
  91448. // "$ref": "NodeGroupsListNodes"
  91449. // },
  91450. // "scopes": [
  91451. // "https://www.googleapis.com/auth/cloud-platform",
  91452. // "https://www.googleapis.com/auth/compute",
  91453. // "https://www.googleapis.com/auth/compute.readonly"
  91454. // ]
  91455. // }
  91456. }
  91457. // Pages invokes f for each page of results.
  91458. // A non-nil error returned from f will halt the iteration.
  91459. // The provided context supersedes any context provided to the Context method.
  91460. func (c *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) error) error {
  91461. c.ctx_ = ctx
  91462. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91463. for {
  91464. x, err := c.Do()
  91465. if err != nil {
  91466. return err
  91467. }
  91468. if err := f(x); err != nil {
  91469. return err
  91470. }
  91471. if x.NextPageToken == "" {
  91472. return nil
  91473. }
  91474. c.PageToken(x.NextPageToken)
  91475. }
  91476. }
  91477. // method id "compute.nodeGroups.setAutoscalingPolicy":
  91478. type NodeGroupsSetAutoscalingPolicyCall struct {
  91479. s *Service
  91480. project string
  91481. zone string
  91482. nodeGroup string
  91483. nodegroupssetautoscalingpolicyrequest *NodeGroupsSetAutoscalingPolicyRequest
  91484. urlParams_ gensupport.URLParams
  91485. ctx_ context.Context
  91486. header_ http.Header
  91487. }
  91488. // SetAutoscalingPolicy: Sets the autoscaling policy of the node group.
  91489. func (r *NodeGroupsService) SetAutoscalingPolicy(project string, zone string, nodeGroup string, nodegroupssetautoscalingpolicyrequest *NodeGroupsSetAutoscalingPolicyRequest) *NodeGroupsSetAutoscalingPolicyCall {
  91490. c := &NodeGroupsSetAutoscalingPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91491. c.project = project
  91492. c.zone = zone
  91493. c.nodeGroup = nodeGroup
  91494. c.nodegroupssetautoscalingpolicyrequest = nodegroupssetautoscalingpolicyrequest
  91495. return c
  91496. }
  91497. // RequestId sets the optional parameter "requestId": An optional
  91498. // request ID to identify requests. Specify a unique request ID so that
  91499. // if you must retry your request, the server will know to ignore the
  91500. // request if it has already been completed.
  91501. //
  91502. // For example, consider a situation where you make an initial request
  91503. // and the request times out. If you make the request again with the
  91504. // same request ID, the server can check if original operation with the
  91505. // same request ID was received, and if so, will ignore the second
  91506. // request. This prevents clients from accidentally creating duplicate
  91507. // commitments.
  91508. //
  91509. // The request ID must be a valid UUID with the exception that zero UUID
  91510. // is not supported (00000000-0000-0000-0000-000000000000).
  91511. func (c *NodeGroupsSetAutoscalingPolicyCall) RequestId(requestId string) *NodeGroupsSetAutoscalingPolicyCall {
  91512. c.urlParams_.Set("requestId", requestId)
  91513. return c
  91514. }
  91515. // Fields allows partial responses to be retrieved. See
  91516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91517. // for more information.
  91518. func (c *NodeGroupsSetAutoscalingPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetAutoscalingPolicyCall {
  91519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91520. return c
  91521. }
  91522. // Context sets the context to be used in this call's Do method. Any
  91523. // pending HTTP request will be aborted if the provided context is
  91524. // canceled.
  91525. func (c *NodeGroupsSetAutoscalingPolicyCall) Context(ctx context.Context) *NodeGroupsSetAutoscalingPolicyCall {
  91526. c.ctx_ = ctx
  91527. return c
  91528. }
  91529. // Header returns an http.Header that can be modified by the caller to
  91530. // add HTTP headers to the request.
  91531. func (c *NodeGroupsSetAutoscalingPolicyCall) Header() http.Header {
  91532. if c.header_ == nil {
  91533. c.header_ = make(http.Header)
  91534. }
  91535. return c.header_
  91536. }
  91537. func (c *NodeGroupsSetAutoscalingPolicyCall) doRequest(alt string) (*http.Response, error) {
  91538. reqHeaders := make(http.Header)
  91539. for k, v := range c.header_ {
  91540. reqHeaders[k] = v
  91541. }
  91542. reqHeaders.Set("User-Agent", c.s.userAgent())
  91543. var body io.Reader = nil
  91544. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetautoscalingpolicyrequest)
  91545. if err != nil {
  91546. return nil, err
  91547. }
  91548. reqHeaders.Set("Content-Type", "application/json")
  91549. c.urlParams_.Set("alt", alt)
  91550. c.urlParams_.Set("prettyPrint", "false")
  91551. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setAutoscalingPolicy")
  91552. urls += "?" + c.urlParams_.Encode()
  91553. req, err := http.NewRequest("POST", urls, body)
  91554. if err != nil {
  91555. return nil, err
  91556. }
  91557. req.Header = reqHeaders
  91558. googleapi.Expand(req.URL, map[string]string{
  91559. "project": c.project,
  91560. "zone": c.zone,
  91561. "nodeGroup": c.nodeGroup,
  91562. })
  91563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91564. }
  91565. // Do executes the "compute.nodeGroups.setAutoscalingPolicy" call.
  91566. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91567. // status code is an error. Response headers are in either
  91568. // *Operation.ServerResponse.Header or (if a response was returned at
  91569. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91570. // to check whether the returned error was because
  91571. // http.StatusNotModified was returned.
  91572. func (c *NodeGroupsSetAutoscalingPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91573. gensupport.SetOptions(c.urlParams_, opts...)
  91574. res, err := c.doRequest("json")
  91575. if res != nil && res.StatusCode == http.StatusNotModified {
  91576. if res.Body != nil {
  91577. res.Body.Close()
  91578. }
  91579. return nil, &googleapi.Error{
  91580. Code: res.StatusCode,
  91581. Header: res.Header,
  91582. }
  91583. }
  91584. if err != nil {
  91585. return nil, err
  91586. }
  91587. defer googleapi.CloseBody(res)
  91588. if err := googleapi.CheckResponse(res); err != nil {
  91589. return nil, err
  91590. }
  91591. ret := &Operation{
  91592. ServerResponse: googleapi.ServerResponse{
  91593. Header: res.Header,
  91594. HTTPStatusCode: res.StatusCode,
  91595. },
  91596. }
  91597. target := &ret
  91598. if err := gensupport.DecodeResponse(target, res); err != nil {
  91599. return nil, err
  91600. }
  91601. return ret, nil
  91602. // {
  91603. // "description": "Sets the autoscaling policy of the node group.",
  91604. // "httpMethod": "POST",
  91605. // "id": "compute.nodeGroups.setAutoscalingPolicy",
  91606. // "parameterOrder": [
  91607. // "project",
  91608. // "zone",
  91609. // "nodeGroup"
  91610. // ],
  91611. // "parameters": {
  91612. // "nodeGroup": {
  91613. // "description": "Name of the NodeGroup resource to update.",
  91614. // "location": "path",
  91615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91616. // "required": true,
  91617. // "type": "string"
  91618. // },
  91619. // "project": {
  91620. // "description": "Project ID for this request.",
  91621. // "location": "path",
  91622. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91623. // "required": true,
  91624. // "type": "string"
  91625. // },
  91626. // "requestId": {
  91627. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91628. // "location": "query",
  91629. // "type": "string"
  91630. // },
  91631. // "zone": {
  91632. // "description": "The name of the zone for this request.",
  91633. // "location": "path",
  91634. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91635. // "required": true,
  91636. // "type": "string"
  91637. // }
  91638. // },
  91639. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setAutoscalingPolicy",
  91640. // "request": {
  91641. // "$ref": "NodeGroupsSetAutoscalingPolicyRequest"
  91642. // },
  91643. // "response": {
  91644. // "$ref": "Operation"
  91645. // },
  91646. // "scopes": [
  91647. // "https://www.googleapis.com/auth/cloud-platform",
  91648. // "https://www.googleapis.com/auth/compute"
  91649. // ]
  91650. // }
  91651. }
  91652. // method id "compute.nodeGroups.setIamPolicy":
  91653. type NodeGroupsSetIamPolicyCall struct {
  91654. s *Service
  91655. project string
  91656. zone string
  91657. resource string
  91658. zonesetpolicyrequest *ZoneSetPolicyRequest
  91659. urlParams_ gensupport.URLParams
  91660. ctx_ context.Context
  91661. header_ http.Header
  91662. }
  91663. // SetIamPolicy: Sets the access control policy on the specified
  91664. // resource. Replaces any existing policy.
  91665. func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
  91666. c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91667. c.project = project
  91668. c.zone = zone
  91669. c.resource = resource
  91670. c.zonesetpolicyrequest = zonesetpolicyrequest
  91671. return c
  91672. }
  91673. // Fields allows partial responses to be retrieved. See
  91674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91675. // for more information.
  91676. func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
  91677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91678. return c
  91679. }
  91680. // Context sets the context to be used in this call's Do method. Any
  91681. // pending HTTP request will be aborted if the provided context is
  91682. // canceled.
  91683. func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
  91684. c.ctx_ = ctx
  91685. return c
  91686. }
  91687. // Header returns an http.Header that can be modified by the caller to
  91688. // add HTTP headers to the request.
  91689. func (c *NodeGroupsSetIamPolicyCall) Header() http.Header {
  91690. if c.header_ == nil {
  91691. c.header_ = make(http.Header)
  91692. }
  91693. return c.header_
  91694. }
  91695. func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  91696. reqHeaders := make(http.Header)
  91697. for k, v := range c.header_ {
  91698. reqHeaders[k] = v
  91699. }
  91700. reqHeaders.Set("User-Agent", c.s.userAgent())
  91701. var body io.Reader = nil
  91702. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  91703. if err != nil {
  91704. return nil, err
  91705. }
  91706. reqHeaders.Set("Content-Type", "application/json")
  91707. c.urlParams_.Set("alt", alt)
  91708. c.urlParams_.Set("prettyPrint", "false")
  91709. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
  91710. urls += "?" + c.urlParams_.Encode()
  91711. req, err := http.NewRequest("POST", urls, body)
  91712. if err != nil {
  91713. return nil, err
  91714. }
  91715. req.Header = reqHeaders
  91716. googleapi.Expand(req.URL, map[string]string{
  91717. "project": c.project,
  91718. "zone": c.zone,
  91719. "resource": c.resource,
  91720. })
  91721. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91722. }
  91723. // Do executes the "compute.nodeGroups.setIamPolicy" call.
  91724. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  91725. // code is an error. Response headers are in either
  91726. // *Policy.ServerResponse.Header or (if a response was returned at all)
  91727. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  91728. // check whether the returned error was because http.StatusNotModified
  91729. // was returned.
  91730. func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  91731. gensupport.SetOptions(c.urlParams_, opts...)
  91732. res, err := c.doRequest("json")
  91733. if res != nil && res.StatusCode == http.StatusNotModified {
  91734. if res.Body != nil {
  91735. res.Body.Close()
  91736. }
  91737. return nil, &googleapi.Error{
  91738. Code: res.StatusCode,
  91739. Header: res.Header,
  91740. }
  91741. }
  91742. if err != nil {
  91743. return nil, err
  91744. }
  91745. defer googleapi.CloseBody(res)
  91746. if err := googleapi.CheckResponse(res); err != nil {
  91747. return nil, err
  91748. }
  91749. ret := &Policy{
  91750. ServerResponse: googleapi.ServerResponse{
  91751. Header: res.Header,
  91752. HTTPStatusCode: res.StatusCode,
  91753. },
  91754. }
  91755. target := &ret
  91756. if err := gensupport.DecodeResponse(target, res); err != nil {
  91757. return nil, err
  91758. }
  91759. return ret, nil
  91760. // {
  91761. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  91762. // "httpMethod": "POST",
  91763. // "id": "compute.nodeGroups.setIamPolicy",
  91764. // "parameterOrder": [
  91765. // "project",
  91766. // "zone",
  91767. // "resource"
  91768. // ],
  91769. // "parameters": {
  91770. // "project": {
  91771. // "description": "Project ID for this request.",
  91772. // "location": "path",
  91773. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91774. // "required": true,
  91775. // "type": "string"
  91776. // },
  91777. // "resource": {
  91778. // "description": "Name or id of the resource for this request.",
  91779. // "location": "path",
  91780. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91781. // "required": true,
  91782. // "type": "string"
  91783. // },
  91784. // "zone": {
  91785. // "description": "The name of the zone for this request.",
  91786. // "location": "path",
  91787. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91788. // "required": true,
  91789. // "type": "string"
  91790. // }
  91791. // },
  91792. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
  91793. // "request": {
  91794. // "$ref": "ZoneSetPolicyRequest"
  91795. // },
  91796. // "response": {
  91797. // "$ref": "Policy"
  91798. // },
  91799. // "scopes": [
  91800. // "https://www.googleapis.com/auth/cloud-platform",
  91801. // "https://www.googleapis.com/auth/compute"
  91802. // ]
  91803. // }
  91804. }
  91805. // method id "compute.nodeGroups.setNodeTemplate":
  91806. type NodeGroupsSetNodeTemplateCall struct {
  91807. s *Service
  91808. project string
  91809. zone string
  91810. nodeGroup string
  91811. nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
  91812. urlParams_ gensupport.URLParams
  91813. ctx_ context.Context
  91814. header_ http.Header
  91815. }
  91816. // SetNodeTemplate: Updates the node template of the node group.
  91817. func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
  91818. c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91819. c.project = project
  91820. c.zone = zone
  91821. c.nodeGroup = nodeGroup
  91822. c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
  91823. return c
  91824. }
  91825. // RequestId sets the optional parameter "requestId": An optional
  91826. // request ID to identify requests. Specify a unique request ID so that
  91827. // if you must retry your request, the server will know to ignore the
  91828. // request if it has already been completed.
  91829. //
  91830. // For example, consider a situation where you make an initial request
  91831. // and the request times out. If you make the request again with the
  91832. // same request ID, the server can check if original operation with the
  91833. // same request ID was received, and if so, will ignore the second
  91834. // request. This prevents clients from accidentally creating duplicate
  91835. // commitments.
  91836. //
  91837. // The request ID must be a valid UUID with the exception that zero UUID
  91838. // is not supported (00000000-0000-0000-0000-000000000000).
  91839. func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
  91840. c.urlParams_.Set("requestId", requestId)
  91841. return c
  91842. }
  91843. // Fields allows partial responses to be retrieved. See
  91844. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91845. // for more information.
  91846. func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
  91847. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91848. return c
  91849. }
  91850. // Context sets the context to be used in this call's Do method. Any
  91851. // pending HTTP request will be aborted if the provided context is
  91852. // canceled.
  91853. func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
  91854. c.ctx_ = ctx
  91855. return c
  91856. }
  91857. // Header returns an http.Header that can be modified by the caller to
  91858. // add HTTP headers to the request.
  91859. func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header {
  91860. if c.header_ == nil {
  91861. c.header_ = make(http.Header)
  91862. }
  91863. return c.header_
  91864. }
  91865. func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
  91866. reqHeaders := make(http.Header)
  91867. for k, v := range c.header_ {
  91868. reqHeaders[k] = v
  91869. }
  91870. reqHeaders.Set("User-Agent", c.s.userAgent())
  91871. var body io.Reader = nil
  91872. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
  91873. if err != nil {
  91874. return nil, err
  91875. }
  91876. reqHeaders.Set("Content-Type", "application/json")
  91877. c.urlParams_.Set("alt", alt)
  91878. c.urlParams_.Set("prettyPrint", "false")
  91879. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
  91880. urls += "?" + c.urlParams_.Encode()
  91881. req, err := http.NewRequest("POST", urls, body)
  91882. if err != nil {
  91883. return nil, err
  91884. }
  91885. req.Header = reqHeaders
  91886. googleapi.Expand(req.URL, map[string]string{
  91887. "project": c.project,
  91888. "zone": c.zone,
  91889. "nodeGroup": c.nodeGroup,
  91890. })
  91891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91892. }
  91893. // Do executes the "compute.nodeGroups.setNodeTemplate" call.
  91894. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91895. // status code is an error. Response headers are in either
  91896. // *Operation.ServerResponse.Header or (if a response was returned at
  91897. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91898. // to check whether the returned error was because
  91899. // http.StatusNotModified was returned.
  91900. func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91901. gensupport.SetOptions(c.urlParams_, opts...)
  91902. res, err := c.doRequest("json")
  91903. if res != nil && res.StatusCode == http.StatusNotModified {
  91904. if res.Body != nil {
  91905. res.Body.Close()
  91906. }
  91907. return nil, &googleapi.Error{
  91908. Code: res.StatusCode,
  91909. Header: res.Header,
  91910. }
  91911. }
  91912. if err != nil {
  91913. return nil, err
  91914. }
  91915. defer googleapi.CloseBody(res)
  91916. if err := googleapi.CheckResponse(res); err != nil {
  91917. return nil, err
  91918. }
  91919. ret := &Operation{
  91920. ServerResponse: googleapi.ServerResponse{
  91921. Header: res.Header,
  91922. HTTPStatusCode: res.StatusCode,
  91923. },
  91924. }
  91925. target := &ret
  91926. if err := gensupport.DecodeResponse(target, res); err != nil {
  91927. return nil, err
  91928. }
  91929. return ret, nil
  91930. // {
  91931. // "description": "Updates the node template of the node group.",
  91932. // "httpMethod": "POST",
  91933. // "id": "compute.nodeGroups.setNodeTemplate",
  91934. // "parameterOrder": [
  91935. // "project",
  91936. // "zone",
  91937. // "nodeGroup"
  91938. // ],
  91939. // "parameters": {
  91940. // "nodeGroup": {
  91941. // "description": "Name of the NodeGroup resource to update.",
  91942. // "location": "path",
  91943. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91944. // "required": true,
  91945. // "type": "string"
  91946. // },
  91947. // "project": {
  91948. // "description": "Project ID for this request.",
  91949. // "location": "path",
  91950. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91951. // "required": true,
  91952. // "type": "string"
  91953. // },
  91954. // "requestId": {
  91955. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91956. // "location": "query",
  91957. // "type": "string"
  91958. // },
  91959. // "zone": {
  91960. // "description": "The name of the zone for this request.",
  91961. // "location": "path",
  91962. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91963. // "required": true,
  91964. // "type": "string"
  91965. // }
  91966. // },
  91967. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
  91968. // "request": {
  91969. // "$ref": "NodeGroupsSetNodeTemplateRequest"
  91970. // },
  91971. // "response": {
  91972. // "$ref": "Operation"
  91973. // },
  91974. // "scopes": [
  91975. // "https://www.googleapis.com/auth/cloud-platform",
  91976. // "https://www.googleapis.com/auth/compute"
  91977. // ]
  91978. // }
  91979. }
  91980. // method id "compute.nodeGroups.testIamPermissions":
  91981. type NodeGroupsTestIamPermissionsCall struct {
  91982. s *Service
  91983. project string
  91984. zone string
  91985. resource string
  91986. testpermissionsrequest *TestPermissionsRequest
  91987. urlParams_ gensupport.URLParams
  91988. ctx_ context.Context
  91989. header_ http.Header
  91990. }
  91991. // TestIamPermissions: Returns permissions that a caller has on the
  91992. // specified resource.
  91993. func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
  91994. c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91995. c.project = project
  91996. c.zone = zone
  91997. c.resource = resource
  91998. c.testpermissionsrequest = testpermissionsrequest
  91999. return c
  92000. }
  92001. // Fields allows partial responses to be retrieved. See
  92002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92003. // for more information.
  92004. func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
  92005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92006. return c
  92007. }
  92008. // Context sets the context to be used in this call's Do method. Any
  92009. // pending HTTP request will be aborted if the provided context is
  92010. // canceled.
  92011. func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
  92012. c.ctx_ = ctx
  92013. return c
  92014. }
  92015. // Header returns an http.Header that can be modified by the caller to
  92016. // add HTTP headers to the request.
  92017. func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header {
  92018. if c.header_ == nil {
  92019. c.header_ = make(http.Header)
  92020. }
  92021. return c.header_
  92022. }
  92023. func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  92024. reqHeaders := make(http.Header)
  92025. for k, v := range c.header_ {
  92026. reqHeaders[k] = v
  92027. }
  92028. reqHeaders.Set("User-Agent", c.s.userAgent())
  92029. var body io.Reader = nil
  92030. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  92031. if err != nil {
  92032. return nil, err
  92033. }
  92034. reqHeaders.Set("Content-Type", "application/json")
  92035. c.urlParams_.Set("alt", alt)
  92036. c.urlParams_.Set("prettyPrint", "false")
  92037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
  92038. urls += "?" + c.urlParams_.Encode()
  92039. req, err := http.NewRequest("POST", urls, body)
  92040. if err != nil {
  92041. return nil, err
  92042. }
  92043. req.Header = reqHeaders
  92044. googleapi.Expand(req.URL, map[string]string{
  92045. "project": c.project,
  92046. "zone": c.zone,
  92047. "resource": c.resource,
  92048. })
  92049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92050. }
  92051. // Do executes the "compute.nodeGroups.testIamPermissions" call.
  92052. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  92053. // non-2xx status code is an error. Response headers are in either
  92054. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  92055. // returned at all) in error.(*googleapi.Error).Header. Use
  92056. // googleapi.IsNotModified to check whether the returned error was
  92057. // because http.StatusNotModified was returned.
  92058. func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  92059. gensupport.SetOptions(c.urlParams_, opts...)
  92060. res, err := c.doRequest("json")
  92061. if res != nil && res.StatusCode == http.StatusNotModified {
  92062. if res.Body != nil {
  92063. res.Body.Close()
  92064. }
  92065. return nil, &googleapi.Error{
  92066. Code: res.StatusCode,
  92067. Header: res.Header,
  92068. }
  92069. }
  92070. if err != nil {
  92071. return nil, err
  92072. }
  92073. defer googleapi.CloseBody(res)
  92074. if err := googleapi.CheckResponse(res); err != nil {
  92075. return nil, err
  92076. }
  92077. ret := &TestPermissionsResponse{
  92078. ServerResponse: googleapi.ServerResponse{
  92079. Header: res.Header,
  92080. HTTPStatusCode: res.StatusCode,
  92081. },
  92082. }
  92083. target := &ret
  92084. if err := gensupport.DecodeResponse(target, res); err != nil {
  92085. return nil, err
  92086. }
  92087. return ret, nil
  92088. // {
  92089. // "description": "Returns permissions that a caller has on the specified resource.",
  92090. // "httpMethod": "POST",
  92091. // "id": "compute.nodeGroups.testIamPermissions",
  92092. // "parameterOrder": [
  92093. // "project",
  92094. // "zone",
  92095. // "resource"
  92096. // ],
  92097. // "parameters": {
  92098. // "project": {
  92099. // "description": "Project ID for this request.",
  92100. // "location": "path",
  92101. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92102. // "required": true,
  92103. // "type": "string"
  92104. // },
  92105. // "resource": {
  92106. // "description": "Name or id of the resource for this request.",
  92107. // "location": "path",
  92108. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92109. // "required": true,
  92110. // "type": "string"
  92111. // },
  92112. // "zone": {
  92113. // "description": "The name of the zone for this request.",
  92114. // "location": "path",
  92115. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92116. // "required": true,
  92117. // "type": "string"
  92118. // }
  92119. // },
  92120. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
  92121. // "request": {
  92122. // "$ref": "TestPermissionsRequest"
  92123. // },
  92124. // "response": {
  92125. // "$ref": "TestPermissionsResponse"
  92126. // },
  92127. // "scopes": [
  92128. // "https://www.googleapis.com/auth/cloud-platform",
  92129. // "https://www.googleapis.com/auth/compute",
  92130. // "https://www.googleapis.com/auth/compute.readonly"
  92131. // ]
  92132. // }
  92133. }
  92134. // method id "compute.nodeTemplates.aggregatedList":
  92135. type NodeTemplatesAggregatedListCall struct {
  92136. s *Service
  92137. project string
  92138. urlParams_ gensupport.URLParams
  92139. ifNoneMatch_ string
  92140. ctx_ context.Context
  92141. header_ http.Header
  92142. }
  92143. // AggregatedList: Retrieves an aggregated list of node templates.
  92144. func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
  92145. c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92146. c.project = project
  92147. return c
  92148. }
  92149. // Filter sets the optional parameter "filter": A filter expression that
  92150. // filters resources listed in the response. The expression must specify
  92151. // the field name, a comparison operator, and the value that you want to
  92152. // use for filtering. The value must be a string, a number, or a
  92153. // boolean. The comparison operator must be either =, !=, >, or <.
  92154. //
  92155. // For example, if you are filtering Compute Engine instances, you can
  92156. // exclude instances named example-instance by specifying name !=
  92157. // example-instance.
  92158. //
  92159. // You can also filter nested fields. For example, you could specify
  92160. // scheduling.automaticRestart = false to include instances only if they
  92161. // are not scheduled for automatic restarts. You can use filtering on
  92162. // nested fields to filter based on resource labels.
  92163. //
  92164. // To filter on multiple expressions, provide each separate expression
  92165. // within parentheses. For example, (scheduling.automaticRestart = true)
  92166. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92167. // AND expression. However, you can include AND and OR expressions
  92168. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92169. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92170. // true).
  92171. func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
  92172. c.urlParams_.Set("filter", filter)
  92173. return c
  92174. }
  92175. // MaxResults sets the optional parameter "maxResults": The maximum
  92176. // number of results per page that should be returned. If the number of
  92177. // available results is larger than maxResults, Compute Engine returns a
  92178. // nextPageToken that can be used to get the next page of results in
  92179. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92180. // (Default: 500)
  92181. func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
  92182. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92183. return c
  92184. }
  92185. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92186. // a certain order. By default, results are returned in alphanumerical
  92187. // order based on the resource name.
  92188. //
  92189. // You can also sort results in descending order based on the creation
  92190. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92191. // based on the creationTimestamp field in reverse chronological order
  92192. // (newest result first). Use this to sort resources like operations so
  92193. // that the newest operation is returned first.
  92194. //
  92195. // Currently, only sorting by name or creationTimestamp desc is
  92196. // supported.
  92197. func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
  92198. c.urlParams_.Set("orderBy", orderBy)
  92199. return c
  92200. }
  92201. // PageToken sets the optional parameter "pageToken": Specifies a page
  92202. // token to use. Set pageToken to the nextPageToken returned by a
  92203. // previous list request to get the next page of results.
  92204. func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
  92205. c.urlParams_.Set("pageToken", pageToken)
  92206. return c
  92207. }
  92208. // Fields allows partial responses to be retrieved. See
  92209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92210. // for more information.
  92211. func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
  92212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92213. return c
  92214. }
  92215. // IfNoneMatch sets the optional parameter which makes the operation
  92216. // fail if the object's ETag matches the given value. This is useful for
  92217. // getting updates only after the object has changed since the last
  92218. // request. Use googleapi.IsNotModified to check whether the response
  92219. // error from Do is the result of In-None-Match.
  92220. func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
  92221. c.ifNoneMatch_ = entityTag
  92222. return c
  92223. }
  92224. // Context sets the context to be used in this call's Do method. Any
  92225. // pending HTTP request will be aborted if the provided context is
  92226. // canceled.
  92227. func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
  92228. c.ctx_ = ctx
  92229. return c
  92230. }
  92231. // Header returns an http.Header that can be modified by the caller to
  92232. // add HTTP headers to the request.
  92233. func (c *NodeTemplatesAggregatedListCall) Header() http.Header {
  92234. if c.header_ == nil {
  92235. c.header_ = make(http.Header)
  92236. }
  92237. return c.header_
  92238. }
  92239. func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  92240. reqHeaders := make(http.Header)
  92241. for k, v := range c.header_ {
  92242. reqHeaders[k] = v
  92243. }
  92244. reqHeaders.Set("User-Agent", c.s.userAgent())
  92245. if c.ifNoneMatch_ != "" {
  92246. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92247. }
  92248. var body io.Reader = nil
  92249. c.urlParams_.Set("alt", alt)
  92250. c.urlParams_.Set("prettyPrint", "false")
  92251. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTemplates")
  92252. urls += "?" + c.urlParams_.Encode()
  92253. req, err := http.NewRequest("GET", urls, body)
  92254. if err != nil {
  92255. return nil, err
  92256. }
  92257. req.Header = reqHeaders
  92258. googleapi.Expand(req.URL, map[string]string{
  92259. "project": c.project,
  92260. })
  92261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92262. }
  92263. // Do executes the "compute.nodeTemplates.aggregatedList" call.
  92264. // Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
  92265. // Any non-2xx status code is an error. Response headers are in either
  92266. // *NodeTemplateAggregatedList.ServerResponse.Header or (if a response
  92267. // was returned at all) in error.(*googleapi.Error).Header. Use
  92268. // googleapi.IsNotModified to check whether the returned error was
  92269. // because http.StatusNotModified was returned.
  92270. func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) {
  92271. gensupport.SetOptions(c.urlParams_, opts...)
  92272. res, err := c.doRequest("json")
  92273. if res != nil && res.StatusCode == http.StatusNotModified {
  92274. if res.Body != nil {
  92275. res.Body.Close()
  92276. }
  92277. return nil, &googleapi.Error{
  92278. Code: res.StatusCode,
  92279. Header: res.Header,
  92280. }
  92281. }
  92282. if err != nil {
  92283. return nil, err
  92284. }
  92285. defer googleapi.CloseBody(res)
  92286. if err := googleapi.CheckResponse(res); err != nil {
  92287. return nil, err
  92288. }
  92289. ret := &NodeTemplateAggregatedList{
  92290. ServerResponse: googleapi.ServerResponse{
  92291. Header: res.Header,
  92292. HTTPStatusCode: res.StatusCode,
  92293. },
  92294. }
  92295. target := &ret
  92296. if err := gensupport.DecodeResponse(target, res); err != nil {
  92297. return nil, err
  92298. }
  92299. return ret, nil
  92300. // {
  92301. // "description": "Retrieves an aggregated list of node templates.",
  92302. // "httpMethod": "GET",
  92303. // "id": "compute.nodeTemplates.aggregatedList",
  92304. // "parameterOrder": [
  92305. // "project"
  92306. // ],
  92307. // "parameters": {
  92308. // "filter": {
  92309. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  92310. // "location": "query",
  92311. // "type": "string"
  92312. // },
  92313. // "maxResults": {
  92314. // "default": "500",
  92315. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  92316. // "format": "uint32",
  92317. // "location": "query",
  92318. // "minimum": "0",
  92319. // "type": "integer"
  92320. // },
  92321. // "orderBy": {
  92322. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  92323. // "location": "query",
  92324. // "type": "string"
  92325. // },
  92326. // "pageToken": {
  92327. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  92328. // "location": "query",
  92329. // "type": "string"
  92330. // },
  92331. // "project": {
  92332. // "description": "Project ID for this request.",
  92333. // "location": "path",
  92334. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92335. // "required": true,
  92336. // "type": "string"
  92337. // }
  92338. // },
  92339. // "path": "{project}/aggregated/nodeTemplates",
  92340. // "response": {
  92341. // "$ref": "NodeTemplateAggregatedList"
  92342. // },
  92343. // "scopes": [
  92344. // "https://www.googleapis.com/auth/cloud-platform",
  92345. // "https://www.googleapis.com/auth/compute",
  92346. // "https://www.googleapis.com/auth/compute.readonly"
  92347. // ]
  92348. // }
  92349. }
  92350. // Pages invokes f for each page of results.
  92351. // A non-nil error returned from f will halt the iteration.
  92352. // The provided context supersedes any context provided to the Context method.
  92353. func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error {
  92354. c.ctx_ = ctx
  92355. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  92356. for {
  92357. x, err := c.Do()
  92358. if err != nil {
  92359. return err
  92360. }
  92361. if err := f(x); err != nil {
  92362. return err
  92363. }
  92364. if x.NextPageToken == "" {
  92365. return nil
  92366. }
  92367. c.PageToken(x.NextPageToken)
  92368. }
  92369. }
  92370. // method id "compute.nodeTemplates.delete":
  92371. type NodeTemplatesDeleteCall struct {
  92372. s *Service
  92373. project string
  92374. region string
  92375. nodeTemplate string
  92376. urlParams_ gensupport.URLParams
  92377. ctx_ context.Context
  92378. header_ http.Header
  92379. }
  92380. // Delete: Deletes the specified NodeTemplate resource.
  92381. func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
  92382. c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92383. c.project = project
  92384. c.region = region
  92385. c.nodeTemplate = nodeTemplate
  92386. return c
  92387. }
  92388. // RequestId sets the optional parameter "requestId": An optional
  92389. // request ID to identify requests. Specify a unique request ID so that
  92390. // if you must retry your request, the server will know to ignore the
  92391. // request if it has already been completed.
  92392. //
  92393. // For example, consider a situation where you make an initial request
  92394. // and the request times out. If you make the request again with the
  92395. // same request ID, the server can check if original operation with the
  92396. // same request ID was received, and if so, will ignore the second
  92397. // request. This prevents clients from accidentally creating duplicate
  92398. // commitments.
  92399. //
  92400. // The request ID must be a valid UUID with the exception that zero UUID
  92401. // is not supported (00000000-0000-0000-0000-000000000000).
  92402. func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
  92403. c.urlParams_.Set("requestId", requestId)
  92404. return c
  92405. }
  92406. // Fields allows partial responses to be retrieved. See
  92407. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92408. // for more information.
  92409. func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
  92410. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92411. return c
  92412. }
  92413. // Context sets the context to be used in this call's Do method. Any
  92414. // pending HTTP request will be aborted if the provided context is
  92415. // canceled.
  92416. func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
  92417. c.ctx_ = ctx
  92418. return c
  92419. }
  92420. // Header returns an http.Header that can be modified by the caller to
  92421. // add HTTP headers to the request.
  92422. func (c *NodeTemplatesDeleteCall) Header() http.Header {
  92423. if c.header_ == nil {
  92424. c.header_ = make(http.Header)
  92425. }
  92426. return c.header_
  92427. }
  92428. func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  92429. reqHeaders := make(http.Header)
  92430. for k, v := range c.header_ {
  92431. reqHeaders[k] = v
  92432. }
  92433. reqHeaders.Set("User-Agent", c.s.userAgent())
  92434. var body io.Reader = nil
  92435. c.urlParams_.Set("alt", alt)
  92436. c.urlParams_.Set("prettyPrint", "false")
  92437. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  92438. urls += "?" + c.urlParams_.Encode()
  92439. req, err := http.NewRequest("DELETE", urls, body)
  92440. if err != nil {
  92441. return nil, err
  92442. }
  92443. req.Header = reqHeaders
  92444. googleapi.Expand(req.URL, map[string]string{
  92445. "project": c.project,
  92446. "region": c.region,
  92447. "nodeTemplate": c.nodeTemplate,
  92448. })
  92449. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92450. }
  92451. // Do executes the "compute.nodeTemplates.delete" call.
  92452. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92453. // status code is an error. Response headers are in either
  92454. // *Operation.ServerResponse.Header or (if a response was returned at
  92455. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92456. // to check whether the returned error was because
  92457. // http.StatusNotModified was returned.
  92458. func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92459. gensupport.SetOptions(c.urlParams_, opts...)
  92460. res, err := c.doRequest("json")
  92461. if res != nil && res.StatusCode == http.StatusNotModified {
  92462. if res.Body != nil {
  92463. res.Body.Close()
  92464. }
  92465. return nil, &googleapi.Error{
  92466. Code: res.StatusCode,
  92467. Header: res.Header,
  92468. }
  92469. }
  92470. if err != nil {
  92471. return nil, err
  92472. }
  92473. defer googleapi.CloseBody(res)
  92474. if err := googleapi.CheckResponse(res); err != nil {
  92475. return nil, err
  92476. }
  92477. ret := &Operation{
  92478. ServerResponse: googleapi.ServerResponse{
  92479. Header: res.Header,
  92480. HTTPStatusCode: res.StatusCode,
  92481. },
  92482. }
  92483. target := &ret
  92484. if err := gensupport.DecodeResponse(target, res); err != nil {
  92485. return nil, err
  92486. }
  92487. return ret, nil
  92488. // {
  92489. // "description": "Deletes the specified NodeTemplate resource.",
  92490. // "httpMethod": "DELETE",
  92491. // "id": "compute.nodeTemplates.delete",
  92492. // "parameterOrder": [
  92493. // "project",
  92494. // "region",
  92495. // "nodeTemplate"
  92496. // ],
  92497. // "parameters": {
  92498. // "nodeTemplate": {
  92499. // "description": "Name of the NodeTemplate resource to delete.",
  92500. // "location": "path",
  92501. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92502. // "required": true,
  92503. // "type": "string"
  92504. // },
  92505. // "project": {
  92506. // "description": "Project ID for this request.",
  92507. // "location": "path",
  92508. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92509. // "required": true,
  92510. // "type": "string"
  92511. // },
  92512. // "region": {
  92513. // "description": "The name of the region for this request.",
  92514. // "location": "path",
  92515. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92516. // "required": true,
  92517. // "type": "string"
  92518. // },
  92519. // "requestId": {
  92520. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92521. // "location": "query",
  92522. // "type": "string"
  92523. // }
  92524. // },
  92525. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  92526. // "response": {
  92527. // "$ref": "Operation"
  92528. // },
  92529. // "scopes": [
  92530. // "https://www.googleapis.com/auth/cloud-platform",
  92531. // "https://www.googleapis.com/auth/compute"
  92532. // ]
  92533. // }
  92534. }
  92535. // method id "compute.nodeTemplates.get":
  92536. type NodeTemplatesGetCall struct {
  92537. s *Service
  92538. project string
  92539. region string
  92540. nodeTemplate string
  92541. urlParams_ gensupport.URLParams
  92542. ifNoneMatch_ string
  92543. ctx_ context.Context
  92544. header_ http.Header
  92545. }
  92546. // Get: Returns the specified node template. Gets a list of available
  92547. // node templates by making a list() request.
  92548. func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
  92549. c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92550. c.project = project
  92551. c.region = region
  92552. c.nodeTemplate = nodeTemplate
  92553. return c
  92554. }
  92555. // Fields allows partial responses to be retrieved. See
  92556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92557. // for more information.
  92558. func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
  92559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92560. return c
  92561. }
  92562. // IfNoneMatch sets the optional parameter which makes the operation
  92563. // fail if the object's ETag matches the given value. This is useful for
  92564. // getting updates only after the object has changed since the last
  92565. // request. Use googleapi.IsNotModified to check whether the response
  92566. // error from Do is the result of In-None-Match.
  92567. func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
  92568. c.ifNoneMatch_ = entityTag
  92569. return c
  92570. }
  92571. // Context sets the context to be used in this call's Do method. Any
  92572. // pending HTTP request will be aborted if the provided context is
  92573. // canceled.
  92574. func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
  92575. c.ctx_ = ctx
  92576. return c
  92577. }
  92578. // Header returns an http.Header that can be modified by the caller to
  92579. // add HTTP headers to the request.
  92580. func (c *NodeTemplatesGetCall) Header() http.Header {
  92581. if c.header_ == nil {
  92582. c.header_ = make(http.Header)
  92583. }
  92584. return c.header_
  92585. }
  92586. func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  92587. reqHeaders := make(http.Header)
  92588. for k, v := range c.header_ {
  92589. reqHeaders[k] = v
  92590. }
  92591. reqHeaders.Set("User-Agent", c.s.userAgent())
  92592. if c.ifNoneMatch_ != "" {
  92593. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92594. }
  92595. var body io.Reader = nil
  92596. c.urlParams_.Set("alt", alt)
  92597. c.urlParams_.Set("prettyPrint", "false")
  92598. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  92599. urls += "?" + c.urlParams_.Encode()
  92600. req, err := http.NewRequest("GET", urls, body)
  92601. if err != nil {
  92602. return nil, err
  92603. }
  92604. req.Header = reqHeaders
  92605. googleapi.Expand(req.URL, map[string]string{
  92606. "project": c.project,
  92607. "region": c.region,
  92608. "nodeTemplate": c.nodeTemplate,
  92609. })
  92610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92611. }
  92612. // Do executes the "compute.nodeTemplates.get" call.
  92613. // Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
  92614. // status code is an error. Response headers are in either
  92615. // *NodeTemplate.ServerResponse.Header or (if a response was returned at
  92616. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92617. // to check whether the returned error was because
  92618. // http.StatusNotModified was returned.
  92619. func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) {
  92620. gensupport.SetOptions(c.urlParams_, opts...)
  92621. res, err := c.doRequest("json")
  92622. if res != nil && res.StatusCode == http.StatusNotModified {
  92623. if res.Body != nil {
  92624. res.Body.Close()
  92625. }
  92626. return nil, &googleapi.Error{
  92627. Code: res.StatusCode,
  92628. Header: res.Header,
  92629. }
  92630. }
  92631. if err != nil {
  92632. return nil, err
  92633. }
  92634. defer googleapi.CloseBody(res)
  92635. if err := googleapi.CheckResponse(res); err != nil {
  92636. return nil, err
  92637. }
  92638. ret := &NodeTemplate{
  92639. ServerResponse: googleapi.ServerResponse{
  92640. Header: res.Header,
  92641. HTTPStatusCode: res.StatusCode,
  92642. },
  92643. }
  92644. target := &ret
  92645. if err := gensupport.DecodeResponse(target, res); err != nil {
  92646. return nil, err
  92647. }
  92648. return ret, nil
  92649. // {
  92650. // "description": "Returns the specified node template. Gets a list of available node templates by making a list() request.",
  92651. // "httpMethod": "GET",
  92652. // "id": "compute.nodeTemplates.get",
  92653. // "parameterOrder": [
  92654. // "project",
  92655. // "region",
  92656. // "nodeTemplate"
  92657. // ],
  92658. // "parameters": {
  92659. // "nodeTemplate": {
  92660. // "description": "Name of the node template to return.",
  92661. // "location": "path",
  92662. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92663. // "required": true,
  92664. // "type": "string"
  92665. // },
  92666. // "project": {
  92667. // "description": "Project ID for this request.",
  92668. // "location": "path",
  92669. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92670. // "required": true,
  92671. // "type": "string"
  92672. // },
  92673. // "region": {
  92674. // "description": "The name of the region for this request.",
  92675. // "location": "path",
  92676. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92677. // "required": true,
  92678. // "type": "string"
  92679. // }
  92680. // },
  92681. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  92682. // "response": {
  92683. // "$ref": "NodeTemplate"
  92684. // },
  92685. // "scopes": [
  92686. // "https://www.googleapis.com/auth/cloud-platform",
  92687. // "https://www.googleapis.com/auth/compute",
  92688. // "https://www.googleapis.com/auth/compute.readonly"
  92689. // ]
  92690. // }
  92691. }
  92692. // method id "compute.nodeTemplates.getIamPolicy":
  92693. type NodeTemplatesGetIamPolicyCall struct {
  92694. s *Service
  92695. project string
  92696. region string
  92697. resource string
  92698. urlParams_ gensupport.URLParams
  92699. ifNoneMatch_ string
  92700. ctx_ context.Context
  92701. header_ http.Header
  92702. }
  92703. // GetIamPolicy: Gets the access control policy for a resource. May be
  92704. // empty if no such policy or resource exists.
  92705. func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
  92706. c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92707. c.project = project
  92708. c.region = region
  92709. c.resource = resource
  92710. return c
  92711. }
  92712. // Fields allows partial responses to be retrieved. See
  92713. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92714. // for more information.
  92715. func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
  92716. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92717. return c
  92718. }
  92719. // IfNoneMatch sets the optional parameter which makes the operation
  92720. // fail if the object's ETag matches the given value. This is useful for
  92721. // getting updates only after the object has changed since the last
  92722. // request. Use googleapi.IsNotModified to check whether the response
  92723. // error from Do is the result of In-None-Match.
  92724. func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
  92725. c.ifNoneMatch_ = entityTag
  92726. return c
  92727. }
  92728. // Context sets the context to be used in this call's Do method. Any
  92729. // pending HTTP request will be aborted if the provided context is
  92730. // canceled.
  92731. func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
  92732. c.ctx_ = ctx
  92733. return c
  92734. }
  92735. // Header returns an http.Header that can be modified by the caller to
  92736. // add HTTP headers to the request.
  92737. func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header {
  92738. if c.header_ == nil {
  92739. c.header_ = make(http.Header)
  92740. }
  92741. return c.header_
  92742. }
  92743. func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  92744. reqHeaders := make(http.Header)
  92745. for k, v := range c.header_ {
  92746. reqHeaders[k] = v
  92747. }
  92748. reqHeaders.Set("User-Agent", c.s.userAgent())
  92749. if c.ifNoneMatch_ != "" {
  92750. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92751. }
  92752. var body io.Reader = nil
  92753. c.urlParams_.Set("alt", alt)
  92754. c.urlParams_.Set("prettyPrint", "false")
  92755. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
  92756. urls += "?" + c.urlParams_.Encode()
  92757. req, err := http.NewRequest("GET", urls, body)
  92758. if err != nil {
  92759. return nil, err
  92760. }
  92761. req.Header = reqHeaders
  92762. googleapi.Expand(req.URL, map[string]string{
  92763. "project": c.project,
  92764. "region": c.region,
  92765. "resource": c.resource,
  92766. })
  92767. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92768. }
  92769. // Do executes the "compute.nodeTemplates.getIamPolicy" call.
  92770. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  92771. // code is an error. Response headers are in either
  92772. // *Policy.ServerResponse.Header or (if a response was returned at all)
  92773. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  92774. // check whether the returned error was because http.StatusNotModified
  92775. // was returned.
  92776. func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  92777. gensupport.SetOptions(c.urlParams_, opts...)
  92778. res, err := c.doRequest("json")
  92779. if res != nil && res.StatusCode == http.StatusNotModified {
  92780. if res.Body != nil {
  92781. res.Body.Close()
  92782. }
  92783. return nil, &googleapi.Error{
  92784. Code: res.StatusCode,
  92785. Header: res.Header,
  92786. }
  92787. }
  92788. if err != nil {
  92789. return nil, err
  92790. }
  92791. defer googleapi.CloseBody(res)
  92792. if err := googleapi.CheckResponse(res); err != nil {
  92793. return nil, err
  92794. }
  92795. ret := &Policy{
  92796. ServerResponse: googleapi.ServerResponse{
  92797. Header: res.Header,
  92798. HTTPStatusCode: res.StatusCode,
  92799. },
  92800. }
  92801. target := &ret
  92802. if err := gensupport.DecodeResponse(target, res); err != nil {
  92803. return nil, err
  92804. }
  92805. return ret, nil
  92806. // {
  92807. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  92808. // "httpMethod": "GET",
  92809. // "id": "compute.nodeTemplates.getIamPolicy",
  92810. // "parameterOrder": [
  92811. // "project",
  92812. // "region",
  92813. // "resource"
  92814. // ],
  92815. // "parameters": {
  92816. // "project": {
  92817. // "description": "Project ID for this request.",
  92818. // "location": "path",
  92819. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92820. // "required": true,
  92821. // "type": "string"
  92822. // },
  92823. // "region": {
  92824. // "description": "The name of the region for this request.",
  92825. // "location": "path",
  92826. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92827. // "required": true,
  92828. // "type": "string"
  92829. // },
  92830. // "resource": {
  92831. // "description": "Name or id of the resource for this request.",
  92832. // "location": "path",
  92833. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92834. // "required": true,
  92835. // "type": "string"
  92836. // }
  92837. // },
  92838. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
  92839. // "response": {
  92840. // "$ref": "Policy"
  92841. // },
  92842. // "scopes": [
  92843. // "https://www.googleapis.com/auth/cloud-platform",
  92844. // "https://www.googleapis.com/auth/compute",
  92845. // "https://www.googleapis.com/auth/compute.readonly"
  92846. // ]
  92847. // }
  92848. }
  92849. // method id "compute.nodeTemplates.insert":
  92850. type NodeTemplatesInsertCall struct {
  92851. s *Service
  92852. project string
  92853. region string
  92854. nodetemplate *NodeTemplate
  92855. urlParams_ gensupport.URLParams
  92856. ctx_ context.Context
  92857. header_ http.Header
  92858. }
  92859. // Insert: Creates a NodeTemplate resource in the specified project
  92860. // using the data included in the request.
  92861. func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
  92862. c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92863. c.project = project
  92864. c.region = region
  92865. c.nodetemplate = nodetemplate
  92866. return c
  92867. }
  92868. // RequestId sets the optional parameter "requestId": An optional
  92869. // request ID to identify requests. Specify a unique request ID so that
  92870. // if you must retry your request, the server will know to ignore the
  92871. // request if it has already been completed.
  92872. //
  92873. // For example, consider a situation where you make an initial request
  92874. // and the request times out. If you make the request again with the
  92875. // same request ID, the server can check if original operation with the
  92876. // same request ID was received, and if so, will ignore the second
  92877. // request. This prevents clients from accidentally creating duplicate
  92878. // commitments.
  92879. //
  92880. // The request ID must be a valid UUID with the exception that zero UUID
  92881. // is not supported (00000000-0000-0000-0000-000000000000).
  92882. func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
  92883. c.urlParams_.Set("requestId", requestId)
  92884. return c
  92885. }
  92886. // Fields allows partial responses to be retrieved. See
  92887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92888. // for more information.
  92889. func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
  92890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92891. return c
  92892. }
  92893. // Context sets the context to be used in this call's Do method. Any
  92894. // pending HTTP request will be aborted if the provided context is
  92895. // canceled.
  92896. func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
  92897. c.ctx_ = ctx
  92898. return c
  92899. }
  92900. // Header returns an http.Header that can be modified by the caller to
  92901. // add HTTP headers to the request.
  92902. func (c *NodeTemplatesInsertCall) Header() http.Header {
  92903. if c.header_ == nil {
  92904. c.header_ = make(http.Header)
  92905. }
  92906. return c.header_
  92907. }
  92908. func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  92909. reqHeaders := make(http.Header)
  92910. for k, v := range c.header_ {
  92911. reqHeaders[k] = v
  92912. }
  92913. reqHeaders.Set("User-Agent", c.s.userAgent())
  92914. var body io.Reader = nil
  92915. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
  92916. if err != nil {
  92917. return nil, err
  92918. }
  92919. reqHeaders.Set("Content-Type", "application/json")
  92920. c.urlParams_.Set("alt", alt)
  92921. c.urlParams_.Set("prettyPrint", "false")
  92922. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  92923. urls += "?" + c.urlParams_.Encode()
  92924. req, err := http.NewRequest("POST", urls, body)
  92925. if err != nil {
  92926. return nil, err
  92927. }
  92928. req.Header = reqHeaders
  92929. googleapi.Expand(req.URL, map[string]string{
  92930. "project": c.project,
  92931. "region": c.region,
  92932. })
  92933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92934. }
  92935. // Do executes the "compute.nodeTemplates.insert" call.
  92936. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92937. // status code is an error. Response headers are in either
  92938. // *Operation.ServerResponse.Header or (if a response was returned at
  92939. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92940. // to check whether the returned error was because
  92941. // http.StatusNotModified was returned.
  92942. func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92943. gensupport.SetOptions(c.urlParams_, opts...)
  92944. res, err := c.doRequest("json")
  92945. if res != nil && res.StatusCode == http.StatusNotModified {
  92946. if res.Body != nil {
  92947. res.Body.Close()
  92948. }
  92949. return nil, &googleapi.Error{
  92950. Code: res.StatusCode,
  92951. Header: res.Header,
  92952. }
  92953. }
  92954. if err != nil {
  92955. return nil, err
  92956. }
  92957. defer googleapi.CloseBody(res)
  92958. if err := googleapi.CheckResponse(res); err != nil {
  92959. return nil, err
  92960. }
  92961. ret := &Operation{
  92962. ServerResponse: googleapi.ServerResponse{
  92963. Header: res.Header,
  92964. HTTPStatusCode: res.StatusCode,
  92965. },
  92966. }
  92967. target := &ret
  92968. if err := gensupport.DecodeResponse(target, res); err != nil {
  92969. return nil, err
  92970. }
  92971. return ret, nil
  92972. // {
  92973. // "description": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
  92974. // "httpMethod": "POST",
  92975. // "id": "compute.nodeTemplates.insert",
  92976. // "parameterOrder": [
  92977. // "project",
  92978. // "region"
  92979. // ],
  92980. // "parameters": {
  92981. // "project": {
  92982. // "description": "Project ID for this request.",
  92983. // "location": "path",
  92984. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92985. // "required": true,
  92986. // "type": "string"
  92987. // },
  92988. // "region": {
  92989. // "description": "The name of the region for this request.",
  92990. // "location": "path",
  92991. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92992. // "required": true,
  92993. // "type": "string"
  92994. // },
  92995. // "requestId": {
  92996. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92997. // "location": "query",
  92998. // "type": "string"
  92999. // }
  93000. // },
  93001. // "path": "{project}/regions/{region}/nodeTemplates",
  93002. // "request": {
  93003. // "$ref": "NodeTemplate"
  93004. // },
  93005. // "response": {
  93006. // "$ref": "Operation"
  93007. // },
  93008. // "scopes": [
  93009. // "https://www.googleapis.com/auth/cloud-platform",
  93010. // "https://www.googleapis.com/auth/compute"
  93011. // ]
  93012. // }
  93013. }
  93014. // method id "compute.nodeTemplates.list":
  93015. type NodeTemplatesListCall struct {
  93016. s *Service
  93017. project string
  93018. region string
  93019. urlParams_ gensupport.URLParams
  93020. ifNoneMatch_ string
  93021. ctx_ context.Context
  93022. header_ http.Header
  93023. }
  93024. // List: Retrieves a list of node templates available to the specified
  93025. // project.
  93026. func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
  93027. c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93028. c.project = project
  93029. c.region = region
  93030. return c
  93031. }
  93032. // Filter sets the optional parameter "filter": A filter expression that
  93033. // filters resources listed in the response. The expression must specify
  93034. // the field name, a comparison operator, and the value that you want to
  93035. // use for filtering. The value must be a string, a number, or a
  93036. // boolean. The comparison operator must be either =, !=, >, or <.
  93037. //
  93038. // For example, if you are filtering Compute Engine instances, you can
  93039. // exclude instances named example-instance by specifying name !=
  93040. // example-instance.
  93041. //
  93042. // You can also filter nested fields. For example, you could specify
  93043. // scheduling.automaticRestart = false to include instances only if they
  93044. // are not scheduled for automatic restarts. You can use filtering on
  93045. // nested fields to filter based on resource labels.
  93046. //
  93047. // To filter on multiple expressions, provide each separate expression
  93048. // within parentheses. For example, (scheduling.automaticRestart = true)
  93049. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93050. // AND expression. However, you can include AND and OR expressions
  93051. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93052. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93053. // true).
  93054. func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
  93055. c.urlParams_.Set("filter", filter)
  93056. return c
  93057. }
  93058. // MaxResults sets the optional parameter "maxResults": The maximum
  93059. // number of results per page that should be returned. If the number of
  93060. // available results is larger than maxResults, Compute Engine returns a
  93061. // nextPageToken that can be used to get the next page of results in
  93062. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93063. // (Default: 500)
  93064. func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
  93065. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93066. return c
  93067. }
  93068. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93069. // a certain order. By default, results are returned in alphanumerical
  93070. // order based on the resource name.
  93071. //
  93072. // You can also sort results in descending order based on the creation
  93073. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93074. // based on the creationTimestamp field in reverse chronological order
  93075. // (newest result first). Use this to sort resources like operations so
  93076. // that the newest operation is returned first.
  93077. //
  93078. // Currently, only sorting by name or creationTimestamp desc is
  93079. // supported.
  93080. func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
  93081. c.urlParams_.Set("orderBy", orderBy)
  93082. return c
  93083. }
  93084. // PageToken sets the optional parameter "pageToken": Specifies a page
  93085. // token to use. Set pageToken to the nextPageToken returned by a
  93086. // previous list request to get the next page of results.
  93087. func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
  93088. c.urlParams_.Set("pageToken", pageToken)
  93089. return c
  93090. }
  93091. // Fields allows partial responses to be retrieved. See
  93092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93093. // for more information.
  93094. func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
  93095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93096. return c
  93097. }
  93098. // IfNoneMatch sets the optional parameter which makes the operation
  93099. // fail if the object's ETag matches the given value. This is useful for
  93100. // getting updates only after the object has changed since the last
  93101. // request. Use googleapi.IsNotModified to check whether the response
  93102. // error from Do is the result of In-None-Match.
  93103. func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
  93104. c.ifNoneMatch_ = entityTag
  93105. return c
  93106. }
  93107. // Context sets the context to be used in this call's Do method. Any
  93108. // pending HTTP request will be aborted if the provided context is
  93109. // canceled.
  93110. func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
  93111. c.ctx_ = ctx
  93112. return c
  93113. }
  93114. // Header returns an http.Header that can be modified by the caller to
  93115. // add HTTP headers to the request.
  93116. func (c *NodeTemplatesListCall) Header() http.Header {
  93117. if c.header_ == nil {
  93118. c.header_ = make(http.Header)
  93119. }
  93120. return c.header_
  93121. }
  93122. func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  93123. reqHeaders := make(http.Header)
  93124. for k, v := range c.header_ {
  93125. reqHeaders[k] = v
  93126. }
  93127. reqHeaders.Set("User-Agent", c.s.userAgent())
  93128. if c.ifNoneMatch_ != "" {
  93129. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93130. }
  93131. var body io.Reader = nil
  93132. c.urlParams_.Set("alt", alt)
  93133. c.urlParams_.Set("prettyPrint", "false")
  93134. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  93135. urls += "?" + c.urlParams_.Encode()
  93136. req, err := http.NewRequest("GET", urls, body)
  93137. if err != nil {
  93138. return nil, err
  93139. }
  93140. req.Header = reqHeaders
  93141. googleapi.Expand(req.URL, map[string]string{
  93142. "project": c.project,
  93143. "region": c.region,
  93144. })
  93145. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93146. }
  93147. // Do executes the "compute.nodeTemplates.list" call.
  93148. // Exactly one of *NodeTemplateList or error will be non-nil. Any
  93149. // non-2xx status code is an error. Response headers are in either
  93150. // *NodeTemplateList.ServerResponse.Header or (if a response was
  93151. // returned at all) in error.(*googleapi.Error).Header. Use
  93152. // googleapi.IsNotModified to check whether the returned error was
  93153. // because http.StatusNotModified was returned.
  93154. func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) {
  93155. gensupport.SetOptions(c.urlParams_, opts...)
  93156. res, err := c.doRequest("json")
  93157. if res != nil && res.StatusCode == http.StatusNotModified {
  93158. if res.Body != nil {
  93159. res.Body.Close()
  93160. }
  93161. return nil, &googleapi.Error{
  93162. Code: res.StatusCode,
  93163. Header: res.Header,
  93164. }
  93165. }
  93166. if err != nil {
  93167. return nil, err
  93168. }
  93169. defer googleapi.CloseBody(res)
  93170. if err := googleapi.CheckResponse(res); err != nil {
  93171. return nil, err
  93172. }
  93173. ret := &NodeTemplateList{
  93174. ServerResponse: googleapi.ServerResponse{
  93175. Header: res.Header,
  93176. HTTPStatusCode: res.StatusCode,
  93177. },
  93178. }
  93179. target := &ret
  93180. if err := gensupport.DecodeResponse(target, res); err != nil {
  93181. return nil, err
  93182. }
  93183. return ret, nil
  93184. // {
  93185. // "description": "Retrieves a list of node templates available to the specified project.",
  93186. // "httpMethod": "GET",
  93187. // "id": "compute.nodeTemplates.list",
  93188. // "parameterOrder": [
  93189. // "project",
  93190. // "region"
  93191. // ],
  93192. // "parameters": {
  93193. // "filter": {
  93194. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  93195. // "location": "query",
  93196. // "type": "string"
  93197. // },
  93198. // "maxResults": {
  93199. // "default": "500",
  93200. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  93201. // "format": "uint32",
  93202. // "location": "query",
  93203. // "minimum": "0",
  93204. // "type": "integer"
  93205. // },
  93206. // "orderBy": {
  93207. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  93208. // "location": "query",
  93209. // "type": "string"
  93210. // },
  93211. // "pageToken": {
  93212. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  93213. // "location": "query",
  93214. // "type": "string"
  93215. // },
  93216. // "project": {
  93217. // "description": "Project ID for this request.",
  93218. // "location": "path",
  93219. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93220. // "required": true,
  93221. // "type": "string"
  93222. // },
  93223. // "region": {
  93224. // "description": "The name of the region for this request.",
  93225. // "location": "path",
  93226. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93227. // "required": true,
  93228. // "type": "string"
  93229. // }
  93230. // },
  93231. // "path": "{project}/regions/{region}/nodeTemplates",
  93232. // "response": {
  93233. // "$ref": "NodeTemplateList"
  93234. // },
  93235. // "scopes": [
  93236. // "https://www.googleapis.com/auth/cloud-platform",
  93237. // "https://www.googleapis.com/auth/compute",
  93238. // "https://www.googleapis.com/auth/compute.readonly"
  93239. // ]
  93240. // }
  93241. }
  93242. // Pages invokes f for each page of results.
  93243. // A non-nil error returned from f will halt the iteration.
  93244. // The provided context supersedes any context provided to the Context method.
  93245. func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error {
  93246. c.ctx_ = ctx
  93247. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93248. for {
  93249. x, err := c.Do()
  93250. if err != nil {
  93251. return err
  93252. }
  93253. if err := f(x); err != nil {
  93254. return err
  93255. }
  93256. if x.NextPageToken == "" {
  93257. return nil
  93258. }
  93259. c.PageToken(x.NextPageToken)
  93260. }
  93261. }
  93262. // method id "compute.nodeTemplates.setIamPolicy":
  93263. type NodeTemplatesSetIamPolicyCall struct {
  93264. s *Service
  93265. project string
  93266. region string
  93267. resource string
  93268. regionsetpolicyrequest *RegionSetPolicyRequest
  93269. urlParams_ gensupport.URLParams
  93270. ctx_ context.Context
  93271. header_ http.Header
  93272. }
  93273. // SetIamPolicy: Sets the access control policy on the specified
  93274. // resource. Replaces any existing policy.
  93275. func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
  93276. c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93277. c.project = project
  93278. c.region = region
  93279. c.resource = resource
  93280. c.regionsetpolicyrequest = regionsetpolicyrequest
  93281. return c
  93282. }
  93283. // Fields allows partial responses to be retrieved. See
  93284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93285. // for more information.
  93286. func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
  93287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93288. return c
  93289. }
  93290. // Context sets the context to be used in this call's Do method. Any
  93291. // pending HTTP request will be aborted if the provided context is
  93292. // canceled.
  93293. func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
  93294. c.ctx_ = ctx
  93295. return c
  93296. }
  93297. // Header returns an http.Header that can be modified by the caller to
  93298. // add HTTP headers to the request.
  93299. func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header {
  93300. if c.header_ == nil {
  93301. c.header_ = make(http.Header)
  93302. }
  93303. return c.header_
  93304. }
  93305. func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  93306. reqHeaders := make(http.Header)
  93307. for k, v := range c.header_ {
  93308. reqHeaders[k] = v
  93309. }
  93310. reqHeaders.Set("User-Agent", c.s.userAgent())
  93311. var body io.Reader = nil
  93312. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  93313. if err != nil {
  93314. return nil, err
  93315. }
  93316. reqHeaders.Set("Content-Type", "application/json")
  93317. c.urlParams_.Set("alt", alt)
  93318. c.urlParams_.Set("prettyPrint", "false")
  93319. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
  93320. urls += "?" + c.urlParams_.Encode()
  93321. req, err := http.NewRequest("POST", urls, body)
  93322. if err != nil {
  93323. return nil, err
  93324. }
  93325. req.Header = reqHeaders
  93326. googleapi.Expand(req.URL, map[string]string{
  93327. "project": c.project,
  93328. "region": c.region,
  93329. "resource": c.resource,
  93330. })
  93331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93332. }
  93333. // Do executes the "compute.nodeTemplates.setIamPolicy" call.
  93334. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  93335. // code is an error. Response headers are in either
  93336. // *Policy.ServerResponse.Header or (if a response was returned at all)
  93337. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  93338. // check whether the returned error was because http.StatusNotModified
  93339. // was returned.
  93340. func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  93341. gensupport.SetOptions(c.urlParams_, opts...)
  93342. res, err := c.doRequest("json")
  93343. if res != nil && res.StatusCode == http.StatusNotModified {
  93344. if res.Body != nil {
  93345. res.Body.Close()
  93346. }
  93347. return nil, &googleapi.Error{
  93348. Code: res.StatusCode,
  93349. Header: res.Header,
  93350. }
  93351. }
  93352. if err != nil {
  93353. return nil, err
  93354. }
  93355. defer googleapi.CloseBody(res)
  93356. if err := googleapi.CheckResponse(res); err != nil {
  93357. return nil, err
  93358. }
  93359. ret := &Policy{
  93360. ServerResponse: googleapi.ServerResponse{
  93361. Header: res.Header,
  93362. HTTPStatusCode: res.StatusCode,
  93363. },
  93364. }
  93365. target := &ret
  93366. if err := gensupport.DecodeResponse(target, res); err != nil {
  93367. return nil, err
  93368. }
  93369. return ret, nil
  93370. // {
  93371. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  93372. // "httpMethod": "POST",
  93373. // "id": "compute.nodeTemplates.setIamPolicy",
  93374. // "parameterOrder": [
  93375. // "project",
  93376. // "region",
  93377. // "resource"
  93378. // ],
  93379. // "parameters": {
  93380. // "project": {
  93381. // "description": "Project ID for this request.",
  93382. // "location": "path",
  93383. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93384. // "required": true,
  93385. // "type": "string"
  93386. // },
  93387. // "region": {
  93388. // "description": "The name of the region for this request.",
  93389. // "location": "path",
  93390. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93391. // "required": true,
  93392. // "type": "string"
  93393. // },
  93394. // "resource": {
  93395. // "description": "Name or id of the resource for this request.",
  93396. // "location": "path",
  93397. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93398. // "required": true,
  93399. // "type": "string"
  93400. // }
  93401. // },
  93402. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
  93403. // "request": {
  93404. // "$ref": "RegionSetPolicyRequest"
  93405. // },
  93406. // "response": {
  93407. // "$ref": "Policy"
  93408. // },
  93409. // "scopes": [
  93410. // "https://www.googleapis.com/auth/cloud-platform",
  93411. // "https://www.googleapis.com/auth/compute"
  93412. // ]
  93413. // }
  93414. }
  93415. // method id "compute.nodeTemplates.testIamPermissions":
  93416. type NodeTemplatesTestIamPermissionsCall struct {
  93417. s *Service
  93418. project string
  93419. region string
  93420. resource string
  93421. testpermissionsrequest *TestPermissionsRequest
  93422. urlParams_ gensupport.URLParams
  93423. ctx_ context.Context
  93424. header_ http.Header
  93425. }
  93426. // TestIamPermissions: Returns permissions that a caller has on the
  93427. // specified resource.
  93428. func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
  93429. c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93430. c.project = project
  93431. c.region = region
  93432. c.resource = resource
  93433. c.testpermissionsrequest = testpermissionsrequest
  93434. return c
  93435. }
  93436. // Fields allows partial responses to be retrieved. See
  93437. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93438. // for more information.
  93439. func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
  93440. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93441. return c
  93442. }
  93443. // Context sets the context to be used in this call's Do method. Any
  93444. // pending HTTP request will be aborted if the provided context is
  93445. // canceled.
  93446. func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
  93447. c.ctx_ = ctx
  93448. return c
  93449. }
  93450. // Header returns an http.Header that can be modified by the caller to
  93451. // add HTTP headers to the request.
  93452. func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
  93453. if c.header_ == nil {
  93454. c.header_ = make(http.Header)
  93455. }
  93456. return c.header_
  93457. }
  93458. func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  93459. reqHeaders := make(http.Header)
  93460. for k, v := range c.header_ {
  93461. reqHeaders[k] = v
  93462. }
  93463. reqHeaders.Set("User-Agent", c.s.userAgent())
  93464. var body io.Reader = nil
  93465. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  93466. if err != nil {
  93467. return nil, err
  93468. }
  93469. reqHeaders.Set("Content-Type", "application/json")
  93470. c.urlParams_.Set("alt", alt)
  93471. c.urlParams_.Set("prettyPrint", "false")
  93472. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
  93473. urls += "?" + c.urlParams_.Encode()
  93474. req, err := http.NewRequest("POST", urls, body)
  93475. if err != nil {
  93476. return nil, err
  93477. }
  93478. req.Header = reqHeaders
  93479. googleapi.Expand(req.URL, map[string]string{
  93480. "project": c.project,
  93481. "region": c.region,
  93482. "resource": c.resource,
  93483. })
  93484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93485. }
  93486. // Do executes the "compute.nodeTemplates.testIamPermissions" call.
  93487. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  93488. // non-2xx status code is an error. Response headers are in either
  93489. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  93490. // returned at all) in error.(*googleapi.Error).Header. Use
  93491. // googleapi.IsNotModified to check whether the returned error was
  93492. // because http.StatusNotModified was returned.
  93493. func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  93494. gensupport.SetOptions(c.urlParams_, opts...)
  93495. res, err := c.doRequest("json")
  93496. if res != nil && res.StatusCode == http.StatusNotModified {
  93497. if res.Body != nil {
  93498. res.Body.Close()
  93499. }
  93500. return nil, &googleapi.Error{
  93501. Code: res.StatusCode,
  93502. Header: res.Header,
  93503. }
  93504. }
  93505. if err != nil {
  93506. return nil, err
  93507. }
  93508. defer googleapi.CloseBody(res)
  93509. if err := googleapi.CheckResponse(res); err != nil {
  93510. return nil, err
  93511. }
  93512. ret := &TestPermissionsResponse{
  93513. ServerResponse: googleapi.ServerResponse{
  93514. Header: res.Header,
  93515. HTTPStatusCode: res.StatusCode,
  93516. },
  93517. }
  93518. target := &ret
  93519. if err := gensupport.DecodeResponse(target, res); err != nil {
  93520. return nil, err
  93521. }
  93522. return ret, nil
  93523. // {
  93524. // "description": "Returns permissions that a caller has on the specified resource.",
  93525. // "httpMethod": "POST",
  93526. // "id": "compute.nodeTemplates.testIamPermissions",
  93527. // "parameterOrder": [
  93528. // "project",
  93529. // "region",
  93530. // "resource"
  93531. // ],
  93532. // "parameters": {
  93533. // "project": {
  93534. // "description": "Project ID for this request.",
  93535. // "location": "path",
  93536. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93537. // "required": true,
  93538. // "type": "string"
  93539. // },
  93540. // "region": {
  93541. // "description": "The name of the region for this request.",
  93542. // "location": "path",
  93543. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93544. // "required": true,
  93545. // "type": "string"
  93546. // },
  93547. // "resource": {
  93548. // "description": "Name or id of the resource for this request.",
  93549. // "location": "path",
  93550. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93551. // "required": true,
  93552. // "type": "string"
  93553. // }
  93554. // },
  93555. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
  93556. // "request": {
  93557. // "$ref": "TestPermissionsRequest"
  93558. // },
  93559. // "response": {
  93560. // "$ref": "TestPermissionsResponse"
  93561. // },
  93562. // "scopes": [
  93563. // "https://www.googleapis.com/auth/cloud-platform",
  93564. // "https://www.googleapis.com/auth/compute",
  93565. // "https://www.googleapis.com/auth/compute.readonly"
  93566. // ]
  93567. // }
  93568. }
  93569. // method id "compute.nodeTypes.aggregatedList":
  93570. type NodeTypesAggregatedListCall struct {
  93571. s *Service
  93572. project string
  93573. urlParams_ gensupport.URLParams
  93574. ifNoneMatch_ string
  93575. ctx_ context.Context
  93576. header_ http.Header
  93577. }
  93578. // AggregatedList: Retrieves an aggregated list of node types.
  93579. func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
  93580. c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93581. c.project = project
  93582. return c
  93583. }
  93584. // Filter sets the optional parameter "filter": A filter expression that
  93585. // filters resources listed in the response. The expression must specify
  93586. // the field name, a comparison operator, and the value that you want to
  93587. // use for filtering. The value must be a string, a number, or a
  93588. // boolean. The comparison operator must be either =, !=, >, or <.
  93589. //
  93590. // For example, if you are filtering Compute Engine instances, you can
  93591. // exclude instances named example-instance by specifying name !=
  93592. // example-instance.
  93593. //
  93594. // You can also filter nested fields. For example, you could specify
  93595. // scheduling.automaticRestart = false to include instances only if they
  93596. // are not scheduled for automatic restarts. You can use filtering on
  93597. // nested fields to filter based on resource labels.
  93598. //
  93599. // To filter on multiple expressions, provide each separate expression
  93600. // within parentheses. For example, (scheduling.automaticRestart = true)
  93601. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93602. // AND expression. However, you can include AND and OR expressions
  93603. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93604. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93605. // true).
  93606. func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
  93607. c.urlParams_.Set("filter", filter)
  93608. return c
  93609. }
  93610. // MaxResults sets the optional parameter "maxResults": The maximum
  93611. // number of results per page that should be returned. If the number of
  93612. // available results is larger than maxResults, Compute Engine returns a
  93613. // nextPageToken that can be used to get the next page of results in
  93614. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93615. // (Default: 500)
  93616. func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
  93617. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93618. return c
  93619. }
  93620. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93621. // a certain order. By default, results are returned in alphanumerical
  93622. // order based on the resource name.
  93623. //
  93624. // You can also sort results in descending order based on the creation
  93625. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93626. // based on the creationTimestamp field in reverse chronological order
  93627. // (newest result first). Use this to sort resources like operations so
  93628. // that the newest operation is returned first.
  93629. //
  93630. // Currently, only sorting by name or creationTimestamp desc is
  93631. // supported.
  93632. func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
  93633. c.urlParams_.Set("orderBy", orderBy)
  93634. return c
  93635. }
  93636. // PageToken sets the optional parameter "pageToken": Specifies a page
  93637. // token to use. Set pageToken to the nextPageToken returned by a
  93638. // previous list request to get the next page of results.
  93639. func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
  93640. c.urlParams_.Set("pageToken", pageToken)
  93641. return c
  93642. }
  93643. // Fields allows partial responses to be retrieved. See
  93644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93645. // for more information.
  93646. func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
  93647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93648. return c
  93649. }
  93650. // IfNoneMatch sets the optional parameter which makes the operation
  93651. // fail if the object's ETag matches the given value. This is useful for
  93652. // getting updates only after the object has changed since the last
  93653. // request. Use googleapi.IsNotModified to check whether the response
  93654. // error from Do is the result of In-None-Match.
  93655. func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
  93656. c.ifNoneMatch_ = entityTag
  93657. return c
  93658. }
  93659. // Context sets the context to be used in this call's Do method. Any
  93660. // pending HTTP request will be aborted if the provided context is
  93661. // canceled.
  93662. func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
  93663. c.ctx_ = ctx
  93664. return c
  93665. }
  93666. // Header returns an http.Header that can be modified by the caller to
  93667. // add HTTP headers to the request.
  93668. func (c *NodeTypesAggregatedListCall) Header() http.Header {
  93669. if c.header_ == nil {
  93670. c.header_ = make(http.Header)
  93671. }
  93672. return c.header_
  93673. }
  93674. func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  93675. reqHeaders := make(http.Header)
  93676. for k, v := range c.header_ {
  93677. reqHeaders[k] = v
  93678. }
  93679. reqHeaders.Set("User-Agent", c.s.userAgent())
  93680. if c.ifNoneMatch_ != "" {
  93681. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93682. }
  93683. var body io.Reader = nil
  93684. c.urlParams_.Set("alt", alt)
  93685. c.urlParams_.Set("prettyPrint", "false")
  93686. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTypes")
  93687. urls += "?" + c.urlParams_.Encode()
  93688. req, err := http.NewRequest("GET", urls, body)
  93689. if err != nil {
  93690. return nil, err
  93691. }
  93692. req.Header = reqHeaders
  93693. googleapi.Expand(req.URL, map[string]string{
  93694. "project": c.project,
  93695. })
  93696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93697. }
  93698. // Do executes the "compute.nodeTypes.aggregatedList" call.
  93699. // Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
  93700. // non-2xx status code is an error. Response headers are in either
  93701. // *NodeTypeAggregatedList.ServerResponse.Header or (if a response was
  93702. // returned at all) in error.(*googleapi.Error).Header. Use
  93703. // googleapi.IsNotModified to check whether the returned error was
  93704. // because http.StatusNotModified was returned.
  93705. func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) {
  93706. gensupport.SetOptions(c.urlParams_, opts...)
  93707. res, err := c.doRequest("json")
  93708. if res != nil && res.StatusCode == http.StatusNotModified {
  93709. if res.Body != nil {
  93710. res.Body.Close()
  93711. }
  93712. return nil, &googleapi.Error{
  93713. Code: res.StatusCode,
  93714. Header: res.Header,
  93715. }
  93716. }
  93717. if err != nil {
  93718. return nil, err
  93719. }
  93720. defer googleapi.CloseBody(res)
  93721. if err := googleapi.CheckResponse(res); err != nil {
  93722. return nil, err
  93723. }
  93724. ret := &NodeTypeAggregatedList{
  93725. ServerResponse: googleapi.ServerResponse{
  93726. Header: res.Header,
  93727. HTTPStatusCode: res.StatusCode,
  93728. },
  93729. }
  93730. target := &ret
  93731. if err := gensupport.DecodeResponse(target, res); err != nil {
  93732. return nil, err
  93733. }
  93734. return ret, nil
  93735. // {
  93736. // "description": "Retrieves an aggregated list of node types.",
  93737. // "httpMethod": "GET",
  93738. // "id": "compute.nodeTypes.aggregatedList",
  93739. // "parameterOrder": [
  93740. // "project"
  93741. // ],
  93742. // "parameters": {
  93743. // "filter": {
  93744. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  93745. // "location": "query",
  93746. // "type": "string"
  93747. // },
  93748. // "maxResults": {
  93749. // "default": "500",
  93750. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  93751. // "format": "uint32",
  93752. // "location": "query",
  93753. // "minimum": "0",
  93754. // "type": "integer"
  93755. // },
  93756. // "orderBy": {
  93757. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  93758. // "location": "query",
  93759. // "type": "string"
  93760. // },
  93761. // "pageToken": {
  93762. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  93763. // "location": "query",
  93764. // "type": "string"
  93765. // },
  93766. // "project": {
  93767. // "description": "Project ID for this request.",
  93768. // "location": "path",
  93769. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93770. // "required": true,
  93771. // "type": "string"
  93772. // }
  93773. // },
  93774. // "path": "{project}/aggregated/nodeTypes",
  93775. // "response": {
  93776. // "$ref": "NodeTypeAggregatedList"
  93777. // },
  93778. // "scopes": [
  93779. // "https://www.googleapis.com/auth/cloud-platform",
  93780. // "https://www.googleapis.com/auth/compute",
  93781. // "https://www.googleapis.com/auth/compute.readonly"
  93782. // ]
  93783. // }
  93784. }
  93785. // Pages invokes f for each page of results.
  93786. // A non-nil error returned from f will halt the iteration.
  93787. // The provided context supersedes any context provided to the Context method.
  93788. func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error {
  93789. c.ctx_ = ctx
  93790. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93791. for {
  93792. x, err := c.Do()
  93793. if err != nil {
  93794. return err
  93795. }
  93796. if err := f(x); err != nil {
  93797. return err
  93798. }
  93799. if x.NextPageToken == "" {
  93800. return nil
  93801. }
  93802. c.PageToken(x.NextPageToken)
  93803. }
  93804. }
  93805. // method id "compute.nodeTypes.get":
  93806. type NodeTypesGetCall struct {
  93807. s *Service
  93808. project string
  93809. zone string
  93810. nodeType string
  93811. urlParams_ gensupport.URLParams
  93812. ifNoneMatch_ string
  93813. ctx_ context.Context
  93814. header_ http.Header
  93815. }
  93816. // Get: Returns the specified node type. Gets a list of available node
  93817. // types by making a list() request.
  93818. func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
  93819. c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93820. c.project = project
  93821. c.zone = zone
  93822. c.nodeType = nodeType
  93823. return c
  93824. }
  93825. // Fields allows partial responses to be retrieved. See
  93826. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93827. // for more information.
  93828. func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
  93829. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93830. return c
  93831. }
  93832. // IfNoneMatch sets the optional parameter which makes the operation
  93833. // fail if the object's ETag matches the given value. This is useful for
  93834. // getting updates only after the object has changed since the last
  93835. // request. Use googleapi.IsNotModified to check whether the response
  93836. // error from Do is the result of In-None-Match.
  93837. func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
  93838. c.ifNoneMatch_ = entityTag
  93839. return c
  93840. }
  93841. // Context sets the context to be used in this call's Do method. Any
  93842. // pending HTTP request will be aborted if the provided context is
  93843. // canceled.
  93844. func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
  93845. c.ctx_ = ctx
  93846. return c
  93847. }
  93848. // Header returns an http.Header that can be modified by the caller to
  93849. // add HTTP headers to the request.
  93850. func (c *NodeTypesGetCall) Header() http.Header {
  93851. if c.header_ == nil {
  93852. c.header_ = make(http.Header)
  93853. }
  93854. return c.header_
  93855. }
  93856. func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  93857. reqHeaders := make(http.Header)
  93858. for k, v := range c.header_ {
  93859. reqHeaders[k] = v
  93860. }
  93861. reqHeaders.Set("User-Agent", c.s.userAgent())
  93862. if c.ifNoneMatch_ != "" {
  93863. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93864. }
  93865. var body io.Reader = nil
  93866. c.urlParams_.Set("alt", alt)
  93867. c.urlParams_.Set("prettyPrint", "false")
  93868. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes/{nodeType}")
  93869. urls += "?" + c.urlParams_.Encode()
  93870. req, err := http.NewRequest("GET", urls, body)
  93871. if err != nil {
  93872. return nil, err
  93873. }
  93874. req.Header = reqHeaders
  93875. googleapi.Expand(req.URL, map[string]string{
  93876. "project": c.project,
  93877. "zone": c.zone,
  93878. "nodeType": c.nodeType,
  93879. })
  93880. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93881. }
  93882. // Do executes the "compute.nodeTypes.get" call.
  93883. // Exactly one of *NodeType or error will be non-nil. Any non-2xx status
  93884. // code is an error. Response headers are in either
  93885. // *NodeType.ServerResponse.Header or (if a response was returned at
  93886. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93887. // to check whether the returned error was because
  93888. // http.StatusNotModified was returned.
  93889. func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) {
  93890. gensupport.SetOptions(c.urlParams_, opts...)
  93891. res, err := c.doRequest("json")
  93892. if res != nil && res.StatusCode == http.StatusNotModified {
  93893. if res.Body != nil {
  93894. res.Body.Close()
  93895. }
  93896. return nil, &googleapi.Error{
  93897. Code: res.StatusCode,
  93898. Header: res.Header,
  93899. }
  93900. }
  93901. if err != nil {
  93902. return nil, err
  93903. }
  93904. defer googleapi.CloseBody(res)
  93905. if err := googleapi.CheckResponse(res); err != nil {
  93906. return nil, err
  93907. }
  93908. ret := &NodeType{
  93909. ServerResponse: googleapi.ServerResponse{
  93910. Header: res.Header,
  93911. HTTPStatusCode: res.StatusCode,
  93912. },
  93913. }
  93914. target := &ret
  93915. if err := gensupport.DecodeResponse(target, res); err != nil {
  93916. return nil, err
  93917. }
  93918. return ret, nil
  93919. // {
  93920. // "description": "Returns the specified node type. Gets a list of available node types by making a list() request.",
  93921. // "httpMethod": "GET",
  93922. // "id": "compute.nodeTypes.get",
  93923. // "parameterOrder": [
  93924. // "project",
  93925. // "zone",
  93926. // "nodeType"
  93927. // ],
  93928. // "parameters": {
  93929. // "nodeType": {
  93930. // "description": "Name of the node type to return.",
  93931. // "location": "path",
  93932. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93933. // "required": true,
  93934. // "type": "string"
  93935. // },
  93936. // "project": {
  93937. // "description": "Project ID for this request.",
  93938. // "location": "path",
  93939. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93940. // "required": true,
  93941. // "type": "string"
  93942. // },
  93943. // "zone": {
  93944. // "description": "The name of the zone for this request.",
  93945. // "location": "path",
  93946. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93947. // "required": true,
  93948. // "type": "string"
  93949. // }
  93950. // },
  93951. // "path": "{project}/zones/{zone}/nodeTypes/{nodeType}",
  93952. // "response": {
  93953. // "$ref": "NodeType"
  93954. // },
  93955. // "scopes": [
  93956. // "https://www.googleapis.com/auth/cloud-platform",
  93957. // "https://www.googleapis.com/auth/compute",
  93958. // "https://www.googleapis.com/auth/compute.readonly"
  93959. // ]
  93960. // }
  93961. }
  93962. // method id "compute.nodeTypes.list":
  93963. type NodeTypesListCall struct {
  93964. s *Service
  93965. project string
  93966. zone string
  93967. urlParams_ gensupport.URLParams
  93968. ifNoneMatch_ string
  93969. ctx_ context.Context
  93970. header_ http.Header
  93971. }
  93972. // List: Retrieves a list of node types available to the specified
  93973. // project.
  93974. func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
  93975. c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93976. c.project = project
  93977. c.zone = zone
  93978. return c
  93979. }
  93980. // Filter sets the optional parameter "filter": A filter expression that
  93981. // filters resources listed in the response. The expression must specify
  93982. // the field name, a comparison operator, and the value that you want to
  93983. // use for filtering. The value must be a string, a number, or a
  93984. // boolean. The comparison operator must be either =, !=, >, or <.
  93985. //
  93986. // For example, if you are filtering Compute Engine instances, you can
  93987. // exclude instances named example-instance by specifying name !=
  93988. // example-instance.
  93989. //
  93990. // You can also filter nested fields. For example, you could specify
  93991. // scheduling.automaticRestart = false to include instances only if they
  93992. // are not scheduled for automatic restarts. You can use filtering on
  93993. // nested fields to filter based on resource labels.
  93994. //
  93995. // To filter on multiple expressions, provide each separate expression
  93996. // within parentheses. For example, (scheduling.automaticRestart = true)
  93997. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93998. // AND expression. However, you can include AND and OR expressions
  93999. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94000. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94001. // true).
  94002. func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
  94003. c.urlParams_.Set("filter", filter)
  94004. return c
  94005. }
  94006. // MaxResults sets the optional parameter "maxResults": The maximum
  94007. // number of results per page that should be returned. If the number of
  94008. // available results is larger than maxResults, Compute Engine returns a
  94009. // nextPageToken that can be used to get the next page of results in
  94010. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94011. // (Default: 500)
  94012. func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
  94013. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94014. return c
  94015. }
  94016. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94017. // a certain order. By default, results are returned in alphanumerical
  94018. // order based on the resource name.
  94019. //
  94020. // You can also sort results in descending order based on the creation
  94021. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94022. // based on the creationTimestamp field in reverse chronological order
  94023. // (newest result first). Use this to sort resources like operations so
  94024. // that the newest operation is returned first.
  94025. //
  94026. // Currently, only sorting by name or creationTimestamp desc is
  94027. // supported.
  94028. func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
  94029. c.urlParams_.Set("orderBy", orderBy)
  94030. return c
  94031. }
  94032. // PageToken sets the optional parameter "pageToken": Specifies a page
  94033. // token to use. Set pageToken to the nextPageToken returned by a
  94034. // previous list request to get the next page of results.
  94035. func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
  94036. c.urlParams_.Set("pageToken", pageToken)
  94037. return c
  94038. }
  94039. // Fields allows partial responses to be retrieved. See
  94040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94041. // for more information.
  94042. func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
  94043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94044. return c
  94045. }
  94046. // IfNoneMatch sets the optional parameter which makes the operation
  94047. // fail if the object's ETag matches the given value. This is useful for
  94048. // getting updates only after the object has changed since the last
  94049. // request. Use googleapi.IsNotModified to check whether the response
  94050. // error from Do is the result of In-None-Match.
  94051. func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
  94052. c.ifNoneMatch_ = entityTag
  94053. return c
  94054. }
  94055. // Context sets the context to be used in this call's Do method. Any
  94056. // pending HTTP request will be aborted if the provided context is
  94057. // canceled.
  94058. func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
  94059. c.ctx_ = ctx
  94060. return c
  94061. }
  94062. // Header returns an http.Header that can be modified by the caller to
  94063. // add HTTP headers to the request.
  94064. func (c *NodeTypesListCall) Header() http.Header {
  94065. if c.header_ == nil {
  94066. c.header_ = make(http.Header)
  94067. }
  94068. return c.header_
  94069. }
  94070. func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
  94071. reqHeaders := make(http.Header)
  94072. for k, v := range c.header_ {
  94073. reqHeaders[k] = v
  94074. }
  94075. reqHeaders.Set("User-Agent", c.s.userAgent())
  94076. if c.ifNoneMatch_ != "" {
  94077. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94078. }
  94079. var body io.Reader = nil
  94080. c.urlParams_.Set("alt", alt)
  94081. c.urlParams_.Set("prettyPrint", "false")
  94082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes")
  94083. urls += "?" + c.urlParams_.Encode()
  94084. req, err := http.NewRequest("GET", urls, body)
  94085. if err != nil {
  94086. return nil, err
  94087. }
  94088. req.Header = reqHeaders
  94089. googleapi.Expand(req.URL, map[string]string{
  94090. "project": c.project,
  94091. "zone": c.zone,
  94092. })
  94093. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94094. }
  94095. // Do executes the "compute.nodeTypes.list" call.
  94096. // Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
  94097. // status code is an error. Response headers are in either
  94098. // *NodeTypeList.ServerResponse.Header or (if a response was returned at
  94099. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94100. // to check whether the returned error was because
  94101. // http.StatusNotModified was returned.
  94102. func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) {
  94103. gensupport.SetOptions(c.urlParams_, opts...)
  94104. res, err := c.doRequest("json")
  94105. if res != nil && res.StatusCode == http.StatusNotModified {
  94106. if res.Body != nil {
  94107. res.Body.Close()
  94108. }
  94109. return nil, &googleapi.Error{
  94110. Code: res.StatusCode,
  94111. Header: res.Header,
  94112. }
  94113. }
  94114. if err != nil {
  94115. return nil, err
  94116. }
  94117. defer googleapi.CloseBody(res)
  94118. if err := googleapi.CheckResponse(res); err != nil {
  94119. return nil, err
  94120. }
  94121. ret := &NodeTypeList{
  94122. ServerResponse: googleapi.ServerResponse{
  94123. Header: res.Header,
  94124. HTTPStatusCode: res.StatusCode,
  94125. },
  94126. }
  94127. target := &ret
  94128. if err := gensupport.DecodeResponse(target, res); err != nil {
  94129. return nil, err
  94130. }
  94131. return ret, nil
  94132. // {
  94133. // "description": "Retrieves a list of node types available to the specified project.",
  94134. // "httpMethod": "GET",
  94135. // "id": "compute.nodeTypes.list",
  94136. // "parameterOrder": [
  94137. // "project",
  94138. // "zone"
  94139. // ],
  94140. // "parameters": {
  94141. // "filter": {
  94142. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  94143. // "location": "query",
  94144. // "type": "string"
  94145. // },
  94146. // "maxResults": {
  94147. // "default": "500",
  94148. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  94149. // "format": "uint32",
  94150. // "location": "query",
  94151. // "minimum": "0",
  94152. // "type": "integer"
  94153. // },
  94154. // "orderBy": {
  94155. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  94156. // "location": "query",
  94157. // "type": "string"
  94158. // },
  94159. // "pageToken": {
  94160. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  94161. // "location": "query",
  94162. // "type": "string"
  94163. // },
  94164. // "project": {
  94165. // "description": "Project ID for this request.",
  94166. // "location": "path",
  94167. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94168. // "required": true,
  94169. // "type": "string"
  94170. // },
  94171. // "zone": {
  94172. // "description": "The name of the zone for this request.",
  94173. // "location": "path",
  94174. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94175. // "required": true,
  94176. // "type": "string"
  94177. // }
  94178. // },
  94179. // "path": "{project}/zones/{zone}/nodeTypes",
  94180. // "response": {
  94181. // "$ref": "NodeTypeList"
  94182. // },
  94183. // "scopes": [
  94184. // "https://www.googleapis.com/auth/cloud-platform",
  94185. // "https://www.googleapis.com/auth/compute",
  94186. // "https://www.googleapis.com/auth/compute.readonly"
  94187. // ]
  94188. // }
  94189. }
  94190. // Pages invokes f for each page of results.
  94191. // A non-nil error returned from f will halt the iteration.
  94192. // The provided context supersedes any context provided to the Context method.
  94193. func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error {
  94194. c.ctx_ = ctx
  94195. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94196. for {
  94197. x, err := c.Do()
  94198. if err != nil {
  94199. return err
  94200. }
  94201. if err := f(x); err != nil {
  94202. return err
  94203. }
  94204. if x.NextPageToken == "" {
  94205. return nil
  94206. }
  94207. c.PageToken(x.NextPageToken)
  94208. }
  94209. }
  94210. // method id "compute.organizationSecurityPolicies.addAssociation":
  94211. type OrganizationSecurityPoliciesAddAssociationCall struct {
  94212. s *Service
  94213. securityPolicy string
  94214. securitypolicyassociation *SecurityPolicyAssociation
  94215. urlParams_ gensupport.URLParams
  94216. ctx_ context.Context
  94217. header_ http.Header
  94218. }
  94219. // AddAssociation: Inserts an association for the specified security
  94220. // policy.
  94221. func (r *OrganizationSecurityPoliciesService) AddAssociation(securityPolicy string, securitypolicyassociation *SecurityPolicyAssociation) *OrganizationSecurityPoliciesAddAssociationCall {
  94222. c := &OrganizationSecurityPoliciesAddAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94223. c.securityPolicy = securityPolicy
  94224. c.securitypolicyassociation = securitypolicyassociation
  94225. return c
  94226. }
  94227. // ReplaceExistingAssociation sets the optional parameter
  94228. // "replaceExistingAssociation": Indicates whether or not to replace it
  94229. // if an association of the attachment already exists. This is false by
  94230. // default, in which case an error will be returned if an assocation
  94231. // already exists.
  94232. func (c *OrganizationSecurityPoliciesAddAssociationCall) ReplaceExistingAssociation(replaceExistingAssociation bool) *OrganizationSecurityPoliciesAddAssociationCall {
  94233. c.urlParams_.Set("replaceExistingAssociation", fmt.Sprint(replaceExistingAssociation))
  94234. return c
  94235. }
  94236. // RequestId sets the optional parameter "requestId": An optional
  94237. // request ID to identify requests. Specify a unique request ID so that
  94238. // if you must retry your request, the server will know to ignore the
  94239. // request if it has already been completed.
  94240. //
  94241. // For example, consider a situation where you make an initial request
  94242. // and the request times out. If you make the request again with the
  94243. // same request ID, the server can check if original operation with the
  94244. // same request ID was received, and if so, will ignore the second
  94245. // request. This prevents clients from accidentally creating duplicate
  94246. // commitments.
  94247. //
  94248. // The request ID must be a valid UUID with the exception that zero UUID
  94249. // is not supported (00000000-0000-0000-0000-000000000000).
  94250. func (c *OrganizationSecurityPoliciesAddAssociationCall) RequestId(requestId string) *OrganizationSecurityPoliciesAddAssociationCall {
  94251. c.urlParams_.Set("requestId", requestId)
  94252. return c
  94253. }
  94254. // Fields allows partial responses to be retrieved. See
  94255. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94256. // for more information.
  94257. func (c *OrganizationSecurityPoliciesAddAssociationCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesAddAssociationCall {
  94258. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94259. return c
  94260. }
  94261. // Context sets the context to be used in this call's Do method. Any
  94262. // pending HTTP request will be aborted if the provided context is
  94263. // canceled.
  94264. func (c *OrganizationSecurityPoliciesAddAssociationCall) Context(ctx context.Context) *OrganizationSecurityPoliciesAddAssociationCall {
  94265. c.ctx_ = ctx
  94266. return c
  94267. }
  94268. // Header returns an http.Header that can be modified by the caller to
  94269. // add HTTP headers to the request.
  94270. func (c *OrganizationSecurityPoliciesAddAssociationCall) Header() http.Header {
  94271. if c.header_ == nil {
  94272. c.header_ = make(http.Header)
  94273. }
  94274. return c.header_
  94275. }
  94276. func (c *OrganizationSecurityPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) {
  94277. reqHeaders := make(http.Header)
  94278. for k, v := range c.header_ {
  94279. reqHeaders[k] = v
  94280. }
  94281. reqHeaders.Set("User-Agent", c.s.userAgent())
  94282. var body io.Reader = nil
  94283. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyassociation)
  94284. if err != nil {
  94285. return nil, err
  94286. }
  94287. reqHeaders.Set("Content-Type", "application/json")
  94288. c.urlParams_.Set("alt", alt)
  94289. c.urlParams_.Set("prettyPrint", "false")
  94290. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/addAssociation")
  94291. urls += "?" + c.urlParams_.Encode()
  94292. req, err := http.NewRequest("POST", urls, body)
  94293. if err != nil {
  94294. return nil, err
  94295. }
  94296. req.Header = reqHeaders
  94297. googleapi.Expand(req.URL, map[string]string{
  94298. "securityPolicy": c.securityPolicy,
  94299. })
  94300. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94301. }
  94302. // Do executes the "compute.organizationSecurityPolicies.addAssociation" call.
  94303. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94304. // status code is an error. Response headers are in either
  94305. // *Operation.ServerResponse.Header or (if a response was returned at
  94306. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94307. // to check whether the returned error was because
  94308. // http.StatusNotModified was returned.
  94309. func (c *OrganizationSecurityPoliciesAddAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94310. gensupport.SetOptions(c.urlParams_, opts...)
  94311. res, err := c.doRequest("json")
  94312. if res != nil && res.StatusCode == http.StatusNotModified {
  94313. if res.Body != nil {
  94314. res.Body.Close()
  94315. }
  94316. return nil, &googleapi.Error{
  94317. Code: res.StatusCode,
  94318. Header: res.Header,
  94319. }
  94320. }
  94321. if err != nil {
  94322. return nil, err
  94323. }
  94324. defer googleapi.CloseBody(res)
  94325. if err := googleapi.CheckResponse(res); err != nil {
  94326. return nil, err
  94327. }
  94328. ret := &Operation{
  94329. ServerResponse: googleapi.ServerResponse{
  94330. Header: res.Header,
  94331. HTTPStatusCode: res.StatusCode,
  94332. },
  94333. }
  94334. target := &ret
  94335. if err := gensupport.DecodeResponse(target, res); err != nil {
  94336. return nil, err
  94337. }
  94338. return ret, nil
  94339. // {
  94340. // "description": "Inserts an association for the specified security policy.",
  94341. // "httpMethod": "POST",
  94342. // "id": "compute.organizationSecurityPolicies.addAssociation",
  94343. // "parameterOrder": [
  94344. // "securityPolicy"
  94345. // ],
  94346. // "parameters": {
  94347. // "replaceExistingAssociation": {
  94348. // "description": "Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an assocation already exists.",
  94349. // "location": "query",
  94350. // "type": "boolean"
  94351. // },
  94352. // "requestId": {
  94353. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94354. // "location": "query",
  94355. // "type": "string"
  94356. // },
  94357. // "securityPolicy": {
  94358. // "description": "Name of the security policy to update.",
  94359. // "location": "path",
  94360. // "pattern": "[0-9]{0,20}",
  94361. // "required": true,
  94362. // "type": "string"
  94363. // }
  94364. // },
  94365. // "path": "locations/global/securityPolicies/{securityPolicy}/addAssociation",
  94366. // "request": {
  94367. // "$ref": "SecurityPolicyAssociation"
  94368. // },
  94369. // "response": {
  94370. // "$ref": "Operation"
  94371. // },
  94372. // "scopes": [
  94373. // "https://www.googleapis.com/auth/cloud-platform",
  94374. // "https://www.googleapis.com/auth/compute"
  94375. // ]
  94376. // }
  94377. }
  94378. // method id "compute.organizationSecurityPolicies.addRule":
  94379. type OrganizationSecurityPoliciesAddRuleCall struct {
  94380. s *Service
  94381. securityPolicy string
  94382. securitypolicyrule *SecurityPolicyRule
  94383. urlParams_ gensupport.URLParams
  94384. ctx_ context.Context
  94385. header_ http.Header
  94386. }
  94387. // AddRule: Inserts a rule into a security policy.
  94388. func (r *OrganizationSecurityPoliciesService) AddRule(securityPolicy string, securitypolicyrule *SecurityPolicyRule) *OrganizationSecurityPoliciesAddRuleCall {
  94389. c := &OrganizationSecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94390. c.securityPolicy = securityPolicy
  94391. c.securitypolicyrule = securitypolicyrule
  94392. return c
  94393. }
  94394. // RequestId sets the optional parameter "requestId": An optional
  94395. // request ID to identify requests. Specify a unique request ID so that
  94396. // if you must retry your request, the server will know to ignore the
  94397. // request if it has already been completed.
  94398. //
  94399. // For example, consider a situation where you make an initial request
  94400. // and the request times out. If you make the request again with the
  94401. // same request ID, the server can check if original operation with the
  94402. // same request ID was received, and if so, will ignore the second
  94403. // request. This prevents clients from accidentally creating duplicate
  94404. // commitments.
  94405. //
  94406. // The request ID must be a valid UUID with the exception that zero UUID
  94407. // is not supported (00000000-0000-0000-0000-000000000000).
  94408. func (c *OrganizationSecurityPoliciesAddRuleCall) RequestId(requestId string) *OrganizationSecurityPoliciesAddRuleCall {
  94409. c.urlParams_.Set("requestId", requestId)
  94410. return c
  94411. }
  94412. // Fields allows partial responses to be retrieved. See
  94413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94414. // for more information.
  94415. func (c *OrganizationSecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesAddRuleCall {
  94416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94417. return c
  94418. }
  94419. // Context sets the context to be used in this call's Do method. Any
  94420. // pending HTTP request will be aborted if the provided context is
  94421. // canceled.
  94422. func (c *OrganizationSecurityPoliciesAddRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesAddRuleCall {
  94423. c.ctx_ = ctx
  94424. return c
  94425. }
  94426. // Header returns an http.Header that can be modified by the caller to
  94427. // add HTTP headers to the request.
  94428. func (c *OrganizationSecurityPoliciesAddRuleCall) Header() http.Header {
  94429. if c.header_ == nil {
  94430. c.header_ = make(http.Header)
  94431. }
  94432. return c.header_
  94433. }
  94434. func (c *OrganizationSecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  94435. reqHeaders := make(http.Header)
  94436. for k, v := range c.header_ {
  94437. reqHeaders[k] = v
  94438. }
  94439. reqHeaders.Set("User-Agent", c.s.userAgent())
  94440. var body io.Reader = nil
  94441. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  94442. if err != nil {
  94443. return nil, err
  94444. }
  94445. reqHeaders.Set("Content-Type", "application/json")
  94446. c.urlParams_.Set("alt", alt)
  94447. c.urlParams_.Set("prettyPrint", "false")
  94448. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/addRule")
  94449. urls += "?" + c.urlParams_.Encode()
  94450. req, err := http.NewRequest("POST", urls, body)
  94451. if err != nil {
  94452. return nil, err
  94453. }
  94454. req.Header = reqHeaders
  94455. googleapi.Expand(req.URL, map[string]string{
  94456. "securityPolicy": c.securityPolicy,
  94457. })
  94458. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94459. }
  94460. // Do executes the "compute.organizationSecurityPolicies.addRule" call.
  94461. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94462. // status code is an error. Response headers are in either
  94463. // *Operation.ServerResponse.Header or (if a response was returned at
  94464. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94465. // to check whether the returned error was because
  94466. // http.StatusNotModified was returned.
  94467. func (c *OrganizationSecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94468. gensupport.SetOptions(c.urlParams_, opts...)
  94469. res, err := c.doRequest("json")
  94470. if res != nil && res.StatusCode == http.StatusNotModified {
  94471. if res.Body != nil {
  94472. res.Body.Close()
  94473. }
  94474. return nil, &googleapi.Error{
  94475. Code: res.StatusCode,
  94476. Header: res.Header,
  94477. }
  94478. }
  94479. if err != nil {
  94480. return nil, err
  94481. }
  94482. defer googleapi.CloseBody(res)
  94483. if err := googleapi.CheckResponse(res); err != nil {
  94484. return nil, err
  94485. }
  94486. ret := &Operation{
  94487. ServerResponse: googleapi.ServerResponse{
  94488. Header: res.Header,
  94489. HTTPStatusCode: res.StatusCode,
  94490. },
  94491. }
  94492. target := &ret
  94493. if err := gensupport.DecodeResponse(target, res); err != nil {
  94494. return nil, err
  94495. }
  94496. return ret, nil
  94497. // {
  94498. // "description": "Inserts a rule into a security policy.",
  94499. // "httpMethod": "POST",
  94500. // "id": "compute.organizationSecurityPolicies.addRule",
  94501. // "parameterOrder": [
  94502. // "securityPolicy"
  94503. // ],
  94504. // "parameters": {
  94505. // "requestId": {
  94506. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94507. // "location": "query",
  94508. // "type": "string"
  94509. // },
  94510. // "securityPolicy": {
  94511. // "description": "Name of the security policy to update.",
  94512. // "location": "path",
  94513. // "pattern": "[0-9]{0,20}",
  94514. // "required": true,
  94515. // "type": "string"
  94516. // }
  94517. // },
  94518. // "path": "locations/global/securityPolicies/{securityPolicy}/addRule",
  94519. // "request": {
  94520. // "$ref": "SecurityPolicyRule"
  94521. // },
  94522. // "response": {
  94523. // "$ref": "Operation"
  94524. // },
  94525. // "scopes": [
  94526. // "https://www.googleapis.com/auth/cloud-platform",
  94527. // "https://www.googleapis.com/auth/compute"
  94528. // ]
  94529. // }
  94530. }
  94531. // method id "compute.organizationSecurityPolicies.copyRules":
  94532. type OrganizationSecurityPoliciesCopyRulesCall struct {
  94533. s *Service
  94534. securityPolicy string
  94535. urlParams_ gensupport.URLParams
  94536. ctx_ context.Context
  94537. header_ http.Header
  94538. }
  94539. // CopyRules: Copies rules to the specified security policy.
  94540. func (r *OrganizationSecurityPoliciesService) CopyRules(securityPolicy string) *OrganizationSecurityPoliciesCopyRulesCall {
  94541. c := &OrganizationSecurityPoliciesCopyRulesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94542. c.securityPolicy = securityPolicy
  94543. return c
  94544. }
  94545. // RequestId sets the optional parameter "requestId": An optional
  94546. // request ID to identify requests. Specify a unique request ID so that
  94547. // if you must retry your request, the server will know to ignore the
  94548. // request if it has already been completed.
  94549. //
  94550. // For example, consider a situation where you make an initial request
  94551. // and the request times out. If you make the request again with the
  94552. // same request ID, the server can check if original operation with the
  94553. // same request ID was received, and if so, will ignore the second
  94554. // request. This prevents clients from accidentally creating duplicate
  94555. // commitments.
  94556. //
  94557. // The request ID must be a valid UUID with the exception that zero UUID
  94558. // is not supported (00000000-0000-0000-0000-000000000000).
  94559. func (c *OrganizationSecurityPoliciesCopyRulesCall) RequestId(requestId string) *OrganizationSecurityPoliciesCopyRulesCall {
  94560. c.urlParams_.Set("requestId", requestId)
  94561. return c
  94562. }
  94563. // SourceSecurityPolicy sets the optional parameter
  94564. // "sourceSecurityPolicy": The security policy from which to copy rules.
  94565. func (c *OrganizationSecurityPoliciesCopyRulesCall) SourceSecurityPolicy(sourceSecurityPolicy string) *OrganizationSecurityPoliciesCopyRulesCall {
  94566. c.urlParams_.Set("sourceSecurityPolicy", sourceSecurityPolicy)
  94567. return c
  94568. }
  94569. // Fields allows partial responses to be retrieved. See
  94570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94571. // for more information.
  94572. func (c *OrganizationSecurityPoliciesCopyRulesCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesCopyRulesCall {
  94573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94574. return c
  94575. }
  94576. // Context sets the context to be used in this call's Do method. Any
  94577. // pending HTTP request will be aborted if the provided context is
  94578. // canceled.
  94579. func (c *OrganizationSecurityPoliciesCopyRulesCall) Context(ctx context.Context) *OrganizationSecurityPoliciesCopyRulesCall {
  94580. c.ctx_ = ctx
  94581. return c
  94582. }
  94583. // Header returns an http.Header that can be modified by the caller to
  94584. // add HTTP headers to the request.
  94585. func (c *OrganizationSecurityPoliciesCopyRulesCall) Header() http.Header {
  94586. if c.header_ == nil {
  94587. c.header_ = make(http.Header)
  94588. }
  94589. return c.header_
  94590. }
  94591. func (c *OrganizationSecurityPoliciesCopyRulesCall) doRequest(alt string) (*http.Response, error) {
  94592. reqHeaders := make(http.Header)
  94593. for k, v := range c.header_ {
  94594. reqHeaders[k] = v
  94595. }
  94596. reqHeaders.Set("User-Agent", c.s.userAgent())
  94597. var body io.Reader = nil
  94598. c.urlParams_.Set("alt", alt)
  94599. c.urlParams_.Set("prettyPrint", "false")
  94600. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/copyRules")
  94601. urls += "?" + c.urlParams_.Encode()
  94602. req, err := http.NewRequest("POST", urls, body)
  94603. if err != nil {
  94604. return nil, err
  94605. }
  94606. req.Header = reqHeaders
  94607. googleapi.Expand(req.URL, map[string]string{
  94608. "securityPolicy": c.securityPolicy,
  94609. })
  94610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94611. }
  94612. // Do executes the "compute.organizationSecurityPolicies.copyRules" call.
  94613. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94614. // status code is an error. Response headers are in either
  94615. // *Operation.ServerResponse.Header or (if a response was returned at
  94616. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94617. // to check whether the returned error was because
  94618. // http.StatusNotModified was returned.
  94619. func (c *OrganizationSecurityPoliciesCopyRulesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94620. gensupport.SetOptions(c.urlParams_, opts...)
  94621. res, err := c.doRequest("json")
  94622. if res != nil && res.StatusCode == http.StatusNotModified {
  94623. if res.Body != nil {
  94624. res.Body.Close()
  94625. }
  94626. return nil, &googleapi.Error{
  94627. Code: res.StatusCode,
  94628. Header: res.Header,
  94629. }
  94630. }
  94631. if err != nil {
  94632. return nil, err
  94633. }
  94634. defer googleapi.CloseBody(res)
  94635. if err := googleapi.CheckResponse(res); err != nil {
  94636. return nil, err
  94637. }
  94638. ret := &Operation{
  94639. ServerResponse: googleapi.ServerResponse{
  94640. Header: res.Header,
  94641. HTTPStatusCode: res.StatusCode,
  94642. },
  94643. }
  94644. target := &ret
  94645. if err := gensupport.DecodeResponse(target, res); err != nil {
  94646. return nil, err
  94647. }
  94648. return ret, nil
  94649. // {
  94650. // "description": "Copies rules to the specified security policy.",
  94651. // "httpMethod": "POST",
  94652. // "id": "compute.organizationSecurityPolicies.copyRules",
  94653. // "parameterOrder": [
  94654. // "securityPolicy"
  94655. // ],
  94656. // "parameters": {
  94657. // "requestId": {
  94658. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94659. // "location": "query",
  94660. // "type": "string"
  94661. // },
  94662. // "securityPolicy": {
  94663. // "description": "Name of the security policy to update.",
  94664. // "location": "path",
  94665. // "pattern": "[0-9]{0,20}",
  94666. // "required": true,
  94667. // "type": "string"
  94668. // },
  94669. // "sourceSecurityPolicy": {
  94670. // "description": "The security policy from which to copy rules.",
  94671. // "location": "query",
  94672. // "type": "string"
  94673. // }
  94674. // },
  94675. // "path": "locations/global/securityPolicies/{securityPolicy}/copyRules",
  94676. // "response": {
  94677. // "$ref": "Operation"
  94678. // },
  94679. // "scopes": [
  94680. // "https://www.googleapis.com/auth/cloud-platform",
  94681. // "https://www.googleapis.com/auth/compute"
  94682. // ]
  94683. // }
  94684. }
  94685. // method id "compute.organizationSecurityPolicies.delete":
  94686. type OrganizationSecurityPoliciesDeleteCall struct {
  94687. s *Service
  94688. securityPolicy string
  94689. urlParams_ gensupport.URLParams
  94690. ctx_ context.Context
  94691. header_ http.Header
  94692. }
  94693. // Delete: Deletes the specified policy.
  94694. func (r *OrganizationSecurityPoliciesService) Delete(securityPolicy string) *OrganizationSecurityPoliciesDeleteCall {
  94695. c := &OrganizationSecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94696. c.securityPolicy = securityPolicy
  94697. return c
  94698. }
  94699. // RequestId sets the optional parameter "requestId": An optional
  94700. // request ID to identify requests. Specify a unique request ID so that
  94701. // if you must retry your request, the server will know to ignore the
  94702. // request if it has already been completed.
  94703. //
  94704. // For example, consider a situation where you make an initial request
  94705. // and the request times out. If you make the request again with the
  94706. // same request ID, the server can check if original operation with the
  94707. // same request ID was received, and if so, will ignore the second
  94708. // request. This prevents clients from accidentally creating duplicate
  94709. // commitments.
  94710. //
  94711. // The request ID must be a valid UUID with the exception that zero UUID
  94712. // is not supported (00000000-0000-0000-0000-000000000000).
  94713. func (c *OrganizationSecurityPoliciesDeleteCall) RequestId(requestId string) *OrganizationSecurityPoliciesDeleteCall {
  94714. c.urlParams_.Set("requestId", requestId)
  94715. return c
  94716. }
  94717. // Fields allows partial responses to be retrieved. See
  94718. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94719. // for more information.
  94720. func (c *OrganizationSecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesDeleteCall {
  94721. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94722. return c
  94723. }
  94724. // Context sets the context to be used in this call's Do method. Any
  94725. // pending HTTP request will be aborted if the provided context is
  94726. // canceled.
  94727. func (c *OrganizationSecurityPoliciesDeleteCall) Context(ctx context.Context) *OrganizationSecurityPoliciesDeleteCall {
  94728. c.ctx_ = ctx
  94729. return c
  94730. }
  94731. // Header returns an http.Header that can be modified by the caller to
  94732. // add HTTP headers to the request.
  94733. func (c *OrganizationSecurityPoliciesDeleteCall) Header() http.Header {
  94734. if c.header_ == nil {
  94735. c.header_ = make(http.Header)
  94736. }
  94737. return c.header_
  94738. }
  94739. func (c *OrganizationSecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  94740. reqHeaders := make(http.Header)
  94741. for k, v := range c.header_ {
  94742. reqHeaders[k] = v
  94743. }
  94744. reqHeaders.Set("User-Agent", c.s.userAgent())
  94745. var body io.Reader = nil
  94746. c.urlParams_.Set("alt", alt)
  94747. c.urlParams_.Set("prettyPrint", "false")
  94748. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}")
  94749. urls += "?" + c.urlParams_.Encode()
  94750. req, err := http.NewRequest("DELETE", urls, body)
  94751. if err != nil {
  94752. return nil, err
  94753. }
  94754. req.Header = reqHeaders
  94755. googleapi.Expand(req.URL, map[string]string{
  94756. "securityPolicy": c.securityPolicy,
  94757. })
  94758. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94759. }
  94760. // Do executes the "compute.organizationSecurityPolicies.delete" call.
  94761. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94762. // status code is an error. Response headers are in either
  94763. // *Operation.ServerResponse.Header or (if a response was returned at
  94764. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94765. // to check whether the returned error was because
  94766. // http.StatusNotModified was returned.
  94767. func (c *OrganizationSecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94768. gensupport.SetOptions(c.urlParams_, opts...)
  94769. res, err := c.doRequest("json")
  94770. if res != nil && res.StatusCode == http.StatusNotModified {
  94771. if res.Body != nil {
  94772. res.Body.Close()
  94773. }
  94774. return nil, &googleapi.Error{
  94775. Code: res.StatusCode,
  94776. Header: res.Header,
  94777. }
  94778. }
  94779. if err != nil {
  94780. return nil, err
  94781. }
  94782. defer googleapi.CloseBody(res)
  94783. if err := googleapi.CheckResponse(res); err != nil {
  94784. return nil, err
  94785. }
  94786. ret := &Operation{
  94787. ServerResponse: googleapi.ServerResponse{
  94788. Header: res.Header,
  94789. HTTPStatusCode: res.StatusCode,
  94790. },
  94791. }
  94792. target := &ret
  94793. if err := gensupport.DecodeResponse(target, res); err != nil {
  94794. return nil, err
  94795. }
  94796. return ret, nil
  94797. // {
  94798. // "description": "Deletes the specified policy.",
  94799. // "httpMethod": "DELETE",
  94800. // "id": "compute.organizationSecurityPolicies.delete",
  94801. // "parameterOrder": [
  94802. // "securityPolicy"
  94803. // ],
  94804. // "parameters": {
  94805. // "requestId": {
  94806. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94807. // "location": "query",
  94808. // "type": "string"
  94809. // },
  94810. // "securityPolicy": {
  94811. // "description": "Name of the security policy to delete.",
  94812. // "location": "path",
  94813. // "pattern": "[0-9]{0,20}",
  94814. // "required": true,
  94815. // "type": "string"
  94816. // }
  94817. // },
  94818. // "path": "locations/global/securityPolicies/{securityPolicy}",
  94819. // "response": {
  94820. // "$ref": "Operation"
  94821. // },
  94822. // "scopes": [
  94823. // "https://www.googleapis.com/auth/cloud-platform",
  94824. // "https://www.googleapis.com/auth/compute"
  94825. // ]
  94826. // }
  94827. }
  94828. // method id "compute.organizationSecurityPolicies.get":
  94829. type OrganizationSecurityPoliciesGetCall struct {
  94830. s *Service
  94831. securityPolicy string
  94832. urlParams_ gensupport.URLParams
  94833. ifNoneMatch_ string
  94834. ctx_ context.Context
  94835. header_ http.Header
  94836. }
  94837. // Get: List all of the ordered rules present in a single specified
  94838. // policy.
  94839. func (r *OrganizationSecurityPoliciesService) Get(securityPolicy string) *OrganizationSecurityPoliciesGetCall {
  94840. c := &OrganizationSecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94841. c.securityPolicy = securityPolicy
  94842. return c
  94843. }
  94844. // Fields allows partial responses to be retrieved. See
  94845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94846. // for more information.
  94847. func (c *OrganizationSecurityPoliciesGetCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesGetCall {
  94848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94849. return c
  94850. }
  94851. // IfNoneMatch sets the optional parameter which makes the operation
  94852. // fail if the object's ETag matches the given value. This is useful for
  94853. // getting updates only after the object has changed since the last
  94854. // request. Use googleapi.IsNotModified to check whether the response
  94855. // error from Do is the result of In-None-Match.
  94856. func (c *OrganizationSecurityPoliciesGetCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesGetCall {
  94857. c.ifNoneMatch_ = entityTag
  94858. return c
  94859. }
  94860. // Context sets the context to be used in this call's Do method. Any
  94861. // pending HTTP request will be aborted if the provided context is
  94862. // canceled.
  94863. func (c *OrganizationSecurityPoliciesGetCall) Context(ctx context.Context) *OrganizationSecurityPoliciesGetCall {
  94864. c.ctx_ = ctx
  94865. return c
  94866. }
  94867. // Header returns an http.Header that can be modified by the caller to
  94868. // add HTTP headers to the request.
  94869. func (c *OrganizationSecurityPoliciesGetCall) Header() http.Header {
  94870. if c.header_ == nil {
  94871. c.header_ = make(http.Header)
  94872. }
  94873. return c.header_
  94874. }
  94875. func (c *OrganizationSecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  94876. reqHeaders := make(http.Header)
  94877. for k, v := range c.header_ {
  94878. reqHeaders[k] = v
  94879. }
  94880. reqHeaders.Set("User-Agent", c.s.userAgent())
  94881. if c.ifNoneMatch_ != "" {
  94882. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94883. }
  94884. var body io.Reader = nil
  94885. c.urlParams_.Set("alt", alt)
  94886. c.urlParams_.Set("prettyPrint", "false")
  94887. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}")
  94888. urls += "?" + c.urlParams_.Encode()
  94889. req, err := http.NewRequest("GET", urls, body)
  94890. if err != nil {
  94891. return nil, err
  94892. }
  94893. req.Header = reqHeaders
  94894. googleapi.Expand(req.URL, map[string]string{
  94895. "securityPolicy": c.securityPolicy,
  94896. })
  94897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94898. }
  94899. // Do executes the "compute.organizationSecurityPolicies.get" call.
  94900. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  94901. // status code is an error. Response headers are in either
  94902. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  94903. // at all) in error.(*googleapi.Error).Header. Use
  94904. // googleapi.IsNotModified to check whether the returned error was
  94905. // because http.StatusNotModified was returned.
  94906. func (c *OrganizationSecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  94907. gensupport.SetOptions(c.urlParams_, opts...)
  94908. res, err := c.doRequest("json")
  94909. if res != nil && res.StatusCode == http.StatusNotModified {
  94910. if res.Body != nil {
  94911. res.Body.Close()
  94912. }
  94913. return nil, &googleapi.Error{
  94914. Code: res.StatusCode,
  94915. Header: res.Header,
  94916. }
  94917. }
  94918. if err != nil {
  94919. return nil, err
  94920. }
  94921. defer googleapi.CloseBody(res)
  94922. if err := googleapi.CheckResponse(res); err != nil {
  94923. return nil, err
  94924. }
  94925. ret := &SecurityPolicy{
  94926. ServerResponse: googleapi.ServerResponse{
  94927. Header: res.Header,
  94928. HTTPStatusCode: res.StatusCode,
  94929. },
  94930. }
  94931. target := &ret
  94932. if err := gensupport.DecodeResponse(target, res); err != nil {
  94933. return nil, err
  94934. }
  94935. return ret, nil
  94936. // {
  94937. // "description": "List all of the ordered rules present in a single specified policy.",
  94938. // "httpMethod": "GET",
  94939. // "id": "compute.organizationSecurityPolicies.get",
  94940. // "parameterOrder": [
  94941. // "securityPolicy"
  94942. // ],
  94943. // "parameters": {
  94944. // "securityPolicy": {
  94945. // "description": "Name of the security policy to get.",
  94946. // "location": "path",
  94947. // "pattern": "[0-9]{0,20}",
  94948. // "required": true,
  94949. // "type": "string"
  94950. // }
  94951. // },
  94952. // "path": "locations/global/securityPolicies/{securityPolicy}",
  94953. // "response": {
  94954. // "$ref": "SecurityPolicy"
  94955. // },
  94956. // "scopes": [
  94957. // "https://www.googleapis.com/auth/cloud-platform",
  94958. // "https://www.googleapis.com/auth/compute",
  94959. // "https://www.googleapis.com/auth/compute.readonly"
  94960. // ]
  94961. // }
  94962. }
  94963. // method id "compute.organizationSecurityPolicies.getAssociation":
  94964. type OrganizationSecurityPoliciesGetAssociationCall struct {
  94965. s *Service
  94966. securityPolicy string
  94967. urlParams_ gensupport.URLParams
  94968. ifNoneMatch_ string
  94969. ctx_ context.Context
  94970. header_ http.Header
  94971. }
  94972. // GetAssociation: Gets an association with the specified name.
  94973. func (r *OrganizationSecurityPoliciesService) GetAssociation(securityPolicy string) *OrganizationSecurityPoliciesGetAssociationCall {
  94974. c := &OrganizationSecurityPoliciesGetAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94975. c.securityPolicy = securityPolicy
  94976. return c
  94977. }
  94978. // Name sets the optional parameter "name": The name of the association
  94979. // to get from the security policy.
  94980. func (c *OrganizationSecurityPoliciesGetAssociationCall) Name(name string) *OrganizationSecurityPoliciesGetAssociationCall {
  94981. c.urlParams_.Set("name", name)
  94982. return c
  94983. }
  94984. // Fields allows partial responses to be retrieved. See
  94985. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94986. // for more information.
  94987. func (c *OrganizationSecurityPoliciesGetAssociationCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesGetAssociationCall {
  94988. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94989. return c
  94990. }
  94991. // IfNoneMatch sets the optional parameter which makes the operation
  94992. // fail if the object's ETag matches the given value. This is useful for
  94993. // getting updates only after the object has changed since the last
  94994. // request. Use googleapi.IsNotModified to check whether the response
  94995. // error from Do is the result of In-None-Match.
  94996. func (c *OrganizationSecurityPoliciesGetAssociationCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesGetAssociationCall {
  94997. c.ifNoneMatch_ = entityTag
  94998. return c
  94999. }
  95000. // Context sets the context to be used in this call's Do method. Any
  95001. // pending HTTP request will be aborted if the provided context is
  95002. // canceled.
  95003. func (c *OrganizationSecurityPoliciesGetAssociationCall) Context(ctx context.Context) *OrganizationSecurityPoliciesGetAssociationCall {
  95004. c.ctx_ = ctx
  95005. return c
  95006. }
  95007. // Header returns an http.Header that can be modified by the caller to
  95008. // add HTTP headers to the request.
  95009. func (c *OrganizationSecurityPoliciesGetAssociationCall) Header() http.Header {
  95010. if c.header_ == nil {
  95011. c.header_ = make(http.Header)
  95012. }
  95013. return c.header_
  95014. }
  95015. func (c *OrganizationSecurityPoliciesGetAssociationCall) doRequest(alt string) (*http.Response, error) {
  95016. reqHeaders := make(http.Header)
  95017. for k, v := range c.header_ {
  95018. reqHeaders[k] = v
  95019. }
  95020. reqHeaders.Set("User-Agent", c.s.userAgent())
  95021. if c.ifNoneMatch_ != "" {
  95022. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95023. }
  95024. var body io.Reader = nil
  95025. c.urlParams_.Set("alt", alt)
  95026. c.urlParams_.Set("prettyPrint", "false")
  95027. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/getAssociation")
  95028. urls += "?" + c.urlParams_.Encode()
  95029. req, err := http.NewRequest("GET", urls, body)
  95030. if err != nil {
  95031. return nil, err
  95032. }
  95033. req.Header = reqHeaders
  95034. googleapi.Expand(req.URL, map[string]string{
  95035. "securityPolicy": c.securityPolicy,
  95036. })
  95037. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95038. }
  95039. // Do executes the "compute.organizationSecurityPolicies.getAssociation" call.
  95040. // Exactly one of *SecurityPolicyAssociation or error will be non-nil.
  95041. // Any non-2xx status code is an error. Response headers are in either
  95042. // *SecurityPolicyAssociation.ServerResponse.Header or (if a response
  95043. // was returned at all) in error.(*googleapi.Error).Header. Use
  95044. // googleapi.IsNotModified to check whether the returned error was
  95045. // because http.StatusNotModified was returned.
  95046. func (c *OrganizationSecurityPoliciesGetAssociationCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyAssociation, error) {
  95047. gensupport.SetOptions(c.urlParams_, opts...)
  95048. res, err := c.doRequest("json")
  95049. if res != nil && res.StatusCode == http.StatusNotModified {
  95050. if res.Body != nil {
  95051. res.Body.Close()
  95052. }
  95053. return nil, &googleapi.Error{
  95054. Code: res.StatusCode,
  95055. Header: res.Header,
  95056. }
  95057. }
  95058. if err != nil {
  95059. return nil, err
  95060. }
  95061. defer googleapi.CloseBody(res)
  95062. if err := googleapi.CheckResponse(res); err != nil {
  95063. return nil, err
  95064. }
  95065. ret := &SecurityPolicyAssociation{
  95066. ServerResponse: googleapi.ServerResponse{
  95067. Header: res.Header,
  95068. HTTPStatusCode: res.StatusCode,
  95069. },
  95070. }
  95071. target := &ret
  95072. if err := gensupport.DecodeResponse(target, res); err != nil {
  95073. return nil, err
  95074. }
  95075. return ret, nil
  95076. // {
  95077. // "description": "Gets an association with the specified name.",
  95078. // "httpMethod": "GET",
  95079. // "id": "compute.organizationSecurityPolicies.getAssociation",
  95080. // "parameterOrder": [
  95081. // "securityPolicy"
  95082. // ],
  95083. // "parameters": {
  95084. // "name": {
  95085. // "description": "The name of the association to get from the security policy.",
  95086. // "location": "query",
  95087. // "type": "string"
  95088. // },
  95089. // "securityPolicy": {
  95090. // "description": "Name of the security policy to which the queried rule belongs.",
  95091. // "location": "path",
  95092. // "pattern": "[0-9]{0,20}",
  95093. // "required": true,
  95094. // "type": "string"
  95095. // }
  95096. // },
  95097. // "path": "locations/global/securityPolicies/{securityPolicy}/getAssociation",
  95098. // "response": {
  95099. // "$ref": "SecurityPolicyAssociation"
  95100. // },
  95101. // "scopes": [
  95102. // "https://www.googleapis.com/auth/cloud-platform",
  95103. // "https://www.googleapis.com/auth/compute",
  95104. // "https://www.googleapis.com/auth/compute.readonly"
  95105. // ]
  95106. // }
  95107. }
  95108. // method id "compute.organizationSecurityPolicies.getRule":
  95109. type OrganizationSecurityPoliciesGetRuleCall struct {
  95110. s *Service
  95111. securityPolicy string
  95112. urlParams_ gensupport.URLParams
  95113. ifNoneMatch_ string
  95114. ctx_ context.Context
  95115. header_ http.Header
  95116. }
  95117. // GetRule: Gets a rule at the specified priority.
  95118. func (r *OrganizationSecurityPoliciesService) GetRule(securityPolicy string) *OrganizationSecurityPoliciesGetRuleCall {
  95119. c := &OrganizationSecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95120. c.securityPolicy = securityPolicy
  95121. return c
  95122. }
  95123. // Priority sets the optional parameter "priority": The priority of the
  95124. // rule to get from the security policy.
  95125. func (c *OrganizationSecurityPoliciesGetRuleCall) Priority(priority int64) *OrganizationSecurityPoliciesGetRuleCall {
  95126. c.urlParams_.Set("priority", fmt.Sprint(priority))
  95127. return c
  95128. }
  95129. // Fields allows partial responses to be retrieved. See
  95130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95131. // for more information.
  95132. func (c *OrganizationSecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesGetRuleCall {
  95133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95134. return c
  95135. }
  95136. // IfNoneMatch sets the optional parameter which makes the operation
  95137. // fail if the object's ETag matches the given value. This is useful for
  95138. // getting updates only after the object has changed since the last
  95139. // request. Use googleapi.IsNotModified to check whether the response
  95140. // error from Do is the result of In-None-Match.
  95141. func (c *OrganizationSecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesGetRuleCall {
  95142. c.ifNoneMatch_ = entityTag
  95143. return c
  95144. }
  95145. // Context sets the context to be used in this call's Do method. Any
  95146. // pending HTTP request will be aborted if the provided context is
  95147. // canceled.
  95148. func (c *OrganizationSecurityPoliciesGetRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesGetRuleCall {
  95149. c.ctx_ = ctx
  95150. return c
  95151. }
  95152. // Header returns an http.Header that can be modified by the caller to
  95153. // add HTTP headers to the request.
  95154. func (c *OrganizationSecurityPoliciesGetRuleCall) Header() http.Header {
  95155. if c.header_ == nil {
  95156. c.header_ = make(http.Header)
  95157. }
  95158. return c.header_
  95159. }
  95160. func (c *OrganizationSecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  95161. reqHeaders := make(http.Header)
  95162. for k, v := range c.header_ {
  95163. reqHeaders[k] = v
  95164. }
  95165. reqHeaders.Set("User-Agent", c.s.userAgent())
  95166. if c.ifNoneMatch_ != "" {
  95167. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95168. }
  95169. var body io.Reader = nil
  95170. c.urlParams_.Set("alt", alt)
  95171. c.urlParams_.Set("prettyPrint", "false")
  95172. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/getRule")
  95173. urls += "?" + c.urlParams_.Encode()
  95174. req, err := http.NewRequest("GET", urls, body)
  95175. if err != nil {
  95176. return nil, err
  95177. }
  95178. req.Header = reqHeaders
  95179. googleapi.Expand(req.URL, map[string]string{
  95180. "securityPolicy": c.securityPolicy,
  95181. })
  95182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95183. }
  95184. // Do executes the "compute.organizationSecurityPolicies.getRule" call.
  95185. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  95186. // non-2xx status code is an error. Response headers are in either
  95187. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  95188. // returned at all) in error.(*googleapi.Error).Header. Use
  95189. // googleapi.IsNotModified to check whether the returned error was
  95190. // because http.StatusNotModified was returned.
  95191. func (c *OrganizationSecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  95192. gensupport.SetOptions(c.urlParams_, opts...)
  95193. res, err := c.doRequest("json")
  95194. if res != nil && res.StatusCode == http.StatusNotModified {
  95195. if res.Body != nil {
  95196. res.Body.Close()
  95197. }
  95198. return nil, &googleapi.Error{
  95199. Code: res.StatusCode,
  95200. Header: res.Header,
  95201. }
  95202. }
  95203. if err != nil {
  95204. return nil, err
  95205. }
  95206. defer googleapi.CloseBody(res)
  95207. if err := googleapi.CheckResponse(res); err != nil {
  95208. return nil, err
  95209. }
  95210. ret := &SecurityPolicyRule{
  95211. ServerResponse: googleapi.ServerResponse{
  95212. Header: res.Header,
  95213. HTTPStatusCode: res.StatusCode,
  95214. },
  95215. }
  95216. target := &ret
  95217. if err := gensupport.DecodeResponse(target, res); err != nil {
  95218. return nil, err
  95219. }
  95220. return ret, nil
  95221. // {
  95222. // "description": "Gets a rule at the specified priority.",
  95223. // "httpMethod": "GET",
  95224. // "id": "compute.organizationSecurityPolicies.getRule",
  95225. // "parameterOrder": [
  95226. // "securityPolicy"
  95227. // ],
  95228. // "parameters": {
  95229. // "priority": {
  95230. // "description": "The priority of the rule to get from the security policy.",
  95231. // "format": "int32",
  95232. // "location": "query",
  95233. // "type": "integer"
  95234. // },
  95235. // "securityPolicy": {
  95236. // "description": "Name of the security policy to which the queried rule belongs.",
  95237. // "location": "path",
  95238. // "pattern": "[0-9]{0,20}",
  95239. // "required": true,
  95240. // "type": "string"
  95241. // }
  95242. // },
  95243. // "path": "locations/global/securityPolicies/{securityPolicy}/getRule",
  95244. // "response": {
  95245. // "$ref": "SecurityPolicyRule"
  95246. // },
  95247. // "scopes": [
  95248. // "https://www.googleapis.com/auth/cloud-platform",
  95249. // "https://www.googleapis.com/auth/compute",
  95250. // "https://www.googleapis.com/auth/compute.readonly"
  95251. // ]
  95252. // }
  95253. }
  95254. // method id "compute.organizationSecurityPolicies.insert":
  95255. type OrganizationSecurityPoliciesInsertCall struct {
  95256. s *Service
  95257. securitypolicy *SecurityPolicy
  95258. urlParams_ gensupport.URLParams
  95259. ctx_ context.Context
  95260. header_ http.Header
  95261. }
  95262. // Insert: Creates a new policy in the specified project using the data
  95263. // included in the request.
  95264. func (r *OrganizationSecurityPoliciesService) Insert(securitypolicy *SecurityPolicy) *OrganizationSecurityPoliciesInsertCall {
  95265. c := &OrganizationSecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95266. c.securitypolicy = securitypolicy
  95267. return c
  95268. }
  95269. // ParentId sets the optional parameter "parentId": Parent ID for this
  95270. // request.
  95271. func (c *OrganizationSecurityPoliciesInsertCall) ParentId(parentId string) *OrganizationSecurityPoliciesInsertCall {
  95272. c.urlParams_.Set("parentId", parentId)
  95273. return c
  95274. }
  95275. // RequestId sets the optional parameter "requestId": An optional
  95276. // request ID to identify requests. Specify a unique request ID so that
  95277. // if you must retry your request, the server will know to ignore the
  95278. // request if it has already been completed.
  95279. //
  95280. // For example, consider a situation where you make an initial request
  95281. // and the request times out. If you make the request again with the
  95282. // same request ID, the server can check if original operation with the
  95283. // same request ID was received, and if so, will ignore the second
  95284. // request. This prevents clients from accidentally creating duplicate
  95285. // commitments.
  95286. //
  95287. // The request ID must be a valid UUID with the exception that zero UUID
  95288. // is not supported (00000000-0000-0000-0000-000000000000).
  95289. func (c *OrganizationSecurityPoliciesInsertCall) RequestId(requestId string) *OrganizationSecurityPoliciesInsertCall {
  95290. c.urlParams_.Set("requestId", requestId)
  95291. return c
  95292. }
  95293. // Fields allows partial responses to be retrieved. See
  95294. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95295. // for more information.
  95296. func (c *OrganizationSecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesInsertCall {
  95297. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95298. return c
  95299. }
  95300. // Context sets the context to be used in this call's Do method. Any
  95301. // pending HTTP request will be aborted if the provided context is
  95302. // canceled.
  95303. func (c *OrganizationSecurityPoliciesInsertCall) Context(ctx context.Context) *OrganizationSecurityPoliciesInsertCall {
  95304. c.ctx_ = ctx
  95305. return c
  95306. }
  95307. // Header returns an http.Header that can be modified by the caller to
  95308. // add HTTP headers to the request.
  95309. func (c *OrganizationSecurityPoliciesInsertCall) Header() http.Header {
  95310. if c.header_ == nil {
  95311. c.header_ = make(http.Header)
  95312. }
  95313. return c.header_
  95314. }
  95315. func (c *OrganizationSecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  95316. reqHeaders := make(http.Header)
  95317. for k, v := range c.header_ {
  95318. reqHeaders[k] = v
  95319. }
  95320. reqHeaders.Set("User-Agent", c.s.userAgent())
  95321. var body io.Reader = nil
  95322. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  95323. if err != nil {
  95324. return nil, err
  95325. }
  95326. reqHeaders.Set("Content-Type", "application/json")
  95327. c.urlParams_.Set("alt", alt)
  95328. c.urlParams_.Set("prettyPrint", "false")
  95329. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies")
  95330. urls += "?" + c.urlParams_.Encode()
  95331. req, err := http.NewRequest("POST", urls, body)
  95332. if err != nil {
  95333. return nil, err
  95334. }
  95335. req.Header = reqHeaders
  95336. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95337. }
  95338. // Do executes the "compute.organizationSecurityPolicies.insert" call.
  95339. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95340. // status code is an error. Response headers are in either
  95341. // *Operation.ServerResponse.Header or (if a response was returned at
  95342. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95343. // to check whether the returned error was because
  95344. // http.StatusNotModified was returned.
  95345. func (c *OrganizationSecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95346. gensupport.SetOptions(c.urlParams_, opts...)
  95347. res, err := c.doRequest("json")
  95348. if res != nil && res.StatusCode == http.StatusNotModified {
  95349. if res.Body != nil {
  95350. res.Body.Close()
  95351. }
  95352. return nil, &googleapi.Error{
  95353. Code: res.StatusCode,
  95354. Header: res.Header,
  95355. }
  95356. }
  95357. if err != nil {
  95358. return nil, err
  95359. }
  95360. defer googleapi.CloseBody(res)
  95361. if err := googleapi.CheckResponse(res); err != nil {
  95362. return nil, err
  95363. }
  95364. ret := &Operation{
  95365. ServerResponse: googleapi.ServerResponse{
  95366. Header: res.Header,
  95367. HTTPStatusCode: res.StatusCode,
  95368. },
  95369. }
  95370. target := &ret
  95371. if err := gensupport.DecodeResponse(target, res); err != nil {
  95372. return nil, err
  95373. }
  95374. return ret, nil
  95375. // {
  95376. // "description": "Creates a new policy in the specified project using the data included in the request.",
  95377. // "httpMethod": "POST",
  95378. // "id": "compute.organizationSecurityPolicies.insert",
  95379. // "parameters": {
  95380. // "parentId": {
  95381. // "description": "Parent ID for this request.",
  95382. // "location": "query",
  95383. // "type": "string"
  95384. // },
  95385. // "requestId": {
  95386. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95387. // "location": "query",
  95388. // "type": "string"
  95389. // }
  95390. // },
  95391. // "path": "locations/global/securityPolicies",
  95392. // "request": {
  95393. // "$ref": "SecurityPolicy"
  95394. // },
  95395. // "response": {
  95396. // "$ref": "Operation"
  95397. // },
  95398. // "scopes": [
  95399. // "https://www.googleapis.com/auth/cloud-platform",
  95400. // "https://www.googleapis.com/auth/compute"
  95401. // ]
  95402. // }
  95403. }
  95404. // method id "compute.organizationSecurityPolicies.list":
  95405. type OrganizationSecurityPoliciesListCall struct {
  95406. s *Service
  95407. urlParams_ gensupport.URLParams
  95408. ifNoneMatch_ string
  95409. ctx_ context.Context
  95410. header_ http.Header
  95411. }
  95412. // List: List all the policies that have been configured for the
  95413. // specified project.
  95414. func (r *OrganizationSecurityPoliciesService) List() *OrganizationSecurityPoliciesListCall {
  95415. c := &OrganizationSecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95416. return c
  95417. }
  95418. // Filter sets the optional parameter "filter": A filter expression that
  95419. // filters resources listed in the response. The expression must specify
  95420. // the field name, a comparison operator, and the value that you want to
  95421. // use for filtering. The value must be a string, a number, or a
  95422. // boolean. The comparison operator must be either =, !=, >, or <.
  95423. //
  95424. // For example, if you are filtering Compute Engine instances, you can
  95425. // exclude instances named example-instance by specifying name !=
  95426. // example-instance.
  95427. //
  95428. // You can also filter nested fields. For example, you could specify
  95429. // scheduling.automaticRestart = false to include instances only if they
  95430. // are not scheduled for automatic restarts. You can use filtering on
  95431. // nested fields to filter based on resource labels.
  95432. //
  95433. // To filter on multiple expressions, provide each separate expression
  95434. // within parentheses. For example, (scheduling.automaticRestart = true)
  95435. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95436. // AND expression. However, you can include AND and OR expressions
  95437. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95438. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95439. // true).
  95440. func (c *OrganizationSecurityPoliciesListCall) Filter(filter string) *OrganizationSecurityPoliciesListCall {
  95441. c.urlParams_.Set("filter", filter)
  95442. return c
  95443. }
  95444. // MaxResults sets the optional parameter "maxResults": The maximum
  95445. // number of results per page that should be returned. If the number of
  95446. // available results is larger than maxResults, Compute Engine returns a
  95447. // nextPageToken that can be used to get the next page of results in
  95448. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95449. // (Default: 500)
  95450. func (c *OrganizationSecurityPoliciesListCall) MaxResults(maxResults int64) *OrganizationSecurityPoliciesListCall {
  95451. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95452. return c
  95453. }
  95454. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95455. // a certain order. By default, results are returned in alphanumerical
  95456. // order based on the resource name.
  95457. //
  95458. // You can also sort results in descending order based on the creation
  95459. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95460. // based on the creationTimestamp field in reverse chronological order
  95461. // (newest result first). Use this to sort resources like operations so
  95462. // that the newest operation is returned first.
  95463. //
  95464. // Currently, only sorting by name or creationTimestamp desc is
  95465. // supported.
  95466. func (c *OrganizationSecurityPoliciesListCall) OrderBy(orderBy string) *OrganizationSecurityPoliciesListCall {
  95467. c.urlParams_.Set("orderBy", orderBy)
  95468. return c
  95469. }
  95470. // PageToken sets the optional parameter "pageToken": Specifies a page
  95471. // token to use. Set pageToken to the nextPageToken returned by a
  95472. // previous list request to get the next page of results.
  95473. func (c *OrganizationSecurityPoliciesListCall) PageToken(pageToken string) *OrganizationSecurityPoliciesListCall {
  95474. c.urlParams_.Set("pageToken", pageToken)
  95475. return c
  95476. }
  95477. // ParentId sets the optional parameter "parentId": Parent ID for this
  95478. // request.
  95479. func (c *OrganizationSecurityPoliciesListCall) ParentId(parentId string) *OrganizationSecurityPoliciesListCall {
  95480. c.urlParams_.Set("parentId", parentId)
  95481. return c
  95482. }
  95483. // Fields allows partial responses to be retrieved. See
  95484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95485. // for more information.
  95486. func (c *OrganizationSecurityPoliciesListCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesListCall {
  95487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95488. return c
  95489. }
  95490. // IfNoneMatch sets the optional parameter which makes the operation
  95491. // fail if the object's ETag matches the given value. This is useful for
  95492. // getting updates only after the object has changed since the last
  95493. // request. Use googleapi.IsNotModified to check whether the response
  95494. // error from Do is the result of In-None-Match.
  95495. func (c *OrganizationSecurityPoliciesListCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesListCall {
  95496. c.ifNoneMatch_ = entityTag
  95497. return c
  95498. }
  95499. // Context sets the context to be used in this call's Do method. Any
  95500. // pending HTTP request will be aborted if the provided context is
  95501. // canceled.
  95502. func (c *OrganizationSecurityPoliciesListCall) Context(ctx context.Context) *OrganizationSecurityPoliciesListCall {
  95503. c.ctx_ = ctx
  95504. return c
  95505. }
  95506. // Header returns an http.Header that can be modified by the caller to
  95507. // add HTTP headers to the request.
  95508. func (c *OrganizationSecurityPoliciesListCall) Header() http.Header {
  95509. if c.header_ == nil {
  95510. c.header_ = make(http.Header)
  95511. }
  95512. return c.header_
  95513. }
  95514. func (c *OrganizationSecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  95515. reqHeaders := make(http.Header)
  95516. for k, v := range c.header_ {
  95517. reqHeaders[k] = v
  95518. }
  95519. reqHeaders.Set("User-Agent", c.s.userAgent())
  95520. if c.ifNoneMatch_ != "" {
  95521. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95522. }
  95523. var body io.Reader = nil
  95524. c.urlParams_.Set("alt", alt)
  95525. c.urlParams_.Set("prettyPrint", "false")
  95526. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies")
  95527. urls += "?" + c.urlParams_.Encode()
  95528. req, err := http.NewRequest("GET", urls, body)
  95529. if err != nil {
  95530. return nil, err
  95531. }
  95532. req.Header = reqHeaders
  95533. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95534. }
  95535. // Do executes the "compute.organizationSecurityPolicies.list" call.
  95536. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  95537. // non-2xx status code is an error. Response headers are in either
  95538. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  95539. // returned at all) in error.(*googleapi.Error).Header. Use
  95540. // googleapi.IsNotModified to check whether the returned error was
  95541. // because http.StatusNotModified was returned.
  95542. func (c *OrganizationSecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  95543. gensupport.SetOptions(c.urlParams_, opts...)
  95544. res, err := c.doRequest("json")
  95545. if res != nil && res.StatusCode == http.StatusNotModified {
  95546. if res.Body != nil {
  95547. res.Body.Close()
  95548. }
  95549. return nil, &googleapi.Error{
  95550. Code: res.StatusCode,
  95551. Header: res.Header,
  95552. }
  95553. }
  95554. if err != nil {
  95555. return nil, err
  95556. }
  95557. defer googleapi.CloseBody(res)
  95558. if err := googleapi.CheckResponse(res); err != nil {
  95559. return nil, err
  95560. }
  95561. ret := &SecurityPolicyList{
  95562. ServerResponse: googleapi.ServerResponse{
  95563. Header: res.Header,
  95564. HTTPStatusCode: res.StatusCode,
  95565. },
  95566. }
  95567. target := &ret
  95568. if err := gensupport.DecodeResponse(target, res); err != nil {
  95569. return nil, err
  95570. }
  95571. return ret, nil
  95572. // {
  95573. // "description": "List all the policies that have been configured for the specified project.",
  95574. // "httpMethod": "GET",
  95575. // "id": "compute.organizationSecurityPolicies.list",
  95576. // "parameters": {
  95577. // "filter": {
  95578. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  95579. // "location": "query",
  95580. // "type": "string"
  95581. // },
  95582. // "maxResults": {
  95583. // "default": "500",
  95584. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  95585. // "format": "uint32",
  95586. // "location": "query",
  95587. // "minimum": "0",
  95588. // "type": "integer"
  95589. // },
  95590. // "orderBy": {
  95591. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  95592. // "location": "query",
  95593. // "type": "string"
  95594. // },
  95595. // "pageToken": {
  95596. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  95597. // "location": "query",
  95598. // "type": "string"
  95599. // },
  95600. // "parentId": {
  95601. // "description": "Parent ID for this request.",
  95602. // "location": "query",
  95603. // "type": "string"
  95604. // }
  95605. // },
  95606. // "path": "locations/global/securityPolicies",
  95607. // "response": {
  95608. // "$ref": "SecurityPolicyList"
  95609. // },
  95610. // "scopes": [
  95611. // "https://www.googleapis.com/auth/cloud-platform",
  95612. // "https://www.googleapis.com/auth/compute",
  95613. // "https://www.googleapis.com/auth/compute.readonly"
  95614. // ]
  95615. // }
  95616. }
  95617. // Pages invokes f for each page of results.
  95618. // A non-nil error returned from f will halt the iteration.
  95619. // The provided context supersedes any context provided to the Context method.
  95620. func (c *OrganizationSecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  95621. c.ctx_ = ctx
  95622. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95623. for {
  95624. x, err := c.Do()
  95625. if err != nil {
  95626. return err
  95627. }
  95628. if err := f(x); err != nil {
  95629. return err
  95630. }
  95631. if x.NextPageToken == "" {
  95632. return nil
  95633. }
  95634. c.PageToken(x.NextPageToken)
  95635. }
  95636. }
  95637. // method id "compute.organizationSecurityPolicies.listAssociations":
  95638. type OrganizationSecurityPoliciesListAssociationsCall struct {
  95639. s *Service
  95640. urlParams_ gensupport.URLParams
  95641. ifNoneMatch_ string
  95642. ctx_ context.Context
  95643. header_ http.Header
  95644. }
  95645. // ListAssociations: Lists associations of a specified target, i.e.,
  95646. // organization or folder.
  95647. func (r *OrganizationSecurityPoliciesService) ListAssociations() *OrganizationSecurityPoliciesListAssociationsCall {
  95648. c := &OrganizationSecurityPoliciesListAssociationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95649. return c
  95650. }
  95651. // TargetResource sets the optional parameter "targetResource": The
  95652. // target resource to list associations. It is an organization, or a
  95653. // folder.
  95654. func (c *OrganizationSecurityPoliciesListAssociationsCall) TargetResource(targetResource string) *OrganizationSecurityPoliciesListAssociationsCall {
  95655. c.urlParams_.Set("targetResource", targetResource)
  95656. return c
  95657. }
  95658. // Fields allows partial responses to be retrieved. See
  95659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95660. // for more information.
  95661. func (c *OrganizationSecurityPoliciesListAssociationsCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesListAssociationsCall {
  95662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95663. return c
  95664. }
  95665. // IfNoneMatch sets the optional parameter which makes the operation
  95666. // fail if the object's ETag matches the given value. This is useful for
  95667. // getting updates only after the object has changed since the last
  95668. // request. Use googleapi.IsNotModified to check whether the response
  95669. // error from Do is the result of In-None-Match.
  95670. func (c *OrganizationSecurityPoliciesListAssociationsCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesListAssociationsCall {
  95671. c.ifNoneMatch_ = entityTag
  95672. return c
  95673. }
  95674. // Context sets the context to be used in this call's Do method. Any
  95675. // pending HTTP request will be aborted if the provided context is
  95676. // canceled.
  95677. func (c *OrganizationSecurityPoliciesListAssociationsCall) Context(ctx context.Context) *OrganizationSecurityPoliciesListAssociationsCall {
  95678. c.ctx_ = ctx
  95679. return c
  95680. }
  95681. // Header returns an http.Header that can be modified by the caller to
  95682. // add HTTP headers to the request.
  95683. func (c *OrganizationSecurityPoliciesListAssociationsCall) Header() http.Header {
  95684. if c.header_ == nil {
  95685. c.header_ = make(http.Header)
  95686. }
  95687. return c.header_
  95688. }
  95689. func (c *OrganizationSecurityPoliciesListAssociationsCall) doRequest(alt string) (*http.Response, error) {
  95690. reqHeaders := make(http.Header)
  95691. for k, v := range c.header_ {
  95692. reqHeaders[k] = v
  95693. }
  95694. reqHeaders.Set("User-Agent", c.s.userAgent())
  95695. if c.ifNoneMatch_ != "" {
  95696. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95697. }
  95698. var body io.Reader = nil
  95699. c.urlParams_.Set("alt", alt)
  95700. c.urlParams_.Set("prettyPrint", "false")
  95701. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/listAssociations")
  95702. urls += "?" + c.urlParams_.Encode()
  95703. req, err := http.NewRequest("GET", urls, body)
  95704. if err != nil {
  95705. return nil, err
  95706. }
  95707. req.Header = reqHeaders
  95708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95709. }
  95710. // Do executes the "compute.organizationSecurityPolicies.listAssociations" call.
  95711. // Exactly one of *OrganizationSecurityPoliciesListAssociationsResponse
  95712. // or error will be non-nil. Any non-2xx status code is an error.
  95713. // Response headers are in either
  95714. // *OrganizationSecurityPoliciesListAssociationsResponse.ServerResponse.H
  95715. // eader or (if a response was returned at all) in
  95716. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  95717. // whether the returned error was because http.StatusNotModified was
  95718. // returned.
  95719. func (c *OrganizationSecurityPoliciesListAssociationsCall) Do(opts ...googleapi.CallOption) (*OrganizationSecurityPoliciesListAssociationsResponse, error) {
  95720. gensupport.SetOptions(c.urlParams_, opts...)
  95721. res, err := c.doRequest("json")
  95722. if res != nil && res.StatusCode == http.StatusNotModified {
  95723. if res.Body != nil {
  95724. res.Body.Close()
  95725. }
  95726. return nil, &googleapi.Error{
  95727. Code: res.StatusCode,
  95728. Header: res.Header,
  95729. }
  95730. }
  95731. if err != nil {
  95732. return nil, err
  95733. }
  95734. defer googleapi.CloseBody(res)
  95735. if err := googleapi.CheckResponse(res); err != nil {
  95736. return nil, err
  95737. }
  95738. ret := &OrganizationSecurityPoliciesListAssociationsResponse{
  95739. ServerResponse: googleapi.ServerResponse{
  95740. Header: res.Header,
  95741. HTTPStatusCode: res.StatusCode,
  95742. },
  95743. }
  95744. target := &ret
  95745. if err := gensupport.DecodeResponse(target, res); err != nil {
  95746. return nil, err
  95747. }
  95748. return ret, nil
  95749. // {
  95750. // "description": "Lists associations of a specified target, i.e., organization or folder.",
  95751. // "httpMethod": "GET",
  95752. // "id": "compute.organizationSecurityPolicies.listAssociations",
  95753. // "parameters": {
  95754. // "targetResource": {
  95755. // "description": "The target resource to list associations. It is an organization, or a folder.",
  95756. // "location": "query",
  95757. // "type": "string"
  95758. // }
  95759. // },
  95760. // "path": "locations/global/securityPolicies/listAssociations",
  95761. // "response": {
  95762. // "$ref": "OrganizationSecurityPoliciesListAssociationsResponse"
  95763. // },
  95764. // "scopes": [
  95765. // "https://www.googleapis.com/auth/cloud-platform",
  95766. // "https://www.googleapis.com/auth/compute"
  95767. // ]
  95768. // }
  95769. }
  95770. // method id "compute.organizationSecurityPolicies.move":
  95771. type OrganizationSecurityPoliciesMoveCall struct {
  95772. s *Service
  95773. securityPolicy string
  95774. urlParams_ gensupport.URLParams
  95775. ctx_ context.Context
  95776. header_ http.Header
  95777. }
  95778. // Move: Moves the specified security policy.
  95779. func (r *OrganizationSecurityPoliciesService) Move(securityPolicy string) *OrganizationSecurityPoliciesMoveCall {
  95780. c := &OrganizationSecurityPoliciesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95781. c.securityPolicy = securityPolicy
  95782. return c
  95783. }
  95784. // ParentId sets the optional parameter "parentId": The new parent of
  95785. // the security policy.
  95786. func (c *OrganizationSecurityPoliciesMoveCall) ParentId(parentId string) *OrganizationSecurityPoliciesMoveCall {
  95787. c.urlParams_.Set("parentId", parentId)
  95788. return c
  95789. }
  95790. // RequestId sets the optional parameter "requestId": An optional
  95791. // request ID to identify requests. Specify a unique request ID so that
  95792. // if you must retry your request, the server will know to ignore the
  95793. // request if it has already been completed.
  95794. //
  95795. // For example, consider a situation where you make an initial request
  95796. // and the request times out. If you make the request again with the
  95797. // same request ID, the server can check if original operation with the
  95798. // same request ID was received, and if so, will ignore the second
  95799. // request. This prevents clients from accidentally creating duplicate
  95800. // commitments.
  95801. //
  95802. // The request ID must be a valid UUID with the exception that zero UUID
  95803. // is not supported (00000000-0000-0000-0000-000000000000).
  95804. func (c *OrganizationSecurityPoliciesMoveCall) RequestId(requestId string) *OrganizationSecurityPoliciesMoveCall {
  95805. c.urlParams_.Set("requestId", requestId)
  95806. return c
  95807. }
  95808. // Fields allows partial responses to be retrieved. See
  95809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95810. // for more information.
  95811. func (c *OrganizationSecurityPoliciesMoveCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesMoveCall {
  95812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95813. return c
  95814. }
  95815. // Context sets the context to be used in this call's Do method. Any
  95816. // pending HTTP request will be aborted if the provided context is
  95817. // canceled.
  95818. func (c *OrganizationSecurityPoliciesMoveCall) Context(ctx context.Context) *OrganizationSecurityPoliciesMoveCall {
  95819. c.ctx_ = ctx
  95820. return c
  95821. }
  95822. // Header returns an http.Header that can be modified by the caller to
  95823. // add HTTP headers to the request.
  95824. func (c *OrganizationSecurityPoliciesMoveCall) Header() http.Header {
  95825. if c.header_ == nil {
  95826. c.header_ = make(http.Header)
  95827. }
  95828. return c.header_
  95829. }
  95830. func (c *OrganizationSecurityPoliciesMoveCall) doRequest(alt string) (*http.Response, error) {
  95831. reqHeaders := make(http.Header)
  95832. for k, v := range c.header_ {
  95833. reqHeaders[k] = v
  95834. }
  95835. reqHeaders.Set("User-Agent", c.s.userAgent())
  95836. var body io.Reader = nil
  95837. c.urlParams_.Set("alt", alt)
  95838. c.urlParams_.Set("prettyPrint", "false")
  95839. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/move")
  95840. urls += "?" + c.urlParams_.Encode()
  95841. req, err := http.NewRequest("POST", urls, body)
  95842. if err != nil {
  95843. return nil, err
  95844. }
  95845. req.Header = reqHeaders
  95846. googleapi.Expand(req.URL, map[string]string{
  95847. "securityPolicy": c.securityPolicy,
  95848. })
  95849. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95850. }
  95851. // Do executes the "compute.organizationSecurityPolicies.move" call.
  95852. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95853. // status code is an error. Response headers are in either
  95854. // *Operation.ServerResponse.Header or (if a response was returned at
  95855. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95856. // to check whether the returned error was because
  95857. // http.StatusNotModified was returned.
  95858. func (c *OrganizationSecurityPoliciesMoveCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95859. gensupport.SetOptions(c.urlParams_, opts...)
  95860. res, err := c.doRequest("json")
  95861. if res != nil && res.StatusCode == http.StatusNotModified {
  95862. if res.Body != nil {
  95863. res.Body.Close()
  95864. }
  95865. return nil, &googleapi.Error{
  95866. Code: res.StatusCode,
  95867. Header: res.Header,
  95868. }
  95869. }
  95870. if err != nil {
  95871. return nil, err
  95872. }
  95873. defer googleapi.CloseBody(res)
  95874. if err := googleapi.CheckResponse(res); err != nil {
  95875. return nil, err
  95876. }
  95877. ret := &Operation{
  95878. ServerResponse: googleapi.ServerResponse{
  95879. Header: res.Header,
  95880. HTTPStatusCode: res.StatusCode,
  95881. },
  95882. }
  95883. target := &ret
  95884. if err := gensupport.DecodeResponse(target, res); err != nil {
  95885. return nil, err
  95886. }
  95887. return ret, nil
  95888. // {
  95889. // "description": "Moves the specified security policy.",
  95890. // "httpMethod": "POST",
  95891. // "id": "compute.organizationSecurityPolicies.move",
  95892. // "parameterOrder": [
  95893. // "securityPolicy"
  95894. // ],
  95895. // "parameters": {
  95896. // "parentId": {
  95897. // "description": "The new parent of the security policy.",
  95898. // "location": "query",
  95899. // "type": "string"
  95900. // },
  95901. // "requestId": {
  95902. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95903. // "location": "query",
  95904. // "type": "string"
  95905. // },
  95906. // "securityPolicy": {
  95907. // "description": "Name of the security policy to update.",
  95908. // "location": "path",
  95909. // "pattern": "[0-9]{0,20}",
  95910. // "required": true,
  95911. // "type": "string"
  95912. // }
  95913. // },
  95914. // "path": "locations/global/securityPolicies/{securityPolicy}/move",
  95915. // "response": {
  95916. // "$ref": "Operation"
  95917. // },
  95918. // "scopes": [
  95919. // "https://www.googleapis.com/auth/cloud-platform",
  95920. // "https://www.googleapis.com/auth/compute"
  95921. // ]
  95922. // }
  95923. }
  95924. // method id "compute.organizationSecurityPolicies.patch":
  95925. type OrganizationSecurityPoliciesPatchCall struct {
  95926. s *Service
  95927. securityPolicy string
  95928. securitypolicy *SecurityPolicy
  95929. urlParams_ gensupport.URLParams
  95930. ctx_ context.Context
  95931. header_ http.Header
  95932. }
  95933. // Patch: Patches the specified policy with the data included in the
  95934. // request.
  95935. func (r *OrganizationSecurityPoliciesService) Patch(securityPolicy string, securitypolicy *SecurityPolicy) *OrganizationSecurityPoliciesPatchCall {
  95936. c := &OrganizationSecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95937. c.securityPolicy = securityPolicy
  95938. c.securitypolicy = securitypolicy
  95939. return c
  95940. }
  95941. // RequestId sets the optional parameter "requestId": An optional
  95942. // request ID to identify requests. Specify a unique request ID so that
  95943. // if you must retry your request, the server will know to ignore the
  95944. // request if it has already been completed.
  95945. //
  95946. // For example, consider a situation where you make an initial request
  95947. // and the request times out. If you make the request again with the
  95948. // same request ID, the server can check if original operation with the
  95949. // same request ID was received, and if so, will ignore the second
  95950. // request. This prevents clients from accidentally creating duplicate
  95951. // commitments.
  95952. //
  95953. // The request ID must be a valid UUID with the exception that zero UUID
  95954. // is not supported (00000000-0000-0000-0000-000000000000).
  95955. func (c *OrganizationSecurityPoliciesPatchCall) RequestId(requestId string) *OrganizationSecurityPoliciesPatchCall {
  95956. c.urlParams_.Set("requestId", requestId)
  95957. return c
  95958. }
  95959. // Fields allows partial responses to be retrieved. See
  95960. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95961. // for more information.
  95962. func (c *OrganizationSecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesPatchCall {
  95963. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95964. return c
  95965. }
  95966. // Context sets the context to be used in this call's Do method. Any
  95967. // pending HTTP request will be aborted if the provided context is
  95968. // canceled.
  95969. func (c *OrganizationSecurityPoliciesPatchCall) Context(ctx context.Context) *OrganizationSecurityPoliciesPatchCall {
  95970. c.ctx_ = ctx
  95971. return c
  95972. }
  95973. // Header returns an http.Header that can be modified by the caller to
  95974. // add HTTP headers to the request.
  95975. func (c *OrganizationSecurityPoliciesPatchCall) Header() http.Header {
  95976. if c.header_ == nil {
  95977. c.header_ = make(http.Header)
  95978. }
  95979. return c.header_
  95980. }
  95981. func (c *OrganizationSecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  95982. reqHeaders := make(http.Header)
  95983. for k, v := range c.header_ {
  95984. reqHeaders[k] = v
  95985. }
  95986. reqHeaders.Set("User-Agent", c.s.userAgent())
  95987. var body io.Reader = nil
  95988. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  95989. if err != nil {
  95990. return nil, err
  95991. }
  95992. reqHeaders.Set("Content-Type", "application/json")
  95993. c.urlParams_.Set("alt", alt)
  95994. c.urlParams_.Set("prettyPrint", "false")
  95995. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}")
  95996. urls += "?" + c.urlParams_.Encode()
  95997. req, err := http.NewRequest("PATCH", urls, body)
  95998. if err != nil {
  95999. return nil, err
  96000. }
  96001. req.Header = reqHeaders
  96002. googleapi.Expand(req.URL, map[string]string{
  96003. "securityPolicy": c.securityPolicy,
  96004. })
  96005. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96006. }
  96007. // Do executes the "compute.organizationSecurityPolicies.patch" call.
  96008. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96009. // status code is an error. Response headers are in either
  96010. // *Operation.ServerResponse.Header or (if a response was returned at
  96011. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96012. // to check whether the returned error was because
  96013. // http.StatusNotModified was returned.
  96014. func (c *OrganizationSecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96015. gensupport.SetOptions(c.urlParams_, opts...)
  96016. res, err := c.doRequest("json")
  96017. if res != nil && res.StatusCode == http.StatusNotModified {
  96018. if res.Body != nil {
  96019. res.Body.Close()
  96020. }
  96021. return nil, &googleapi.Error{
  96022. Code: res.StatusCode,
  96023. Header: res.Header,
  96024. }
  96025. }
  96026. if err != nil {
  96027. return nil, err
  96028. }
  96029. defer googleapi.CloseBody(res)
  96030. if err := googleapi.CheckResponse(res); err != nil {
  96031. return nil, err
  96032. }
  96033. ret := &Operation{
  96034. ServerResponse: googleapi.ServerResponse{
  96035. Header: res.Header,
  96036. HTTPStatusCode: res.StatusCode,
  96037. },
  96038. }
  96039. target := &ret
  96040. if err := gensupport.DecodeResponse(target, res); err != nil {
  96041. return nil, err
  96042. }
  96043. return ret, nil
  96044. // {
  96045. // "description": "Patches the specified policy with the data included in the request.",
  96046. // "httpMethod": "PATCH",
  96047. // "id": "compute.organizationSecurityPolicies.patch",
  96048. // "parameterOrder": [
  96049. // "securityPolicy"
  96050. // ],
  96051. // "parameters": {
  96052. // "requestId": {
  96053. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96054. // "location": "query",
  96055. // "type": "string"
  96056. // },
  96057. // "securityPolicy": {
  96058. // "description": "Name of the security policy to update.",
  96059. // "location": "path",
  96060. // "pattern": "[0-9]{0,20}",
  96061. // "required": true,
  96062. // "type": "string"
  96063. // }
  96064. // },
  96065. // "path": "locations/global/securityPolicies/{securityPolicy}",
  96066. // "request": {
  96067. // "$ref": "SecurityPolicy"
  96068. // },
  96069. // "response": {
  96070. // "$ref": "Operation"
  96071. // },
  96072. // "scopes": [
  96073. // "https://www.googleapis.com/auth/cloud-platform",
  96074. // "https://www.googleapis.com/auth/compute"
  96075. // ]
  96076. // }
  96077. }
  96078. // method id "compute.organizationSecurityPolicies.patchRule":
  96079. type OrganizationSecurityPoliciesPatchRuleCall struct {
  96080. s *Service
  96081. securityPolicy string
  96082. securitypolicyrule *SecurityPolicyRule
  96083. urlParams_ gensupport.URLParams
  96084. ctx_ context.Context
  96085. header_ http.Header
  96086. }
  96087. // PatchRule: Patches a rule at the specified priority.
  96088. func (r *OrganizationSecurityPoliciesService) PatchRule(securityPolicy string, securitypolicyrule *SecurityPolicyRule) *OrganizationSecurityPoliciesPatchRuleCall {
  96089. c := &OrganizationSecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96090. c.securityPolicy = securityPolicy
  96091. c.securitypolicyrule = securitypolicyrule
  96092. return c
  96093. }
  96094. // Priority sets the optional parameter "priority": The priority of the
  96095. // rule to patch.
  96096. func (c *OrganizationSecurityPoliciesPatchRuleCall) Priority(priority int64) *OrganizationSecurityPoliciesPatchRuleCall {
  96097. c.urlParams_.Set("priority", fmt.Sprint(priority))
  96098. return c
  96099. }
  96100. // RequestId sets the optional parameter "requestId": An optional
  96101. // request ID to identify requests. Specify a unique request ID so that
  96102. // if you must retry your request, the server will know to ignore the
  96103. // request if it has already been completed.
  96104. //
  96105. // For example, consider a situation where you make an initial request
  96106. // and the request times out. If you make the request again with the
  96107. // same request ID, the server can check if original operation with the
  96108. // same request ID was received, and if so, will ignore the second
  96109. // request. This prevents clients from accidentally creating duplicate
  96110. // commitments.
  96111. //
  96112. // The request ID must be a valid UUID with the exception that zero UUID
  96113. // is not supported (00000000-0000-0000-0000-000000000000).
  96114. func (c *OrganizationSecurityPoliciesPatchRuleCall) RequestId(requestId string) *OrganizationSecurityPoliciesPatchRuleCall {
  96115. c.urlParams_.Set("requestId", requestId)
  96116. return c
  96117. }
  96118. // Fields allows partial responses to be retrieved. See
  96119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96120. // for more information.
  96121. func (c *OrganizationSecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesPatchRuleCall {
  96122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96123. return c
  96124. }
  96125. // Context sets the context to be used in this call's Do method. Any
  96126. // pending HTTP request will be aborted if the provided context is
  96127. // canceled.
  96128. func (c *OrganizationSecurityPoliciesPatchRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesPatchRuleCall {
  96129. c.ctx_ = ctx
  96130. return c
  96131. }
  96132. // Header returns an http.Header that can be modified by the caller to
  96133. // add HTTP headers to the request.
  96134. func (c *OrganizationSecurityPoliciesPatchRuleCall) Header() http.Header {
  96135. if c.header_ == nil {
  96136. c.header_ = make(http.Header)
  96137. }
  96138. return c.header_
  96139. }
  96140. func (c *OrganizationSecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  96141. reqHeaders := make(http.Header)
  96142. for k, v := range c.header_ {
  96143. reqHeaders[k] = v
  96144. }
  96145. reqHeaders.Set("User-Agent", c.s.userAgent())
  96146. var body io.Reader = nil
  96147. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  96148. if err != nil {
  96149. return nil, err
  96150. }
  96151. reqHeaders.Set("Content-Type", "application/json")
  96152. c.urlParams_.Set("alt", alt)
  96153. c.urlParams_.Set("prettyPrint", "false")
  96154. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/patchRule")
  96155. urls += "?" + c.urlParams_.Encode()
  96156. req, err := http.NewRequest("POST", urls, body)
  96157. if err != nil {
  96158. return nil, err
  96159. }
  96160. req.Header = reqHeaders
  96161. googleapi.Expand(req.URL, map[string]string{
  96162. "securityPolicy": c.securityPolicy,
  96163. })
  96164. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96165. }
  96166. // Do executes the "compute.organizationSecurityPolicies.patchRule" call.
  96167. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96168. // status code is an error. Response headers are in either
  96169. // *Operation.ServerResponse.Header or (if a response was returned at
  96170. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96171. // to check whether the returned error was because
  96172. // http.StatusNotModified was returned.
  96173. func (c *OrganizationSecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96174. gensupport.SetOptions(c.urlParams_, opts...)
  96175. res, err := c.doRequest("json")
  96176. if res != nil && res.StatusCode == http.StatusNotModified {
  96177. if res.Body != nil {
  96178. res.Body.Close()
  96179. }
  96180. return nil, &googleapi.Error{
  96181. Code: res.StatusCode,
  96182. Header: res.Header,
  96183. }
  96184. }
  96185. if err != nil {
  96186. return nil, err
  96187. }
  96188. defer googleapi.CloseBody(res)
  96189. if err := googleapi.CheckResponse(res); err != nil {
  96190. return nil, err
  96191. }
  96192. ret := &Operation{
  96193. ServerResponse: googleapi.ServerResponse{
  96194. Header: res.Header,
  96195. HTTPStatusCode: res.StatusCode,
  96196. },
  96197. }
  96198. target := &ret
  96199. if err := gensupport.DecodeResponse(target, res); err != nil {
  96200. return nil, err
  96201. }
  96202. return ret, nil
  96203. // {
  96204. // "description": "Patches a rule at the specified priority.",
  96205. // "httpMethod": "POST",
  96206. // "id": "compute.organizationSecurityPolicies.patchRule",
  96207. // "parameterOrder": [
  96208. // "securityPolicy"
  96209. // ],
  96210. // "parameters": {
  96211. // "priority": {
  96212. // "description": "The priority of the rule to patch.",
  96213. // "format": "int32",
  96214. // "location": "query",
  96215. // "type": "integer"
  96216. // },
  96217. // "requestId": {
  96218. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96219. // "location": "query",
  96220. // "type": "string"
  96221. // },
  96222. // "securityPolicy": {
  96223. // "description": "Name of the security policy to update.",
  96224. // "location": "path",
  96225. // "pattern": "[0-9]{0,20}",
  96226. // "required": true,
  96227. // "type": "string"
  96228. // }
  96229. // },
  96230. // "path": "locations/global/securityPolicies/{securityPolicy}/patchRule",
  96231. // "request": {
  96232. // "$ref": "SecurityPolicyRule"
  96233. // },
  96234. // "response": {
  96235. // "$ref": "Operation"
  96236. // },
  96237. // "scopes": [
  96238. // "https://www.googleapis.com/auth/cloud-platform",
  96239. // "https://www.googleapis.com/auth/compute"
  96240. // ]
  96241. // }
  96242. }
  96243. // method id "compute.organizationSecurityPolicies.removeAssociation":
  96244. type OrganizationSecurityPoliciesRemoveAssociationCall struct {
  96245. s *Service
  96246. securityPolicy string
  96247. urlParams_ gensupport.URLParams
  96248. ctx_ context.Context
  96249. header_ http.Header
  96250. }
  96251. // RemoveAssociation: Removes an association for the specified security
  96252. // policy.
  96253. func (r *OrganizationSecurityPoliciesService) RemoveAssociation(securityPolicy string) *OrganizationSecurityPoliciesRemoveAssociationCall {
  96254. c := &OrganizationSecurityPoliciesRemoveAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96255. c.securityPolicy = securityPolicy
  96256. return c
  96257. }
  96258. // Name sets the optional parameter "name": Name for the attachment that
  96259. // will be removed.
  96260. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Name(name string) *OrganizationSecurityPoliciesRemoveAssociationCall {
  96261. c.urlParams_.Set("name", name)
  96262. return c
  96263. }
  96264. // RequestId sets the optional parameter "requestId": An optional
  96265. // request ID to identify requests. Specify a unique request ID so that
  96266. // if you must retry your request, the server will know to ignore the
  96267. // request if it has already been completed.
  96268. //
  96269. // For example, consider a situation where you make an initial request
  96270. // and the request times out. If you make the request again with the
  96271. // same request ID, the server can check if original operation with the
  96272. // same request ID was received, and if so, will ignore the second
  96273. // request. This prevents clients from accidentally creating duplicate
  96274. // commitments.
  96275. //
  96276. // The request ID must be a valid UUID with the exception that zero UUID
  96277. // is not supported (00000000-0000-0000-0000-000000000000).
  96278. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) RequestId(requestId string) *OrganizationSecurityPoliciesRemoveAssociationCall {
  96279. c.urlParams_.Set("requestId", requestId)
  96280. return c
  96281. }
  96282. // Fields allows partial responses to be retrieved. See
  96283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96284. // for more information.
  96285. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesRemoveAssociationCall {
  96286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96287. return c
  96288. }
  96289. // Context sets the context to be used in this call's Do method. Any
  96290. // pending HTTP request will be aborted if the provided context is
  96291. // canceled.
  96292. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Context(ctx context.Context) *OrganizationSecurityPoliciesRemoveAssociationCall {
  96293. c.ctx_ = ctx
  96294. return c
  96295. }
  96296. // Header returns an http.Header that can be modified by the caller to
  96297. // add HTTP headers to the request.
  96298. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Header() http.Header {
  96299. if c.header_ == nil {
  96300. c.header_ = make(http.Header)
  96301. }
  96302. return c.header_
  96303. }
  96304. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) {
  96305. reqHeaders := make(http.Header)
  96306. for k, v := range c.header_ {
  96307. reqHeaders[k] = v
  96308. }
  96309. reqHeaders.Set("User-Agent", c.s.userAgent())
  96310. var body io.Reader = nil
  96311. c.urlParams_.Set("alt", alt)
  96312. c.urlParams_.Set("prettyPrint", "false")
  96313. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/removeAssociation")
  96314. urls += "?" + c.urlParams_.Encode()
  96315. req, err := http.NewRequest("POST", urls, body)
  96316. if err != nil {
  96317. return nil, err
  96318. }
  96319. req.Header = reqHeaders
  96320. googleapi.Expand(req.URL, map[string]string{
  96321. "securityPolicy": c.securityPolicy,
  96322. })
  96323. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96324. }
  96325. // Do executes the "compute.organizationSecurityPolicies.removeAssociation" call.
  96326. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96327. // status code is an error. Response headers are in either
  96328. // *Operation.ServerResponse.Header or (if a response was returned at
  96329. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96330. // to check whether the returned error was because
  96331. // http.StatusNotModified was returned.
  96332. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96333. gensupport.SetOptions(c.urlParams_, opts...)
  96334. res, err := c.doRequest("json")
  96335. if res != nil && res.StatusCode == http.StatusNotModified {
  96336. if res.Body != nil {
  96337. res.Body.Close()
  96338. }
  96339. return nil, &googleapi.Error{
  96340. Code: res.StatusCode,
  96341. Header: res.Header,
  96342. }
  96343. }
  96344. if err != nil {
  96345. return nil, err
  96346. }
  96347. defer googleapi.CloseBody(res)
  96348. if err := googleapi.CheckResponse(res); err != nil {
  96349. return nil, err
  96350. }
  96351. ret := &Operation{
  96352. ServerResponse: googleapi.ServerResponse{
  96353. Header: res.Header,
  96354. HTTPStatusCode: res.StatusCode,
  96355. },
  96356. }
  96357. target := &ret
  96358. if err := gensupport.DecodeResponse(target, res); err != nil {
  96359. return nil, err
  96360. }
  96361. return ret, nil
  96362. // {
  96363. // "description": "Removes an association for the specified security policy.",
  96364. // "httpMethod": "POST",
  96365. // "id": "compute.organizationSecurityPolicies.removeAssociation",
  96366. // "parameterOrder": [
  96367. // "securityPolicy"
  96368. // ],
  96369. // "parameters": {
  96370. // "name": {
  96371. // "description": "Name for the attachment that will be removed.",
  96372. // "location": "query",
  96373. // "type": "string"
  96374. // },
  96375. // "requestId": {
  96376. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96377. // "location": "query",
  96378. // "type": "string"
  96379. // },
  96380. // "securityPolicy": {
  96381. // "description": "Name of the security policy to update.",
  96382. // "location": "path",
  96383. // "pattern": "[0-9]{0,20}",
  96384. // "required": true,
  96385. // "type": "string"
  96386. // }
  96387. // },
  96388. // "path": "locations/global/securityPolicies/{securityPolicy}/removeAssociation",
  96389. // "response": {
  96390. // "$ref": "Operation"
  96391. // },
  96392. // "scopes": [
  96393. // "https://www.googleapis.com/auth/cloud-platform",
  96394. // "https://www.googleapis.com/auth/compute"
  96395. // ]
  96396. // }
  96397. }
  96398. // method id "compute.organizationSecurityPolicies.removeRule":
  96399. type OrganizationSecurityPoliciesRemoveRuleCall struct {
  96400. s *Service
  96401. securityPolicy string
  96402. urlParams_ gensupport.URLParams
  96403. ctx_ context.Context
  96404. header_ http.Header
  96405. }
  96406. // RemoveRule: Deletes a rule at the specified priority.
  96407. func (r *OrganizationSecurityPoliciesService) RemoveRule(securityPolicy string) *OrganizationSecurityPoliciesRemoveRuleCall {
  96408. c := &OrganizationSecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96409. c.securityPolicy = securityPolicy
  96410. return c
  96411. }
  96412. // Priority sets the optional parameter "priority": The priority of the
  96413. // rule to remove from the security policy.
  96414. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Priority(priority int64) *OrganizationSecurityPoliciesRemoveRuleCall {
  96415. c.urlParams_.Set("priority", fmt.Sprint(priority))
  96416. return c
  96417. }
  96418. // RequestId sets the optional parameter "requestId": An optional
  96419. // request ID to identify requests. Specify a unique request ID so that
  96420. // if you must retry your request, the server will know to ignore the
  96421. // request if it has already been completed.
  96422. //
  96423. // For example, consider a situation where you make an initial request
  96424. // and the request times out. If you make the request again with the
  96425. // same request ID, the server can check if original operation with the
  96426. // same request ID was received, and if so, will ignore the second
  96427. // request. This prevents clients from accidentally creating duplicate
  96428. // commitments.
  96429. //
  96430. // The request ID must be a valid UUID with the exception that zero UUID
  96431. // is not supported (00000000-0000-0000-0000-000000000000).
  96432. func (c *OrganizationSecurityPoliciesRemoveRuleCall) RequestId(requestId string) *OrganizationSecurityPoliciesRemoveRuleCall {
  96433. c.urlParams_.Set("requestId", requestId)
  96434. return c
  96435. }
  96436. // Fields allows partial responses to be retrieved. See
  96437. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96438. // for more information.
  96439. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesRemoveRuleCall {
  96440. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96441. return c
  96442. }
  96443. // Context sets the context to be used in this call's Do method. Any
  96444. // pending HTTP request will be aborted if the provided context is
  96445. // canceled.
  96446. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesRemoveRuleCall {
  96447. c.ctx_ = ctx
  96448. return c
  96449. }
  96450. // Header returns an http.Header that can be modified by the caller to
  96451. // add HTTP headers to the request.
  96452. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Header() http.Header {
  96453. if c.header_ == nil {
  96454. c.header_ = make(http.Header)
  96455. }
  96456. return c.header_
  96457. }
  96458. func (c *OrganizationSecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  96459. reqHeaders := make(http.Header)
  96460. for k, v := range c.header_ {
  96461. reqHeaders[k] = v
  96462. }
  96463. reqHeaders.Set("User-Agent", c.s.userAgent())
  96464. var body io.Reader = nil
  96465. c.urlParams_.Set("alt", alt)
  96466. c.urlParams_.Set("prettyPrint", "false")
  96467. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/removeRule")
  96468. urls += "?" + c.urlParams_.Encode()
  96469. req, err := http.NewRequest("POST", urls, body)
  96470. if err != nil {
  96471. return nil, err
  96472. }
  96473. req.Header = reqHeaders
  96474. googleapi.Expand(req.URL, map[string]string{
  96475. "securityPolicy": c.securityPolicy,
  96476. })
  96477. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96478. }
  96479. // Do executes the "compute.organizationSecurityPolicies.removeRule" call.
  96480. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96481. // status code is an error. Response headers are in either
  96482. // *Operation.ServerResponse.Header or (if a response was returned at
  96483. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96484. // to check whether the returned error was because
  96485. // http.StatusNotModified was returned.
  96486. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96487. gensupport.SetOptions(c.urlParams_, opts...)
  96488. res, err := c.doRequest("json")
  96489. if res != nil && res.StatusCode == http.StatusNotModified {
  96490. if res.Body != nil {
  96491. res.Body.Close()
  96492. }
  96493. return nil, &googleapi.Error{
  96494. Code: res.StatusCode,
  96495. Header: res.Header,
  96496. }
  96497. }
  96498. if err != nil {
  96499. return nil, err
  96500. }
  96501. defer googleapi.CloseBody(res)
  96502. if err := googleapi.CheckResponse(res); err != nil {
  96503. return nil, err
  96504. }
  96505. ret := &Operation{
  96506. ServerResponse: googleapi.ServerResponse{
  96507. Header: res.Header,
  96508. HTTPStatusCode: res.StatusCode,
  96509. },
  96510. }
  96511. target := &ret
  96512. if err := gensupport.DecodeResponse(target, res); err != nil {
  96513. return nil, err
  96514. }
  96515. return ret, nil
  96516. // {
  96517. // "description": "Deletes a rule at the specified priority.",
  96518. // "httpMethod": "POST",
  96519. // "id": "compute.organizationSecurityPolicies.removeRule",
  96520. // "parameterOrder": [
  96521. // "securityPolicy"
  96522. // ],
  96523. // "parameters": {
  96524. // "priority": {
  96525. // "description": "The priority of the rule to remove from the security policy.",
  96526. // "format": "int32",
  96527. // "location": "query",
  96528. // "type": "integer"
  96529. // },
  96530. // "requestId": {
  96531. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96532. // "location": "query",
  96533. // "type": "string"
  96534. // },
  96535. // "securityPolicy": {
  96536. // "description": "Name of the security policy to update.",
  96537. // "location": "path",
  96538. // "pattern": "[0-9]{0,20}",
  96539. // "required": true,
  96540. // "type": "string"
  96541. // }
  96542. // },
  96543. // "path": "locations/global/securityPolicies/{securityPolicy}/removeRule",
  96544. // "response": {
  96545. // "$ref": "Operation"
  96546. // },
  96547. // "scopes": [
  96548. // "https://www.googleapis.com/auth/cloud-platform",
  96549. // "https://www.googleapis.com/auth/compute"
  96550. // ]
  96551. // }
  96552. }
  96553. // method id "compute.projects.disableXpnHost":
  96554. type ProjectsDisableXpnHostCall struct {
  96555. s *Service
  96556. project string
  96557. urlParams_ gensupport.URLParams
  96558. ctx_ context.Context
  96559. header_ http.Header
  96560. }
  96561. // DisableXpnHost: Disable this project as a shared VPC host project.
  96562. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  96563. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96564. c.project = project
  96565. return c
  96566. }
  96567. // RequestId sets the optional parameter "requestId": An optional
  96568. // request ID to identify requests. Specify a unique request ID so that
  96569. // if you must retry your request, the server will know to ignore the
  96570. // request if it has already been completed.
  96571. //
  96572. // For example, consider a situation where you make an initial request
  96573. // and the request times out. If you make the request again with the
  96574. // same request ID, the server can check if original operation with the
  96575. // same request ID was received, and if so, will ignore the second
  96576. // request. This prevents clients from accidentally creating duplicate
  96577. // commitments.
  96578. //
  96579. // The request ID must be a valid UUID with the exception that zero UUID
  96580. // is not supported (00000000-0000-0000-0000-000000000000).
  96581. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  96582. c.urlParams_.Set("requestId", requestId)
  96583. return c
  96584. }
  96585. // Fields allows partial responses to be retrieved. See
  96586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96587. // for more information.
  96588. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  96589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96590. return c
  96591. }
  96592. // Context sets the context to be used in this call's Do method. Any
  96593. // pending HTTP request will be aborted if the provided context is
  96594. // canceled.
  96595. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  96596. c.ctx_ = ctx
  96597. return c
  96598. }
  96599. // Header returns an http.Header that can be modified by the caller to
  96600. // add HTTP headers to the request.
  96601. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  96602. if c.header_ == nil {
  96603. c.header_ = make(http.Header)
  96604. }
  96605. return c.header_
  96606. }
  96607. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  96608. reqHeaders := make(http.Header)
  96609. for k, v := range c.header_ {
  96610. reqHeaders[k] = v
  96611. }
  96612. reqHeaders.Set("User-Agent", c.s.userAgent())
  96613. var body io.Reader = nil
  96614. c.urlParams_.Set("alt", alt)
  96615. c.urlParams_.Set("prettyPrint", "false")
  96616. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  96617. urls += "?" + c.urlParams_.Encode()
  96618. req, err := http.NewRequest("POST", urls, body)
  96619. if err != nil {
  96620. return nil, err
  96621. }
  96622. req.Header = reqHeaders
  96623. googleapi.Expand(req.URL, map[string]string{
  96624. "project": c.project,
  96625. })
  96626. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96627. }
  96628. // Do executes the "compute.projects.disableXpnHost" call.
  96629. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96630. // status code is an error. Response headers are in either
  96631. // *Operation.ServerResponse.Header or (if a response was returned at
  96632. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96633. // to check whether the returned error was because
  96634. // http.StatusNotModified was returned.
  96635. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96636. gensupport.SetOptions(c.urlParams_, opts...)
  96637. res, err := c.doRequest("json")
  96638. if res != nil && res.StatusCode == http.StatusNotModified {
  96639. if res.Body != nil {
  96640. res.Body.Close()
  96641. }
  96642. return nil, &googleapi.Error{
  96643. Code: res.StatusCode,
  96644. Header: res.Header,
  96645. }
  96646. }
  96647. if err != nil {
  96648. return nil, err
  96649. }
  96650. defer googleapi.CloseBody(res)
  96651. if err := googleapi.CheckResponse(res); err != nil {
  96652. return nil, err
  96653. }
  96654. ret := &Operation{
  96655. ServerResponse: googleapi.ServerResponse{
  96656. Header: res.Header,
  96657. HTTPStatusCode: res.StatusCode,
  96658. },
  96659. }
  96660. target := &ret
  96661. if err := gensupport.DecodeResponse(target, res); err != nil {
  96662. return nil, err
  96663. }
  96664. return ret, nil
  96665. // {
  96666. // "description": "Disable this project as a shared VPC host project.",
  96667. // "httpMethod": "POST",
  96668. // "id": "compute.projects.disableXpnHost",
  96669. // "parameterOrder": [
  96670. // "project"
  96671. // ],
  96672. // "parameters": {
  96673. // "project": {
  96674. // "description": "Project ID for this request.",
  96675. // "location": "path",
  96676. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96677. // "required": true,
  96678. // "type": "string"
  96679. // },
  96680. // "requestId": {
  96681. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96682. // "location": "query",
  96683. // "type": "string"
  96684. // }
  96685. // },
  96686. // "path": "{project}/disableXpnHost",
  96687. // "response": {
  96688. // "$ref": "Operation"
  96689. // },
  96690. // "scopes": [
  96691. // "https://www.googleapis.com/auth/cloud-platform",
  96692. // "https://www.googleapis.com/auth/compute"
  96693. // ]
  96694. // }
  96695. }
  96696. // method id "compute.projects.disableXpnResource":
  96697. type ProjectsDisableXpnResourceCall struct {
  96698. s *Service
  96699. project string
  96700. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  96701. urlParams_ gensupport.URLParams
  96702. ctx_ context.Context
  96703. header_ http.Header
  96704. }
  96705. // DisableXpnResource: Disable a serivce resource (a.k.a service
  96706. // project) associated with this host project.
  96707. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  96708. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96709. c.project = project
  96710. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  96711. return c
  96712. }
  96713. // RequestId sets the optional parameter "requestId": An optional
  96714. // request ID to identify requests. Specify a unique request ID so that
  96715. // if you must retry your request, the server will know to ignore the
  96716. // request if it has already been completed.
  96717. //
  96718. // For example, consider a situation where you make an initial request
  96719. // and the request times out. If you make the request again with the
  96720. // same request ID, the server can check if original operation with the
  96721. // same request ID was received, and if so, will ignore the second
  96722. // request. This prevents clients from accidentally creating duplicate
  96723. // commitments.
  96724. //
  96725. // The request ID must be a valid UUID with the exception that zero UUID
  96726. // is not supported (00000000-0000-0000-0000-000000000000).
  96727. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  96728. c.urlParams_.Set("requestId", requestId)
  96729. return c
  96730. }
  96731. // Fields allows partial responses to be retrieved. See
  96732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96733. // for more information.
  96734. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  96735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96736. return c
  96737. }
  96738. // Context sets the context to be used in this call's Do method. Any
  96739. // pending HTTP request will be aborted if the provided context is
  96740. // canceled.
  96741. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  96742. c.ctx_ = ctx
  96743. return c
  96744. }
  96745. // Header returns an http.Header that can be modified by the caller to
  96746. // add HTTP headers to the request.
  96747. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  96748. if c.header_ == nil {
  96749. c.header_ = make(http.Header)
  96750. }
  96751. return c.header_
  96752. }
  96753. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  96754. reqHeaders := make(http.Header)
  96755. for k, v := range c.header_ {
  96756. reqHeaders[k] = v
  96757. }
  96758. reqHeaders.Set("User-Agent", c.s.userAgent())
  96759. var body io.Reader = nil
  96760. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  96761. if err != nil {
  96762. return nil, err
  96763. }
  96764. reqHeaders.Set("Content-Type", "application/json")
  96765. c.urlParams_.Set("alt", alt)
  96766. c.urlParams_.Set("prettyPrint", "false")
  96767. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  96768. urls += "?" + c.urlParams_.Encode()
  96769. req, err := http.NewRequest("POST", urls, body)
  96770. if err != nil {
  96771. return nil, err
  96772. }
  96773. req.Header = reqHeaders
  96774. googleapi.Expand(req.URL, map[string]string{
  96775. "project": c.project,
  96776. })
  96777. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96778. }
  96779. // Do executes the "compute.projects.disableXpnResource" call.
  96780. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96781. // status code is an error. Response headers are in either
  96782. // *Operation.ServerResponse.Header or (if a response was returned at
  96783. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96784. // to check whether the returned error was because
  96785. // http.StatusNotModified was returned.
  96786. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96787. gensupport.SetOptions(c.urlParams_, opts...)
  96788. res, err := c.doRequest("json")
  96789. if res != nil && res.StatusCode == http.StatusNotModified {
  96790. if res.Body != nil {
  96791. res.Body.Close()
  96792. }
  96793. return nil, &googleapi.Error{
  96794. Code: res.StatusCode,
  96795. Header: res.Header,
  96796. }
  96797. }
  96798. if err != nil {
  96799. return nil, err
  96800. }
  96801. defer googleapi.CloseBody(res)
  96802. if err := googleapi.CheckResponse(res); err != nil {
  96803. return nil, err
  96804. }
  96805. ret := &Operation{
  96806. ServerResponse: googleapi.ServerResponse{
  96807. Header: res.Header,
  96808. HTTPStatusCode: res.StatusCode,
  96809. },
  96810. }
  96811. target := &ret
  96812. if err := gensupport.DecodeResponse(target, res); err != nil {
  96813. return nil, err
  96814. }
  96815. return ret, nil
  96816. // {
  96817. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  96818. // "httpMethod": "POST",
  96819. // "id": "compute.projects.disableXpnResource",
  96820. // "parameterOrder": [
  96821. // "project"
  96822. // ],
  96823. // "parameters": {
  96824. // "project": {
  96825. // "description": "Project ID for this request.",
  96826. // "location": "path",
  96827. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96828. // "required": true,
  96829. // "type": "string"
  96830. // },
  96831. // "requestId": {
  96832. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96833. // "location": "query",
  96834. // "type": "string"
  96835. // }
  96836. // },
  96837. // "path": "{project}/disableXpnResource",
  96838. // "request": {
  96839. // "$ref": "ProjectsDisableXpnResourceRequest"
  96840. // },
  96841. // "response": {
  96842. // "$ref": "Operation"
  96843. // },
  96844. // "scopes": [
  96845. // "https://www.googleapis.com/auth/cloud-platform",
  96846. // "https://www.googleapis.com/auth/compute"
  96847. // ]
  96848. // }
  96849. }
  96850. // method id "compute.projects.enableXpnHost":
  96851. type ProjectsEnableXpnHostCall struct {
  96852. s *Service
  96853. project string
  96854. urlParams_ gensupport.URLParams
  96855. ctx_ context.Context
  96856. header_ http.Header
  96857. }
  96858. // EnableXpnHost: Enable this project as a shared VPC host project.
  96859. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  96860. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96861. c.project = project
  96862. return c
  96863. }
  96864. // RequestId sets the optional parameter "requestId": An optional
  96865. // request ID to identify requests. Specify a unique request ID so that
  96866. // if you must retry your request, the server will know to ignore the
  96867. // request if it has already been completed.
  96868. //
  96869. // For example, consider a situation where you make an initial request
  96870. // and the request times out. If you make the request again with the
  96871. // same request ID, the server can check if original operation with the
  96872. // same request ID was received, and if so, will ignore the second
  96873. // request. This prevents clients from accidentally creating duplicate
  96874. // commitments.
  96875. //
  96876. // The request ID must be a valid UUID with the exception that zero UUID
  96877. // is not supported (00000000-0000-0000-0000-000000000000).
  96878. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  96879. c.urlParams_.Set("requestId", requestId)
  96880. return c
  96881. }
  96882. // Fields allows partial responses to be retrieved. See
  96883. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96884. // for more information.
  96885. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  96886. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96887. return c
  96888. }
  96889. // Context sets the context to be used in this call's Do method. Any
  96890. // pending HTTP request will be aborted if the provided context is
  96891. // canceled.
  96892. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  96893. c.ctx_ = ctx
  96894. return c
  96895. }
  96896. // Header returns an http.Header that can be modified by the caller to
  96897. // add HTTP headers to the request.
  96898. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  96899. if c.header_ == nil {
  96900. c.header_ = make(http.Header)
  96901. }
  96902. return c.header_
  96903. }
  96904. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  96905. reqHeaders := make(http.Header)
  96906. for k, v := range c.header_ {
  96907. reqHeaders[k] = v
  96908. }
  96909. reqHeaders.Set("User-Agent", c.s.userAgent())
  96910. var body io.Reader = nil
  96911. c.urlParams_.Set("alt", alt)
  96912. c.urlParams_.Set("prettyPrint", "false")
  96913. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  96914. urls += "?" + c.urlParams_.Encode()
  96915. req, err := http.NewRequest("POST", urls, body)
  96916. if err != nil {
  96917. return nil, err
  96918. }
  96919. req.Header = reqHeaders
  96920. googleapi.Expand(req.URL, map[string]string{
  96921. "project": c.project,
  96922. })
  96923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96924. }
  96925. // Do executes the "compute.projects.enableXpnHost" call.
  96926. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96927. // status code is an error. Response headers are in either
  96928. // *Operation.ServerResponse.Header or (if a response was returned at
  96929. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96930. // to check whether the returned error was because
  96931. // http.StatusNotModified was returned.
  96932. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96933. gensupport.SetOptions(c.urlParams_, opts...)
  96934. res, err := c.doRequest("json")
  96935. if res != nil && res.StatusCode == http.StatusNotModified {
  96936. if res.Body != nil {
  96937. res.Body.Close()
  96938. }
  96939. return nil, &googleapi.Error{
  96940. Code: res.StatusCode,
  96941. Header: res.Header,
  96942. }
  96943. }
  96944. if err != nil {
  96945. return nil, err
  96946. }
  96947. defer googleapi.CloseBody(res)
  96948. if err := googleapi.CheckResponse(res); err != nil {
  96949. return nil, err
  96950. }
  96951. ret := &Operation{
  96952. ServerResponse: googleapi.ServerResponse{
  96953. Header: res.Header,
  96954. HTTPStatusCode: res.StatusCode,
  96955. },
  96956. }
  96957. target := &ret
  96958. if err := gensupport.DecodeResponse(target, res); err != nil {
  96959. return nil, err
  96960. }
  96961. return ret, nil
  96962. // {
  96963. // "description": "Enable this project as a shared VPC host project.",
  96964. // "httpMethod": "POST",
  96965. // "id": "compute.projects.enableXpnHost",
  96966. // "parameterOrder": [
  96967. // "project"
  96968. // ],
  96969. // "parameters": {
  96970. // "project": {
  96971. // "description": "Project ID for this request.",
  96972. // "location": "path",
  96973. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96974. // "required": true,
  96975. // "type": "string"
  96976. // },
  96977. // "requestId": {
  96978. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96979. // "location": "query",
  96980. // "type": "string"
  96981. // }
  96982. // },
  96983. // "path": "{project}/enableXpnHost",
  96984. // "response": {
  96985. // "$ref": "Operation"
  96986. // },
  96987. // "scopes": [
  96988. // "https://www.googleapis.com/auth/cloud-platform",
  96989. // "https://www.googleapis.com/auth/compute"
  96990. // ]
  96991. // }
  96992. }
  96993. // method id "compute.projects.enableXpnResource":
  96994. type ProjectsEnableXpnResourceCall struct {
  96995. s *Service
  96996. project string
  96997. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  96998. urlParams_ gensupport.URLParams
  96999. ctx_ context.Context
  97000. header_ http.Header
  97001. }
  97002. // EnableXpnResource: Enable service resource (a.k.a service project)
  97003. // for a host project, so that subnets in the host project can be used
  97004. // by instances in the service project.
  97005. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  97006. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97007. c.project = project
  97008. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  97009. return c
  97010. }
  97011. // RequestId sets the optional parameter "requestId": An optional
  97012. // request ID to identify requests. Specify a unique request ID so that
  97013. // if you must retry your request, the server will know to ignore the
  97014. // request if it has already been completed.
  97015. //
  97016. // For example, consider a situation where you make an initial request
  97017. // and the request times out. If you make the request again with the
  97018. // same request ID, the server can check if original operation with the
  97019. // same request ID was received, and if so, will ignore the second
  97020. // request. This prevents clients from accidentally creating duplicate
  97021. // commitments.
  97022. //
  97023. // The request ID must be a valid UUID with the exception that zero UUID
  97024. // is not supported (00000000-0000-0000-0000-000000000000).
  97025. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  97026. c.urlParams_.Set("requestId", requestId)
  97027. return c
  97028. }
  97029. // Fields allows partial responses to be retrieved. See
  97030. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97031. // for more information.
  97032. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  97033. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97034. return c
  97035. }
  97036. // Context sets the context to be used in this call's Do method. Any
  97037. // pending HTTP request will be aborted if the provided context is
  97038. // canceled.
  97039. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  97040. c.ctx_ = ctx
  97041. return c
  97042. }
  97043. // Header returns an http.Header that can be modified by the caller to
  97044. // add HTTP headers to the request.
  97045. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  97046. if c.header_ == nil {
  97047. c.header_ = make(http.Header)
  97048. }
  97049. return c.header_
  97050. }
  97051. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  97052. reqHeaders := make(http.Header)
  97053. for k, v := range c.header_ {
  97054. reqHeaders[k] = v
  97055. }
  97056. reqHeaders.Set("User-Agent", c.s.userAgent())
  97057. var body io.Reader = nil
  97058. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  97059. if err != nil {
  97060. return nil, err
  97061. }
  97062. reqHeaders.Set("Content-Type", "application/json")
  97063. c.urlParams_.Set("alt", alt)
  97064. c.urlParams_.Set("prettyPrint", "false")
  97065. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  97066. urls += "?" + c.urlParams_.Encode()
  97067. req, err := http.NewRequest("POST", urls, body)
  97068. if err != nil {
  97069. return nil, err
  97070. }
  97071. req.Header = reqHeaders
  97072. googleapi.Expand(req.URL, map[string]string{
  97073. "project": c.project,
  97074. })
  97075. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97076. }
  97077. // Do executes the "compute.projects.enableXpnResource" call.
  97078. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97079. // status code is an error. Response headers are in either
  97080. // *Operation.ServerResponse.Header or (if a response was returned at
  97081. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97082. // to check whether the returned error was because
  97083. // http.StatusNotModified was returned.
  97084. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97085. gensupport.SetOptions(c.urlParams_, opts...)
  97086. res, err := c.doRequest("json")
  97087. if res != nil && res.StatusCode == http.StatusNotModified {
  97088. if res.Body != nil {
  97089. res.Body.Close()
  97090. }
  97091. return nil, &googleapi.Error{
  97092. Code: res.StatusCode,
  97093. Header: res.Header,
  97094. }
  97095. }
  97096. if err != nil {
  97097. return nil, err
  97098. }
  97099. defer googleapi.CloseBody(res)
  97100. if err := googleapi.CheckResponse(res); err != nil {
  97101. return nil, err
  97102. }
  97103. ret := &Operation{
  97104. ServerResponse: googleapi.ServerResponse{
  97105. Header: res.Header,
  97106. HTTPStatusCode: res.StatusCode,
  97107. },
  97108. }
  97109. target := &ret
  97110. if err := gensupport.DecodeResponse(target, res); err != nil {
  97111. return nil, err
  97112. }
  97113. return ret, nil
  97114. // {
  97115. // "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.",
  97116. // "httpMethod": "POST",
  97117. // "id": "compute.projects.enableXpnResource",
  97118. // "parameterOrder": [
  97119. // "project"
  97120. // ],
  97121. // "parameters": {
  97122. // "project": {
  97123. // "description": "Project ID for this request.",
  97124. // "location": "path",
  97125. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97126. // "required": true,
  97127. // "type": "string"
  97128. // },
  97129. // "requestId": {
  97130. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97131. // "location": "query",
  97132. // "type": "string"
  97133. // }
  97134. // },
  97135. // "path": "{project}/enableXpnResource",
  97136. // "request": {
  97137. // "$ref": "ProjectsEnableXpnResourceRequest"
  97138. // },
  97139. // "response": {
  97140. // "$ref": "Operation"
  97141. // },
  97142. // "scopes": [
  97143. // "https://www.googleapis.com/auth/cloud-platform",
  97144. // "https://www.googleapis.com/auth/compute"
  97145. // ]
  97146. // }
  97147. }
  97148. // method id "compute.projects.get":
  97149. type ProjectsGetCall struct {
  97150. s *Service
  97151. project string
  97152. urlParams_ gensupport.URLParams
  97153. ifNoneMatch_ string
  97154. ctx_ context.Context
  97155. header_ http.Header
  97156. }
  97157. // Get: Returns the specified Project resource.
  97158. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  97159. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  97160. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97161. c.project = project
  97162. return c
  97163. }
  97164. // Fields allows partial responses to be retrieved. See
  97165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97166. // for more information.
  97167. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  97168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97169. return c
  97170. }
  97171. // IfNoneMatch sets the optional parameter which makes the operation
  97172. // fail if the object's ETag matches the given value. This is useful for
  97173. // getting updates only after the object has changed since the last
  97174. // request. Use googleapi.IsNotModified to check whether the response
  97175. // error from Do is the result of In-None-Match.
  97176. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  97177. c.ifNoneMatch_ = entityTag
  97178. return c
  97179. }
  97180. // Context sets the context to be used in this call's Do method. Any
  97181. // pending HTTP request will be aborted if the provided context is
  97182. // canceled.
  97183. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  97184. c.ctx_ = ctx
  97185. return c
  97186. }
  97187. // Header returns an http.Header that can be modified by the caller to
  97188. // add HTTP headers to the request.
  97189. func (c *ProjectsGetCall) Header() http.Header {
  97190. if c.header_ == nil {
  97191. c.header_ = make(http.Header)
  97192. }
  97193. return c.header_
  97194. }
  97195. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  97196. reqHeaders := make(http.Header)
  97197. for k, v := range c.header_ {
  97198. reqHeaders[k] = v
  97199. }
  97200. reqHeaders.Set("User-Agent", c.s.userAgent())
  97201. if c.ifNoneMatch_ != "" {
  97202. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97203. }
  97204. var body io.Reader = nil
  97205. c.urlParams_.Set("alt", alt)
  97206. c.urlParams_.Set("prettyPrint", "false")
  97207. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  97208. urls += "?" + c.urlParams_.Encode()
  97209. req, err := http.NewRequest("GET", urls, body)
  97210. if err != nil {
  97211. return nil, err
  97212. }
  97213. req.Header = reqHeaders
  97214. googleapi.Expand(req.URL, map[string]string{
  97215. "project": c.project,
  97216. })
  97217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97218. }
  97219. // Do executes the "compute.projects.get" call.
  97220. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  97221. // code is an error. Response headers are in either
  97222. // *Project.ServerResponse.Header or (if a response was returned at all)
  97223. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  97224. // check whether the returned error was because http.StatusNotModified
  97225. // was returned.
  97226. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  97227. gensupport.SetOptions(c.urlParams_, opts...)
  97228. res, err := c.doRequest("json")
  97229. if res != nil && res.StatusCode == http.StatusNotModified {
  97230. if res.Body != nil {
  97231. res.Body.Close()
  97232. }
  97233. return nil, &googleapi.Error{
  97234. Code: res.StatusCode,
  97235. Header: res.Header,
  97236. }
  97237. }
  97238. if err != nil {
  97239. return nil, err
  97240. }
  97241. defer googleapi.CloseBody(res)
  97242. if err := googleapi.CheckResponse(res); err != nil {
  97243. return nil, err
  97244. }
  97245. ret := &Project{
  97246. ServerResponse: googleapi.ServerResponse{
  97247. Header: res.Header,
  97248. HTTPStatusCode: res.StatusCode,
  97249. },
  97250. }
  97251. target := &ret
  97252. if err := gensupport.DecodeResponse(target, res); err != nil {
  97253. return nil, err
  97254. }
  97255. return ret, nil
  97256. // {
  97257. // "description": "Returns the specified Project resource.",
  97258. // "httpMethod": "GET",
  97259. // "id": "compute.projects.get",
  97260. // "parameterOrder": [
  97261. // "project"
  97262. // ],
  97263. // "parameters": {
  97264. // "project": {
  97265. // "description": "Project ID for this request.",
  97266. // "location": "path",
  97267. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97268. // "required": true,
  97269. // "type": "string"
  97270. // }
  97271. // },
  97272. // "path": "{project}",
  97273. // "response": {
  97274. // "$ref": "Project"
  97275. // },
  97276. // "scopes": [
  97277. // "https://www.googleapis.com/auth/cloud-platform",
  97278. // "https://www.googleapis.com/auth/compute",
  97279. // "https://www.googleapis.com/auth/compute.readonly"
  97280. // ]
  97281. // }
  97282. }
  97283. // method id "compute.projects.getXpnHost":
  97284. type ProjectsGetXpnHostCall struct {
  97285. s *Service
  97286. project string
  97287. urlParams_ gensupport.URLParams
  97288. ifNoneMatch_ string
  97289. ctx_ context.Context
  97290. header_ http.Header
  97291. }
  97292. // GetXpnHost: Gets the shared VPC host project that this project links
  97293. // to. May be empty if no link exists.
  97294. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  97295. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97296. c.project = project
  97297. return c
  97298. }
  97299. // Fields allows partial responses to be retrieved. See
  97300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97301. // for more information.
  97302. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  97303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97304. return c
  97305. }
  97306. // IfNoneMatch sets the optional parameter which makes the operation
  97307. // fail if the object's ETag matches the given value. This is useful for
  97308. // getting updates only after the object has changed since the last
  97309. // request. Use googleapi.IsNotModified to check whether the response
  97310. // error from Do is the result of In-None-Match.
  97311. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  97312. c.ifNoneMatch_ = entityTag
  97313. return c
  97314. }
  97315. // Context sets the context to be used in this call's Do method. Any
  97316. // pending HTTP request will be aborted if the provided context is
  97317. // canceled.
  97318. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  97319. c.ctx_ = ctx
  97320. return c
  97321. }
  97322. // Header returns an http.Header that can be modified by the caller to
  97323. // add HTTP headers to the request.
  97324. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  97325. if c.header_ == nil {
  97326. c.header_ = make(http.Header)
  97327. }
  97328. return c.header_
  97329. }
  97330. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  97331. reqHeaders := make(http.Header)
  97332. for k, v := range c.header_ {
  97333. reqHeaders[k] = v
  97334. }
  97335. reqHeaders.Set("User-Agent", c.s.userAgent())
  97336. if c.ifNoneMatch_ != "" {
  97337. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97338. }
  97339. var body io.Reader = nil
  97340. c.urlParams_.Set("alt", alt)
  97341. c.urlParams_.Set("prettyPrint", "false")
  97342. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  97343. urls += "?" + c.urlParams_.Encode()
  97344. req, err := http.NewRequest("GET", urls, body)
  97345. if err != nil {
  97346. return nil, err
  97347. }
  97348. req.Header = reqHeaders
  97349. googleapi.Expand(req.URL, map[string]string{
  97350. "project": c.project,
  97351. })
  97352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97353. }
  97354. // Do executes the "compute.projects.getXpnHost" call.
  97355. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  97356. // code is an error. Response headers are in either
  97357. // *Project.ServerResponse.Header or (if a response was returned at all)
  97358. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  97359. // check whether the returned error was because http.StatusNotModified
  97360. // was returned.
  97361. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  97362. gensupport.SetOptions(c.urlParams_, opts...)
  97363. res, err := c.doRequest("json")
  97364. if res != nil && res.StatusCode == http.StatusNotModified {
  97365. if res.Body != nil {
  97366. res.Body.Close()
  97367. }
  97368. return nil, &googleapi.Error{
  97369. Code: res.StatusCode,
  97370. Header: res.Header,
  97371. }
  97372. }
  97373. if err != nil {
  97374. return nil, err
  97375. }
  97376. defer googleapi.CloseBody(res)
  97377. if err := googleapi.CheckResponse(res); err != nil {
  97378. return nil, err
  97379. }
  97380. ret := &Project{
  97381. ServerResponse: googleapi.ServerResponse{
  97382. Header: res.Header,
  97383. HTTPStatusCode: res.StatusCode,
  97384. },
  97385. }
  97386. target := &ret
  97387. if err := gensupport.DecodeResponse(target, res); err != nil {
  97388. return nil, err
  97389. }
  97390. return ret, nil
  97391. // {
  97392. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  97393. // "httpMethod": "GET",
  97394. // "id": "compute.projects.getXpnHost",
  97395. // "parameterOrder": [
  97396. // "project"
  97397. // ],
  97398. // "parameters": {
  97399. // "project": {
  97400. // "description": "Project ID for this request.",
  97401. // "location": "path",
  97402. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97403. // "required": true,
  97404. // "type": "string"
  97405. // }
  97406. // },
  97407. // "path": "{project}/getXpnHost",
  97408. // "response": {
  97409. // "$ref": "Project"
  97410. // },
  97411. // "scopes": [
  97412. // "https://www.googleapis.com/auth/cloud-platform",
  97413. // "https://www.googleapis.com/auth/compute"
  97414. // ]
  97415. // }
  97416. }
  97417. // method id "compute.projects.getXpnResources":
  97418. type ProjectsGetXpnResourcesCall struct {
  97419. s *Service
  97420. project string
  97421. urlParams_ gensupport.URLParams
  97422. ifNoneMatch_ string
  97423. ctx_ context.Context
  97424. header_ http.Header
  97425. }
  97426. // GetXpnResources: Gets service resources (a.k.a service project)
  97427. // associated with this host project.
  97428. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  97429. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97430. c.project = project
  97431. return c
  97432. }
  97433. // Filter sets the optional parameter "filter": A filter expression that
  97434. // filters resources listed in the response. The expression must specify
  97435. // the field name, a comparison operator, and the value that you want to
  97436. // use for filtering. The value must be a string, a number, or a
  97437. // boolean. The comparison operator must be either =, !=, >, or <.
  97438. //
  97439. // For example, if you are filtering Compute Engine instances, you can
  97440. // exclude instances named example-instance by specifying name !=
  97441. // example-instance.
  97442. //
  97443. // You can also filter nested fields. For example, you could specify
  97444. // scheduling.automaticRestart = false to include instances only if they
  97445. // are not scheduled for automatic restarts. You can use filtering on
  97446. // nested fields to filter based on resource labels.
  97447. //
  97448. // To filter on multiple expressions, provide each separate expression
  97449. // within parentheses. For example, (scheduling.automaticRestart = true)
  97450. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  97451. // AND expression. However, you can include AND and OR expressions
  97452. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  97453. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  97454. // true).
  97455. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  97456. c.urlParams_.Set("filter", filter)
  97457. return c
  97458. }
  97459. // MaxResults sets the optional parameter "maxResults": The maximum
  97460. // number of results per page that should be returned. If the number of
  97461. // available results is larger than maxResults, Compute Engine returns a
  97462. // nextPageToken that can be used to get the next page of results in
  97463. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  97464. // (Default: 500)
  97465. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  97466. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  97467. return c
  97468. }
  97469. // OrderBy sets the optional parameter "order_by": Sorts list results by
  97470. // a certain order. By default, results are returned in alphanumerical
  97471. // order based on the resource name.
  97472. //
  97473. // You can also sort results in descending order based on the creation
  97474. // timestamp using orderBy="creationTimestamp desc". This sorts results
  97475. // based on the creationTimestamp field in reverse chronological order
  97476. // (newest result first). Use this to sort resources like operations so
  97477. // that the newest operation is returned first.
  97478. //
  97479. // Currently, only sorting by name or creationTimestamp desc is
  97480. // supported.
  97481. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  97482. c.urlParams_.Set("order_by", orderBy)
  97483. return c
  97484. }
  97485. // PageToken sets the optional parameter "pageToken": Specifies a page
  97486. // token to use. Set pageToken to the nextPageToken returned by a
  97487. // previous list request to get the next page of results.
  97488. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  97489. c.urlParams_.Set("pageToken", pageToken)
  97490. return c
  97491. }
  97492. // Fields allows partial responses to be retrieved. See
  97493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97494. // for more information.
  97495. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  97496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97497. return c
  97498. }
  97499. // IfNoneMatch sets the optional parameter which makes the operation
  97500. // fail if the object's ETag matches the given value. This is useful for
  97501. // getting updates only after the object has changed since the last
  97502. // request. Use googleapi.IsNotModified to check whether the response
  97503. // error from Do is the result of In-None-Match.
  97504. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  97505. c.ifNoneMatch_ = entityTag
  97506. return c
  97507. }
  97508. // Context sets the context to be used in this call's Do method. Any
  97509. // pending HTTP request will be aborted if the provided context is
  97510. // canceled.
  97511. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  97512. c.ctx_ = ctx
  97513. return c
  97514. }
  97515. // Header returns an http.Header that can be modified by the caller to
  97516. // add HTTP headers to the request.
  97517. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  97518. if c.header_ == nil {
  97519. c.header_ = make(http.Header)
  97520. }
  97521. return c.header_
  97522. }
  97523. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  97524. reqHeaders := make(http.Header)
  97525. for k, v := range c.header_ {
  97526. reqHeaders[k] = v
  97527. }
  97528. reqHeaders.Set("User-Agent", c.s.userAgent())
  97529. if c.ifNoneMatch_ != "" {
  97530. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97531. }
  97532. var body io.Reader = nil
  97533. c.urlParams_.Set("alt", alt)
  97534. c.urlParams_.Set("prettyPrint", "false")
  97535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  97536. urls += "?" + c.urlParams_.Encode()
  97537. req, err := http.NewRequest("GET", urls, body)
  97538. if err != nil {
  97539. return nil, err
  97540. }
  97541. req.Header = reqHeaders
  97542. googleapi.Expand(req.URL, map[string]string{
  97543. "project": c.project,
  97544. })
  97545. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97546. }
  97547. // Do executes the "compute.projects.getXpnResources" call.
  97548. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  97549. // non-2xx status code is an error. Response headers are in either
  97550. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  97551. // returned at all) in error.(*googleapi.Error).Header. Use
  97552. // googleapi.IsNotModified to check whether the returned error was
  97553. // because http.StatusNotModified was returned.
  97554. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  97555. gensupport.SetOptions(c.urlParams_, opts...)
  97556. res, err := c.doRequest("json")
  97557. if res != nil && res.StatusCode == http.StatusNotModified {
  97558. if res.Body != nil {
  97559. res.Body.Close()
  97560. }
  97561. return nil, &googleapi.Error{
  97562. Code: res.StatusCode,
  97563. Header: res.Header,
  97564. }
  97565. }
  97566. if err != nil {
  97567. return nil, err
  97568. }
  97569. defer googleapi.CloseBody(res)
  97570. if err := googleapi.CheckResponse(res); err != nil {
  97571. return nil, err
  97572. }
  97573. ret := &ProjectsGetXpnResources{
  97574. ServerResponse: googleapi.ServerResponse{
  97575. Header: res.Header,
  97576. HTTPStatusCode: res.StatusCode,
  97577. },
  97578. }
  97579. target := &ret
  97580. if err := gensupport.DecodeResponse(target, res); err != nil {
  97581. return nil, err
  97582. }
  97583. return ret, nil
  97584. // {
  97585. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  97586. // "httpMethod": "GET",
  97587. // "id": "compute.projects.getXpnResources",
  97588. // "parameterOrder": [
  97589. // "project"
  97590. // ],
  97591. // "parameters": {
  97592. // "filter": {
  97593. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  97594. // "location": "query",
  97595. // "type": "string"
  97596. // },
  97597. // "maxResults": {
  97598. // "default": "500",
  97599. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  97600. // "format": "uint32",
  97601. // "location": "query",
  97602. // "minimum": "0",
  97603. // "type": "integer"
  97604. // },
  97605. // "order_by": {
  97606. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  97607. // "location": "query",
  97608. // "type": "string"
  97609. // },
  97610. // "pageToken": {
  97611. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  97612. // "location": "query",
  97613. // "type": "string"
  97614. // },
  97615. // "project": {
  97616. // "description": "Project ID for this request.",
  97617. // "location": "path",
  97618. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97619. // "required": true,
  97620. // "type": "string"
  97621. // }
  97622. // },
  97623. // "path": "{project}/getXpnResources",
  97624. // "response": {
  97625. // "$ref": "ProjectsGetXpnResources"
  97626. // },
  97627. // "scopes": [
  97628. // "https://www.googleapis.com/auth/cloud-platform",
  97629. // "https://www.googleapis.com/auth/compute"
  97630. // ]
  97631. // }
  97632. }
  97633. // Pages invokes f for each page of results.
  97634. // A non-nil error returned from f will halt the iteration.
  97635. // The provided context supersedes any context provided to the Context method.
  97636. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  97637. c.ctx_ = ctx
  97638. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  97639. for {
  97640. x, err := c.Do()
  97641. if err != nil {
  97642. return err
  97643. }
  97644. if err := f(x); err != nil {
  97645. return err
  97646. }
  97647. if x.NextPageToken == "" {
  97648. return nil
  97649. }
  97650. c.PageToken(x.NextPageToken)
  97651. }
  97652. }
  97653. // method id "compute.projects.listXpnHosts":
  97654. type ProjectsListXpnHostsCall struct {
  97655. s *Service
  97656. project string
  97657. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  97658. urlParams_ gensupport.URLParams
  97659. ctx_ context.Context
  97660. header_ http.Header
  97661. }
  97662. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  97663. // in an organization.
  97664. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  97665. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97666. c.project = project
  97667. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  97668. return c
  97669. }
  97670. // Filter sets the optional parameter "filter": A filter expression that
  97671. // filters resources listed in the response. The expression must specify
  97672. // the field name, a comparison operator, and the value that you want to
  97673. // use for filtering. The value must be a string, a number, or a
  97674. // boolean. The comparison operator must be either =, !=, >, or <.
  97675. //
  97676. // For example, if you are filtering Compute Engine instances, you can
  97677. // exclude instances named example-instance by specifying name !=
  97678. // example-instance.
  97679. //
  97680. // You can also filter nested fields. For example, you could specify
  97681. // scheduling.automaticRestart = false to include instances only if they
  97682. // are not scheduled for automatic restarts. You can use filtering on
  97683. // nested fields to filter based on resource labels.
  97684. //
  97685. // To filter on multiple expressions, provide each separate expression
  97686. // within parentheses. For example, (scheduling.automaticRestart = true)
  97687. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  97688. // AND expression. However, you can include AND and OR expressions
  97689. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  97690. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  97691. // true).
  97692. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  97693. c.urlParams_.Set("filter", filter)
  97694. return c
  97695. }
  97696. // MaxResults sets the optional parameter "maxResults": The maximum
  97697. // number of results per page that should be returned. If the number of
  97698. // available results is larger than maxResults, Compute Engine returns a
  97699. // nextPageToken that can be used to get the next page of results in
  97700. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  97701. // (Default: 500)
  97702. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  97703. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  97704. return c
  97705. }
  97706. // OrderBy sets the optional parameter "order_by": Sorts list results by
  97707. // a certain order. By default, results are returned in alphanumerical
  97708. // order based on the resource name.
  97709. //
  97710. // You can also sort results in descending order based on the creation
  97711. // timestamp using orderBy="creationTimestamp desc". This sorts results
  97712. // based on the creationTimestamp field in reverse chronological order
  97713. // (newest result first). Use this to sort resources like operations so
  97714. // that the newest operation is returned first.
  97715. //
  97716. // Currently, only sorting by name or creationTimestamp desc is
  97717. // supported.
  97718. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  97719. c.urlParams_.Set("order_by", orderBy)
  97720. return c
  97721. }
  97722. // PageToken sets the optional parameter "pageToken": Specifies a page
  97723. // token to use. Set pageToken to the nextPageToken returned by a
  97724. // previous list request to get the next page of results.
  97725. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  97726. c.urlParams_.Set("pageToken", pageToken)
  97727. return c
  97728. }
  97729. // Fields allows partial responses to be retrieved. See
  97730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97731. // for more information.
  97732. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  97733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97734. return c
  97735. }
  97736. // Context sets the context to be used in this call's Do method. Any
  97737. // pending HTTP request will be aborted if the provided context is
  97738. // canceled.
  97739. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  97740. c.ctx_ = ctx
  97741. return c
  97742. }
  97743. // Header returns an http.Header that can be modified by the caller to
  97744. // add HTTP headers to the request.
  97745. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  97746. if c.header_ == nil {
  97747. c.header_ = make(http.Header)
  97748. }
  97749. return c.header_
  97750. }
  97751. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  97752. reqHeaders := make(http.Header)
  97753. for k, v := range c.header_ {
  97754. reqHeaders[k] = v
  97755. }
  97756. reqHeaders.Set("User-Agent", c.s.userAgent())
  97757. var body io.Reader = nil
  97758. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  97759. if err != nil {
  97760. return nil, err
  97761. }
  97762. reqHeaders.Set("Content-Type", "application/json")
  97763. c.urlParams_.Set("alt", alt)
  97764. c.urlParams_.Set("prettyPrint", "false")
  97765. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  97766. urls += "?" + c.urlParams_.Encode()
  97767. req, err := http.NewRequest("POST", urls, body)
  97768. if err != nil {
  97769. return nil, err
  97770. }
  97771. req.Header = reqHeaders
  97772. googleapi.Expand(req.URL, map[string]string{
  97773. "project": c.project,
  97774. })
  97775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97776. }
  97777. // Do executes the "compute.projects.listXpnHosts" call.
  97778. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  97779. // status code is an error. Response headers are in either
  97780. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  97781. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97782. // to check whether the returned error was because
  97783. // http.StatusNotModified was returned.
  97784. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  97785. gensupport.SetOptions(c.urlParams_, opts...)
  97786. res, err := c.doRequest("json")
  97787. if res != nil && res.StatusCode == http.StatusNotModified {
  97788. if res.Body != nil {
  97789. res.Body.Close()
  97790. }
  97791. return nil, &googleapi.Error{
  97792. Code: res.StatusCode,
  97793. Header: res.Header,
  97794. }
  97795. }
  97796. if err != nil {
  97797. return nil, err
  97798. }
  97799. defer googleapi.CloseBody(res)
  97800. if err := googleapi.CheckResponse(res); err != nil {
  97801. return nil, err
  97802. }
  97803. ret := &XpnHostList{
  97804. ServerResponse: googleapi.ServerResponse{
  97805. Header: res.Header,
  97806. HTTPStatusCode: res.StatusCode,
  97807. },
  97808. }
  97809. target := &ret
  97810. if err := gensupport.DecodeResponse(target, res); err != nil {
  97811. return nil, err
  97812. }
  97813. return ret, nil
  97814. // {
  97815. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  97816. // "httpMethod": "POST",
  97817. // "id": "compute.projects.listXpnHosts",
  97818. // "parameterOrder": [
  97819. // "project"
  97820. // ],
  97821. // "parameters": {
  97822. // "filter": {
  97823. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  97824. // "location": "query",
  97825. // "type": "string"
  97826. // },
  97827. // "maxResults": {
  97828. // "default": "500",
  97829. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  97830. // "format": "uint32",
  97831. // "location": "query",
  97832. // "minimum": "0",
  97833. // "type": "integer"
  97834. // },
  97835. // "order_by": {
  97836. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  97837. // "location": "query",
  97838. // "type": "string"
  97839. // },
  97840. // "pageToken": {
  97841. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  97842. // "location": "query",
  97843. // "type": "string"
  97844. // },
  97845. // "project": {
  97846. // "description": "Project ID for this request.",
  97847. // "location": "path",
  97848. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97849. // "required": true,
  97850. // "type": "string"
  97851. // }
  97852. // },
  97853. // "path": "{project}/listXpnHosts",
  97854. // "request": {
  97855. // "$ref": "ProjectsListXpnHostsRequest"
  97856. // },
  97857. // "response": {
  97858. // "$ref": "XpnHostList"
  97859. // },
  97860. // "scopes": [
  97861. // "https://www.googleapis.com/auth/cloud-platform",
  97862. // "https://www.googleapis.com/auth/compute"
  97863. // ]
  97864. // }
  97865. }
  97866. // Pages invokes f for each page of results.
  97867. // A non-nil error returned from f will halt the iteration.
  97868. // The provided context supersedes any context provided to the Context method.
  97869. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  97870. c.ctx_ = ctx
  97871. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  97872. for {
  97873. x, err := c.Do()
  97874. if err != nil {
  97875. return err
  97876. }
  97877. if err := f(x); err != nil {
  97878. return err
  97879. }
  97880. if x.NextPageToken == "" {
  97881. return nil
  97882. }
  97883. c.PageToken(x.NextPageToken)
  97884. }
  97885. }
  97886. // method id "compute.projects.moveDisk":
  97887. type ProjectsMoveDiskCall struct {
  97888. s *Service
  97889. project string
  97890. diskmoverequest *DiskMoveRequest
  97891. urlParams_ gensupport.URLParams
  97892. ctx_ context.Context
  97893. header_ http.Header
  97894. }
  97895. // MoveDisk: Moves a persistent disk from one zone to another.
  97896. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  97897. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97898. c.project = project
  97899. c.diskmoverequest = diskmoverequest
  97900. return c
  97901. }
  97902. // RequestId sets the optional parameter "requestId": An optional
  97903. // request ID to identify requests. Specify a unique request ID so that
  97904. // if you must retry your request, the server will know to ignore the
  97905. // request if it has already been completed.
  97906. //
  97907. // For example, consider a situation where you make an initial request
  97908. // and the request times out. If you make the request again with the
  97909. // same request ID, the server can check if original operation with the
  97910. // same request ID was received, and if so, will ignore the second
  97911. // request. This prevents clients from accidentally creating duplicate
  97912. // commitments.
  97913. //
  97914. // The request ID must be a valid UUID with the exception that zero UUID
  97915. // is not supported (00000000-0000-0000-0000-000000000000).
  97916. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  97917. c.urlParams_.Set("requestId", requestId)
  97918. return c
  97919. }
  97920. // Fields allows partial responses to be retrieved. See
  97921. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97922. // for more information.
  97923. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  97924. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97925. return c
  97926. }
  97927. // Context sets the context to be used in this call's Do method. Any
  97928. // pending HTTP request will be aborted if the provided context is
  97929. // canceled.
  97930. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  97931. c.ctx_ = ctx
  97932. return c
  97933. }
  97934. // Header returns an http.Header that can be modified by the caller to
  97935. // add HTTP headers to the request.
  97936. func (c *ProjectsMoveDiskCall) Header() http.Header {
  97937. if c.header_ == nil {
  97938. c.header_ = make(http.Header)
  97939. }
  97940. return c.header_
  97941. }
  97942. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  97943. reqHeaders := make(http.Header)
  97944. for k, v := range c.header_ {
  97945. reqHeaders[k] = v
  97946. }
  97947. reqHeaders.Set("User-Agent", c.s.userAgent())
  97948. var body io.Reader = nil
  97949. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  97950. if err != nil {
  97951. return nil, err
  97952. }
  97953. reqHeaders.Set("Content-Type", "application/json")
  97954. c.urlParams_.Set("alt", alt)
  97955. c.urlParams_.Set("prettyPrint", "false")
  97956. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  97957. urls += "?" + c.urlParams_.Encode()
  97958. req, err := http.NewRequest("POST", urls, body)
  97959. if err != nil {
  97960. return nil, err
  97961. }
  97962. req.Header = reqHeaders
  97963. googleapi.Expand(req.URL, map[string]string{
  97964. "project": c.project,
  97965. })
  97966. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97967. }
  97968. // Do executes the "compute.projects.moveDisk" call.
  97969. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97970. // status code is an error. Response headers are in either
  97971. // *Operation.ServerResponse.Header or (if a response was returned at
  97972. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97973. // to check whether the returned error was because
  97974. // http.StatusNotModified was returned.
  97975. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97976. gensupport.SetOptions(c.urlParams_, opts...)
  97977. res, err := c.doRequest("json")
  97978. if res != nil && res.StatusCode == http.StatusNotModified {
  97979. if res.Body != nil {
  97980. res.Body.Close()
  97981. }
  97982. return nil, &googleapi.Error{
  97983. Code: res.StatusCode,
  97984. Header: res.Header,
  97985. }
  97986. }
  97987. if err != nil {
  97988. return nil, err
  97989. }
  97990. defer googleapi.CloseBody(res)
  97991. if err := googleapi.CheckResponse(res); err != nil {
  97992. return nil, err
  97993. }
  97994. ret := &Operation{
  97995. ServerResponse: googleapi.ServerResponse{
  97996. Header: res.Header,
  97997. HTTPStatusCode: res.StatusCode,
  97998. },
  97999. }
  98000. target := &ret
  98001. if err := gensupport.DecodeResponse(target, res); err != nil {
  98002. return nil, err
  98003. }
  98004. return ret, nil
  98005. // {
  98006. // "description": "Moves a persistent disk from one zone to another.",
  98007. // "httpMethod": "POST",
  98008. // "id": "compute.projects.moveDisk",
  98009. // "parameterOrder": [
  98010. // "project"
  98011. // ],
  98012. // "parameters": {
  98013. // "project": {
  98014. // "description": "Project ID for this request.",
  98015. // "location": "path",
  98016. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98017. // "required": true,
  98018. // "type": "string"
  98019. // },
  98020. // "requestId": {
  98021. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98022. // "location": "query",
  98023. // "type": "string"
  98024. // }
  98025. // },
  98026. // "path": "{project}/moveDisk",
  98027. // "request": {
  98028. // "$ref": "DiskMoveRequest"
  98029. // },
  98030. // "response": {
  98031. // "$ref": "Operation"
  98032. // },
  98033. // "scopes": [
  98034. // "https://www.googleapis.com/auth/cloud-platform",
  98035. // "https://www.googleapis.com/auth/compute"
  98036. // ]
  98037. // }
  98038. }
  98039. // method id "compute.projects.moveInstance":
  98040. type ProjectsMoveInstanceCall struct {
  98041. s *Service
  98042. project string
  98043. instancemoverequest *InstanceMoveRequest
  98044. urlParams_ gensupport.URLParams
  98045. ctx_ context.Context
  98046. header_ http.Header
  98047. }
  98048. // MoveInstance: Moves an instance and its attached persistent disks
  98049. // from one zone to another.
  98050. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  98051. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98052. c.project = project
  98053. c.instancemoverequest = instancemoverequest
  98054. return c
  98055. }
  98056. // RequestId sets the optional parameter "requestId": An optional
  98057. // request ID to identify requests. Specify a unique request ID so that
  98058. // if you must retry your request, the server will know to ignore the
  98059. // request if it has already been completed.
  98060. //
  98061. // For example, consider a situation where you make an initial request
  98062. // and the request times out. If you make the request again with the
  98063. // same request ID, the server can check if original operation with the
  98064. // same request ID was received, and if so, will ignore the second
  98065. // request. This prevents clients from accidentally creating duplicate
  98066. // commitments.
  98067. //
  98068. // The request ID must be a valid UUID with the exception that zero UUID
  98069. // is not supported (00000000-0000-0000-0000-000000000000).
  98070. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  98071. c.urlParams_.Set("requestId", requestId)
  98072. return c
  98073. }
  98074. // Fields allows partial responses to be retrieved. See
  98075. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98076. // for more information.
  98077. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  98078. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98079. return c
  98080. }
  98081. // Context sets the context to be used in this call's Do method. Any
  98082. // pending HTTP request will be aborted if the provided context is
  98083. // canceled.
  98084. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  98085. c.ctx_ = ctx
  98086. return c
  98087. }
  98088. // Header returns an http.Header that can be modified by the caller to
  98089. // add HTTP headers to the request.
  98090. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  98091. if c.header_ == nil {
  98092. c.header_ = make(http.Header)
  98093. }
  98094. return c.header_
  98095. }
  98096. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  98097. reqHeaders := make(http.Header)
  98098. for k, v := range c.header_ {
  98099. reqHeaders[k] = v
  98100. }
  98101. reqHeaders.Set("User-Agent", c.s.userAgent())
  98102. var body io.Reader = nil
  98103. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  98104. if err != nil {
  98105. return nil, err
  98106. }
  98107. reqHeaders.Set("Content-Type", "application/json")
  98108. c.urlParams_.Set("alt", alt)
  98109. c.urlParams_.Set("prettyPrint", "false")
  98110. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  98111. urls += "?" + c.urlParams_.Encode()
  98112. req, err := http.NewRequest("POST", urls, body)
  98113. if err != nil {
  98114. return nil, err
  98115. }
  98116. req.Header = reqHeaders
  98117. googleapi.Expand(req.URL, map[string]string{
  98118. "project": c.project,
  98119. })
  98120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98121. }
  98122. // Do executes the "compute.projects.moveInstance" call.
  98123. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98124. // status code is an error. Response headers are in either
  98125. // *Operation.ServerResponse.Header or (if a response was returned at
  98126. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98127. // to check whether the returned error was because
  98128. // http.StatusNotModified was returned.
  98129. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98130. gensupport.SetOptions(c.urlParams_, opts...)
  98131. res, err := c.doRequest("json")
  98132. if res != nil && res.StatusCode == http.StatusNotModified {
  98133. if res.Body != nil {
  98134. res.Body.Close()
  98135. }
  98136. return nil, &googleapi.Error{
  98137. Code: res.StatusCode,
  98138. Header: res.Header,
  98139. }
  98140. }
  98141. if err != nil {
  98142. return nil, err
  98143. }
  98144. defer googleapi.CloseBody(res)
  98145. if err := googleapi.CheckResponse(res); err != nil {
  98146. return nil, err
  98147. }
  98148. ret := &Operation{
  98149. ServerResponse: googleapi.ServerResponse{
  98150. Header: res.Header,
  98151. HTTPStatusCode: res.StatusCode,
  98152. },
  98153. }
  98154. target := &ret
  98155. if err := gensupport.DecodeResponse(target, res); err != nil {
  98156. return nil, err
  98157. }
  98158. return ret, nil
  98159. // {
  98160. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  98161. // "httpMethod": "POST",
  98162. // "id": "compute.projects.moveInstance",
  98163. // "parameterOrder": [
  98164. // "project"
  98165. // ],
  98166. // "parameters": {
  98167. // "project": {
  98168. // "description": "Project ID for this request.",
  98169. // "location": "path",
  98170. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98171. // "required": true,
  98172. // "type": "string"
  98173. // },
  98174. // "requestId": {
  98175. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98176. // "location": "query",
  98177. // "type": "string"
  98178. // }
  98179. // },
  98180. // "path": "{project}/moveInstance",
  98181. // "request": {
  98182. // "$ref": "InstanceMoveRequest"
  98183. // },
  98184. // "response": {
  98185. // "$ref": "Operation"
  98186. // },
  98187. // "scopes": [
  98188. // "https://www.googleapis.com/auth/cloud-platform",
  98189. // "https://www.googleapis.com/auth/compute"
  98190. // ]
  98191. // }
  98192. }
  98193. // method id "compute.projects.setCommonInstanceMetadata":
  98194. type ProjectsSetCommonInstanceMetadataCall struct {
  98195. s *Service
  98196. project string
  98197. metadata *Metadata
  98198. urlParams_ gensupport.URLParams
  98199. ctx_ context.Context
  98200. header_ http.Header
  98201. }
  98202. // SetCommonInstanceMetadata: Sets metadata common to all instances
  98203. // within the specified project using the data included in the request.
  98204. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  98205. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  98206. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98207. c.project = project
  98208. c.metadata = metadata
  98209. return c
  98210. }
  98211. // RequestId sets the optional parameter "requestId": An optional
  98212. // request ID to identify requests. Specify a unique request ID so that
  98213. // if you must retry your request, the server will know to ignore the
  98214. // request if it has already been completed.
  98215. //
  98216. // For example, consider a situation where you make an initial request
  98217. // and the request times out. If you make the request again with the
  98218. // same request ID, the server can check if original operation with the
  98219. // same request ID was received, and if so, will ignore the second
  98220. // request. This prevents clients from accidentally creating duplicate
  98221. // commitments.
  98222. //
  98223. // The request ID must be a valid UUID with the exception that zero UUID
  98224. // is not supported (00000000-0000-0000-0000-000000000000).
  98225. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  98226. c.urlParams_.Set("requestId", requestId)
  98227. return c
  98228. }
  98229. // Fields allows partial responses to be retrieved. See
  98230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98231. // for more information.
  98232. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  98233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98234. return c
  98235. }
  98236. // Context sets the context to be used in this call's Do method. Any
  98237. // pending HTTP request will be aborted if the provided context is
  98238. // canceled.
  98239. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  98240. c.ctx_ = ctx
  98241. return c
  98242. }
  98243. // Header returns an http.Header that can be modified by the caller to
  98244. // add HTTP headers to the request.
  98245. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  98246. if c.header_ == nil {
  98247. c.header_ = make(http.Header)
  98248. }
  98249. return c.header_
  98250. }
  98251. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  98252. reqHeaders := make(http.Header)
  98253. for k, v := range c.header_ {
  98254. reqHeaders[k] = v
  98255. }
  98256. reqHeaders.Set("User-Agent", c.s.userAgent())
  98257. var body io.Reader = nil
  98258. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  98259. if err != nil {
  98260. return nil, err
  98261. }
  98262. reqHeaders.Set("Content-Type", "application/json")
  98263. c.urlParams_.Set("alt", alt)
  98264. c.urlParams_.Set("prettyPrint", "false")
  98265. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  98266. urls += "?" + c.urlParams_.Encode()
  98267. req, err := http.NewRequest("POST", urls, body)
  98268. if err != nil {
  98269. return nil, err
  98270. }
  98271. req.Header = reqHeaders
  98272. googleapi.Expand(req.URL, map[string]string{
  98273. "project": c.project,
  98274. })
  98275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98276. }
  98277. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  98278. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98279. // status code is an error. Response headers are in either
  98280. // *Operation.ServerResponse.Header or (if a response was returned at
  98281. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98282. // to check whether the returned error was because
  98283. // http.StatusNotModified was returned.
  98284. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98285. gensupport.SetOptions(c.urlParams_, opts...)
  98286. res, err := c.doRequest("json")
  98287. if res != nil && res.StatusCode == http.StatusNotModified {
  98288. if res.Body != nil {
  98289. res.Body.Close()
  98290. }
  98291. return nil, &googleapi.Error{
  98292. Code: res.StatusCode,
  98293. Header: res.Header,
  98294. }
  98295. }
  98296. if err != nil {
  98297. return nil, err
  98298. }
  98299. defer googleapi.CloseBody(res)
  98300. if err := googleapi.CheckResponse(res); err != nil {
  98301. return nil, err
  98302. }
  98303. ret := &Operation{
  98304. ServerResponse: googleapi.ServerResponse{
  98305. Header: res.Header,
  98306. HTTPStatusCode: res.StatusCode,
  98307. },
  98308. }
  98309. target := &ret
  98310. if err := gensupport.DecodeResponse(target, res); err != nil {
  98311. return nil, err
  98312. }
  98313. return ret, nil
  98314. // {
  98315. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  98316. // "httpMethod": "POST",
  98317. // "id": "compute.projects.setCommonInstanceMetadata",
  98318. // "parameterOrder": [
  98319. // "project"
  98320. // ],
  98321. // "parameters": {
  98322. // "project": {
  98323. // "description": "Project ID for this request.",
  98324. // "location": "path",
  98325. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98326. // "required": true,
  98327. // "type": "string"
  98328. // },
  98329. // "requestId": {
  98330. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98331. // "location": "query",
  98332. // "type": "string"
  98333. // }
  98334. // },
  98335. // "path": "{project}/setCommonInstanceMetadata",
  98336. // "request": {
  98337. // "$ref": "Metadata"
  98338. // },
  98339. // "response": {
  98340. // "$ref": "Operation"
  98341. // },
  98342. // "scopes": [
  98343. // "https://www.googleapis.com/auth/cloud-platform",
  98344. // "https://www.googleapis.com/auth/compute"
  98345. // ]
  98346. // }
  98347. }
  98348. // method id "compute.projects.setDefaultNetworkTier":
  98349. type ProjectsSetDefaultNetworkTierCall struct {
  98350. s *Service
  98351. project string
  98352. projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
  98353. urlParams_ gensupport.URLParams
  98354. ctx_ context.Context
  98355. header_ http.Header
  98356. }
  98357. // SetDefaultNetworkTier: Sets the default network tier of the project.
  98358. // The default network tier is used when an
  98359. // address/forwardingRule/instance is created without specifying the
  98360. // network tier field.
  98361. func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
  98362. c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98363. c.project = project
  98364. c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
  98365. return c
  98366. }
  98367. // RequestId sets the optional parameter "requestId": An optional
  98368. // request ID to identify requests. Specify a unique request ID so that
  98369. // if you must retry your request, the server will know to ignore the
  98370. // request if it has already been completed.
  98371. //
  98372. // For example, consider a situation where you make an initial request
  98373. // and the request times out. If you make the request again with the
  98374. // same request ID, the server can check if original operation with the
  98375. // same request ID was received, and if so, will ignore the second
  98376. // request. This prevents clients from accidentally creating duplicate
  98377. // commitments.
  98378. //
  98379. // The request ID must be a valid UUID with the exception that zero UUID
  98380. // is not supported (00000000-0000-0000-0000-000000000000).
  98381. func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
  98382. c.urlParams_.Set("requestId", requestId)
  98383. return c
  98384. }
  98385. // Fields allows partial responses to be retrieved. See
  98386. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98387. // for more information.
  98388. func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
  98389. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98390. return c
  98391. }
  98392. // Context sets the context to be used in this call's Do method. Any
  98393. // pending HTTP request will be aborted if the provided context is
  98394. // canceled.
  98395. func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
  98396. c.ctx_ = ctx
  98397. return c
  98398. }
  98399. // Header returns an http.Header that can be modified by the caller to
  98400. // add HTTP headers to the request.
  98401. func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
  98402. if c.header_ == nil {
  98403. c.header_ = make(http.Header)
  98404. }
  98405. return c.header_
  98406. }
  98407. func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
  98408. reqHeaders := make(http.Header)
  98409. for k, v := range c.header_ {
  98410. reqHeaders[k] = v
  98411. }
  98412. reqHeaders.Set("User-Agent", c.s.userAgent())
  98413. var body io.Reader = nil
  98414. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
  98415. if err != nil {
  98416. return nil, err
  98417. }
  98418. reqHeaders.Set("Content-Type", "application/json")
  98419. c.urlParams_.Set("alt", alt)
  98420. c.urlParams_.Set("prettyPrint", "false")
  98421. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultNetworkTier")
  98422. urls += "?" + c.urlParams_.Encode()
  98423. req, err := http.NewRequest("POST", urls, body)
  98424. if err != nil {
  98425. return nil, err
  98426. }
  98427. req.Header = reqHeaders
  98428. googleapi.Expand(req.URL, map[string]string{
  98429. "project": c.project,
  98430. })
  98431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98432. }
  98433. // Do executes the "compute.projects.setDefaultNetworkTier" call.
  98434. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98435. // status code is an error. Response headers are in either
  98436. // *Operation.ServerResponse.Header or (if a response was returned at
  98437. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98438. // to check whether the returned error was because
  98439. // http.StatusNotModified was returned.
  98440. func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98441. gensupport.SetOptions(c.urlParams_, opts...)
  98442. res, err := c.doRequest("json")
  98443. if res != nil && res.StatusCode == http.StatusNotModified {
  98444. if res.Body != nil {
  98445. res.Body.Close()
  98446. }
  98447. return nil, &googleapi.Error{
  98448. Code: res.StatusCode,
  98449. Header: res.Header,
  98450. }
  98451. }
  98452. if err != nil {
  98453. return nil, err
  98454. }
  98455. defer googleapi.CloseBody(res)
  98456. if err := googleapi.CheckResponse(res); err != nil {
  98457. return nil, err
  98458. }
  98459. ret := &Operation{
  98460. ServerResponse: googleapi.ServerResponse{
  98461. Header: res.Header,
  98462. HTTPStatusCode: res.StatusCode,
  98463. },
  98464. }
  98465. target := &ret
  98466. if err := gensupport.DecodeResponse(target, res); err != nil {
  98467. return nil, err
  98468. }
  98469. return ret, nil
  98470. // {
  98471. // "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.",
  98472. // "httpMethod": "POST",
  98473. // "id": "compute.projects.setDefaultNetworkTier",
  98474. // "parameterOrder": [
  98475. // "project"
  98476. // ],
  98477. // "parameters": {
  98478. // "project": {
  98479. // "description": "Project ID for this request.",
  98480. // "location": "path",
  98481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98482. // "required": true,
  98483. // "type": "string"
  98484. // },
  98485. // "requestId": {
  98486. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98487. // "location": "query",
  98488. // "type": "string"
  98489. // }
  98490. // },
  98491. // "path": "{project}/setDefaultNetworkTier",
  98492. // "request": {
  98493. // "$ref": "ProjectsSetDefaultNetworkTierRequest"
  98494. // },
  98495. // "response": {
  98496. // "$ref": "Operation"
  98497. // },
  98498. // "scopes": [
  98499. // "https://www.googleapis.com/auth/cloud-platform",
  98500. // "https://www.googleapis.com/auth/compute"
  98501. // ]
  98502. // }
  98503. }
  98504. // method id "compute.projects.setDefaultServiceAccount":
  98505. type ProjectsSetDefaultServiceAccountCall struct {
  98506. s *Service
  98507. project string
  98508. projectssetdefaultserviceaccountrequest *ProjectsSetDefaultServiceAccountRequest
  98509. urlParams_ gensupport.URLParams
  98510. ctx_ context.Context
  98511. header_ http.Header
  98512. }
  98513. // SetDefaultServiceAccount: Sets the default service account of the
  98514. // project. The default service account is used when a VM instance is
  98515. // created with the service account email address set to "default".
  98516. func (r *ProjectsService) SetDefaultServiceAccount(project string, projectssetdefaultserviceaccountrequest *ProjectsSetDefaultServiceAccountRequest) *ProjectsSetDefaultServiceAccountCall {
  98517. c := &ProjectsSetDefaultServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98518. c.project = project
  98519. c.projectssetdefaultserviceaccountrequest = projectssetdefaultserviceaccountrequest
  98520. return c
  98521. }
  98522. // RequestId sets the optional parameter "requestId": An optional
  98523. // request ID to identify requests. Specify a unique request ID so that
  98524. // if you must retry your request, the server will know to ignore the
  98525. // request if it has already been completed.
  98526. //
  98527. // For example, consider a situation where you make an initial request
  98528. // and the request times out. If you make the request again with the
  98529. // same request ID, the server can check if original operation with the
  98530. // same request ID was received, and if so, will ignore the second
  98531. // request. This prevents clients from accidentally creating duplicate
  98532. // commitments.
  98533. //
  98534. // The request ID must be a valid UUID with the exception that zero UUID
  98535. // is not supported (00000000-0000-0000-0000-000000000000).
  98536. func (c *ProjectsSetDefaultServiceAccountCall) RequestId(requestId string) *ProjectsSetDefaultServiceAccountCall {
  98537. c.urlParams_.Set("requestId", requestId)
  98538. return c
  98539. }
  98540. // Fields allows partial responses to be retrieved. See
  98541. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98542. // for more information.
  98543. func (c *ProjectsSetDefaultServiceAccountCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultServiceAccountCall {
  98544. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98545. return c
  98546. }
  98547. // Context sets the context to be used in this call's Do method. Any
  98548. // pending HTTP request will be aborted if the provided context is
  98549. // canceled.
  98550. func (c *ProjectsSetDefaultServiceAccountCall) Context(ctx context.Context) *ProjectsSetDefaultServiceAccountCall {
  98551. c.ctx_ = ctx
  98552. return c
  98553. }
  98554. // Header returns an http.Header that can be modified by the caller to
  98555. // add HTTP headers to the request.
  98556. func (c *ProjectsSetDefaultServiceAccountCall) Header() http.Header {
  98557. if c.header_ == nil {
  98558. c.header_ = make(http.Header)
  98559. }
  98560. return c.header_
  98561. }
  98562. func (c *ProjectsSetDefaultServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  98563. reqHeaders := make(http.Header)
  98564. for k, v := range c.header_ {
  98565. reqHeaders[k] = v
  98566. }
  98567. reqHeaders.Set("User-Agent", c.s.userAgent())
  98568. var body io.Reader = nil
  98569. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultserviceaccountrequest)
  98570. if err != nil {
  98571. return nil, err
  98572. }
  98573. reqHeaders.Set("Content-Type", "application/json")
  98574. c.urlParams_.Set("alt", alt)
  98575. c.urlParams_.Set("prettyPrint", "false")
  98576. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultServiceAccount")
  98577. urls += "?" + c.urlParams_.Encode()
  98578. req, err := http.NewRequest("POST", urls, body)
  98579. if err != nil {
  98580. return nil, err
  98581. }
  98582. req.Header = reqHeaders
  98583. googleapi.Expand(req.URL, map[string]string{
  98584. "project": c.project,
  98585. })
  98586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98587. }
  98588. // Do executes the "compute.projects.setDefaultServiceAccount" call.
  98589. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98590. // status code is an error. Response headers are in either
  98591. // *Operation.ServerResponse.Header or (if a response was returned at
  98592. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98593. // to check whether the returned error was because
  98594. // http.StatusNotModified was returned.
  98595. func (c *ProjectsSetDefaultServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98596. gensupport.SetOptions(c.urlParams_, opts...)
  98597. res, err := c.doRequest("json")
  98598. if res != nil && res.StatusCode == http.StatusNotModified {
  98599. if res.Body != nil {
  98600. res.Body.Close()
  98601. }
  98602. return nil, &googleapi.Error{
  98603. Code: res.StatusCode,
  98604. Header: res.Header,
  98605. }
  98606. }
  98607. if err != nil {
  98608. return nil, err
  98609. }
  98610. defer googleapi.CloseBody(res)
  98611. if err := googleapi.CheckResponse(res); err != nil {
  98612. return nil, err
  98613. }
  98614. ret := &Operation{
  98615. ServerResponse: googleapi.ServerResponse{
  98616. Header: res.Header,
  98617. HTTPStatusCode: res.StatusCode,
  98618. },
  98619. }
  98620. target := &ret
  98621. if err := gensupport.DecodeResponse(target, res); err != nil {
  98622. return nil, err
  98623. }
  98624. return ret, nil
  98625. // {
  98626. // "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\".",
  98627. // "httpMethod": "POST",
  98628. // "id": "compute.projects.setDefaultServiceAccount",
  98629. // "parameterOrder": [
  98630. // "project"
  98631. // ],
  98632. // "parameters": {
  98633. // "project": {
  98634. // "description": "Project ID for this request.",
  98635. // "location": "path",
  98636. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98637. // "required": true,
  98638. // "type": "string"
  98639. // },
  98640. // "requestId": {
  98641. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98642. // "location": "query",
  98643. // "type": "string"
  98644. // }
  98645. // },
  98646. // "path": "{project}/setDefaultServiceAccount",
  98647. // "request": {
  98648. // "$ref": "ProjectsSetDefaultServiceAccountRequest"
  98649. // },
  98650. // "response": {
  98651. // "$ref": "Operation"
  98652. // },
  98653. // "scopes": [
  98654. // "https://www.googleapis.com/auth/cloud-platform",
  98655. // "https://www.googleapis.com/auth/compute"
  98656. // ]
  98657. // }
  98658. }
  98659. // method id "compute.projects.setUsageExportBucket":
  98660. type ProjectsSetUsageExportBucketCall struct {
  98661. s *Service
  98662. project string
  98663. usageexportlocation *UsageExportLocation
  98664. urlParams_ gensupport.URLParams
  98665. ctx_ context.Context
  98666. header_ http.Header
  98667. }
  98668. // SetUsageExportBucket: Enables the usage export feature and sets the
  98669. // usage export bucket where reports are stored. If you provide an empty
  98670. // request body using this method, the usage export feature will be
  98671. // disabled.
  98672. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  98673. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  98674. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98675. c.project = project
  98676. c.usageexportlocation = usageexportlocation
  98677. return c
  98678. }
  98679. // RequestId sets the optional parameter "requestId": An optional
  98680. // request ID to identify requests. Specify a unique request ID so that
  98681. // if you must retry your request, the server will know to ignore the
  98682. // request if it has already been completed.
  98683. //
  98684. // For example, consider a situation where you make an initial request
  98685. // and the request times out. If you make the request again with the
  98686. // same request ID, the server can check if original operation with the
  98687. // same request ID was received, and if so, will ignore the second
  98688. // request. This prevents clients from accidentally creating duplicate
  98689. // commitments.
  98690. //
  98691. // The request ID must be a valid UUID with the exception that zero UUID
  98692. // is not supported (00000000-0000-0000-0000-000000000000).
  98693. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  98694. c.urlParams_.Set("requestId", requestId)
  98695. return c
  98696. }
  98697. // Fields allows partial responses to be retrieved. See
  98698. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98699. // for more information.
  98700. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  98701. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98702. return c
  98703. }
  98704. // Context sets the context to be used in this call's Do method. Any
  98705. // pending HTTP request will be aborted if the provided context is
  98706. // canceled.
  98707. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  98708. c.ctx_ = ctx
  98709. return c
  98710. }
  98711. // Header returns an http.Header that can be modified by the caller to
  98712. // add HTTP headers to the request.
  98713. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  98714. if c.header_ == nil {
  98715. c.header_ = make(http.Header)
  98716. }
  98717. return c.header_
  98718. }
  98719. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  98720. reqHeaders := make(http.Header)
  98721. for k, v := range c.header_ {
  98722. reqHeaders[k] = v
  98723. }
  98724. reqHeaders.Set("User-Agent", c.s.userAgent())
  98725. var body io.Reader = nil
  98726. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  98727. if err != nil {
  98728. return nil, err
  98729. }
  98730. reqHeaders.Set("Content-Type", "application/json")
  98731. c.urlParams_.Set("alt", alt)
  98732. c.urlParams_.Set("prettyPrint", "false")
  98733. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  98734. urls += "?" + c.urlParams_.Encode()
  98735. req, err := http.NewRequest("POST", urls, body)
  98736. if err != nil {
  98737. return nil, err
  98738. }
  98739. req.Header = reqHeaders
  98740. googleapi.Expand(req.URL, map[string]string{
  98741. "project": c.project,
  98742. })
  98743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98744. }
  98745. // Do executes the "compute.projects.setUsageExportBucket" call.
  98746. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98747. // status code is an error. Response headers are in either
  98748. // *Operation.ServerResponse.Header or (if a response was returned at
  98749. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98750. // to check whether the returned error was because
  98751. // http.StatusNotModified was returned.
  98752. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98753. gensupport.SetOptions(c.urlParams_, opts...)
  98754. res, err := c.doRequest("json")
  98755. if res != nil && res.StatusCode == http.StatusNotModified {
  98756. if res.Body != nil {
  98757. res.Body.Close()
  98758. }
  98759. return nil, &googleapi.Error{
  98760. Code: res.StatusCode,
  98761. Header: res.Header,
  98762. }
  98763. }
  98764. if err != nil {
  98765. return nil, err
  98766. }
  98767. defer googleapi.CloseBody(res)
  98768. if err := googleapi.CheckResponse(res); err != nil {
  98769. return nil, err
  98770. }
  98771. ret := &Operation{
  98772. ServerResponse: googleapi.ServerResponse{
  98773. Header: res.Header,
  98774. HTTPStatusCode: res.StatusCode,
  98775. },
  98776. }
  98777. target := &ret
  98778. if err := gensupport.DecodeResponse(target, res); err != nil {
  98779. return nil, err
  98780. }
  98781. return ret, nil
  98782. // {
  98783. // "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.",
  98784. // "httpMethod": "POST",
  98785. // "id": "compute.projects.setUsageExportBucket",
  98786. // "parameterOrder": [
  98787. // "project"
  98788. // ],
  98789. // "parameters": {
  98790. // "project": {
  98791. // "description": "Project ID for this request.",
  98792. // "location": "path",
  98793. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98794. // "required": true,
  98795. // "type": "string"
  98796. // },
  98797. // "requestId": {
  98798. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98799. // "location": "query",
  98800. // "type": "string"
  98801. // }
  98802. // },
  98803. // "path": "{project}/setUsageExportBucket",
  98804. // "request": {
  98805. // "$ref": "UsageExportLocation"
  98806. // },
  98807. // "response": {
  98808. // "$ref": "Operation"
  98809. // },
  98810. // "scopes": [
  98811. // "https://www.googleapis.com/auth/cloud-platform",
  98812. // "https://www.googleapis.com/auth/compute",
  98813. // "https://www.googleapis.com/auth/devstorage.full_control",
  98814. // "https://www.googleapis.com/auth/devstorage.read_only",
  98815. // "https://www.googleapis.com/auth/devstorage.read_write"
  98816. // ]
  98817. // }
  98818. }
  98819. // method id "compute.regionAutoscalers.delete":
  98820. type RegionAutoscalersDeleteCall struct {
  98821. s *Service
  98822. project string
  98823. region string
  98824. autoscaler string
  98825. urlParams_ gensupport.URLParams
  98826. ctx_ context.Context
  98827. header_ http.Header
  98828. }
  98829. // Delete: Deletes the specified autoscaler.
  98830. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  98831. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98832. c.project = project
  98833. c.region = region
  98834. c.autoscaler = autoscaler
  98835. return c
  98836. }
  98837. // RequestId sets the optional parameter "requestId": An optional
  98838. // request ID to identify requests. Specify a unique request ID so that
  98839. // if you must retry your request, the server will know to ignore the
  98840. // request if it has already been completed.
  98841. //
  98842. // For example, consider a situation where you make an initial request
  98843. // and the request times out. If you make the request again with the
  98844. // same request ID, the server can check if original operation with the
  98845. // same request ID was received, and if so, will ignore the second
  98846. // request. This prevents clients from accidentally creating duplicate
  98847. // commitments.
  98848. //
  98849. // The request ID must be a valid UUID with the exception that zero UUID
  98850. // is not supported (00000000-0000-0000-0000-000000000000).
  98851. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  98852. c.urlParams_.Set("requestId", requestId)
  98853. return c
  98854. }
  98855. // Fields allows partial responses to be retrieved. See
  98856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98857. // for more information.
  98858. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  98859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98860. return c
  98861. }
  98862. // Context sets the context to be used in this call's Do method. Any
  98863. // pending HTTP request will be aborted if the provided context is
  98864. // canceled.
  98865. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  98866. c.ctx_ = ctx
  98867. return c
  98868. }
  98869. // Header returns an http.Header that can be modified by the caller to
  98870. // add HTTP headers to the request.
  98871. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  98872. if c.header_ == nil {
  98873. c.header_ = make(http.Header)
  98874. }
  98875. return c.header_
  98876. }
  98877. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  98878. reqHeaders := make(http.Header)
  98879. for k, v := range c.header_ {
  98880. reqHeaders[k] = v
  98881. }
  98882. reqHeaders.Set("User-Agent", c.s.userAgent())
  98883. var body io.Reader = nil
  98884. c.urlParams_.Set("alt", alt)
  98885. c.urlParams_.Set("prettyPrint", "false")
  98886. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  98887. urls += "?" + c.urlParams_.Encode()
  98888. req, err := http.NewRequest("DELETE", urls, body)
  98889. if err != nil {
  98890. return nil, err
  98891. }
  98892. req.Header = reqHeaders
  98893. googleapi.Expand(req.URL, map[string]string{
  98894. "project": c.project,
  98895. "region": c.region,
  98896. "autoscaler": c.autoscaler,
  98897. })
  98898. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98899. }
  98900. // Do executes the "compute.regionAutoscalers.delete" call.
  98901. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98902. // status code is an error. Response headers are in either
  98903. // *Operation.ServerResponse.Header or (if a response was returned at
  98904. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98905. // to check whether the returned error was because
  98906. // http.StatusNotModified was returned.
  98907. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98908. gensupport.SetOptions(c.urlParams_, opts...)
  98909. res, err := c.doRequest("json")
  98910. if res != nil && res.StatusCode == http.StatusNotModified {
  98911. if res.Body != nil {
  98912. res.Body.Close()
  98913. }
  98914. return nil, &googleapi.Error{
  98915. Code: res.StatusCode,
  98916. Header: res.Header,
  98917. }
  98918. }
  98919. if err != nil {
  98920. return nil, err
  98921. }
  98922. defer googleapi.CloseBody(res)
  98923. if err := googleapi.CheckResponse(res); err != nil {
  98924. return nil, err
  98925. }
  98926. ret := &Operation{
  98927. ServerResponse: googleapi.ServerResponse{
  98928. Header: res.Header,
  98929. HTTPStatusCode: res.StatusCode,
  98930. },
  98931. }
  98932. target := &ret
  98933. if err := gensupport.DecodeResponse(target, res); err != nil {
  98934. return nil, err
  98935. }
  98936. return ret, nil
  98937. // {
  98938. // "description": "Deletes the specified autoscaler.",
  98939. // "httpMethod": "DELETE",
  98940. // "id": "compute.regionAutoscalers.delete",
  98941. // "parameterOrder": [
  98942. // "project",
  98943. // "region",
  98944. // "autoscaler"
  98945. // ],
  98946. // "parameters": {
  98947. // "autoscaler": {
  98948. // "description": "Name of the autoscaler to delete.",
  98949. // "location": "path",
  98950. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98951. // "required": true,
  98952. // "type": "string"
  98953. // },
  98954. // "project": {
  98955. // "description": "Project ID for this request.",
  98956. // "location": "path",
  98957. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98958. // "required": true,
  98959. // "type": "string"
  98960. // },
  98961. // "region": {
  98962. // "description": "Name of the region scoping this request.",
  98963. // "location": "path",
  98964. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98965. // "required": true,
  98966. // "type": "string"
  98967. // },
  98968. // "requestId": {
  98969. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98970. // "location": "query",
  98971. // "type": "string"
  98972. // }
  98973. // },
  98974. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  98975. // "response": {
  98976. // "$ref": "Operation"
  98977. // },
  98978. // "scopes": [
  98979. // "https://www.googleapis.com/auth/cloud-platform",
  98980. // "https://www.googleapis.com/auth/compute"
  98981. // ]
  98982. // }
  98983. }
  98984. // method id "compute.regionAutoscalers.get":
  98985. type RegionAutoscalersGetCall struct {
  98986. s *Service
  98987. project string
  98988. region string
  98989. autoscaler string
  98990. urlParams_ gensupport.URLParams
  98991. ifNoneMatch_ string
  98992. ctx_ context.Context
  98993. header_ http.Header
  98994. }
  98995. // Get: Returns the specified autoscaler.
  98996. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  98997. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98998. c.project = project
  98999. c.region = region
  99000. c.autoscaler = autoscaler
  99001. return c
  99002. }
  99003. // Fields allows partial responses to be retrieved. See
  99004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99005. // for more information.
  99006. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  99007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99008. return c
  99009. }
  99010. // IfNoneMatch sets the optional parameter which makes the operation
  99011. // fail if the object's ETag matches the given value. This is useful for
  99012. // getting updates only after the object has changed since the last
  99013. // request. Use googleapi.IsNotModified to check whether the response
  99014. // error from Do is the result of In-None-Match.
  99015. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  99016. c.ifNoneMatch_ = entityTag
  99017. return c
  99018. }
  99019. // Context sets the context to be used in this call's Do method. Any
  99020. // pending HTTP request will be aborted if the provided context is
  99021. // canceled.
  99022. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  99023. c.ctx_ = ctx
  99024. return c
  99025. }
  99026. // Header returns an http.Header that can be modified by the caller to
  99027. // add HTTP headers to the request.
  99028. func (c *RegionAutoscalersGetCall) Header() http.Header {
  99029. if c.header_ == nil {
  99030. c.header_ = make(http.Header)
  99031. }
  99032. return c.header_
  99033. }
  99034. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  99035. reqHeaders := make(http.Header)
  99036. for k, v := range c.header_ {
  99037. reqHeaders[k] = v
  99038. }
  99039. reqHeaders.Set("User-Agent", c.s.userAgent())
  99040. if c.ifNoneMatch_ != "" {
  99041. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99042. }
  99043. var body io.Reader = nil
  99044. c.urlParams_.Set("alt", alt)
  99045. c.urlParams_.Set("prettyPrint", "false")
  99046. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  99047. urls += "?" + c.urlParams_.Encode()
  99048. req, err := http.NewRequest("GET", urls, body)
  99049. if err != nil {
  99050. return nil, err
  99051. }
  99052. req.Header = reqHeaders
  99053. googleapi.Expand(req.URL, map[string]string{
  99054. "project": c.project,
  99055. "region": c.region,
  99056. "autoscaler": c.autoscaler,
  99057. })
  99058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99059. }
  99060. // Do executes the "compute.regionAutoscalers.get" call.
  99061. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  99062. // status code is an error. Response headers are in either
  99063. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  99064. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99065. // to check whether the returned error was because
  99066. // http.StatusNotModified was returned.
  99067. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  99068. gensupport.SetOptions(c.urlParams_, opts...)
  99069. res, err := c.doRequest("json")
  99070. if res != nil && res.StatusCode == http.StatusNotModified {
  99071. if res.Body != nil {
  99072. res.Body.Close()
  99073. }
  99074. return nil, &googleapi.Error{
  99075. Code: res.StatusCode,
  99076. Header: res.Header,
  99077. }
  99078. }
  99079. if err != nil {
  99080. return nil, err
  99081. }
  99082. defer googleapi.CloseBody(res)
  99083. if err := googleapi.CheckResponse(res); err != nil {
  99084. return nil, err
  99085. }
  99086. ret := &Autoscaler{
  99087. ServerResponse: googleapi.ServerResponse{
  99088. Header: res.Header,
  99089. HTTPStatusCode: res.StatusCode,
  99090. },
  99091. }
  99092. target := &ret
  99093. if err := gensupport.DecodeResponse(target, res); err != nil {
  99094. return nil, err
  99095. }
  99096. return ret, nil
  99097. // {
  99098. // "description": "Returns the specified autoscaler.",
  99099. // "httpMethod": "GET",
  99100. // "id": "compute.regionAutoscalers.get",
  99101. // "parameterOrder": [
  99102. // "project",
  99103. // "region",
  99104. // "autoscaler"
  99105. // ],
  99106. // "parameters": {
  99107. // "autoscaler": {
  99108. // "description": "Name of the autoscaler to return.",
  99109. // "location": "path",
  99110. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99111. // "required": true,
  99112. // "type": "string"
  99113. // },
  99114. // "project": {
  99115. // "description": "Project ID for this request.",
  99116. // "location": "path",
  99117. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99118. // "required": true,
  99119. // "type": "string"
  99120. // },
  99121. // "region": {
  99122. // "description": "Name of the region scoping this request.",
  99123. // "location": "path",
  99124. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99125. // "required": true,
  99126. // "type": "string"
  99127. // }
  99128. // },
  99129. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  99130. // "response": {
  99131. // "$ref": "Autoscaler"
  99132. // },
  99133. // "scopes": [
  99134. // "https://www.googleapis.com/auth/cloud-platform",
  99135. // "https://www.googleapis.com/auth/compute",
  99136. // "https://www.googleapis.com/auth/compute.readonly"
  99137. // ]
  99138. // }
  99139. }
  99140. // method id "compute.regionAutoscalers.insert":
  99141. type RegionAutoscalersInsertCall struct {
  99142. s *Service
  99143. project string
  99144. region string
  99145. autoscaler *Autoscaler
  99146. urlParams_ gensupport.URLParams
  99147. ctx_ context.Context
  99148. header_ http.Header
  99149. }
  99150. // Insert: Creates an autoscaler in the specified project using the data
  99151. // included in the request.
  99152. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  99153. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99154. c.project = project
  99155. c.region = region
  99156. c.autoscaler = autoscaler
  99157. return c
  99158. }
  99159. // RequestId sets the optional parameter "requestId": An optional
  99160. // request ID to identify requests. Specify a unique request ID so that
  99161. // if you must retry your request, the server will know to ignore the
  99162. // request if it has already been completed.
  99163. //
  99164. // For example, consider a situation where you make an initial request
  99165. // and the request times out. If you make the request again with the
  99166. // same request ID, the server can check if original operation with the
  99167. // same request ID was received, and if so, will ignore the second
  99168. // request. This prevents clients from accidentally creating duplicate
  99169. // commitments.
  99170. //
  99171. // The request ID must be a valid UUID with the exception that zero UUID
  99172. // is not supported (00000000-0000-0000-0000-000000000000).
  99173. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  99174. c.urlParams_.Set("requestId", requestId)
  99175. return c
  99176. }
  99177. // Fields allows partial responses to be retrieved. See
  99178. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99179. // for more information.
  99180. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  99181. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99182. return c
  99183. }
  99184. // Context sets the context to be used in this call's Do method. Any
  99185. // pending HTTP request will be aborted if the provided context is
  99186. // canceled.
  99187. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  99188. c.ctx_ = ctx
  99189. return c
  99190. }
  99191. // Header returns an http.Header that can be modified by the caller to
  99192. // add HTTP headers to the request.
  99193. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  99194. if c.header_ == nil {
  99195. c.header_ = make(http.Header)
  99196. }
  99197. return c.header_
  99198. }
  99199. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  99200. reqHeaders := make(http.Header)
  99201. for k, v := range c.header_ {
  99202. reqHeaders[k] = v
  99203. }
  99204. reqHeaders.Set("User-Agent", c.s.userAgent())
  99205. var body io.Reader = nil
  99206. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  99207. if err != nil {
  99208. return nil, err
  99209. }
  99210. reqHeaders.Set("Content-Type", "application/json")
  99211. c.urlParams_.Set("alt", alt)
  99212. c.urlParams_.Set("prettyPrint", "false")
  99213. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  99214. urls += "?" + c.urlParams_.Encode()
  99215. req, err := http.NewRequest("POST", urls, body)
  99216. if err != nil {
  99217. return nil, err
  99218. }
  99219. req.Header = reqHeaders
  99220. googleapi.Expand(req.URL, map[string]string{
  99221. "project": c.project,
  99222. "region": c.region,
  99223. })
  99224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99225. }
  99226. // Do executes the "compute.regionAutoscalers.insert" call.
  99227. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99228. // status code is an error. Response headers are in either
  99229. // *Operation.ServerResponse.Header or (if a response was returned at
  99230. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99231. // to check whether the returned error was because
  99232. // http.StatusNotModified was returned.
  99233. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99234. gensupport.SetOptions(c.urlParams_, opts...)
  99235. res, err := c.doRequest("json")
  99236. if res != nil && res.StatusCode == http.StatusNotModified {
  99237. if res.Body != nil {
  99238. res.Body.Close()
  99239. }
  99240. return nil, &googleapi.Error{
  99241. Code: res.StatusCode,
  99242. Header: res.Header,
  99243. }
  99244. }
  99245. if err != nil {
  99246. return nil, err
  99247. }
  99248. defer googleapi.CloseBody(res)
  99249. if err := googleapi.CheckResponse(res); err != nil {
  99250. return nil, err
  99251. }
  99252. ret := &Operation{
  99253. ServerResponse: googleapi.ServerResponse{
  99254. Header: res.Header,
  99255. HTTPStatusCode: res.StatusCode,
  99256. },
  99257. }
  99258. target := &ret
  99259. if err := gensupport.DecodeResponse(target, res); err != nil {
  99260. return nil, err
  99261. }
  99262. return ret, nil
  99263. // {
  99264. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  99265. // "httpMethod": "POST",
  99266. // "id": "compute.regionAutoscalers.insert",
  99267. // "parameterOrder": [
  99268. // "project",
  99269. // "region"
  99270. // ],
  99271. // "parameters": {
  99272. // "project": {
  99273. // "description": "Project ID for this request.",
  99274. // "location": "path",
  99275. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99276. // "required": true,
  99277. // "type": "string"
  99278. // },
  99279. // "region": {
  99280. // "description": "Name of the region scoping this request.",
  99281. // "location": "path",
  99282. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99283. // "required": true,
  99284. // "type": "string"
  99285. // },
  99286. // "requestId": {
  99287. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99288. // "location": "query",
  99289. // "type": "string"
  99290. // }
  99291. // },
  99292. // "path": "{project}/regions/{region}/autoscalers",
  99293. // "request": {
  99294. // "$ref": "Autoscaler"
  99295. // },
  99296. // "response": {
  99297. // "$ref": "Operation"
  99298. // },
  99299. // "scopes": [
  99300. // "https://www.googleapis.com/auth/cloud-platform",
  99301. // "https://www.googleapis.com/auth/compute"
  99302. // ]
  99303. // }
  99304. }
  99305. // method id "compute.regionAutoscalers.list":
  99306. type RegionAutoscalersListCall struct {
  99307. s *Service
  99308. project string
  99309. region string
  99310. urlParams_ gensupport.URLParams
  99311. ifNoneMatch_ string
  99312. ctx_ context.Context
  99313. header_ http.Header
  99314. }
  99315. // List: Retrieves a list of autoscalers contained within the specified
  99316. // region.
  99317. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  99318. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99319. c.project = project
  99320. c.region = region
  99321. return c
  99322. }
  99323. // Filter sets the optional parameter "filter": A filter expression that
  99324. // filters resources listed in the response. The expression must specify
  99325. // the field name, a comparison operator, and the value that you want to
  99326. // use for filtering. The value must be a string, a number, or a
  99327. // boolean. The comparison operator must be either =, !=, >, or <.
  99328. //
  99329. // For example, if you are filtering Compute Engine instances, you can
  99330. // exclude instances named example-instance by specifying name !=
  99331. // example-instance.
  99332. //
  99333. // You can also filter nested fields. For example, you could specify
  99334. // scheduling.automaticRestart = false to include instances only if they
  99335. // are not scheduled for automatic restarts. You can use filtering on
  99336. // nested fields to filter based on resource labels.
  99337. //
  99338. // To filter on multiple expressions, provide each separate expression
  99339. // within parentheses. For example, (scheduling.automaticRestart = true)
  99340. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  99341. // AND expression. However, you can include AND and OR expressions
  99342. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  99343. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  99344. // true).
  99345. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  99346. c.urlParams_.Set("filter", filter)
  99347. return c
  99348. }
  99349. // MaxResults sets the optional parameter "maxResults": The maximum
  99350. // number of results per page that should be returned. If the number of
  99351. // available results is larger than maxResults, Compute Engine returns a
  99352. // nextPageToken that can be used to get the next page of results in
  99353. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  99354. // (Default: 500)
  99355. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  99356. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  99357. return c
  99358. }
  99359. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  99360. // a certain order. By default, results are returned in alphanumerical
  99361. // order based on the resource name.
  99362. //
  99363. // You can also sort results in descending order based on the creation
  99364. // timestamp using orderBy="creationTimestamp desc". This sorts results
  99365. // based on the creationTimestamp field in reverse chronological order
  99366. // (newest result first). Use this to sort resources like operations so
  99367. // that the newest operation is returned first.
  99368. //
  99369. // Currently, only sorting by name or creationTimestamp desc is
  99370. // supported.
  99371. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  99372. c.urlParams_.Set("orderBy", orderBy)
  99373. return c
  99374. }
  99375. // PageToken sets the optional parameter "pageToken": Specifies a page
  99376. // token to use. Set pageToken to the nextPageToken returned by a
  99377. // previous list request to get the next page of results.
  99378. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  99379. c.urlParams_.Set("pageToken", pageToken)
  99380. return c
  99381. }
  99382. // Fields allows partial responses to be retrieved. See
  99383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99384. // for more information.
  99385. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  99386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99387. return c
  99388. }
  99389. // IfNoneMatch sets the optional parameter which makes the operation
  99390. // fail if the object's ETag matches the given value. This is useful for
  99391. // getting updates only after the object has changed since the last
  99392. // request. Use googleapi.IsNotModified to check whether the response
  99393. // error from Do is the result of In-None-Match.
  99394. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  99395. c.ifNoneMatch_ = entityTag
  99396. return c
  99397. }
  99398. // Context sets the context to be used in this call's Do method. Any
  99399. // pending HTTP request will be aborted if the provided context is
  99400. // canceled.
  99401. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  99402. c.ctx_ = ctx
  99403. return c
  99404. }
  99405. // Header returns an http.Header that can be modified by the caller to
  99406. // add HTTP headers to the request.
  99407. func (c *RegionAutoscalersListCall) Header() http.Header {
  99408. if c.header_ == nil {
  99409. c.header_ = make(http.Header)
  99410. }
  99411. return c.header_
  99412. }
  99413. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  99414. reqHeaders := make(http.Header)
  99415. for k, v := range c.header_ {
  99416. reqHeaders[k] = v
  99417. }
  99418. reqHeaders.Set("User-Agent", c.s.userAgent())
  99419. if c.ifNoneMatch_ != "" {
  99420. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99421. }
  99422. var body io.Reader = nil
  99423. c.urlParams_.Set("alt", alt)
  99424. c.urlParams_.Set("prettyPrint", "false")
  99425. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  99426. urls += "?" + c.urlParams_.Encode()
  99427. req, err := http.NewRequest("GET", urls, body)
  99428. if err != nil {
  99429. return nil, err
  99430. }
  99431. req.Header = reqHeaders
  99432. googleapi.Expand(req.URL, map[string]string{
  99433. "project": c.project,
  99434. "region": c.region,
  99435. })
  99436. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99437. }
  99438. // Do executes the "compute.regionAutoscalers.list" call.
  99439. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  99440. // non-2xx status code is an error. Response headers are in either
  99441. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  99442. // returned at all) in error.(*googleapi.Error).Header. Use
  99443. // googleapi.IsNotModified to check whether the returned error was
  99444. // because http.StatusNotModified was returned.
  99445. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  99446. gensupport.SetOptions(c.urlParams_, opts...)
  99447. res, err := c.doRequest("json")
  99448. if res != nil && res.StatusCode == http.StatusNotModified {
  99449. if res.Body != nil {
  99450. res.Body.Close()
  99451. }
  99452. return nil, &googleapi.Error{
  99453. Code: res.StatusCode,
  99454. Header: res.Header,
  99455. }
  99456. }
  99457. if err != nil {
  99458. return nil, err
  99459. }
  99460. defer googleapi.CloseBody(res)
  99461. if err := googleapi.CheckResponse(res); err != nil {
  99462. return nil, err
  99463. }
  99464. ret := &RegionAutoscalerList{
  99465. ServerResponse: googleapi.ServerResponse{
  99466. Header: res.Header,
  99467. HTTPStatusCode: res.StatusCode,
  99468. },
  99469. }
  99470. target := &ret
  99471. if err := gensupport.DecodeResponse(target, res); err != nil {
  99472. return nil, err
  99473. }
  99474. return ret, nil
  99475. // {
  99476. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  99477. // "httpMethod": "GET",
  99478. // "id": "compute.regionAutoscalers.list",
  99479. // "parameterOrder": [
  99480. // "project",
  99481. // "region"
  99482. // ],
  99483. // "parameters": {
  99484. // "filter": {
  99485. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  99486. // "location": "query",
  99487. // "type": "string"
  99488. // },
  99489. // "maxResults": {
  99490. // "default": "500",
  99491. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  99492. // "format": "uint32",
  99493. // "location": "query",
  99494. // "minimum": "0",
  99495. // "type": "integer"
  99496. // },
  99497. // "orderBy": {
  99498. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  99499. // "location": "query",
  99500. // "type": "string"
  99501. // },
  99502. // "pageToken": {
  99503. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  99504. // "location": "query",
  99505. // "type": "string"
  99506. // },
  99507. // "project": {
  99508. // "description": "Project ID for this request.",
  99509. // "location": "path",
  99510. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99511. // "required": true,
  99512. // "type": "string"
  99513. // },
  99514. // "region": {
  99515. // "description": "Name of the region scoping this request.",
  99516. // "location": "path",
  99517. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99518. // "required": true,
  99519. // "type": "string"
  99520. // }
  99521. // },
  99522. // "path": "{project}/regions/{region}/autoscalers",
  99523. // "response": {
  99524. // "$ref": "RegionAutoscalerList"
  99525. // },
  99526. // "scopes": [
  99527. // "https://www.googleapis.com/auth/cloud-platform",
  99528. // "https://www.googleapis.com/auth/compute",
  99529. // "https://www.googleapis.com/auth/compute.readonly"
  99530. // ]
  99531. // }
  99532. }
  99533. // Pages invokes f for each page of results.
  99534. // A non-nil error returned from f will halt the iteration.
  99535. // The provided context supersedes any context provided to the Context method.
  99536. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  99537. c.ctx_ = ctx
  99538. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  99539. for {
  99540. x, err := c.Do()
  99541. if err != nil {
  99542. return err
  99543. }
  99544. if err := f(x); err != nil {
  99545. return err
  99546. }
  99547. if x.NextPageToken == "" {
  99548. return nil
  99549. }
  99550. c.PageToken(x.NextPageToken)
  99551. }
  99552. }
  99553. // method id "compute.regionAutoscalers.patch":
  99554. type RegionAutoscalersPatchCall struct {
  99555. s *Service
  99556. project string
  99557. region string
  99558. autoscaler *Autoscaler
  99559. urlParams_ gensupport.URLParams
  99560. ctx_ context.Context
  99561. header_ http.Header
  99562. }
  99563. // Patch: Updates an autoscaler in the specified project using the data
  99564. // included in the request. This method supports PATCH semantics and
  99565. // uses the JSON merge patch format and processing rules.
  99566. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  99567. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99568. c.project = project
  99569. c.region = region
  99570. c.autoscaler = autoscaler
  99571. return c
  99572. }
  99573. // Autoscaler sets the optional parameter "autoscaler": Name of the
  99574. // autoscaler to patch.
  99575. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  99576. c.urlParams_.Set("autoscaler", autoscaler)
  99577. return c
  99578. }
  99579. // RequestId sets the optional parameter "requestId": An optional
  99580. // request ID to identify requests. Specify a unique request ID so that
  99581. // if you must retry your request, the server will know to ignore the
  99582. // request if it has already been completed.
  99583. //
  99584. // For example, consider a situation where you make an initial request
  99585. // and the request times out. If you make the request again with the
  99586. // same request ID, the server can check if original operation with the
  99587. // same request ID was received, and if so, will ignore the second
  99588. // request. This prevents clients from accidentally creating duplicate
  99589. // commitments.
  99590. //
  99591. // The request ID must be a valid UUID with the exception that zero UUID
  99592. // is not supported (00000000-0000-0000-0000-000000000000).
  99593. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  99594. c.urlParams_.Set("requestId", requestId)
  99595. return c
  99596. }
  99597. // Fields allows partial responses to be retrieved. See
  99598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99599. // for more information.
  99600. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  99601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99602. return c
  99603. }
  99604. // Context sets the context to be used in this call's Do method. Any
  99605. // pending HTTP request will be aborted if the provided context is
  99606. // canceled.
  99607. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  99608. c.ctx_ = ctx
  99609. return c
  99610. }
  99611. // Header returns an http.Header that can be modified by the caller to
  99612. // add HTTP headers to the request.
  99613. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  99614. if c.header_ == nil {
  99615. c.header_ = make(http.Header)
  99616. }
  99617. return c.header_
  99618. }
  99619. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  99620. reqHeaders := make(http.Header)
  99621. for k, v := range c.header_ {
  99622. reqHeaders[k] = v
  99623. }
  99624. reqHeaders.Set("User-Agent", c.s.userAgent())
  99625. var body io.Reader = nil
  99626. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  99627. if err != nil {
  99628. return nil, err
  99629. }
  99630. reqHeaders.Set("Content-Type", "application/json")
  99631. c.urlParams_.Set("alt", alt)
  99632. c.urlParams_.Set("prettyPrint", "false")
  99633. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  99634. urls += "?" + c.urlParams_.Encode()
  99635. req, err := http.NewRequest("PATCH", urls, body)
  99636. if err != nil {
  99637. return nil, err
  99638. }
  99639. req.Header = reqHeaders
  99640. googleapi.Expand(req.URL, map[string]string{
  99641. "project": c.project,
  99642. "region": c.region,
  99643. })
  99644. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99645. }
  99646. // Do executes the "compute.regionAutoscalers.patch" call.
  99647. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99648. // status code is an error. Response headers are in either
  99649. // *Operation.ServerResponse.Header or (if a response was returned at
  99650. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99651. // to check whether the returned error was because
  99652. // http.StatusNotModified was returned.
  99653. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99654. gensupport.SetOptions(c.urlParams_, opts...)
  99655. res, err := c.doRequest("json")
  99656. if res != nil && res.StatusCode == http.StatusNotModified {
  99657. if res.Body != nil {
  99658. res.Body.Close()
  99659. }
  99660. return nil, &googleapi.Error{
  99661. Code: res.StatusCode,
  99662. Header: res.Header,
  99663. }
  99664. }
  99665. if err != nil {
  99666. return nil, err
  99667. }
  99668. defer googleapi.CloseBody(res)
  99669. if err := googleapi.CheckResponse(res); err != nil {
  99670. return nil, err
  99671. }
  99672. ret := &Operation{
  99673. ServerResponse: googleapi.ServerResponse{
  99674. Header: res.Header,
  99675. HTTPStatusCode: res.StatusCode,
  99676. },
  99677. }
  99678. target := &ret
  99679. if err := gensupport.DecodeResponse(target, res); err != nil {
  99680. return nil, err
  99681. }
  99682. return ret, nil
  99683. // {
  99684. // "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.",
  99685. // "httpMethod": "PATCH",
  99686. // "id": "compute.regionAutoscalers.patch",
  99687. // "parameterOrder": [
  99688. // "project",
  99689. // "region"
  99690. // ],
  99691. // "parameters": {
  99692. // "autoscaler": {
  99693. // "description": "Name of the autoscaler to patch.",
  99694. // "location": "query",
  99695. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99696. // "type": "string"
  99697. // },
  99698. // "project": {
  99699. // "description": "Project ID for this request.",
  99700. // "location": "path",
  99701. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99702. // "required": true,
  99703. // "type": "string"
  99704. // },
  99705. // "region": {
  99706. // "description": "Name of the region scoping this request.",
  99707. // "location": "path",
  99708. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99709. // "required": true,
  99710. // "type": "string"
  99711. // },
  99712. // "requestId": {
  99713. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99714. // "location": "query",
  99715. // "type": "string"
  99716. // }
  99717. // },
  99718. // "path": "{project}/regions/{region}/autoscalers",
  99719. // "request": {
  99720. // "$ref": "Autoscaler"
  99721. // },
  99722. // "response": {
  99723. // "$ref": "Operation"
  99724. // },
  99725. // "scopes": [
  99726. // "https://www.googleapis.com/auth/cloud-platform",
  99727. // "https://www.googleapis.com/auth/compute"
  99728. // ]
  99729. // }
  99730. }
  99731. // method id "compute.regionAutoscalers.testIamPermissions":
  99732. type RegionAutoscalersTestIamPermissionsCall struct {
  99733. s *Service
  99734. project string
  99735. region string
  99736. resource string
  99737. testpermissionsrequest *TestPermissionsRequest
  99738. urlParams_ gensupport.URLParams
  99739. ctx_ context.Context
  99740. header_ http.Header
  99741. }
  99742. // TestIamPermissions: Returns permissions that a caller has on the
  99743. // specified resource.
  99744. func (r *RegionAutoscalersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionAutoscalersTestIamPermissionsCall {
  99745. c := &RegionAutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99746. c.project = project
  99747. c.region = region
  99748. c.resource = resource
  99749. c.testpermissionsrequest = testpermissionsrequest
  99750. return c
  99751. }
  99752. // Fields allows partial responses to be retrieved. See
  99753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99754. // for more information.
  99755. func (c *RegionAutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionAutoscalersTestIamPermissionsCall {
  99756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99757. return c
  99758. }
  99759. // Context sets the context to be used in this call's Do method. Any
  99760. // pending HTTP request will be aborted if the provided context is
  99761. // canceled.
  99762. func (c *RegionAutoscalersTestIamPermissionsCall) Context(ctx context.Context) *RegionAutoscalersTestIamPermissionsCall {
  99763. c.ctx_ = ctx
  99764. return c
  99765. }
  99766. // Header returns an http.Header that can be modified by the caller to
  99767. // add HTTP headers to the request.
  99768. func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header {
  99769. if c.header_ == nil {
  99770. c.header_ = make(http.Header)
  99771. }
  99772. return c.header_
  99773. }
  99774. func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  99775. reqHeaders := make(http.Header)
  99776. for k, v := range c.header_ {
  99777. reqHeaders[k] = v
  99778. }
  99779. reqHeaders.Set("User-Agent", c.s.userAgent())
  99780. var body io.Reader = nil
  99781. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  99782. if err != nil {
  99783. return nil, err
  99784. }
  99785. reqHeaders.Set("Content-Type", "application/json")
  99786. c.urlParams_.Set("alt", alt)
  99787. c.urlParams_.Set("prettyPrint", "false")
  99788. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions")
  99789. urls += "?" + c.urlParams_.Encode()
  99790. req, err := http.NewRequest("POST", urls, body)
  99791. if err != nil {
  99792. return nil, err
  99793. }
  99794. req.Header = reqHeaders
  99795. googleapi.Expand(req.URL, map[string]string{
  99796. "project": c.project,
  99797. "region": c.region,
  99798. "resource": c.resource,
  99799. })
  99800. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99801. }
  99802. // Do executes the "compute.regionAutoscalers.testIamPermissions" call.
  99803. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  99804. // non-2xx status code is an error. Response headers are in either
  99805. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  99806. // returned at all) in error.(*googleapi.Error).Header. Use
  99807. // googleapi.IsNotModified to check whether the returned error was
  99808. // because http.StatusNotModified was returned.
  99809. func (c *RegionAutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  99810. gensupport.SetOptions(c.urlParams_, opts...)
  99811. res, err := c.doRequest("json")
  99812. if res != nil && res.StatusCode == http.StatusNotModified {
  99813. if res.Body != nil {
  99814. res.Body.Close()
  99815. }
  99816. return nil, &googleapi.Error{
  99817. Code: res.StatusCode,
  99818. Header: res.Header,
  99819. }
  99820. }
  99821. if err != nil {
  99822. return nil, err
  99823. }
  99824. defer googleapi.CloseBody(res)
  99825. if err := googleapi.CheckResponse(res); err != nil {
  99826. return nil, err
  99827. }
  99828. ret := &TestPermissionsResponse{
  99829. ServerResponse: googleapi.ServerResponse{
  99830. Header: res.Header,
  99831. HTTPStatusCode: res.StatusCode,
  99832. },
  99833. }
  99834. target := &ret
  99835. if err := gensupport.DecodeResponse(target, res); err != nil {
  99836. return nil, err
  99837. }
  99838. return ret, nil
  99839. // {
  99840. // "description": "Returns permissions that a caller has on the specified resource.",
  99841. // "httpMethod": "POST",
  99842. // "id": "compute.regionAutoscalers.testIamPermissions",
  99843. // "parameterOrder": [
  99844. // "project",
  99845. // "region",
  99846. // "resource"
  99847. // ],
  99848. // "parameters": {
  99849. // "project": {
  99850. // "description": "Project ID for this request.",
  99851. // "location": "path",
  99852. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99853. // "required": true,
  99854. // "type": "string"
  99855. // },
  99856. // "region": {
  99857. // "description": "The name of the region for this request.",
  99858. // "location": "path",
  99859. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99860. // "required": true,
  99861. // "type": "string"
  99862. // },
  99863. // "resource": {
  99864. // "description": "Name or id of the resource for this request.",
  99865. // "location": "path",
  99866. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99867. // "required": true,
  99868. // "type": "string"
  99869. // }
  99870. // },
  99871. // "path": "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions",
  99872. // "request": {
  99873. // "$ref": "TestPermissionsRequest"
  99874. // },
  99875. // "response": {
  99876. // "$ref": "TestPermissionsResponse"
  99877. // },
  99878. // "scopes": [
  99879. // "https://www.googleapis.com/auth/cloud-platform",
  99880. // "https://www.googleapis.com/auth/compute",
  99881. // "https://www.googleapis.com/auth/compute.readonly"
  99882. // ]
  99883. // }
  99884. }
  99885. // method id "compute.regionAutoscalers.update":
  99886. type RegionAutoscalersUpdateCall struct {
  99887. s *Service
  99888. project string
  99889. region string
  99890. autoscaler *Autoscaler
  99891. urlParams_ gensupport.URLParams
  99892. ctx_ context.Context
  99893. header_ http.Header
  99894. }
  99895. // Update: Updates an autoscaler in the specified project using the data
  99896. // included in the request.
  99897. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  99898. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99899. c.project = project
  99900. c.region = region
  99901. c.autoscaler = autoscaler
  99902. return c
  99903. }
  99904. // Autoscaler sets the optional parameter "autoscaler": Name of the
  99905. // autoscaler to update.
  99906. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  99907. c.urlParams_.Set("autoscaler", autoscaler)
  99908. return c
  99909. }
  99910. // RequestId sets the optional parameter "requestId": An optional
  99911. // request ID to identify requests. Specify a unique request ID so that
  99912. // if you must retry your request, the server will know to ignore the
  99913. // request if it has already been completed.
  99914. //
  99915. // For example, consider a situation where you make an initial request
  99916. // and the request times out. If you make the request again with the
  99917. // same request ID, the server can check if original operation with the
  99918. // same request ID was received, and if so, will ignore the second
  99919. // request. This prevents clients from accidentally creating duplicate
  99920. // commitments.
  99921. //
  99922. // The request ID must be a valid UUID with the exception that zero UUID
  99923. // is not supported (00000000-0000-0000-0000-000000000000).
  99924. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  99925. c.urlParams_.Set("requestId", requestId)
  99926. return c
  99927. }
  99928. // Fields allows partial responses to be retrieved. See
  99929. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99930. // for more information.
  99931. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  99932. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99933. return c
  99934. }
  99935. // Context sets the context to be used in this call's Do method. Any
  99936. // pending HTTP request will be aborted if the provided context is
  99937. // canceled.
  99938. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  99939. c.ctx_ = ctx
  99940. return c
  99941. }
  99942. // Header returns an http.Header that can be modified by the caller to
  99943. // add HTTP headers to the request.
  99944. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  99945. if c.header_ == nil {
  99946. c.header_ = make(http.Header)
  99947. }
  99948. return c.header_
  99949. }
  99950. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  99951. reqHeaders := make(http.Header)
  99952. for k, v := range c.header_ {
  99953. reqHeaders[k] = v
  99954. }
  99955. reqHeaders.Set("User-Agent", c.s.userAgent())
  99956. var body io.Reader = nil
  99957. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  99958. if err != nil {
  99959. return nil, err
  99960. }
  99961. reqHeaders.Set("Content-Type", "application/json")
  99962. c.urlParams_.Set("alt", alt)
  99963. c.urlParams_.Set("prettyPrint", "false")
  99964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  99965. urls += "?" + c.urlParams_.Encode()
  99966. req, err := http.NewRequest("PUT", urls, body)
  99967. if err != nil {
  99968. return nil, err
  99969. }
  99970. req.Header = reqHeaders
  99971. googleapi.Expand(req.URL, map[string]string{
  99972. "project": c.project,
  99973. "region": c.region,
  99974. })
  99975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99976. }
  99977. // Do executes the "compute.regionAutoscalers.update" call.
  99978. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99979. // status code is an error. Response headers are in either
  99980. // *Operation.ServerResponse.Header or (if a response was returned at
  99981. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99982. // to check whether the returned error was because
  99983. // http.StatusNotModified was returned.
  99984. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99985. gensupport.SetOptions(c.urlParams_, opts...)
  99986. res, err := c.doRequest("json")
  99987. if res != nil && res.StatusCode == http.StatusNotModified {
  99988. if res.Body != nil {
  99989. res.Body.Close()
  99990. }
  99991. return nil, &googleapi.Error{
  99992. Code: res.StatusCode,
  99993. Header: res.Header,
  99994. }
  99995. }
  99996. if err != nil {
  99997. return nil, err
  99998. }
  99999. defer googleapi.CloseBody(res)
  100000. if err := googleapi.CheckResponse(res); err != nil {
  100001. return nil, err
  100002. }
  100003. ret := &Operation{
  100004. ServerResponse: googleapi.ServerResponse{
  100005. Header: res.Header,
  100006. HTTPStatusCode: res.StatusCode,
  100007. },
  100008. }
  100009. target := &ret
  100010. if err := gensupport.DecodeResponse(target, res); err != nil {
  100011. return nil, err
  100012. }
  100013. return ret, nil
  100014. // {
  100015. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  100016. // "httpMethod": "PUT",
  100017. // "id": "compute.regionAutoscalers.update",
  100018. // "parameterOrder": [
  100019. // "project",
  100020. // "region"
  100021. // ],
  100022. // "parameters": {
  100023. // "autoscaler": {
  100024. // "description": "Name of the autoscaler to update.",
  100025. // "location": "query",
  100026. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100027. // "type": "string"
  100028. // },
  100029. // "project": {
  100030. // "description": "Project ID for this request.",
  100031. // "location": "path",
  100032. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100033. // "required": true,
  100034. // "type": "string"
  100035. // },
  100036. // "region": {
  100037. // "description": "Name of the region scoping this request.",
  100038. // "location": "path",
  100039. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100040. // "required": true,
  100041. // "type": "string"
  100042. // },
  100043. // "requestId": {
  100044. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100045. // "location": "query",
  100046. // "type": "string"
  100047. // }
  100048. // },
  100049. // "path": "{project}/regions/{region}/autoscalers",
  100050. // "request": {
  100051. // "$ref": "Autoscaler"
  100052. // },
  100053. // "response": {
  100054. // "$ref": "Operation"
  100055. // },
  100056. // "scopes": [
  100057. // "https://www.googleapis.com/auth/cloud-platform",
  100058. // "https://www.googleapis.com/auth/compute"
  100059. // ]
  100060. // }
  100061. }
  100062. // method id "compute.regionBackendServices.delete":
  100063. type RegionBackendServicesDeleteCall struct {
  100064. s *Service
  100065. project string
  100066. region string
  100067. backendService string
  100068. urlParams_ gensupport.URLParams
  100069. ctx_ context.Context
  100070. header_ http.Header
  100071. }
  100072. // Delete: Deletes the specified regional BackendService resource.
  100073. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  100074. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100075. c.project = project
  100076. c.region = region
  100077. c.backendService = backendService
  100078. return c
  100079. }
  100080. // RequestId sets the optional parameter "requestId": An optional
  100081. // request ID to identify requests. Specify a unique request ID so that
  100082. // if you must retry your request, the server will know to ignore the
  100083. // request if it has already been completed.
  100084. //
  100085. // For example, consider a situation where you make an initial request
  100086. // and the request times out. If you make the request again with the
  100087. // same request ID, the server can check if original operation with the
  100088. // same request ID was received, and if so, will ignore the second
  100089. // request. This prevents clients from accidentally creating duplicate
  100090. // commitments.
  100091. //
  100092. // The request ID must be a valid UUID with the exception that zero UUID
  100093. // is not supported (00000000-0000-0000-0000-000000000000).
  100094. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  100095. c.urlParams_.Set("requestId", requestId)
  100096. return c
  100097. }
  100098. // Fields allows partial responses to be retrieved. See
  100099. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100100. // for more information.
  100101. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  100102. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100103. return c
  100104. }
  100105. // Context sets the context to be used in this call's Do method. Any
  100106. // pending HTTP request will be aborted if the provided context is
  100107. // canceled.
  100108. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  100109. c.ctx_ = ctx
  100110. return c
  100111. }
  100112. // Header returns an http.Header that can be modified by the caller to
  100113. // add HTTP headers to the request.
  100114. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  100115. if c.header_ == nil {
  100116. c.header_ = make(http.Header)
  100117. }
  100118. return c.header_
  100119. }
  100120. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  100121. reqHeaders := make(http.Header)
  100122. for k, v := range c.header_ {
  100123. reqHeaders[k] = v
  100124. }
  100125. reqHeaders.Set("User-Agent", c.s.userAgent())
  100126. var body io.Reader = nil
  100127. c.urlParams_.Set("alt", alt)
  100128. c.urlParams_.Set("prettyPrint", "false")
  100129. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  100130. urls += "?" + c.urlParams_.Encode()
  100131. req, err := http.NewRequest("DELETE", urls, body)
  100132. if err != nil {
  100133. return nil, err
  100134. }
  100135. req.Header = reqHeaders
  100136. googleapi.Expand(req.URL, map[string]string{
  100137. "project": c.project,
  100138. "region": c.region,
  100139. "backendService": c.backendService,
  100140. })
  100141. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100142. }
  100143. // Do executes the "compute.regionBackendServices.delete" call.
  100144. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100145. // status code is an error. Response headers are in either
  100146. // *Operation.ServerResponse.Header or (if a response was returned at
  100147. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100148. // to check whether the returned error was because
  100149. // http.StatusNotModified was returned.
  100150. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100151. gensupport.SetOptions(c.urlParams_, opts...)
  100152. res, err := c.doRequest("json")
  100153. if res != nil && res.StatusCode == http.StatusNotModified {
  100154. if res.Body != nil {
  100155. res.Body.Close()
  100156. }
  100157. return nil, &googleapi.Error{
  100158. Code: res.StatusCode,
  100159. Header: res.Header,
  100160. }
  100161. }
  100162. if err != nil {
  100163. return nil, err
  100164. }
  100165. defer googleapi.CloseBody(res)
  100166. if err := googleapi.CheckResponse(res); err != nil {
  100167. return nil, err
  100168. }
  100169. ret := &Operation{
  100170. ServerResponse: googleapi.ServerResponse{
  100171. Header: res.Header,
  100172. HTTPStatusCode: res.StatusCode,
  100173. },
  100174. }
  100175. target := &ret
  100176. if err := gensupport.DecodeResponse(target, res); err != nil {
  100177. return nil, err
  100178. }
  100179. return ret, nil
  100180. // {
  100181. // "description": "Deletes the specified regional BackendService resource.",
  100182. // "httpMethod": "DELETE",
  100183. // "id": "compute.regionBackendServices.delete",
  100184. // "parameterOrder": [
  100185. // "project",
  100186. // "region",
  100187. // "backendService"
  100188. // ],
  100189. // "parameters": {
  100190. // "backendService": {
  100191. // "description": "Name of the BackendService resource to delete.",
  100192. // "location": "path",
  100193. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100194. // "required": true,
  100195. // "type": "string"
  100196. // },
  100197. // "project": {
  100198. // "description": "Project ID for this request.",
  100199. // "location": "path",
  100200. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100201. // "required": true,
  100202. // "type": "string"
  100203. // },
  100204. // "region": {
  100205. // "description": "Name of the region scoping this request.",
  100206. // "location": "path",
  100207. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100208. // "required": true,
  100209. // "type": "string"
  100210. // },
  100211. // "requestId": {
  100212. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100213. // "location": "query",
  100214. // "type": "string"
  100215. // }
  100216. // },
  100217. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  100218. // "response": {
  100219. // "$ref": "Operation"
  100220. // },
  100221. // "scopes": [
  100222. // "https://www.googleapis.com/auth/cloud-platform",
  100223. // "https://www.googleapis.com/auth/compute"
  100224. // ]
  100225. // }
  100226. }
  100227. // method id "compute.regionBackendServices.get":
  100228. type RegionBackendServicesGetCall struct {
  100229. s *Service
  100230. project string
  100231. region string
  100232. backendService string
  100233. urlParams_ gensupport.URLParams
  100234. ifNoneMatch_ string
  100235. ctx_ context.Context
  100236. header_ http.Header
  100237. }
  100238. // Get: Returns the specified regional BackendService resource.
  100239. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  100240. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100241. c.project = project
  100242. c.region = region
  100243. c.backendService = backendService
  100244. return c
  100245. }
  100246. // Fields allows partial responses to be retrieved. See
  100247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100248. // for more information.
  100249. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  100250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100251. return c
  100252. }
  100253. // IfNoneMatch sets the optional parameter which makes the operation
  100254. // fail if the object's ETag matches the given value. This is useful for
  100255. // getting updates only after the object has changed since the last
  100256. // request. Use googleapi.IsNotModified to check whether the response
  100257. // error from Do is the result of In-None-Match.
  100258. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  100259. c.ifNoneMatch_ = entityTag
  100260. return c
  100261. }
  100262. // Context sets the context to be used in this call's Do method. Any
  100263. // pending HTTP request will be aborted if the provided context is
  100264. // canceled.
  100265. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  100266. c.ctx_ = ctx
  100267. return c
  100268. }
  100269. // Header returns an http.Header that can be modified by the caller to
  100270. // add HTTP headers to the request.
  100271. func (c *RegionBackendServicesGetCall) Header() http.Header {
  100272. if c.header_ == nil {
  100273. c.header_ = make(http.Header)
  100274. }
  100275. return c.header_
  100276. }
  100277. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  100278. reqHeaders := make(http.Header)
  100279. for k, v := range c.header_ {
  100280. reqHeaders[k] = v
  100281. }
  100282. reqHeaders.Set("User-Agent", c.s.userAgent())
  100283. if c.ifNoneMatch_ != "" {
  100284. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100285. }
  100286. var body io.Reader = nil
  100287. c.urlParams_.Set("alt", alt)
  100288. c.urlParams_.Set("prettyPrint", "false")
  100289. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  100290. urls += "?" + c.urlParams_.Encode()
  100291. req, err := http.NewRequest("GET", urls, body)
  100292. if err != nil {
  100293. return nil, err
  100294. }
  100295. req.Header = reqHeaders
  100296. googleapi.Expand(req.URL, map[string]string{
  100297. "project": c.project,
  100298. "region": c.region,
  100299. "backendService": c.backendService,
  100300. })
  100301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100302. }
  100303. // Do executes the "compute.regionBackendServices.get" call.
  100304. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  100305. // status code is an error. Response headers are in either
  100306. // *BackendService.ServerResponse.Header or (if a response was returned
  100307. // at all) in error.(*googleapi.Error).Header. Use
  100308. // googleapi.IsNotModified to check whether the returned error was
  100309. // because http.StatusNotModified was returned.
  100310. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  100311. gensupport.SetOptions(c.urlParams_, opts...)
  100312. res, err := c.doRequest("json")
  100313. if res != nil && res.StatusCode == http.StatusNotModified {
  100314. if res.Body != nil {
  100315. res.Body.Close()
  100316. }
  100317. return nil, &googleapi.Error{
  100318. Code: res.StatusCode,
  100319. Header: res.Header,
  100320. }
  100321. }
  100322. if err != nil {
  100323. return nil, err
  100324. }
  100325. defer googleapi.CloseBody(res)
  100326. if err := googleapi.CheckResponse(res); err != nil {
  100327. return nil, err
  100328. }
  100329. ret := &BackendService{
  100330. ServerResponse: googleapi.ServerResponse{
  100331. Header: res.Header,
  100332. HTTPStatusCode: res.StatusCode,
  100333. },
  100334. }
  100335. target := &ret
  100336. if err := gensupport.DecodeResponse(target, res); err != nil {
  100337. return nil, err
  100338. }
  100339. return ret, nil
  100340. // {
  100341. // "description": "Returns the specified regional BackendService resource.",
  100342. // "httpMethod": "GET",
  100343. // "id": "compute.regionBackendServices.get",
  100344. // "parameterOrder": [
  100345. // "project",
  100346. // "region",
  100347. // "backendService"
  100348. // ],
  100349. // "parameters": {
  100350. // "backendService": {
  100351. // "description": "Name of the BackendService resource to return.",
  100352. // "location": "path",
  100353. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100354. // "required": true,
  100355. // "type": "string"
  100356. // },
  100357. // "project": {
  100358. // "description": "Project ID for this request.",
  100359. // "location": "path",
  100360. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100361. // "required": true,
  100362. // "type": "string"
  100363. // },
  100364. // "region": {
  100365. // "description": "Name of the region scoping this request.",
  100366. // "location": "path",
  100367. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100368. // "required": true,
  100369. // "type": "string"
  100370. // }
  100371. // },
  100372. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  100373. // "response": {
  100374. // "$ref": "BackendService"
  100375. // },
  100376. // "scopes": [
  100377. // "https://www.googleapis.com/auth/cloud-platform",
  100378. // "https://www.googleapis.com/auth/compute",
  100379. // "https://www.googleapis.com/auth/compute.readonly"
  100380. // ]
  100381. // }
  100382. }
  100383. // method id "compute.regionBackendServices.getHealth":
  100384. type RegionBackendServicesGetHealthCall struct {
  100385. s *Service
  100386. project string
  100387. region string
  100388. backendService string
  100389. resourcegroupreference *ResourceGroupReference
  100390. urlParams_ gensupport.URLParams
  100391. ctx_ context.Context
  100392. header_ http.Header
  100393. }
  100394. // GetHealth: Gets the most recent health check results for this
  100395. // regional BackendService.
  100396. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  100397. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100398. c.project = project
  100399. c.region = region
  100400. c.backendService = backendService
  100401. c.resourcegroupreference = resourcegroupreference
  100402. return c
  100403. }
  100404. // Fields allows partial responses to be retrieved. See
  100405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100406. // for more information.
  100407. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  100408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100409. return c
  100410. }
  100411. // Context sets the context to be used in this call's Do method. Any
  100412. // pending HTTP request will be aborted if the provided context is
  100413. // canceled.
  100414. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  100415. c.ctx_ = ctx
  100416. return c
  100417. }
  100418. // Header returns an http.Header that can be modified by the caller to
  100419. // add HTTP headers to the request.
  100420. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  100421. if c.header_ == nil {
  100422. c.header_ = make(http.Header)
  100423. }
  100424. return c.header_
  100425. }
  100426. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  100427. reqHeaders := make(http.Header)
  100428. for k, v := range c.header_ {
  100429. reqHeaders[k] = v
  100430. }
  100431. reqHeaders.Set("User-Agent", c.s.userAgent())
  100432. var body io.Reader = nil
  100433. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  100434. if err != nil {
  100435. return nil, err
  100436. }
  100437. reqHeaders.Set("Content-Type", "application/json")
  100438. c.urlParams_.Set("alt", alt)
  100439. c.urlParams_.Set("prettyPrint", "false")
  100440. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  100441. urls += "?" + c.urlParams_.Encode()
  100442. req, err := http.NewRequest("POST", urls, body)
  100443. if err != nil {
  100444. return nil, err
  100445. }
  100446. req.Header = reqHeaders
  100447. googleapi.Expand(req.URL, map[string]string{
  100448. "project": c.project,
  100449. "region": c.region,
  100450. "backendService": c.backendService,
  100451. })
  100452. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100453. }
  100454. // Do executes the "compute.regionBackendServices.getHealth" call.
  100455. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  100456. // Any non-2xx status code is an error. Response headers are in either
  100457. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  100458. // was returned at all) in error.(*googleapi.Error).Header. Use
  100459. // googleapi.IsNotModified to check whether the returned error was
  100460. // because http.StatusNotModified was returned.
  100461. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  100462. gensupport.SetOptions(c.urlParams_, opts...)
  100463. res, err := c.doRequest("json")
  100464. if res != nil && res.StatusCode == http.StatusNotModified {
  100465. if res.Body != nil {
  100466. res.Body.Close()
  100467. }
  100468. return nil, &googleapi.Error{
  100469. Code: res.StatusCode,
  100470. Header: res.Header,
  100471. }
  100472. }
  100473. if err != nil {
  100474. return nil, err
  100475. }
  100476. defer googleapi.CloseBody(res)
  100477. if err := googleapi.CheckResponse(res); err != nil {
  100478. return nil, err
  100479. }
  100480. ret := &BackendServiceGroupHealth{
  100481. ServerResponse: googleapi.ServerResponse{
  100482. Header: res.Header,
  100483. HTTPStatusCode: res.StatusCode,
  100484. },
  100485. }
  100486. target := &ret
  100487. if err := gensupport.DecodeResponse(target, res); err != nil {
  100488. return nil, err
  100489. }
  100490. return ret, nil
  100491. // {
  100492. // "description": "Gets the most recent health check results for this regional BackendService.",
  100493. // "httpMethod": "POST",
  100494. // "id": "compute.regionBackendServices.getHealth",
  100495. // "parameterOrder": [
  100496. // "project",
  100497. // "region",
  100498. // "backendService"
  100499. // ],
  100500. // "parameters": {
  100501. // "backendService": {
  100502. // "description": "Name of the BackendService resource for which to get health.",
  100503. // "location": "path",
  100504. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100505. // "required": true,
  100506. // "type": "string"
  100507. // },
  100508. // "project": {
  100509. // "location": "path",
  100510. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100511. // "required": true,
  100512. // "type": "string"
  100513. // },
  100514. // "region": {
  100515. // "description": "Name of the region scoping this request.",
  100516. // "location": "path",
  100517. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100518. // "required": true,
  100519. // "type": "string"
  100520. // }
  100521. // },
  100522. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  100523. // "request": {
  100524. // "$ref": "ResourceGroupReference"
  100525. // },
  100526. // "response": {
  100527. // "$ref": "BackendServiceGroupHealth"
  100528. // },
  100529. // "scopes": [
  100530. // "https://www.googleapis.com/auth/cloud-platform",
  100531. // "https://www.googleapis.com/auth/compute",
  100532. // "https://www.googleapis.com/auth/compute.readonly"
  100533. // ]
  100534. // }
  100535. }
  100536. // method id "compute.regionBackendServices.insert":
  100537. type RegionBackendServicesInsertCall struct {
  100538. s *Service
  100539. project string
  100540. region string
  100541. backendservice *BackendService
  100542. urlParams_ gensupport.URLParams
  100543. ctx_ context.Context
  100544. header_ http.Header
  100545. }
  100546. // Insert: Creates a regional BackendService resource in the specified
  100547. // project using the data included in the request. There are several
  100548. // restrictions and guidelines to keep in mind when creating a regional
  100549. // backend service. Read Restrictions and Guidelines for more
  100550. // information.
  100551. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  100552. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100553. c.project = project
  100554. c.region = region
  100555. c.backendservice = backendservice
  100556. return c
  100557. }
  100558. // RequestId sets the optional parameter "requestId": An optional
  100559. // request ID to identify requests. Specify a unique request ID so that
  100560. // if you must retry your request, the server will know to ignore the
  100561. // request if it has already been completed.
  100562. //
  100563. // For example, consider a situation where you make an initial request
  100564. // and the request times out. If you make the request again with the
  100565. // same request ID, the server can check if original operation with the
  100566. // same request ID was received, and if so, will ignore the second
  100567. // request. This prevents clients from accidentally creating duplicate
  100568. // commitments.
  100569. //
  100570. // The request ID must be a valid UUID with the exception that zero UUID
  100571. // is not supported (00000000-0000-0000-0000-000000000000).
  100572. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  100573. c.urlParams_.Set("requestId", requestId)
  100574. return c
  100575. }
  100576. // Fields allows partial responses to be retrieved. See
  100577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100578. // for more information.
  100579. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  100580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100581. return c
  100582. }
  100583. // Context sets the context to be used in this call's Do method. Any
  100584. // pending HTTP request will be aborted if the provided context is
  100585. // canceled.
  100586. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  100587. c.ctx_ = ctx
  100588. return c
  100589. }
  100590. // Header returns an http.Header that can be modified by the caller to
  100591. // add HTTP headers to the request.
  100592. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  100593. if c.header_ == nil {
  100594. c.header_ = make(http.Header)
  100595. }
  100596. return c.header_
  100597. }
  100598. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  100599. reqHeaders := make(http.Header)
  100600. for k, v := range c.header_ {
  100601. reqHeaders[k] = v
  100602. }
  100603. reqHeaders.Set("User-Agent", c.s.userAgent())
  100604. var body io.Reader = nil
  100605. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  100606. if err != nil {
  100607. return nil, err
  100608. }
  100609. reqHeaders.Set("Content-Type", "application/json")
  100610. c.urlParams_.Set("alt", alt)
  100611. c.urlParams_.Set("prettyPrint", "false")
  100612. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  100613. urls += "?" + c.urlParams_.Encode()
  100614. req, err := http.NewRequest("POST", urls, body)
  100615. if err != nil {
  100616. return nil, err
  100617. }
  100618. req.Header = reqHeaders
  100619. googleapi.Expand(req.URL, map[string]string{
  100620. "project": c.project,
  100621. "region": c.region,
  100622. })
  100623. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100624. }
  100625. // Do executes the "compute.regionBackendServices.insert" call.
  100626. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100627. // status code is an error. Response headers are in either
  100628. // *Operation.ServerResponse.Header or (if a response was returned at
  100629. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100630. // to check whether the returned error was because
  100631. // http.StatusNotModified was returned.
  100632. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100633. gensupport.SetOptions(c.urlParams_, opts...)
  100634. res, err := c.doRequest("json")
  100635. if res != nil && res.StatusCode == http.StatusNotModified {
  100636. if res.Body != nil {
  100637. res.Body.Close()
  100638. }
  100639. return nil, &googleapi.Error{
  100640. Code: res.StatusCode,
  100641. Header: res.Header,
  100642. }
  100643. }
  100644. if err != nil {
  100645. return nil, err
  100646. }
  100647. defer googleapi.CloseBody(res)
  100648. if err := googleapi.CheckResponse(res); err != nil {
  100649. return nil, err
  100650. }
  100651. ret := &Operation{
  100652. ServerResponse: googleapi.ServerResponse{
  100653. Header: res.Header,
  100654. HTTPStatusCode: res.StatusCode,
  100655. },
  100656. }
  100657. target := &ret
  100658. if err := gensupport.DecodeResponse(target, res); err != nil {
  100659. return nil, err
  100660. }
  100661. return ret, nil
  100662. // {
  100663. // "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.",
  100664. // "httpMethod": "POST",
  100665. // "id": "compute.regionBackendServices.insert",
  100666. // "parameterOrder": [
  100667. // "project",
  100668. // "region"
  100669. // ],
  100670. // "parameters": {
  100671. // "project": {
  100672. // "description": "Project ID for this request.",
  100673. // "location": "path",
  100674. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100675. // "required": true,
  100676. // "type": "string"
  100677. // },
  100678. // "region": {
  100679. // "description": "Name of the region scoping this request.",
  100680. // "location": "path",
  100681. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100682. // "required": true,
  100683. // "type": "string"
  100684. // },
  100685. // "requestId": {
  100686. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100687. // "location": "query",
  100688. // "type": "string"
  100689. // }
  100690. // },
  100691. // "path": "{project}/regions/{region}/backendServices",
  100692. // "request": {
  100693. // "$ref": "BackendService"
  100694. // },
  100695. // "response": {
  100696. // "$ref": "Operation"
  100697. // },
  100698. // "scopes": [
  100699. // "https://www.googleapis.com/auth/cloud-platform",
  100700. // "https://www.googleapis.com/auth/compute"
  100701. // ]
  100702. // }
  100703. }
  100704. // method id "compute.regionBackendServices.list":
  100705. type RegionBackendServicesListCall struct {
  100706. s *Service
  100707. project string
  100708. region string
  100709. urlParams_ gensupport.URLParams
  100710. ifNoneMatch_ string
  100711. ctx_ context.Context
  100712. header_ http.Header
  100713. }
  100714. // List: Retrieves the list of regional BackendService resources
  100715. // available to the specified project in the given region.
  100716. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  100717. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100718. c.project = project
  100719. c.region = region
  100720. return c
  100721. }
  100722. // Filter sets the optional parameter "filter": A filter expression that
  100723. // filters resources listed in the response. The expression must specify
  100724. // the field name, a comparison operator, and the value that you want to
  100725. // use for filtering. The value must be a string, a number, or a
  100726. // boolean. The comparison operator must be either =, !=, >, or <.
  100727. //
  100728. // For example, if you are filtering Compute Engine instances, you can
  100729. // exclude instances named example-instance by specifying name !=
  100730. // example-instance.
  100731. //
  100732. // You can also filter nested fields. For example, you could specify
  100733. // scheduling.automaticRestart = false to include instances only if they
  100734. // are not scheduled for automatic restarts. You can use filtering on
  100735. // nested fields to filter based on resource labels.
  100736. //
  100737. // To filter on multiple expressions, provide each separate expression
  100738. // within parentheses. For example, (scheduling.automaticRestart = true)
  100739. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  100740. // AND expression. However, you can include AND and OR expressions
  100741. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  100742. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  100743. // true).
  100744. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  100745. c.urlParams_.Set("filter", filter)
  100746. return c
  100747. }
  100748. // MaxResults sets the optional parameter "maxResults": The maximum
  100749. // number of results per page that should be returned. If the number of
  100750. // available results is larger than maxResults, Compute Engine returns a
  100751. // nextPageToken that can be used to get the next page of results in
  100752. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  100753. // (Default: 500)
  100754. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  100755. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  100756. return c
  100757. }
  100758. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  100759. // a certain order. By default, results are returned in alphanumerical
  100760. // order based on the resource name.
  100761. //
  100762. // You can also sort results in descending order based on the creation
  100763. // timestamp using orderBy="creationTimestamp desc". This sorts results
  100764. // based on the creationTimestamp field in reverse chronological order
  100765. // (newest result first). Use this to sort resources like operations so
  100766. // that the newest operation is returned first.
  100767. //
  100768. // Currently, only sorting by name or creationTimestamp desc is
  100769. // supported.
  100770. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  100771. c.urlParams_.Set("orderBy", orderBy)
  100772. return c
  100773. }
  100774. // PageToken sets the optional parameter "pageToken": Specifies a page
  100775. // token to use. Set pageToken to the nextPageToken returned by a
  100776. // previous list request to get the next page of results.
  100777. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  100778. c.urlParams_.Set("pageToken", pageToken)
  100779. return c
  100780. }
  100781. // Fields allows partial responses to be retrieved. See
  100782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100783. // for more information.
  100784. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  100785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100786. return c
  100787. }
  100788. // IfNoneMatch sets the optional parameter which makes the operation
  100789. // fail if the object's ETag matches the given value. This is useful for
  100790. // getting updates only after the object has changed since the last
  100791. // request. Use googleapi.IsNotModified to check whether the response
  100792. // error from Do is the result of In-None-Match.
  100793. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  100794. c.ifNoneMatch_ = entityTag
  100795. return c
  100796. }
  100797. // Context sets the context to be used in this call's Do method. Any
  100798. // pending HTTP request will be aborted if the provided context is
  100799. // canceled.
  100800. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  100801. c.ctx_ = ctx
  100802. return c
  100803. }
  100804. // Header returns an http.Header that can be modified by the caller to
  100805. // add HTTP headers to the request.
  100806. func (c *RegionBackendServicesListCall) Header() http.Header {
  100807. if c.header_ == nil {
  100808. c.header_ = make(http.Header)
  100809. }
  100810. return c.header_
  100811. }
  100812. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  100813. reqHeaders := make(http.Header)
  100814. for k, v := range c.header_ {
  100815. reqHeaders[k] = v
  100816. }
  100817. reqHeaders.Set("User-Agent", c.s.userAgent())
  100818. if c.ifNoneMatch_ != "" {
  100819. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100820. }
  100821. var body io.Reader = nil
  100822. c.urlParams_.Set("alt", alt)
  100823. c.urlParams_.Set("prettyPrint", "false")
  100824. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  100825. urls += "?" + c.urlParams_.Encode()
  100826. req, err := http.NewRequest("GET", urls, body)
  100827. if err != nil {
  100828. return nil, err
  100829. }
  100830. req.Header = reqHeaders
  100831. googleapi.Expand(req.URL, map[string]string{
  100832. "project": c.project,
  100833. "region": c.region,
  100834. })
  100835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100836. }
  100837. // Do executes the "compute.regionBackendServices.list" call.
  100838. // Exactly one of *BackendServiceList or error will be non-nil. Any
  100839. // non-2xx status code is an error. Response headers are in either
  100840. // *BackendServiceList.ServerResponse.Header or (if a response was
  100841. // returned at all) in error.(*googleapi.Error).Header. Use
  100842. // googleapi.IsNotModified to check whether the returned error was
  100843. // because http.StatusNotModified was returned.
  100844. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  100845. gensupport.SetOptions(c.urlParams_, opts...)
  100846. res, err := c.doRequest("json")
  100847. if res != nil && res.StatusCode == http.StatusNotModified {
  100848. if res.Body != nil {
  100849. res.Body.Close()
  100850. }
  100851. return nil, &googleapi.Error{
  100852. Code: res.StatusCode,
  100853. Header: res.Header,
  100854. }
  100855. }
  100856. if err != nil {
  100857. return nil, err
  100858. }
  100859. defer googleapi.CloseBody(res)
  100860. if err := googleapi.CheckResponse(res); err != nil {
  100861. return nil, err
  100862. }
  100863. ret := &BackendServiceList{
  100864. ServerResponse: googleapi.ServerResponse{
  100865. Header: res.Header,
  100866. HTTPStatusCode: res.StatusCode,
  100867. },
  100868. }
  100869. target := &ret
  100870. if err := gensupport.DecodeResponse(target, res); err != nil {
  100871. return nil, err
  100872. }
  100873. return ret, nil
  100874. // {
  100875. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  100876. // "httpMethod": "GET",
  100877. // "id": "compute.regionBackendServices.list",
  100878. // "parameterOrder": [
  100879. // "project",
  100880. // "region"
  100881. // ],
  100882. // "parameters": {
  100883. // "filter": {
  100884. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  100885. // "location": "query",
  100886. // "type": "string"
  100887. // },
  100888. // "maxResults": {
  100889. // "default": "500",
  100890. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  100891. // "format": "uint32",
  100892. // "location": "query",
  100893. // "minimum": "0",
  100894. // "type": "integer"
  100895. // },
  100896. // "orderBy": {
  100897. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  100898. // "location": "query",
  100899. // "type": "string"
  100900. // },
  100901. // "pageToken": {
  100902. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  100903. // "location": "query",
  100904. // "type": "string"
  100905. // },
  100906. // "project": {
  100907. // "description": "Project ID for this request.",
  100908. // "location": "path",
  100909. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100910. // "required": true,
  100911. // "type": "string"
  100912. // },
  100913. // "region": {
  100914. // "description": "Name of the region scoping this request.",
  100915. // "location": "path",
  100916. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100917. // "required": true,
  100918. // "type": "string"
  100919. // }
  100920. // },
  100921. // "path": "{project}/regions/{region}/backendServices",
  100922. // "response": {
  100923. // "$ref": "BackendServiceList"
  100924. // },
  100925. // "scopes": [
  100926. // "https://www.googleapis.com/auth/cloud-platform",
  100927. // "https://www.googleapis.com/auth/compute",
  100928. // "https://www.googleapis.com/auth/compute.readonly"
  100929. // ]
  100930. // }
  100931. }
  100932. // Pages invokes f for each page of results.
  100933. // A non-nil error returned from f will halt the iteration.
  100934. // The provided context supersedes any context provided to the Context method.
  100935. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  100936. c.ctx_ = ctx
  100937. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  100938. for {
  100939. x, err := c.Do()
  100940. if err != nil {
  100941. return err
  100942. }
  100943. if err := f(x); err != nil {
  100944. return err
  100945. }
  100946. if x.NextPageToken == "" {
  100947. return nil
  100948. }
  100949. c.PageToken(x.NextPageToken)
  100950. }
  100951. }
  100952. // method id "compute.regionBackendServices.patch":
  100953. type RegionBackendServicesPatchCall struct {
  100954. s *Service
  100955. project string
  100956. region string
  100957. backendService string
  100958. backendservice *BackendService
  100959. urlParams_ gensupport.URLParams
  100960. ctx_ context.Context
  100961. header_ http.Header
  100962. }
  100963. // Patch: Updates the specified regional BackendService resource with
  100964. // the data included in the request. There are several restrictions and
  100965. // guidelines to keep in mind when updating a backend service. Read
  100966. // Restrictions and Guidelines for more information. This method
  100967. // supports PATCH semantics and uses the JSON merge patch format and
  100968. // processing rules.
  100969. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  100970. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100971. c.project = project
  100972. c.region = region
  100973. c.backendService = backendService
  100974. c.backendservice = backendservice
  100975. return c
  100976. }
  100977. // RequestId sets the optional parameter "requestId": An optional
  100978. // request ID to identify requests. Specify a unique request ID so that
  100979. // if you must retry your request, the server will know to ignore the
  100980. // request if it has already been completed.
  100981. //
  100982. // For example, consider a situation where you make an initial request
  100983. // and the request times out. If you make the request again with the
  100984. // same request ID, the server can check if original operation with the
  100985. // same request ID was received, and if so, will ignore the second
  100986. // request. This prevents clients from accidentally creating duplicate
  100987. // commitments.
  100988. //
  100989. // The request ID must be a valid UUID with the exception that zero UUID
  100990. // is not supported (00000000-0000-0000-0000-000000000000).
  100991. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  100992. c.urlParams_.Set("requestId", requestId)
  100993. return c
  100994. }
  100995. // Fields allows partial responses to be retrieved. See
  100996. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100997. // for more information.
  100998. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  100999. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101000. return c
  101001. }
  101002. // Context sets the context to be used in this call's Do method. Any
  101003. // pending HTTP request will be aborted if the provided context is
  101004. // canceled.
  101005. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  101006. c.ctx_ = ctx
  101007. return c
  101008. }
  101009. // Header returns an http.Header that can be modified by the caller to
  101010. // add HTTP headers to the request.
  101011. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  101012. if c.header_ == nil {
  101013. c.header_ = make(http.Header)
  101014. }
  101015. return c.header_
  101016. }
  101017. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  101018. reqHeaders := make(http.Header)
  101019. for k, v := range c.header_ {
  101020. reqHeaders[k] = v
  101021. }
  101022. reqHeaders.Set("User-Agent", c.s.userAgent())
  101023. var body io.Reader = nil
  101024. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  101025. if err != nil {
  101026. return nil, err
  101027. }
  101028. reqHeaders.Set("Content-Type", "application/json")
  101029. c.urlParams_.Set("alt", alt)
  101030. c.urlParams_.Set("prettyPrint", "false")
  101031. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  101032. urls += "?" + c.urlParams_.Encode()
  101033. req, err := http.NewRequest("PATCH", urls, body)
  101034. if err != nil {
  101035. return nil, err
  101036. }
  101037. req.Header = reqHeaders
  101038. googleapi.Expand(req.URL, map[string]string{
  101039. "project": c.project,
  101040. "region": c.region,
  101041. "backendService": c.backendService,
  101042. })
  101043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101044. }
  101045. // Do executes the "compute.regionBackendServices.patch" call.
  101046. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101047. // status code is an error. Response headers are in either
  101048. // *Operation.ServerResponse.Header or (if a response was returned at
  101049. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101050. // to check whether the returned error was because
  101051. // http.StatusNotModified was returned.
  101052. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101053. gensupport.SetOptions(c.urlParams_, opts...)
  101054. res, err := c.doRequest("json")
  101055. if res != nil && res.StatusCode == http.StatusNotModified {
  101056. if res.Body != nil {
  101057. res.Body.Close()
  101058. }
  101059. return nil, &googleapi.Error{
  101060. Code: res.StatusCode,
  101061. Header: res.Header,
  101062. }
  101063. }
  101064. if err != nil {
  101065. return nil, err
  101066. }
  101067. defer googleapi.CloseBody(res)
  101068. if err := googleapi.CheckResponse(res); err != nil {
  101069. return nil, err
  101070. }
  101071. ret := &Operation{
  101072. ServerResponse: googleapi.ServerResponse{
  101073. Header: res.Header,
  101074. HTTPStatusCode: res.StatusCode,
  101075. },
  101076. }
  101077. target := &ret
  101078. if err := gensupport.DecodeResponse(target, res); err != nil {
  101079. return nil, err
  101080. }
  101081. return ret, nil
  101082. // {
  101083. // "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.",
  101084. // "httpMethod": "PATCH",
  101085. // "id": "compute.regionBackendServices.patch",
  101086. // "parameterOrder": [
  101087. // "project",
  101088. // "region",
  101089. // "backendService"
  101090. // ],
  101091. // "parameters": {
  101092. // "backendService": {
  101093. // "description": "Name of the BackendService resource to patch.",
  101094. // "location": "path",
  101095. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  101096. // "required": true,
  101097. // "type": "string"
  101098. // },
  101099. // "project": {
  101100. // "description": "Project ID for this request.",
  101101. // "location": "path",
  101102. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101103. // "required": true,
  101104. // "type": "string"
  101105. // },
  101106. // "region": {
  101107. // "description": "Name of the region scoping this request.",
  101108. // "location": "path",
  101109. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101110. // "required": true,
  101111. // "type": "string"
  101112. // },
  101113. // "requestId": {
  101114. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101115. // "location": "query",
  101116. // "type": "string"
  101117. // }
  101118. // },
  101119. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  101120. // "request": {
  101121. // "$ref": "BackendService"
  101122. // },
  101123. // "response": {
  101124. // "$ref": "Operation"
  101125. // },
  101126. // "scopes": [
  101127. // "https://www.googleapis.com/auth/cloud-platform",
  101128. // "https://www.googleapis.com/auth/compute"
  101129. // ]
  101130. // }
  101131. }
  101132. // method id "compute.regionBackendServices.testIamPermissions":
  101133. type RegionBackendServicesTestIamPermissionsCall struct {
  101134. s *Service
  101135. project string
  101136. region string
  101137. resource string
  101138. testpermissionsrequest *TestPermissionsRequest
  101139. urlParams_ gensupport.URLParams
  101140. ctx_ context.Context
  101141. header_ http.Header
  101142. }
  101143. // TestIamPermissions: Returns permissions that a caller has on the
  101144. // specified resource.
  101145. func (r *RegionBackendServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionBackendServicesTestIamPermissionsCall {
  101146. c := &RegionBackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101147. c.project = project
  101148. c.region = region
  101149. c.resource = resource
  101150. c.testpermissionsrequest = testpermissionsrequest
  101151. return c
  101152. }
  101153. // Fields allows partial responses to be retrieved. See
  101154. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101155. // for more information.
  101156. func (c *RegionBackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionBackendServicesTestIamPermissionsCall {
  101157. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101158. return c
  101159. }
  101160. // Context sets the context to be used in this call's Do method. Any
  101161. // pending HTTP request will be aborted if the provided context is
  101162. // canceled.
  101163. func (c *RegionBackendServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionBackendServicesTestIamPermissionsCall {
  101164. c.ctx_ = ctx
  101165. return c
  101166. }
  101167. // Header returns an http.Header that can be modified by the caller to
  101168. // add HTTP headers to the request.
  101169. func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header {
  101170. if c.header_ == nil {
  101171. c.header_ = make(http.Header)
  101172. }
  101173. return c.header_
  101174. }
  101175. func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  101176. reqHeaders := make(http.Header)
  101177. for k, v := range c.header_ {
  101178. reqHeaders[k] = v
  101179. }
  101180. reqHeaders.Set("User-Agent", c.s.userAgent())
  101181. var body io.Reader = nil
  101182. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  101183. if err != nil {
  101184. return nil, err
  101185. }
  101186. reqHeaders.Set("Content-Type", "application/json")
  101187. c.urlParams_.Set("alt", alt)
  101188. c.urlParams_.Set("prettyPrint", "false")
  101189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{resource}/testIamPermissions")
  101190. urls += "?" + c.urlParams_.Encode()
  101191. req, err := http.NewRequest("POST", urls, body)
  101192. if err != nil {
  101193. return nil, err
  101194. }
  101195. req.Header = reqHeaders
  101196. googleapi.Expand(req.URL, map[string]string{
  101197. "project": c.project,
  101198. "region": c.region,
  101199. "resource": c.resource,
  101200. })
  101201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101202. }
  101203. // Do executes the "compute.regionBackendServices.testIamPermissions" call.
  101204. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  101205. // non-2xx status code is an error. Response headers are in either
  101206. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  101207. // returned at all) in error.(*googleapi.Error).Header. Use
  101208. // googleapi.IsNotModified to check whether the returned error was
  101209. // because http.StatusNotModified was returned.
  101210. func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  101211. gensupport.SetOptions(c.urlParams_, opts...)
  101212. res, err := c.doRequest("json")
  101213. if res != nil && res.StatusCode == http.StatusNotModified {
  101214. if res.Body != nil {
  101215. res.Body.Close()
  101216. }
  101217. return nil, &googleapi.Error{
  101218. Code: res.StatusCode,
  101219. Header: res.Header,
  101220. }
  101221. }
  101222. if err != nil {
  101223. return nil, err
  101224. }
  101225. defer googleapi.CloseBody(res)
  101226. if err := googleapi.CheckResponse(res); err != nil {
  101227. return nil, err
  101228. }
  101229. ret := &TestPermissionsResponse{
  101230. ServerResponse: googleapi.ServerResponse{
  101231. Header: res.Header,
  101232. HTTPStatusCode: res.StatusCode,
  101233. },
  101234. }
  101235. target := &ret
  101236. if err := gensupport.DecodeResponse(target, res); err != nil {
  101237. return nil, err
  101238. }
  101239. return ret, nil
  101240. // {
  101241. // "description": "Returns permissions that a caller has on the specified resource.",
  101242. // "httpMethod": "POST",
  101243. // "id": "compute.regionBackendServices.testIamPermissions",
  101244. // "parameterOrder": [
  101245. // "project",
  101246. // "region",
  101247. // "resource"
  101248. // ],
  101249. // "parameters": {
  101250. // "project": {
  101251. // "description": "Project ID for this request.",
  101252. // "location": "path",
  101253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101254. // "required": true,
  101255. // "type": "string"
  101256. // },
  101257. // "region": {
  101258. // "description": "The name of the region for this request.",
  101259. // "location": "path",
  101260. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101261. // "required": true,
  101262. // "type": "string"
  101263. // },
  101264. // "resource": {
  101265. // "description": "Name or id of the resource for this request.",
  101266. // "location": "path",
  101267. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  101268. // "required": true,
  101269. // "type": "string"
  101270. // }
  101271. // },
  101272. // "path": "{project}/regions/{region}/backendServices/{resource}/testIamPermissions",
  101273. // "request": {
  101274. // "$ref": "TestPermissionsRequest"
  101275. // },
  101276. // "response": {
  101277. // "$ref": "TestPermissionsResponse"
  101278. // },
  101279. // "scopes": [
  101280. // "https://www.googleapis.com/auth/cloud-platform",
  101281. // "https://www.googleapis.com/auth/compute",
  101282. // "https://www.googleapis.com/auth/compute.readonly"
  101283. // ]
  101284. // }
  101285. }
  101286. // method id "compute.regionBackendServices.update":
  101287. type RegionBackendServicesUpdateCall struct {
  101288. s *Service
  101289. project string
  101290. region string
  101291. backendService string
  101292. backendservice *BackendService
  101293. urlParams_ gensupport.URLParams
  101294. ctx_ context.Context
  101295. header_ http.Header
  101296. }
  101297. // Update: Updates the specified regional BackendService resource with
  101298. // the data included in the request. There are several restrictions and
  101299. // guidelines to keep in mind when updating a backend service. Read
  101300. // Restrictions and Guidelines for more information.
  101301. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  101302. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101303. c.project = project
  101304. c.region = region
  101305. c.backendService = backendService
  101306. c.backendservice = backendservice
  101307. return c
  101308. }
  101309. // RequestId sets the optional parameter "requestId": An optional
  101310. // request ID to identify requests. Specify a unique request ID so that
  101311. // if you must retry your request, the server will know to ignore the
  101312. // request if it has already been completed.
  101313. //
  101314. // For example, consider a situation where you make an initial request
  101315. // and the request times out. If you make the request again with the
  101316. // same request ID, the server can check if original operation with the
  101317. // same request ID was received, and if so, will ignore the second
  101318. // request. This prevents clients from accidentally creating duplicate
  101319. // commitments.
  101320. //
  101321. // The request ID must be a valid UUID with the exception that zero UUID
  101322. // is not supported (00000000-0000-0000-0000-000000000000).
  101323. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  101324. c.urlParams_.Set("requestId", requestId)
  101325. return c
  101326. }
  101327. // Fields allows partial responses to be retrieved. See
  101328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101329. // for more information.
  101330. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  101331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101332. return c
  101333. }
  101334. // Context sets the context to be used in this call's Do method. Any
  101335. // pending HTTP request will be aborted if the provided context is
  101336. // canceled.
  101337. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  101338. c.ctx_ = ctx
  101339. return c
  101340. }
  101341. // Header returns an http.Header that can be modified by the caller to
  101342. // add HTTP headers to the request.
  101343. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  101344. if c.header_ == nil {
  101345. c.header_ = make(http.Header)
  101346. }
  101347. return c.header_
  101348. }
  101349. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  101350. reqHeaders := make(http.Header)
  101351. for k, v := range c.header_ {
  101352. reqHeaders[k] = v
  101353. }
  101354. reqHeaders.Set("User-Agent", c.s.userAgent())
  101355. var body io.Reader = nil
  101356. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  101357. if err != nil {
  101358. return nil, err
  101359. }
  101360. reqHeaders.Set("Content-Type", "application/json")
  101361. c.urlParams_.Set("alt", alt)
  101362. c.urlParams_.Set("prettyPrint", "false")
  101363. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  101364. urls += "?" + c.urlParams_.Encode()
  101365. req, err := http.NewRequest("PUT", urls, body)
  101366. if err != nil {
  101367. return nil, err
  101368. }
  101369. req.Header = reqHeaders
  101370. googleapi.Expand(req.URL, map[string]string{
  101371. "project": c.project,
  101372. "region": c.region,
  101373. "backendService": c.backendService,
  101374. })
  101375. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101376. }
  101377. // Do executes the "compute.regionBackendServices.update" call.
  101378. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101379. // status code is an error. Response headers are in either
  101380. // *Operation.ServerResponse.Header or (if a response was returned at
  101381. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101382. // to check whether the returned error was because
  101383. // http.StatusNotModified was returned.
  101384. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101385. gensupport.SetOptions(c.urlParams_, opts...)
  101386. res, err := c.doRequest("json")
  101387. if res != nil && res.StatusCode == http.StatusNotModified {
  101388. if res.Body != nil {
  101389. res.Body.Close()
  101390. }
  101391. return nil, &googleapi.Error{
  101392. Code: res.StatusCode,
  101393. Header: res.Header,
  101394. }
  101395. }
  101396. if err != nil {
  101397. return nil, err
  101398. }
  101399. defer googleapi.CloseBody(res)
  101400. if err := googleapi.CheckResponse(res); err != nil {
  101401. return nil, err
  101402. }
  101403. ret := &Operation{
  101404. ServerResponse: googleapi.ServerResponse{
  101405. Header: res.Header,
  101406. HTTPStatusCode: res.StatusCode,
  101407. },
  101408. }
  101409. target := &ret
  101410. if err := gensupport.DecodeResponse(target, res); err != nil {
  101411. return nil, err
  101412. }
  101413. return ret, nil
  101414. // {
  101415. // "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.",
  101416. // "httpMethod": "PUT",
  101417. // "id": "compute.regionBackendServices.update",
  101418. // "parameterOrder": [
  101419. // "project",
  101420. // "region",
  101421. // "backendService"
  101422. // ],
  101423. // "parameters": {
  101424. // "backendService": {
  101425. // "description": "Name of the BackendService resource to update.",
  101426. // "location": "path",
  101427. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  101428. // "required": true,
  101429. // "type": "string"
  101430. // },
  101431. // "project": {
  101432. // "description": "Project ID for this request.",
  101433. // "location": "path",
  101434. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101435. // "required": true,
  101436. // "type": "string"
  101437. // },
  101438. // "region": {
  101439. // "description": "Name of the region scoping this request.",
  101440. // "location": "path",
  101441. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101442. // "required": true,
  101443. // "type": "string"
  101444. // },
  101445. // "requestId": {
  101446. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101447. // "location": "query",
  101448. // "type": "string"
  101449. // }
  101450. // },
  101451. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  101452. // "request": {
  101453. // "$ref": "BackendService"
  101454. // },
  101455. // "response": {
  101456. // "$ref": "Operation"
  101457. // },
  101458. // "scopes": [
  101459. // "https://www.googleapis.com/auth/cloud-platform",
  101460. // "https://www.googleapis.com/auth/compute"
  101461. // ]
  101462. // }
  101463. }
  101464. // method id "compute.regionCommitments.aggregatedList":
  101465. type RegionCommitmentsAggregatedListCall struct {
  101466. s *Service
  101467. project string
  101468. urlParams_ gensupport.URLParams
  101469. ifNoneMatch_ string
  101470. ctx_ context.Context
  101471. header_ http.Header
  101472. }
  101473. // AggregatedList: Retrieves an aggregated list of commitments.
  101474. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  101475. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101476. c.project = project
  101477. return c
  101478. }
  101479. // Filter sets the optional parameter "filter": A filter expression that
  101480. // filters resources listed in the response. The expression must specify
  101481. // the field name, a comparison operator, and the value that you want to
  101482. // use for filtering. The value must be a string, a number, or a
  101483. // boolean. The comparison operator must be either =, !=, >, or <.
  101484. //
  101485. // For example, if you are filtering Compute Engine instances, you can
  101486. // exclude instances named example-instance by specifying name !=
  101487. // example-instance.
  101488. //
  101489. // You can also filter nested fields. For example, you could specify
  101490. // scheduling.automaticRestart = false to include instances only if they
  101491. // are not scheduled for automatic restarts. You can use filtering on
  101492. // nested fields to filter based on resource labels.
  101493. //
  101494. // To filter on multiple expressions, provide each separate expression
  101495. // within parentheses. For example, (scheduling.automaticRestart = true)
  101496. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  101497. // AND expression. However, you can include AND and OR expressions
  101498. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  101499. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  101500. // true).
  101501. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  101502. c.urlParams_.Set("filter", filter)
  101503. return c
  101504. }
  101505. // MaxResults sets the optional parameter "maxResults": The maximum
  101506. // number of results per page that should be returned. If the number of
  101507. // available results is larger than maxResults, Compute Engine returns a
  101508. // nextPageToken that can be used to get the next page of results in
  101509. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  101510. // (Default: 500)
  101511. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  101512. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  101513. return c
  101514. }
  101515. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  101516. // a certain order. By default, results are returned in alphanumerical
  101517. // order based on the resource name.
  101518. //
  101519. // You can also sort results in descending order based on the creation
  101520. // timestamp using orderBy="creationTimestamp desc". This sorts results
  101521. // based on the creationTimestamp field in reverse chronological order
  101522. // (newest result first). Use this to sort resources like operations so
  101523. // that the newest operation is returned first.
  101524. //
  101525. // Currently, only sorting by name or creationTimestamp desc is
  101526. // supported.
  101527. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  101528. c.urlParams_.Set("orderBy", orderBy)
  101529. return c
  101530. }
  101531. // PageToken sets the optional parameter "pageToken": Specifies a page
  101532. // token to use. Set pageToken to the nextPageToken returned by a
  101533. // previous list request to get the next page of results.
  101534. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  101535. c.urlParams_.Set("pageToken", pageToken)
  101536. return c
  101537. }
  101538. // Fields allows partial responses to be retrieved. See
  101539. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101540. // for more information.
  101541. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  101542. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101543. return c
  101544. }
  101545. // IfNoneMatch sets the optional parameter which makes the operation
  101546. // fail if the object's ETag matches the given value. This is useful for
  101547. // getting updates only after the object has changed since the last
  101548. // request. Use googleapi.IsNotModified to check whether the response
  101549. // error from Do is the result of In-None-Match.
  101550. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  101551. c.ifNoneMatch_ = entityTag
  101552. return c
  101553. }
  101554. // Context sets the context to be used in this call's Do method. Any
  101555. // pending HTTP request will be aborted if the provided context is
  101556. // canceled.
  101557. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  101558. c.ctx_ = ctx
  101559. return c
  101560. }
  101561. // Header returns an http.Header that can be modified by the caller to
  101562. // add HTTP headers to the request.
  101563. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  101564. if c.header_ == nil {
  101565. c.header_ = make(http.Header)
  101566. }
  101567. return c.header_
  101568. }
  101569. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  101570. reqHeaders := make(http.Header)
  101571. for k, v := range c.header_ {
  101572. reqHeaders[k] = v
  101573. }
  101574. reqHeaders.Set("User-Agent", c.s.userAgent())
  101575. if c.ifNoneMatch_ != "" {
  101576. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101577. }
  101578. var body io.Reader = nil
  101579. c.urlParams_.Set("alt", alt)
  101580. c.urlParams_.Set("prettyPrint", "false")
  101581. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  101582. urls += "?" + c.urlParams_.Encode()
  101583. req, err := http.NewRequest("GET", urls, body)
  101584. if err != nil {
  101585. return nil, err
  101586. }
  101587. req.Header = reqHeaders
  101588. googleapi.Expand(req.URL, map[string]string{
  101589. "project": c.project,
  101590. })
  101591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101592. }
  101593. // Do executes the "compute.regionCommitments.aggregatedList" call.
  101594. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  101595. // Any non-2xx status code is an error. Response headers are in either
  101596. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  101597. // returned at all) in error.(*googleapi.Error).Header. Use
  101598. // googleapi.IsNotModified to check whether the returned error was
  101599. // because http.StatusNotModified was returned.
  101600. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  101601. gensupport.SetOptions(c.urlParams_, opts...)
  101602. res, err := c.doRequest("json")
  101603. if res != nil && res.StatusCode == http.StatusNotModified {
  101604. if res.Body != nil {
  101605. res.Body.Close()
  101606. }
  101607. return nil, &googleapi.Error{
  101608. Code: res.StatusCode,
  101609. Header: res.Header,
  101610. }
  101611. }
  101612. if err != nil {
  101613. return nil, err
  101614. }
  101615. defer googleapi.CloseBody(res)
  101616. if err := googleapi.CheckResponse(res); err != nil {
  101617. return nil, err
  101618. }
  101619. ret := &CommitmentAggregatedList{
  101620. ServerResponse: googleapi.ServerResponse{
  101621. Header: res.Header,
  101622. HTTPStatusCode: res.StatusCode,
  101623. },
  101624. }
  101625. target := &ret
  101626. if err := gensupport.DecodeResponse(target, res); err != nil {
  101627. return nil, err
  101628. }
  101629. return ret, nil
  101630. // {
  101631. // "description": "Retrieves an aggregated list of commitments.",
  101632. // "httpMethod": "GET",
  101633. // "id": "compute.regionCommitments.aggregatedList",
  101634. // "parameterOrder": [
  101635. // "project"
  101636. // ],
  101637. // "parameters": {
  101638. // "filter": {
  101639. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  101640. // "location": "query",
  101641. // "type": "string"
  101642. // },
  101643. // "maxResults": {
  101644. // "default": "500",
  101645. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  101646. // "format": "uint32",
  101647. // "location": "query",
  101648. // "minimum": "0",
  101649. // "type": "integer"
  101650. // },
  101651. // "orderBy": {
  101652. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  101653. // "location": "query",
  101654. // "type": "string"
  101655. // },
  101656. // "pageToken": {
  101657. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  101658. // "location": "query",
  101659. // "type": "string"
  101660. // },
  101661. // "project": {
  101662. // "description": "Project ID for this request.",
  101663. // "location": "path",
  101664. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101665. // "required": true,
  101666. // "type": "string"
  101667. // }
  101668. // },
  101669. // "path": "{project}/aggregated/commitments",
  101670. // "response": {
  101671. // "$ref": "CommitmentAggregatedList"
  101672. // },
  101673. // "scopes": [
  101674. // "https://www.googleapis.com/auth/cloud-platform",
  101675. // "https://www.googleapis.com/auth/compute",
  101676. // "https://www.googleapis.com/auth/compute.readonly"
  101677. // ]
  101678. // }
  101679. }
  101680. // Pages invokes f for each page of results.
  101681. // A non-nil error returned from f will halt the iteration.
  101682. // The provided context supersedes any context provided to the Context method.
  101683. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  101684. c.ctx_ = ctx
  101685. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  101686. for {
  101687. x, err := c.Do()
  101688. if err != nil {
  101689. return err
  101690. }
  101691. if err := f(x); err != nil {
  101692. return err
  101693. }
  101694. if x.NextPageToken == "" {
  101695. return nil
  101696. }
  101697. c.PageToken(x.NextPageToken)
  101698. }
  101699. }
  101700. // method id "compute.regionCommitments.get":
  101701. type RegionCommitmentsGetCall struct {
  101702. s *Service
  101703. project string
  101704. region string
  101705. commitment string
  101706. urlParams_ gensupport.URLParams
  101707. ifNoneMatch_ string
  101708. ctx_ context.Context
  101709. header_ http.Header
  101710. }
  101711. // Get: Returns the specified commitment resource. Gets a list of
  101712. // available commitments by making a list() request.
  101713. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  101714. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101715. c.project = project
  101716. c.region = region
  101717. c.commitment = commitment
  101718. return c
  101719. }
  101720. // Fields allows partial responses to be retrieved. See
  101721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101722. // for more information.
  101723. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  101724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101725. return c
  101726. }
  101727. // IfNoneMatch sets the optional parameter which makes the operation
  101728. // fail if the object's ETag matches the given value. This is useful for
  101729. // getting updates only after the object has changed since the last
  101730. // request. Use googleapi.IsNotModified to check whether the response
  101731. // error from Do is the result of In-None-Match.
  101732. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  101733. c.ifNoneMatch_ = entityTag
  101734. return c
  101735. }
  101736. // Context sets the context to be used in this call's Do method. Any
  101737. // pending HTTP request will be aborted if the provided context is
  101738. // canceled.
  101739. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  101740. c.ctx_ = ctx
  101741. return c
  101742. }
  101743. // Header returns an http.Header that can be modified by the caller to
  101744. // add HTTP headers to the request.
  101745. func (c *RegionCommitmentsGetCall) Header() http.Header {
  101746. if c.header_ == nil {
  101747. c.header_ = make(http.Header)
  101748. }
  101749. return c.header_
  101750. }
  101751. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  101752. reqHeaders := make(http.Header)
  101753. for k, v := range c.header_ {
  101754. reqHeaders[k] = v
  101755. }
  101756. reqHeaders.Set("User-Agent", c.s.userAgent())
  101757. if c.ifNoneMatch_ != "" {
  101758. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101759. }
  101760. var body io.Reader = nil
  101761. c.urlParams_.Set("alt", alt)
  101762. c.urlParams_.Set("prettyPrint", "false")
  101763. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  101764. urls += "?" + c.urlParams_.Encode()
  101765. req, err := http.NewRequest("GET", urls, body)
  101766. if err != nil {
  101767. return nil, err
  101768. }
  101769. req.Header = reqHeaders
  101770. googleapi.Expand(req.URL, map[string]string{
  101771. "project": c.project,
  101772. "region": c.region,
  101773. "commitment": c.commitment,
  101774. })
  101775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101776. }
  101777. // Do executes the "compute.regionCommitments.get" call.
  101778. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  101779. // status code is an error. Response headers are in either
  101780. // *Commitment.ServerResponse.Header or (if a response was returned at
  101781. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101782. // to check whether the returned error was because
  101783. // http.StatusNotModified was returned.
  101784. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  101785. gensupport.SetOptions(c.urlParams_, opts...)
  101786. res, err := c.doRequest("json")
  101787. if res != nil && res.StatusCode == http.StatusNotModified {
  101788. if res.Body != nil {
  101789. res.Body.Close()
  101790. }
  101791. return nil, &googleapi.Error{
  101792. Code: res.StatusCode,
  101793. Header: res.Header,
  101794. }
  101795. }
  101796. if err != nil {
  101797. return nil, err
  101798. }
  101799. defer googleapi.CloseBody(res)
  101800. if err := googleapi.CheckResponse(res); err != nil {
  101801. return nil, err
  101802. }
  101803. ret := &Commitment{
  101804. ServerResponse: googleapi.ServerResponse{
  101805. Header: res.Header,
  101806. HTTPStatusCode: res.StatusCode,
  101807. },
  101808. }
  101809. target := &ret
  101810. if err := gensupport.DecodeResponse(target, res); err != nil {
  101811. return nil, err
  101812. }
  101813. return ret, nil
  101814. // {
  101815. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  101816. // "httpMethod": "GET",
  101817. // "id": "compute.regionCommitments.get",
  101818. // "parameterOrder": [
  101819. // "project",
  101820. // "region",
  101821. // "commitment"
  101822. // ],
  101823. // "parameters": {
  101824. // "commitment": {
  101825. // "description": "Name of the commitment to return.",
  101826. // "location": "path",
  101827. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  101828. // "required": true,
  101829. // "type": "string"
  101830. // },
  101831. // "project": {
  101832. // "description": "Project ID for this request.",
  101833. // "location": "path",
  101834. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101835. // "required": true,
  101836. // "type": "string"
  101837. // },
  101838. // "region": {
  101839. // "description": "Name of the region for this request.",
  101840. // "location": "path",
  101841. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101842. // "required": true,
  101843. // "type": "string"
  101844. // }
  101845. // },
  101846. // "path": "{project}/regions/{region}/commitments/{commitment}",
  101847. // "response": {
  101848. // "$ref": "Commitment"
  101849. // },
  101850. // "scopes": [
  101851. // "https://www.googleapis.com/auth/cloud-platform",
  101852. // "https://www.googleapis.com/auth/compute",
  101853. // "https://www.googleapis.com/auth/compute.readonly"
  101854. // ]
  101855. // }
  101856. }
  101857. // method id "compute.regionCommitments.insert":
  101858. type RegionCommitmentsInsertCall struct {
  101859. s *Service
  101860. project string
  101861. region string
  101862. commitment *Commitment
  101863. urlParams_ gensupport.URLParams
  101864. ctx_ context.Context
  101865. header_ http.Header
  101866. }
  101867. // Insert: Creates a commitment in the specified project using the data
  101868. // included in the request.
  101869. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  101870. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101871. c.project = project
  101872. c.region = region
  101873. c.commitment = commitment
  101874. return c
  101875. }
  101876. // RequestId sets the optional parameter "requestId": An optional
  101877. // request ID to identify requests. Specify a unique request ID so that
  101878. // if you must retry your request, the server will know to ignore the
  101879. // request if it has already been completed.
  101880. //
  101881. // For example, consider a situation where you make an initial request
  101882. // and the request times out. If you make the request again with the
  101883. // same request ID, the server can check if original operation with the
  101884. // same request ID was received, and if so, will ignore the second
  101885. // request. This prevents clients from accidentally creating duplicate
  101886. // commitments.
  101887. //
  101888. // The request ID must be a valid UUID with the exception that zero UUID
  101889. // is not supported (00000000-0000-0000-0000-000000000000).
  101890. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  101891. c.urlParams_.Set("requestId", requestId)
  101892. return c
  101893. }
  101894. // Fields allows partial responses to be retrieved. See
  101895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101896. // for more information.
  101897. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  101898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101899. return c
  101900. }
  101901. // Context sets the context to be used in this call's Do method. Any
  101902. // pending HTTP request will be aborted if the provided context is
  101903. // canceled.
  101904. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  101905. c.ctx_ = ctx
  101906. return c
  101907. }
  101908. // Header returns an http.Header that can be modified by the caller to
  101909. // add HTTP headers to the request.
  101910. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  101911. if c.header_ == nil {
  101912. c.header_ = make(http.Header)
  101913. }
  101914. return c.header_
  101915. }
  101916. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  101917. reqHeaders := make(http.Header)
  101918. for k, v := range c.header_ {
  101919. reqHeaders[k] = v
  101920. }
  101921. reqHeaders.Set("User-Agent", c.s.userAgent())
  101922. var body io.Reader = nil
  101923. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  101924. if err != nil {
  101925. return nil, err
  101926. }
  101927. reqHeaders.Set("Content-Type", "application/json")
  101928. c.urlParams_.Set("alt", alt)
  101929. c.urlParams_.Set("prettyPrint", "false")
  101930. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  101931. urls += "?" + c.urlParams_.Encode()
  101932. req, err := http.NewRequest("POST", urls, body)
  101933. if err != nil {
  101934. return nil, err
  101935. }
  101936. req.Header = reqHeaders
  101937. googleapi.Expand(req.URL, map[string]string{
  101938. "project": c.project,
  101939. "region": c.region,
  101940. })
  101941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101942. }
  101943. // Do executes the "compute.regionCommitments.insert" call.
  101944. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101945. // status code is an error. Response headers are in either
  101946. // *Operation.ServerResponse.Header or (if a response was returned at
  101947. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101948. // to check whether the returned error was because
  101949. // http.StatusNotModified was returned.
  101950. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101951. gensupport.SetOptions(c.urlParams_, opts...)
  101952. res, err := c.doRequest("json")
  101953. if res != nil && res.StatusCode == http.StatusNotModified {
  101954. if res.Body != nil {
  101955. res.Body.Close()
  101956. }
  101957. return nil, &googleapi.Error{
  101958. Code: res.StatusCode,
  101959. Header: res.Header,
  101960. }
  101961. }
  101962. if err != nil {
  101963. return nil, err
  101964. }
  101965. defer googleapi.CloseBody(res)
  101966. if err := googleapi.CheckResponse(res); err != nil {
  101967. return nil, err
  101968. }
  101969. ret := &Operation{
  101970. ServerResponse: googleapi.ServerResponse{
  101971. Header: res.Header,
  101972. HTTPStatusCode: res.StatusCode,
  101973. },
  101974. }
  101975. target := &ret
  101976. if err := gensupport.DecodeResponse(target, res); err != nil {
  101977. return nil, err
  101978. }
  101979. return ret, nil
  101980. // {
  101981. // "description": "Creates a commitment in the specified project using the data included in the request.",
  101982. // "httpMethod": "POST",
  101983. // "id": "compute.regionCommitments.insert",
  101984. // "parameterOrder": [
  101985. // "project",
  101986. // "region"
  101987. // ],
  101988. // "parameters": {
  101989. // "project": {
  101990. // "description": "Project ID for this request.",
  101991. // "location": "path",
  101992. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101993. // "required": true,
  101994. // "type": "string"
  101995. // },
  101996. // "region": {
  101997. // "description": "Name of the region for this request.",
  101998. // "location": "path",
  101999. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102000. // "required": true,
  102001. // "type": "string"
  102002. // },
  102003. // "requestId": {
  102004. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102005. // "location": "query",
  102006. // "type": "string"
  102007. // }
  102008. // },
  102009. // "path": "{project}/regions/{region}/commitments",
  102010. // "request": {
  102011. // "$ref": "Commitment"
  102012. // },
  102013. // "response": {
  102014. // "$ref": "Operation"
  102015. // },
  102016. // "scopes": [
  102017. // "https://www.googleapis.com/auth/cloud-platform",
  102018. // "https://www.googleapis.com/auth/compute"
  102019. // ]
  102020. // }
  102021. }
  102022. // method id "compute.regionCommitments.list":
  102023. type RegionCommitmentsListCall struct {
  102024. s *Service
  102025. project string
  102026. region string
  102027. urlParams_ gensupport.URLParams
  102028. ifNoneMatch_ string
  102029. ctx_ context.Context
  102030. header_ http.Header
  102031. }
  102032. // List: Retrieves a list of commitments contained within the specified
  102033. // region.
  102034. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  102035. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102036. c.project = project
  102037. c.region = region
  102038. return c
  102039. }
  102040. // Filter sets the optional parameter "filter": A filter expression that
  102041. // filters resources listed in the response. The expression must specify
  102042. // the field name, a comparison operator, and the value that you want to
  102043. // use for filtering. The value must be a string, a number, or a
  102044. // boolean. The comparison operator must be either =, !=, >, or <.
  102045. //
  102046. // For example, if you are filtering Compute Engine instances, you can
  102047. // exclude instances named example-instance by specifying name !=
  102048. // example-instance.
  102049. //
  102050. // You can also filter nested fields. For example, you could specify
  102051. // scheduling.automaticRestart = false to include instances only if they
  102052. // are not scheduled for automatic restarts. You can use filtering on
  102053. // nested fields to filter based on resource labels.
  102054. //
  102055. // To filter on multiple expressions, provide each separate expression
  102056. // within parentheses. For example, (scheduling.automaticRestart = true)
  102057. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  102058. // AND expression. However, you can include AND and OR expressions
  102059. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  102060. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  102061. // true).
  102062. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  102063. c.urlParams_.Set("filter", filter)
  102064. return c
  102065. }
  102066. // MaxResults sets the optional parameter "maxResults": The maximum
  102067. // number of results per page that should be returned. If the number of
  102068. // available results is larger than maxResults, Compute Engine returns a
  102069. // nextPageToken that can be used to get the next page of results in
  102070. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  102071. // (Default: 500)
  102072. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  102073. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  102074. return c
  102075. }
  102076. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  102077. // a certain order. By default, results are returned in alphanumerical
  102078. // order based on the resource name.
  102079. //
  102080. // You can also sort results in descending order based on the creation
  102081. // timestamp using orderBy="creationTimestamp desc". This sorts results
  102082. // based on the creationTimestamp field in reverse chronological order
  102083. // (newest result first). Use this to sort resources like operations so
  102084. // that the newest operation is returned first.
  102085. //
  102086. // Currently, only sorting by name or creationTimestamp desc is
  102087. // supported.
  102088. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  102089. c.urlParams_.Set("orderBy", orderBy)
  102090. return c
  102091. }
  102092. // PageToken sets the optional parameter "pageToken": Specifies a page
  102093. // token to use. Set pageToken to the nextPageToken returned by a
  102094. // previous list request to get the next page of results.
  102095. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  102096. c.urlParams_.Set("pageToken", pageToken)
  102097. return c
  102098. }
  102099. // Fields allows partial responses to be retrieved. See
  102100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102101. // for more information.
  102102. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  102103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102104. return c
  102105. }
  102106. // IfNoneMatch sets the optional parameter which makes the operation
  102107. // fail if the object's ETag matches the given value. This is useful for
  102108. // getting updates only after the object has changed since the last
  102109. // request. Use googleapi.IsNotModified to check whether the response
  102110. // error from Do is the result of In-None-Match.
  102111. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  102112. c.ifNoneMatch_ = entityTag
  102113. return c
  102114. }
  102115. // Context sets the context to be used in this call's Do method. Any
  102116. // pending HTTP request will be aborted if the provided context is
  102117. // canceled.
  102118. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  102119. c.ctx_ = ctx
  102120. return c
  102121. }
  102122. // Header returns an http.Header that can be modified by the caller to
  102123. // add HTTP headers to the request.
  102124. func (c *RegionCommitmentsListCall) Header() http.Header {
  102125. if c.header_ == nil {
  102126. c.header_ = make(http.Header)
  102127. }
  102128. return c.header_
  102129. }
  102130. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  102131. reqHeaders := make(http.Header)
  102132. for k, v := range c.header_ {
  102133. reqHeaders[k] = v
  102134. }
  102135. reqHeaders.Set("User-Agent", c.s.userAgent())
  102136. if c.ifNoneMatch_ != "" {
  102137. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102138. }
  102139. var body io.Reader = nil
  102140. c.urlParams_.Set("alt", alt)
  102141. c.urlParams_.Set("prettyPrint", "false")
  102142. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  102143. urls += "?" + c.urlParams_.Encode()
  102144. req, err := http.NewRequest("GET", urls, body)
  102145. if err != nil {
  102146. return nil, err
  102147. }
  102148. req.Header = reqHeaders
  102149. googleapi.Expand(req.URL, map[string]string{
  102150. "project": c.project,
  102151. "region": c.region,
  102152. })
  102153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102154. }
  102155. // Do executes the "compute.regionCommitments.list" call.
  102156. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  102157. // status code is an error. Response headers are in either
  102158. // *CommitmentList.ServerResponse.Header or (if a response was returned
  102159. // at all) in error.(*googleapi.Error).Header. Use
  102160. // googleapi.IsNotModified to check whether the returned error was
  102161. // because http.StatusNotModified was returned.
  102162. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  102163. gensupport.SetOptions(c.urlParams_, opts...)
  102164. res, err := c.doRequest("json")
  102165. if res != nil && res.StatusCode == http.StatusNotModified {
  102166. if res.Body != nil {
  102167. res.Body.Close()
  102168. }
  102169. return nil, &googleapi.Error{
  102170. Code: res.StatusCode,
  102171. Header: res.Header,
  102172. }
  102173. }
  102174. if err != nil {
  102175. return nil, err
  102176. }
  102177. defer googleapi.CloseBody(res)
  102178. if err := googleapi.CheckResponse(res); err != nil {
  102179. return nil, err
  102180. }
  102181. ret := &CommitmentList{
  102182. ServerResponse: googleapi.ServerResponse{
  102183. Header: res.Header,
  102184. HTTPStatusCode: res.StatusCode,
  102185. },
  102186. }
  102187. target := &ret
  102188. if err := gensupport.DecodeResponse(target, res); err != nil {
  102189. return nil, err
  102190. }
  102191. return ret, nil
  102192. // {
  102193. // "description": "Retrieves a list of commitments contained within the specified region.",
  102194. // "httpMethod": "GET",
  102195. // "id": "compute.regionCommitments.list",
  102196. // "parameterOrder": [
  102197. // "project",
  102198. // "region"
  102199. // ],
  102200. // "parameters": {
  102201. // "filter": {
  102202. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  102203. // "location": "query",
  102204. // "type": "string"
  102205. // },
  102206. // "maxResults": {
  102207. // "default": "500",
  102208. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  102209. // "format": "uint32",
  102210. // "location": "query",
  102211. // "minimum": "0",
  102212. // "type": "integer"
  102213. // },
  102214. // "orderBy": {
  102215. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  102216. // "location": "query",
  102217. // "type": "string"
  102218. // },
  102219. // "pageToken": {
  102220. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  102221. // "location": "query",
  102222. // "type": "string"
  102223. // },
  102224. // "project": {
  102225. // "description": "Project ID for this request.",
  102226. // "location": "path",
  102227. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102228. // "required": true,
  102229. // "type": "string"
  102230. // },
  102231. // "region": {
  102232. // "description": "Name of the region for this request.",
  102233. // "location": "path",
  102234. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102235. // "required": true,
  102236. // "type": "string"
  102237. // }
  102238. // },
  102239. // "path": "{project}/regions/{region}/commitments",
  102240. // "response": {
  102241. // "$ref": "CommitmentList"
  102242. // },
  102243. // "scopes": [
  102244. // "https://www.googleapis.com/auth/cloud-platform",
  102245. // "https://www.googleapis.com/auth/compute",
  102246. // "https://www.googleapis.com/auth/compute.readonly"
  102247. // ]
  102248. // }
  102249. }
  102250. // Pages invokes f for each page of results.
  102251. // A non-nil error returned from f will halt the iteration.
  102252. // The provided context supersedes any context provided to the Context method.
  102253. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  102254. c.ctx_ = ctx
  102255. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  102256. for {
  102257. x, err := c.Do()
  102258. if err != nil {
  102259. return err
  102260. }
  102261. if err := f(x); err != nil {
  102262. return err
  102263. }
  102264. if x.NextPageToken == "" {
  102265. return nil
  102266. }
  102267. c.PageToken(x.NextPageToken)
  102268. }
  102269. }
  102270. // method id "compute.regionCommitments.testIamPermissions":
  102271. type RegionCommitmentsTestIamPermissionsCall struct {
  102272. s *Service
  102273. project string
  102274. region string
  102275. resource string
  102276. testpermissionsrequest *TestPermissionsRequest
  102277. urlParams_ gensupport.URLParams
  102278. ctx_ context.Context
  102279. header_ http.Header
  102280. }
  102281. // TestIamPermissions: Returns permissions that a caller has on the
  102282. // specified resource.
  102283. func (r *RegionCommitmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionCommitmentsTestIamPermissionsCall {
  102284. c := &RegionCommitmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102285. c.project = project
  102286. c.region = region
  102287. c.resource = resource
  102288. c.testpermissionsrequest = testpermissionsrequest
  102289. return c
  102290. }
  102291. // Fields allows partial responses to be retrieved. See
  102292. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102293. // for more information.
  102294. func (c *RegionCommitmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionCommitmentsTestIamPermissionsCall {
  102295. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102296. return c
  102297. }
  102298. // Context sets the context to be used in this call's Do method. Any
  102299. // pending HTTP request will be aborted if the provided context is
  102300. // canceled.
  102301. func (c *RegionCommitmentsTestIamPermissionsCall) Context(ctx context.Context) *RegionCommitmentsTestIamPermissionsCall {
  102302. c.ctx_ = ctx
  102303. return c
  102304. }
  102305. // Header returns an http.Header that can be modified by the caller to
  102306. // add HTTP headers to the request.
  102307. func (c *RegionCommitmentsTestIamPermissionsCall) Header() http.Header {
  102308. if c.header_ == nil {
  102309. c.header_ = make(http.Header)
  102310. }
  102311. return c.header_
  102312. }
  102313. func (c *RegionCommitmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  102314. reqHeaders := make(http.Header)
  102315. for k, v := range c.header_ {
  102316. reqHeaders[k] = v
  102317. }
  102318. reqHeaders.Set("User-Agent", c.s.userAgent())
  102319. var body io.Reader = nil
  102320. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  102321. if err != nil {
  102322. return nil, err
  102323. }
  102324. reqHeaders.Set("Content-Type", "application/json")
  102325. c.urlParams_.Set("alt", alt)
  102326. c.urlParams_.Set("prettyPrint", "false")
  102327. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{resource}/testIamPermissions")
  102328. urls += "?" + c.urlParams_.Encode()
  102329. req, err := http.NewRequest("POST", urls, body)
  102330. if err != nil {
  102331. return nil, err
  102332. }
  102333. req.Header = reqHeaders
  102334. googleapi.Expand(req.URL, map[string]string{
  102335. "project": c.project,
  102336. "region": c.region,
  102337. "resource": c.resource,
  102338. })
  102339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102340. }
  102341. // Do executes the "compute.regionCommitments.testIamPermissions" call.
  102342. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  102343. // non-2xx status code is an error. Response headers are in either
  102344. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  102345. // returned at all) in error.(*googleapi.Error).Header. Use
  102346. // googleapi.IsNotModified to check whether the returned error was
  102347. // because http.StatusNotModified was returned.
  102348. func (c *RegionCommitmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  102349. gensupport.SetOptions(c.urlParams_, opts...)
  102350. res, err := c.doRequest("json")
  102351. if res != nil && res.StatusCode == http.StatusNotModified {
  102352. if res.Body != nil {
  102353. res.Body.Close()
  102354. }
  102355. return nil, &googleapi.Error{
  102356. Code: res.StatusCode,
  102357. Header: res.Header,
  102358. }
  102359. }
  102360. if err != nil {
  102361. return nil, err
  102362. }
  102363. defer googleapi.CloseBody(res)
  102364. if err := googleapi.CheckResponse(res); err != nil {
  102365. return nil, err
  102366. }
  102367. ret := &TestPermissionsResponse{
  102368. ServerResponse: googleapi.ServerResponse{
  102369. Header: res.Header,
  102370. HTTPStatusCode: res.StatusCode,
  102371. },
  102372. }
  102373. target := &ret
  102374. if err := gensupport.DecodeResponse(target, res); err != nil {
  102375. return nil, err
  102376. }
  102377. return ret, nil
  102378. // {
  102379. // "description": "Returns permissions that a caller has on the specified resource.",
  102380. // "httpMethod": "POST",
  102381. // "id": "compute.regionCommitments.testIamPermissions",
  102382. // "parameterOrder": [
  102383. // "project",
  102384. // "region",
  102385. // "resource"
  102386. // ],
  102387. // "parameters": {
  102388. // "project": {
  102389. // "description": "Project ID for this request.",
  102390. // "location": "path",
  102391. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102392. // "required": true,
  102393. // "type": "string"
  102394. // },
  102395. // "region": {
  102396. // "description": "The name of the region for this request.",
  102397. // "location": "path",
  102398. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102399. // "required": true,
  102400. // "type": "string"
  102401. // },
  102402. // "resource": {
  102403. // "description": "Name or id of the resource for this request.",
  102404. // "location": "path",
  102405. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  102406. // "required": true,
  102407. // "type": "string"
  102408. // }
  102409. // },
  102410. // "path": "{project}/regions/{region}/commitments/{resource}/testIamPermissions",
  102411. // "request": {
  102412. // "$ref": "TestPermissionsRequest"
  102413. // },
  102414. // "response": {
  102415. // "$ref": "TestPermissionsResponse"
  102416. // },
  102417. // "scopes": [
  102418. // "https://www.googleapis.com/auth/cloud-platform",
  102419. // "https://www.googleapis.com/auth/compute",
  102420. // "https://www.googleapis.com/auth/compute.readonly"
  102421. // ]
  102422. // }
  102423. }
  102424. // method id "compute.regionCommitments.updateReservations":
  102425. type RegionCommitmentsUpdateReservationsCall struct {
  102426. s *Service
  102427. project string
  102428. region string
  102429. commitment string
  102430. regioncommitmentsupdatereservationsrequest *RegionCommitmentsUpdateReservationsRequest
  102431. urlParams_ gensupport.URLParams
  102432. ctx_ context.Context
  102433. header_ http.Header
  102434. }
  102435. // UpdateReservations: Update the shape of reservations for GPUS/Local
  102436. // SSDs of reservations within the commitments.
  102437. func (r *RegionCommitmentsService) UpdateReservations(project string, region string, commitment string, regioncommitmentsupdatereservationsrequest *RegionCommitmentsUpdateReservationsRequest) *RegionCommitmentsUpdateReservationsCall {
  102438. c := &RegionCommitmentsUpdateReservationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102439. c.project = project
  102440. c.region = region
  102441. c.commitment = commitment
  102442. c.regioncommitmentsupdatereservationsrequest = regioncommitmentsupdatereservationsrequest
  102443. return c
  102444. }
  102445. // RequestId sets the optional parameter "requestId": An optional
  102446. // request ID to identify requests. Specify a unique request ID so that
  102447. // if you must retry your request, the server will know to ignore the
  102448. // request if it has already been completed.
  102449. //
  102450. // For example, consider a situation where you make an initial request
  102451. // and the request times out. If you make the request again with the
  102452. // same request ID, the server can check if original operation with the
  102453. // same request ID was received, and if so, will ignore the second
  102454. // request. This prevents clients from accidentally creating duplicate
  102455. // commitments.
  102456. //
  102457. // The request ID must be a valid UUID with the exception that zero UUID
  102458. // is not supported (00000000-0000-0000-0000-000000000000).
  102459. func (c *RegionCommitmentsUpdateReservationsCall) RequestId(requestId string) *RegionCommitmentsUpdateReservationsCall {
  102460. c.urlParams_.Set("requestId", requestId)
  102461. return c
  102462. }
  102463. // Fields allows partial responses to be retrieved. See
  102464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102465. // for more information.
  102466. func (c *RegionCommitmentsUpdateReservationsCall) Fields(s ...googleapi.Field) *RegionCommitmentsUpdateReservationsCall {
  102467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102468. return c
  102469. }
  102470. // Context sets the context to be used in this call's Do method. Any
  102471. // pending HTTP request will be aborted if the provided context is
  102472. // canceled.
  102473. func (c *RegionCommitmentsUpdateReservationsCall) Context(ctx context.Context) *RegionCommitmentsUpdateReservationsCall {
  102474. c.ctx_ = ctx
  102475. return c
  102476. }
  102477. // Header returns an http.Header that can be modified by the caller to
  102478. // add HTTP headers to the request.
  102479. func (c *RegionCommitmentsUpdateReservationsCall) Header() http.Header {
  102480. if c.header_ == nil {
  102481. c.header_ = make(http.Header)
  102482. }
  102483. return c.header_
  102484. }
  102485. func (c *RegionCommitmentsUpdateReservationsCall) doRequest(alt string) (*http.Response, error) {
  102486. reqHeaders := make(http.Header)
  102487. for k, v := range c.header_ {
  102488. reqHeaders[k] = v
  102489. }
  102490. reqHeaders.Set("User-Agent", c.s.userAgent())
  102491. var body io.Reader = nil
  102492. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioncommitmentsupdatereservationsrequest)
  102493. if err != nil {
  102494. return nil, err
  102495. }
  102496. reqHeaders.Set("Content-Type", "application/json")
  102497. c.urlParams_.Set("alt", alt)
  102498. c.urlParams_.Set("prettyPrint", "false")
  102499. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}/updateReservations")
  102500. urls += "?" + c.urlParams_.Encode()
  102501. req, err := http.NewRequest("POST", urls, body)
  102502. if err != nil {
  102503. return nil, err
  102504. }
  102505. req.Header = reqHeaders
  102506. googleapi.Expand(req.URL, map[string]string{
  102507. "project": c.project,
  102508. "region": c.region,
  102509. "commitment": c.commitment,
  102510. })
  102511. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102512. }
  102513. // Do executes the "compute.regionCommitments.updateReservations" call.
  102514. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102515. // status code is an error. Response headers are in either
  102516. // *Operation.ServerResponse.Header or (if a response was returned at
  102517. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102518. // to check whether the returned error was because
  102519. // http.StatusNotModified was returned.
  102520. func (c *RegionCommitmentsUpdateReservationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102521. gensupport.SetOptions(c.urlParams_, opts...)
  102522. res, err := c.doRequest("json")
  102523. if res != nil && res.StatusCode == http.StatusNotModified {
  102524. if res.Body != nil {
  102525. res.Body.Close()
  102526. }
  102527. return nil, &googleapi.Error{
  102528. Code: res.StatusCode,
  102529. Header: res.Header,
  102530. }
  102531. }
  102532. if err != nil {
  102533. return nil, err
  102534. }
  102535. defer googleapi.CloseBody(res)
  102536. if err := googleapi.CheckResponse(res); err != nil {
  102537. return nil, err
  102538. }
  102539. ret := &Operation{
  102540. ServerResponse: googleapi.ServerResponse{
  102541. Header: res.Header,
  102542. HTTPStatusCode: res.StatusCode,
  102543. },
  102544. }
  102545. target := &ret
  102546. if err := gensupport.DecodeResponse(target, res); err != nil {
  102547. return nil, err
  102548. }
  102549. return ret, nil
  102550. // {
  102551. // "description": "Update the shape of reservations for GPUS/Local SSDs of reservations within the commitments.",
  102552. // "httpMethod": "POST",
  102553. // "id": "compute.regionCommitments.updateReservations",
  102554. // "parameterOrder": [
  102555. // "project",
  102556. // "region",
  102557. // "commitment"
  102558. // ],
  102559. // "parameters": {
  102560. // "commitment": {
  102561. // "description": "Name of the commitment of which the reservation's capacities are being updated.",
  102562. // "location": "path",
  102563. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  102564. // "required": true,
  102565. // "type": "string"
  102566. // },
  102567. // "project": {
  102568. // "description": "Project ID for this request.",
  102569. // "location": "path",
  102570. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102571. // "required": true,
  102572. // "type": "string"
  102573. // },
  102574. // "region": {
  102575. // "description": "Name of the region for this request.",
  102576. // "location": "path",
  102577. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102578. // "required": true,
  102579. // "type": "string"
  102580. // },
  102581. // "requestId": {
  102582. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102583. // "location": "query",
  102584. // "type": "string"
  102585. // }
  102586. // },
  102587. // "path": "{project}/regions/{region}/commitments/{commitment}/updateReservations",
  102588. // "request": {
  102589. // "$ref": "RegionCommitmentsUpdateReservationsRequest"
  102590. // },
  102591. // "response": {
  102592. // "$ref": "Operation"
  102593. // },
  102594. // "scopes": [
  102595. // "https://www.googleapis.com/auth/cloud-platform",
  102596. // "https://www.googleapis.com/auth/compute"
  102597. // ]
  102598. // }
  102599. }
  102600. // method id "compute.regionDiskTypes.get":
  102601. type RegionDiskTypesGetCall struct {
  102602. s *Service
  102603. project string
  102604. region string
  102605. diskType string
  102606. urlParams_ gensupport.URLParams
  102607. ifNoneMatch_ string
  102608. ctx_ context.Context
  102609. header_ http.Header
  102610. }
  102611. // Get: Returns the specified regional disk type. Gets a list of
  102612. // available disk types by making a list() request.
  102613. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  102614. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102615. c.project = project
  102616. c.region = region
  102617. c.diskType = diskType
  102618. return c
  102619. }
  102620. // Fields allows partial responses to be retrieved. See
  102621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102622. // for more information.
  102623. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  102624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102625. return c
  102626. }
  102627. // IfNoneMatch sets the optional parameter which makes the operation
  102628. // fail if the object's ETag matches the given value. This is useful for
  102629. // getting updates only after the object has changed since the last
  102630. // request. Use googleapi.IsNotModified to check whether the response
  102631. // error from Do is the result of In-None-Match.
  102632. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  102633. c.ifNoneMatch_ = entityTag
  102634. return c
  102635. }
  102636. // Context sets the context to be used in this call's Do method. Any
  102637. // pending HTTP request will be aborted if the provided context is
  102638. // canceled.
  102639. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  102640. c.ctx_ = ctx
  102641. return c
  102642. }
  102643. // Header returns an http.Header that can be modified by the caller to
  102644. // add HTTP headers to the request.
  102645. func (c *RegionDiskTypesGetCall) Header() http.Header {
  102646. if c.header_ == nil {
  102647. c.header_ = make(http.Header)
  102648. }
  102649. return c.header_
  102650. }
  102651. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  102652. reqHeaders := make(http.Header)
  102653. for k, v := range c.header_ {
  102654. reqHeaders[k] = v
  102655. }
  102656. reqHeaders.Set("User-Agent", c.s.userAgent())
  102657. if c.ifNoneMatch_ != "" {
  102658. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102659. }
  102660. var body io.Reader = nil
  102661. c.urlParams_.Set("alt", alt)
  102662. c.urlParams_.Set("prettyPrint", "false")
  102663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  102664. urls += "?" + c.urlParams_.Encode()
  102665. req, err := http.NewRequest("GET", urls, body)
  102666. if err != nil {
  102667. return nil, err
  102668. }
  102669. req.Header = reqHeaders
  102670. googleapi.Expand(req.URL, map[string]string{
  102671. "project": c.project,
  102672. "region": c.region,
  102673. "diskType": c.diskType,
  102674. })
  102675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102676. }
  102677. // Do executes the "compute.regionDiskTypes.get" call.
  102678. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  102679. // code is an error. Response headers are in either
  102680. // *DiskType.ServerResponse.Header or (if a response was returned at
  102681. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102682. // to check whether the returned error was because
  102683. // http.StatusNotModified was returned.
  102684. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  102685. gensupport.SetOptions(c.urlParams_, opts...)
  102686. res, err := c.doRequest("json")
  102687. if res != nil && res.StatusCode == http.StatusNotModified {
  102688. if res.Body != nil {
  102689. res.Body.Close()
  102690. }
  102691. return nil, &googleapi.Error{
  102692. Code: res.StatusCode,
  102693. Header: res.Header,
  102694. }
  102695. }
  102696. if err != nil {
  102697. return nil, err
  102698. }
  102699. defer googleapi.CloseBody(res)
  102700. if err := googleapi.CheckResponse(res); err != nil {
  102701. return nil, err
  102702. }
  102703. ret := &DiskType{
  102704. ServerResponse: googleapi.ServerResponse{
  102705. Header: res.Header,
  102706. HTTPStatusCode: res.StatusCode,
  102707. },
  102708. }
  102709. target := &ret
  102710. if err := gensupport.DecodeResponse(target, res); err != nil {
  102711. return nil, err
  102712. }
  102713. return ret, nil
  102714. // {
  102715. // "description": "Returns the specified regional disk type. Gets a list of available disk types by making a list() request.",
  102716. // "httpMethod": "GET",
  102717. // "id": "compute.regionDiskTypes.get",
  102718. // "parameterOrder": [
  102719. // "project",
  102720. // "region",
  102721. // "diskType"
  102722. // ],
  102723. // "parameters": {
  102724. // "diskType": {
  102725. // "description": "Name of the disk type to return.",
  102726. // "location": "path",
  102727. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  102728. // "required": true,
  102729. // "type": "string"
  102730. // },
  102731. // "project": {
  102732. // "description": "Project ID for this request.",
  102733. // "location": "path",
  102734. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102735. // "required": true,
  102736. // "type": "string"
  102737. // },
  102738. // "region": {
  102739. // "description": "The name of the region for this request.",
  102740. // "location": "path",
  102741. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102742. // "required": true,
  102743. // "type": "string"
  102744. // }
  102745. // },
  102746. // "path": "{project}/regions/{region}/diskTypes/{diskType}",
  102747. // "response": {
  102748. // "$ref": "DiskType"
  102749. // },
  102750. // "scopes": [
  102751. // "https://www.googleapis.com/auth/cloud-platform",
  102752. // "https://www.googleapis.com/auth/compute",
  102753. // "https://www.googleapis.com/auth/compute.readonly"
  102754. // ]
  102755. // }
  102756. }
  102757. // method id "compute.regionDiskTypes.list":
  102758. type RegionDiskTypesListCall struct {
  102759. s *Service
  102760. project string
  102761. region string
  102762. urlParams_ gensupport.URLParams
  102763. ifNoneMatch_ string
  102764. ctx_ context.Context
  102765. header_ http.Header
  102766. }
  102767. // List: Retrieves a list of regional disk types available to the
  102768. // specified project.
  102769. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  102770. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102771. c.project = project
  102772. c.region = region
  102773. return c
  102774. }
  102775. // Filter sets the optional parameter "filter": A filter expression that
  102776. // filters resources listed in the response. The expression must specify
  102777. // the field name, a comparison operator, and the value that you want to
  102778. // use for filtering. The value must be a string, a number, or a
  102779. // boolean. The comparison operator must be either =, !=, >, or <.
  102780. //
  102781. // For example, if you are filtering Compute Engine instances, you can
  102782. // exclude instances named example-instance by specifying name !=
  102783. // example-instance.
  102784. //
  102785. // You can also filter nested fields. For example, you could specify
  102786. // scheduling.automaticRestart = false to include instances only if they
  102787. // are not scheduled for automatic restarts. You can use filtering on
  102788. // nested fields to filter based on resource labels.
  102789. //
  102790. // To filter on multiple expressions, provide each separate expression
  102791. // within parentheses. For example, (scheduling.automaticRestart = true)
  102792. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  102793. // AND expression. However, you can include AND and OR expressions
  102794. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  102795. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  102796. // true).
  102797. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  102798. c.urlParams_.Set("filter", filter)
  102799. return c
  102800. }
  102801. // MaxResults sets the optional parameter "maxResults": The maximum
  102802. // number of results per page that should be returned. If the number of
  102803. // available results is larger than maxResults, Compute Engine returns a
  102804. // nextPageToken that can be used to get the next page of results in
  102805. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  102806. // (Default: 500)
  102807. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  102808. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  102809. return c
  102810. }
  102811. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  102812. // a certain order. By default, results are returned in alphanumerical
  102813. // order based on the resource name.
  102814. //
  102815. // You can also sort results in descending order based on the creation
  102816. // timestamp using orderBy="creationTimestamp desc". This sorts results
  102817. // based on the creationTimestamp field in reverse chronological order
  102818. // (newest result first). Use this to sort resources like operations so
  102819. // that the newest operation is returned first.
  102820. //
  102821. // Currently, only sorting by name or creationTimestamp desc is
  102822. // supported.
  102823. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  102824. c.urlParams_.Set("orderBy", orderBy)
  102825. return c
  102826. }
  102827. // PageToken sets the optional parameter "pageToken": Specifies a page
  102828. // token to use. Set pageToken to the nextPageToken returned by a
  102829. // previous list request to get the next page of results.
  102830. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  102831. c.urlParams_.Set("pageToken", pageToken)
  102832. return c
  102833. }
  102834. // Fields allows partial responses to be retrieved. See
  102835. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102836. // for more information.
  102837. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  102838. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102839. return c
  102840. }
  102841. // IfNoneMatch sets the optional parameter which makes the operation
  102842. // fail if the object's ETag matches the given value. This is useful for
  102843. // getting updates only after the object has changed since the last
  102844. // request. Use googleapi.IsNotModified to check whether the response
  102845. // error from Do is the result of In-None-Match.
  102846. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  102847. c.ifNoneMatch_ = entityTag
  102848. return c
  102849. }
  102850. // Context sets the context to be used in this call's Do method. Any
  102851. // pending HTTP request will be aborted if the provided context is
  102852. // canceled.
  102853. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  102854. c.ctx_ = ctx
  102855. return c
  102856. }
  102857. // Header returns an http.Header that can be modified by the caller to
  102858. // add HTTP headers to the request.
  102859. func (c *RegionDiskTypesListCall) Header() http.Header {
  102860. if c.header_ == nil {
  102861. c.header_ = make(http.Header)
  102862. }
  102863. return c.header_
  102864. }
  102865. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  102866. reqHeaders := make(http.Header)
  102867. for k, v := range c.header_ {
  102868. reqHeaders[k] = v
  102869. }
  102870. reqHeaders.Set("User-Agent", c.s.userAgent())
  102871. if c.ifNoneMatch_ != "" {
  102872. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102873. }
  102874. var body io.Reader = nil
  102875. c.urlParams_.Set("alt", alt)
  102876. c.urlParams_.Set("prettyPrint", "false")
  102877. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  102878. urls += "?" + c.urlParams_.Encode()
  102879. req, err := http.NewRequest("GET", urls, body)
  102880. if err != nil {
  102881. return nil, err
  102882. }
  102883. req.Header = reqHeaders
  102884. googleapi.Expand(req.URL, map[string]string{
  102885. "project": c.project,
  102886. "region": c.region,
  102887. })
  102888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102889. }
  102890. // Do executes the "compute.regionDiskTypes.list" call.
  102891. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  102892. // non-2xx status code is an error. Response headers are in either
  102893. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  102894. // returned at all) in error.(*googleapi.Error).Header. Use
  102895. // googleapi.IsNotModified to check whether the returned error was
  102896. // because http.StatusNotModified was returned.
  102897. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  102898. gensupport.SetOptions(c.urlParams_, opts...)
  102899. res, err := c.doRequest("json")
  102900. if res != nil && res.StatusCode == http.StatusNotModified {
  102901. if res.Body != nil {
  102902. res.Body.Close()
  102903. }
  102904. return nil, &googleapi.Error{
  102905. Code: res.StatusCode,
  102906. Header: res.Header,
  102907. }
  102908. }
  102909. if err != nil {
  102910. return nil, err
  102911. }
  102912. defer googleapi.CloseBody(res)
  102913. if err := googleapi.CheckResponse(res); err != nil {
  102914. return nil, err
  102915. }
  102916. ret := &RegionDiskTypeList{
  102917. ServerResponse: googleapi.ServerResponse{
  102918. Header: res.Header,
  102919. HTTPStatusCode: res.StatusCode,
  102920. },
  102921. }
  102922. target := &ret
  102923. if err := gensupport.DecodeResponse(target, res); err != nil {
  102924. return nil, err
  102925. }
  102926. return ret, nil
  102927. // {
  102928. // "description": "Retrieves a list of regional disk types available to the specified project.",
  102929. // "httpMethod": "GET",
  102930. // "id": "compute.regionDiskTypes.list",
  102931. // "parameterOrder": [
  102932. // "project",
  102933. // "region"
  102934. // ],
  102935. // "parameters": {
  102936. // "filter": {
  102937. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  102938. // "location": "query",
  102939. // "type": "string"
  102940. // },
  102941. // "maxResults": {
  102942. // "default": "500",
  102943. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  102944. // "format": "uint32",
  102945. // "location": "query",
  102946. // "minimum": "0",
  102947. // "type": "integer"
  102948. // },
  102949. // "orderBy": {
  102950. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  102951. // "location": "query",
  102952. // "type": "string"
  102953. // },
  102954. // "pageToken": {
  102955. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  102956. // "location": "query",
  102957. // "type": "string"
  102958. // },
  102959. // "project": {
  102960. // "description": "Project ID for this request.",
  102961. // "location": "path",
  102962. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102963. // "required": true,
  102964. // "type": "string"
  102965. // },
  102966. // "region": {
  102967. // "description": "The name of the region for this request.",
  102968. // "location": "path",
  102969. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102970. // "required": true,
  102971. // "type": "string"
  102972. // }
  102973. // },
  102974. // "path": "{project}/regions/{region}/diskTypes",
  102975. // "response": {
  102976. // "$ref": "RegionDiskTypeList"
  102977. // },
  102978. // "scopes": [
  102979. // "https://www.googleapis.com/auth/cloud-platform",
  102980. // "https://www.googleapis.com/auth/compute",
  102981. // "https://www.googleapis.com/auth/compute.readonly"
  102982. // ]
  102983. // }
  102984. }
  102985. // Pages invokes f for each page of results.
  102986. // A non-nil error returned from f will halt the iteration.
  102987. // The provided context supersedes any context provided to the Context method.
  102988. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  102989. c.ctx_ = ctx
  102990. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  102991. for {
  102992. x, err := c.Do()
  102993. if err != nil {
  102994. return err
  102995. }
  102996. if err := f(x); err != nil {
  102997. return err
  102998. }
  102999. if x.NextPageToken == "" {
  103000. return nil
  103001. }
  103002. c.PageToken(x.NextPageToken)
  103003. }
  103004. }
  103005. // method id "compute.regionDisks.addResourcePolicies":
  103006. type RegionDisksAddResourcePoliciesCall struct {
  103007. s *Service
  103008. project string
  103009. region string
  103010. disk string
  103011. regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest
  103012. urlParams_ gensupport.URLParams
  103013. ctx_ context.Context
  103014. header_ http.Header
  103015. }
  103016. // AddResourcePolicies: Adds existing resource policies to a regional
  103017. // disk. You can only add one policy which will be applied to this disk
  103018. // for scheduling snapshot creation.
  103019. func (r *RegionDisksService) AddResourcePolicies(project string, region string, disk string, regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest) *RegionDisksAddResourcePoliciesCall {
  103020. c := &RegionDisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103021. c.project = project
  103022. c.region = region
  103023. c.disk = disk
  103024. c.regiondisksaddresourcepoliciesrequest = regiondisksaddresourcepoliciesrequest
  103025. return c
  103026. }
  103027. // RequestId sets the optional parameter "requestId": An optional
  103028. // request ID to identify requests. Specify a unique request ID so that
  103029. // if you must retry your request, the server will know to ignore the
  103030. // request if it has already been completed.
  103031. //
  103032. // For example, consider a situation where you make an initial request
  103033. // and the request times out. If you make the request again with the
  103034. // same request ID, the server can check if original operation with the
  103035. // same request ID was received, and if so, will ignore the second
  103036. // request. This prevents clients from accidentally creating duplicate
  103037. // commitments.
  103038. //
  103039. // The request ID must be a valid UUID with the exception that zero UUID
  103040. // is not supported (00000000-0000-0000-0000-000000000000).
  103041. func (c *RegionDisksAddResourcePoliciesCall) RequestId(requestId string) *RegionDisksAddResourcePoliciesCall {
  103042. c.urlParams_.Set("requestId", requestId)
  103043. return c
  103044. }
  103045. // Fields allows partial responses to be retrieved. See
  103046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103047. // for more information.
  103048. func (c *RegionDisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksAddResourcePoliciesCall {
  103049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103050. return c
  103051. }
  103052. // Context sets the context to be used in this call's Do method. Any
  103053. // pending HTTP request will be aborted if the provided context is
  103054. // canceled.
  103055. func (c *RegionDisksAddResourcePoliciesCall) Context(ctx context.Context) *RegionDisksAddResourcePoliciesCall {
  103056. c.ctx_ = ctx
  103057. return c
  103058. }
  103059. // Header returns an http.Header that can be modified by the caller to
  103060. // add HTTP headers to the request.
  103061. func (c *RegionDisksAddResourcePoliciesCall) Header() http.Header {
  103062. if c.header_ == nil {
  103063. c.header_ = make(http.Header)
  103064. }
  103065. return c.header_
  103066. }
  103067. func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  103068. reqHeaders := make(http.Header)
  103069. for k, v := range c.header_ {
  103070. reqHeaders[k] = v
  103071. }
  103072. reqHeaders.Set("User-Agent", c.s.userAgent())
  103073. var body io.Reader = nil
  103074. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest)
  103075. if err != nil {
  103076. return nil, err
  103077. }
  103078. reqHeaders.Set("Content-Type", "application/json")
  103079. c.urlParams_.Set("alt", alt)
  103080. c.urlParams_.Set("prettyPrint", "false")
  103081. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/addResourcePolicies")
  103082. urls += "?" + c.urlParams_.Encode()
  103083. req, err := http.NewRequest("POST", urls, body)
  103084. if err != nil {
  103085. return nil, err
  103086. }
  103087. req.Header = reqHeaders
  103088. googleapi.Expand(req.URL, map[string]string{
  103089. "project": c.project,
  103090. "region": c.region,
  103091. "disk": c.disk,
  103092. })
  103093. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103094. }
  103095. // Do executes the "compute.regionDisks.addResourcePolicies" call.
  103096. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103097. // status code is an error. Response headers are in either
  103098. // *Operation.ServerResponse.Header or (if a response was returned at
  103099. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103100. // to check whether the returned error was because
  103101. // http.StatusNotModified was returned.
  103102. func (c *RegionDisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103103. gensupport.SetOptions(c.urlParams_, opts...)
  103104. res, err := c.doRequest("json")
  103105. if res != nil && res.StatusCode == http.StatusNotModified {
  103106. if res.Body != nil {
  103107. res.Body.Close()
  103108. }
  103109. return nil, &googleapi.Error{
  103110. Code: res.StatusCode,
  103111. Header: res.Header,
  103112. }
  103113. }
  103114. if err != nil {
  103115. return nil, err
  103116. }
  103117. defer googleapi.CloseBody(res)
  103118. if err := googleapi.CheckResponse(res); err != nil {
  103119. return nil, err
  103120. }
  103121. ret := &Operation{
  103122. ServerResponse: googleapi.ServerResponse{
  103123. Header: res.Header,
  103124. HTTPStatusCode: res.StatusCode,
  103125. },
  103126. }
  103127. target := &ret
  103128. if err := gensupport.DecodeResponse(target, res); err != nil {
  103129. return nil, err
  103130. }
  103131. return ret, nil
  103132. // {
  103133. // "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.",
  103134. // "httpMethod": "POST",
  103135. // "id": "compute.regionDisks.addResourcePolicies",
  103136. // "parameterOrder": [
  103137. // "project",
  103138. // "region",
  103139. // "disk"
  103140. // ],
  103141. // "parameters": {
  103142. // "disk": {
  103143. // "description": "The disk name for this request.",
  103144. // "location": "path",
  103145. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103146. // "required": true,
  103147. // "type": "string"
  103148. // },
  103149. // "project": {
  103150. // "description": "Project ID for this request.",
  103151. // "location": "path",
  103152. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103153. // "required": true,
  103154. // "type": "string"
  103155. // },
  103156. // "region": {
  103157. // "description": "The name of the region for this request.",
  103158. // "location": "path",
  103159. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103160. // "required": true,
  103161. // "type": "string"
  103162. // },
  103163. // "requestId": {
  103164. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103165. // "location": "query",
  103166. // "type": "string"
  103167. // }
  103168. // },
  103169. // "path": "{project}/regions/{region}/disks/{disk}/addResourcePolicies",
  103170. // "request": {
  103171. // "$ref": "RegionDisksAddResourcePoliciesRequest"
  103172. // },
  103173. // "response": {
  103174. // "$ref": "Operation"
  103175. // },
  103176. // "scopes": [
  103177. // "https://www.googleapis.com/auth/cloud-platform",
  103178. // "https://www.googleapis.com/auth/compute"
  103179. // ]
  103180. // }
  103181. }
  103182. // method id "compute.regionDisks.createSnapshot":
  103183. type RegionDisksCreateSnapshotCall struct {
  103184. s *Service
  103185. project string
  103186. region string
  103187. disk string
  103188. snapshot *Snapshot
  103189. urlParams_ gensupport.URLParams
  103190. ctx_ context.Context
  103191. header_ http.Header
  103192. }
  103193. // CreateSnapshot: Creates a snapshot of this regional disk.
  103194. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  103195. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103196. c.project = project
  103197. c.region = region
  103198. c.disk = disk
  103199. c.snapshot = snapshot
  103200. return c
  103201. }
  103202. // GuestFlush sets the optional parameter "guestFlush": [Input Only]
  103203. // Specifies to create an application consistent snapshot by informing
  103204. // the OS to prepare for the snapshot process. Currently only supported
  103205. // on Windows instances using the Volume Shadow Copy Service (VSS).
  103206. func (c *RegionDisksCreateSnapshotCall) GuestFlush(guestFlush bool) *RegionDisksCreateSnapshotCall {
  103207. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  103208. return c
  103209. }
  103210. // RequestId sets the optional parameter "requestId": An optional
  103211. // request ID to identify requests. Specify a unique request ID so that
  103212. // if you must retry your request, the server will know to ignore the
  103213. // request if it has already been completed.
  103214. //
  103215. // For example, consider a situation where you make an initial request
  103216. // and the request times out. If you make the request again with the
  103217. // same request ID, the server can check if original operation with the
  103218. // same request ID was received, and if so, will ignore the second
  103219. // request. This prevents clients from accidentally creating duplicate
  103220. // commitments.
  103221. //
  103222. // The request ID must be a valid UUID with the exception that zero UUID
  103223. // is not supported (00000000-0000-0000-0000-000000000000).
  103224. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  103225. c.urlParams_.Set("requestId", requestId)
  103226. return c
  103227. }
  103228. // Fields allows partial responses to be retrieved. See
  103229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103230. // for more information.
  103231. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  103232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103233. return c
  103234. }
  103235. // Context sets the context to be used in this call's Do method. Any
  103236. // pending HTTP request will be aborted if the provided context is
  103237. // canceled.
  103238. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  103239. c.ctx_ = ctx
  103240. return c
  103241. }
  103242. // Header returns an http.Header that can be modified by the caller to
  103243. // add HTTP headers to the request.
  103244. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  103245. if c.header_ == nil {
  103246. c.header_ = make(http.Header)
  103247. }
  103248. return c.header_
  103249. }
  103250. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  103251. reqHeaders := make(http.Header)
  103252. for k, v := range c.header_ {
  103253. reqHeaders[k] = v
  103254. }
  103255. reqHeaders.Set("User-Agent", c.s.userAgent())
  103256. var body io.Reader = nil
  103257. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  103258. if err != nil {
  103259. return nil, err
  103260. }
  103261. reqHeaders.Set("Content-Type", "application/json")
  103262. c.urlParams_.Set("alt", alt)
  103263. c.urlParams_.Set("prettyPrint", "false")
  103264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  103265. urls += "?" + c.urlParams_.Encode()
  103266. req, err := http.NewRequest("POST", urls, body)
  103267. if err != nil {
  103268. return nil, err
  103269. }
  103270. req.Header = reqHeaders
  103271. googleapi.Expand(req.URL, map[string]string{
  103272. "project": c.project,
  103273. "region": c.region,
  103274. "disk": c.disk,
  103275. })
  103276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103277. }
  103278. // Do executes the "compute.regionDisks.createSnapshot" call.
  103279. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103280. // status code is an error. Response headers are in either
  103281. // *Operation.ServerResponse.Header or (if a response was returned at
  103282. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103283. // to check whether the returned error was because
  103284. // http.StatusNotModified was returned.
  103285. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103286. gensupport.SetOptions(c.urlParams_, opts...)
  103287. res, err := c.doRequest("json")
  103288. if res != nil && res.StatusCode == http.StatusNotModified {
  103289. if res.Body != nil {
  103290. res.Body.Close()
  103291. }
  103292. return nil, &googleapi.Error{
  103293. Code: res.StatusCode,
  103294. Header: res.Header,
  103295. }
  103296. }
  103297. if err != nil {
  103298. return nil, err
  103299. }
  103300. defer googleapi.CloseBody(res)
  103301. if err := googleapi.CheckResponse(res); err != nil {
  103302. return nil, err
  103303. }
  103304. ret := &Operation{
  103305. ServerResponse: googleapi.ServerResponse{
  103306. Header: res.Header,
  103307. HTTPStatusCode: res.StatusCode,
  103308. },
  103309. }
  103310. target := &ret
  103311. if err := gensupport.DecodeResponse(target, res); err != nil {
  103312. return nil, err
  103313. }
  103314. return ret, nil
  103315. // {
  103316. // "description": "Creates a snapshot of this regional disk.",
  103317. // "httpMethod": "POST",
  103318. // "id": "compute.regionDisks.createSnapshot",
  103319. // "parameterOrder": [
  103320. // "project",
  103321. // "region",
  103322. // "disk"
  103323. // ],
  103324. // "parameters": {
  103325. // "disk": {
  103326. // "description": "Name of the regional persistent disk to snapshot.",
  103327. // "location": "path",
  103328. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103329. // "required": true,
  103330. // "type": "string"
  103331. // },
  103332. // "guestFlush": {
  103333. // "description": "[Input Only] Specifies to create an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).",
  103334. // "location": "query",
  103335. // "type": "boolean"
  103336. // },
  103337. // "project": {
  103338. // "description": "Project ID for this request.",
  103339. // "location": "path",
  103340. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103341. // "required": true,
  103342. // "type": "string"
  103343. // },
  103344. // "region": {
  103345. // "description": "Name of the region for this request.",
  103346. // "location": "path",
  103347. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103348. // "required": true,
  103349. // "type": "string"
  103350. // },
  103351. // "requestId": {
  103352. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103353. // "location": "query",
  103354. // "type": "string"
  103355. // }
  103356. // },
  103357. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  103358. // "request": {
  103359. // "$ref": "Snapshot"
  103360. // },
  103361. // "response": {
  103362. // "$ref": "Operation"
  103363. // },
  103364. // "scopes": [
  103365. // "https://www.googleapis.com/auth/cloud-platform",
  103366. // "https://www.googleapis.com/auth/compute"
  103367. // ]
  103368. // }
  103369. }
  103370. // method id "compute.regionDisks.delete":
  103371. type RegionDisksDeleteCall struct {
  103372. s *Service
  103373. project string
  103374. region string
  103375. disk string
  103376. urlParams_ gensupport.URLParams
  103377. ctx_ context.Context
  103378. header_ http.Header
  103379. }
  103380. // Delete: Deletes the specified regional persistent disk. Deleting a
  103381. // regional disk removes all the replicas of its data permanently and is
  103382. // irreversible. However, deleting a disk does not delete any snapshots
  103383. // previously made from the disk. You must separately delete snapshots.
  103384. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  103385. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103386. c.project = project
  103387. c.region = region
  103388. c.disk = disk
  103389. return c
  103390. }
  103391. // RequestId sets the optional parameter "requestId": An optional
  103392. // request ID to identify requests. Specify a unique request ID so that
  103393. // if you must retry your request, the server will know to ignore the
  103394. // request if it has already been completed.
  103395. //
  103396. // For example, consider a situation where you make an initial request
  103397. // and the request times out. If you make the request again with the
  103398. // same request ID, the server can check if original operation with the
  103399. // same request ID was received, and if so, will ignore the second
  103400. // request. This prevents clients from accidentally creating duplicate
  103401. // commitments.
  103402. //
  103403. // The request ID must be a valid UUID with the exception that zero UUID
  103404. // is not supported (00000000-0000-0000-0000-000000000000).
  103405. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  103406. c.urlParams_.Set("requestId", requestId)
  103407. return c
  103408. }
  103409. // Fields allows partial responses to be retrieved. See
  103410. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103411. // for more information.
  103412. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  103413. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103414. return c
  103415. }
  103416. // Context sets the context to be used in this call's Do method. Any
  103417. // pending HTTP request will be aborted if the provided context is
  103418. // canceled.
  103419. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  103420. c.ctx_ = ctx
  103421. return c
  103422. }
  103423. // Header returns an http.Header that can be modified by the caller to
  103424. // add HTTP headers to the request.
  103425. func (c *RegionDisksDeleteCall) Header() http.Header {
  103426. if c.header_ == nil {
  103427. c.header_ = make(http.Header)
  103428. }
  103429. return c.header_
  103430. }
  103431. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  103432. reqHeaders := make(http.Header)
  103433. for k, v := range c.header_ {
  103434. reqHeaders[k] = v
  103435. }
  103436. reqHeaders.Set("User-Agent", c.s.userAgent())
  103437. var body io.Reader = nil
  103438. c.urlParams_.Set("alt", alt)
  103439. c.urlParams_.Set("prettyPrint", "false")
  103440. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  103441. urls += "?" + c.urlParams_.Encode()
  103442. req, err := http.NewRequest("DELETE", urls, body)
  103443. if err != nil {
  103444. return nil, err
  103445. }
  103446. req.Header = reqHeaders
  103447. googleapi.Expand(req.URL, map[string]string{
  103448. "project": c.project,
  103449. "region": c.region,
  103450. "disk": c.disk,
  103451. })
  103452. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103453. }
  103454. // Do executes the "compute.regionDisks.delete" call.
  103455. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103456. // status code is an error. Response headers are in either
  103457. // *Operation.ServerResponse.Header or (if a response was returned at
  103458. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103459. // to check whether the returned error was because
  103460. // http.StatusNotModified was returned.
  103461. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103462. gensupport.SetOptions(c.urlParams_, opts...)
  103463. res, err := c.doRequest("json")
  103464. if res != nil && res.StatusCode == http.StatusNotModified {
  103465. if res.Body != nil {
  103466. res.Body.Close()
  103467. }
  103468. return nil, &googleapi.Error{
  103469. Code: res.StatusCode,
  103470. Header: res.Header,
  103471. }
  103472. }
  103473. if err != nil {
  103474. return nil, err
  103475. }
  103476. defer googleapi.CloseBody(res)
  103477. if err := googleapi.CheckResponse(res); err != nil {
  103478. return nil, err
  103479. }
  103480. ret := &Operation{
  103481. ServerResponse: googleapi.ServerResponse{
  103482. Header: res.Header,
  103483. HTTPStatusCode: res.StatusCode,
  103484. },
  103485. }
  103486. target := &ret
  103487. if err := gensupport.DecodeResponse(target, res); err != nil {
  103488. return nil, err
  103489. }
  103490. return ret, nil
  103491. // {
  103492. // "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.",
  103493. // "httpMethod": "DELETE",
  103494. // "id": "compute.regionDisks.delete",
  103495. // "parameterOrder": [
  103496. // "project",
  103497. // "region",
  103498. // "disk"
  103499. // ],
  103500. // "parameters": {
  103501. // "disk": {
  103502. // "description": "Name of the regional persistent disk to delete.",
  103503. // "location": "path",
  103504. // "required": true,
  103505. // "type": "string"
  103506. // },
  103507. // "project": {
  103508. // "description": "Project ID for this request.",
  103509. // "location": "path",
  103510. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103511. // "required": true,
  103512. // "type": "string"
  103513. // },
  103514. // "region": {
  103515. // "description": "Name of the region for this request.",
  103516. // "location": "path",
  103517. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103518. // "required": true,
  103519. // "type": "string"
  103520. // },
  103521. // "requestId": {
  103522. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103523. // "location": "query",
  103524. // "type": "string"
  103525. // }
  103526. // },
  103527. // "path": "{project}/regions/{region}/disks/{disk}",
  103528. // "response": {
  103529. // "$ref": "Operation"
  103530. // },
  103531. // "scopes": [
  103532. // "https://www.googleapis.com/auth/cloud-platform",
  103533. // "https://www.googleapis.com/auth/compute"
  103534. // ]
  103535. // }
  103536. }
  103537. // method id "compute.regionDisks.get":
  103538. type RegionDisksGetCall struct {
  103539. s *Service
  103540. project string
  103541. region string
  103542. disk string
  103543. urlParams_ gensupport.URLParams
  103544. ifNoneMatch_ string
  103545. ctx_ context.Context
  103546. header_ http.Header
  103547. }
  103548. // Get: Returns a specified regional persistent disk.
  103549. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  103550. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103551. c.project = project
  103552. c.region = region
  103553. c.disk = disk
  103554. return c
  103555. }
  103556. // Fields allows partial responses to be retrieved. See
  103557. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103558. // for more information.
  103559. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  103560. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103561. return c
  103562. }
  103563. // IfNoneMatch sets the optional parameter which makes the operation
  103564. // fail if the object's ETag matches the given value. This is useful for
  103565. // getting updates only after the object has changed since the last
  103566. // request. Use googleapi.IsNotModified to check whether the response
  103567. // error from Do is the result of In-None-Match.
  103568. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  103569. c.ifNoneMatch_ = entityTag
  103570. return c
  103571. }
  103572. // Context sets the context to be used in this call's Do method. Any
  103573. // pending HTTP request will be aborted if the provided context is
  103574. // canceled.
  103575. func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  103576. c.ctx_ = ctx
  103577. return c
  103578. }
  103579. // Header returns an http.Header that can be modified by the caller to
  103580. // add HTTP headers to the request.
  103581. func (c *RegionDisksGetCall) Header() http.Header {
  103582. if c.header_ == nil {
  103583. c.header_ = make(http.Header)
  103584. }
  103585. return c.header_
  103586. }
  103587. func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
  103588. reqHeaders := make(http.Header)
  103589. for k, v := range c.header_ {
  103590. reqHeaders[k] = v
  103591. }
  103592. reqHeaders.Set("User-Agent", c.s.userAgent())
  103593. if c.ifNoneMatch_ != "" {
  103594. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103595. }
  103596. var body io.Reader = nil
  103597. c.urlParams_.Set("alt", alt)
  103598. c.urlParams_.Set("prettyPrint", "false")
  103599. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  103600. urls += "?" + c.urlParams_.Encode()
  103601. req, err := http.NewRequest("GET", urls, body)
  103602. if err != nil {
  103603. return nil, err
  103604. }
  103605. req.Header = reqHeaders
  103606. googleapi.Expand(req.URL, map[string]string{
  103607. "project": c.project,
  103608. "region": c.region,
  103609. "disk": c.disk,
  103610. })
  103611. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103612. }
  103613. // Do executes the "compute.regionDisks.get" call.
  103614. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  103615. // code is an error. Response headers are in either
  103616. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  103617. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  103618. // whether the returned error was because http.StatusNotModified was
  103619. // returned.
  103620. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  103621. gensupport.SetOptions(c.urlParams_, opts...)
  103622. res, err := c.doRequest("json")
  103623. if res != nil && res.StatusCode == http.StatusNotModified {
  103624. if res.Body != nil {
  103625. res.Body.Close()
  103626. }
  103627. return nil, &googleapi.Error{
  103628. Code: res.StatusCode,
  103629. Header: res.Header,
  103630. }
  103631. }
  103632. if err != nil {
  103633. return nil, err
  103634. }
  103635. defer googleapi.CloseBody(res)
  103636. if err := googleapi.CheckResponse(res); err != nil {
  103637. return nil, err
  103638. }
  103639. ret := &Disk{
  103640. ServerResponse: googleapi.ServerResponse{
  103641. Header: res.Header,
  103642. HTTPStatusCode: res.StatusCode,
  103643. },
  103644. }
  103645. target := &ret
  103646. if err := gensupport.DecodeResponse(target, res); err != nil {
  103647. return nil, err
  103648. }
  103649. return ret, nil
  103650. // {
  103651. // "description": "Returns a specified regional persistent disk.",
  103652. // "httpMethod": "GET",
  103653. // "id": "compute.regionDisks.get",
  103654. // "parameterOrder": [
  103655. // "project",
  103656. // "region",
  103657. // "disk"
  103658. // ],
  103659. // "parameters": {
  103660. // "disk": {
  103661. // "description": "Name of the regional persistent disk to return.",
  103662. // "location": "path",
  103663. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103664. // "required": true,
  103665. // "type": "string"
  103666. // },
  103667. // "project": {
  103668. // "description": "Project ID for this request.",
  103669. // "location": "path",
  103670. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103671. // "required": true,
  103672. // "type": "string"
  103673. // },
  103674. // "region": {
  103675. // "description": "Name of the region for this request.",
  103676. // "location": "path",
  103677. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103678. // "required": true,
  103679. // "type": "string"
  103680. // }
  103681. // },
  103682. // "path": "{project}/regions/{region}/disks/{disk}",
  103683. // "response": {
  103684. // "$ref": "Disk"
  103685. // },
  103686. // "scopes": [
  103687. // "https://www.googleapis.com/auth/cloud-platform",
  103688. // "https://www.googleapis.com/auth/compute",
  103689. // "https://www.googleapis.com/auth/compute.readonly"
  103690. // ]
  103691. // }
  103692. }
  103693. // method id "compute.regionDisks.getIamPolicy":
  103694. type RegionDisksGetIamPolicyCall struct {
  103695. s *Service
  103696. project string
  103697. region string
  103698. resource string
  103699. urlParams_ gensupport.URLParams
  103700. ifNoneMatch_ string
  103701. ctx_ context.Context
  103702. header_ http.Header
  103703. }
  103704. // GetIamPolicy: Gets the access control policy for a resource. May be
  103705. // empty if no such policy or resource exists.
  103706. func (r *RegionDisksService) GetIamPolicy(project string, region string, resource string) *RegionDisksGetIamPolicyCall {
  103707. c := &RegionDisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103708. c.project = project
  103709. c.region = region
  103710. c.resource = resource
  103711. return c
  103712. }
  103713. // Fields allows partial responses to be retrieved. See
  103714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103715. // for more information.
  103716. func (c *RegionDisksGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksGetIamPolicyCall {
  103717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103718. return c
  103719. }
  103720. // IfNoneMatch sets the optional parameter which makes the operation
  103721. // fail if the object's ETag matches the given value. This is useful for
  103722. // getting updates only after the object has changed since the last
  103723. // request. Use googleapi.IsNotModified to check whether the response
  103724. // error from Do is the result of In-None-Match.
  103725. func (c *RegionDisksGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionDisksGetIamPolicyCall {
  103726. c.ifNoneMatch_ = entityTag
  103727. return c
  103728. }
  103729. // Context sets the context to be used in this call's Do method. Any
  103730. // pending HTTP request will be aborted if the provided context is
  103731. // canceled.
  103732. func (c *RegionDisksGetIamPolicyCall) Context(ctx context.Context) *RegionDisksGetIamPolicyCall {
  103733. c.ctx_ = ctx
  103734. return c
  103735. }
  103736. // Header returns an http.Header that can be modified by the caller to
  103737. // add HTTP headers to the request.
  103738. func (c *RegionDisksGetIamPolicyCall) Header() http.Header {
  103739. if c.header_ == nil {
  103740. c.header_ = make(http.Header)
  103741. }
  103742. return c.header_
  103743. }
  103744. func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  103745. reqHeaders := make(http.Header)
  103746. for k, v := range c.header_ {
  103747. reqHeaders[k] = v
  103748. }
  103749. reqHeaders.Set("User-Agent", c.s.userAgent())
  103750. if c.ifNoneMatch_ != "" {
  103751. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103752. }
  103753. var body io.Reader = nil
  103754. c.urlParams_.Set("alt", alt)
  103755. c.urlParams_.Set("prettyPrint", "false")
  103756. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/getIamPolicy")
  103757. urls += "?" + c.urlParams_.Encode()
  103758. req, err := http.NewRequest("GET", urls, body)
  103759. if err != nil {
  103760. return nil, err
  103761. }
  103762. req.Header = reqHeaders
  103763. googleapi.Expand(req.URL, map[string]string{
  103764. "project": c.project,
  103765. "region": c.region,
  103766. "resource": c.resource,
  103767. })
  103768. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103769. }
  103770. // Do executes the "compute.regionDisks.getIamPolicy" call.
  103771. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  103772. // code is an error. Response headers are in either
  103773. // *Policy.ServerResponse.Header or (if a response was returned at all)
  103774. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  103775. // check whether the returned error was because http.StatusNotModified
  103776. // was returned.
  103777. func (c *RegionDisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  103778. gensupport.SetOptions(c.urlParams_, opts...)
  103779. res, err := c.doRequest("json")
  103780. if res != nil && res.StatusCode == http.StatusNotModified {
  103781. if res.Body != nil {
  103782. res.Body.Close()
  103783. }
  103784. return nil, &googleapi.Error{
  103785. Code: res.StatusCode,
  103786. Header: res.Header,
  103787. }
  103788. }
  103789. if err != nil {
  103790. return nil, err
  103791. }
  103792. defer googleapi.CloseBody(res)
  103793. if err := googleapi.CheckResponse(res); err != nil {
  103794. return nil, err
  103795. }
  103796. ret := &Policy{
  103797. ServerResponse: googleapi.ServerResponse{
  103798. Header: res.Header,
  103799. HTTPStatusCode: res.StatusCode,
  103800. },
  103801. }
  103802. target := &ret
  103803. if err := gensupport.DecodeResponse(target, res); err != nil {
  103804. return nil, err
  103805. }
  103806. return ret, nil
  103807. // {
  103808. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  103809. // "httpMethod": "GET",
  103810. // "id": "compute.regionDisks.getIamPolicy",
  103811. // "parameterOrder": [
  103812. // "project",
  103813. // "region",
  103814. // "resource"
  103815. // ],
  103816. // "parameters": {
  103817. // "project": {
  103818. // "description": "Project ID for this request.",
  103819. // "location": "path",
  103820. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103821. // "required": true,
  103822. // "type": "string"
  103823. // },
  103824. // "region": {
  103825. // "description": "The name of the region for this request.",
  103826. // "location": "path",
  103827. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103828. // "required": true,
  103829. // "type": "string"
  103830. // },
  103831. // "resource": {
  103832. // "description": "Name or id of the resource for this request.",
  103833. // "location": "path",
  103834. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103835. // "required": true,
  103836. // "type": "string"
  103837. // }
  103838. // },
  103839. // "path": "{project}/regions/{region}/disks/{resource}/getIamPolicy",
  103840. // "response": {
  103841. // "$ref": "Policy"
  103842. // },
  103843. // "scopes": [
  103844. // "https://www.googleapis.com/auth/cloud-platform",
  103845. // "https://www.googleapis.com/auth/compute",
  103846. // "https://www.googleapis.com/auth/compute.readonly"
  103847. // ]
  103848. // }
  103849. }
  103850. // method id "compute.regionDisks.insert":
  103851. type RegionDisksInsertCall struct {
  103852. s *Service
  103853. project string
  103854. region string
  103855. disk *Disk
  103856. urlParams_ gensupport.URLParams
  103857. ctx_ context.Context
  103858. header_ http.Header
  103859. }
  103860. // Insert: Creates a persistent regional disk in the specified project
  103861. // using the data included in the request.
  103862. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  103863. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103864. c.project = project
  103865. c.region = region
  103866. c.disk = disk
  103867. return c
  103868. }
  103869. // RequestId sets the optional parameter "requestId": An optional
  103870. // request ID to identify requests. Specify a unique request ID so that
  103871. // if you must retry your request, the server will know to ignore the
  103872. // request if it has already been completed.
  103873. //
  103874. // For example, consider a situation where you make an initial request
  103875. // and the request times out. If you make the request again with the
  103876. // same request ID, the server can check if original operation with the
  103877. // same request ID was received, and if so, will ignore the second
  103878. // request. This prevents clients from accidentally creating duplicate
  103879. // commitments.
  103880. //
  103881. // The request ID must be a valid UUID with the exception that zero UUID
  103882. // is not supported (00000000-0000-0000-0000-000000000000).
  103883. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  103884. c.urlParams_.Set("requestId", requestId)
  103885. return c
  103886. }
  103887. // SourceImage sets the optional parameter "sourceImage": Source image
  103888. // to restore onto a disk.
  103889. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  103890. c.urlParams_.Set("sourceImage", sourceImage)
  103891. return c
  103892. }
  103893. // Fields allows partial responses to be retrieved. See
  103894. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103895. // for more information.
  103896. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  103897. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103898. return c
  103899. }
  103900. // Context sets the context to be used in this call's Do method. Any
  103901. // pending HTTP request will be aborted if the provided context is
  103902. // canceled.
  103903. func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  103904. c.ctx_ = ctx
  103905. return c
  103906. }
  103907. // Header returns an http.Header that can be modified by the caller to
  103908. // add HTTP headers to the request.
  103909. func (c *RegionDisksInsertCall) Header() http.Header {
  103910. if c.header_ == nil {
  103911. c.header_ = make(http.Header)
  103912. }
  103913. return c.header_
  103914. }
  103915. func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
  103916. reqHeaders := make(http.Header)
  103917. for k, v := range c.header_ {
  103918. reqHeaders[k] = v
  103919. }
  103920. reqHeaders.Set("User-Agent", c.s.userAgent())
  103921. var body io.Reader = nil
  103922. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  103923. if err != nil {
  103924. return nil, err
  103925. }
  103926. reqHeaders.Set("Content-Type", "application/json")
  103927. c.urlParams_.Set("alt", alt)
  103928. c.urlParams_.Set("prettyPrint", "false")
  103929. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  103930. urls += "?" + c.urlParams_.Encode()
  103931. req, err := http.NewRequest("POST", urls, body)
  103932. if err != nil {
  103933. return nil, err
  103934. }
  103935. req.Header = reqHeaders
  103936. googleapi.Expand(req.URL, map[string]string{
  103937. "project": c.project,
  103938. "region": c.region,
  103939. })
  103940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103941. }
  103942. // Do executes the "compute.regionDisks.insert" call.
  103943. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103944. // status code is an error. Response headers are in either
  103945. // *Operation.ServerResponse.Header or (if a response was returned at
  103946. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103947. // to check whether the returned error was because
  103948. // http.StatusNotModified was returned.
  103949. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103950. gensupport.SetOptions(c.urlParams_, opts...)
  103951. res, err := c.doRequest("json")
  103952. if res != nil && res.StatusCode == http.StatusNotModified {
  103953. if res.Body != nil {
  103954. res.Body.Close()
  103955. }
  103956. return nil, &googleapi.Error{
  103957. Code: res.StatusCode,
  103958. Header: res.Header,
  103959. }
  103960. }
  103961. if err != nil {
  103962. return nil, err
  103963. }
  103964. defer googleapi.CloseBody(res)
  103965. if err := googleapi.CheckResponse(res); err != nil {
  103966. return nil, err
  103967. }
  103968. ret := &Operation{
  103969. ServerResponse: googleapi.ServerResponse{
  103970. Header: res.Header,
  103971. HTTPStatusCode: res.StatusCode,
  103972. },
  103973. }
  103974. target := &ret
  103975. if err := gensupport.DecodeResponse(target, res); err != nil {
  103976. return nil, err
  103977. }
  103978. return ret, nil
  103979. // {
  103980. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  103981. // "httpMethod": "POST",
  103982. // "id": "compute.regionDisks.insert",
  103983. // "parameterOrder": [
  103984. // "project",
  103985. // "region"
  103986. // ],
  103987. // "parameters": {
  103988. // "project": {
  103989. // "description": "Project ID for this request.",
  103990. // "location": "path",
  103991. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103992. // "required": true,
  103993. // "type": "string"
  103994. // },
  103995. // "region": {
  103996. // "description": "Name of the region for this request.",
  103997. // "location": "path",
  103998. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103999. // "required": true,
  104000. // "type": "string"
  104001. // },
  104002. // "requestId": {
  104003. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104004. // "location": "query",
  104005. // "type": "string"
  104006. // },
  104007. // "sourceImage": {
  104008. // "description": "Optional. Source image to restore onto a disk.",
  104009. // "location": "query",
  104010. // "type": "string"
  104011. // }
  104012. // },
  104013. // "path": "{project}/regions/{region}/disks",
  104014. // "request": {
  104015. // "$ref": "Disk"
  104016. // },
  104017. // "response": {
  104018. // "$ref": "Operation"
  104019. // },
  104020. // "scopes": [
  104021. // "https://www.googleapis.com/auth/cloud-platform",
  104022. // "https://www.googleapis.com/auth/compute"
  104023. // ]
  104024. // }
  104025. }
  104026. // method id "compute.regionDisks.list":
  104027. type RegionDisksListCall struct {
  104028. s *Service
  104029. project string
  104030. region string
  104031. urlParams_ gensupport.URLParams
  104032. ifNoneMatch_ string
  104033. ctx_ context.Context
  104034. header_ http.Header
  104035. }
  104036. // List: Retrieves the list of persistent disks contained within the
  104037. // specified region.
  104038. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  104039. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104040. c.project = project
  104041. c.region = region
  104042. return c
  104043. }
  104044. // Filter sets the optional parameter "filter": A filter expression that
  104045. // filters resources listed in the response. The expression must specify
  104046. // the field name, a comparison operator, and the value that you want to
  104047. // use for filtering. The value must be a string, a number, or a
  104048. // boolean. The comparison operator must be either =, !=, >, or <.
  104049. //
  104050. // For example, if you are filtering Compute Engine instances, you can
  104051. // exclude instances named example-instance by specifying name !=
  104052. // example-instance.
  104053. //
  104054. // You can also filter nested fields. For example, you could specify
  104055. // scheduling.automaticRestart = false to include instances only if they
  104056. // are not scheduled for automatic restarts. You can use filtering on
  104057. // nested fields to filter based on resource labels.
  104058. //
  104059. // To filter on multiple expressions, provide each separate expression
  104060. // within parentheses. For example, (scheduling.automaticRestart = true)
  104061. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  104062. // AND expression. However, you can include AND and OR expressions
  104063. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  104064. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  104065. // true).
  104066. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  104067. c.urlParams_.Set("filter", filter)
  104068. return c
  104069. }
  104070. // MaxResults sets the optional parameter "maxResults": The maximum
  104071. // number of results per page that should be returned. If the number of
  104072. // available results is larger than maxResults, Compute Engine returns a
  104073. // nextPageToken that can be used to get the next page of results in
  104074. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  104075. // (Default: 500)
  104076. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  104077. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  104078. return c
  104079. }
  104080. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  104081. // a certain order. By default, results are returned in alphanumerical
  104082. // order based on the resource name.
  104083. //
  104084. // You can also sort results in descending order based on the creation
  104085. // timestamp using orderBy="creationTimestamp desc". This sorts results
  104086. // based on the creationTimestamp field in reverse chronological order
  104087. // (newest result first). Use this to sort resources like operations so
  104088. // that the newest operation is returned first.
  104089. //
  104090. // Currently, only sorting by name or creationTimestamp desc is
  104091. // supported.
  104092. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  104093. c.urlParams_.Set("orderBy", orderBy)
  104094. return c
  104095. }
  104096. // PageToken sets the optional parameter "pageToken": Specifies a page
  104097. // token to use. Set pageToken to the nextPageToken returned by a
  104098. // previous list request to get the next page of results.
  104099. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  104100. c.urlParams_.Set("pageToken", pageToken)
  104101. return c
  104102. }
  104103. // Fields allows partial responses to be retrieved. See
  104104. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104105. // for more information.
  104106. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  104107. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104108. return c
  104109. }
  104110. // IfNoneMatch sets the optional parameter which makes the operation
  104111. // fail if the object's ETag matches the given value. This is useful for
  104112. // getting updates only after the object has changed since the last
  104113. // request. Use googleapi.IsNotModified to check whether the response
  104114. // error from Do is the result of In-None-Match.
  104115. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  104116. c.ifNoneMatch_ = entityTag
  104117. return c
  104118. }
  104119. // Context sets the context to be used in this call's Do method. Any
  104120. // pending HTTP request will be aborted if the provided context is
  104121. // canceled.
  104122. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  104123. c.ctx_ = ctx
  104124. return c
  104125. }
  104126. // Header returns an http.Header that can be modified by the caller to
  104127. // add HTTP headers to the request.
  104128. func (c *RegionDisksListCall) Header() http.Header {
  104129. if c.header_ == nil {
  104130. c.header_ = make(http.Header)
  104131. }
  104132. return c.header_
  104133. }
  104134. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  104135. reqHeaders := make(http.Header)
  104136. for k, v := range c.header_ {
  104137. reqHeaders[k] = v
  104138. }
  104139. reqHeaders.Set("User-Agent", c.s.userAgent())
  104140. if c.ifNoneMatch_ != "" {
  104141. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  104142. }
  104143. var body io.Reader = nil
  104144. c.urlParams_.Set("alt", alt)
  104145. c.urlParams_.Set("prettyPrint", "false")
  104146. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  104147. urls += "?" + c.urlParams_.Encode()
  104148. req, err := http.NewRequest("GET", urls, body)
  104149. if err != nil {
  104150. return nil, err
  104151. }
  104152. req.Header = reqHeaders
  104153. googleapi.Expand(req.URL, map[string]string{
  104154. "project": c.project,
  104155. "region": c.region,
  104156. })
  104157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104158. }
  104159. // Do executes the "compute.regionDisks.list" call.
  104160. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  104161. // code is an error. Response headers are in either
  104162. // *DiskList.ServerResponse.Header or (if a response was returned at
  104163. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104164. // to check whether the returned error was because
  104165. // http.StatusNotModified was returned.
  104166. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  104167. gensupport.SetOptions(c.urlParams_, opts...)
  104168. res, err := c.doRequest("json")
  104169. if res != nil && res.StatusCode == http.StatusNotModified {
  104170. if res.Body != nil {
  104171. res.Body.Close()
  104172. }
  104173. return nil, &googleapi.Error{
  104174. Code: res.StatusCode,
  104175. Header: res.Header,
  104176. }
  104177. }
  104178. if err != nil {
  104179. return nil, err
  104180. }
  104181. defer googleapi.CloseBody(res)
  104182. if err := googleapi.CheckResponse(res); err != nil {
  104183. return nil, err
  104184. }
  104185. ret := &DiskList{
  104186. ServerResponse: googleapi.ServerResponse{
  104187. Header: res.Header,
  104188. HTTPStatusCode: res.StatusCode,
  104189. },
  104190. }
  104191. target := &ret
  104192. if err := gensupport.DecodeResponse(target, res); err != nil {
  104193. return nil, err
  104194. }
  104195. return ret, nil
  104196. // {
  104197. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  104198. // "httpMethod": "GET",
  104199. // "id": "compute.regionDisks.list",
  104200. // "parameterOrder": [
  104201. // "project",
  104202. // "region"
  104203. // ],
  104204. // "parameters": {
  104205. // "filter": {
  104206. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  104207. // "location": "query",
  104208. // "type": "string"
  104209. // },
  104210. // "maxResults": {
  104211. // "default": "500",
  104212. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  104213. // "format": "uint32",
  104214. // "location": "query",
  104215. // "minimum": "0",
  104216. // "type": "integer"
  104217. // },
  104218. // "orderBy": {
  104219. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  104220. // "location": "query",
  104221. // "type": "string"
  104222. // },
  104223. // "pageToken": {
  104224. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  104225. // "location": "query",
  104226. // "type": "string"
  104227. // },
  104228. // "project": {
  104229. // "description": "Project ID for this request.",
  104230. // "location": "path",
  104231. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104232. // "required": true,
  104233. // "type": "string"
  104234. // },
  104235. // "region": {
  104236. // "description": "Name of the region for this request.",
  104237. // "location": "path",
  104238. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104239. // "required": true,
  104240. // "type": "string"
  104241. // }
  104242. // },
  104243. // "path": "{project}/regions/{region}/disks",
  104244. // "response": {
  104245. // "$ref": "DiskList"
  104246. // },
  104247. // "scopes": [
  104248. // "https://www.googleapis.com/auth/cloud-platform",
  104249. // "https://www.googleapis.com/auth/compute",
  104250. // "https://www.googleapis.com/auth/compute.readonly"
  104251. // ]
  104252. // }
  104253. }
  104254. // Pages invokes f for each page of results.
  104255. // A non-nil error returned from f will halt the iteration.
  104256. // The provided context supersedes any context provided to the Context method.
  104257. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  104258. c.ctx_ = ctx
  104259. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  104260. for {
  104261. x, err := c.Do()
  104262. if err != nil {
  104263. return err
  104264. }
  104265. if err := f(x); err != nil {
  104266. return err
  104267. }
  104268. if x.NextPageToken == "" {
  104269. return nil
  104270. }
  104271. c.PageToken(x.NextPageToken)
  104272. }
  104273. }
  104274. // method id "compute.regionDisks.removeResourcePolicies":
  104275. type RegionDisksRemoveResourcePoliciesCall struct {
  104276. s *Service
  104277. project string
  104278. region string
  104279. disk string
  104280. regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest
  104281. urlParams_ gensupport.URLParams
  104282. ctx_ context.Context
  104283. header_ http.Header
  104284. }
  104285. // RemoveResourcePolicies: Removes resource policies from a regional
  104286. // disk.
  104287. func (r *RegionDisksService) RemoveResourcePolicies(project string, region string, disk string, regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest) *RegionDisksRemoveResourcePoliciesCall {
  104288. c := &RegionDisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104289. c.project = project
  104290. c.region = region
  104291. c.disk = disk
  104292. c.regiondisksremoveresourcepoliciesrequest = regiondisksremoveresourcepoliciesrequest
  104293. return c
  104294. }
  104295. // RequestId sets the optional parameter "requestId": An optional
  104296. // request ID to identify requests. Specify a unique request ID so that
  104297. // if you must retry your request, the server will know to ignore the
  104298. // request if it has already been completed.
  104299. //
  104300. // For example, consider a situation where you make an initial request
  104301. // and the request times out. If you make the request again with the
  104302. // same request ID, the server can check if original operation with the
  104303. // same request ID was received, and if so, will ignore the second
  104304. // request. This prevents clients from accidentally creating duplicate
  104305. // commitments.
  104306. //
  104307. // The request ID must be a valid UUID with the exception that zero UUID
  104308. // is not supported (00000000-0000-0000-0000-000000000000).
  104309. func (c *RegionDisksRemoveResourcePoliciesCall) RequestId(requestId string) *RegionDisksRemoveResourcePoliciesCall {
  104310. c.urlParams_.Set("requestId", requestId)
  104311. return c
  104312. }
  104313. // Fields allows partial responses to be retrieved. See
  104314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104315. // for more information.
  104316. func (c *RegionDisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksRemoveResourcePoliciesCall {
  104317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104318. return c
  104319. }
  104320. // Context sets the context to be used in this call's Do method. Any
  104321. // pending HTTP request will be aborted if the provided context is
  104322. // canceled.
  104323. func (c *RegionDisksRemoveResourcePoliciesCall) Context(ctx context.Context) *RegionDisksRemoveResourcePoliciesCall {
  104324. c.ctx_ = ctx
  104325. return c
  104326. }
  104327. // Header returns an http.Header that can be modified by the caller to
  104328. // add HTTP headers to the request.
  104329. func (c *RegionDisksRemoveResourcePoliciesCall) Header() http.Header {
  104330. if c.header_ == nil {
  104331. c.header_ = make(http.Header)
  104332. }
  104333. return c.header_
  104334. }
  104335. func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  104336. reqHeaders := make(http.Header)
  104337. for k, v := range c.header_ {
  104338. reqHeaders[k] = v
  104339. }
  104340. reqHeaders.Set("User-Agent", c.s.userAgent())
  104341. var body io.Reader = nil
  104342. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest)
  104343. if err != nil {
  104344. return nil, err
  104345. }
  104346. reqHeaders.Set("Content-Type", "application/json")
  104347. c.urlParams_.Set("alt", alt)
  104348. c.urlParams_.Set("prettyPrint", "false")
  104349. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/removeResourcePolicies")
  104350. urls += "?" + c.urlParams_.Encode()
  104351. req, err := http.NewRequest("POST", urls, body)
  104352. if err != nil {
  104353. return nil, err
  104354. }
  104355. req.Header = reqHeaders
  104356. googleapi.Expand(req.URL, map[string]string{
  104357. "project": c.project,
  104358. "region": c.region,
  104359. "disk": c.disk,
  104360. })
  104361. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104362. }
  104363. // Do executes the "compute.regionDisks.removeResourcePolicies" call.
  104364. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104365. // status code is an error. Response headers are in either
  104366. // *Operation.ServerResponse.Header or (if a response was returned at
  104367. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104368. // to check whether the returned error was because
  104369. // http.StatusNotModified was returned.
  104370. func (c *RegionDisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104371. gensupport.SetOptions(c.urlParams_, opts...)
  104372. res, err := c.doRequest("json")
  104373. if res != nil && res.StatusCode == http.StatusNotModified {
  104374. if res.Body != nil {
  104375. res.Body.Close()
  104376. }
  104377. return nil, &googleapi.Error{
  104378. Code: res.StatusCode,
  104379. Header: res.Header,
  104380. }
  104381. }
  104382. if err != nil {
  104383. return nil, err
  104384. }
  104385. defer googleapi.CloseBody(res)
  104386. if err := googleapi.CheckResponse(res); err != nil {
  104387. return nil, err
  104388. }
  104389. ret := &Operation{
  104390. ServerResponse: googleapi.ServerResponse{
  104391. Header: res.Header,
  104392. HTTPStatusCode: res.StatusCode,
  104393. },
  104394. }
  104395. target := &ret
  104396. if err := gensupport.DecodeResponse(target, res); err != nil {
  104397. return nil, err
  104398. }
  104399. return ret, nil
  104400. // {
  104401. // "description": "Removes resource policies from a regional disk.",
  104402. // "httpMethod": "POST",
  104403. // "id": "compute.regionDisks.removeResourcePolicies",
  104404. // "parameterOrder": [
  104405. // "project",
  104406. // "region",
  104407. // "disk"
  104408. // ],
  104409. // "parameters": {
  104410. // "disk": {
  104411. // "description": "The disk name for this request.",
  104412. // "location": "path",
  104413. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104414. // "required": true,
  104415. // "type": "string"
  104416. // },
  104417. // "project": {
  104418. // "description": "Project ID for this request.",
  104419. // "location": "path",
  104420. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104421. // "required": true,
  104422. // "type": "string"
  104423. // },
  104424. // "region": {
  104425. // "description": "The name of the region for this request.",
  104426. // "location": "path",
  104427. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104428. // "required": true,
  104429. // "type": "string"
  104430. // },
  104431. // "requestId": {
  104432. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104433. // "location": "query",
  104434. // "type": "string"
  104435. // }
  104436. // },
  104437. // "path": "{project}/regions/{region}/disks/{disk}/removeResourcePolicies",
  104438. // "request": {
  104439. // "$ref": "RegionDisksRemoveResourcePoliciesRequest"
  104440. // },
  104441. // "response": {
  104442. // "$ref": "Operation"
  104443. // },
  104444. // "scopes": [
  104445. // "https://www.googleapis.com/auth/cloud-platform",
  104446. // "https://www.googleapis.com/auth/compute"
  104447. // ]
  104448. // }
  104449. }
  104450. // method id "compute.regionDisks.resize":
  104451. type RegionDisksResizeCall struct {
  104452. s *Service
  104453. project string
  104454. region string
  104455. disk string
  104456. regiondisksresizerequest *RegionDisksResizeRequest
  104457. urlParams_ gensupport.URLParams
  104458. ctx_ context.Context
  104459. header_ http.Header
  104460. }
  104461. // Resize: Resizes the specified regional persistent disk.
  104462. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  104463. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104464. c.project = project
  104465. c.region = region
  104466. c.disk = disk
  104467. c.regiondisksresizerequest = regiondisksresizerequest
  104468. return c
  104469. }
  104470. // RequestId sets the optional parameter "requestId": An optional
  104471. // request ID to identify requests. Specify a unique request ID so that
  104472. // if you must retry your request, the server will know to ignore the
  104473. // request if it has already been completed.
  104474. //
  104475. // For example, consider a situation where you make an initial request
  104476. // and the request times out. If you make the request again with the
  104477. // same request ID, the server can check if original operation with the
  104478. // same request ID was received, and if so, will ignore the second
  104479. // request. This prevents clients from accidentally creating duplicate
  104480. // commitments.
  104481. //
  104482. // The request ID must be a valid UUID with the exception that zero UUID
  104483. // is not supported (00000000-0000-0000-0000-000000000000).
  104484. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  104485. c.urlParams_.Set("requestId", requestId)
  104486. return c
  104487. }
  104488. // Fields allows partial responses to be retrieved. See
  104489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104490. // for more information.
  104491. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  104492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104493. return c
  104494. }
  104495. // Context sets the context to be used in this call's Do method. Any
  104496. // pending HTTP request will be aborted if the provided context is
  104497. // canceled.
  104498. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  104499. c.ctx_ = ctx
  104500. return c
  104501. }
  104502. // Header returns an http.Header that can be modified by the caller to
  104503. // add HTTP headers to the request.
  104504. func (c *RegionDisksResizeCall) Header() http.Header {
  104505. if c.header_ == nil {
  104506. c.header_ = make(http.Header)
  104507. }
  104508. return c.header_
  104509. }
  104510. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  104511. reqHeaders := make(http.Header)
  104512. for k, v := range c.header_ {
  104513. reqHeaders[k] = v
  104514. }
  104515. reqHeaders.Set("User-Agent", c.s.userAgent())
  104516. var body io.Reader = nil
  104517. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  104518. if err != nil {
  104519. return nil, err
  104520. }
  104521. reqHeaders.Set("Content-Type", "application/json")
  104522. c.urlParams_.Set("alt", alt)
  104523. c.urlParams_.Set("prettyPrint", "false")
  104524. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  104525. urls += "?" + c.urlParams_.Encode()
  104526. req, err := http.NewRequest("POST", urls, body)
  104527. if err != nil {
  104528. return nil, err
  104529. }
  104530. req.Header = reqHeaders
  104531. googleapi.Expand(req.URL, map[string]string{
  104532. "project": c.project,
  104533. "region": c.region,
  104534. "disk": c.disk,
  104535. })
  104536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104537. }
  104538. // Do executes the "compute.regionDisks.resize" call.
  104539. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104540. // status code is an error. Response headers are in either
  104541. // *Operation.ServerResponse.Header or (if a response was returned at
  104542. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104543. // to check whether the returned error was because
  104544. // http.StatusNotModified was returned.
  104545. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104546. gensupport.SetOptions(c.urlParams_, opts...)
  104547. res, err := c.doRequest("json")
  104548. if res != nil && res.StatusCode == http.StatusNotModified {
  104549. if res.Body != nil {
  104550. res.Body.Close()
  104551. }
  104552. return nil, &googleapi.Error{
  104553. Code: res.StatusCode,
  104554. Header: res.Header,
  104555. }
  104556. }
  104557. if err != nil {
  104558. return nil, err
  104559. }
  104560. defer googleapi.CloseBody(res)
  104561. if err := googleapi.CheckResponse(res); err != nil {
  104562. return nil, err
  104563. }
  104564. ret := &Operation{
  104565. ServerResponse: googleapi.ServerResponse{
  104566. Header: res.Header,
  104567. HTTPStatusCode: res.StatusCode,
  104568. },
  104569. }
  104570. target := &ret
  104571. if err := gensupport.DecodeResponse(target, res); err != nil {
  104572. return nil, err
  104573. }
  104574. return ret, nil
  104575. // {
  104576. // "description": "Resizes the specified regional persistent disk.",
  104577. // "httpMethod": "POST",
  104578. // "id": "compute.regionDisks.resize",
  104579. // "parameterOrder": [
  104580. // "project",
  104581. // "region",
  104582. // "disk"
  104583. // ],
  104584. // "parameters": {
  104585. // "disk": {
  104586. // "description": "Name of the regional persistent disk.",
  104587. // "location": "path",
  104588. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104589. // "required": true,
  104590. // "type": "string"
  104591. // },
  104592. // "project": {
  104593. // "description": "The project ID for this request.",
  104594. // "location": "path",
  104595. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104596. // "required": true,
  104597. // "type": "string"
  104598. // },
  104599. // "region": {
  104600. // "description": "Name of the region for this request.",
  104601. // "location": "path",
  104602. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104603. // "required": true,
  104604. // "type": "string"
  104605. // },
  104606. // "requestId": {
  104607. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104608. // "location": "query",
  104609. // "type": "string"
  104610. // }
  104611. // },
  104612. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  104613. // "request": {
  104614. // "$ref": "RegionDisksResizeRequest"
  104615. // },
  104616. // "response": {
  104617. // "$ref": "Operation"
  104618. // },
  104619. // "scopes": [
  104620. // "https://www.googleapis.com/auth/cloud-platform",
  104621. // "https://www.googleapis.com/auth/compute"
  104622. // ]
  104623. // }
  104624. }
  104625. // method id "compute.regionDisks.setIamPolicy":
  104626. type RegionDisksSetIamPolicyCall struct {
  104627. s *Service
  104628. project string
  104629. region string
  104630. resource string
  104631. regionsetpolicyrequest *RegionSetPolicyRequest
  104632. urlParams_ gensupport.URLParams
  104633. ctx_ context.Context
  104634. header_ http.Header
  104635. }
  104636. // SetIamPolicy: Sets the access control policy on the specified
  104637. // resource. Replaces any existing policy.
  104638. func (r *RegionDisksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *RegionDisksSetIamPolicyCall {
  104639. c := &RegionDisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104640. c.project = project
  104641. c.region = region
  104642. c.resource = resource
  104643. c.regionsetpolicyrequest = regionsetpolicyrequest
  104644. return c
  104645. }
  104646. // Fields allows partial responses to be retrieved. See
  104647. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104648. // for more information.
  104649. func (c *RegionDisksSetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksSetIamPolicyCall {
  104650. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104651. return c
  104652. }
  104653. // Context sets the context to be used in this call's Do method. Any
  104654. // pending HTTP request will be aborted if the provided context is
  104655. // canceled.
  104656. func (c *RegionDisksSetIamPolicyCall) Context(ctx context.Context) *RegionDisksSetIamPolicyCall {
  104657. c.ctx_ = ctx
  104658. return c
  104659. }
  104660. // Header returns an http.Header that can be modified by the caller to
  104661. // add HTTP headers to the request.
  104662. func (c *RegionDisksSetIamPolicyCall) Header() http.Header {
  104663. if c.header_ == nil {
  104664. c.header_ = make(http.Header)
  104665. }
  104666. return c.header_
  104667. }
  104668. func (c *RegionDisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  104669. reqHeaders := make(http.Header)
  104670. for k, v := range c.header_ {
  104671. reqHeaders[k] = v
  104672. }
  104673. reqHeaders.Set("User-Agent", c.s.userAgent())
  104674. var body io.Reader = nil
  104675. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  104676. if err != nil {
  104677. return nil, err
  104678. }
  104679. reqHeaders.Set("Content-Type", "application/json")
  104680. c.urlParams_.Set("alt", alt)
  104681. c.urlParams_.Set("prettyPrint", "false")
  104682. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setIamPolicy")
  104683. urls += "?" + c.urlParams_.Encode()
  104684. req, err := http.NewRequest("POST", urls, body)
  104685. if err != nil {
  104686. return nil, err
  104687. }
  104688. req.Header = reqHeaders
  104689. googleapi.Expand(req.URL, map[string]string{
  104690. "project": c.project,
  104691. "region": c.region,
  104692. "resource": c.resource,
  104693. })
  104694. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104695. }
  104696. // Do executes the "compute.regionDisks.setIamPolicy" call.
  104697. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  104698. // code is an error. Response headers are in either
  104699. // *Policy.ServerResponse.Header or (if a response was returned at all)
  104700. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  104701. // check whether the returned error was because http.StatusNotModified
  104702. // was returned.
  104703. func (c *RegionDisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  104704. gensupport.SetOptions(c.urlParams_, opts...)
  104705. res, err := c.doRequest("json")
  104706. if res != nil && res.StatusCode == http.StatusNotModified {
  104707. if res.Body != nil {
  104708. res.Body.Close()
  104709. }
  104710. return nil, &googleapi.Error{
  104711. Code: res.StatusCode,
  104712. Header: res.Header,
  104713. }
  104714. }
  104715. if err != nil {
  104716. return nil, err
  104717. }
  104718. defer googleapi.CloseBody(res)
  104719. if err := googleapi.CheckResponse(res); err != nil {
  104720. return nil, err
  104721. }
  104722. ret := &Policy{
  104723. ServerResponse: googleapi.ServerResponse{
  104724. Header: res.Header,
  104725. HTTPStatusCode: res.StatusCode,
  104726. },
  104727. }
  104728. target := &ret
  104729. if err := gensupport.DecodeResponse(target, res); err != nil {
  104730. return nil, err
  104731. }
  104732. return ret, nil
  104733. // {
  104734. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  104735. // "httpMethod": "POST",
  104736. // "id": "compute.regionDisks.setIamPolicy",
  104737. // "parameterOrder": [
  104738. // "project",
  104739. // "region",
  104740. // "resource"
  104741. // ],
  104742. // "parameters": {
  104743. // "project": {
  104744. // "description": "Project ID for this request.",
  104745. // "location": "path",
  104746. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104747. // "required": true,
  104748. // "type": "string"
  104749. // },
  104750. // "region": {
  104751. // "description": "The name of the region for this request.",
  104752. // "location": "path",
  104753. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104754. // "required": true,
  104755. // "type": "string"
  104756. // },
  104757. // "resource": {
  104758. // "description": "Name or id of the resource for this request.",
  104759. // "location": "path",
  104760. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104761. // "required": true,
  104762. // "type": "string"
  104763. // }
  104764. // },
  104765. // "path": "{project}/regions/{region}/disks/{resource}/setIamPolicy",
  104766. // "request": {
  104767. // "$ref": "RegionSetPolicyRequest"
  104768. // },
  104769. // "response": {
  104770. // "$ref": "Policy"
  104771. // },
  104772. // "scopes": [
  104773. // "https://www.googleapis.com/auth/cloud-platform",
  104774. // "https://www.googleapis.com/auth/compute"
  104775. // ]
  104776. // }
  104777. }
  104778. // method id "compute.regionDisks.setLabels":
  104779. type RegionDisksSetLabelsCall struct {
  104780. s *Service
  104781. project string
  104782. region string
  104783. resource string
  104784. regionsetlabelsrequest *RegionSetLabelsRequest
  104785. urlParams_ gensupport.URLParams
  104786. ctx_ context.Context
  104787. header_ http.Header
  104788. }
  104789. // SetLabels: Sets the labels on the target regional disk.
  104790. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  104791. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104792. c.project = project
  104793. c.region = region
  104794. c.resource = resource
  104795. c.regionsetlabelsrequest = regionsetlabelsrequest
  104796. return c
  104797. }
  104798. // RequestId sets the optional parameter "requestId": An optional
  104799. // request ID to identify requests. Specify a unique request ID so that
  104800. // if you must retry your request, the server will know to ignore the
  104801. // request if it has already been completed.
  104802. //
  104803. // For example, consider a situation where you make an initial request
  104804. // and the request times out. If you make the request again with the
  104805. // same request ID, the server can check if original operation with the
  104806. // same request ID was received, and if so, will ignore the second
  104807. // request. This prevents clients from accidentally creating duplicate
  104808. // commitments.
  104809. //
  104810. // The request ID must be a valid UUID with the exception that zero UUID
  104811. // is not supported (00000000-0000-0000-0000-000000000000).
  104812. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  104813. c.urlParams_.Set("requestId", requestId)
  104814. return c
  104815. }
  104816. // Fields allows partial responses to be retrieved. See
  104817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104818. // for more information.
  104819. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  104820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104821. return c
  104822. }
  104823. // Context sets the context to be used in this call's Do method. Any
  104824. // pending HTTP request will be aborted if the provided context is
  104825. // canceled.
  104826. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  104827. c.ctx_ = ctx
  104828. return c
  104829. }
  104830. // Header returns an http.Header that can be modified by the caller to
  104831. // add HTTP headers to the request.
  104832. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  104833. if c.header_ == nil {
  104834. c.header_ = make(http.Header)
  104835. }
  104836. return c.header_
  104837. }
  104838. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  104839. reqHeaders := make(http.Header)
  104840. for k, v := range c.header_ {
  104841. reqHeaders[k] = v
  104842. }
  104843. reqHeaders.Set("User-Agent", c.s.userAgent())
  104844. var body io.Reader = nil
  104845. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  104846. if err != nil {
  104847. return nil, err
  104848. }
  104849. reqHeaders.Set("Content-Type", "application/json")
  104850. c.urlParams_.Set("alt", alt)
  104851. c.urlParams_.Set("prettyPrint", "false")
  104852. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  104853. urls += "?" + c.urlParams_.Encode()
  104854. req, err := http.NewRequest("POST", urls, body)
  104855. if err != nil {
  104856. return nil, err
  104857. }
  104858. req.Header = reqHeaders
  104859. googleapi.Expand(req.URL, map[string]string{
  104860. "project": c.project,
  104861. "region": c.region,
  104862. "resource": c.resource,
  104863. })
  104864. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104865. }
  104866. // Do executes the "compute.regionDisks.setLabels" call.
  104867. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104868. // status code is an error. Response headers are in either
  104869. // *Operation.ServerResponse.Header or (if a response was returned at
  104870. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104871. // to check whether the returned error was because
  104872. // http.StatusNotModified was returned.
  104873. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104874. gensupport.SetOptions(c.urlParams_, opts...)
  104875. res, err := c.doRequest("json")
  104876. if res != nil && res.StatusCode == http.StatusNotModified {
  104877. if res.Body != nil {
  104878. res.Body.Close()
  104879. }
  104880. return nil, &googleapi.Error{
  104881. Code: res.StatusCode,
  104882. Header: res.Header,
  104883. }
  104884. }
  104885. if err != nil {
  104886. return nil, err
  104887. }
  104888. defer googleapi.CloseBody(res)
  104889. if err := googleapi.CheckResponse(res); err != nil {
  104890. return nil, err
  104891. }
  104892. ret := &Operation{
  104893. ServerResponse: googleapi.ServerResponse{
  104894. Header: res.Header,
  104895. HTTPStatusCode: res.StatusCode,
  104896. },
  104897. }
  104898. target := &ret
  104899. if err := gensupport.DecodeResponse(target, res); err != nil {
  104900. return nil, err
  104901. }
  104902. return ret, nil
  104903. // {
  104904. // "description": "Sets the labels on the target regional disk.",
  104905. // "httpMethod": "POST",
  104906. // "id": "compute.regionDisks.setLabels",
  104907. // "parameterOrder": [
  104908. // "project",
  104909. // "region",
  104910. // "resource"
  104911. // ],
  104912. // "parameters": {
  104913. // "project": {
  104914. // "description": "Project ID for this request.",
  104915. // "location": "path",
  104916. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104917. // "required": true,
  104918. // "type": "string"
  104919. // },
  104920. // "region": {
  104921. // "description": "The region for this request.",
  104922. // "location": "path",
  104923. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104924. // "required": true,
  104925. // "type": "string"
  104926. // },
  104927. // "requestId": {
  104928. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104929. // "location": "query",
  104930. // "type": "string"
  104931. // },
  104932. // "resource": {
  104933. // "description": "Name or id of the resource for this request.",
  104934. // "location": "path",
  104935. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104936. // "required": true,
  104937. // "type": "string"
  104938. // }
  104939. // },
  104940. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  104941. // "request": {
  104942. // "$ref": "RegionSetLabelsRequest"
  104943. // },
  104944. // "response": {
  104945. // "$ref": "Operation"
  104946. // },
  104947. // "scopes": [
  104948. // "https://www.googleapis.com/auth/cloud-platform",
  104949. // "https://www.googleapis.com/auth/compute"
  104950. // ]
  104951. // }
  104952. }
  104953. // method id "compute.regionDisks.testIamPermissions":
  104954. type RegionDisksTestIamPermissionsCall struct {
  104955. s *Service
  104956. project string
  104957. region string
  104958. resource string
  104959. testpermissionsrequest *TestPermissionsRequest
  104960. urlParams_ gensupport.URLParams
  104961. ctx_ context.Context
  104962. header_ http.Header
  104963. }
  104964. // TestIamPermissions: Returns permissions that a caller has on the
  104965. // specified resource.
  104966. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  104967. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104968. c.project = project
  104969. c.region = region
  104970. c.resource = resource
  104971. c.testpermissionsrequest = testpermissionsrequest
  104972. return c
  104973. }
  104974. // Fields allows partial responses to be retrieved. See
  104975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104976. // for more information.
  104977. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  104978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104979. return c
  104980. }
  104981. // Context sets the context to be used in this call's Do method. Any
  104982. // pending HTTP request will be aborted if the provided context is
  104983. // canceled.
  104984. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  104985. c.ctx_ = ctx
  104986. return c
  104987. }
  104988. // Header returns an http.Header that can be modified by the caller to
  104989. // add HTTP headers to the request.
  104990. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  104991. if c.header_ == nil {
  104992. c.header_ = make(http.Header)
  104993. }
  104994. return c.header_
  104995. }
  104996. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  104997. reqHeaders := make(http.Header)
  104998. for k, v := range c.header_ {
  104999. reqHeaders[k] = v
  105000. }
  105001. reqHeaders.Set("User-Agent", c.s.userAgent())
  105002. var body io.Reader = nil
  105003. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  105004. if err != nil {
  105005. return nil, err
  105006. }
  105007. reqHeaders.Set("Content-Type", "application/json")
  105008. c.urlParams_.Set("alt", alt)
  105009. c.urlParams_.Set("prettyPrint", "false")
  105010. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  105011. urls += "?" + c.urlParams_.Encode()
  105012. req, err := http.NewRequest("POST", urls, body)
  105013. if err != nil {
  105014. return nil, err
  105015. }
  105016. req.Header = reqHeaders
  105017. googleapi.Expand(req.URL, map[string]string{
  105018. "project": c.project,
  105019. "region": c.region,
  105020. "resource": c.resource,
  105021. })
  105022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105023. }
  105024. // Do executes the "compute.regionDisks.testIamPermissions" call.
  105025. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  105026. // non-2xx status code is an error. Response headers are in either
  105027. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  105028. // returned at all) in error.(*googleapi.Error).Header. Use
  105029. // googleapi.IsNotModified to check whether the returned error was
  105030. // because http.StatusNotModified was returned.
  105031. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  105032. gensupport.SetOptions(c.urlParams_, opts...)
  105033. res, err := c.doRequest("json")
  105034. if res != nil && res.StatusCode == http.StatusNotModified {
  105035. if res.Body != nil {
  105036. res.Body.Close()
  105037. }
  105038. return nil, &googleapi.Error{
  105039. Code: res.StatusCode,
  105040. Header: res.Header,
  105041. }
  105042. }
  105043. if err != nil {
  105044. return nil, err
  105045. }
  105046. defer googleapi.CloseBody(res)
  105047. if err := googleapi.CheckResponse(res); err != nil {
  105048. return nil, err
  105049. }
  105050. ret := &TestPermissionsResponse{
  105051. ServerResponse: googleapi.ServerResponse{
  105052. Header: res.Header,
  105053. HTTPStatusCode: res.StatusCode,
  105054. },
  105055. }
  105056. target := &ret
  105057. if err := gensupport.DecodeResponse(target, res); err != nil {
  105058. return nil, err
  105059. }
  105060. return ret, nil
  105061. // {
  105062. // "description": "Returns permissions that a caller has on the specified resource.",
  105063. // "httpMethod": "POST",
  105064. // "id": "compute.regionDisks.testIamPermissions",
  105065. // "parameterOrder": [
  105066. // "project",
  105067. // "region",
  105068. // "resource"
  105069. // ],
  105070. // "parameters": {
  105071. // "project": {
  105072. // "description": "Project ID for this request.",
  105073. // "location": "path",
  105074. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105075. // "required": true,
  105076. // "type": "string"
  105077. // },
  105078. // "region": {
  105079. // "description": "The name of the region for this request.",
  105080. // "location": "path",
  105081. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105082. // "required": true,
  105083. // "type": "string"
  105084. // },
  105085. // "resource": {
  105086. // "description": "Name or id of the resource for this request.",
  105087. // "location": "path",
  105088. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  105089. // "required": true,
  105090. // "type": "string"
  105091. // }
  105092. // },
  105093. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  105094. // "request": {
  105095. // "$ref": "TestPermissionsRequest"
  105096. // },
  105097. // "response": {
  105098. // "$ref": "TestPermissionsResponse"
  105099. // },
  105100. // "scopes": [
  105101. // "https://www.googleapis.com/auth/cloud-platform",
  105102. // "https://www.googleapis.com/auth/compute",
  105103. // "https://www.googleapis.com/auth/compute.readonly"
  105104. // ]
  105105. // }
  105106. }
  105107. // method id "compute.regionHealthCheckServices.delete":
  105108. type RegionHealthCheckServicesDeleteCall struct {
  105109. s *Service
  105110. project string
  105111. region string
  105112. healthCheckService string
  105113. urlParams_ gensupport.URLParams
  105114. ctx_ context.Context
  105115. header_ http.Header
  105116. }
  105117. // Delete: Deletes the specified regional HealthCheckService.
  105118. func (r *RegionHealthCheckServicesService) Delete(project string, region string, healthCheckService string) *RegionHealthCheckServicesDeleteCall {
  105119. c := &RegionHealthCheckServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105120. c.project = project
  105121. c.region = region
  105122. c.healthCheckService = healthCheckService
  105123. return c
  105124. }
  105125. // RequestId sets the optional parameter "requestId": An optional
  105126. // request ID to identify requests. Specify a unique request ID so that
  105127. // if you must retry your request, the server will know to ignore the
  105128. // request if it has already been completed.
  105129. //
  105130. // For example, consider a situation where you make an initial request
  105131. // and the request times out. If you make the request again with the
  105132. // same request ID, the server can check if original operation with the
  105133. // same request ID was received, and if so, will ignore the second
  105134. // request. This prevents clients from accidentally creating duplicate
  105135. // commitments.
  105136. //
  105137. // The request ID must be a valid UUID with the exception that zero UUID
  105138. // is not supported (00000000-0000-0000-0000-000000000000).
  105139. func (c *RegionHealthCheckServicesDeleteCall) RequestId(requestId string) *RegionHealthCheckServicesDeleteCall {
  105140. c.urlParams_.Set("requestId", requestId)
  105141. return c
  105142. }
  105143. // Fields allows partial responses to be retrieved. See
  105144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105145. // for more information.
  105146. func (c *RegionHealthCheckServicesDeleteCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesDeleteCall {
  105147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105148. return c
  105149. }
  105150. // Context sets the context to be used in this call's Do method. Any
  105151. // pending HTTP request will be aborted if the provided context is
  105152. // canceled.
  105153. func (c *RegionHealthCheckServicesDeleteCall) Context(ctx context.Context) *RegionHealthCheckServicesDeleteCall {
  105154. c.ctx_ = ctx
  105155. return c
  105156. }
  105157. // Header returns an http.Header that can be modified by the caller to
  105158. // add HTTP headers to the request.
  105159. func (c *RegionHealthCheckServicesDeleteCall) Header() http.Header {
  105160. if c.header_ == nil {
  105161. c.header_ = make(http.Header)
  105162. }
  105163. return c.header_
  105164. }
  105165. func (c *RegionHealthCheckServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  105166. reqHeaders := make(http.Header)
  105167. for k, v := range c.header_ {
  105168. reqHeaders[k] = v
  105169. }
  105170. reqHeaders.Set("User-Agent", c.s.userAgent())
  105171. var body io.Reader = nil
  105172. c.urlParams_.Set("alt", alt)
  105173. c.urlParams_.Set("prettyPrint", "false")
  105174. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthCheckServices/{healthCheckService}")
  105175. urls += "?" + c.urlParams_.Encode()
  105176. req, err := http.NewRequest("DELETE", urls, body)
  105177. if err != nil {
  105178. return nil, err
  105179. }
  105180. req.Header = reqHeaders
  105181. googleapi.Expand(req.URL, map[string]string{
  105182. "project": c.project,
  105183. "region": c.region,
  105184. "healthCheckService": c.healthCheckService,
  105185. })
  105186. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105187. }
  105188. // Do executes the "compute.regionHealthCheckServices.delete" call.
  105189. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105190. // status code is an error. Response headers are in either
  105191. // *Operation.ServerResponse.Header or (if a response was returned at
  105192. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105193. // to check whether the returned error was because
  105194. // http.StatusNotModified was returned.
  105195. func (c *RegionHealthCheckServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105196. gensupport.SetOptions(c.urlParams_, opts...)
  105197. res, err := c.doRequest("json")
  105198. if res != nil && res.StatusCode == http.StatusNotModified {
  105199. if res.Body != nil {
  105200. res.Body.Close()
  105201. }
  105202. return nil, &googleapi.Error{
  105203. Code: res.StatusCode,
  105204. Header: res.Header,
  105205. }
  105206. }
  105207. if err != nil {
  105208. return nil, err
  105209. }
  105210. defer googleapi.CloseBody(res)
  105211. if err := googleapi.CheckResponse(res); err != nil {
  105212. return nil, err
  105213. }
  105214. ret := &Operation{
  105215. ServerResponse: googleapi.ServerResponse{
  105216. Header: res.Header,
  105217. HTTPStatusCode: res.StatusCode,
  105218. },
  105219. }
  105220. target := &ret
  105221. if err := gensupport.DecodeResponse(target, res); err != nil {
  105222. return nil, err
  105223. }
  105224. return ret, nil
  105225. // {
  105226. // "description": "Deletes the specified regional HealthCheckService.",
  105227. // "httpMethod": "DELETE",
  105228. // "id": "compute.regionHealthCheckServices.delete",
  105229. // "parameterOrder": [
  105230. // "project",
  105231. // "region",
  105232. // "healthCheckService"
  105233. // ],
  105234. // "parameters": {
  105235. // "healthCheckService": {
  105236. // "description": "Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  105237. // "location": "path",
  105238. // "required": true,
  105239. // "type": "string"
  105240. // },
  105241. // "project": {
  105242. // "description": "Project ID for this request.",
  105243. // "location": "path",
  105244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105245. // "required": true,
  105246. // "type": "string"
  105247. // },
  105248. // "region": {
  105249. // "description": "Name of the region scoping this request.",
  105250. // "location": "path",
  105251. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105252. // "required": true,
  105253. // "type": "string"
  105254. // },
  105255. // "requestId": {
  105256. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105257. // "location": "query",
  105258. // "type": "string"
  105259. // }
  105260. // },
  105261. // "path": "{project}/regions/{region}/healthCheckServices/{healthCheckService}",
  105262. // "response": {
  105263. // "$ref": "Operation"
  105264. // },
  105265. // "scopes": [
  105266. // "https://www.googleapis.com/auth/cloud-platform",
  105267. // "https://www.googleapis.com/auth/compute"
  105268. // ]
  105269. // }
  105270. }
  105271. // method id "compute.regionHealthCheckServices.get":
  105272. type RegionHealthCheckServicesGetCall struct {
  105273. s *Service
  105274. project string
  105275. region string
  105276. healthCheckService string
  105277. urlParams_ gensupport.URLParams
  105278. ifNoneMatch_ string
  105279. ctx_ context.Context
  105280. header_ http.Header
  105281. }
  105282. // Get: Returns the specified regional HealthCheckService resource.
  105283. func (r *RegionHealthCheckServicesService) Get(project string, region string, healthCheckService string) *RegionHealthCheckServicesGetCall {
  105284. c := &RegionHealthCheckServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105285. c.project = project
  105286. c.region = region
  105287. c.healthCheckService = healthCheckService
  105288. return c
  105289. }
  105290. // Fields allows partial responses to be retrieved. See
  105291. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105292. // for more information.
  105293. func (c *RegionHealthCheckServicesGetCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesGetCall {
  105294. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105295. return c
  105296. }
  105297. // IfNoneMatch sets the optional parameter which makes the operation
  105298. // fail if the object's ETag matches the given value. This is useful for
  105299. // getting updates only after the object has changed since the last
  105300. // request. Use googleapi.IsNotModified to check whether the response
  105301. // error from Do is the result of In-None-Match.
  105302. func (c *RegionHealthCheckServicesGetCall) IfNoneMatch(entityTag string) *RegionHealthCheckServicesGetCall {
  105303. c.ifNoneMatch_ = entityTag
  105304. return c
  105305. }
  105306. // Context sets the context to be used in this call's Do method. Any
  105307. // pending HTTP request will be aborted if the provided context is
  105308. // canceled.
  105309. func (c *RegionHealthCheckServicesGetCall) Context(ctx context.Context) *RegionHealthCheckServicesGetCall {
  105310. c.ctx_ = ctx
  105311. return c
  105312. }
  105313. // Header returns an http.Header that can be modified by the caller to
  105314. // add HTTP headers to the request.
  105315. func (c *RegionHealthCheckServicesGetCall) Header() http.Header {
  105316. if c.header_ == nil {
  105317. c.header_ = make(http.Header)
  105318. }
  105319. return c.header_
  105320. }
  105321. func (c *RegionHealthCheckServicesGetCall) doRequest(alt string) (*http.Response, error) {
  105322. reqHeaders := make(http.Header)
  105323. for k, v := range c.header_ {
  105324. reqHeaders[k] = v
  105325. }
  105326. reqHeaders.Set("User-Agent", c.s.userAgent())
  105327. if c.ifNoneMatch_ != "" {
  105328. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105329. }
  105330. var body io.Reader = nil
  105331. c.urlParams_.Set("alt", alt)
  105332. c.urlParams_.Set("prettyPrint", "false")
  105333. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthCheckServices/{healthCheckService}")
  105334. urls += "?" + c.urlParams_.Encode()
  105335. req, err := http.NewRequest("GET", urls, body)
  105336. if err != nil {
  105337. return nil, err
  105338. }
  105339. req.Header = reqHeaders
  105340. googleapi.Expand(req.URL, map[string]string{
  105341. "project": c.project,
  105342. "region": c.region,
  105343. "healthCheckService": c.healthCheckService,
  105344. })
  105345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105346. }
  105347. // Do executes the "compute.regionHealthCheckServices.get" call.
  105348. // Exactly one of *HealthCheckService or error will be non-nil. Any
  105349. // non-2xx status code is an error. Response headers are in either
  105350. // *HealthCheckService.ServerResponse.Header or (if a response was
  105351. // returned at all) in error.(*googleapi.Error).Header. Use
  105352. // googleapi.IsNotModified to check whether the returned error was
  105353. // because http.StatusNotModified was returned.
  105354. func (c *RegionHealthCheckServicesGetCall) Do(opts ...googleapi.CallOption) (*HealthCheckService, error) {
  105355. gensupport.SetOptions(c.urlParams_, opts...)
  105356. res, err := c.doRequest("json")
  105357. if res != nil && res.StatusCode == http.StatusNotModified {
  105358. if res.Body != nil {
  105359. res.Body.Close()
  105360. }
  105361. return nil, &googleapi.Error{
  105362. Code: res.StatusCode,
  105363. Header: res.Header,
  105364. }
  105365. }
  105366. if err != nil {
  105367. return nil, err
  105368. }
  105369. defer googleapi.CloseBody(res)
  105370. if err := googleapi.CheckResponse(res); err != nil {
  105371. return nil, err
  105372. }
  105373. ret := &HealthCheckService{
  105374. ServerResponse: googleapi.ServerResponse{
  105375. Header: res.Header,
  105376. HTTPStatusCode: res.StatusCode,
  105377. },
  105378. }
  105379. target := &ret
  105380. if err := gensupport.DecodeResponse(target, res); err != nil {
  105381. return nil, err
  105382. }
  105383. return ret, nil
  105384. // {
  105385. // "description": "Returns the specified regional HealthCheckService resource.",
  105386. // "httpMethod": "GET",
  105387. // "id": "compute.regionHealthCheckServices.get",
  105388. // "parameterOrder": [
  105389. // "project",
  105390. // "region",
  105391. // "healthCheckService"
  105392. // ],
  105393. // "parameters": {
  105394. // "healthCheckService": {
  105395. // "description": "Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035.",
  105396. // "location": "path",
  105397. // "required": true,
  105398. // "type": "string"
  105399. // },
  105400. // "project": {
  105401. // "description": "Project ID for this request.",
  105402. // "location": "path",
  105403. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105404. // "required": true,
  105405. // "type": "string"
  105406. // },
  105407. // "region": {
  105408. // "description": "Name of the region scoping this request.",
  105409. // "location": "path",
  105410. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105411. // "required": true,
  105412. // "type": "string"
  105413. // }
  105414. // },
  105415. // "path": "{project}/regions/{region}/healthCheckServices/{healthCheckService}",
  105416. // "response": {
  105417. // "$ref": "HealthCheckService"
  105418. // },
  105419. // "scopes": [
  105420. // "https://www.googleapis.com/auth/cloud-platform",
  105421. // "https://www.googleapis.com/auth/compute",
  105422. // "https://www.googleapis.com/auth/compute.readonly"
  105423. // ]
  105424. // }
  105425. }
  105426. // method id "compute.regionHealthCheckServices.insert":
  105427. type RegionHealthCheckServicesInsertCall struct {
  105428. s *Service
  105429. project string
  105430. region string
  105431. healthcheckservice *HealthCheckService
  105432. urlParams_ gensupport.URLParams
  105433. ctx_ context.Context
  105434. header_ http.Header
  105435. }
  105436. // Insert: Creates a regional HealthCheckService resource in the
  105437. // specified project and region using the data included in the request.
  105438. func (r *RegionHealthCheckServicesService) Insert(project string, region string, healthcheckservice *HealthCheckService) *RegionHealthCheckServicesInsertCall {
  105439. c := &RegionHealthCheckServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105440. c.project = project
  105441. c.region = region
  105442. c.healthcheckservice = healthcheckservice
  105443. return c
  105444. }
  105445. // RequestId sets the optional parameter "requestId": An optional
  105446. // request ID to identify requests. Specify a unique request ID so that
  105447. // if you must retry your request, the server will know to ignore the
  105448. // request if it has already been completed.
  105449. //
  105450. // For example, consider a situation where you make an initial request
  105451. // and the request times out. If you make the request again with the
  105452. // same request ID, the server can check if original operation with the
  105453. // same request ID was received, and if so, will ignore the second
  105454. // request. This prevents clients from accidentally creating duplicate
  105455. // commitments.
  105456. //
  105457. // The request ID must be a valid UUID with the exception that zero UUID
  105458. // is not supported (00000000-0000-0000-0000-000000000000).
  105459. func (c *RegionHealthCheckServicesInsertCall) RequestId(requestId string) *RegionHealthCheckServicesInsertCall {
  105460. c.urlParams_.Set("requestId", requestId)
  105461. return c
  105462. }
  105463. // Fields allows partial responses to be retrieved. See
  105464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105465. // for more information.
  105466. func (c *RegionHealthCheckServicesInsertCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesInsertCall {
  105467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105468. return c
  105469. }
  105470. // Context sets the context to be used in this call's Do method. Any
  105471. // pending HTTP request will be aborted if the provided context is
  105472. // canceled.
  105473. func (c *RegionHealthCheckServicesInsertCall) Context(ctx context.Context) *RegionHealthCheckServicesInsertCall {
  105474. c.ctx_ = ctx
  105475. return c
  105476. }
  105477. // Header returns an http.Header that can be modified by the caller to
  105478. // add HTTP headers to the request.
  105479. func (c *RegionHealthCheckServicesInsertCall) Header() http.Header {
  105480. if c.header_ == nil {
  105481. c.header_ = make(http.Header)
  105482. }
  105483. return c.header_
  105484. }
  105485. func (c *RegionHealthCheckServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  105486. reqHeaders := make(http.Header)
  105487. for k, v := range c.header_ {
  105488. reqHeaders[k] = v
  105489. }
  105490. reqHeaders.Set("User-Agent", c.s.userAgent())
  105491. var body io.Reader = nil
  105492. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice)
  105493. if err != nil {
  105494. return nil, err
  105495. }
  105496. reqHeaders.Set("Content-Type", "application/json")
  105497. c.urlParams_.Set("alt", alt)
  105498. c.urlParams_.Set("prettyPrint", "false")
  105499. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthCheckServices")
  105500. urls += "?" + c.urlParams_.Encode()
  105501. req, err := http.NewRequest("POST", urls, body)
  105502. if err != nil {
  105503. return nil, err
  105504. }
  105505. req.Header = reqHeaders
  105506. googleapi.Expand(req.URL, map[string]string{
  105507. "project": c.project,
  105508. "region": c.region,
  105509. })
  105510. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105511. }
  105512. // Do executes the "compute.regionHealthCheckServices.insert" call.
  105513. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105514. // status code is an error. Response headers are in either
  105515. // *Operation.ServerResponse.Header or (if a response was returned at
  105516. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105517. // to check whether the returned error was because
  105518. // http.StatusNotModified was returned.
  105519. func (c *RegionHealthCheckServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105520. gensupport.SetOptions(c.urlParams_, opts...)
  105521. res, err := c.doRequest("json")
  105522. if res != nil && res.StatusCode == http.StatusNotModified {
  105523. if res.Body != nil {
  105524. res.Body.Close()
  105525. }
  105526. return nil, &googleapi.Error{
  105527. Code: res.StatusCode,
  105528. Header: res.Header,
  105529. }
  105530. }
  105531. if err != nil {
  105532. return nil, err
  105533. }
  105534. defer googleapi.CloseBody(res)
  105535. if err := googleapi.CheckResponse(res); err != nil {
  105536. return nil, err
  105537. }
  105538. ret := &Operation{
  105539. ServerResponse: googleapi.ServerResponse{
  105540. Header: res.Header,
  105541. HTTPStatusCode: res.StatusCode,
  105542. },
  105543. }
  105544. target := &ret
  105545. if err := gensupport.DecodeResponse(target, res); err != nil {
  105546. return nil, err
  105547. }
  105548. return ret, nil
  105549. // {
  105550. // "description": "Creates a regional HealthCheckService resource in the specified project and region using the data included in the request.",
  105551. // "httpMethod": "POST",
  105552. // "id": "compute.regionHealthCheckServices.insert",
  105553. // "parameterOrder": [
  105554. // "project",
  105555. // "region"
  105556. // ],
  105557. // "parameters": {
  105558. // "project": {
  105559. // "description": "Project ID for this request.",
  105560. // "location": "path",
  105561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105562. // "required": true,
  105563. // "type": "string"
  105564. // },
  105565. // "region": {
  105566. // "description": "Name of the region scoping this request.",
  105567. // "location": "path",
  105568. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105569. // "required": true,
  105570. // "type": "string"
  105571. // },
  105572. // "requestId": {
  105573. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105574. // "location": "query",
  105575. // "type": "string"
  105576. // }
  105577. // },
  105578. // "path": "{project}/regions/{region}/healthCheckServices",
  105579. // "request": {
  105580. // "$ref": "HealthCheckService"
  105581. // },
  105582. // "response": {
  105583. // "$ref": "Operation"
  105584. // },
  105585. // "scopes": [
  105586. // "https://www.googleapis.com/auth/cloud-platform",
  105587. // "https://www.googleapis.com/auth/compute"
  105588. // ]
  105589. // }
  105590. }
  105591. // method id "compute.regionHealthCheckServices.list":
  105592. type RegionHealthCheckServicesListCall struct {
  105593. s *Service
  105594. project string
  105595. region string
  105596. urlParams_ gensupport.URLParams
  105597. ifNoneMatch_ string
  105598. ctx_ context.Context
  105599. header_ http.Header
  105600. }
  105601. // List: Lists all the HealthCheckService resources that have been
  105602. // configured for the specified project in the given region.
  105603. func (r *RegionHealthCheckServicesService) List(project string, region string) *RegionHealthCheckServicesListCall {
  105604. c := &RegionHealthCheckServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105605. c.project = project
  105606. c.region = region
  105607. return c
  105608. }
  105609. // Filter sets the optional parameter "filter": A filter expression that
  105610. // filters resources listed in the response. The expression must specify
  105611. // the field name, a comparison operator, and the value that you want to
  105612. // use for filtering. The value must be a string, a number, or a
  105613. // boolean. The comparison operator must be either =, !=, >, or <.
  105614. //
  105615. // For example, if you are filtering Compute Engine instances, you can
  105616. // exclude instances named example-instance by specifying name !=
  105617. // example-instance.
  105618. //
  105619. // You can also filter nested fields. For example, you could specify
  105620. // scheduling.automaticRestart = false to include instances only if they
  105621. // are not scheduled for automatic restarts. You can use filtering on
  105622. // nested fields to filter based on resource labels.
  105623. //
  105624. // To filter on multiple expressions, provide each separate expression
  105625. // within parentheses. For example, (scheduling.automaticRestart = true)
  105626. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  105627. // AND expression. However, you can include AND and OR expressions
  105628. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  105629. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  105630. // true).
  105631. func (c *RegionHealthCheckServicesListCall) Filter(filter string) *RegionHealthCheckServicesListCall {
  105632. c.urlParams_.Set("filter", filter)
  105633. return c
  105634. }
  105635. // MaxResults sets the optional parameter "maxResults": The maximum
  105636. // number of results per page that should be returned. If the number of
  105637. // available results is larger than maxResults, Compute Engine returns a
  105638. // nextPageToken that can be used to get the next page of results in
  105639. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  105640. // (Default: 500)
  105641. func (c *RegionHealthCheckServicesListCall) MaxResults(maxResults int64) *RegionHealthCheckServicesListCall {
  105642. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  105643. return c
  105644. }
  105645. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  105646. // a certain order. By default, results are returned in alphanumerical
  105647. // order based on the resource name.
  105648. //
  105649. // You can also sort results in descending order based on the creation
  105650. // timestamp using orderBy="creationTimestamp desc". This sorts results
  105651. // based on the creationTimestamp field in reverse chronological order
  105652. // (newest result first). Use this to sort resources like operations so
  105653. // that the newest operation is returned first.
  105654. //
  105655. // Currently, only sorting by name or creationTimestamp desc is
  105656. // supported.
  105657. func (c *RegionHealthCheckServicesListCall) OrderBy(orderBy string) *RegionHealthCheckServicesListCall {
  105658. c.urlParams_.Set("orderBy", orderBy)
  105659. return c
  105660. }
  105661. // PageToken sets the optional parameter "pageToken": Specifies a page
  105662. // token to use. Set pageToken to the nextPageToken returned by a
  105663. // previous list request to get the next page of results.
  105664. func (c *RegionHealthCheckServicesListCall) PageToken(pageToken string) *RegionHealthCheckServicesListCall {
  105665. c.urlParams_.Set("pageToken", pageToken)
  105666. return c
  105667. }
  105668. // Fields allows partial responses to be retrieved. See
  105669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105670. // for more information.
  105671. func (c *RegionHealthCheckServicesListCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesListCall {
  105672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105673. return c
  105674. }
  105675. // IfNoneMatch sets the optional parameter which makes the operation
  105676. // fail if the object's ETag matches the given value. This is useful for
  105677. // getting updates only after the object has changed since the last
  105678. // request. Use googleapi.IsNotModified to check whether the response
  105679. // error from Do is the result of In-None-Match.
  105680. func (c *RegionHealthCheckServicesListCall) IfNoneMatch(entityTag string) *RegionHealthCheckServicesListCall {
  105681. c.ifNoneMatch_ = entityTag
  105682. return c
  105683. }
  105684. // Context sets the context to be used in this call's Do method. Any
  105685. // pending HTTP request will be aborted if the provided context is
  105686. // canceled.
  105687. func (c *RegionHealthCheckServicesListCall) Context(ctx context.Context) *RegionHealthCheckServicesListCall {
  105688. c.ctx_ = ctx
  105689. return c
  105690. }
  105691. // Header returns an http.Header that can be modified by the caller to
  105692. // add HTTP headers to the request.
  105693. func (c *RegionHealthCheckServicesListCall) Header() http.Header {
  105694. if c.header_ == nil {
  105695. c.header_ = make(http.Header)
  105696. }
  105697. return c.header_
  105698. }
  105699. func (c *RegionHealthCheckServicesListCall) doRequest(alt string) (*http.Response, error) {
  105700. reqHeaders := make(http.Header)
  105701. for k, v := range c.header_ {
  105702. reqHeaders[k] = v
  105703. }
  105704. reqHeaders.Set("User-Agent", c.s.userAgent())
  105705. if c.ifNoneMatch_ != "" {
  105706. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105707. }
  105708. var body io.Reader = nil
  105709. c.urlParams_.Set("alt", alt)
  105710. c.urlParams_.Set("prettyPrint", "false")
  105711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthCheckServices")
  105712. urls += "?" + c.urlParams_.Encode()
  105713. req, err := http.NewRequest("GET", urls, body)
  105714. if err != nil {
  105715. return nil, err
  105716. }
  105717. req.Header = reqHeaders
  105718. googleapi.Expand(req.URL, map[string]string{
  105719. "project": c.project,
  105720. "region": c.region,
  105721. })
  105722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105723. }
  105724. // Do executes the "compute.regionHealthCheckServices.list" call.
  105725. // Exactly one of *HealthCheckServicesList or error will be non-nil. Any
  105726. // non-2xx status code is an error. Response headers are in either
  105727. // *HealthCheckServicesList.ServerResponse.Header or (if a response was
  105728. // returned at all) in error.(*googleapi.Error).Header. Use
  105729. // googleapi.IsNotModified to check whether the returned error was
  105730. // because http.StatusNotModified was returned.
  105731. func (c *RegionHealthCheckServicesListCall) Do(opts ...googleapi.CallOption) (*HealthCheckServicesList, error) {
  105732. gensupport.SetOptions(c.urlParams_, opts...)
  105733. res, err := c.doRequest("json")
  105734. if res != nil && res.StatusCode == http.StatusNotModified {
  105735. if res.Body != nil {
  105736. res.Body.Close()
  105737. }
  105738. return nil, &googleapi.Error{
  105739. Code: res.StatusCode,
  105740. Header: res.Header,
  105741. }
  105742. }
  105743. if err != nil {
  105744. return nil, err
  105745. }
  105746. defer googleapi.CloseBody(res)
  105747. if err := googleapi.CheckResponse(res); err != nil {
  105748. return nil, err
  105749. }
  105750. ret := &HealthCheckServicesList{
  105751. ServerResponse: googleapi.ServerResponse{
  105752. Header: res.Header,
  105753. HTTPStatusCode: res.StatusCode,
  105754. },
  105755. }
  105756. target := &ret
  105757. if err := gensupport.DecodeResponse(target, res); err != nil {
  105758. return nil, err
  105759. }
  105760. return ret, nil
  105761. // {
  105762. // "description": "Lists all the HealthCheckService resources that have been configured for the specified project in the given region.",
  105763. // "httpMethod": "GET",
  105764. // "id": "compute.regionHealthCheckServices.list",
  105765. // "parameterOrder": [
  105766. // "project",
  105767. // "region"
  105768. // ],
  105769. // "parameters": {
  105770. // "filter": {
  105771. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  105772. // "location": "query",
  105773. // "type": "string"
  105774. // },
  105775. // "maxResults": {
  105776. // "default": "500",
  105777. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  105778. // "format": "uint32",
  105779. // "location": "query",
  105780. // "minimum": "0",
  105781. // "type": "integer"
  105782. // },
  105783. // "orderBy": {
  105784. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  105785. // "location": "query",
  105786. // "type": "string"
  105787. // },
  105788. // "pageToken": {
  105789. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  105790. // "location": "query",
  105791. // "type": "string"
  105792. // },
  105793. // "project": {
  105794. // "description": "Project ID for this request.",
  105795. // "location": "path",
  105796. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105797. // "required": true,
  105798. // "type": "string"
  105799. // },
  105800. // "region": {
  105801. // "description": "Name of the region scoping this request.",
  105802. // "location": "path",
  105803. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105804. // "required": true,
  105805. // "type": "string"
  105806. // }
  105807. // },
  105808. // "path": "{project}/regions/{region}/healthCheckServices",
  105809. // "response": {
  105810. // "$ref": "HealthCheckServicesList"
  105811. // },
  105812. // "scopes": [
  105813. // "https://www.googleapis.com/auth/cloud-platform",
  105814. // "https://www.googleapis.com/auth/compute",
  105815. // "https://www.googleapis.com/auth/compute.readonly"
  105816. // ]
  105817. // }
  105818. }
  105819. // Pages invokes f for each page of results.
  105820. // A non-nil error returned from f will halt the iteration.
  105821. // The provided context supersedes any context provided to the Context method.
  105822. func (c *RegionHealthCheckServicesListCall) Pages(ctx context.Context, f func(*HealthCheckServicesList) error) error {
  105823. c.ctx_ = ctx
  105824. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  105825. for {
  105826. x, err := c.Do()
  105827. if err != nil {
  105828. return err
  105829. }
  105830. if err := f(x); err != nil {
  105831. return err
  105832. }
  105833. if x.NextPageToken == "" {
  105834. return nil
  105835. }
  105836. c.PageToken(x.NextPageToken)
  105837. }
  105838. }
  105839. // method id "compute.regionHealthCheckServices.testIamPermissions":
  105840. type RegionHealthCheckServicesTestIamPermissionsCall struct {
  105841. s *Service
  105842. project string
  105843. region string
  105844. resource string
  105845. testpermissionsrequest *TestPermissionsRequest
  105846. urlParams_ gensupport.URLParams
  105847. ctx_ context.Context
  105848. header_ http.Header
  105849. }
  105850. // TestIamPermissions: Returns permissions that a caller has on the
  105851. // specified resource.
  105852. func (r *RegionHealthCheckServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionHealthCheckServicesTestIamPermissionsCall {
  105853. c := &RegionHealthCheckServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105854. c.project = project
  105855. c.region = region
  105856. c.resource = resource
  105857. c.testpermissionsrequest = testpermissionsrequest
  105858. return c
  105859. }
  105860. // Fields allows partial responses to be retrieved. See
  105861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105862. // for more information.
  105863. func (c *RegionHealthCheckServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesTestIamPermissionsCall {
  105864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105865. return c
  105866. }
  105867. // Context sets the context to be used in this call's Do method. Any
  105868. // pending HTTP request will be aborted if the provided context is
  105869. // canceled.
  105870. func (c *RegionHealthCheckServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionHealthCheckServicesTestIamPermissionsCall {
  105871. c.ctx_ = ctx
  105872. return c
  105873. }
  105874. // Header returns an http.Header that can be modified by the caller to
  105875. // add HTTP headers to the request.
  105876. func (c *RegionHealthCheckServicesTestIamPermissionsCall) Header() http.Header {
  105877. if c.header_ == nil {
  105878. c.header_ = make(http.Header)
  105879. }
  105880. return c.header_
  105881. }
  105882. func (c *RegionHealthCheckServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  105883. reqHeaders := make(http.Header)
  105884. for k, v := range c.header_ {
  105885. reqHeaders[k] = v
  105886. }
  105887. reqHeaders.Set("User-Agent", c.s.userAgent())
  105888. var body io.Reader = nil
  105889. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  105890. if err != nil {
  105891. return nil, err
  105892. }
  105893. reqHeaders.Set("Content-Type", "application/json")
  105894. c.urlParams_.Set("alt", alt)
  105895. c.urlParams_.Set("prettyPrint", "false")
  105896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthCheckServices/{resource}/testIamPermissions")
  105897. urls += "?" + c.urlParams_.Encode()
  105898. req, err := http.NewRequest("POST", urls, body)
  105899. if err != nil {
  105900. return nil, err
  105901. }
  105902. req.Header = reqHeaders
  105903. googleapi.Expand(req.URL, map[string]string{
  105904. "project": c.project,
  105905. "region": c.region,
  105906. "resource": c.resource,
  105907. })
  105908. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105909. }
  105910. // Do executes the "compute.regionHealthCheckServices.testIamPermissions" call.
  105911. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  105912. // non-2xx status code is an error. Response headers are in either
  105913. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  105914. // returned at all) in error.(*googleapi.Error).Header. Use
  105915. // googleapi.IsNotModified to check whether the returned error was
  105916. // because http.StatusNotModified was returned.
  105917. func (c *RegionHealthCheckServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  105918. gensupport.SetOptions(c.urlParams_, opts...)
  105919. res, err := c.doRequest("json")
  105920. if res != nil && res.StatusCode == http.StatusNotModified {
  105921. if res.Body != nil {
  105922. res.Body.Close()
  105923. }
  105924. return nil, &googleapi.Error{
  105925. Code: res.StatusCode,
  105926. Header: res.Header,
  105927. }
  105928. }
  105929. if err != nil {
  105930. return nil, err
  105931. }
  105932. defer googleapi.CloseBody(res)
  105933. if err := googleapi.CheckResponse(res); err != nil {
  105934. return nil, err
  105935. }
  105936. ret := &TestPermissionsResponse{
  105937. ServerResponse: googleapi.ServerResponse{
  105938. Header: res.Header,
  105939. HTTPStatusCode: res.StatusCode,
  105940. },
  105941. }
  105942. target := &ret
  105943. if err := gensupport.DecodeResponse(target, res); err != nil {
  105944. return nil, err
  105945. }
  105946. return ret, nil
  105947. // {
  105948. // "description": "Returns permissions that a caller has on the specified resource.",
  105949. // "httpMethod": "POST",
  105950. // "id": "compute.regionHealthCheckServices.testIamPermissions",
  105951. // "parameterOrder": [
  105952. // "project",
  105953. // "region",
  105954. // "resource"
  105955. // ],
  105956. // "parameters": {
  105957. // "project": {
  105958. // "description": "Project ID for this request.",
  105959. // "location": "path",
  105960. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105961. // "required": true,
  105962. // "type": "string"
  105963. // },
  105964. // "region": {
  105965. // "description": "The name of the region for this request.",
  105966. // "location": "path",
  105967. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105968. // "required": true,
  105969. // "type": "string"
  105970. // },
  105971. // "resource": {
  105972. // "description": "Name or id of the resource for this request.",
  105973. // "location": "path",
  105974. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  105975. // "required": true,
  105976. // "type": "string"
  105977. // }
  105978. // },
  105979. // "path": "{project}/regions/{region}/healthCheckServices/{resource}/testIamPermissions",
  105980. // "request": {
  105981. // "$ref": "TestPermissionsRequest"
  105982. // },
  105983. // "response": {
  105984. // "$ref": "TestPermissionsResponse"
  105985. // },
  105986. // "scopes": [
  105987. // "https://www.googleapis.com/auth/cloud-platform",
  105988. // "https://www.googleapis.com/auth/compute",
  105989. // "https://www.googleapis.com/auth/compute.readonly"
  105990. // ]
  105991. // }
  105992. }
  105993. // method id "compute.regionHealthChecks.delete":
  105994. type RegionHealthChecksDeleteCall struct {
  105995. s *Service
  105996. project string
  105997. region string
  105998. healthCheck string
  105999. urlParams_ gensupport.URLParams
  106000. ctx_ context.Context
  106001. header_ http.Header
  106002. }
  106003. // Delete: Deletes the specified HealthCheck resource.
  106004. func (r *RegionHealthChecksService) Delete(project string, region string, healthCheck string) *RegionHealthChecksDeleteCall {
  106005. c := &RegionHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106006. c.project = project
  106007. c.region = region
  106008. c.healthCheck = healthCheck
  106009. return c
  106010. }
  106011. // RequestId sets the optional parameter "requestId": An optional
  106012. // request ID to identify requests. Specify a unique request ID so that
  106013. // if you must retry your request, the server will know to ignore the
  106014. // request if it has already been completed.
  106015. //
  106016. // For example, consider a situation where you make an initial request
  106017. // and the request times out. If you make the request again with the
  106018. // same request ID, the server can check if original operation with the
  106019. // same request ID was received, and if so, will ignore the second
  106020. // request. This prevents clients from accidentally creating duplicate
  106021. // commitments.
  106022. //
  106023. // The request ID must be a valid UUID with the exception that zero UUID
  106024. // is not supported (00000000-0000-0000-0000-000000000000).
  106025. func (c *RegionHealthChecksDeleteCall) RequestId(requestId string) *RegionHealthChecksDeleteCall {
  106026. c.urlParams_.Set("requestId", requestId)
  106027. return c
  106028. }
  106029. // Fields allows partial responses to be retrieved. See
  106030. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106031. // for more information.
  106032. func (c *RegionHealthChecksDeleteCall) Fields(s ...googleapi.Field) *RegionHealthChecksDeleteCall {
  106033. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106034. return c
  106035. }
  106036. // Context sets the context to be used in this call's Do method. Any
  106037. // pending HTTP request will be aborted if the provided context is
  106038. // canceled.
  106039. func (c *RegionHealthChecksDeleteCall) Context(ctx context.Context) *RegionHealthChecksDeleteCall {
  106040. c.ctx_ = ctx
  106041. return c
  106042. }
  106043. // Header returns an http.Header that can be modified by the caller to
  106044. // add HTTP headers to the request.
  106045. func (c *RegionHealthChecksDeleteCall) Header() http.Header {
  106046. if c.header_ == nil {
  106047. c.header_ = make(http.Header)
  106048. }
  106049. return c.header_
  106050. }
  106051. func (c *RegionHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  106052. reqHeaders := make(http.Header)
  106053. for k, v := range c.header_ {
  106054. reqHeaders[k] = v
  106055. }
  106056. reqHeaders.Set("User-Agent", c.s.userAgent())
  106057. var body io.Reader = nil
  106058. c.urlParams_.Set("alt", alt)
  106059. c.urlParams_.Set("prettyPrint", "false")
  106060. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  106061. urls += "?" + c.urlParams_.Encode()
  106062. req, err := http.NewRequest("DELETE", urls, body)
  106063. if err != nil {
  106064. return nil, err
  106065. }
  106066. req.Header = reqHeaders
  106067. googleapi.Expand(req.URL, map[string]string{
  106068. "project": c.project,
  106069. "region": c.region,
  106070. "healthCheck": c.healthCheck,
  106071. })
  106072. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106073. }
  106074. // Do executes the "compute.regionHealthChecks.delete" call.
  106075. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106076. // status code is an error. Response headers are in either
  106077. // *Operation.ServerResponse.Header or (if a response was returned at
  106078. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106079. // to check whether the returned error was because
  106080. // http.StatusNotModified was returned.
  106081. func (c *RegionHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106082. gensupport.SetOptions(c.urlParams_, opts...)
  106083. res, err := c.doRequest("json")
  106084. if res != nil && res.StatusCode == http.StatusNotModified {
  106085. if res.Body != nil {
  106086. res.Body.Close()
  106087. }
  106088. return nil, &googleapi.Error{
  106089. Code: res.StatusCode,
  106090. Header: res.Header,
  106091. }
  106092. }
  106093. if err != nil {
  106094. return nil, err
  106095. }
  106096. defer googleapi.CloseBody(res)
  106097. if err := googleapi.CheckResponse(res); err != nil {
  106098. return nil, err
  106099. }
  106100. ret := &Operation{
  106101. ServerResponse: googleapi.ServerResponse{
  106102. Header: res.Header,
  106103. HTTPStatusCode: res.StatusCode,
  106104. },
  106105. }
  106106. target := &ret
  106107. if err := gensupport.DecodeResponse(target, res); err != nil {
  106108. return nil, err
  106109. }
  106110. return ret, nil
  106111. // {
  106112. // "description": "Deletes the specified HealthCheck resource.",
  106113. // "httpMethod": "DELETE",
  106114. // "id": "compute.regionHealthChecks.delete",
  106115. // "parameterOrder": [
  106116. // "project",
  106117. // "region",
  106118. // "healthCheck"
  106119. // ],
  106120. // "parameters": {
  106121. // "healthCheck": {
  106122. // "description": "Name of the HealthCheck resource to delete.",
  106123. // "location": "path",
  106124. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  106125. // "required": true,
  106126. // "type": "string"
  106127. // },
  106128. // "project": {
  106129. // "description": "Project ID for this request.",
  106130. // "location": "path",
  106131. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106132. // "required": true,
  106133. // "type": "string"
  106134. // },
  106135. // "region": {
  106136. // "description": "Name of the region scoping this request.",
  106137. // "location": "path",
  106138. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106139. // "required": true,
  106140. // "type": "string"
  106141. // },
  106142. // "requestId": {
  106143. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106144. // "location": "query",
  106145. // "type": "string"
  106146. // }
  106147. // },
  106148. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  106149. // "response": {
  106150. // "$ref": "Operation"
  106151. // },
  106152. // "scopes": [
  106153. // "https://www.googleapis.com/auth/cloud-platform",
  106154. // "https://www.googleapis.com/auth/compute"
  106155. // ]
  106156. // }
  106157. }
  106158. // method id "compute.regionHealthChecks.get":
  106159. type RegionHealthChecksGetCall struct {
  106160. s *Service
  106161. project string
  106162. region string
  106163. healthCheck string
  106164. urlParams_ gensupport.URLParams
  106165. ifNoneMatch_ string
  106166. ctx_ context.Context
  106167. header_ http.Header
  106168. }
  106169. // Get: Returns the specified HealthCheck resource. Gets a list of
  106170. // available health checks by making a list() request.
  106171. func (r *RegionHealthChecksService) Get(project string, region string, healthCheck string) *RegionHealthChecksGetCall {
  106172. c := &RegionHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106173. c.project = project
  106174. c.region = region
  106175. c.healthCheck = healthCheck
  106176. return c
  106177. }
  106178. // Fields allows partial responses to be retrieved. See
  106179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106180. // for more information.
  106181. func (c *RegionHealthChecksGetCall) Fields(s ...googleapi.Field) *RegionHealthChecksGetCall {
  106182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106183. return c
  106184. }
  106185. // IfNoneMatch sets the optional parameter which makes the operation
  106186. // fail if the object's ETag matches the given value. This is useful for
  106187. // getting updates only after the object has changed since the last
  106188. // request. Use googleapi.IsNotModified to check whether the response
  106189. // error from Do is the result of In-None-Match.
  106190. func (c *RegionHealthChecksGetCall) IfNoneMatch(entityTag string) *RegionHealthChecksGetCall {
  106191. c.ifNoneMatch_ = entityTag
  106192. return c
  106193. }
  106194. // Context sets the context to be used in this call's Do method. Any
  106195. // pending HTTP request will be aborted if the provided context is
  106196. // canceled.
  106197. func (c *RegionHealthChecksGetCall) Context(ctx context.Context) *RegionHealthChecksGetCall {
  106198. c.ctx_ = ctx
  106199. return c
  106200. }
  106201. // Header returns an http.Header that can be modified by the caller to
  106202. // add HTTP headers to the request.
  106203. func (c *RegionHealthChecksGetCall) Header() http.Header {
  106204. if c.header_ == nil {
  106205. c.header_ = make(http.Header)
  106206. }
  106207. return c.header_
  106208. }
  106209. func (c *RegionHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  106210. reqHeaders := make(http.Header)
  106211. for k, v := range c.header_ {
  106212. reqHeaders[k] = v
  106213. }
  106214. reqHeaders.Set("User-Agent", c.s.userAgent())
  106215. if c.ifNoneMatch_ != "" {
  106216. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  106217. }
  106218. var body io.Reader = nil
  106219. c.urlParams_.Set("alt", alt)
  106220. c.urlParams_.Set("prettyPrint", "false")
  106221. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  106222. urls += "?" + c.urlParams_.Encode()
  106223. req, err := http.NewRequest("GET", urls, body)
  106224. if err != nil {
  106225. return nil, err
  106226. }
  106227. req.Header = reqHeaders
  106228. googleapi.Expand(req.URL, map[string]string{
  106229. "project": c.project,
  106230. "region": c.region,
  106231. "healthCheck": c.healthCheck,
  106232. })
  106233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106234. }
  106235. // Do executes the "compute.regionHealthChecks.get" call.
  106236. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  106237. // status code is an error. Response headers are in either
  106238. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  106239. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106240. // to check whether the returned error was because
  106241. // http.StatusNotModified was returned.
  106242. func (c *RegionHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  106243. gensupport.SetOptions(c.urlParams_, opts...)
  106244. res, err := c.doRequest("json")
  106245. if res != nil && res.StatusCode == http.StatusNotModified {
  106246. if res.Body != nil {
  106247. res.Body.Close()
  106248. }
  106249. return nil, &googleapi.Error{
  106250. Code: res.StatusCode,
  106251. Header: res.Header,
  106252. }
  106253. }
  106254. if err != nil {
  106255. return nil, err
  106256. }
  106257. defer googleapi.CloseBody(res)
  106258. if err := googleapi.CheckResponse(res); err != nil {
  106259. return nil, err
  106260. }
  106261. ret := &HealthCheck{
  106262. ServerResponse: googleapi.ServerResponse{
  106263. Header: res.Header,
  106264. HTTPStatusCode: res.StatusCode,
  106265. },
  106266. }
  106267. target := &ret
  106268. if err := gensupport.DecodeResponse(target, res); err != nil {
  106269. return nil, err
  106270. }
  106271. return ret, nil
  106272. // {
  106273. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  106274. // "httpMethod": "GET",
  106275. // "id": "compute.regionHealthChecks.get",
  106276. // "parameterOrder": [
  106277. // "project",
  106278. // "region",
  106279. // "healthCheck"
  106280. // ],
  106281. // "parameters": {
  106282. // "healthCheck": {
  106283. // "description": "Name of the HealthCheck resource to return.",
  106284. // "location": "path",
  106285. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  106286. // "required": true,
  106287. // "type": "string"
  106288. // },
  106289. // "project": {
  106290. // "description": "Project ID for this request.",
  106291. // "location": "path",
  106292. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106293. // "required": true,
  106294. // "type": "string"
  106295. // },
  106296. // "region": {
  106297. // "description": "Name of the region scoping this request.",
  106298. // "location": "path",
  106299. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106300. // "required": true,
  106301. // "type": "string"
  106302. // }
  106303. // },
  106304. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  106305. // "response": {
  106306. // "$ref": "HealthCheck"
  106307. // },
  106308. // "scopes": [
  106309. // "https://www.googleapis.com/auth/cloud-platform",
  106310. // "https://www.googleapis.com/auth/compute",
  106311. // "https://www.googleapis.com/auth/compute.readonly"
  106312. // ]
  106313. // }
  106314. }
  106315. // method id "compute.regionHealthChecks.insert":
  106316. type RegionHealthChecksInsertCall struct {
  106317. s *Service
  106318. project string
  106319. region string
  106320. healthcheck *HealthCheck
  106321. urlParams_ gensupport.URLParams
  106322. ctx_ context.Context
  106323. header_ http.Header
  106324. }
  106325. // Insert: Creates a HealthCheck resource in the specified project using
  106326. // the data included in the request.
  106327. func (r *RegionHealthChecksService) Insert(project string, region string, healthcheck *HealthCheck) *RegionHealthChecksInsertCall {
  106328. c := &RegionHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106329. c.project = project
  106330. c.region = region
  106331. c.healthcheck = healthcheck
  106332. return c
  106333. }
  106334. // RequestId sets the optional parameter "requestId": An optional
  106335. // request ID to identify requests. Specify a unique request ID so that
  106336. // if you must retry your request, the server will know to ignore the
  106337. // request if it has already been completed.
  106338. //
  106339. // For example, consider a situation where you make an initial request
  106340. // and the request times out. If you make the request again with the
  106341. // same request ID, the server can check if original operation with the
  106342. // same request ID was received, and if so, will ignore the second
  106343. // request. This prevents clients from accidentally creating duplicate
  106344. // commitments.
  106345. //
  106346. // The request ID must be a valid UUID with the exception that zero UUID
  106347. // is not supported (00000000-0000-0000-0000-000000000000).
  106348. func (c *RegionHealthChecksInsertCall) RequestId(requestId string) *RegionHealthChecksInsertCall {
  106349. c.urlParams_.Set("requestId", requestId)
  106350. return c
  106351. }
  106352. // Fields allows partial responses to be retrieved. See
  106353. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106354. // for more information.
  106355. func (c *RegionHealthChecksInsertCall) Fields(s ...googleapi.Field) *RegionHealthChecksInsertCall {
  106356. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106357. return c
  106358. }
  106359. // Context sets the context to be used in this call's Do method. Any
  106360. // pending HTTP request will be aborted if the provided context is
  106361. // canceled.
  106362. func (c *RegionHealthChecksInsertCall) Context(ctx context.Context) *RegionHealthChecksInsertCall {
  106363. c.ctx_ = ctx
  106364. return c
  106365. }
  106366. // Header returns an http.Header that can be modified by the caller to
  106367. // add HTTP headers to the request.
  106368. func (c *RegionHealthChecksInsertCall) Header() http.Header {
  106369. if c.header_ == nil {
  106370. c.header_ = make(http.Header)
  106371. }
  106372. return c.header_
  106373. }
  106374. func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  106375. reqHeaders := make(http.Header)
  106376. for k, v := range c.header_ {
  106377. reqHeaders[k] = v
  106378. }
  106379. reqHeaders.Set("User-Agent", c.s.userAgent())
  106380. var body io.Reader = nil
  106381. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  106382. if err != nil {
  106383. return nil, err
  106384. }
  106385. reqHeaders.Set("Content-Type", "application/json")
  106386. c.urlParams_.Set("alt", alt)
  106387. c.urlParams_.Set("prettyPrint", "false")
  106388. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks")
  106389. urls += "?" + c.urlParams_.Encode()
  106390. req, err := http.NewRequest("POST", urls, body)
  106391. if err != nil {
  106392. return nil, err
  106393. }
  106394. req.Header = reqHeaders
  106395. googleapi.Expand(req.URL, map[string]string{
  106396. "project": c.project,
  106397. "region": c.region,
  106398. })
  106399. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106400. }
  106401. // Do executes the "compute.regionHealthChecks.insert" call.
  106402. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106403. // status code is an error. Response headers are in either
  106404. // *Operation.ServerResponse.Header or (if a response was returned at
  106405. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106406. // to check whether the returned error was because
  106407. // http.StatusNotModified was returned.
  106408. func (c *RegionHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106409. gensupport.SetOptions(c.urlParams_, opts...)
  106410. res, err := c.doRequest("json")
  106411. if res != nil && res.StatusCode == http.StatusNotModified {
  106412. if res.Body != nil {
  106413. res.Body.Close()
  106414. }
  106415. return nil, &googleapi.Error{
  106416. Code: res.StatusCode,
  106417. Header: res.Header,
  106418. }
  106419. }
  106420. if err != nil {
  106421. return nil, err
  106422. }
  106423. defer googleapi.CloseBody(res)
  106424. if err := googleapi.CheckResponse(res); err != nil {
  106425. return nil, err
  106426. }
  106427. ret := &Operation{
  106428. ServerResponse: googleapi.ServerResponse{
  106429. Header: res.Header,
  106430. HTTPStatusCode: res.StatusCode,
  106431. },
  106432. }
  106433. target := &ret
  106434. if err := gensupport.DecodeResponse(target, res); err != nil {
  106435. return nil, err
  106436. }
  106437. return ret, nil
  106438. // {
  106439. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  106440. // "httpMethod": "POST",
  106441. // "id": "compute.regionHealthChecks.insert",
  106442. // "parameterOrder": [
  106443. // "project",
  106444. // "region"
  106445. // ],
  106446. // "parameters": {
  106447. // "project": {
  106448. // "description": "Project ID for this request.",
  106449. // "location": "path",
  106450. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106451. // "required": true,
  106452. // "type": "string"
  106453. // },
  106454. // "region": {
  106455. // "description": "Name of the region scoping this request.",
  106456. // "location": "path",
  106457. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106458. // "required": true,
  106459. // "type": "string"
  106460. // },
  106461. // "requestId": {
  106462. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106463. // "location": "query",
  106464. // "type": "string"
  106465. // }
  106466. // },
  106467. // "path": "{project}/regions/{region}/healthChecks",
  106468. // "request": {
  106469. // "$ref": "HealthCheck"
  106470. // },
  106471. // "response": {
  106472. // "$ref": "Operation"
  106473. // },
  106474. // "scopes": [
  106475. // "https://www.googleapis.com/auth/cloud-platform",
  106476. // "https://www.googleapis.com/auth/compute"
  106477. // ]
  106478. // }
  106479. }
  106480. // method id "compute.regionHealthChecks.list":
  106481. type RegionHealthChecksListCall struct {
  106482. s *Service
  106483. project string
  106484. region string
  106485. urlParams_ gensupport.URLParams
  106486. ifNoneMatch_ string
  106487. ctx_ context.Context
  106488. header_ http.Header
  106489. }
  106490. // List: Retrieves the list of HealthCheck resources available to the
  106491. // specified project.
  106492. func (r *RegionHealthChecksService) List(project string, region string) *RegionHealthChecksListCall {
  106493. c := &RegionHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106494. c.project = project
  106495. c.region = region
  106496. return c
  106497. }
  106498. // Filter sets the optional parameter "filter": A filter expression that
  106499. // filters resources listed in the response. The expression must specify
  106500. // the field name, a comparison operator, and the value that you want to
  106501. // use for filtering. The value must be a string, a number, or a
  106502. // boolean. The comparison operator must be either =, !=, >, or <.
  106503. //
  106504. // For example, if you are filtering Compute Engine instances, you can
  106505. // exclude instances named example-instance by specifying name !=
  106506. // example-instance.
  106507. //
  106508. // You can also filter nested fields. For example, you could specify
  106509. // scheduling.automaticRestart = false to include instances only if they
  106510. // are not scheduled for automatic restarts. You can use filtering on
  106511. // nested fields to filter based on resource labels.
  106512. //
  106513. // To filter on multiple expressions, provide each separate expression
  106514. // within parentheses. For example, (scheduling.automaticRestart = true)
  106515. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  106516. // AND expression. However, you can include AND and OR expressions
  106517. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  106518. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  106519. // true).
  106520. func (c *RegionHealthChecksListCall) Filter(filter string) *RegionHealthChecksListCall {
  106521. c.urlParams_.Set("filter", filter)
  106522. return c
  106523. }
  106524. // MaxResults sets the optional parameter "maxResults": The maximum
  106525. // number of results per page that should be returned. If the number of
  106526. // available results is larger than maxResults, Compute Engine returns a
  106527. // nextPageToken that can be used to get the next page of results in
  106528. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  106529. // (Default: 500)
  106530. func (c *RegionHealthChecksListCall) MaxResults(maxResults int64) *RegionHealthChecksListCall {
  106531. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  106532. return c
  106533. }
  106534. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  106535. // a certain order. By default, results are returned in alphanumerical
  106536. // order based on the resource name.
  106537. //
  106538. // You can also sort results in descending order based on the creation
  106539. // timestamp using orderBy="creationTimestamp desc". This sorts results
  106540. // based on the creationTimestamp field in reverse chronological order
  106541. // (newest result first). Use this to sort resources like operations so
  106542. // that the newest operation is returned first.
  106543. //
  106544. // Currently, only sorting by name or creationTimestamp desc is
  106545. // supported.
  106546. func (c *RegionHealthChecksListCall) OrderBy(orderBy string) *RegionHealthChecksListCall {
  106547. c.urlParams_.Set("orderBy", orderBy)
  106548. return c
  106549. }
  106550. // PageToken sets the optional parameter "pageToken": Specifies a page
  106551. // token to use. Set pageToken to the nextPageToken returned by a
  106552. // previous list request to get the next page of results.
  106553. func (c *RegionHealthChecksListCall) PageToken(pageToken string) *RegionHealthChecksListCall {
  106554. c.urlParams_.Set("pageToken", pageToken)
  106555. return c
  106556. }
  106557. // Fields allows partial responses to be retrieved. See
  106558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106559. // for more information.
  106560. func (c *RegionHealthChecksListCall) Fields(s ...googleapi.Field) *RegionHealthChecksListCall {
  106561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106562. return c
  106563. }
  106564. // IfNoneMatch sets the optional parameter which makes the operation
  106565. // fail if the object's ETag matches the given value. This is useful for
  106566. // getting updates only after the object has changed since the last
  106567. // request. Use googleapi.IsNotModified to check whether the response
  106568. // error from Do is the result of In-None-Match.
  106569. func (c *RegionHealthChecksListCall) IfNoneMatch(entityTag string) *RegionHealthChecksListCall {
  106570. c.ifNoneMatch_ = entityTag
  106571. return c
  106572. }
  106573. // Context sets the context to be used in this call's Do method. Any
  106574. // pending HTTP request will be aborted if the provided context is
  106575. // canceled.
  106576. func (c *RegionHealthChecksListCall) Context(ctx context.Context) *RegionHealthChecksListCall {
  106577. c.ctx_ = ctx
  106578. return c
  106579. }
  106580. // Header returns an http.Header that can be modified by the caller to
  106581. // add HTTP headers to the request.
  106582. func (c *RegionHealthChecksListCall) Header() http.Header {
  106583. if c.header_ == nil {
  106584. c.header_ = make(http.Header)
  106585. }
  106586. return c.header_
  106587. }
  106588. func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  106589. reqHeaders := make(http.Header)
  106590. for k, v := range c.header_ {
  106591. reqHeaders[k] = v
  106592. }
  106593. reqHeaders.Set("User-Agent", c.s.userAgent())
  106594. if c.ifNoneMatch_ != "" {
  106595. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  106596. }
  106597. var body io.Reader = nil
  106598. c.urlParams_.Set("alt", alt)
  106599. c.urlParams_.Set("prettyPrint", "false")
  106600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks")
  106601. urls += "?" + c.urlParams_.Encode()
  106602. req, err := http.NewRequest("GET", urls, body)
  106603. if err != nil {
  106604. return nil, err
  106605. }
  106606. req.Header = reqHeaders
  106607. googleapi.Expand(req.URL, map[string]string{
  106608. "project": c.project,
  106609. "region": c.region,
  106610. })
  106611. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106612. }
  106613. // Do executes the "compute.regionHealthChecks.list" call.
  106614. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  106615. // status code is an error. Response headers are in either
  106616. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  106617. // at all) in error.(*googleapi.Error).Header. Use
  106618. // googleapi.IsNotModified to check whether the returned error was
  106619. // because http.StatusNotModified was returned.
  106620. func (c *RegionHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  106621. gensupport.SetOptions(c.urlParams_, opts...)
  106622. res, err := c.doRequest("json")
  106623. if res != nil && res.StatusCode == http.StatusNotModified {
  106624. if res.Body != nil {
  106625. res.Body.Close()
  106626. }
  106627. return nil, &googleapi.Error{
  106628. Code: res.StatusCode,
  106629. Header: res.Header,
  106630. }
  106631. }
  106632. if err != nil {
  106633. return nil, err
  106634. }
  106635. defer googleapi.CloseBody(res)
  106636. if err := googleapi.CheckResponse(res); err != nil {
  106637. return nil, err
  106638. }
  106639. ret := &HealthCheckList{
  106640. ServerResponse: googleapi.ServerResponse{
  106641. Header: res.Header,
  106642. HTTPStatusCode: res.StatusCode,
  106643. },
  106644. }
  106645. target := &ret
  106646. if err := gensupport.DecodeResponse(target, res); err != nil {
  106647. return nil, err
  106648. }
  106649. return ret, nil
  106650. // {
  106651. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  106652. // "httpMethod": "GET",
  106653. // "id": "compute.regionHealthChecks.list",
  106654. // "parameterOrder": [
  106655. // "project",
  106656. // "region"
  106657. // ],
  106658. // "parameters": {
  106659. // "filter": {
  106660. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  106661. // "location": "query",
  106662. // "type": "string"
  106663. // },
  106664. // "maxResults": {
  106665. // "default": "500",
  106666. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  106667. // "format": "uint32",
  106668. // "location": "query",
  106669. // "minimum": "0",
  106670. // "type": "integer"
  106671. // },
  106672. // "orderBy": {
  106673. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  106674. // "location": "query",
  106675. // "type": "string"
  106676. // },
  106677. // "pageToken": {
  106678. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  106679. // "location": "query",
  106680. // "type": "string"
  106681. // },
  106682. // "project": {
  106683. // "description": "Project ID for this request.",
  106684. // "location": "path",
  106685. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106686. // "required": true,
  106687. // "type": "string"
  106688. // },
  106689. // "region": {
  106690. // "description": "Name of the region scoping this request.",
  106691. // "location": "path",
  106692. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106693. // "required": true,
  106694. // "type": "string"
  106695. // }
  106696. // },
  106697. // "path": "{project}/regions/{region}/healthChecks",
  106698. // "response": {
  106699. // "$ref": "HealthCheckList"
  106700. // },
  106701. // "scopes": [
  106702. // "https://www.googleapis.com/auth/cloud-platform",
  106703. // "https://www.googleapis.com/auth/compute",
  106704. // "https://www.googleapis.com/auth/compute.readonly"
  106705. // ]
  106706. // }
  106707. }
  106708. // Pages invokes f for each page of results.
  106709. // A non-nil error returned from f will halt the iteration.
  106710. // The provided context supersedes any context provided to the Context method.
  106711. func (c *RegionHealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  106712. c.ctx_ = ctx
  106713. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  106714. for {
  106715. x, err := c.Do()
  106716. if err != nil {
  106717. return err
  106718. }
  106719. if err := f(x); err != nil {
  106720. return err
  106721. }
  106722. if x.NextPageToken == "" {
  106723. return nil
  106724. }
  106725. c.PageToken(x.NextPageToken)
  106726. }
  106727. }
  106728. // method id "compute.regionHealthChecks.patch":
  106729. type RegionHealthChecksPatchCall struct {
  106730. s *Service
  106731. project string
  106732. region string
  106733. healthCheck string
  106734. healthcheck *HealthCheck
  106735. urlParams_ gensupport.URLParams
  106736. ctx_ context.Context
  106737. header_ http.Header
  106738. }
  106739. // Patch: Updates a HealthCheck resource in the specified project using
  106740. // the data included in the request. This method supports PATCH
  106741. // semantics and uses the JSON merge patch format and processing rules.
  106742. func (r *RegionHealthChecksService) Patch(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksPatchCall {
  106743. c := &RegionHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106744. c.project = project
  106745. c.region = region
  106746. c.healthCheck = healthCheck
  106747. c.healthcheck = healthcheck
  106748. return c
  106749. }
  106750. // RequestId sets the optional parameter "requestId": An optional
  106751. // request ID to identify requests. Specify a unique request ID so that
  106752. // if you must retry your request, the server will know to ignore the
  106753. // request if it has already been completed.
  106754. //
  106755. // For example, consider a situation where you make an initial request
  106756. // and the request times out. If you make the request again with the
  106757. // same request ID, the server can check if original operation with the
  106758. // same request ID was received, and if so, will ignore the second
  106759. // request. This prevents clients from accidentally creating duplicate
  106760. // commitments.
  106761. //
  106762. // The request ID must be a valid UUID with the exception that zero UUID
  106763. // is not supported (00000000-0000-0000-0000-000000000000).
  106764. func (c *RegionHealthChecksPatchCall) RequestId(requestId string) *RegionHealthChecksPatchCall {
  106765. c.urlParams_.Set("requestId", requestId)
  106766. return c
  106767. }
  106768. // Fields allows partial responses to be retrieved. See
  106769. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106770. // for more information.
  106771. func (c *RegionHealthChecksPatchCall) Fields(s ...googleapi.Field) *RegionHealthChecksPatchCall {
  106772. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106773. return c
  106774. }
  106775. // Context sets the context to be used in this call's Do method. Any
  106776. // pending HTTP request will be aborted if the provided context is
  106777. // canceled.
  106778. func (c *RegionHealthChecksPatchCall) Context(ctx context.Context) *RegionHealthChecksPatchCall {
  106779. c.ctx_ = ctx
  106780. return c
  106781. }
  106782. // Header returns an http.Header that can be modified by the caller to
  106783. // add HTTP headers to the request.
  106784. func (c *RegionHealthChecksPatchCall) Header() http.Header {
  106785. if c.header_ == nil {
  106786. c.header_ = make(http.Header)
  106787. }
  106788. return c.header_
  106789. }
  106790. func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  106791. reqHeaders := make(http.Header)
  106792. for k, v := range c.header_ {
  106793. reqHeaders[k] = v
  106794. }
  106795. reqHeaders.Set("User-Agent", c.s.userAgent())
  106796. var body io.Reader = nil
  106797. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  106798. if err != nil {
  106799. return nil, err
  106800. }
  106801. reqHeaders.Set("Content-Type", "application/json")
  106802. c.urlParams_.Set("alt", alt)
  106803. c.urlParams_.Set("prettyPrint", "false")
  106804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  106805. urls += "?" + c.urlParams_.Encode()
  106806. req, err := http.NewRequest("PATCH", urls, body)
  106807. if err != nil {
  106808. return nil, err
  106809. }
  106810. req.Header = reqHeaders
  106811. googleapi.Expand(req.URL, map[string]string{
  106812. "project": c.project,
  106813. "region": c.region,
  106814. "healthCheck": c.healthCheck,
  106815. })
  106816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106817. }
  106818. // Do executes the "compute.regionHealthChecks.patch" call.
  106819. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106820. // status code is an error. Response headers are in either
  106821. // *Operation.ServerResponse.Header or (if a response was returned at
  106822. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106823. // to check whether the returned error was because
  106824. // http.StatusNotModified was returned.
  106825. func (c *RegionHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106826. gensupport.SetOptions(c.urlParams_, opts...)
  106827. res, err := c.doRequest("json")
  106828. if res != nil && res.StatusCode == http.StatusNotModified {
  106829. if res.Body != nil {
  106830. res.Body.Close()
  106831. }
  106832. return nil, &googleapi.Error{
  106833. Code: res.StatusCode,
  106834. Header: res.Header,
  106835. }
  106836. }
  106837. if err != nil {
  106838. return nil, err
  106839. }
  106840. defer googleapi.CloseBody(res)
  106841. if err := googleapi.CheckResponse(res); err != nil {
  106842. return nil, err
  106843. }
  106844. ret := &Operation{
  106845. ServerResponse: googleapi.ServerResponse{
  106846. Header: res.Header,
  106847. HTTPStatusCode: res.StatusCode,
  106848. },
  106849. }
  106850. target := &ret
  106851. if err := gensupport.DecodeResponse(target, res); err != nil {
  106852. return nil, err
  106853. }
  106854. return ret, nil
  106855. // {
  106856. // "description": "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.",
  106857. // "httpMethod": "PATCH",
  106858. // "id": "compute.regionHealthChecks.patch",
  106859. // "parameterOrder": [
  106860. // "project",
  106861. // "region",
  106862. // "healthCheck"
  106863. // ],
  106864. // "parameters": {
  106865. // "healthCheck": {
  106866. // "description": "Name of the HealthCheck resource to patch.",
  106867. // "location": "path",
  106868. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  106869. // "required": true,
  106870. // "type": "string"
  106871. // },
  106872. // "project": {
  106873. // "description": "Project ID for this request.",
  106874. // "location": "path",
  106875. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106876. // "required": true,
  106877. // "type": "string"
  106878. // },
  106879. // "region": {
  106880. // "description": "Name of the region scoping this request.",
  106881. // "location": "path",
  106882. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106883. // "required": true,
  106884. // "type": "string"
  106885. // },
  106886. // "requestId": {
  106887. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106888. // "location": "query",
  106889. // "type": "string"
  106890. // }
  106891. // },
  106892. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  106893. // "request": {
  106894. // "$ref": "HealthCheck"
  106895. // },
  106896. // "response": {
  106897. // "$ref": "Operation"
  106898. // },
  106899. // "scopes": [
  106900. // "https://www.googleapis.com/auth/cloud-platform",
  106901. // "https://www.googleapis.com/auth/compute"
  106902. // ]
  106903. // }
  106904. }
  106905. // method id "compute.regionHealthChecks.testIamPermissions":
  106906. type RegionHealthChecksTestIamPermissionsCall struct {
  106907. s *Service
  106908. project string
  106909. region string
  106910. resource string
  106911. testpermissionsrequest *TestPermissionsRequest
  106912. urlParams_ gensupport.URLParams
  106913. ctx_ context.Context
  106914. header_ http.Header
  106915. }
  106916. // TestIamPermissions: Returns permissions that a caller has on the
  106917. // specified resource.
  106918. func (r *RegionHealthChecksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionHealthChecksTestIamPermissionsCall {
  106919. c := &RegionHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106920. c.project = project
  106921. c.region = region
  106922. c.resource = resource
  106923. c.testpermissionsrequest = testpermissionsrequest
  106924. return c
  106925. }
  106926. // Fields allows partial responses to be retrieved. See
  106927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106928. // for more information.
  106929. func (c *RegionHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionHealthChecksTestIamPermissionsCall {
  106930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106931. return c
  106932. }
  106933. // Context sets the context to be used in this call's Do method. Any
  106934. // pending HTTP request will be aborted if the provided context is
  106935. // canceled.
  106936. func (c *RegionHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *RegionHealthChecksTestIamPermissionsCall {
  106937. c.ctx_ = ctx
  106938. return c
  106939. }
  106940. // Header returns an http.Header that can be modified by the caller to
  106941. // add HTTP headers to the request.
  106942. func (c *RegionHealthChecksTestIamPermissionsCall) Header() http.Header {
  106943. if c.header_ == nil {
  106944. c.header_ = make(http.Header)
  106945. }
  106946. return c.header_
  106947. }
  106948. func (c *RegionHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  106949. reqHeaders := make(http.Header)
  106950. for k, v := range c.header_ {
  106951. reqHeaders[k] = v
  106952. }
  106953. reqHeaders.Set("User-Agent", c.s.userAgent())
  106954. var body io.Reader = nil
  106955. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  106956. if err != nil {
  106957. return nil, err
  106958. }
  106959. reqHeaders.Set("Content-Type", "application/json")
  106960. c.urlParams_.Set("alt", alt)
  106961. c.urlParams_.Set("prettyPrint", "false")
  106962. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{resource}/testIamPermissions")
  106963. urls += "?" + c.urlParams_.Encode()
  106964. req, err := http.NewRequest("POST", urls, body)
  106965. if err != nil {
  106966. return nil, err
  106967. }
  106968. req.Header = reqHeaders
  106969. googleapi.Expand(req.URL, map[string]string{
  106970. "project": c.project,
  106971. "region": c.region,
  106972. "resource": c.resource,
  106973. })
  106974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106975. }
  106976. // Do executes the "compute.regionHealthChecks.testIamPermissions" call.
  106977. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  106978. // non-2xx status code is an error. Response headers are in either
  106979. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  106980. // returned at all) in error.(*googleapi.Error).Header. Use
  106981. // googleapi.IsNotModified to check whether the returned error was
  106982. // because http.StatusNotModified was returned.
  106983. func (c *RegionHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  106984. gensupport.SetOptions(c.urlParams_, opts...)
  106985. res, err := c.doRequest("json")
  106986. if res != nil && res.StatusCode == http.StatusNotModified {
  106987. if res.Body != nil {
  106988. res.Body.Close()
  106989. }
  106990. return nil, &googleapi.Error{
  106991. Code: res.StatusCode,
  106992. Header: res.Header,
  106993. }
  106994. }
  106995. if err != nil {
  106996. return nil, err
  106997. }
  106998. defer googleapi.CloseBody(res)
  106999. if err := googleapi.CheckResponse(res); err != nil {
  107000. return nil, err
  107001. }
  107002. ret := &TestPermissionsResponse{
  107003. ServerResponse: googleapi.ServerResponse{
  107004. Header: res.Header,
  107005. HTTPStatusCode: res.StatusCode,
  107006. },
  107007. }
  107008. target := &ret
  107009. if err := gensupport.DecodeResponse(target, res); err != nil {
  107010. return nil, err
  107011. }
  107012. return ret, nil
  107013. // {
  107014. // "description": "Returns permissions that a caller has on the specified resource.",
  107015. // "httpMethod": "POST",
  107016. // "id": "compute.regionHealthChecks.testIamPermissions",
  107017. // "parameterOrder": [
  107018. // "project",
  107019. // "region",
  107020. // "resource"
  107021. // ],
  107022. // "parameters": {
  107023. // "project": {
  107024. // "description": "Project ID for this request.",
  107025. // "location": "path",
  107026. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107027. // "required": true,
  107028. // "type": "string"
  107029. // },
  107030. // "region": {
  107031. // "description": "The name of the region for this request.",
  107032. // "location": "path",
  107033. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107034. // "required": true,
  107035. // "type": "string"
  107036. // },
  107037. // "resource": {
  107038. // "description": "Name or id of the resource for this request.",
  107039. // "location": "path",
  107040. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  107041. // "required": true,
  107042. // "type": "string"
  107043. // }
  107044. // },
  107045. // "path": "{project}/regions/{region}/healthChecks/{resource}/testIamPermissions",
  107046. // "request": {
  107047. // "$ref": "TestPermissionsRequest"
  107048. // },
  107049. // "response": {
  107050. // "$ref": "TestPermissionsResponse"
  107051. // },
  107052. // "scopes": [
  107053. // "https://www.googleapis.com/auth/cloud-platform",
  107054. // "https://www.googleapis.com/auth/compute",
  107055. // "https://www.googleapis.com/auth/compute.readonly"
  107056. // ]
  107057. // }
  107058. }
  107059. // method id "compute.regionHealthChecks.update":
  107060. type RegionHealthChecksUpdateCall struct {
  107061. s *Service
  107062. project string
  107063. region string
  107064. healthCheck string
  107065. healthcheck *HealthCheck
  107066. urlParams_ gensupport.URLParams
  107067. ctx_ context.Context
  107068. header_ http.Header
  107069. }
  107070. // Update: Updates a HealthCheck resource in the specified project using
  107071. // the data included in the request.
  107072. func (r *RegionHealthChecksService) Update(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksUpdateCall {
  107073. c := &RegionHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107074. c.project = project
  107075. c.region = region
  107076. c.healthCheck = healthCheck
  107077. c.healthcheck = healthcheck
  107078. return c
  107079. }
  107080. // RequestId sets the optional parameter "requestId": An optional
  107081. // request ID to identify requests. Specify a unique request ID so that
  107082. // if you must retry your request, the server will know to ignore the
  107083. // request if it has already been completed.
  107084. //
  107085. // For example, consider a situation where you make an initial request
  107086. // and the request times out. If you make the request again with the
  107087. // same request ID, the server can check if original operation with the
  107088. // same request ID was received, and if so, will ignore the second
  107089. // request. This prevents clients from accidentally creating duplicate
  107090. // commitments.
  107091. //
  107092. // The request ID must be a valid UUID with the exception that zero UUID
  107093. // is not supported (00000000-0000-0000-0000-000000000000).
  107094. func (c *RegionHealthChecksUpdateCall) RequestId(requestId string) *RegionHealthChecksUpdateCall {
  107095. c.urlParams_.Set("requestId", requestId)
  107096. return c
  107097. }
  107098. // Fields allows partial responses to be retrieved. See
  107099. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107100. // for more information.
  107101. func (c *RegionHealthChecksUpdateCall) Fields(s ...googleapi.Field) *RegionHealthChecksUpdateCall {
  107102. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107103. return c
  107104. }
  107105. // Context sets the context to be used in this call's Do method. Any
  107106. // pending HTTP request will be aborted if the provided context is
  107107. // canceled.
  107108. func (c *RegionHealthChecksUpdateCall) Context(ctx context.Context) *RegionHealthChecksUpdateCall {
  107109. c.ctx_ = ctx
  107110. return c
  107111. }
  107112. // Header returns an http.Header that can be modified by the caller to
  107113. // add HTTP headers to the request.
  107114. func (c *RegionHealthChecksUpdateCall) Header() http.Header {
  107115. if c.header_ == nil {
  107116. c.header_ = make(http.Header)
  107117. }
  107118. return c.header_
  107119. }
  107120. func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  107121. reqHeaders := make(http.Header)
  107122. for k, v := range c.header_ {
  107123. reqHeaders[k] = v
  107124. }
  107125. reqHeaders.Set("User-Agent", c.s.userAgent())
  107126. var body io.Reader = nil
  107127. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  107128. if err != nil {
  107129. return nil, err
  107130. }
  107131. reqHeaders.Set("Content-Type", "application/json")
  107132. c.urlParams_.Set("alt", alt)
  107133. c.urlParams_.Set("prettyPrint", "false")
  107134. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  107135. urls += "?" + c.urlParams_.Encode()
  107136. req, err := http.NewRequest("PUT", urls, body)
  107137. if err != nil {
  107138. return nil, err
  107139. }
  107140. req.Header = reqHeaders
  107141. googleapi.Expand(req.URL, map[string]string{
  107142. "project": c.project,
  107143. "region": c.region,
  107144. "healthCheck": c.healthCheck,
  107145. })
  107146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107147. }
  107148. // Do executes the "compute.regionHealthChecks.update" call.
  107149. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107150. // status code is an error. Response headers are in either
  107151. // *Operation.ServerResponse.Header or (if a response was returned at
  107152. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107153. // to check whether the returned error was because
  107154. // http.StatusNotModified was returned.
  107155. func (c *RegionHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107156. gensupport.SetOptions(c.urlParams_, opts...)
  107157. res, err := c.doRequest("json")
  107158. if res != nil && res.StatusCode == http.StatusNotModified {
  107159. if res.Body != nil {
  107160. res.Body.Close()
  107161. }
  107162. return nil, &googleapi.Error{
  107163. Code: res.StatusCode,
  107164. Header: res.Header,
  107165. }
  107166. }
  107167. if err != nil {
  107168. return nil, err
  107169. }
  107170. defer googleapi.CloseBody(res)
  107171. if err := googleapi.CheckResponse(res); err != nil {
  107172. return nil, err
  107173. }
  107174. ret := &Operation{
  107175. ServerResponse: googleapi.ServerResponse{
  107176. Header: res.Header,
  107177. HTTPStatusCode: res.StatusCode,
  107178. },
  107179. }
  107180. target := &ret
  107181. if err := gensupport.DecodeResponse(target, res); err != nil {
  107182. return nil, err
  107183. }
  107184. return ret, nil
  107185. // {
  107186. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  107187. // "httpMethod": "PUT",
  107188. // "id": "compute.regionHealthChecks.update",
  107189. // "parameterOrder": [
  107190. // "project",
  107191. // "region",
  107192. // "healthCheck"
  107193. // ],
  107194. // "parameters": {
  107195. // "healthCheck": {
  107196. // "description": "Name of the HealthCheck resource to update.",
  107197. // "location": "path",
  107198. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  107199. // "required": true,
  107200. // "type": "string"
  107201. // },
  107202. // "project": {
  107203. // "description": "Project ID for this request.",
  107204. // "location": "path",
  107205. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107206. // "required": true,
  107207. // "type": "string"
  107208. // },
  107209. // "region": {
  107210. // "description": "Name of the region scoping this request.",
  107211. // "location": "path",
  107212. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107213. // "required": true,
  107214. // "type": "string"
  107215. // },
  107216. // "requestId": {
  107217. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107218. // "location": "query",
  107219. // "type": "string"
  107220. // }
  107221. // },
  107222. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  107223. // "request": {
  107224. // "$ref": "HealthCheck"
  107225. // },
  107226. // "response": {
  107227. // "$ref": "Operation"
  107228. // },
  107229. // "scopes": [
  107230. // "https://www.googleapis.com/auth/cloud-platform",
  107231. // "https://www.googleapis.com/auth/compute"
  107232. // ]
  107233. // }
  107234. }
  107235. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  107236. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  107237. s *Service
  107238. project string
  107239. region string
  107240. instanceGroupManager string
  107241. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  107242. urlParams_ gensupport.URLParams
  107243. ctx_ context.Context
  107244. header_ http.Header
  107245. }
  107246. // AbandonInstances: Flags the specified instances to be immediately
  107247. // removed from the managed instance group. Abandoning an instance does
  107248. // not delete the instance, but it does remove the instance from any
  107249. // target pools that are applied by the managed instance group. This
  107250. // method reduces the targetSize of the managed instance group by the
  107251. // number of instances that you abandon. This operation is marked as
  107252. // DONE when the action is scheduled even if the instances have not yet
  107253. // been removed from the group. You must separately verify the status of
  107254. // the abandoning action with the listmanagedinstances method.
  107255. //
  107256. // If the group is part of a backend service that has enabled connection
  107257. // draining, it can take up to 60 seconds after the connection draining
  107258. // duration has elapsed before the VM instance is removed or
  107259. // deleted.
  107260. //
  107261. // You can specify a maximum of 1000 instances with this method per
  107262. // request.
  107263. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  107264. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107265. c.project = project
  107266. c.region = region
  107267. c.instanceGroupManager = instanceGroupManager
  107268. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  107269. return c
  107270. }
  107271. // RequestId sets the optional parameter "requestId": An optional
  107272. // request ID to identify requests. Specify a unique request ID so that
  107273. // if you must retry your request, the server will know to ignore the
  107274. // request if it has already been completed.
  107275. //
  107276. // For example, consider a situation where you make an initial request
  107277. // and the request times out. If you make the request again with the
  107278. // same request ID, the server can check if original operation with the
  107279. // same request ID was received, and if so, will ignore the second
  107280. // request. This prevents clients from accidentally creating duplicate
  107281. // commitments.
  107282. //
  107283. // The request ID must be a valid UUID with the exception that zero UUID
  107284. // is not supported (00000000-0000-0000-0000-000000000000).
  107285. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  107286. c.urlParams_.Set("requestId", requestId)
  107287. return c
  107288. }
  107289. // Fields allows partial responses to be retrieved. See
  107290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107291. // for more information.
  107292. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  107293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107294. return c
  107295. }
  107296. // Context sets the context to be used in this call's Do method. Any
  107297. // pending HTTP request will be aborted if the provided context is
  107298. // canceled.
  107299. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  107300. c.ctx_ = ctx
  107301. return c
  107302. }
  107303. // Header returns an http.Header that can be modified by the caller to
  107304. // add HTTP headers to the request.
  107305. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  107306. if c.header_ == nil {
  107307. c.header_ = make(http.Header)
  107308. }
  107309. return c.header_
  107310. }
  107311. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  107312. reqHeaders := make(http.Header)
  107313. for k, v := range c.header_ {
  107314. reqHeaders[k] = v
  107315. }
  107316. reqHeaders.Set("User-Agent", c.s.userAgent())
  107317. var body io.Reader = nil
  107318. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  107319. if err != nil {
  107320. return nil, err
  107321. }
  107322. reqHeaders.Set("Content-Type", "application/json")
  107323. c.urlParams_.Set("alt", alt)
  107324. c.urlParams_.Set("prettyPrint", "false")
  107325. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  107326. urls += "?" + c.urlParams_.Encode()
  107327. req, err := http.NewRequest("POST", urls, body)
  107328. if err != nil {
  107329. return nil, err
  107330. }
  107331. req.Header = reqHeaders
  107332. googleapi.Expand(req.URL, map[string]string{
  107333. "project": c.project,
  107334. "region": c.region,
  107335. "instanceGroupManager": c.instanceGroupManager,
  107336. })
  107337. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107338. }
  107339. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  107340. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107341. // status code is an error. Response headers are in either
  107342. // *Operation.ServerResponse.Header or (if a response was returned at
  107343. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107344. // to check whether the returned error was because
  107345. // http.StatusNotModified was returned.
  107346. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107347. gensupport.SetOptions(c.urlParams_, opts...)
  107348. res, err := c.doRequest("json")
  107349. if res != nil && res.StatusCode == http.StatusNotModified {
  107350. if res.Body != nil {
  107351. res.Body.Close()
  107352. }
  107353. return nil, &googleapi.Error{
  107354. Code: res.StatusCode,
  107355. Header: res.Header,
  107356. }
  107357. }
  107358. if err != nil {
  107359. return nil, err
  107360. }
  107361. defer googleapi.CloseBody(res)
  107362. if err := googleapi.CheckResponse(res); err != nil {
  107363. return nil, err
  107364. }
  107365. ret := &Operation{
  107366. ServerResponse: googleapi.ServerResponse{
  107367. Header: res.Header,
  107368. HTTPStatusCode: res.StatusCode,
  107369. },
  107370. }
  107371. target := &ret
  107372. if err := gensupport.DecodeResponse(target, res); err != nil {
  107373. return nil, err
  107374. }
  107375. return ret, nil
  107376. // {
  107377. // "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.",
  107378. // "httpMethod": "POST",
  107379. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  107380. // "parameterOrder": [
  107381. // "project",
  107382. // "region",
  107383. // "instanceGroupManager"
  107384. // ],
  107385. // "parameters": {
  107386. // "instanceGroupManager": {
  107387. // "description": "Name of the managed instance group.",
  107388. // "location": "path",
  107389. // "required": true,
  107390. // "type": "string"
  107391. // },
  107392. // "project": {
  107393. // "description": "Project ID for this request.",
  107394. // "location": "path",
  107395. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107396. // "required": true,
  107397. // "type": "string"
  107398. // },
  107399. // "region": {
  107400. // "description": "Name of the region scoping this request.",
  107401. // "location": "path",
  107402. // "required": true,
  107403. // "type": "string"
  107404. // },
  107405. // "requestId": {
  107406. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107407. // "location": "query",
  107408. // "type": "string"
  107409. // }
  107410. // },
  107411. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  107412. // "request": {
  107413. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  107414. // },
  107415. // "response": {
  107416. // "$ref": "Operation"
  107417. // },
  107418. // "scopes": [
  107419. // "https://www.googleapis.com/auth/cloud-platform",
  107420. // "https://www.googleapis.com/auth/compute"
  107421. // ]
  107422. // }
  107423. }
  107424. // method id "compute.regionInstanceGroupManagers.applyUpdatesToInstances":
  107425. type RegionInstanceGroupManagersApplyUpdatesToInstancesCall struct {
  107426. s *Service
  107427. project string
  107428. region string
  107429. instanceGroupManager string
  107430. regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest
  107431. urlParams_ gensupport.URLParams
  107432. ctx_ context.Context
  107433. header_ http.Header
  107434. }
  107435. // ApplyUpdatesToInstances: Apply updates to selected instances the
  107436. // managed instance group.
  107437. func (r *RegionInstanceGroupManagersService) ApplyUpdatesToInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  107438. c := &RegionInstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107439. c.project = project
  107440. c.region = region
  107441. c.instanceGroupManager = instanceGroupManager
  107442. c.regioninstancegroupmanagersapplyupdatesrequest = regioninstancegroupmanagersapplyupdatesrequest
  107443. return c
  107444. }
  107445. // Fields allows partial responses to be retrieved. See
  107446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107447. // for more information.
  107448. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  107449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107450. return c
  107451. }
  107452. // Context sets the context to be used in this call's Do method. Any
  107453. // pending HTTP request will be aborted if the provided context is
  107454. // canceled.
  107455. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  107456. c.ctx_ = ctx
  107457. return c
  107458. }
  107459. // Header returns an http.Header that can be modified by the caller to
  107460. // add HTTP headers to the request.
  107461. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header {
  107462. if c.header_ == nil {
  107463. c.header_ = make(http.Header)
  107464. }
  107465. return c.header_
  107466. }
  107467. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) {
  107468. reqHeaders := make(http.Header)
  107469. for k, v := range c.header_ {
  107470. reqHeaders[k] = v
  107471. }
  107472. reqHeaders.Set("User-Agent", c.s.userAgent())
  107473. var body io.Reader = nil
  107474. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersapplyupdatesrequest)
  107475. if err != nil {
  107476. return nil, err
  107477. }
  107478. reqHeaders.Set("Content-Type", "application/json")
  107479. c.urlParams_.Set("alt", alt)
  107480. c.urlParams_.Set("prettyPrint", "false")
  107481. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances")
  107482. urls += "?" + c.urlParams_.Encode()
  107483. req, err := http.NewRequest("POST", urls, body)
  107484. if err != nil {
  107485. return nil, err
  107486. }
  107487. req.Header = reqHeaders
  107488. googleapi.Expand(req.URL, map[string]string{
  107489. "project": c.project,
  107490. "region": c.region,
  107491. "instanceGroupManager": c.instanceGroupManager,
  107492. })
  107493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107494. }
  107495. // Do executes the "compute.regionInstanceGroupManagers.applyUpdatesToInstances" call.
  107496. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107497. // status code is an error. Response headers are in either
  107498. // *Operation.ServerResponse.Header or (if a response was returned at
  107499. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107500. // to check whether the returned error was because
  107501. // http.StatusNotModified was returned.
  107502. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107503. gensupport.SetOptions(c.urlParams_, opts...)
  107504. res, err := c.doRequest("json")
  107505. if res != nil && res.StatusCode == http.StatusNotModified {
  107506. if res.Body != nil {
  107507. res.Body.Close()
  107508. }
  107509. return nil, &googleapi.Error{
  107510. Code: res.StatusCode,
  107511. Header: res.Header,
  107512. }
  107513. }
  107514. if err != nil {
  107515. return nil, err
  107516. }
  107517. defer googleapi.CloseBody(res)
  107518. if err := googleapi.CheckResponse(res); err != nil {
  107519. return nil, err
  107520. }
  107521. ret := &Operation{
  107522. ServerResponse: googleapi.ServerResponse{
  107523. Header: res.Header,
  107524. HTTPStatusCode: res.StatusCode,
  107525. },
  107526. }
  107527. target := &ret
  107528. if err := gensupport.DecodeResponse(target, res); err != nil {
  107529. return nil, err
  107530. }
  107531. return ret, nil
  107532. // {
  107533. // "description": "Apply updates to selected instances the managed instance group.",
  107534. // "httpMethod": "POST",
  107535. // "id": "compute.regionInstanceGroupManagers.applyUpdatesToInstances",
  107536. // "parameterOrder": [
  107537. // "project",
  107538. // "region",
  107539. // "instanceGroupManager"
  107540. // ],
  107541. // "parameters": {
  107542. // "instanceGroupManager": {
  107543. // "description": "The name of the managed instance group, should conform to RFC1035.",
  107544. // "location": "path",
  107545. // "required": true,
  107546. // "type": "string"
  107547. // },
  107548. // "project": {
  107549. // "description": "Project ID for this request.",
  107550. // "location": "path",
  107551. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107552. // "required": true,
  107553. // "type": "string"
  107554. // },
  107555. // "region": {
  107556. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  107557. // "location": "path",
  107558. // "required": true,
  107559. // "type": "string"
  107560. // }
  107561. // },
  107562. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
  107563. // "request": {
  107564. // "$ref": "RegionInstanceGroupManagersApplyUpdatesRequest"
  107565. // },
  107566. // "response": {
  107567. // "$ref": "Operation"
  107568. // },
  107569. // "scopes": [
  107570. // "https://www.googleapis.com/auth/cloud-platform",
  107571. // "https://www.googleapis.com/auth/compute"
  107572. // ]
  107573. // }
  107574. }
  107575. // method id "compute.regionInstanceGroupManagers.createInstances":
  107576. type RegionInstanceGroupManagersCreateInstancesCall struct {
  107577. s *Service
  107578. project string
  107579. region string
  107580. instanceGroupManager string
  107581. regioninstancegroupmanagerscreateinstancesrequest *RegionInstanceGroupManagersCreateInstancesRequest
  107582. urlParams_ gensupport.URLParams
  107583. ctx_ context.Context
  107584. header_ http.Header
  107585. }
  107586. // CreateInstances: Creates instances with per-instance configs in this
  107587. // regional managed instance group. Instances are created using the
  107588. // current instance template. The create instances operation is marked
  107589. // DONE if the createInstances request is successful. The underlying
  107590. // actions take additional time. You must separately verify the status
  107591. // of the creating or actions with the listmanagedinstances method.
  107592. func (r *RegionInstanceGroupManagersService) CreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagerscreateinstancesrequest *RegionInstanceGroupManagersCreateInstancesRequest) *RegionInstanceGroupManagersCreateInstancesCall {
  107593. c := &RegionInstanceGroupManagersCreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107594. c.project = project
  107595. c.region = region
  107596. c.instanceGroupManager = instanceGroupManager
  107597. c.regioninstancegroupmanagerscreateinstancesrequest = regioninstancegroupmanagerscreateinstancesrequest
  107598. return c
  107599. }
  107600. // RequestId sets the optional parameter "requestId": An optional
  107601. // request ID to identify requests. Specify a unique request ID so that
  107602. // if you must retry your request, the server will know to ignore the
  107603. // request if it has already been completed.
  107604. //
  107605. // For example, consider a situation where you make an initial request
  107606. // and the request times out. If you make the request again with the
  107607. // same request ID, the server can check if original operation with the
  107608. // same request ID was received, and if so, will ignore the second
  107609. // request.
  107610. //
  107611. // The request ID must be a valid UUID with the exception that zero UUID
  107612. // is not supported (00000000-0000-0000-0000-000000000000).
  107613. func (c *RegionInstanceGroupManagersCreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersCreateInstancesCall {
  107614. c.urlParams_.Set("requestId", requestId)
  107615. return c
  107616. }
  107617. // Fields allows partial responses to be retrieved. See
  107618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107619. // for more information.
  107620. func (c *RegionInstanceGroupManagersCreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersCreateInstancesCall {
  107621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107622. return c
  107623. }
  107624. // Context sets the context to be used in this call's Do method. Any
  107625. // pending HTTP request will be aborted if the provided context is
  107626. // canceled.
  107627. func (c *RegionInstanceGroupManagersCreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersCreateInstancesCall {
  107628. c.ctx_ = ctx
  107629. return c
  107630. }
  107631. // Header returns an http.Header that can be modified by the caller to
  107632. // add HTTP headers to the request.
  107633. func (c *RegionInstanceGroupManagersCreateInstancesCall) Header() http.Header {
  107634. if c.header_ == nil {
  107635. c.header_ = make(http.Header)
  107636. }
  107637. return c.header_
  107638. }
  107639. func (c *RegionInstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  107640. reqHeaders := make(http.Header)
  107641. for k, v := range c.header_ {
  107642. reqHeaders[k] = v
  107643. }
  107644. reqHeaders.Set("User-Agent", c.s.userAgent())
  107645. var body io.Reader = nil
  107646. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerscreateinstancesrequest)
  107647. if err != nil {
  107648. return nil, err
  107649. }
  107650. reqHeaders.Set("Content-Type", "application/json")
  107651. c.urlParams_.Set("alt", alt)
  107652. c.urlParams_.Set("prettyPrint", "false")
  107653. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/createInstances")
  107654. urls += "?" + c.urlParams_.Encode()
  107655. req, err := http.NewRequest("POST", urls, body)
  107656. if err != nil {
  107657. return nil, err
  107658. }
  107659. req.Header = reqHeaders
  107660. googleapi.Expand(req.URL, map[string]string{
  107661. "project": c.project,
  107662. "region": c.region,
  107663. "instanceGroupManager": c.instanceGroupManager,
  107664. })
  107665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107666. }
  107667. // Do executes the "compute.regionInstanceGroupManagers.createInstances" call.
  107668. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107669. // status code is an error. Response headers are in either
  107670. // *Operation.ServerResponse.Header or (if a response was returned at
  107671. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107672. // to check whether the returned error was because
  107673. // http.StatusNotModified was returned.
  107674. func (c *RegionInstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107675. gensupport.SetOptions(c.urlParams_, opts...)
  107676. res, err := c.doRequest("json")
  107677. if res != nil && res.StatusCode == http.StatusNotModified {
  107678. if res.Body != nil {
  107679. res.Body.Close()
  107680. }
  107681. return nil, &googleapi.Error{
  107682. Code: res.StatusCode,
  107683. Header: res.Header,
  107684. }
  107685. }
  107686. if err != nil {
  107687. return nil, err
  107688. }
  107689. defer googleapi.CloseBody(res)
  107690. if err := googleapi.CheckResponse(res); err != nil {
  107691. return nil, err
  107692. }
  107693. ret := &Operation{
  107694. ServerResponse: googleapi.ServerResponse{
  107695. Header: res.Header,
  107696. HTTPStatusCode: res.StatusCode,
  107697. },
  107698. }
  107699. target := &ret
  107700. if err := gensupport.DecodeResponse(target, res); err != nil {
  107701. return nil, err
  107702. }
  107703. return ret, nil
  107704. // {
  107705. // "description": "Creates instances with per-instance configs in this regional 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.",
  107706. // "httpMethod": "POST",
  107707. // "id": "compute.regionInstanceGroupManagers.createInstances",
  107708. // "parameterOrder": [
  107709. // "project",
  107710. // "region",
  107711. // "instanceGroupManager"
  107712. // ],
  107713. // "parameters": {
  107714. // "instanceGroupManager": {
  107715. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  107716. // "location": "path",
  107717. // "required": true,
  107718. // "type": "string"
  107719. // },
  107720. // "project": {
  107721. // "description": "Project ID for this request.",
  107722. // "location": "path",
  107723. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107724. // "required": true,
  107725. // "type": "string"
  107726. // },
  107727. // "region": {
  107728. // "description": "The name of the region where the managed instance group is located. It should conform to RFC1035.",
  107729. // "location": "path",
  107730. // "required": true,
  107731. // "type": "string"
  107732. // },
  107733. // "requestId": {
  107734. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same 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).",
  107735. // "location": "query",
  107736. // "type": "string"
  107737. // }
  107738. // },
  107739. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/createInstances",
  107740. // "request": {
  107741. // "$ref": "RegionInstanceGroupManagersCreateInstancesRequest"
  107742. // },
  107743. // "response": {
  107744. // "$ref": "Operation"
  107745. // },
  107746. // "scopes": [
  107747. // "https://www.googleapis.com/auth/cloud-platform",
  107748. // "https://www.googleapis.com/auth/compute"
  107749. // ]
  107750. // }
  107751. }
  107752. // method id "compute.regionInstanceGroupManagers.delete":
  107753. type RegionInstanceGroupManagersDeleteCall struct {
  107754. s *Service
  107755. project string
  107756. region string
  107757. instanceGroupManager string
  107758. urlParams_ gensupport.URLParams
  107759. ctx_ context.Context
  107760. header_ http.Header
  107761. }
  107762. // Delete: Deletes the specified managed instance group and all of the
  107763. // instances in that group.
  107764. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  107765. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107766. c.project = project
  107767. c.region = region
  107768. c.instanceGroupManager = instanceGroupManager
  107769. return c
  107770. }
  107771. // RequestId sets the optional parameter "requestId": An optional
  107772. // request ID to identify requests. Specify a unique request ID so that
  107773. // if you must retry your request, the server will know to ignore the
  107774. // request if it has already been completed.
  107775. //
  107776. // For example, consider a situation where you make an initial request
  107777. // and the request times out. If you make the request again with the
  107778. // same request ID, the server can check if original operation with the
  107779. // same request ID was received, and if so, will ignore the second
  107780. // request. This prevents clients from accidentally creating duplicate
  107781. // commitments.
  107782. //
  107783. // The request ID must be a valid UUID with the exception that zero UUID
  107784. // is not supported (00000000-0000-0000-0000-000000000000).
  107785. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  107786. c.urlParams_.Set("requestId", requestId)
  107787. return c
  107788. }
  107789. // Fields allows partial responses to be retrieved. See
  107790. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107791. // for more information.
  107792. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  107793. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107794. return c
  107795. }
  107796. // Context sets the context to be used in this call's Do method. Any
  107797. // pending HTTP request will be aborted if the provided context is
  107798. // canceled.
  107799. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  107800. c.ctx_ = ctx
  107801. return c
  107802. }
  107803. // Header returns an http.Header that can be modified by the caller to
  107804. // add HTTP headers to the request.
  107805. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  107806. if c.header_ == nil {
  107807. c.header_ = make(http.Header)
  107808. }
  107809. return c.header_
  107810. }
  107811. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  107812. reqHeaders := make(http.Header)
  107813. for k, v := range c.header_ {
  107814. reqHeaders[k] = v
  107815. }
  107816. reqHeaders.Set("User-Agent", c.s.userAgent())
  107817. var body io.Reader = nil
  107818. c.urlParams_.Set("alt", alt)
  107819. c.urlParams_.Set("prettyPrint", "false")
  107820. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  107821. urls += "?" + c.urlParams_.Encode()
  107822. req, err := http.NewRequest("DELETE", urls, body)
  107823. if err != nil {
  107824. return nil, err
  107825. }
  107826. req.Header = reqHeaders
  107827. googleapi.Expand(req.URL, map[string]string{
  107828. "project": c.project,
  107829. "region": c.region,
  107830. "instanceGroupManager": c.instanceGroupManager,
  107831. })
  107832. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107833. }
  107834. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  107835. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107836. // status code is an error. Response headers are in either
  107837. // *Operation.ServerResponse.Header or (if a response was returned at
  107838. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107839. // to check whether the returned error was because
  107840. // http.StatusNotModified was returned.
  107841. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107842. gensupport.SetOptions(c.urlParams_, opts...)
  107843. res, err := c.doRequest("json")
  107844. if res != nil && res.StatusCode == http.StatusNotModified {
  107845. if res.Body != nil {
  107846. res.Body.Close()
  107847. }
  107848. return nil, &googleapi.Error{
  107849. Code: res.StatusCode,
  107850. Header: res.Header,
  107851. }
  107852. }
  107853. if err != nil {
  107854. return nil, err
  107855. }
  107856. defer googleapi.CloseBody(res)
  107857. if err := googleapi.CheckResponse(res); err != nil {
  107858. return nil, err
  107859. }
  107860. ret := &Operation{
  107861. ServerResponse: googleapi.ServerResponse{
  107862. Header: res.Header,
  107863. HTTPStatusCode: res.StatusCode,
  107864. },
  107865. }
  107866. target := &ret
  107867. if err := gensupport.DecodeResponse(target, res); err != nil {
  107868. return nil, err
  107869. }
  107870. return ret, nil
  107871. // {
  107872. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  107873. // "httpMethod": "DELETE",
  107874. // "id": "compute.regionInstanceGroupManagers.delete",
  107875. // "parameterOrder": [
  107876. // "project",
  107877. // "region",
  107878. // "instanceGroupManager"
  107879. // ],
  107880. // "parameters": {
  107881. // "instanceGroupManager": {
  107882. // "description": "Name of the managed instance group to delete.",
  107883. // "location": "path",
  107884. // "required": true,
  107885. // "type": "string"
  107886. // },
  107887. // "project": {
  107888. // "description": "Project ID for this request.",
  107889. // "location": "path",
  107890. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107891. // "required": true,
  107892. // "type": "string"
  107893. // },
  107894. // "region": {
  107895. // "description": "Name of the region scoping this request.",
  107896. // "location": "path",
  107897. // "required": true,
  107898. // "type": "string"
  107899. // },
  107900. // "requestId": {
  107901. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107902. // "location": "query",
  107903. // "type": "string"
  107904. // }
  107905. // },
  107906. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  107907. // "response": {
  107908. // "$ref": "Operation"
  107909. // },
  107910. // "scopes": [
  107911. // "https://www.googleapis.com/auth/cloud-platform",
  107912. // "https://www.googleapis.com/auth/compute"
  107913. // ]
  107914. // }
  107915. }
  107916. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  107917. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  107918. s *Service
  107919. project string
  107920. region string
  107921. instanceGroupManager string
  107922. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  107923. urlParams_ gensupport.URLParams
  107924. ctx_ context.Context
  107925. header_ http.Header
  107926. }
  107927. // DeleteInstances: Flags the specified instances in the managed
  107928. // instance group to be immediately deleted. The instances are also
  107929. // removed from any target pools of which they were a member. This
  107930. // method reduces the targetSize of the managed instance group by the
  107931. // number of instances that you delete. The deleteInstances operation is
  107932. // marked DONE if the deleteInstances request is successful. The
  107933. // underlying actions take additional time. You must separately verify
  107934. // the status of the deleting action with the listmanagedinstances
  107935. // method.
  107936. //
  107937. // If the group is part of a backend service that has enabled connection
  107938. // draining, it can take up to 60 seconds after the connection draining
  107939. // duration has elapsed before the VM instance is removed or
  107940. // deleted.
  107941. //
  107942. // You can specify a maximum of 1000 instances with this method per
  107943. // request.
  107944. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  107945. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107946. c.project = project
  107947. c.region = region
  107948. c.instanceGroupManager = instanceGroupManager
  107949. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  107950. return c
  107951. }
  107952. // RequestId sets the optional parameter "requestId": An optional
  107953. // request ID to identify requests. Specify a unique request ID so that
  107954. // if you must retry your request, the server will know to ignore the
  107955. // request if it has already been completed.
  107956. //
  107957. // For example, consider a situation where you make an initial request
  107958. // and the request times out. If you make the request again with the
  107959. // same request ID, the server can check if original operation with the
  107960. // same request ID was received, and if so, will ignore the second
  107961. // request. This prevents clients from accidentally creating duplicate
  107962. // commitments.
  107963. //
  107964. // The request ID must be a valid UUID with the exception that zero UUID
  107965. // is not supported (00000000-0000-0000-0000-000000000000).
  107966. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  107967. c.urlParams_.Set("requestId", requestId)
  107968. return c
  107969. }
  107970. // Fields allows partial responses to be retrieved. See
  107971. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107972. // for more information.
  107973. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  107974. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107975. return c
  107976. }
  107977. // Context sets the context to be used in this call's Do method. Any
  107978. // pending HTTP request will be aborted if the provided context is
  107979. // canceled.
  107980. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  107981. c.ctx_ = ctx
  107982. return c
  107983. }
  107984. // Header returns an http.Header that can be modified by the caller to
  107985. // add HTTP headers to the request.
  107986. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  107987. if c.header_ == nil {
  107988. c.header_ = make(http.Header)
  107989. }
  107990. return c.header_
  107991. }
  107992. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  107993. reqHeaders := make(http.Header)
  107994. for k, v := range c.header_ {
  107995. reqHeaders[k] = v
  107996. }
  107997. reqHeaders.Set("User-Agent", c.s.userAgent())
  107998. var body io.Reader = nil
  107999. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  108000. if err != nil {
  108001. return nil, err
  108002. }
  108003. reqHeaders.Set("Content-Type", "application/json")
  108004. c.urlParams_.Set("alt", alt)
  108005. c.urlParams_.Set("prettyPrint", "false")
  108006. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  108007. urls += "?" + c.urlParams_.Encode()
  108008. req, err := http.NewRequest("POST", urls, body)
  108009. if err != nil {
  108010. return nil, err
  108011. }
  108012. req.Header = reqHeaders
  108013. googleapi.Expand(req.URL, map[string]string{
  108014. "project": c.project,
  108015. "region": c.region,
  108016. "instanceGroupManager": c.instanceGroupManager,
  108017. })
  108018. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108019. }
  108020. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  108021. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108022. // status code is an error. Response headers are in either
  108023. // *Operation.ServerResponse.Header or (if a response was returned at
  108024. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108025. // to check whether the returned error was because
  108026. // http.StatusNotModified was returned.
  108027. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108028. gensupport.SetOptions(c.urlParams_, opts...)
  108029. res, err := c.doRequest("json")
  108030. if res != nil && res.StatusCode == http.StatusNotModified {
  108031. if res.Body != nil {
  108032. res.Body.Close()
  108033. }
  108034. return nil, &googleapi.Error{
  108035. Code: res.StatusCode,
  108036. Header: res.Header,
  108037. }
  108038. }
  108039. if err != nil {
  108040. return nil, err
  108041. }
  108042. defer googleapi.CloseBody(res)
  108043. if err := googleapi.CheckResponse(res); err != nil {
  108044. return nil, err
  108045. }
  108046. ret := &Operation{
  108047. ServerResponse: googleapi.ServerResponse{
  108048. Header: res.Header,
  108049. HTTPStatusCode: res.StatusCode,
  108050. },
  108051. }
  108052. target := &ret
  108053. if err := gensupport.DecodeResponse(target, res); err != nil {
  108054. return nil, err
  108055. }
  108056. return ret, nil
  108057. // {
  108058. // "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.",
  108059. // "httpMethod": "POST",
  108060. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  108061. // "parameterOrder": [
  108062. // "project",
  108063. // "region",
  108064. // "instanceGroupManager"
  108065. // ],
  108066. // "parameters": {
  108067. // "instanceGroupManager": {
  108068. // "description": "Name of the managed instance group.",
  108069. // "location": "path",
  108070. // "required": true,
  108071. // "type": "string"
  108072. // },
  108073. // "project": {
  108074. // "description": "Project ID for this request.",
  108075. // "location": "path",
  108076. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108077. // "required": true,
  108078. // "type": "string"
  108079. // },
  108080. // "region": {
  108081. // "description": "Name of the region scoping this request.",
  108082. // "location": "path",
  108083. // "required": true,
  108084. // "type": "string"
  108085. // },
  108086. // "requestId": {
  108087. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108088. // "location": "query",
  108089. // "type": "string"
  108090. // }
  108091. // },
  108092. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  108093. // "request": {
  108094. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  108095. // },
  108096. // "response": {
  108097. // "$ref": "Operation"
  108098. // },
  108099. // "scopes": [
  108100. // "https://www.googleapis.com/auth/cloud-platform",
  108101. // "https://www.googleapis.com/auth/compute"
  108102. // ]
  108103. // }
  108104. }
  108105. // method id "compute.regionInstanceGroupManagers.deletePerInstanceConfigs":
  108106. type RegionInstanceGroupManagersDeletePerInstanceConfigsCall struct {
  108107. s *Service
  108108. project string
  108109. region string
  108110. instanceGroupManager string
  108111. regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq
  108112. urlParams_ gensupport.URLParams
  108113. ctx_ context.Context
  108114. header_ http.Header
  108115. }
  108116. // DeletePerInstanceConfigs: Deletes selected per-instance configs for
  108117. // the managed instance group.
  108118. func (r *RegionInstanceGroupManagersService) DeletePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  108119. c := &RegionInstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108120. c.project = project
  108121. c.region = region
  108122. c.instanceGroupManager = instanceGroupManager
  108123. c.regioninstancegroupmanagerdeleteinstanceconfigreq = regioninstancegroupmanagerdeleteinstanceconfigreq
  108124. return c
  108125. }
  108126. // Fields allows partial responses to be retrieved. See
  108127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108128. // for more information.
  108129. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  108130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108131. return c
  108132. }
  108133. // Context sets the context to be used in this call's Do method. Any
  108134. // pending HTTP request will be aborted if the provided context is
  108135. // canceled.
  108136. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  108137. c.ctx_ = ctx
  108138. return c
  108139. }
  108140. // Header returns an http.Header that can be modified by the caller to
  108141. // add HTTP headers to the request.
  108142. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header {
  108143. if c.header_ == nil {
  108144. c.header_ = make(http.Header)
  108145. }
  108146. return c.header_
  108147. }
  108148. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  108149. reqHeaders := make(http.Header)
  108150. for k, v := range c.header_ {
  108151. reqHeaders[k] = v
  108152. }
  108153. reqHeaders.Set("User-Agent", c.s.userAgent())
  108154. var body io.Reader = nil
  108155. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerdeleteinstanceconfigreq)
  108156. if err != nil {
  108157. return nil, err
  108158. }
  108159. reqHeaders.Set("Content-Type", "application/json")
  108160. c.urlParams_.Set("alt", alt)
  108161. c.urlParams_.Set("prettyPrint", "false")
  108162. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs")
  108163. urls += "?" + c.urlParams_.Encode()
  108164. req, err := http.NewRequest("POST", urls, body)
  108165. if err != nil {
  108166. return nil, err
  108167. }
  108168. req.Header = reqHeaders
  108169. googleapi.Expand(req.URL, map[string]string{
  108170. "project": c.project,
  108171. "region": c.region,
  108172. "instanceGroupManager": c.instanceGroupManager,
  108173. })
  108174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108175. }
  108176. // Do executes the "compute.regionInstanceGroupManagers.deletePerInstanceConfigs" call.
  108177. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108178. // status code is an error. Response headers are in either
  108179. // *Operation.ServerResponse.Header or (if a response was returned at
  108180. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108181. // to check whether the returned error was because
  108182. // http.StatusNotModified was returned.
  108183. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108184. gensupport.SetOptions(c.urlParams_, opts...)
  108185. res, err := c.doRequest("json")
  108186. if res != nil && res.StatusCode == http.StatusNotModified {
  108187. if res.Body != nil {
  108188. res.Body.Close()
  108189. }
  108190. return nil, &googleapi.Error{
  108191. Code: res.StatusCode,
  108192. Header: res.Header,
  108193. }
  108194. }
  108195. if err != nil {
  108196. return nil, err
  108197. }
  108198. defer googleapi.CloseBody(res)
  108199. if err := googleapi.CheckResponse(res); err != nil {
  108200. return nil, err
  108201. }
  108202. ret := &Operation{
  108203. ServerResponse: googleapi.ServerResponse{
  108204. Header: res.Header,
  108205. HTTPStatusCode: res.StatusCode,
  108206. },
  108207. }
  108208. target := &ret
  108209. if err := gensupport.DecodeResponse(target, res); err != nil {
  108210. return nil, err
  108211. }
  108212. return ret, nil
  108213. // {
  108214. // "description": "Deletes selected per-instance configs for the managed instance group.",
  108215. // "httpMethod": "POST",
  108216. // "id": "compute.regionInstanceGroupManagers.deletePerInstanceConfigs",
  108217. // "parameterOrder": [
  108218. // "project",
  108219. // "region",
  108220. // "instanceGroupManager"
  108221. // ],
  108222. // "parameters": {
  108223. // "instanceGroupManager": {
  108224. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  108225. // "location": "path",
  108226. // "required": true,
  108227. // "type": "string"
  108228. // },
  108229. // "project": {
  108230. // "description": "Project ID for this request.",
  108231. // "location": "path",
  108232. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108233. // "required": true,
  108234. // "type": "string"
  108235. // },
  108236. // "region": {
  108237. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  108238. // "location": "path",
  108239. // "required": true,
  108240. // "type": "string"
  108241. // }
  108242. // },
  108243. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
  108244. // "request": {
  108245. // "$ref": "RegionInstanceGroupManagerDeleteInstanceConfigReq"
  108246. // },
  108247. // "response": {
  108248. // "$ref": "Operation"
  108249. // },
  108250. // "scopes": [
  108251. // "https://www.googleapis.com/auth/cloud-platform",
  108252. // "https://www.googleapis.com/auth/compute"
  108253. // ]
  108254. // }
  108255. }
  108256. // method id "compute.regionInstanceGroupManagers.get":
  108257. type RegionInstanceGroupManagersGetCall struct {
  108258. s *Service
  108259. project string
  108260. region string
  108261. instanceGroupManager string
  108262. urlParams_ gensupport.URLParams
  108263. ifNoneMatch_ string
  108264. ctx_ context.Context
  108265. header_ http.Header
  108266. }
  108267. // Get: Returns all of the details about the specified managed instance
  108268. // group.
  108269. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  108270. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108271. c.project = project
  108272. c.region = region
  108273. c.instanceGroupManager = instanceGroupManager
  108274. return c
  108275. }
  108276. // Fields allows partial responses to be retrieved. See
  108277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108278. // for more information.
  108279. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  108280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108281. return c
  108282. }
  108283. // IfNoneMatch sets the optional parameter which makes the operation
  108284. // fail if the object's ETag matches the given value. This is useful for
  108285. // getting updates only after the object has changed since the last
  108286. // request. Use googleapi.IsNotModified to check whether the response
  108287. // error from Do is the result of In-None-Match.
  108288. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  108289. c.ifNoneMatch_ = entityTag
  108290. return c
  108291. }
  108292. // Context sets the context to be used in this call's Do method. Any
  108293. // pending HTTP request will be aborted if the provided context is
  108294. // canceled.
  108295. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  108296. c.ctx_ = ctx
  108297. return c
  108298. }
  108299. // Header returns an http.Header that can be modified by the caller to
  108300. // add HTTP headers to the request.
  108301. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  108302. if c.header_ == nil {
  108303. c.header_ = make(http.Header)
  108304. }
  108305. return c.header_
  108306. }
  108307. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  108308. reqHeaders := make(http.Header)
  108309. for k, v := range c.header_ {
  108310. reqHeaders[k] = v
  108311. }
  108312. reqHeaders.Set("User-Agent", c.s.userAgent())
  108313. if c.ifNoneMatch_ != "" {
  108314. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  108315. }
  108316. var body io.Reader = nil
  108317. c.urlParams_.Set("alt", alt)
  108318. c.urlParams_.Set("prettyPrint", "false")
  108319. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  108320. urls += "?" + c.urlParams_.Encode()
  108321. req, err := http.NewRequest("GET", urls, body)
  108322. if err != nil {
  108323. return nil, err
  108324. }
  108325. req.Header = reqHeaders
  108326. googleapi.Expand(req.URL, map[string]string{
  108327. "project": c.project,
  108328. "region": c.region,
  108329. "instanceGroupManager": c.instanceGroupManager,
  108330. })
  108331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108332. }
  108333. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  108334. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  108335. // non-2xx status code is an error. Response headers are in either
  108336. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  108337. // returned at all) in error.(*googleapi.Error).Header. Use
  108338. // googleapi.IsNotModified to check whether the returned error was
  108339. // because http.StatusNotModified was returned.
  108340. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  108341. gensupport.SetOptions(c.urlParams_, opts...)
  108342. res, err := c.doRequest("json")
  108343. if res != nil && res.StatusCode == http.StatusNotModified {
  108344. if res.Body != nil {
  108345. res.Body.Close()
  108346. }
  108347. return nil, &googleapi.Error{
  108348. Code: res.StatusCode,
  108349. Header: res.Header,
  108350. }
  108351. }
  108352. if err != nil {
  108353. return nil, err
  108354. }
  108355. defer googleapi.CloseBody(res)
  108356. if err := googleapi.CheckResponse(res); err != nil {
  108357. return nil, err
  108358. }
  108359. ret := &InstanceGroupManager{
  108360. ServerResponse: googleapi.ServerResponse{
  108361. Header: res.Header,
  108362. HTTPStatusCode: res.StatusCode,
  108363. },
  108364. }
  108365. target := &ret
  108366. if err := gensupport.DecodeResponse(target, res); err != nil {
  108367. return nil, err
  108368. }
  108369. return ret, nil
  108370. // {
  108371. // "description": "Returns all of the details about the specified managed instance group.",
  108372. // "httpMethod": "GET",
  108373. // "id": "compute.regionInstanceGroupManagers.get",
  108374. // "parameterOrder": [
  108375. // "project",
  108376. // "region",
  108377. // "instanceGroupManager"
  108378. // ],
  108379. // "parameters": {
  108380. // "instanceGroupManager": {
  108381. // "description": "Name of the managed instance group to return.",
  108382. // "location": "path",
  108383. // "required": true,
  108384. // "type": "string"
  108385. // },
  108386. // "project": {
  108387. // "description": "Project ID for this request.",
  108388. // "location": "path",
  108389. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108390. // "required": true,
  108391. // "type": "string"
  108392. // },
  108393. // "region": {
  108394. // "description": "Name of the region scoping this request.",
  108395. // "location": "path",
  108396. // "required": true,
  108397. // "type": "string"
  108398. // }
  108399. // },
  108400. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  108401. // "response": {
  108402. // "$ref": "InstanceGroupManager"
  108403. // },
  108404. // "scopes": [
  108405. // "https://www.googleapis.com/auth/cloud-platform",
  108406. // "https://www.googleapis.com/auth/compute",
  108407. // "https://www.googleapis.com/auth/compute.readonly"
  108408. // ]
  108409. // }
  108410. }
  108411. // method id "compute.regionInstanceGroupManagers.insert":
  108412. type RegionInstanceGroupManagersInsertCall struct {
  108413. s *Service
  108414. project string
  108415. region string
  108416. instancegroupmanager *InstanceGroupManager
  108417. urlParams_ gensupport.URLParams
  108418. ctx_ context.Context
  108419. header_ http.Header
  108420. }
  108421. // Insert: Creates a managed instance group using the information that
  108422. // you specify in the request. After the group is created, instances in
  108423. // the group are created using the specified instance template. This
  108424. // operation is marked as DONE when the group is created even if the
  108425. // instances in the group have not yet been created. You must separately
  108426. // verify the status of the individual instances with the
  108427. // listmanagedinstances method.
  108428. //
  108429. // A regional managed instance group can contain up to 2000 instances.
  108430. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  108431. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108432. c.project = project
  108433. c.region = region
  108434. c.instancegroupmanager = instancegroupmanager
  108435. return c
  108436. }
  108437. // RequestId sets the optional parameter "requestId": An optional
  108438. // request ID to identify requests. Specify a unique request ID so that
  108439. // if you must retry your request, the server will know to ignore the
  108440. // request if it has already been completed.
  108441. //
  108442. // For example, consider a situation where you make an initial request
  108443. // and the request times out. If you make the request again with the
  108444. // same request ID, the server can check if original operation with the
  108445. // same request ID was received, and if so, will ignore the second
  108446. // request. This prevents clients from accidentally creating duplicate
  108447. // commitments.
  108448. //
  108449. // The request ID must be a valid UUID with the exception that zero UUID
  108450. // is not supported (00000000-0000-0000-0000-000000000000).
  108451. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  108452. c.urlParams_.Set("requestId", requestId)
  108453. return c
  108454. }
  108455. // Fields allows partial responses to be retrieved. See
  108456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108457. // for more information.
  108458. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  108459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108460. return c
  108461. }
  108462. // Context sets the context to be used in this call's Do method. Any
  108463. // pending HTTP request will be aborted if the provided context is
  108464. // canceled.
  108465. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  108466. c.ctx_ = ctx
  108467. return c
  108468. }
  108469. // Header returns an http.Header that can be modified by the caller to
  108470. // add HTTP headers to the request.
  108471. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  108472. if c.header_ == nil {
  108473. c.header_ = make(http.Header)
  108474. }
  108475. return c.header_
  108476. }
  108477. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  108478. reqHeaders := make(http.Header)
  108479. for k, v := range c.header_ {
  108480. reqHeaders[k] = v
  108481. }
  108482. reqHeaders.Set("User-Agent", c.s.userAgent())
  108483. var body io.Reader = nil
  108484. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  108485. if err != nil {
  108486. return nil, err
  108487. }
  108488. reqHeaders.Set("Content-Type", "application/json")
  108489. c.urlParams_.Set("alt", alt)
  108490. c.urlParams_.Set("prettyPrint", "false")
  108491. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  108492. urls += "?" + c.urlParams_.Encode()
  108493. req, err := http.NewRequest("POST", urls, body)
  108494. if err != nil {
  108495. return nil, err
  108496. }
  108497. req.Header = reqHeaders
  108498. googleapi.Expand(req.URL, map[string]string{
  108499. "project": c.project,
  108500. "region": c.region,
  108501. })
  108502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108503. }
  108504. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  108505. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108506. // status code is an error. Response headers are in either
  108507. // *Operation.ServerResponse.Header or (if a response was returned at
  108508. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108509. // to check whether the returned error was because
  108510. // http.StatusNotModified was returned.
  108511. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108512. gensupport.SetOptions(c.urlParams_, opts...)
  108513. res, err := c.doRequest("json")
  108514. if res != nil && res.StatusCode == http.StatusNotModified {
  108515. if res.Body != nil {
  108516. res.Body.Close()
  108517. }
  108518. return nil, &googleapi.Error{
  108519. Code: res.StatusCode,
  108520. Header: res.Header,
  108521. }
  108522. }
  108523. if err != nil {
  108524. return nil, err
  108525. }
  108526. defer googleapi.CloseBody(res)
  108527. if err := googleapi.CheckResponse(res); err != nil {
  108528. return nil, err
  108529. }
  108530. ret := &Operation{
  108531. ServerResponse: googleapi.ServerResponse{
  108532. Header: res.Header,
  108533. HTTPStatusCode: res.StatusCode,
  108534. },
  108535. }
  108536. target := &ret
  108537. if err := gensupport.DecodeResponse(target, res); err != nil {
  108538. return nil, err
  108539. }
  108540. return ret, nil
  108541. // {
  108542. // "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.",
  108543. // "httpMethod": "POST",
  108544. // "id": "compute.regionInstanceGroupManagers.insert",
  108545. // "parameterOrder": [
  108546. // "project",
  108547. // "region"
  108548. // ],
  108549. // "parameters": {
  108550. // "project": {
  108551. // "description": "Project ID for this request.",
  108552. // "location": "path",
  108553. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108554. // "required": true,
  108555. // "type": "string"
  108556. // },
  108557. // "region": {
  108558. // "description": "Name of the region scoping this request.",
  108559. // "location": "path",
  108560. // "required": true,
  108561. // "type": "string"
  108562. // },
  108563. // "requestId": {
  108564. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108565. // "location": "query",
  108566. // "type": "string"
  108567. // }
  108568. // },
  108569. // "path": "{project}/regions/{region}/instanceGroupManagers",
  108570. // "request": {
  108571. // "$ref": "InstanceGroupManager"
  108572. // },
  108573. // "response": {
  108574. // "$ref": "Operation"
  108575. // },
  108576. // "scopes": [
  108577. // "https://www.googleapis.com/auth/cloud-platform",
  108578. // "https://www.googleapis.com/auth/compute"
  108579. // ]
  108580. // }
  108581. }
  108582. // method id "compute.regionInstanceGroupManagers.list":
  108583. type RegionInstanceGroupManagersListCall struct {
  108584. s *Service
  108585. project string
  108586. region string
  108587. urlParams_ gensupport.URLParams
  108588. ifNoneMatch_ string
  108589. ctx_ context.Context
  108590. header_ http.Header
  108591. }
  108592. // List: Retrieves the list of managed instance groups that are
  108593. // contained within the specified region.
  108594. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  108595. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108596. c.project = project
  108597. c.region = region
  108598. return c
  108599. }
  108600. // Filter sets the optional parameter "filter": A filter expression that
  108601. // filters resources listed in the response. The expression must specify
  108602. // the field name, a comparison operator, and the value that you want to
  108603. // use for filtering. The value must be a string, a number, or a
  108604. // boolean. The comparison operator must be either =, !=, >, or <.
  108605. //
  108606. // For example, if you are filtering Compute Engine instances, you can
  108607. // exclude instances named example-instance by specifying name !=
  108608. // example-instance.
  108609. //
  108610. // You can also filter nested fields. For example, you could specify
  108611. // scheduling.automaticRestart = false to include instances only if they
  108612. // are not scheduled for automatic restarts. You can use filtering on
  108613. // nested fields to filter based on resource labels.
  108614. //
  108615. // To filter on multiple expressions, provide each separate expression
  108616. // within parentheses. For example, (scheduling.automaticRestart = true)
  108617. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  108618. // AND expression. However, you can include AND and OR expressions
  108619. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  108620. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  108621. // true).
  108622. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  108623. c.urlParams_.Set("filter", filter)
  108624. return c
  108625. }
  108626. // MaxResults sets the optional parameter "maxResults": The maximum
  108627. // number of results per page that should be returned. If the number of
  108628. // available results is larger than maxResults, Compute Engine returns a
  108629. // nextPageToken that can be used to get the next page of results in
  108630. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  108631. // (Default: 500)
  108632. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  108633. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  108634. return c
  108635. }
  108636. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  108637. // a certain order. By default, results are returned in alphanumerical
  108638. // order based on the resource name.
  108639. //
  108640. // You can also sort results in descending order based on the creation
  108641. // timestamp using orderBy="creationTimestamp desc". This sorts results
  108642. // based on the creationTimestamp field in reverse chronological order
  108643. // (newest result first). Use this to sort resources like operations so
  108644. // that the newest operation is returned first.
  108645. //
  108646. // Currently, only sorting by name or creationTimestamp desc is
  108647. // supported.
  108648. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  108649. c.urlParams_.Set("orderBy", orderBy)
  108650. return c
  108651. }
  108652. // PageToken sets the optional parameter "pageToken": Specifies a page
  108653. // token to use. Set pageToken to the nextPageToken returned by a
  108654. // previous list request to get the next page of results.
  108655. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  108656. c.urlParams_.Set("pageToken", pageToken)
  108657. return c
  108658. }
  108659. // Fields allows partial responses to be retrieved. See
  108660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108661. // for more information.
  108662. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  108663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108664. return c
  108665. }
  108666. // IfNoneMatch sets the optional parameter which makes the operation
  108667. // fail if the object's ETag matches the given value. This is useful for
  108668. // getting updates only after the object has changed since the last
  108669. // request. Use googleapi.IsNotModified to check whether the response
  108670. // error from Do is the result of In-None-Match.
  108671. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  108672. c.ifNoneMatch_ = entityTag
  108673. return c
  108674. }
  108675. // Context sets the context to be used in this call's Do method. Any
  108676. // pending HTTP request will be aborted if the provided context is
  108677. // canceled.
  108678. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  108679. c.ctx_ = ctx
  108680. return c
  108681. }
  108682. // Header returns an http.Header that can be modified by the caller to
  108683. // add HTTP headers to the request.
  108684. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  108685. if c.header_ == nil {
  108686. c.header_ = make(http.Header)
  108687. }
  108688. return c.header_
  108689. }
  108690. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  108691. reqHeaders := make(http.Header)
  108692. for k, v := range c.header_ {
  108693. reqHeaders[k] = v
  108694. }
  108695. reqHeaders.Set("User-Agent", c.s.userAgent())
  108696. if c.ifNoneMatch_ != "" {
  108697. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  108698. }
  108699. var body io.Reader = nil
  108700. c.urlParams_.Set("alt", alt)
  108701. c.urlParams_.Set("prettyPrint", "false")
  108702. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  108703. urls += "?" + c.urlParams_.Encode()
  108704. req, err := http.NewRequest("GET", urls, body)
  108705. if err != nil {
  108706. return nil, err
  108707. }
  108708. req.Header = reqHeaders
  108709. googleapi.Expand(req.URL, map[string]string{
  108710. "project": c.project,
  108711. "region": c.region,
  108712. })
  108713. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108714. }
  108715. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  108716. // Exactly one of *RegionInstanceGroupManagerList or error will be
  108717. // non-nil. Any non-2xx status code is an error. Response headers are in
  108718. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  108719. // response was returned at all) in error.(*googleapi.Error).Header. Use
  108720. // googleapi.IsNotModified to check whether the returned error was
  108721. // because http.StatusNotModified was returned.
  108722. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  108723. gensupport.SetOptions(c.urlParams_, opts...)
  108724. res, err := c.doRequest("json")
  108725. if res != nil && res.StatusCode == http.StatusNotModified {
  108726. if res.Body != nil {
  108727. res.Body.Close()
  108728. }
  108729. return nil, &googleapi.Error{
  108730. Code: res.StatusCode,
  108731. Header: res.Header,
  108732. }
  108733. }
  108734. if err != nil {
  108735. return nil, err
  108736. }
  108737. defer googleapi.CloseBody(res)
  108738. if err := googleapi.CheckResponse(res); err != nil {
  108739. return nil, err
  108740. }
  108741. ret := &RegionInstanceGroupManagerList{
  108742. ServerResponse: googleapi.ServerResponse{
  108743. Header: res.Header,
  108744. HTTPStatusCode: res.StatusCode,
  108745. },
  108746. }
  108747. target := &ret
  108748. if err := gensupport.DecodeResponse(target, res); err != nil {
  108749. return nil, err
  108750. }
  108751. return ret, nil
  108752. // {
  108753. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  108754. // "httpMethod": "GET",
  108755. // "id": "compute.regionInstanceGroupManagers.list",
  108756. // "parameterOrder": [
  108757. // "project",
  108758. // "region"
  108759. // ],
  108760. // "parameters": {
  108761. // "filter": {
  108762. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  108763. // "location": "query",
  108764. // "type": "string"
  108765. // },
  108766. // "maxResults": {
  108767. // "default": "500",
  108768. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  108769. // "format": "uint32",
  108770. // "location": "query",
  108771. // "minimum": "0",
  108772. // "type": "integer"
  108773. // },
  108774. // "orderBy": {
  108775. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  108776. // "location": "query",
  108777. // "type": "string"
  108778. // },
  108779. // "pageToken": {
  108780. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  108781. // "location": "query",
  108782. // "type": "string"
  108783. // },
  108784. // "project": {
  108785. // "description": "Project ID for this request.",
  108786. // "location": "path",
  108787. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108788. // "required": true,
  108789. // "type": "string"
  108790. // },
  108791. // "region": {
  108792. // "description": "Name of the region scoping this request.",
  108793. // "location": "path",
  108794. // "required": true,
  108795. // "type": "string"
  108796. // }
  108797. // },
  108798. // "path": "{project}/regions/{region}/instanceGroupManagers",
  108799. // "response": {
  108800. // "$ref": "RegionInstanceGroupManagerList"
  108801. // },
  108802. // "scopes": [
  108803. // "https://www.googleapis.com/auth/cloud-platform",
  108804. // "https://www.googleapis.com/auth/compute",
  108805. // "https://www.googleapis.com/auth/compute.readonly"
  108806. // ]
  108807. // }
  108808. }
  108809. // Pages invokes f for each page of results.
  108810. // A non-nil error returned from f will halt the iteration.
  108811. // The provided context supersedes any context provided to the Context method.
  108812. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  108813. c.ctx_ = ctx
  108814. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  108815. for {
  108816. x, err := c.Do()
  108817. if err != nil {
  108818. return err
  108819. }
  108820. if err := f(x); err != nil {
  108821. return err
  108822. }
  108823. if x.NextPageToken == "" {
  108824. return nil
  108825. }
  108826. c.PageToken(x.NextPageToken)
  108827. }
  108828. }
  108829. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  108830. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  108831. s *Service
  108832. project string
  108833. region string
  108834. instanceGroupManager string
  108835. urlParams_ gensupport.URLParams
  108836. ctx_ context.Context
  108837. header_ http.Header
  108838. }
  108839. // ListManagedInstances: Lists the instances in the managed instance
  108840. // group and instances that are scheduled to be created. The list
  108841. // includes any current actions that the group has scheduled for its
  108842. // instances.
  108843. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  108844. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108845. c.project = project
  108846. c.region = region
  108847. c.instanceGroupManager = instanceGroupManager
  108848. return c
  108849. }
  108850. // Filter sets the optional parameter "filter": A filter expression that
  108851. // filters resources listed in the response. The expression must specify
  108852. // the field name, a comparison operator, and the value that you want to
  108853. // use for filtering. The value must be a string, a number, or a
  108854. // boolean. The comparison operator must be either =, !=, >, or <.
  108855. //
  108856. // For example, if you are filtering Compute Engine instances, you can
  108857. // exclude instances named example-instance by specifying name !=
  108858. // example-instance.
  108859. //
  108860. // You can also filter nested fields. For example, you could specify
  108861. // scheduling.automaticRestart = false to include instances only if they
  108862. // are not scheduled for automatic restarts. You can use filtering on
  108863. // nested fields to filter based on resource labels.
  108864. //
  108865. // To filter on multiple expressions, provide each separate expression
  108866. // within parentheses. For example, (scheduling.automaticRestart = true)
  108867. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  108868. // AND expression. However, you can include AND and OR expressions
  108869. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  108870. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  108871. // true).
  108872. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  108873. c.urlParams_.Set("filter", filter)
  108874. return c
  108875. }
  108876. // MaxResults sets the optional parameter "maxResults": The maximum
  108877. // number of results per page that should be returned. If the number of
  108878. // available results is larger than maxResults, Compute Engine returns a
  108879. // nextPageToken that can be used to get the next page of results in
  108880. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  108881. // (Default: 500)
  108882. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  108883. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  108884. return c
  108885. }
  108886. // OrderBy sets the optional parameter "order_by": Sorts list results by
  108887. // a certain order. By default, results are returned in alphanumerical
  108888. // order based on the resource name.
  108889. //
  108890. // You can also sort results in descending order based on the creation
  108891. // timestamp using orderBy="creationTimestamp desc". This sorts results
  108892. // based on the creationTimestamp field in reverse chronological order
  108893. // (newest result first). Use this to sort resources like operations so
  108894. // that the newest operation is returned first.
  108895. //
  108896. // Currently, only sorting by name or creationTimestamp desc is
  108897. // supported.
  108898. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  108899. c.urlParams_.Set("order_by", orderBy)
  108900. return c
  108901. }
  108902. // PageToken sets the optional parameter "pageToken": Specifies a page
  108903. // token to use. Set pageToken to the nextPageToken returned by a
  108904. // previous list request to get the next page of results.
  108905. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  108906. c.urlParams_.Set("pageToken", pageToken)
  108907. return c
  108908. }
  108909. // Fields allows partial responses to be retrieved. See
  108910. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108911. // for more information.
  108912. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  108913. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108914. return c
  108915. }
  108916. // Context sets the context to be used in this call's Do method. Any
  108917. // pending HTTP request will be aborted if the provided context is
  108918. // canceled.
  108919. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  108920. c.ctx_ = ctx
  108921. return c
  108922. }
  108923. // Header returns an http.Header that can be modified by the caller to
  108924. // add HTTP headers to the request.
  108925. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  108926. if c.header_ == nil {
  108927. c.header_ = make(http.Header)
  108928. }
  108929. return c.header_
  108930. }
  108931. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  108932. reqHeaders := make(http.Header)
  108933. for k, v := range c.header_ {
  108934. reqHeaders[k] = v
  108935. }
  108936. reqHeaders.Set("User-Agent", c.s.userAgent())
  108937. var body io.Reader = nil
  108938. c.urlParams_.Set("alt", alt)
  108939. c.urlParams_.Set("prettyPrint", "false")
  108940. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  108941. urls += "?" + c.urlParams_.Encode()
  108942. req, err := http.NewRequest("POST", urls, body)
  108943. if err != nil {
  108944. return nil, err
  108945. }
  108946. req.Header = reqHeaders
  108947. googleapi.Expand(req.URL, map[string]string{
  108948. "project": c.project,
  108949. "region": c.region,
  108950. "instanceGroupManager": c.instanceGroupManager,
  108951. })
  108952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108953. }
  108954. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  108955. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  108956. // error will be non-nil. Any non-2xx status code is an error. Response
  108957. // headers are in either
  108958. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  108959. // r or (if a response was returned at all) in
  108960. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  108961. // whether the returned error was because http.StatusNotModified was
  108962. // returned.
  108963. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  108964. gensupport.SetOptions(c.urlParams_, opts...)
  108965. res, err := c.doRequest("json")
  108966. if res != nil && res.StatusCode == http.StatusNotModified {
  108967. if res.Body != nil {
  108968. res.Body.Close()
  108969. }
  108970. return nil, &googleapi.Error{
  108971. Code: res.StatusCode,
  108972. Header: res.Header,
  108973. }
  108974. }
  108975. if err != nil {
  108976. return nil, err
  108977. }
  108978. defer googleapi.CloseBody(res)
  108979. if err := googleapi.CheckResponse(res); err != nil {
  108980. return nil, err
  108981. }
  108982. ret := &RegionInstanceGroupManagersListInstancesResponse{
  108983. ServerResponse: googleapi.ServerResponse{
  108984. Header: res.Header,
  108985. HTTPStatusCode: res.StatusCode,
  108986. },
  108987. }
  108988. target := &ret
  108989. if err := gensupport.DecodeResponse(target, res); err != nil {
  108990. return nil, err
  108991. }
  108992. return ret, nil
  108993. // {
  108994. // "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.",
  108995. // "httpMethod": "POST",
  108996. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  108997. // "parameterOrder": [
  108998. // "project",
  108999. // "region",
  109000. // "instanceGroupManager"
  109001. // ],
  109002. // "parameters": {
  109003. // "filter": {
  109004. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  109005. // "location": "query",
  109006. // "type": "string"
  109007. // },
  109008. // "instanceGroupManager": {
  109009. // "description": "The name of the managed instance group.",
  109010. // "location": "path",
  109011. // "required": true,
  109012. // "type": "string"
  109013. // },
  109014. // "maxResults": {
  109015. // "default": "500",
  109016. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  109017. // "format": "uint32",
  109018. // "location": "query",
  109019. // "minimum": "0",
  109020. // "type": "integer"
  109021. // },
  109022. // "order_by": {
  109023. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  109024. // "location": "query",
  109025. // "type": "string"
  109026. // },
  109027. // "pageToken": {
  109028. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  109029. // "location": "query",
  109030. // "type": "string"
  109031. // },
  109032. // "project": {
  109033. // "description": "Project ID for this request.",
  109034. // "location": "path",
  109035. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109036. // "required": true,
  109037. // "type": "string"
  109038. // },
  109039. // "region": {
  109040. // "description": "Name of the region scoping this request.",
  109041. // "location": "path",
  109042. // "required": true,
  109043. // "type": "string"
  109044. // }
  109045. // },
  109046. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  109047. // "response": {
  109048. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  109049. // },
  109050. // "scopes": [
  109051. // "https://www.googleapis.com/auth/cloud-platform",
  109052. // "https://www.googleapis.com/auth/compute",
  109053. // "https://www.googleapis.com/auth/compute.readonly"
  109054. // ]
  109055. // }
  109056. }
  109057. // Pages invokes f for each page of results.
  109058. // A non-nil error returned from f will halt the iteration.
  109059. // The provided context supersedes any context provided to the Context method.
  109060. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstancesResponse) error) error {
  109061. c.ctx_ = ctx
  109062. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  109063. for {
  109064. x, err := c.Do()
  109065. if err != nil {
  109066. return err
  109067. }
  109068. if err := f(x); err != nil {
  109069. return err
  109070. }
  109071. if x.NextPageToken == "" {
  109072. return nil
  109073. }
  109074. c.PageToken(x.NextPageToken)
  109075. }
  109076. }
  109077. // method id "compute.regionInstanceGroupManagers.listPerInstanceConfigs":
  109078. type RegionInstanceGroupManagersListPerInstanceConfigsCall struct {
  109079. s *Service
  109080. project string
  109081. region string
  109082. instanceGroupManager string
  109083. urlParams_ gensupport.URLParams
  109084. ctx_ context.Context
  109085. header_ http.Header
  109086. }
  109087. // ListPerInstanceConfigs: Lists all of the per-instance configs defined
  109088. // for the managed instance group.
  109089. func (r *RegionInstanceGroupManagersService) ListPerInstanceConfigs(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  109090. c := &RegionInstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109091. c.project = project
  109092. c.region = region
  109093. c.instanceGroupManager = instanceGroupManager
  109094. return c
  109095. }
  109096. // Filter sets the optional parameter "filter": A filter expression that
  109097. // filters resources listed in the response. The expression must specify
  109098. // the field name, a comparison operator, and the value that you want to
  109099. // use for filtering. The value must be a string, a number, or a
  109100. // boolean. The comparison operator must be either =, !=, >, or <.
  109101. //
  109102. // For example, if you are filtering Compute Engine instances, you can
  109103. // exclude instances named example-instance by specifying name !=
  109104. // example-instance.
  109105. //
  109106. // You can also filter nested fields. For example, you could specify
  109107. // scheduling.automaticRestart = false to include instances only if they
  109108. // are not scheduled for automatic restarts. You can use filtering on
  109109. // nested fields to filter based on resource labels.
  109110. //
  109111. // To filter on multiple expressions, provide each separate expression
  109112. // within parentheses. For example, (scheduling.automaticRestart = true)
  109113. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  109114. // AND expression. However, you can include AND and OR expressions
  109115. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  109116. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  109117. // true).
  109118. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  109119. c.urlParams_.Set("filter", filter)
  109120. return c
  109121. }
  109122. // MaxResults sets the optional parameter "maxResults": The maximum
  109123. // number of results per page that should be returned. If the number of
  109124. // available results is larger than maxResults, Compute Engine returns a
  109125. // nextPageToken that can be used to get the next page of results in
  109126. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  109127. // (Default: 500)
  109128. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  109129. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  109130. return c
  109131. }
  109132. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  109133. // a certain order. By default, results are returned in alphanumerical
  109134. // order based on the resource name.
  109135. //
  109136. // You can also sort results in descending order based on the creation
  109137. // timestamp using orderBy="creationTimestamp desc". This sorts results
  109138. // based on the creationTimestamp field in reverse chronological order
  109139. // (newest result first). Use this to sort resources like operations so
  109140. // that the newest operation is returned first.
  109141. //
  109142. // Currently, only sorting by name or creationTimestamp desc is
  109143. // supported.
  109144. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  109145. c.urlParams_.Set("orderBy", orderBy)
  109146. return c
  109147. }
  109148. // PageToken sets the optional parameter "pageToken": Specifies a page
  109149. // token to use. Set pageToken to the nextPageToken returned by a
  109150. // previous list request to get the next page of results.
  109151. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  109152. c.urlParams_.Set("pageToken", pageToken)
  109153. return c
  109154. }
  109155. // Fields allows partial responses to be retrieved. See
  109156. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109157. // for more information.
  109158. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  109159. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109160. return c
  109161. }
  109162. // Context sets the context to be used in this call's Do method. Any
  109163. // pending HTTP request will be aborted if the provided context is
  109164. // canceled.
  109165. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  109166. c.ctx_ = ctx
  109167. return c
  109168. }
  109169. // Header returns an http.Header that can be modified by the caller to
  109170. // add HTTP headers to the request.
  109171. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header {
  109172. if c.header_ == nil {
  109173. c.header_ = make(http.Header)
  109174. }
  109175. return c.header_
  109176. }
  109177. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  109178. reqHeaders := make(http.Header)
  109179. for k, v := range c.header_ {
  109180. reqHeaders[k] = v
  109181. }
  109182. reqHeaders.Set("User-Agent", c.s.userAgent())
  109183. var body io.Reader = nil
  109184. c.urlParams_.Set("alt", alt)
  109185. c.urlParams_.Set("prettyPrint", "false")
  109186. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs")
  109187. urls += "?" + c.urlParams_.Encode()
  109188. req, err := http.NewRequest("POST", urls, body)
  109189. if err != nil {
  109190. return nil, err
  109191. }
  109192. req.Header = reqHeaders
  109193. googleapi.Expand(req.URL, map[string]string{
  109194. "project": c.project,
  109195. "region": c.region,
  109196. "instanceGroupManager": c.instanceGroupManager,
  109197. })
  109198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109199. }
  109200. // Do executes the "compute.regionInstanceGroupManagers.listPerInstanceConfigs" call.
  109201. // Exactly one of *RegionInstanceGroupManagersListInstanceConfigsResp or
  109202. // error will be non-nil. Any non-2xx status code is an error. Response
  109203. // headers are in either
  109204. // *RegionInstanceGroupManagersListInstanceConfigsResp.ServerResponse.Hea
  109205. // der or (if a response was returned at all) in
  109206. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  109207. // whether the returned error was because http.StatusNotModified was
  109208. // returned.
  109209. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstanceConfigsResp, error) {
  109210. gensupport.SetOptions(c.urlParams_, opts...)
  109211. res, err := c.doRequest("json")
  109212. if res != nil && res.StatusCode == http.StatusNotModified {
  109213. if res.Body != nil {
  109214. res.Body.Close()
  109215. }
  109216. return nil, &googleapi.Error{
  109217. Code: res.StatusCode,
  109218. Header: res.Header,
  109219. }
  109220. }
  109221. if err != nil {
  109222. return nil, err
  109223. }
  109224. defer googleapi.CloseBody(res)
  109225. if err := googleapi.CheckResponse(res); err != nil {
  109226. return nil, err
  109227. }
  109228. ret := &RegionInstanceGroupManagersListInstanceConfigsResp{
  109229. ServerResponse: googleapi.ServerResponse{
  109230. Header: res.Header,
  109231. HTTPStatusCode: res.StatusCode,
  109232. },
  109233. }
  109234. target := &ret
  109235. if err := gensupport.DecodeResponse(target, res); err != nil {
  109236. return nil, err
  109237. }
  109238. return ret, nil
  109239. // {
  109240. // "description": "Lists all of the per-instance configs defined for the managed instance group.",
  109241. // "httpMethod": "POST",
  109242. // "id": "compute.regionInstanceGroupManagers.listPerInstanceConfigs",
  109243. // "parameterOrder": [
  109244. // "project",
  109245. // "region",
  109246. // "instanceGroupManager"
  109247. // ],
  109248. // "parameters": {
  109249. // "filter": {
  109250. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  109251. // "location": "query",
  109252. // "type": "string"
  109253. // },
  109254. // "instanceGroupManager": {
  109255. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  109256. // "location": "path",
  109257. // "required": true,
  109258. // "type": "string"
  109259. // },
  109260. // "maxResults": {
  109261. // "default": "500",
  109262. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  109263. // "format": "uint32",
  109264. // "location": "query",
  109265. // "minimum": "0",
  109266. // "type": "integer"
  109267. // },
  109268. // "orderBy": {
  109269. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  109270. // "location": "query",
  109271. // "type": "string"
  109272. // },
  109273. // "pageToken": {
  109274. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  109275. // "location": "query",
  109276. // "type": "string"
  109277. // },
  109278. // "project": {
  109279. // "description": "Project ID for this request.",
  109280. // "location": "path",
  109281. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109282. // "required": true,
  109283. // "type": "string"
  109284. // },
  109285. // "region": {
  109286. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  109287. // "location": "path",
  109288. // "required": true,
  109289. // "type": "string"
  109290. // }
  109291. // },
  109292. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
  109293. // "response": {
  109294. // "$ref": "RegionInstanceGroupManagersListInstanceConfigsResp"
  109295. // },
  109296. // "scopes": [
  109297. // "https://www.googleapis.com/auth/cloud-platform",
  109298. // "https://www.googleapis.com/auth/compute",
  109299. // "https://www.googleapis.com/auth/compute.readonly"
  109300. // ]
  109301. // }
  109302. }
  109303. // Pages invokes f for each page of results.
  109304. // A non-nil error returned from f will halt the iteration.
  109305. // The provided context supersedes any context provided to the Context method.
  109306. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstanceConfigsResp) error) error {
  109307. c.ctx_ = ctx
  109308. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  109309. for {
  109310. x, err := c.Do()
  109311. if err != nil {
  109312. return err
  109313. }
  109314. if err := f(x); err != nil {
  109315. return err
  109316. }
  109317. if x.NextPageToken == "" {
  109318. return nil
  109319. }
  109320. c.PageToken(x.NextPageToken)
  109321. }
  109322. }
  109323. // method id "compute.regionInstanceGroupManagers.patch":
  109324. type RegionInstanceGroupManagersPatchCall struct {
  109325. s *Service
  109326. project string
  109327. region string
  109328. instanceGroupManager string
  109329. instancegroupmanager *InstanceGroupManager
  109330. urlParams_ gensupport.URLParams
  109331. ctx_ context.Context
  109332. header_ http.Header
  109333. }
  109334. // Patch: Updates a managed instance group using the information that
  109335. // you specify in the request. This operation is marked as DONE when the
  109336. // group is patched even if the instances in the group are still in the
  109337. // process of being patched. You must separately verify the status of
  109338. // the individual instances with the listmanagedinstances method. This
  109339. // method supports PATCH semantics and uses the JSON merge patch format
  109340. // and processing rules.
  109341. func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
  109342. c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109343. c.project = project
  109344. c.region = region
  109345. c.instanceGroupManager = instanceGroupManager
  109346. c.instancegroupmanager = instancegroupmanager
  109347. return c
  109348. }
  109349. // RequestId sets the optional parameter "requestId": An optional
  109350. // request ID to identify requests. Specify a unique request ID so that
  109351. // if you must retry your request, the server will know to ignore the
  109352. // request if it has already been completed.
  109353. //
  109354. // For example, consider a situation where you make an initial request
  109355. // and the request times out. If you make the request again with the
  109356. // same request ID, the server can check if original operation with the
  109357. // same request ID was received, and if so, will ignore the second
  109358. // request. This prevents clients from accidentally creating duplicate
  109359. // commitments.
  109360. //
  109361. // The request ID must be a valid UUID with the exception that zero UUID
  109362. // is not supported (00000000-0000-0000-0000-000000000000).
  109363. func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
  109364. c.urlParams_.Set("requestId", requestId)
  109365. return c
  109366. }
  109367. // Fields allows partial responses to be retrieved. See
  109368. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109369. // for more information.
  109370. func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
  109371. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109372. return c
  109373. }
  109374. // Context sets the context to be used in this call's Do method. Any
  109375. // pending HTTP request will be aborted if the provided context is
  109376. // canceled.
  109377. func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
  109378. c.ctx_ = ctx
  109379. return c
  109380. }
  109381. // Header returns an http.Header that can be modified by the caller to
  109382. // add HTTP headers to the request.
  109383. func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header {
  109384. if c.header_ == nil {
  109385. c.header_ = make(http.Header)
  109386. }
  109387. return c.header_
  109388. }
  109389. func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  109390. reqHeaders := make(http.Header)
  109391. for k, v := range c.header_ {
  109392. reqHeaders[k] = v
  109393. }
  109394. reqHeaders.Set("User-Agent", c.s.userAgent())
  109395. var body io.Reader = nil
  109396. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  109397. if err != nil {
  109398. return nil, err
  109399. }
  109400. reqHeaders.Set("Content-Type", "application/json")
  109401. c.urlParams_.Set("alt", alt)
  109402. c.urlParams_.Set("prettyPrint", "false")
  109403. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  109404. urls += "?" + c.urlParams_.Encode()
  109405. req, err := http.NewRequest("PATCH", urls, body)
  109406. if err != nil {
  109407. return nil, err
  109408. }
  109409. req.Header = reqHeaders
  109410. googleapi.Expand(req.URL, map[string]string{
  109411. "project": c.project,
  109412. "region": c.region,
  109413. "instanceGroupManager": c.instanceGroupManager,
  109414. })
  109415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109416. }
  109417. // Do executes the "compute.regionInstanceGroupManagers.patch" call.
  109418. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109419. // status code is an error. Response headers are in either
  109420. // *Operation.ServerResponse.Header or (if a response was returned at
  109421. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109422. // to check whether the returned error was because
  109423. // http.StatusNotModified was returned.
  109424. func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109425. gensupport.SetOptions(c.urlParams_, opts...)
  109426. res, err := c.doRequest("json")
  109427. if res != nil && res.StatusCode == http.StatusNotModified {
  109428. if res.Body != nil {
  109429. res.Body.Close()
  109430. }
  109431. return nil, &googleapi.Error{
  109432. Code: res.StatusCode,
  109433. Header: res.Header,
  109434. }
  109435. }
  109436. if err != nil {
  109437. return nil, err
  109438. }
  109439. defer googleapi.CloseBody(res)
  109440. if err := googleapi.CheckResponse(res); err != nil {
  109441. return nil, err
  109442. }
  109443. ret := &Operation{
  109444. ServerResponse: googleapi.ServerResponse{
  109445. Header: res.Header,
  109446. HTTPStatusCode: res.StatusCode,
  109447. },
  109448. }
  109449. target := &ret
  109450. if err := gensupport.DecodeResponse(target, res); err != nil {
  109451. return nil, err
  109452. }
  109453. return ret, nil
  109454. // {
  109455. // "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.",
  109456. // "httpMethod": "PATCH",
  109457. // "id": "compute.regionInstanceGroupManagers.patch",
  109458. // "parameterOrder": [
  109459. // "project",
  109460. // "region",
  109461. // "instanceGroupManager"
  109462. // ],
  109463. // "parameters": {
  109464. // "instanceGroupManager": {
  109465. // "description": "The name of the instance group manager.",
  109466. // "location": "path",
  109467. // "required": true,
  109468. // "type": "string"
  109469. // },
  109470. // "project": {
  109471. // "description": "Project ID for this request.",
  109472. // "location": "path",
  109473. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109474. // "required": true,
  109475. // "type": "string"
  109476. // },
  109477. // "region": {
  109478. // "description": "Name of the region scoping this request.",
  109479. // "location": "path",
  109480. // "required": true,
  109481. // "type": "string"
  109482. // },
  109483. // "requestId": {
  109484. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109485. // "location": "query",
  109486. // "type": "string"
  109487. // }
  109488. // },
  109489. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  109490. // "request": {
  109491. // "$ref": "InstanceGroupManager"
  109492. // },
  109493. // "response": {
  109494. // "$ref": "Operation"
  109495. // },
  109496. // "scopes": [
  109497. // "https://www.googleapis.com/auth/cloud-platform",
  109498. // "https://www.googleapis.com/auth/compute"
  109499. // ]
  109500. // }
  109501. }
  109502. // method id "compute.regionInstanceGroupManagers.patchPerInstanceConfigs":
  109503. type RegionInstanceGroupManagersPatchPerInstanceConfigsCall struct {
  109504. s *Service
  109505. project string
  109506. region string
  109507. instanceGroupManager string
  109508. regioninstancegroupmanagerpatchinstanceconfigreq *RegionInstanceGroupManagerPatchInstanceConfigReq
  109509. urlParams_ gensupport.URLParams
  109510. ctx_ context.Context
  109511. header_ http.Header
  109512. }
  109513. // PatchPerInstanceConfigs: Insert or patch (for the ones that already
  109514. // exist) per-instance configs for the managed instance group.
  109515. // perInstanceConfig.instance serves as a key used to distinguish
  109516. // whether to perform insert or patch.
  109517. func (r *RegionInstanceGroupManagersService) PatchPerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerpatchinstanceconfigreq *RegionInstanceGroupManagerPatchInstanceConfigReq) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall {
  109518. c := &RegionInstanceGroupManagersPatchPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109519. c.project = project
  109520. c.region = region
  109521. c.instanceGroupManager = instanceGroupManager
  109522. c.regioninstancegroupmanagerpatchinstanceconfigreq = regioninstancegroupmanagerpatchinstanceconfigreq
  109523. return c
  109524. }
  109525. // RequestId sets the optional parameter "requestId": An optional
  109526. // request ID to identify requests. Specify a unique request ID so that
  109527. // if you must retry your request, the server will know to ignore the
  109528. // request if it has already been completed.
  109529. //
  109530. // For example, consider a situation where you make an initial request
  109531. // and the request times out. If you make the request again with the
  109532. // same request ID, the server can check if original operation with the
  109533. // same request ID was received, and if so, will ignore the second
  109534. // request. This prevents clients from accidentally creating duplicate
  109535. // commitments.
  109536. //
  109537. // The request ID must be a valid UUID with the exception that zero UUID
  109538. // is not supported (00000000-0000-0000-0000-000000000000).
  109539. func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall {
  109540. c.urlParams_.Set("requestId", requestId)
  109541. return c
  109542. }
  109543. // Fields allows partial responses to be retrieved. See
  109544. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109545. // for more information.
  109546. func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall {
  109547. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109548. return c
  109549. }
  109550. // Context sets the context to be used in this call's Do method. Any
  109551. // pending HTTP request will be aborted if the provided context is
  109552. // canceled.
  109553. func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall {
  109554. c.ctx_ = ctx
  109555. return c
  109556. }
  109557. // Header returns an http.Header that can be modified by the caller to
  109558. // add HTTP headers to the request.
  109559. func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.Header {
  109560. if c.header_ == nil {
  109561. c.header_ = make(http.Header)
  109562. }
  109563. return c.header_
  109564. }
  109565. func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  109566. reqHeaders := make(http.Header)
  109567. for k, v := range c.header_ {
  109568. reqHeaders[k] = v
  109569. }
  109570. reqHeaders.Set("User-Agent", c.s.userAgent())
  109571. var body io.Reader = nil
  109572. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerpatchinstanceconfigreq)
  109573. if err != nil {
  109574. return nil, err
  109575. }
  109576. reqHeaders.Set("Content-Type", "application/json")
  109577. c.urlParams_.Set("alt", alt)
  109578. c.urlParams_.Set("prettyPrint", "false")
  109579. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs")
  109580. urls += "?" + c.urlParams_.Encode()
  109581. req, err := http.NewRequest("POST", urls, body)
  109582. if err != nil {
  109583. return nil, err
  109584. }
  109585. req.Header = reqHeaders
  109586. googleapi.Expand(req.URL, map[string]string{
  109587. "project": c.project,
  109588. "region": c.region,
  109589. "instanceGroupManager": c.instanceGroupManager,
  109590. })
  109591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109592. }
  109593. // Do executes the "compute.regionInstanceGroupManagers.patchPerInstanceConfigs" call.
  109594. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109595. // status code is an error. Response headers are in either
  109596. // *Operation.ServerResponse.Header or (if a response was returned at
  109597. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109598. // to check whether the returned error was because
  109599. // http.StatusNotModified was returned.
  109600. func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109601. gensupport.SetOptions(c.urlParams_, opts...)
  109602. res, err := c.doRequest("json")
  109603. if res != nil && res.StatusCode == http.StatusNotModified {
  109604. if res.Body != nil {
  109605. res.Body.Close()
  109606. }
  109607. return nil, &googleapi.Error{
  109608. Code: res.StatusCode,
  109609. Header: res.Header,
  109610. }
  109611. }
  109612. if err != nil {
  109613. return nil, err
  109614. }
  109615. defer googleapi.CloseBody(res)
  109616. if err := googleapi.CheckResponse(res); err != nil {
  109617. return nil, err
  109618. }
  109619. ret := &Operation{
  109620. ServerResponse: googleapi.ServerResponse{
  109621. Header: res.Header,
  109622. HTTPStatusCode: res.StatusCode,
  109623. },
  109624. }
  109625. target := &ret
  109626. if err := gensupport.DecodeResponse(target, res); err != nil {
  109627. return nil, err
  109628. }
  109629. return ret, nil
  109630. // {
  109631. // "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.",
  109632. // "httpMethod": "POST",
  109633. // "id": "compute.regionInstanceGroupManagers.patchPerInstanceConfigs",
  109634. // "parameterOrder": [
  109635. // "project",
  109636. // "region",
  109637. // "instanceGroupManager"
  109638. // ],
  109639. // "parameters": {
  109640. // "instanceGroupManager": {
  109641. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  109642. // "location": "path",
  109643. // "required": true,
  109644. // "type": "string"
  109645. // },
  109646. // "project": {
  109647. // "description": "Project ID for this request.",
  109648. // "location": "path",
  109649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109650. // "required": true,
  109651. // "type": "string"
  109652. // },
  109653. // "region": {
  109654. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  109655. // "location": "path",
  109656. // "required": true,
  109657. // "type": "string"
  109658. // },
  109659. // "requestId": {
  109660. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109661. // "location": "query",
  109662. // "type": "string"
  109663. // }
  109664. // },
  109665. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs",
  109666. // "request": {
  109667. // "$ref": "RegionInstanceGroupManagerPatchInstanceConfigReq"
  109668. // },
  109669. // "response": {
  109670. // "$ref": "Operation"
  109671. // },
  109672. // "scopes": [
  109673. // "https://www.googleapis.com/auth/cloud-platform",
  109674. // "https://www.googleapis.com/auth/compute"
  109675. // ]
  109676. // }
  109677. }
  109678. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  109679. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  109680. s *Service
  109681. project string
  109682. region string
  109683. instanceGroupManager string
  109684. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  109685. urlParams_ gensupport.URLParams
  109686. ctx_ context.Context
  109687. header_ http.Header
  109688. }
  109689. // RecreateInstances: Flags the specified instances in the managed
  109690. // instance group to be immediately recreated. The instances are deleted
  109691. // and recreated using the current instance template for the managed
  109692. // instance group. This operation is marked as DONE when the flag is set
  109693. // even if the instances have not yet been recreated. You must
  109694. // separately verify the status of the recreating action with the
  109695. // listmanagedinstances method.
  109696. //
  109697. // If the group is part of a backend service that has enabled connection
  109698. // draining, it can take up to 60 seconds after the connection draining
  109699. // duration has elapsed before the VM instance is removed or
  109700. // deleted.
  109701. //
  109702. // You can specify a maximum of 1000 instances with this method per
  109703. // request.
  109704. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  109705. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109706. c.project = project
  109707. c.region = region
  109708. c.instanceGroupManager = instanceGroupManager
  109709. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  109710. return c
  109711. }
  109712. // RequestId sets the optional parameter "requestId": An optional
  109713. // request ID to identify requests. Specify a unique request ID so that
  109714. // if you must retry your request, the server will know to ignore the
  109715. // request if it has already been completed.
  109716. //
  109717. // For example, consider a situation where you make an initial request
  109718. // and the request times out. If you make the request again with the
  109719. // same request ID, the server can check if original operation with the
  109720. // same request ID was received, and if so, will ignore the second
  109721. // request. This prevents clients from accidentally creating duplicate
  109722. // commitments.
  109723. //
  109724. // The request ID must be a valid UUID with the exception that zero UUID
  109725. // is not supported (00000000-0000-0000-0000-000000000000).
  109726. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  109727. c.urlParams_.Set("requestId", requestId)
  109728. return c
  109729. }
  109730. // Fields allows partial responses to be retrieved. See
  109731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109732. // for more information.
  109733. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  109734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109735. return c
  109736. }
  109737. // Context sets the context to be used in this call's Do method. Any
  109738. // pending HTTP request will be aborted if the provided context is
  109739. // canceled.
  109740. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  109741. c.ctx_ = ctx
  109742. return c
  109743. }
  109744. // Header returns an http.Header that can be modified by the caller to
  109745. // add HTTP headers to the request.
  109746. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  109747. if c.header_ == nil {
  109748. c.header_ = make(http.Header)
  109749. }
  109750. return c.header_
  109751. }
  109752. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  109753. reqHeaders := make(http.Header)
  109754. for k, v := range c.header_ {
  109755. reqHeaders[k] = v
  109756. }
  109757. reqHeaders.Set("User-Agent", c.s.userAgent())
  109758. var body io.Reader = nil
  109759. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  109760. if err != nil {
  109761. return nil, err
  109762. }
  109763. reqHeaders.Set("Content-Type", "application/json")
  109764. c.urlParams_.Set("alt", alt)
  109765. c.urlParams_.Set("prettyPrint", "false")
  109766. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  109767. urls += "?" + c.urlParams_.Encode()
  109768. req, err := http.NewRequest("POST", urls, body)
  109769. if err != nil {
  109770. return nil, err
  109771. }
  109772. req.Header = reqHeaders
  109773. googleapi.Expand(req.URL, map[string]string{
  109774. "project": c.project,
  109775. "region": c.region,
  109776. "instanceGroupManager": c.instanceGroupManager,
  109777. })
  109778. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109779. }
  109780. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  109781. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109782. // status code is an error. Response headers are in either
  109783. // *Operation.ServerResponse.Header or (if a response was returned at
  109784. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109785. // to check whether the returned error was because
  109786. // http.StatusNotModified was returned.
  109787. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109788. gensupport.SetOptions(c.urlParams_, opts...)
  109789. res, err := c.doRequest("json")
  109790. if res != nil && res.StatusCode == http.StatusNotModified {
  109791. if res.Body != nil {
  109792. res.Body.Close()
  109793. }
  109794. return nil, &googleapi.Error{
  109795. Code: res.StatusCode,
  109796. Header: res.Header,
  109797. }
  109798. }
  109799. if err != nil {
  109800. return nil, err
  109801. }
  109802. defer googleapi.CloseBody(res)
  109803. if err := googleapi.CheckResponse(res); err != nil {
  109804. return nil, err
  109805. }
  109806. ret := &Operation{
  109807. ServerResponse: googleapi.ServerResponse{
  109808. Header: res.Header,
  109809. HTTPStatusCode: res.StatusCode,
  109810. },
  109811. }
  109812. target := &ret
  109813. if err := gensupport.DecodeResponse(target, res); err != nil {
  109814. return nil, err
  109815. }
  109816. return ret, nil
  109817. // {
  109818. // "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.",
  109819. // "httpMethod": "POST",
  109820. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  109821. // "parameterOrder": [
  109822. // "project",
  109823. // "region",
  109824. // "instanceGroupManager"
  109825. // ],
  109826. // "parameters": {
  109827. // "instanceGroupManager": {
  109828. // "description": "Name of the managed instance group.",
  109829. // "location": "path",
  109830. // "required": true,
  109831. // "type": "string"
  109832. // },
  109833. // "project": {
  109834. // "description": "Project ID for this request.",
  109835. // "location": "path",
  109836. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109837. // "required": true,
  109838. // "type": "string"
  109839. // },
  109840. // "region": {
  109841. // "description": "Name of the region scoping this request.",
  109842. // "location": "path",
  109843. // "required": true,
  109844. // "type": "string"
  109845. // },
  109846. // "requestId": {
  109847. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109848. // "location": "query",
  109849. // "type": "string"
  109850. // }
  109851. // },
  109852. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  109853. // "request": {
  109854. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  109855. // },
  109856. // "response": {
  109857. // "$ref": "Operation"
  109858. // },
  109859. // "scopes": [
  109860. // "https://www.googleapis.com/auth/cloud-platform",
  109861. // "https://www.googleapis.com/auth/compute"
  109862. // ]
  109863. // }
  109864. }
  109865. // method id "compute.regionInstanceGroupManagers.resize":
  109866. type RegionInstanceGroupManagersResizeCall struct {
  109867. s *Service
  109868. project string
  109869. region string
  109870. instanceGroupManager string
  109871. urlParams_ gensupport.URLParams
  109872. ctx_ context.Context
  109873. header_ http.Header
  109874. }
  109875. // Resize: Changes the intended size of the managed instance group. If
  109876. // you increase the size, the group creates new instances using the
  109877. // current instance template. If you decrease the size, the group
  109878. // deletes one or more instances.
  109879. //
  109880. // The resize operation is marked DONE if the resize request is
  109881. // successful. The underlying actions take additional time. You must
  109882. // separately verify the status of the creating or deleting actions with
  109883. // the listmanagedinstances method.
  109884. //
  109885. // If the group is part of a backend service that has enabled connection
  109886. // draining, it can take up to 60 seconds after the connection draining
  109887. // duration has elapsed before the VM instance is removed or deleted.
  109888. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  109889. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109890. c.project = project
  109891. c.region = region
  109892. c.instanceGroupManager = instanceGroupManager
  109893. c.urlParams_.Set("size", fmt.Sprint(size))
  109894. return c
  109895. }
  109896. // RequestId sets the optional parameter "requestId": An optional
  109897. // request ID to identify requests. Specify a unique request ID so that
  109898. // if you must retry your request, the server will know to ignore the
  109899. // request if it has already been completed.
  109900. //
  109901. // For example, consider a situation where you make an initial request
  109902. // and the request times out. If you make the request again with the
  109903. // same request ID, the server can check if original operation with the
  109904. // same request ID was received, and if so, will ignore the second
  109905. // request. This prevents clients from accidentally creating duplicate
  109906. // commitments.
  109907. //
  109908. // The request ID must be a valid UUID with the exception that zero UUID
  109909. // is not supported (00000000-0000-0000-0000-000000000000).
  109910. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  109911. c.urlParams_.Set("requestId", requestId)
  109912. return c
  109913. }
  109914. // Fields allows partial responses to be retrieved. See
  109915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109916. // for more information.
  109917. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  109918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109919. return c
  109920. }
  109921. // Context sets the context to be used in this call's Do method. Any
  109922. // pending HTTP request will be aborted if the provided context is
  109923. // canceled.
  109924. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  109925. c.ctx_ = ctx
  109926. return c
  109927. }
  109928. // Header returns an http.Header that can be modified by the caller to
  109929. // add HTTP headers to the request.
  109930. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  109931. if c.header_ == nil {
  109932. c.header_ = make(http.Header)
  109933. }
  109934. return c.header_
  109935. }
  109936. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  109937. reqHeaders := make(http.Header)
  109938. for k, v := range c.header_ {
  109939. reqHeaders[k] = v
  109940. }
  109941. reqHeaders.Set("User-Agent", c.s.userAgent())
  109942. var body io.Reader = nil
  109943. c.urlParams_.Set("alt", alt)
  109944. c.urlParams_.Set("prettyPrint", "false")
  109945. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  109946. urls += "?" + c.urlParams_.Encode()
  109947. req, err := http.NewRequest("POST", urls, body)
  109948. if err != nil {
  109949. return nil, err
  109950. }
  109951. req.Header = reqHeaders
  109952. googleapi.Expand(req.URL, map[string]string{
  109953. "project": c.project,
  109954. "region": c.region,
  109955. "instanceGroupManager": c.instanceGroupManager,
  109956. })
  109957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109958. }
  109959. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  109960. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109961. // status code is an error. Response headers are in either
  109962. // *Operation.ServerResponse.Header or (if a response was returned at
  109963. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109964. // to check whether the returned error was because
  109965. // http.StatusNotModified was returned.
  109966. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109967. gensupport.SetOptions(c.urlParams_, opts...)
  109968. res, err := c.doRequest("json")
  109969. if res != nil && res.StatusCode == http.StatusNotModified {
  109970. if res.Body != nil {
  109971. res.Body.Close()
  109972. }
  109973. return nil, &googleapi.Error{
  109974. Code: res.StatusCode,
  109975. Header: res.Header,
  109976. }
  109977. }
  109978. if err != nil {
  109979. return nil, err
  109980. }
  109981. defer googleapi.CloseBody(res)
  109982. if err := googleapi.CheckResponse(res); err != nil {
  109983. return nil, err
  109984. }
  109985. ret := &Operation{
  109986. ServerResponse: googleapi.ServerResponse{
  109987. Header: res.Header,
  109988. HTTPStatusCode: res.StatusCode,
  109989. },
  109990. }
  109991. target := &ret
  109992. if err := gensupport.DecodeResponse(target, res); err != nil {
  109993. return nil, err
  109994. }
  109995. return ret, nil
  109996. // {
  109997. // "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.",
  109998. // "httpMethod": "POST",
  109999. // "id": "compute.regionInstanceGroupManagers.resize",
  110000. // "parameterOrder": [
  110001. // "project",
  110002. // "region",
  110003. // "instanceGroupManager",
  110004. // "size"
  110005. // ],
  110006. // "parameters": {
  110007. // "instanceGroupManager": {
  110008. // "description": "Name of the managed instance group.",
  110009. // "location": "path",
  110010. // "required": true,
  110011. // "type": "string"
  110012. // },
  110013. // "project": {
  110014. // "description": "Project ID for this request.",
  110015. // "location": "path",
  110016. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110017. // "required": true,
  110018. // "type": "string"
  110019. // },
  110020. // "region": {
  110021. // "description": "Name of the region scoping this request.",
  110022. // "location": "path",
  110023. // "required": true,
  110024. // "type": "string"
  110025. // },
  110026. // "requestId": {
  110027. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110028. // "location": "query",
  110029. // "type": "string"
  110030. // },
  110031. // "size": {
  110032. // "description": "Number of instances that should exist in this instance group manager.",
  110033. // "format": "int32",
  110034. // "location": "query",
  110035. // "minimum": "0",
  110036. // "required": true,
  110037. // "type": "integer"
  110038. // }
  110039. // },
  110040. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  110041. // "response": {
  110042. // "$ref": "Operation"
  110043. // },
  110044. // "scopes": [
  110045. // "https://www.googleapis.com/auth/cloud-platform",
  110046. // "https://www.googleapis.com/auth/compute"
  110047. // ]
  110048. // }
  110049. }
  110050. // method id "compute.regionInstanceGroupManagers.setAutoHealingPolicies":
  110051. type RegionInstanceGroupManagersSetAutoHealingPoliciesCall struct {
  110052. s *Service
  110053. project string
  110054. region string
  110055. instanceGroupManager string
  110056. regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest
  110057. urlParams_ gensupport.URLParams
  110058. ctx_ context.Context
  110059. header_ http.Header
  110060. }
  110061. // SetAutoHealingPolicies: Modifies the autohealing policy for the
  110062. // instances in this managed instance group. [Deprecated] This method is
  110063. // deprecated. Please use Patch instead.
  110064. func (r *RegionInstanceGroupManagersService) SetAutoHealingPolicies(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  110065. c := &RegionInstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110066. c.project = project
  110067. c.region = region
  110068. c.instanceGroupManager = instanceGroupManager
  110069. c.regioninstancegroupmanagerssetautohealingrequest = regioninstancegroupmanagerssetautohealingrequest
  110070. return c
  110071. }
  110072. // RequestId sets the optional parameter "requestId": An optional
  110073. // request ID to identify requests. Specify a unique request ID so that
  110074. // if you must retry your request, the server will know to ignore the
  110075. // request if it has already been completed.
  110076. //
  110077. // For example, consider a situation where you make an initial request
  110078. // and the request times out. If you make the request again with the
  110079. // same request ID, the server can check if original operation with the
  110080. // same request ID was received, and if so, will ignore the second
  110081. // request. This prevents clients from accidentally creating duplicate
  110082. // commitments.
  110083. //
  110084. // The request ID must be a valid UUID with the exception that zero UUID
  110085. // is not supported (00000000-0000-0000-0000-000000000000).
  110086. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  110087. c.urlParams_.Set("requestId", requestId)
  110088. return c
  110089. }
  110090. // Fields allows partial responses to be retrieved. See
  110091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110092. // for more information.
  110093. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  110094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110095. return c
  110096. }
  110097. // Context sets the context to be used in this call's Do method. Any
  110098. // pending HTTP request will be aborted if the provided context is
  110099. // canceled.
  110100. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  110101. c.ctx_ = ctx
  110102. return c
  110103. }
  110104. // Header returns an http.Header that can be modified by the caller to
  110105. // add HTTP headers to the request.
  110106. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  110107. if c.header_ == nil {
  110108. c.header_ = make(http.Header)
  110109. }
  110110. return c.header_
  110111. }
  110112. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  110113. reqHeaders := make(http.Header)
  110114. for k, v := range c.header_ {
  110115. reqHeaders[k] = v
  110116. }
  110117. reqHeaders.Set("User-Agent", c.s.userAgent())
  110118. var body io.Reader = nil
  110119. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssetautohealingrequest)
  110120. if err != nil {
  110121. return nil, err
  110122. }
  110123. reqHeaders.Set("Content-Type", "application/json")
  110124. c.urlParams_.Set("alt", alt)
  110125. c.urlParams_.Set("prettyPrint", "false")
  110126. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  110127. urls += "?" + c.urlParams_.Encode()
  110128. req, err := http.NewRequest("POST", urls, body)
  110129. if err != nil {
  110130. return nil, err
  110131. }
  110132. req.Header = reqHeaders
  110133. googleapi.Expand(req.URL, map[string]string{
  110134. "project": c.project,
  110135. "region": c.region,
  110136. "instanceGroupManager": c.instanceGroupManager,
  110137. })
  110138. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110139. }
  110140. // Do executes the "compute.regionInstanceGroupManagers.setAutoHealingPolicies" call.
  110141. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110142. // status code is an error. Response headers are in either
  110143. // *Operation.ServerResponse.Header or (if a response was returned at
  110144. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110145. // to check whether the returned error was because
  110146. // http.StatusNotModified was returned.
  110147. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110148. gensupport.SetOptions(c.urlParams_, opts...)
  110149. res, err := c.doRequest("json")
  110150. if res != nil && res.StatusCode == http.StatusNotModified {
  110151. if res.Body != nil {
  110152. res.Body.Close()
  110153. }
  110154. return nil, &googleapi.Error{
  110155. Code: res.StatusCode,
  110156. Header: res.Header,
  110157. }
  110158. }
  110159. if err != nil {
  110160. return nil, err
  110161. }
  110162. defer googleapi.CloseBody(res)
  110163. if err := googleapi.CheckResponse(res); err != nil {
  110164. return nil, err
  110165. }
  110166. ret := &Operation{
  110167. ServerResponse: googleapi.ServerResponse{
  110168. Header: res.Header,
  110169. HTTPStatusCode: res.StatusCode,
  110170. },
  110171. }
  110172. target := &ret
  110173. if err := gensupport.DecodeResponse(target, res); err != nil {
  110174. return nil, err
  110175. }
  110176. return ret, nil
  110177. // {
  110178. // "description": "Modifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. Please use Patch instead.",
  110179. // "httpMethod": "POST",
  110180. // "id": "compute.regionInstanceGroupManagers.setAutoHealingPolicies",
  110181. // "parameterOrder": [
  110182. // "project",
  110183. // "region",
  110184. // "instanceGroupManager"
  110185. // ],
  110186. // "parameters": {
  110187. // "instanceGroupManager": {
  110188. // "description": "Name of the managed instance group.",
  110189. // "location": "path",
  110190. // "required": true,
  110191. // "type": "string"
  110192. // },
  110193. // "project": {
  110194. // "description": "Project ID for this request.",
  110195. // "location": "path",
  110196. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110197. // "required": true,
  110198. // "type": "string"
  110199. // },
  110200. // "region": {
  110201. // "description": "Name of the region scoping this request.",
  110202. // "location": "path",
  110203. // "required": true,
  110204. // "type": "string"
  110205. // },
  110206. // "requestId": {
  110207. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110208. // "location": "query",
  110209. // "type": "string"
  110210. // }
  110211. // },
  110212. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  110213. // "request": {
  110214. // "$ref": "RegionInstanceGroupManagersSetAutoHealingRequest"
  110215. // },
  110216. // "response": {
  110217. // "$ref": "Operation"
  110218. // },
  110219. // "scopes": [
  110220. // "https://www.googleapis.com/auth/cloud-platform",
  110221. // "https://www.googleapis.com/auth/compute"
  110222. // ]
  110223. // }
  110224. }
  110225. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  110226. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  110227. s *Service
  110228. project string
  110229. region string
  110230. instanceGroupManager string
  110231. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  110232. urlParams_ gensupport.URLParams
  110233. ctx_ context.Context
  110234. header_ http.Header
  110235. }
  110236. // SetInstanceTemplate: Sets the instance template to use when creating
  110237. // new instances or recreating instances in this group. Existing
  110238. // instances are not affected.
  110239. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  110240. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110241. c.project = project
  110242. c.region = region
  110243. c.instanceGroupManager = instanceGroupManager
  110244. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  110245. return c
  110246. }
  110247. // RequestId sets the optional parameter "requestId": An optional
  110248. // request ID to identify requests. Specify a unique request ID so that
  110249. // if you must retry your request, the server will know to ignore the
  110250. // request if it has already been completed.
  110251. //
  110252. // For example, consider a situation where you make an initial request
  110253. // and the request times out. If you make the request again with the
  110254. // same request ID, the server can check if original operation with the
  110255. // same request ID was received, and if so, will ignore the second
  110256. // request. This prevents clients from accidentally creating duplicate
  110257. // commitments.
  110258. //
  110259. // The request ID must be a valid UUID with the exception that zero UUID
  110260. // is not supported (00000000-0000-0000-0000-000000000000).
  110261. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  110262. c.urlParams_.Set("requestId", requestId)
  110263. return c
  110264. }
  110265. // Fields allows partial responses to be retrieved. See
  110266. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110267. // for more information.
  110268. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  110269. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110270. return c
  110271. }
  110272. // Context sets the context to be used in this call's Do method. Any
  110273. // pending HTTP request will be aborted if the provided context is
  110274. // canceled.
  110275. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  110276. c.ctx_ = ctx
  110277. return c
  110278. }
  110279. // Header returns an http.Header that can be modified by the caller to
  110280. // add HTTP headers to the request.
  110281. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  110282. if c.header_ == nil {
  110283. c.header_ = make(http.Header)
  110284. }
  110285. return c.header_
  110286. }
  110287. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  110288. reqHeaders := make(http.Header)
  110289. for k, v := range c.header_ {
  110290. reqHeaders[k] = v
  110291. }
  110292. reqHeaders.Set("User-Agent", c.s.userAgent())
  110293. var body io.Reader = nil
  110294. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  110295. if err != nil {
  110296. return nil, err
  110297. }
  110298. reqHeaders.Set("Content-Type", "application/json")
  110299. c.urlParams_.Set("alt", alt)
  110300. c.urlParams_.Set("prettyPrint", "false")
  110301. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  110302. urls += "?" + c.urlParams_.Encode()
  110303. req, err := http.NewRequest("POST", urls, body)
  110304. if err != nil {
  110305. return nil, err
  110306. }
  110307. req.Header = reqHeaders
  110308. googleapi.Expand(req.URL, map[string]string{
  110309. "project": c.project,
  110310. "region": c.region,
  110311. "instanceGroupManager": c.instanceGroupManager,
  110312. })
  110313. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110314. }
  110315. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  110316. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110317. // status code is an error. Response headers are in either
  110318. // *Operation.ServerResponse.Header or (if a response was returned at
  110319. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110320. // to check whether the returned error was because
  110321. // http.StatusNotModified was returned.
  110322. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110323. gensupport.SetOptions(c.urlParams_, opts...)
  110324. res, err := c.doRequest("json")
  110325. if res != nil && res.StatusCode == http.StatusNotModified {
  110326. if res.Body != nil {
  110327. res.Body.Close()
  110328. }
  110329. return nil, &googleapi.Error{
  110330. Code: res.StatusCode,
  110331. Header: res.Header,
  110332. }
  110333. }
  110334. if err != nil {
  110335. return nil, err
  110336. }
  110337. defer googleapi.CloseBody(res)
  110338. if err := googleapi.CheckResponse(res); err != nil {
  110339. return nil, err
  110340. }
  110341. ret := &Operation{
  110342. ServerResponse: googleapi.ServerResponse{
  110343. Header: res.Header,
  110344. HTTPStatusCode: res.StatusCode,
  110345. },
  110346. }
  110347. target := &ret
  110348. if err := gensupport.DecodeResponse(target, res); err != nil {
  110349. return nil, err
  110350. }
  110351. return ret, nil
  110352. // {
  110353. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  110354. // "httpMethod": "POST",
  110355. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  110356. // "parameterOrder": [
  110357. // "project",
  110358. // "region",
  110359. // "instanceGroupManager"
  110360. // ],
  110361. // "parameters": {
  110362. // "instanceGroupManager": {
  110363. // "description": "The name of the managed instance group.",
  110364. // "location": "path",
  110365. // "required": true,
  110366. // "type": "string"
  110367. // },
  110368. // "project": {
  110369. // "description": "Project ID for this request.",
  110370. // "location": "path",
  110371. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110372. // "required": true,
  110373. // "type": "string"
  110374. // },
  110375. // "region": {
  110376. // "description": "Name of the region scoping this request.",
  110377. // "location": "path",
  110378. // "required": true,
  110379. // "type": "string"
  110380. // },
  110381. // "requestId": {
  110382. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110383. // "location": "query",
  110384. // "type": "string"
  110385. // }
  110386. // },
  110387. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  110388. // "request": {
  110389. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  110390. // },
  110391. // "response": {
  110392. // "$ref": "Operation"
  110393. // },
  110394. // "scopes": [
  110395. // "https://www.googleapis.com/auth/cloud-platform",
  110396. // "https://www.googleapis.com/auth/compute"
  110397. // ]
  110398. // }
  110399. }
  110400. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  110401. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  110402. s *Service
  110403. project string
  110404. region string
  110405. instanceGroupManager string
  110406. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  110407. urlParams_ gensupport.URLParams
  110408. ctx_ context.Context
  110409. header_ http.Header
  110410. }
  110411. // SetTargetPools: Modifies the target pools to which all new instances
  110412. // in this group are assigned. Existing instances in the group are not
  110413. // affected.
  110414. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  110415. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110416. c.project = project
  110417. c.region = region
  110418. c.instanceGroupManager = instanceGroupManager
  110419. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  110420. return c
  110421. }
  110422. // RequestId sets the optional parameter "requestId": An optional
  110423. // request ID to identify requests. Specify a unique request ID so that
  110424. // if you must retry your request, the server will know to ignore the
  110425. // request if it has already been completed.
  110426. //
  110427. // For example, consider a situation where you make an initial request
  110428. // and the request times out. If you make the request again with the
  110429. // same request ID, the server can check if original operation with the
  110430. // same request ID was received, and if so, will ignore the second
  110431. // request. This prevents clients from accidentally creating duplicate
  110432. // commitments.
  110433. //
  110434. // The request ID must be a valid UUID with the exception that zero UUID
  110435. // is not supported (00000000-0000-0000-0000-000000000000).
  110436. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  110437. c.urlParams_.Set("requestId", requestId)
  110438. return c
  110439. }
  110440. // Fields allows partial responses to be retrieved. See
  110441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110442. // for more information.
  110443. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  110444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110445. return c
  110446. }
  110447. // Context sets the context to be used in this call's Do method. Any
  110448. // pending HTTP request will be aborted if the provided context is
  110449. // canceled.
  110450. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  110451. c.ctx_ = ctx
  110452. return c
  110453. }
  110454. // Header returns an http.Header that can be modified by the caller to
  110455. // add HTTP headers to the request.
  110456. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  110457. if c.header_ == nil {
  110458. c.header_ = make(http.Header)
  110459. }
  110460. return c.header_
  110461. }
  110462. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  110463. reqHeaders := make(http.Header)
  110464. for k, v := range c.header_ {
  110465. reqHeaders[k] = v
  110466. }
  110467. reqHeaders.Set("User-Agent", c.s.userAgent())
  110468. var body io.Reader = nil
  110469. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  110470. if err != nil {
  110471. return nil, err
  110472. }
  110473. reqHeaders.Set("Content-Type", "application/json")
  110474. c.urlParams_.Set("alt", alt)
  110475. c.urlParams_.Set("prettyPrint", "false")
  110476. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  110477. urls += "?" + c.urlParams_.Encode()
  110478. req, err := http.NewRequest("POST", urls, body)
  110479. if err != nil {
  110480. return nil, err
  110481. }
  110482. req.Header = reqHeaders
  110483. googleapi.Expand(req.URL, map[string]string{
  110484. "project": c.project,
  110485. "region": c.region,
  110486. "instanceGroupManager": c.instanceGroupManager,
  110487. })
  110488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110489. }
  110490. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  110491. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110492. // status code is an error. Response headers are in either
  110493. // *Operation.ServerResponse.Header or (if a response was returned at
  110494. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110495. // to check whether the returned error was because
  110496. // http.StatusNotModified was returned.
  110497. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110498. gensupport.SetOptions(c.urlParams_, opts...)
  110499. res, err := c.doRequest("json")
  110500. if res != nil && res.StatusCode == http.StatusNotModified {
  110501. if res.Body != nil {
  110502. res.Body.Close()
  110503. }
  110504. return nil, &googleapi.Error{
  110505. Code: res.StatusCode,
  110506. Header: res.Header,
  110507. }
  110508. }
  110509. if err != nil {
  110510. return nil, err
  110511. }
  110512. defer googleapi.CloseBody(res)
  110513. if err := googleapi.CheckResponse(res); err != nil {
  110514. return nil, err
  110515. }
  110516. ret := &Operation{
  110517. ServerResponse: googleapi.ServerResponse{
  110518. Header: res.Header,
  110519. HTTPStatusCode: res.StatusCode,
  110520. },
  110521. }
  110522. target := &ret
  110523. if err := gensupport.DecodeResponse(target, res); err != nil {
  110524. return nil, err
  110525. }
  110526. return ret, nil
  110527. // {
  110528. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  110529. // "httpMethod": "POST",
  110530. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  110531. // "parameterOrder": [
  110532. // "project",
  110533. // "region",
  110534. // "instanceGroupManager"
  110535. // ],
  110536. // "parameters": {
  110537. // "instanceGroupManager": {
  110538. // "description": "Name of the managed instance group.",
  110539. // "location": "path",
  110540. // "required": true,
  110541. // "type": "string"
  110542. // },
  110543. // "project": {
  110544. // "description": "Project ID for this request.",
  110545. // "location": "path",
  110546. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110547. // "required": true,
  110548. // "type": "string"
  110549. // },
  110550. // "region": {
  110551. // "description": "Name of the region scoping this request.",
  110552. // "location": "path",
  110553. // "required": true,
  110554. // "type": "string"
  110555. // },
  110556. // "requestId": {
  110557. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110558. // "location": "query",
  110559. // "type": "string"
  110560. // }
  110561. // },
  110562. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  110563. // "request": {
  110564. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  110565. // },
  110566. // "response": {
  110567. // "$ref": "Operation"
  110568. // },
  110569. // "scopes": [
  110570. // "https://www.googleapis.com/auth/cloud-platform",
  110571. // "https://www.googleapis.com/auth/compute"
  110572. // ]
  110573. // }
  110574. }
  110575. // method id "compute.regionInstanceGroupManagers.testIamPermissions":
  110576. type RegionInstanceGroupManagersTestIamPermissionsCall struct {
  110577. s *Service
  110578. project string
  110579. region string
  110580. resource string
  110581. testpermissionsrequest *TestPermissionsRequest
  110582. urlParams_ gensupport.URLParams
  110583. ctx_ context.Context
  110584. header_ http.Header
  110585. }
  110586. // TestIamPermissions: Returns permissions that a caller has on the
  110587. // specified resource.
  110588. func (r *RegionInstanceGroupManagersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupManagersTestIamPermissionsCall {
  110589. c := &RegionInstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110590. c.project = project
  110591. c.region = region
  110592. c.resource = resource
  110593. c.testpermissionsrequest = testpermissionsrequest
  110594. return c
  110595. }
  110596. // Fields allows partial responses to be retrieved. See
  110597. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110598. // for more information.
  110599. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersTestIamPermissionsCall {
  110600. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110601. return c
  110602. }
  110603. // Context sets the context to be used in this call's Do method. Any
  110604. // pending HTTP request will be aborted if the provided context is
  110605. // canceled.
  110606. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupManagersTestIamPermissionsCall {
  110607. c.ctx_ = ctx
  110608. return c
  110609. }
  110610. // Header returns an http.Header that can be modified by the caller to
  110611. // add HTTP headers to the request.
  110612. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  110613. if c.header_ == nil {
  110614. c.header_ = make(http.Header)
  110615. }
  110616. return c.header_
  110617. }
  110618. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  110619. reqHeaders := make(http.Header)
  110620. for k, v := range c.header_ {
  110621. reqHeaders[k] = v
  110622. }
  110623. reqHeaders.Set("User-Agent", c.s.userAgent())
  110624. var body io.Reader = nil
  110625. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  110626. if err != nil {
  110627. return nil, err
  110628. }
  110629. reqHeaders.Set("Content-Type", "application/json")
  110630. c.urlParams_.Set("alt", alt)
  110631. c.urlParams_.Set("prettyPrint", "false")
  110632. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions")
  110633. urls += "?" + c.urlParams_.Encode()
  110634. req, err := http.NewRequest("POST", urls, body)
  110635. if err != nil {
  110636. return nil, err
  110637. }
  110638. req.Header = reqHeaders
  110639. googleapi.Expand(req.URL, map[string]string{
  110640. "project": c.project,
  110641. "region": c.region,
  110642. "resource": c.resource,
  110643. })
  110644. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110645. }
  110646. // Do executes the "compute.regionInstanceGroupManagers.testIamPermissions" call.
  110647. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  110648. // non-2xx status code is an error. Response headers are in either
  110649. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  110650. // returned at all) in error.(*googleapi.Error).Header. Use
  110651. // googleapi.IsNotModified to check whether the returned error was
  110652. // because http.StatusNotModified was returned.
  110653. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  110654. gensupport.SetOptions(c.urlParams_, opts...)
  110655. res, err := c.doRequest("json")
  110656. if res != nil && res.StatusCode == http.StatusNotModified {
  110657. if res.Body != nil {
  110658. res.Body.Close()
  110659. }
  110660. return nil, &googleapi.Error{
  110661. Code: res.StatusCode,
  110662. Header: res.Header,
  110663. }
  110664. }
  110665. if err != nil {
  110666. return nil, err
  110667. }
  110668. defer googleapi.CloseBody(res)
  110669. if err := googleapi.CheckResponse(res); err != nil {
  110670. return nil, err
  110671. }
  110672. ret := &TestPermissionsResponse{
  110673. ServerResponse: googleapi.ServerResponse{
  110674. Header: res.Header,
  110675. HTTPStatusCode: res.StatusCode,
  110676. },
  110677. }
  110678. target := &ret
  110679. if err := gensupport.DecodeResponse(target, res); err != nil {
  110680. return nil, err
  110681. }
  110682. return ret, nil
  110683. // {
  110684. // "description": "Returns permissions that a caller has on the specified resource.",
  110685. // "httpMethod": "POST",
  110686. // "id": "compute.regionInstanceGroupManagers.testIamPermissions",
  110687. // "parameterOrder": [
  110688. // "project",
  110689. // "region",
  110690. // "resource"
  110691. // ],
  110692. // "parameters": {
  110693. // "project": {
  110694. // "description": "Project ID for this request.",
  110695. // "location": "path",
  110696. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110697. // "required": true,
  110698. // "type": "string"
  110699. // },
  110700. // "region": {
  110701. // "description": "The name of the region for this request.",
  110702. // "location": "path",
  110703. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110704. // "required": true,
  110705. // "type": "string"
  110706. // },
  110707. // "resource": {
  110708. // "description": "Name or id of the resource for this request.",
  110709. // "location": "path",
  110710. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110711. // "required": true,
  110712. // "type": "string"
  110713. // }
  110714. // },
  110715. // "path": "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions",
  110716. // "request": {
  110717. // "$ref": "TestPermissionsRequest"
  110718. // },
  110719. // "response": {
  110720. // "$ref": "TestPermissionsResponse"
  110721. // },
  110722. // "scopes": [
  110723. // "https://www.googleapis.com/auth/cloud-platform",
  110724. // "https://www.googleapis.com/auth/compute",
  110725. // "https://www.googleapis.com/auth/compute.readonly"
  110726. // ]
  110727. // }
  110728. }
  110729. // method id "compute.regionInstanceGroupManagers.update":
  110730. type RegionInstanceGroupManagersUpdateCall struct {
  110731. s *Service
  110732. project string
  110733. region string
  110734. instanceGroupManager string
  110735. instancegroupmanager *InstanceGroupManager
  110736. urlParams_ gensupport.URLParams
  110737. ctx_ context.Context
  110738. header_ http.Header
  110739. }
  110740. // Update: Updates a managed instance group using the information that
  110741. // you specify in the request. This operation is marked as DONE when the
  110742. // group is updated even if the instances in the group have not yet been
  110743. // updated. You must separately verify the status of the individual
  110744. // instances with the listmanagedinstances method.
  110745. func (r *RegionInstanceGroupManagersService) Update(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersUpdateCall {
  110746. c := &RegionInstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110747. c.project = project
  110748. c.region = region
  110749. c.instanceGroupManager = instanceGroupManager
  110750. c.instancegroupmanager = instancegroupmanager
  110751. return c
  110752. }
  110753. // RequestId sets the optional parameter "requestId": An optional
  110754. // request ID to identify requests. Specify a unique request ID so that
  110755. // if you must retry your request, the server will know to ignore the
  110756. // request if it has already been completed.
  110757. //
  110758. // For example, consider a situation where you make an initial request
  110759. // and the request times out. If you make the request again with the
  110760. // same request ID, the server can check if original operation with the
  110761. // same request ID was received, and if so, will ignore the second
  110762. // request. This prevents clients from accidentally creating duplicate
  110763. // commitments.
  110764. //
  110765. // The request ID must be a valid UUID with the exception that zero UUID
  110766. // is not supported (00000000-0000-0000-0000-000000000000).
  110767. func (c *RegionInstanceGroupManagersUpdateCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdateCall {
  110768. c.urlParams_.Set("requestId", requestId)
  110769. return c
  110770. }
  110771. // Fields allows partial responses to be retrieved. See
  110772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110773. // for more information.
  110774. func (c *RegionInstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdateCall {
  110775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110776. return c
  110777. }
  110778. // Context sets the context to be used in this call's Do method. Any
  110779. // pending HTTP request will be aborted if the provided context is
  110780. // canceled.
  110781. func (c *RegionInstanceGroupManagersUpdateCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdateCall {
  110782. c.ctx_ = ctx
  110783. return c
  110784. }
  110785. // Header returns an http.Header that can be modified by the caller to
  110786. // add HTTP headers to the request.
  110787. func (c *RegionInstanceGroupManagersUpdateCall) Header() http.Header {
  110788. if c.header_ == nil {
  110789. c.header_ = make(http.Header)
  110790. }
  110791. return c.header_
  110792. }
  110793. func (c *RegionInstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  110794. reqHeaders := make(http.Header)
  110795. for k, v := range c.header_ {
  110796. reqHeaders[k] = v
  110797. }
  110798. reqHeaders.Set("User-Agent", c.s.userAgent())
  110799. var body io.Reader = nil
  110800. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  110801. if err != nil {
  110802. return nil, err
  110803. }
  110804. reqHeaders.Set("Content-Type", "application/json")
  110805. c.urlParams_.Set("alt", alt)
  110806. c.urlParams_.Set("prettyPrint", "false")
  110807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  110808. urls += "?" + c.urlParams_.Encode()
  110809. req, err := http.NewRequest("PUT", urls, body)
  110810. if err != nil {
  110811. return nil, err
  110812. }
  110813. req.Header = reqHeaders
  110814. googleapi.Expand(req.URL, map[string]string{
  110815. "project": c.project,
  110816. "region": c.region,
  110817. "instanceGroupManager": c.instanceGroupManager,
  110818. })
  110819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110820. }
  110821. // Do executes the "compute.regionInstanceGroupManagers.update" call.
  110822. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110823. // status code is an error. Response headers are in either
  110824. // *Operation.ServerResponse.Header or (if a response was returned at
  110825. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110826. // to check whether the returned error was because
  110827. // http.StatusNotModified was returned.
  110828. func (c *RegionInstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110829. gensupport.SetOptions(c.urlParams_, opts...)
  110830. res, err := c.doRequest("json")
  110831. if res != nil && res.StatusCode == http.StatusNotModified {
  110832. if res.Body != nil {
  110833. res.Body.Close()
  110834. }
  110835. return nil, &googleapi.Error{
  110836. Code: res.StatusCode,
  110837. Header: res.Header,
  110838. }
  110839. }
  110840. if err != nil {
  110841. return nil, err
  110842. }
  110843. defer googleapi.CloseBody(res)
  110844. if err := googleapi.CheckResponse(res); err != nil {
  110845. return nil, err
  110846. }
  110847. ret := &Operation{
  110848. ServerResponse: googleapi.ServerResponse{
  110849. Header: res.Header,
  110850. HTTPStatusCode: res.StatusCode,
  110851. },
  110852. }
  110853. target := &ret
  110854. if err := gensupport.DecodeResponse(target, res); err != nil {
  110855. return nil, err
  110856. }
  110857. return ret, nil
  110858. // {
  110859. // "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.",
  110860. // "httpMethod": "PUT",
  110861. // "id": "compute.regionInstanceGroupManagers.update",
  110862. // "parameterOrder": [
  110863. // "project",
  110864. // "region",
  110865. // "instanceGroupManager"
  110866. // ],
  110867. // "parameters": {
  110868. // "instanceGroupManager": {
  110869. // "description": "The name of the instance group manager.",
  110870. // "location": "path",
  110871. // "required": true,
  110872. // "type": "string"
  110873. // },
  110874. // "project": {
  110875. // "description": "Project ID for this request.",
  110876. // "location": "path",
  110877. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110878. // "required": true,
  110879. // "type": "string"
  110880. // },
  110881. // "region": {
  110882. // "description": "Name of the region scoping this request.",
  110883. // "location": "path",
  110884. // "required": true,
  110885. // "type": "string"
  110886. // },
  110887. // "requestId": {
  110888. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110889. // "location": "query",
  110890. // "type": "string"
  110891. // }
  110892. // },
  110893. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  110894. // "request": {
  110895. // "$ref": "InstanceGroupManager"
  110896. // },
  110897. // "response": {
  110898. // "$ref": "Operation"
  110899. // },
  110900. // "scopes": [
  110901. // "https://www.googleapis.com/auth/cloud-platform",
  110902. // "https://www.googleapis.com/auth/compute"
  110903. // ]
  110904. // }
  110905. }
  110906. // method id "compute.regionInstanceGroupManagers.updatePerInstanceConfigs":
  110907. type RegionInstanceGroupManagersUpdatePerInstanceConfigsCall struct {
  110908. s *Service
  110909. project string
  110910. region string
  110911. instanceGroupManager string
  110912. regioninstancegroupmanagerupdateinstanceconfigreq *RegionInstanceGroupManagerUpdateInstanceConfigReq
  110913. urlParams_ gensupport.URLParams
  110914. ctx_ context.Context
  110915. header_ http.Header
  110916. }
  110917. // UpdatePerInstanceConfigs: Insert or update (for the ones that already
  110918. // exist) per-instance configs for the managed instance group.
  110919. // perInstanceConfig.instance serves as a key used to distinguish
  110920. // whether to perform insert or patch.
  110921. func (r *RegionInstanceGroupManagersService) UpdatePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerupdateinstanceconfigreq *RegionInstanceGroupManagerUpdateInstanceConfigReq) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  110922. c := &RegionInstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110923. c.project = project
  110924. c.region = region
  110925. c.instanceGroupManager = instanceGroupManager
  110926. c.regioninstancegroupmanagerupdateinstanceconfigreq = regioninstancegroupmanagerupdateinstanceconfigreq
  110927. return c
  110928. }
  110929. // RequestId sets the optional parameter "requestId": An optional
  110930. // request ID to identify requests. Specify a unique request ID so that
  110931. // if you must retry your request, the server will know to ignore the
  110932. // request if it has already been completed.
  110933. //
  110934. // For example, consider a situation where you make an initial request
  110935. // and the request times out. If you make the request again with the
  110936. // same request ID, the server can check if original operation with the
  110937. // same request ID was received, and if so, will ignore the second
  110938. // request. This prevents clients from accidentally creating duplicate
  110939. // commitments.
  110940. //
  110941. // The request ID must be a valid UUID with the exception that zero UUID
  110942. // is not supported (00000000-0000-0000-0000-000000000000).
  110943. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  110944. c.urlParams_.Set("requestId", requestId)
  110945. return c
  110946. }
  110947. // Fields allows partial responses to be retrieved. See
  110948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110949. // for more information.
  110950. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  110951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110952. return c
  110953. }
  110954. // Context sets the context to be used in this call's Do method. Any
  110955. // pending HTTP request will be aborted if the provided context is
  110956. // canceled.
  110957. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  110958. c.ctx_ = ctx
  110959. return c
  110960. }
  110961. // Header returns an http.Header that can be modified by the caller to
  110962. // add HTTP headers to the request.
  110963. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header {
  110964. if c.header_ == nil {
  110965. c.header_ = make(http.Header)
  110966. }
  110967. return c.header_
  110968. }
  110969. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  110970. reqHeaders := make(http.Header)
  110971. for k, v := range c.header_ {
  110972. reqHeaders[k] = v
  110973. }
  110974. reqHeaders.Set("User-Agent", c.s.userAgent())
  110975. var body io.Reader = nil
  110976. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerupdateinstanceconfigreq)
  110977. if err != nil {
  110978. return nil, err
  110979. }
  110980. reqHeaders.Set("Content-Type", "application/json")
  110981. c.urlParams_.Set("alt", alt)
  110982. c.urlParams_.Set("prettyPrint", "false")
  110983. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs")
  110984. urls += "?" + c.urlParams_.Encode()
  110985. req, err := http.NewRequest("POST", urls, body)
  110986. if err != nil {
  110987. return nil, err
  110988. }
  110989. req.Header = reqHeaders
  110990. googleapi.Expand(req.URL, map[string]string{
  110991. "project": c.project,
  110992. "region": c.region,
  110993. "instanceGroupManager": c.instanceGroupManager,
  110994. })
  110995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110996. }
  110997. // Do executes the "compute.regionInstanceGroupManagers.updatePerInstanceConfigs" call.
  110998. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110999. // status code is an error. Response headers are in either
  111000. // *Operation.ServerResponse.Header or (if a response was returned at
  111001. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111002. // to check whether the returned error was because
  111003. // http.StatusNotModified was returned.
  111004. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111005. gensupport.SetOptions(c.urlParams_, opts...)
  111006. res, err := c.doRequest("json")
  111007. if res != nil && res.StatusCode == http.StatusNotModified {
  111008. if res.Body != nil {
  111009. res.Body.Close()
  111010. }
  111011. return nil, &googleapi.Error{
  111012. Code: res.StatusCode,
  111013. Header: res.Header,
  111014. }
  111015. }
  111016. if err != nil {
  111017. return nil, err
  111018. }
  111019. defer googleapi.CloseBody(res)
  111020. if err := googleapi.CheckResponse(res); err != nil {
  111021. return nil, err
  111022. }
  111023. ret := &Operation{
  111024. ServerResponse: googleapi.ServerResponse{
  111025. Header: res.Header,
  111026. HTTPStatusCode: res.StatusCode,
  111027. },
  111028. }
  111029. target := &ret
  111030. if err := gensupport.DecodeResponse(target, res); err != nil {
  111031. return nil, err
  111032. }
  111033. return ret, nil
  111034. // {
  111035. // "description": "Insert or update (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.",
  111036. // "httpMethod": "POST",
  111037. // "id": "compute.regionInstanceGroupManagers.updatePerInstanceConfigs",
  111038. // "parameterOrder": [
  111039. // "project",
  111040. // "region",
  111041. // "instanceGroupManager"
  111042. // ],
  111043. // "parameters": {
  111044. // "instanceGroupManager": {
  111045. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  111046. // "location": "path",
  111047. // "required": true,
  111048. // "type": "string"
  111049. // },
  111050. // "project": {
  111051. // "description": "Project ID for this request.",
  111052. // "location": "path",
  111053. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111054. // "required": true,
  111055. // "type": "string"
  111056. // },
  111057. // "region": {
  111058. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  111059. // "location": "path",
  111060. // "required": true,
  111061. // "type": "string"
  111062. // },
  111063. // "requestId": {
  111064. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111065. // "location": "query",
  111066. // "type": "string"
  111067. // }
  111068. // },
  111069. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
  111070. // "request": {
  111071. // "$ref": "RegionInstanceGroupManagerUpdateInstanceConfigReq"
  111072. // },
  111073. // "response": {
  111074. // "$ref": "Operation"
  111075. // },
  111076. // "scopes": [
  111077. // "https://www.googleapis.com/auth/cloud-platform",
  111078. // "https://www.googleapis.com/auth/compute"
  111079. // ]
  111080. // }
  111081. }
  111082. // method id "compute.regionInstanceGroups.get":
  111083. type RegionInstanceGroupsGetCall struct {
  111084. s *Service
  111085. project string
  111086. region string
  111087. instanceGroup string
  111088. urlParams_ gensupport.URLParams
  111089. ifNoneMatch_ string
  111090. ctx_ context.Context
  111091. header_ http.Header
  111092. }
  111093. // Get: Returns the specified instance group resource.
  111094. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  111095. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111096. c.project = project
  111097. c.region = region
  111098. c.instanceGroup = instanceGroup
  111099. return c
  111100. }
  111101. // Fields allows partial responses to be retrieved. See
  111102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111103. // for more information.
  111104. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  111105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111106. return c
  111107. }
  111108. // IfNoneMatch sets the optional parameter which makes the operation
  111109. // fail if the object's ETag matches the given value. This is useful for
  111110. // getting updates only after the object has changed since the last
  111111. // request. Use googleapi.IsNotModified to check whether the response
  111112. // error from Do is the result of In-None-Match.
  111113. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  111114. c.ifNoneMatch_ = entityTag
  111115. return c
  111116. }
  111117. // Context sets the context to be used in this call's Do method. Any
  111118. // pending HTTP request will be aborted if the provided context is
  111119. // canceled.
  111120. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  111121. c.ctx_ = ctx
  111122. return c
  111123. }
  111124. // Header returns an http.Header that can be modified by the caller to
  111125. // add HTTP headers to the request.
  111126. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  111127. if c.header_ == nil {
  111128. c.header_ = make(http.Header)
  111129. }
  111130. return c.header_
  111131. }
  111132. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  111133. reqHeaders := make(http.Header)
  111134. for k, v := range c.header_ {
  111135. reqHeaders[k] = v
  111136. }
  111137. reqHeaders.Set("User-Agent", c.s.userAgent())
  111138. if c.ifNoneMatch_ != "" {
  111139. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111140. }
  111141. var body io.Reader = nil
  111142. c.urlParams_.Set("alt", alt)
  111143. c.urlParams_.Set("prettyPrint", "false")
  111144. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  111145. urls += "?" + c.urlParams_.Encode()
  111146. req, err := http.NewRequest("GET", urls, body)
  111147. if err != nil {
  111148. return nil, err
  111149. }
  111150. req.Header = reqHeaders
  111151. googleapi.Expand(req.URL, map[string]string{
  111152. "project": c.project,
  111153. "region": c.region,
  111154. "instanceGroup": c.instanceGroup,
  111155. })
  111156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111157. }
  111158. // Do executes the "compute.regionInstanceGroups.get" call.
  111159. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  111160. // status code is an error. Response headers are in either
  111161. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  111162. // at all) in error.(*googleapi.Error).Header. Use
  111163. // googleapi.IsNotModified to check whether the returned error was
  111164. // because http.StatusNotModified was returned.
  111165. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  111166. gensupport.SetOptions(c.urlParams_, opts...)
  111167. res, err := c.doRequest("json")
  111168. if res != nil && res.StatusCode == http.StatusNotModified {
  111169. if res.Body != nil {
  111170. res.Body.Close()
  111171. }
  111172. return nil, &googleapi.Error{
  111173. Code: res.StatusCode,
  111174. Header: res.Header,
  111175. }
  111176. }
  111177. if err != nil {
  111178. return nil, err
  111179. }
  111180. defer googleapi.CloseBody(res)
  111181. if err := googleapi.CheckResponse(res); err != nil {
  111182. return nil, err
  111183. }
  111184. ret := &InstanceGroup{
  111185. ServerResponse: googleapi.ServerResponse{
  111186. Header: res.Header,
  111187. HTTPStatusCode: res.StatusCode,
  111188. },
  111189. }
  111190. target := &ret
  111191. if err := gensupport.DecodeResponse(target, res); err != nil {
  111192. return nil, err
  111193. }
  111194. return ret, nil
  111195. // {
  111196. // "description": "Returns the specified instance group resource.",
  111197. // "httpMethod": "GET",
  111198. // "id": "compute.regionInstanceGroups.get",
  111199. // "parameterOrder": [
  111200. // "project",
  111201. // "region",
  111202. // "instanceGroup"
  111203. // ],
  111204. // "parameters": {
  111205. // "instanceGroup": {
  111206. // "description": "Name of the instance group resource to return.",
  111207. // "location": "path",
  111208. // "required": true,
  111209. // "type": "string"
  111210. // },
  111211. // "project": {
  111212. // "description": "Project ID for this request.",
  111213. // "location": "path",
  111214. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111215. // "required": true,
  111216. // "type": "string"
  111217. // },
  111218. // "region": {
  111219. // "description": "Name of the region scoping this request.",
  111220. // "location": "path",
  111221. // "required": true,
  111222. // "type": "string"
  111223. // }
  111224. // },
  111225. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  111226. // "response": {
  111227. // "$ref": "InstanceGroup"
  111228. // },
  111229. // "scopes": [
  111230. // "https://www.googleapis.com/auth/cloud-platform",
  111231. // "https://www.googleapis.com/auth/compute",
  111232. // "https://www.googleapis.com/auth/compute.readonly"
  111233. // ]
  111234. // }
  111235. }
  111236. // method id "compute.regionInstanceGroups.list":
  111237. type RegionInstanceGroupsListCall struct {
  111238. s *Service
  111239. project string
  111240. region string
  111241. urlParams_ gensupport.URLParams
  111242. ifNoneMatch_ string
  111243. ctx_ context.Context
  111244. header_ http.Header
  111245. }
  111246. // List: Retrieves the list of instance group resources contained within
  111247. // the specified region.
  111248. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  111249. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111250. c.project = project
  111251. c.region = region
  111252. return c
  111253. }
  111254. // Filter sets the optional parameter "filter": A filter expression that
  111255. // filters resources listed in the response. The expression must specify
  111256. // the field name, a comparison operator, and the value that you want to
  111257. // use for filtering. The value must be a string, a number, or a
  111258. // boolean. The comparison operator must be either =, !=, >, or <.
  111259. //
  111260. // For example, if you are filtering Compute Engine instances, you can
  111261. // exclude instances named example-instance by specifying name !=
  111262. // example-instance.
  111263. //
  111264. // You can also filter nested fields. For example, you could specify
  111265. // scheduling.automaticRestart = false to include instances only if they
  111266. // are not scheduled for automatic restarts. You can use filtering on
  111267. // nested fields to filter based on resource labels.
  111268. //
  111269. // To filter on multiple expressions, provide each separate expression
  111270. // within parentheses. For example, (scheduling.automaticRestart = true)
  111271. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  111272. // AND expression. However, you can include AND and OR expressions
  111273. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  111274. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  111275. // true).
  111276. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  111277. c.urlParams_.Set("filter", filter)
  111278. return c
  111279. }
  111280. // MaxResults sets the optional parameter "maxResults": The maximum
  111281. // number of results per page that should be returned. If the number of
  111282. // available results is larger than maxResults, Compute Engine returns a
  111283. // nextPageToken that can be used to get the next page of results in
  111284. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  111285. // (Default: 500)
  111286. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  111287. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  111288. return c
  111289. }
  111290. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  111291. // a certain order. By default, results are returned in alphanumerical
  111292. // order based on the resource name.
  111293. //
  111294. // You can also sort results in descending order based on the creation
  111295. // timestamp using orderBy="creationTimestamp desc". This sorts results
  111296. // based on the creationTimestamp field in reverse chronological order
  111297. // (newest result first). Use this to sort resources like operations so
  111298. // that the newest operation is returned first.
  111299. //
  111300. // Currently, only sorting by name or creationTimestamp desc is
  111301. // supported.
  111302. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  111303. c.urlParams_.Set("orderBy", orderBy)
  111304. return c
  111305. }
  111306. // PageToken sets the optional parameter "pageToken": Specifies a page
  111307. // token to use. Set pageToken to the nextPageToken returned by a
  111308. // previous list request to get the next page of results.
  111309. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  111310. c.urlParams_.Set("pageToken", pageToken)
  111311. return c
  111312. }
  111313. // Fields allows partial responses to be retrieved. See
  111314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111315. // for more information.
  111316. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  111317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111318. return c
  111319. }
  111320. // IfNoneMatch sets the optional parameter which makes the operation
  111321. // fail if the object's ETag matches the given value. This is useful for
  111322. // getting updates only after the object has changed since the last
  111323. // request. Use googleapi.IsNotModified to check whether the response
  111324. // error from Do is the result of In-None-Match.
  111325. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  111326. c.ifNoneMatch_ = entityTag
  111327. return c
  111328. }
  111329. // Context sets the context to be used in this call's Do method. Any
  111330. // pending HTTP request will be aborted if the provided context is
  111331. // canceled.
  111332. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  111333. c.ctx_ = ctx
  111334. return c
  111335. }
  111336. // Header returns an http.Header that can be modified by the caller to
  111337. // add HTTP headers to the request.
  111338. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  111339. if c.header_ == nil {
  111340. c.header_ = make(http.Header)
  111341. }
  111342. return c.header_
  111343. }
  111344. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  111345. reqHeaders := make(http.Header)
  111346. for k, v := range c.header_ {
  111347. reqHeaders[k] = v
  111348. }
  111349. reqHeaders.Set("User-Agent", c.s.userAgent())
  111350. if c.ifNoneMatch_ != "" {
  111351. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111352. }
  111353. var body io.Reader = nil
  111354. c.urlParams_.Set("alt", alt)
  111355. c.urlParams_.Set("prettyPrint", "false")
  111356. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  111357. urls += "?" + c.urlParams_.Encode()
  111358. req, err := http.NewRequest("GET", urls, body)
  111359. if err != nil {
  111360. return nil, err
  111361. }
  111362. req.Header = reqHeaders
  111363. googleapi.Expand(req.URL, map[string]string{
  111364. "project": c.project,
  111365. "region": c.region,
  111366. })
  111367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111368. }
  111369. // Do executes the "compute.regionInstanceGroups.list" call.
  111370. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  111371. // non-2xx status code is an error. Response headers are in either
  111372. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  111373. // returned at all) in error.(*googleapi.Error).Header. Use
  111374. // googleapi.IsNotModified to check whether the returned error was
  111375. // because http.StatusNotModified was returned.
  111376. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  111377. gensupport.SetOptions(c.urlParams_, opts...)
  111378. res, err := c.doRequest("json")
  111379. if res != nil && res.StatusCode == http.StatusNotModified {
  111380. if res.Body != nil {
  111381. res.Body.Close()
  111382. }
  111383. return nil, &googleapi.Error{
  111384. Code: res.StatusCode,
  111385. Header: res.Header,
  111386. }
  111387. }
  111388. if err != nil {
  111389. return nil, err
  111390. }
  111391. defer googleapi.CloseBody(res)
  111392. if err := googleapi.CheckResponse(res); err != nil {
  111393. return nil, err
  111394. }
  111395. ret := &RegionInstanceGroupList{
  111396. ServerResponse: googleapi.ServerResponse{
  111397. Header: res.Header,
  111398. HTTPStatusCode: res.StatusCode,
  111399. },
  111400. }
  111401. target := &ret
  111402. if err := gensupport.DecodeResponse(target, res); err != nil {
  111403. return nil, err
  111404. }
  111405. return ret, nil
  111406. // {
  111407. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  111408. // "httpMethod": "GET",
  111409. // "id": "compute.regionInstanceGroups.list",
  111410. // "parameterOrder": [
  111411. // "project",
  111412. // "region"
  111413. // ],
  111414. // "parameters": {
  111415. // "filter": {
  111416. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  111417. // "location": "query",
  111418. // "type": "string"
  111419. // },
  111420. // "maxResults": {
  111421. // "default": "500",
  111422. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  111423. // "format": "uint32",
  111424. // "location": "query",
  111425. // "minimum": "0",
  111426. // "type": "integer"
  111427. // },
  111428. // "orderBy": {
  111429. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  111430. // "location": "query",
  111431. // "type": "string"
  111432. // },
  111433. // "pageToken": {
  111434. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  111435. // "location": "query",
  111436. // "type": "string"
  111437. // },
  111438. // "project": {
  111439. // "description": "Project ID for this request.",
  111440. // "location": "path",
  111441. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111442. // "required": true,
  111443. // "type": "string"
  111444. // },
  111445. // "region": {
  111446. // "description": "Name of the region scoping this request.",
  111447. // "location": "path",
  111448. // "required": true,
  111449. // "type": "string"
  111450. // }
  111451. // },
  111452. // "path": "{project}/regions/{region}/instanceGroups",
  111453. // "response": {
  111454. // "$ref": "RegionInstanceGroupList"
  111455. // },
  111456. // "scopes": [
  111457. // "https://www.googleapis.com/auth/cloud-platform",
  111458. // "https://www.googleapis.com/auth/compute",
  111459. // "https://www.googleapis.com/auth/compute.readonly"
  111460. // ]
  111461. // }
  111462. }
  111463. // Pages invokes f for each page of results.
  111464. // A non-nil error returned from f will halt the iteration.
  111465. // The provided context supersedes any context provided to the Context method.
  111466. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  111467. c.ctx_ = ctx
  111468. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  111469. for {
  111470. x, err := c.Do()
  111471. if err != nil {
  111472. return err
  111473. }
  111474. if err := f(x); err != nil {
  111475. return err
  111476. }
  111477. if x.NextPageToken == "" {
  111478. return nil
  111479. }
  111480. c.PageToken(x.NextPageToken)
  111481. }
  111482. }
  111483. // method id "compute.regionInstanceGroups.listInstances":
  111484. type RegionInstanceGroupsListInstancesCall struct {
  111485. s *Service
  111486. project string
  111487. region string
  111488. instanceGroup string
  111489. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  111490. urlParams_ gensupport.URLParams
  111491. ctx_ context.Context
  111492. header_ http.Header
  111493. }
  111494. // ListInstances: Lists the instances in the specified instance group
  111495. // and displays information about the named ports. Depending on the
  111496. // specified options, this method can list all instances or only the
  111497. // instances that are running.
  111498. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  111499. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111500. c.project = project
  111501. c.region = region
  111502. c.instanceGroup = instanceGroup
  111503. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  111504. return c
  111505. }
  111506. // Filter sets the optional parameter "filter": A filter expression that
  111507. // filters resources listed in the response. The expression must specify
  111508. // the field name, a comparison operator, and the value that you want to
  111509. // use for filtering. The value must be a string, a number, or a
  111510. // boolean. The comparison operator must be either =, !=, >, or <.
  111511. //
  111512. // For example, if you are filtering Compute Engine instances, you can
  111513. // exclude instances named example-instance by specifying name !=
  111514. // example-instance.
  111515. //
  111516. // You can also filter nested fields. For example, you could specify
  111517. // scheduling.automaticRestart = false to include instances only if they
  111518. // are not scheduled for automatic restarts. You can use filtering on
  111519. // nested fields to filter based on resource labels.
  111520. //
  111521. // To filter on multiple expressions, provide each separate expression
  111522. // within parentheses. For example, (scheduling.automaticRestart = true)
  111523. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  111524. // AND expression. However, you can include AND and OR expressions
  111525. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  111526. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  111527. // true).
  111528. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  111529. c.urlParams_.Set("filter", filter)
  111530. return c
  111531. }
  111532. // MaxResults sets the optional parameter "maxResults": The maximum
  111533. // number of results per page that should be returned. If the number of
  111534. // available results is larger than maxResults, Compute Engine returns a
  111535. // nextPageToken that can be used to get the next page of results in
  111536. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  111537. // (Default: 500)
  111538. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  111539. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  111540. return c
  111541. }
  111542. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  111543. // a certain order. By default, results are returned in alphanumerical
  111544. // order based on the resource name.
  111545. //
  111546. // You can also sort results in descending order based on the creation
  111547. // timestamp using orderBy="creationTimestamp desc". This sorts results
  111548. // based on the creationTimestamp field in reverse chronological order
  111549. // (newest result first). Use this to sort resources like operations so
  111550. // that the newest operation is returned first.
  111551. //
  111552. // Currently, only sorting by name or creationTimestamp desc is
  111553. // supported.
  111554. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  111555. c.urlParams_.Set("orderBy", orderBy)
  111556. return c
  111557. }
  111558. // PageToken sets the optional parameter "pageToken": Specifies a page
  111559. // token to use. Set pageToken to the nextPageToken returned by a
  111560. // previous list request to get the next page of results.
  111561. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  111562. c.urlParams_.Set("pageToken", pageToken)
  111563. return c
  111564. }
  111565. // Fields allows partial responses to be retrieved. See
  111566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111567. // for more information.
  111568. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  111569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111570. return c
  111571. }
  111572. // Context sets the context to be used in this call's Do method. Any
  111573. // pending HTTP request will be aborted if the provided context is
  111574. // canceled.
  111575. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  111576. c.ctx_ = ctx
  111577. return c
  111578. }
  111579. // Header returns an http.Header that can be modified by the caller to
  111580. // add HTTP headers to the request.
  111581. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  111582. if c.header_ == nil {
  111583. c.header_ = make(http.Header)
  111584. }
  111585. return c.header_
  111586. }
  111587. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  111588. reqHeaders := make(http.Header)
  111589. for k, v := range c.header_ {
  111590. reqHeaders[k] = v
  111591. }
  111592. reqHeaders.Set("User-Agent", c.s.userAgent())
  111593. var body io.Reader = nil
  111594. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  111595. if err != nil {
  111596. return nil, err
  111597. }
  111598. reqHeaders.Set("Content-Type", "application/json")
  111599. c.urlParams_.Set("alt", alt)
  111600. c.urlParams_.Set("prettyPrint", "false")
  111601. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  111602. urls += "?" + c.urlParams_.Encode()
  111603. req, err := http.NewRequest("POST", urls, body)
  111604. if err != nil {
  111605. return nil, err
  111606. }
  111607. req.Header = reqHeaders
  111608. googleapi.Expand(req.URL, map[string]string{
  111609. "project": c.project,
  111610. "region": c.region,
  111611. "instanceGroup": c.instanceGroup,
  111612. })
  111613. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111614. }
  111615. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  111616. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  111617. // non-nil. Any non-2xx status code is an error. Response headers are in
  111618. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  111619. // (if a response was returned at all) in
  111620. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  111621. // whether the returned error was because http.StatusNotModified was
  111622. // returned.
  111623. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  111624. gensupport.SetOptions(c.urlParams_, opts...)
  111625. res, err := c.doRequest("json")
  111626. if res != nil && res.StatusCode == http.StatusNotModified {
  111627. if res.Body != nil {
  111628. res.Body.Close()
  111629. }
  111630. return nil, &googleapi.Error{
  111631. Code: res.StatusCode,
  111632. Header: res.Header,
  111633. }
  111634. }
  111635. if err != nil {
  111636. return nil, err
  111637. }
  111638. defer googleapi.CloseBody(res)
  111639. if err := googleapi.CheckResponse(res); err != nil {
  111640. return nil, err
  111641. }
  111642. ret := &RegionInstanceGroupsListInstances{
  111643. ServerResponse: googleapi.ServerResponse{
  111644. Header: res.Header,
  111645. HTTPStatusCode: res.StatusCode,
  111646. },
  111647. }
  111648. target := &ret
  111649. if err := gensupport.DecodeResponse(target, res); err != nil {
  111650. return nil, err
  111651. }
  111652. return ret, nil
  111653. // {
  111654. // "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.",
  111655. // "httpMethod": "POST",
  111656. // "id": "compute.regionInstanceGroups.listInstances",
  111657. // "parameterOrder": [
  111658. // "project",
  111659. // "region",
  111660. // "instanceGroup"
  111661. // ],
  111662. // "parameters": {
  111663. // "filter": {
  111664. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  111665. // "location": "query",
  111666. // "type": "string"
  111667. // },
  111668. // "instanceGroup": {
  111669. // "description": "Name of the regional instance group for which we want to list the instances.",
  111670. // "location": "path",
  111671. // "required": true,
  111672. // "type": "string"
  111673. // },
  111674. // "maxResults": {
  111675. // "default": "500",
  111676. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  111677. // "format": "uint32",
  111678. // "location": "query",
  111679. // "minimum": "0",
  111680. // "type": "integer"
  111681. // },
  111682. // "orderBy": {
  111683. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  111684. // "location": "query",
  111685. // "type": "string"
  111686. // },
  111687. // "pageToken": {
  111688. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  111689. // "location": "query",
  111690. // "type": "string"
  111691. // },
  111692. // "project": {
  111693. // "description": "Project ID for this request.",
  111694. // "location": "path",
  111695. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111696. // "required": true,
  111697. // "type": "string"
  111698. // },
  111699. // "region": {
  111700. // "description": "Name of the region scoping this request.",
  111701. // "location": "path",
  111702. // "required": true,
  111703. // "type": "string"
  111704. // }
  111705. // },
  111706. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  111707. // "request": {
  111708. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  111709. // },
  111710. // "response": {
  111711. // "$ref": "RegionInstanceGroupsListInstances"
  111712. // },
  111713. // "scopes": [
  111714. // "https://www.googleapis.com/auth/cloud-platform",
  111715. // "https://www.googleapis.com/auth/compute",
  111716. // "https://www.googleapis.com/auth/compute.readonly"
  111717. // ]
  111718. // }
  111719. }
  111720. // Pages invokes f for each page of results.
  111721. // A non-nil error returned from f will halt the iteration.
  111722. // The provided context supersedes any context provided to the Context method.
  111723. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  111724. c.ctx_ = ctx
  111725. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  111726. for {
  111727. x, err := c.Do()
  111728. if err != nil {
  111729. return err
  111730. }
  111731. if err := f(x); err != nil {
  111732. return err
  111733. }
  111734. if x.NextPageToken == "" {
  111735. return nil
  111736. }
  111737. c.PageToken(x.NextPageToken)
  111738. }
  111739. }
  111740. // method id "compute.regionInstanceGroups.setNamedPorts":
  111741. type RegionInstanceGroupsSetNamedPortsCall struct {
  111742. s *Service
  111743. project string
  111744. region string
  111745. instanceGroup string
  111746. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  111747. urlParams_ gensupport.URLParams
  111748. ctx_ context.Context
  111749. header_ http.Header
  111750. }
  111751. // SetNamedPorts: Sets the named ports for the specified regional
  111752. // instance group.
  111753. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  111754. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111755. c.project = project
  111756. c.region = region
  111757. c.instanceGroup = instanceGroup
  111758. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  111759. return c
  111760. }
  111761. // RequestId sets the optional parameter "requestId": An optional
  111762. // request ID to identify requests. Specify a unique request ID so that
  111763. // if you must retry your request, the server will know to ignore the
  111764. // request if it has already been completed.
  111765. //
  111766. // For example, consider a situation where you make an initial request
  111767. // and the request times out. If you make the request again with the
  111768. // same request ID, the server can check if original operation with the
  111769. // same request ID was received, and if so, will ignore the second
  111770. // request. This prevents clients from accidentally creating duplicate
  111771. // commitments.
  111772. //
  111773. // The request ID must be a valid UUID with the exception that zero UUID
  111774. // is not supported (00000000-0000-0000-0000-000000000000).
  111775. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  111776. c.urlParams_.Set("requestId", requestId)
  111777. return c
  111778. }
  111779. // Fields allows partial responses to be retrieved. See
  111780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111781. // for more information.
  111782. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  111783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111784. return c
  111785. }
  111786. // Context sets the context to be used in this call's Do method. Any
  111787. // pending HTTP request will be aborted if the provided context is
  111788. // canceled.
  111789. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  111790. c.ctx_ = ctx
  111791. return c
  111792. }
  111793. // Header returns an http.Header that can be modified by the caller to
  111794. // add HTTP headers to the request.
  111795. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  111796. if c.header_ == nil {
  111797. c.header_ = make(http.Header)
  111798. }
  111799. return c.header_
  111800. }
  111801. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  111802. reqHeaders := make(http.Header)
  111803. for k, v := range c.header_ {
  111804. reqHeaders[k] = v
  111805. }
  111806. reqHeaders.Set("User-Agent", c.s.userAgent())
  111807. var body io.Reader = nil
  111808. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  111809. if err != nil {
  111810. return nil, err
  111811. }
  111812. reqHeaders.Set("Content-Type", "application/json")
  111813. c.urlParams_.Set("alt", alt)
  111814. c.urlParams_.Set("prettyPrint", "false")
  111815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  111816. urls += "?" + c.urlParams_.Encode()
  111817. req, err := http.NewRequest("POST", urls, body)
  111818. if err != nil {
  111819. return nil, err
  111820. }
  111821. req.Header = reqHeaders
  111822. googleapi.Expand(req.URL, map[string]string{
  111823. "project": c.project,
  111824. "region": c.region,
  111825. "instanceGroup": c.instanceGroup,
  111826. })
  111827. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111828. }
  111829. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  111830. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111831. // status code is an error. Response headers are in either
  111832. // *Operation.ServerResponse.Header or (if a response was returned at
  111833. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111834. // to check whether the returned error was because
  111835. // http.StatusNotModified was returned.
  111836. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111837. gensupport.SetOptions(c.urlParams_, opts...)
  111838. res, err := c.doRequest("json")
  111839. if res != nil && res.StatusCode == http.StatusNotModified {
  111840. if res.Body != nil {
  111841. res.Body.Close()
  111842. }
  111843. return nil, &googleapi.Error{
  111844. Code: res.StatusCode,
  111845. Header: res.Header,
  111846. }
  111847. }
  111848. if err != nil {
  111849. return nil, err
  111850. }
  111851. defer googleapi.CloseBody(res)
  111852. if err := googleapi.CheckResponse(res); err != nil {
  111853. return nil, err
  111854. }
  111855. ret := &Operation{
  111856. ServerResponse: googleapi.ServerResponse{
  111857. Header: res.Header,
  111858. HTTPStatusCode: res.StatusCode,
  111859. },
  111860. }
  111861. target := &ret
  111862. if err := gensupport.DecodeResponse(target, res); err != nil {
  111863. return nil, err
  111864. }
  111865. return ret, nil
  111866. // {
  111867. // "description": "Sets the named ports for the specified regional instance group.",
  111868. // "httpMethod": "POST",
  111869. // "id": "compute.regionInstanceGroups.setNamedPorts",
  111870. // "parameterOrder": [
  111871. // "project",
  111872. // "region",
  111873. // "instanceGroup"
  111874. // ],
  111875. // "parameters": {
  111876. // "instanceGroup": {
  111877. // "description": "The name of the regional instance group where the named ports are updated.",
  111878. // "location": "path",
  111879. // "required": true,
  111880. // "type": "string"
  111881. // },
  111882. // "project": {
  111883. // "description": "Project ID for this request.",
  111884. // "location": "path",
  111885. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111886. // "required": true,
  111887. // "type": "string"
  111888. // },
  111889. // "region": {
  111890. // "description": "Name of the region scoping this request.",
  111891. // "location": "path",
  111892. // "required": true,
  111893. // "type": "string"
  111894. // },
  111895. // "requestId": {
  111896. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111897. // "location": "query",
  111898. // "type": "string"
  111899. // }
  111900. // },
  111901. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  111902. // "request": {
  111903. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  111904. // },
  111905. // "response": {
  111906. // "$ref": "Operation"
  111907. // },
  111908. // "scopes": [
  111909. // "https://www.googleapis.com/auth/cloud-platform",
  111910. // "https://www.googleapis.com/auth/compute"
  111911. // ]
  111912. // }
  111913. }
  111914. // method id "compute.regionInstanceGroups.testIamPermissions":
  111915. type RegionInstanceGroupsTestIamPermissionsCall struct {
  111916. s *Service
  111917. project string
  111918. region string
  111919. resource string
  111920. testpermissionsrequest *TestPermissionsRequest
  111921. urlParams_ gensupport.URLParams
  111922. ctx_ context.Context
  111923. header_ http.Header
  111924. }
  111925. // TestIamPermissions: Returns permissions that a caller has on the
  111926. // specified resource.
  111927. func (r *RegionInstanceGroupsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupsTestIamPermissionsCall {
  111928. c := &RegionInstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111929. c.project = project
  111930. c.region = region
  111931. c.resource = resource
  111932. c.testpermissionsrequest = testpermissionsrequest
  111933. return c
  111934. }
  111935. // Fields allows partial responses to be retrieved. See
  111936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111937. // for more information.
  111938. func (c *RegionInstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsTestIamPermissionsCall {
  111939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111940. return c
  111941. }
  111942. // Context sets the context to be used in this call's Do method. Any
  111943. // pending HTTP request will be aborted if the provided context is
  111944. // canceled.
  111945. func (c *RegionInstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupsTestIamPermissionsCall {
  111946. c.ctx_ = ctx
  111947. return c
  111948. }
  111949. // Header returns an http.Header that can be modified by the caller to
  111950. // add HTTP headers to the request.
  111951. func (c *RegionInstanceGroupsTestIamPermissionsCall) Header() http.Header {
  111952. if c.header_ == nil {
  111953. c.header_ = make(http.Header)
  111954. }
  111955. return c.header_
  111956. }
  111957. func (c *RegionInstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  111958. reqHeaders := make(http.Header)
  111959. for k, v := range c.header_ {
  111960. reqHeaders[k] = v
  111961. }
  111962. reqHeaders.Set("User-Agent", c.s.userAgent())
  111963. var body io.Reader = nil
  111964. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  111965. if err != nil {
  111966. return nil, err
  111967. }
  111968. reqHeaders.Set("Content-Type", "application/json")
  111969. c.urlParams_.Set("alt", alt)
  111970. c.urlParams_.Set("prettyPrint", "false")
  111971. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions")
  111972. urls += "?" + c.urlParams_.Encode()
  111973. req, err := http.NewRequest("POST", urls, body)
  111974. if err != nil {
  111975. return nil, err
  111976. }
  111977. req.Header = reqHeaders
  111978. googleapi.Expand(req.URL, map[string]string{
  111979. "project": c.project,
  111980. "region": c.region,
  111981. "resource": c.resource,
  111982. })
  111983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111984. }
  111985. // Do executes the "compute.regionInstanceGroups.testIamPermissions" call.
  111986. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  111987. // non-2xx status code is an error. Response headers are in either
  111988. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  111989. // returned at all) in error.(*googleapi.Error).Header. Use
  111990. // googleapi.IsNotModified to check whether the returned error was
  111991. // because http.StatusNotModified was returned.
  111992. func (c *RegionInstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  111993. gensupport.SetOptions(c.urlParams_, opts...)
  111994. res, err := c.doRequest("json")
  111995. if res != nil && res.StatusCode == http.StatusNotModified {
  111996. if res.Body != nil {
  111997. res.Body.Close()
  111998. }
  111999. return nil, &googleapi.Error{
  112000. Code: res.StatusCode,
  112001. Header: res.Header,
  112002. }
  112003. }
  112004. if err != nil {
  112005. return nil, err
  112006. }
  112007. defer googleapi.CloseBody(res)
  112008. if err := googleapi.CheckResponse(res); err != nil {
  112009. return nil, err
  112010. }
  112011. ret := &TestPermissionsResponse{
  112012. ServerResponse: googleapi.ServerResponse{
  112013. Header: res.Header,
  112014. HTTPStatusCode: res.StatusCode,
  112015. },
  112016. }
  112017. target := &ret
  112018. if err := gensupport.DecodeResponse(target, res); err != nil {
  112019. return nil, err
  112020. }
  112021. return ret, nil
  112022. // {
  112023. // "description": "Returns permissions that a caller has on the specified resource.",
  112024. // "httpMethod": "POST",
  112025. // "id": "compute.regionInstanceGroups.testIamPermissions",
  112026. // "parameterOrder": [
  112027. // "project",
  112028. // "region",
  112029. // "resource"
  112030. // ],
  112031. // "parameters": {
  112032. // "project": {
  112033. // "description": "Project ID for this request.",
  112034. // "location": "path",
  112035. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112036. // "required": true,
  112037. // "type": "string"
  112038. // },
  112039. // "region": {
  112040. // "description": "The name of the region for this request.",
  112041. // "location": "path",
  112042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112043. // "required": true,
  112044. // "type": "string"
  112045. // },
  112046. // "resource": {
  112047. // "description": "Name or id of the resource for this request.",
  112048. // "location": "path",
  112049. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112050. // "required": true,
  112051. // "type": "string"
  112052. // }
  112053. // },
  112054. // "path": "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions",
  112055. // "request": {
  112056. // "$ref": "TestPermissionsRequest"
  112057. // },
  112058. // "response": {
  112059. // "$ref": "TestPermissionsResponse"
  112060. // },
  112061. // "scopes": [
  112062. // "https://www.googleapis.com/auth/cloud-platform",
  112063. // "https://www.googleapis.com/auth/compute",
  112064. // "https://www.googleapis.com/auth/compute.readonly"
  112065. // ]
  112066. // }
  112067. }
  112068. // method id "compute.regionNotificationEndpoints.delete":
  112069. type RegionNotificationEndpointsDeleteCall struct {
  112070. s *Service
  112071. project string
  112072. region string
  112073. notificationEndpoint string
  112074. urlParams_ gensupport.URLParams
  112075. ctx_ context.Context
  112076. header_ http.Header
  112077. }
  112078. // Delete: Deletes the specified NotificationEndpoint in the given
  112079. // region
  112080. func (r *RegionNotificationEndpointsService) Delete(project string, region string, notificationEndpoint string) *RegionNotificationEndpointsDeleteCall {
  112081. c := &RegionNotificationEndpointsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112082. c.project = project
  112083. c.region = region
  112084. c.notificationEndpoint = notificationEndpoint
  112085. return c
  112086. }
  112087. // RequestId sets the optional parameter "requestId": An optional
  112088. // request ID to identify requests. Specify a unique request ID so that
  112089. // if you must retry your request, the server will know to ignore the
  112090. // request if it has already been completed.
  112091. //
  112092. // For example, consider a situation where you make an initial request
  112093. // and the request times out. If you make the request again with the
  112094. // same request ID, the server can check if original operation with the
  112095. // same request ID was received, and if so, will ignore the second
  112096. // request. This prevents clients from accidentally creating duplicate
  112097. // commitments.
  112098. //
  112099. // The request ID must be a valid UUID with the exception that zero UUID
  112100. // is not supported (00000000-0000-0000-0000-000000000000).
  112101. func (c *RegionNotificationEndpointsDeleteCall) RequestId(requestId string) *RegionNotificationEndpointsDeleteCall {
  112102. c.urlParams_.Set("requestId", requestId)
  112103. return c
  112104. }
  112105. // Fields allows partial responses to be retrieved. See
  112106. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112107. // for more information.
  112108. func (c *RegionNotificationEndpointsDeleteCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsDeleteCall {
  112109. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112110. return c
  112111. }
  112112. // Context sets the context to be used in this call's Do method. Any
  112113. // pending HTTP request will be aborted if the provided context is
  112114. // canceled.
  112115. func (c *RegionNotificationEndpointsDeleteCall) Context(ctx context.Context) *RegionNotificationEndpointsDeleteCall {
  112116. c.ctx_ = ctx
  112117. return c
  112118. }
  112119. // Header returns an http.Header that can be modified by the caller to
  112120. // add HTTP headers to the request.
  112121. func (c *RegionNotificationEndpointsDeleteCall) Header() http.Header {
  112122. if c.header_ == nil {
  112123. c.header_ = make(http.Header)
  112124. }
  112125. return c.header_
  112126. }
  112127. func (c *RegionNotificationEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) {
  112128. reqHeaders := make(http.Header)
  112129. for k, v := range c.header_ {
  112130. reqHeaders[k] = v
  112131. }
  112132. reqHeaders.Set("User-Agent", c.s.userAgent())
  112133. var body io.Reader = nil
  112134. c.urlParams_.Set("alt", alt)
  112135. c.urlParams_.Set("prettyPrint", "false")
  112136. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}")
  112137. urls += "?" + c.urlParams_.Encode()
  112138. req, err := http.NewRequest("DELETE", urls, body)
  112139. if err != nil {
  112140. return nil, err
  112141. }
  112142. req.Header = reqHeaders
  112143. googleapi.Expand(req.URL, map[string]string{
  112144. "project": c.project,
  112145. "region": c.region,
  112146. "notificationEndpoint": c.notificationEndpoint,
  112147. })
  112148. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112149. }
  112150. // Do executes the "compute.regionNotificationEndpoints.delete" call.
  112151. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112152. // status code is an error. Response headers are in either
  112153. // *Operation.ServerResponse.Header or (if a response was returned at
  112154. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112155. // to check whether the returned error was because
  112156. // http.StatusNotModified was returned.
  112157. func (c *RegionNotificationEndpointsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112158. gensupport.SetOptions(c.urlParams_, opts...)
  112159. res, err := c.doRequest("json")
  112160. if res != nil && res.StatusCode == http.StatusNotModified {
  112161. if res.Body != nil {
  112162. res.Body.Close()
  112163. }
  112164. return nil, &googleapi.Error{
  112165. Code: res.StatusCode,
  112166. Header: res.Header,
  112167. }
  112168. }
  112169. if err != nil {
  112170. return nil, err
  112171. }
  112172. defer googleapi.CloseBody(res)
  112173. if err := googleapi.CheckResponse(res); err != nil {
  112174. return nil, err
  112175. }
  112176. ret := &Operation{
  112177. ServerResponse: googleapi.ServerResponse{
  112178. Header: res.Header,
  112179. HTTPStatusCode: res.StatusCode,
  112180. },
  112181. }
  112182. target := &ret
  112183. if err := gensupport.DecodeResponse(target, res); err != nil {
  112184. return nil, err
  112185. }
  112186. return ret, nil
  112187. // {
  112188. // "description": "Deletes the specified NotificationEndpoint in the given region",
  112189. // "httpMethod": "DELETE",
  112190. // "id": "compute.regionNotificationEndpoints.delete",
  112191. // "parameterOrder": [
  112192. // "project",
  112193. // "region",
  112194. // "notificationEndpoint"
  112195. // ],
  112196. // "parameters": {
  112197. // "notificationEndpoint": {
  112198. // "description": "Name of the NotificationEndpoint resource to delete.",
  112199. // "location": "path",
  112200. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112201. // "required": true,
  112202. // "type": "string"
  112203. // },
  112204. // "project": {
  112205. // "description": "Project ID for this request.",
  112206. // "location": "path",
  112207. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112208. // "required": true,
  112209. // "type": "string"
  112210. // },
  112211. // "region": {
  112212. // "description": "Name of the region scoping this request.",
  112213. // "location": "path",
  112214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112215. // "required": true,
  112216. // "type": "string"
  112217. // },
  112218. // "requestId": {
  112219. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112220. // "location": "query",
  112221. // "type": "string"
  112222. // }
  112223. // },
  112224. // "path": "{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}",
  112225. // "response": {
  112226. // "$ref": "Operation"
  112227. // },
  112228. // "scopes": [
  112229. // "https://www.googleapis.com/auth/cloud-platform",
  112230. // "https://www.googleapis.com/auth/compute"
  112231. // ]
  112232. // }
  112233. }
  112234. // method id "compute.regionNotificationEndpoints.get":
  112235. type RegionNotificationEndpointsGetCall struct {
  112236. s *Service
  112237. project string
  112238. region string
  112239. notificationEndpoint string
  112240. urlParams_ gensupport.URLParams
  112241. ifNoneMatch_ string
  112242. ctx_ context.Context
  112243. header_ http.Header
  112244. }
  112245. // Get: Returns the specified NotificationEndpoint resource in the given
  112246. // region.
  112247. func (r *RegionNotificationEndpointsService) Get(project string, region string, notificationEndpoint string) *RegionNotificationEndpointsGetCall {
  112248. c := &RegionNotificationEndpointsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112249. c.project = project
  112250. c.region = region
  112251. c.notificationEndpoint = notificationEndpoint
  112252. return c
  112253. }
  112254. // Fields allows partial responses to be retrieved. See
  112255. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112256. // for more information.
  112257. func (c *RegionNotificationEndpointsGetCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsGetCall {
  112258. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112259. return c
  112260. }
  112261. // IfNoneMatch sets the optional parameter which makes the operation
  112262. // fail if the object's ETag matches the given value. This is useful for
  112263. // getting updates only after the object has changed since the last
  112264. // request. Use googleapi.IsNotModified to check whether the response
  112265. // error from Do is the result of In-None-Match.
  112266. func (c *RegionNotificationEndpointsGetCall) IfNoneMatch(entityTag string) *RegionNotificationEndpointsGetCall {
  112267. c.ifNoneMatch_ = entityTag
  112268. return c
  112269. }
  112270. // Context sets the context to be used in this call's Do method. Any
  112271. // pending HTTP request will be aborted if the provided context is
  112272. // canceled.
  112273. func (c *RegionNotificationEndpointsGetCall) Context(ctx context.Context) *RegionNotificationEndpointsGetCall {
  112274. c.ctx_ = ctx
  112275. return c
  112276. }
  112277. // Header returns an http.Header that can be modified by the caller to
  112278. // add HTTP headers to the request.
  112279. func (c *RegionNotificationEndpointsGetCall) Header() http.Header {
  112280. if c.header_ == nil {
  112281. c.header_ = make(http.Header)
  112282. }
  112283. return c.header_
  112284. }
  112285. func (c *RegionNotificationEndpointsGetCall) doRequest(alt string) (*http.Response, error) {
  112286. reqHeaders := make(http.Header)
  112287. for k, v := range c.header_ {
  112288. reqHeaders[k] = v
  112289. }
  112290. reqHeaders.Set("User-Agent", c.s.userAgent())
  112291. if c.ifNoneMatch_ != "" {
  112292. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112293. }
  112294. var body io.Reader = nil
  112295. c.urlParams_.Set("alt", alt)
  112296. c.urlParams_.Set("prettyPrint", "false")
  112297. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}")
  112298. urls += "?" + c.urlParams_.Encode()
  112299. req, err := http.NewRequest("GET", urls, body)
  112300. if err != nil {
  112301. return nil, err
  112302. }
  112303. req.Header = reqHeaders
  112304. googleapi.Expand(req.URL, map[string]string{
  112305. "project": c.project,
  112306. "region": c.region,
  112307. "notificationEndpoint": c.notificationEndpoint,
  112308. })
  112309. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112310. }
  112311. // Do executes the "compute.regionNotificationEndpoints.get" call.
  112312. // Exactly one of *NotificationEndpoint or error will be non-nil. Any
  112313. // non-2xx status code is an error. Response headers are in either
  112314. // *NotificationEndpoint.ServerResponse.Header or (if a response was
  112315. // returned at all) in error.(*googleapi.Error).Header. Use
  112316. // googleapi.IsNotModified to check whether the returned error was
  112317. // because http.StatusNotModified was returned.
  112318. func (c *RegionNotificationEndpointsGetCall) Do(opts ...googleapi.CallOption) (*NotificationEndpoint, error) {
  112319. gensupport.SetOptions(c.urlParams_, opts...)
  112320. res, err := c.doRequest("json")
  112321. if res != nil && res.StatusCode == http.StatusNotModified {
  112322. if res.Body != nil {
  112323. res.Body.Close()
  112324. }
  112325. return nil, &googleapi.Error{
  112326. Code: res.StatusCode,
  112327. Header: res.Header,
  112328. }
  112329. }
  112330. if err != nil {
  112331. return nil, err
  112332. }
  112333. defer googleapi.CloseBody(res)
  112334. if err := googleapi.CheckResponse(res); err != nil {
  112335. return nil, err
  112336. }
  112337. ret := &NotificationEndpoint{
  112338. ServerResponse: googleapi.ServerResponse{
  112339. Header: res.Header,
  112340. HTTPStatusCode: res.StatusCode,
  112341. },
  112342. }
  112343. target := &ret
  112344. if err := gensupport.DecodeResponse(target, res); err != nil {
  112345. return nil, err
  112346. }
  112347. return ret, nil
  112348. // {
  112349. // "description": "Returns the specified NotificationEndpoint resource in the given region.",
  112350. // "httpMethod": "GET",
  112351. // "id": "compute.regionNotificationEndpoints.get",
  112352. // "parameterOrder": [
  112353. // "project",
  112354. // "region",
  112355. // "notificationEndpoint"
  112356. // ],
  112357. // "parameters": {
  112358. // "notificationEndpoint": {
  112359. // "description": "Name of the NotificationEndpoint resource to return.",
  112360. // "location": "path",
  112361. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112362. // "required": true,
  112363. // "type": "string"
  112364. // },
  112365. // "project": {
  112366. // "description": "Project ID for this request.",
  112367. // "location": "path",
  112368. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112369. // "required": true,
  112370. // "type": "string"
  112371. // },
  112372. // "region": {
  112373. // "description": "Name of the region scoping this request.",
  112374. // "location": "path",
  112375. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112376. // "required": true,
  112377. // "type": "string"
  112378. // }
  112379. // },
  112380. // "path": "{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}",
  112381. // "response": {
  112382. // "$ref": "NotificationEndpoint"
  112383. // },
  112384. // "scopes": [
  112385. // "https://www.googleapis.com/auth/cloud-platform",
  112386. // "https://www.googleapis.com/auth/compute",
  112387. // "https://www.googleapis.com/auth/compute.readonly"
  112388. // ]
  112389. // }
  112390. }
  112391. // method id "compute.regionNotificationEndpoints.insert":
  112392. type RegionNotificationEndpointsInsertCall struct {
  112393. s *Service
  112394. project string
  112395. region string
  112396. notificationendpoint *NotificationEndpoint
  112397. urlParams_ gensupport.URLParams
  112398. ctx_ context.Context
  112399. header_ http.Header
  112400. }
  112401. // Insert: Create a NotificationEndpoint in the specified project in the
  112402. // given region using the parameters that are included in the request.
  112403. func (r *RegionNotificationEndpointsService) Insert(project string, region string, notificationendpoint *NotificationEndpoint) *RegionNotificationEndpointsInsertCall {
  112404. c := &RegionNotificationEndpointsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112405. c.project = project
  112406. c.region = region
  112407. c.notificationendpoint = notificationendpoint
  112408. return c
  112409. }
  112410. // RequestId sets the optional parameter "requestId": An optional
  112411. // request ID to identify requests. Specify a unique request ID so that
  112412. // if you must retry your request, the server will know to ignore the
  112413. // request if it has already been completed.
  112414. //
  112415. // For example, consider a situation where you make an initial request
  112416. // and the request times out. If you make the request again with the
  112417. // same request ID, the server can check if original operation with the
  112418. // same request ID was received, and if so, will ignore the second
  112419. // request. This prevents clients from accidentally creating duplicate
  112420. // commitments.
  112421. //
  112422. // The request ID must be a valid UUID with the exception that zero UUID
  112423. // is not supported (00000000-0000-0000-0000-000000000000).
  112424. func (c *RegionNotificationEndpointsInsertCall) RequestId(requestId string) *RegionNotificationEndpointsInsertCall {
  112425. c.urlParams_.Set("requestId", requestId)
  112426. return c
  112427. }
  112428. // Fields allows partial responses to be retrieved. See
  112429. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112430. // for more information.
  112431. func (c *RegionNotificationEndpointsInsertCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsInsertCall {
  112432. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112433. return c
  112434. }
  112435. // Context sets the context to be used in this call's Do method. Any
  112436. // pending HTTP request will be aborted if the provided context is
  112437. // canceled.
  112438. func (c *RegionNotificationEndpointsInsertCall) Context(ctx context.Context) *RegionNotificationEndpointsInsertCall {
  112439. c.ctx_ = ctx
  112440. return c
  112441. }
  112442. // Header returns an http.Header that can be modified by the caller to
  112443. // add HTTP headers to the request.
  112444. func (c *RegionNotificationEndpointsInsertCall) Header() http.Header {
  112445. if c.header_ == nil {
  112446. c.header_ = make(http.Header)
  112447. }
  112448. return c.header_
  112449. }
  112450. func (c *RegionNotificationEndpointsInsertCall) doRequest(alt string) (*http.Response, error) {
  112451. reqHeaders := make(http.Header)
  112452. for k, v := range c.header_ {
  112453. reqHeaders[k] = v
  112454. }
  112455. reqHeaders.Set("User-Agent", c.s.userAgent())
  112456. var body io.Reader = nil
  112457. body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationendpoint)
  112458. if err != nil {
  112459. return nil, err
  112460. }
  112461. reqHeaders.Set("Content-Type", "application/json")
  112462. c.urlParams_.Set("alt", alt)
  112463. c.urlParams_.Set("prettyPrint", "false")
  112464. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/notificationEndpoints")
  112465. urls += "?" + c.urlParams_.Encode()
  112466. req, err := http.NewRequest("POST", urls, body)
  112467. if err != nil {
  112468. return nil, err
  112469. }
  112470. req.Header = reqHeaders
  112471. googleapi.Expand(req.URL, map[string]string{
  112472. "project": c.project,
  112473. "region": c.region,
  112474. })
  112475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112476. }
  112477. // Do executes the "compute.regionNotificationEndpoints.insert" call.
  112478. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112479. // status code is an error. Response headers are in either
  112480. // *Operation.ServerResponse.Header or (if a response was returned at
  112481. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112482. // to check whether the returned error was because
  112483. // http.StatusNotModified was returned.
  112484. func (c *RegionNotificationEndpointsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112485. gensupport.SetOptions(c.urlParams_, opts...)
  112486. res, err := c.doRequest("json")
  112487. if res != nil && res.StatusCode == http.StatusNotModified {
  112488. if res.Body != nil {
  112489. res.Body.Close()
  112490. }
  112491. return nil, &googleapi.Error{
  112492. Code: res.StatusCode,
  112493. Header: res.Header,
  112494. }
  112495. }
  112496. if err != nil {
  112497. return nil, err
  112498. }
  112499. defer googleapi.CloseBody(res)
  112500. if err := googleapi.CheckResponse(res); err != nil {
  112501. return nil, err
  112502. }
  112503. ret := &Operation{
  112504. ServerResponse: googleapi.ServerResponse{
  112505. Header: res.Header,
  112506. HTTPStatusCode: res.StatusCode,
  112507. },
  112508. }
  112509. target := &ret
  112510. if err := gensupport.DecodeResponse(target, res); err != nil {
  112511. return nil, err
  112512. }
  112513. return ret, nil
  112514. // {
  112515. // "description": "Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request.",
  112516. // "httpMethod": "POST",
  112517. // "id": "compute.regionNotificationEndpoints.insert",
  112518. // "parameterOrder": [
  112519. // "project",
  112520. // "region"
  112521. // ],
  112522. // "parameters": {
  112523. // "project": {
  112524. // "description": "Project ID for this request.",
  112525. // "location": "path",
  112526. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112527. // "required": true,
  112528. // "type": "string"
  112529. // },
  112530. // "region": {
  112531. // "description": "Name of the region scoping this request.",
  112532. // "location": "path",
  112533. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112534. // "required": true,
  112535. // "type": "string"
  112536. // },
  112537. // "requestId": {
  112538. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112539. // "location": "query",
  112540. // "type": "string"
  112541. // }
  112542. // },
  112543. // "path": "{project}/regions/{region}/notificationEndpoints",
  112544. // "request": {
  112545. // "$ref": "NotificationEndpoint"
  112546. // },
  112547. // "response": {
  112548. // "$ref": "Operation"
  112549. // },
  112550. // "scopes": [
  112551. // "https://www.googleapis.com/auth/cloud-platform",
  112552. // "https://www.googleapis.com/auth/compute"
  112553. // ]
  112554. // }
  112555. }
  112556. // method id "compute.regionNotificationEndpoints.list":
  112557. type RegionNotificationEndpointsListCall struct {
  112558. s *Service
  112559. project string
  112560. region string
  112561. urlParams_ gensupport.URLParams
  112562. ifNoneMatch_ string
  112563. ctx_ context.Context
  112564. header_ http.Header
  112565. }
  112566. // List: Lists the NotificationEndpoints for a project in the given
  112567. // region.
  112568. func (r *RegionNotificationEndpointsService) List(project string, region string) *RegionNotificationEndpointsListCall {
  112569. c := &RegionNotificationEndpointsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112570. c.project = project
  112571. c.region = region
  112572. return c
  112573. }
  112574. // Filter sets the optional parameter "filter": A filter expression that
  112575. // filters resources listed in the response. The expression must specify
  112576. // the field name, a comparison operator, and the value that you want to
  112577. // use for filtering. The value must be a string, a number, or a
  112578. // boolean. The comparison operator must be either =, !=, >, or <.
  112579. //
  112580. // For example, if you are filtering Compute Engine instances, you can
  112581. // exclude instances named example-instance by specifying name !=
  112582. // example-instance.
  112583. //
  112584. // You can also filter nested fields. For example, you could specify
  112585. // scheduling.automaticRestart = false to include instances only if they
  112586. // are not scheduled for automatic restarts. You can use filtering on
  112587. // nested fields to filter based on resource labels.
  112588. //
  112589. // To filter on multiple expressions, provide each separate expression
  112590. // within parentheses. For example, (scheduling.automaticRestart = true)
  112591. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  112592. // AND expression. However, you can include AND and OR expressions
  112593. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  112594. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  112595. // true).
  112596. func (c *RegionNotificationEndpointsListCall) Filter(filter string) *RegionNotificationEndpointsListCall {
  112597. c.urlParams_.Set("filter", filter)
  112598. return c
  112599. }
  112600. // MaxResults sets the optional parameter "maxResults": The maximum
  112601. // number of results per page that should be returned. If the number of
  112602. // available results is larger than maxResults, Compute Engine returns a
  112603. // nextPageToken that can be used to get the next page of results in
  112604. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  112605. // (Default: 500)
  112606. func (c *RegionNotificationEndpointsListCall) MaxResults(maxResults int64) *RegionNotificationEndpointsListCall {
  112607. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  112608. return c
  112609. }
  112610. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  112611. // a certain order. By default, results are returned in alphanumerical
  112612. // order based on the resource name.
  112613. //
  112614. // You can also sort results in descending order based on the creation
  112615. // timestamp using orderBy="creationTimestamp desc". This sorts results
  112616. // based on the creationTimestamp field in reverse chronological order
  112617. // (newest result first). Use this to sort resources like operations so
  112618. // that the newest operation is returned first.
  112619. //
  112620. // Currently, only sorting by name or creationTimestamp desc is
  112621. // supported.
  112622. func (c *RegionNotificationEndpointsListCall) OrderBy(orderBy string) *RegionNotificationEndpointsListCall {
  112623. c.urlParams_.Set("orderBy", orderBy)
  112624. return c
  112625. }
  112626. // PageToken sets the optional parameter "pageToken": Specifies a page
  112627. // token to use. Set pageToken to the nextPageToken returned by a
  112628. // previous list request to get the next page of results.
  112629. func (c *RegionNotificationEndpointsListCall) PageToken(pageToken string) *RegionNotificationEndpointsListCall {
  112630. c.urlParams_.Set("pageToken", pageToken)
  112631. return c
  112632. }
  112633. // Fields allows partial responses to be retrieved. See
  112634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112635. // for more information.
  112636. func (c *RegionNotificationEndpointsListCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsListCall {
  112637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112638. return c
  112639. }
  112640. // IfNoneMatch sets the optional parameter which makes the operation
  112641. // fail if the object's ETag matches the given value. This is useful for
  112642. // getting updates only after the object has changed since the last
  112643. // request. Use googleapi.IsNotModified to check whether the response
  112644. // error from Do is the result of In-None-Match.
  112645. func (c *RegionNotificationEndpointsListCall) IfNoneMatch(entityTag string) *RegionNotificationEndpointsListCall {
  112646. c.ifNoneMatch_ = entityTag
  112647. return c
  112648. }
  112649. // Context sets the context to be used in this call's Do method. Any
  112650. // pending HTTP request will be aborted if the provided context is
  112651. // canceled.
  112652. func (c *RegionNotificationEndpointsListCall) Context(ctx context.Context) *RegionNotificationEndpointsListCall {
  112653. c.ctx_ = ctx
  112654. return c
  112655. }
  112656. // Header returns an http.Header that can be modified by the caller to
  112657. // add HTTP headers to the request.
  112658. func (c *RegionNotificationEndpointsListCall) Header() http.Header {
  112659. if c.header_ == nil {
  112660. c.header_ = make(http.Header)
  112661. }
  112662. return c.header_
  112663. }
  112664. func (c *RegionNotificationEndpointsListCall) doRequest(alt string) (*http.Response, error) {
  112665. reqHeaders := make(http.Header)
  112666. for k, v := range c.header_ {
  112667. reqHeaders[k] = v
  112668. }
  112669. reqHeaders.Set("User-Agent", c.s.userAgent())
  112670. if c.ifNoneMatch_ != "" {
  112671. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112672. }
  112673. var body io.Reader = nil
  112674. c.urlParams_.Set("alt", alt)
  112675. c.urlParams_.Set("prettyPrint", "false")
  112676. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/notificationEndpoints")
  112677. urls += "?" + c.urlParams_.Encode()
  112678. req, err := http.NewRequest("GET", urls, body)
  112679. if err != nil {
  112680. return nil, err
  112681. }
  112682. req.Header = reqHeaders
  112683. googleapi.Expand(req.URL, map[string]string{
  112684. "project": c.project,
  112685. "region": c.region,
  112686. })
  112687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112688. }
  112689. // Do executes the "compute.regionNotificationEndpoints.list" call.
  112690. // Exactly one of *NotificationEndpointList or error will be non-nil.
  112691. // Any non-2xx status code is an error. Response headers are in either
  112692. // *NotificationEndpointList.ServerResponse.Header or (if a response was
  112693. // returned at all) in error.(*googleapi.Error).Header. Use
  112694. // googleapi.IsNotModified to check whether the returned error was
  112695. // because http.StatusNotModified was returned.
  112696. func (c *RegionNotificationEndpointsListCall) Do(opts ...googleapi.CallOption) (*NotificationEndpointList, error) {
  112697. gensupport.SetOptions(c.urlParams_, opts...)
  112698. res, err := c.doRequest("json")
  112699. if res != nil && res.StatusCode == http.StatusNotModified {
  112700. if res.Body != nil {
  112701. res.Body.Close()
  112702. }
  112703. return nil, &googleapi.Error{
  112704. Code: res.StatusCode,
  112705. Header: res.Header,
  112706. }
  112707. }
  112708. if err != nil {
  112709. return nil, err
  112710. }
  112711. defer googleapi.CloseBody(res)
  112712. if err := googleapi.CheckResponse(res); err != nil {
  112713. return nil, err
  112714. }
  112715. ret := &NotificationEndpointList{
  112716. ServerResponse: googleapi.ServerResponse{
  112717. Header: res.Header,
  112718. HTTPStatusCode: res.StatusCode,
  112719. },
  112720. }
  112721. target := &ret
  112722. if err := gensupport.DecodeResponse(target, res); err != nil {
  112723. return nil, err
  112724. }
  112725. return ret, nil
  112726. // {
  112727. // "description": "Lists the NotificationEndpoints for a project in the given region.",
  112728. // "httpMethod": "GET",
  112729. // "id": "compute.regionNotificationEndpoints.list",
  112730. // "parameterOrder": [
  112731. // "project",
  112732. // "region"
  112733. // ],
  112734. // "parameters": {
  112735. // "filter": {
  112736. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  112737. // "location": "query",
  112738. // "type": "string"
  112739. // },
  112740. // "maxResults": {
  112741. // "default": "500",
  112742. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  112743. // "format": "uint32",
  112744. // "location": "query",
  112745. // "minimum": "0",
  112746. // "type": "integer"
  112747. // },
  112748. // "orderBy": {
  112749. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  112750. // "location": "query",
  112751. // "type": "string"
  112752. // },
  112753. // "pageToken": {
  112754. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  112755. // "location": "query",
  112756. // "type": "string"
  112757. // },
  112758. // "project": {
  112759. // "description": "Project ID for this request.",
  112760. // "location": "path",
  112761. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112762. // "required": true,
  112763. // "type": "string"
  112764. // },
  112765. // "region": {
  112766. // "description": "Name of the region scoping this request.",
  112767. // "location": "path",
  112768. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112769. // "required": true,
  112770. // "type": "string"
  112771. // }
  112772. // },
  112773. // "path": "{project}/regions/{region}/notificationEndpoints",
  112774. // "response": {
  112775. // "$ref": "NotificationEndpointList"
  112776. // },
  112777. // "scopes": [
  112778. // "https://www.googleapis.com/auth/cloud-platform",
  112779. // "https://www.googleapis.com/auth/compute",
  112780. // "https://www.googleapis.com/auth/compute.readonly"
  112781. // ]
  112782. // }
  112783. }
  112784. // Pages invokes f for each page of results.
  112785. // A non-nil error returned from f will halt the iteration.
  112786. // The provided context supersedes any context provided to the Context method.
  112787. func (c *RegionNotificationEndpointsListCall) Pages(ctx context.Context, f func(*NotificationEndpointList) error) error {
  112788. c.ctx_ = ctx
  112789. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  112790. for {
  112791. x, err := c.Do()
  112792. if err != nil {
  112793. return err
  112794. }
  112795. if err := f(x); err != nil {
  112796. return err
  112797. }
  112798. if x.NextPageToken == "" {
  112799. return nil
  112800. }
  112801. c.PageToken(x.NextPageToken)
  112802. }
  112803. }
  112804. // method id "compute.regionNotificationEndpoints.testIamPermissions":
  112805. type RegionNotificationEndpointsTestIamPermissionsCall struct {
  112806. s *Service
  112807. project string
  112808. region string
  112809. resource string
  112810. testpermissionsrequest *TestPermissionsRequest
  112811. urlParams_ gensupport.URLParams
  112812. ctx_ context.Context
  112813. header_ http.Header
  112814. }
  112815. // TestIamPermissions: Returns permissions that a caller has on the
  112816. // specified resource.
  112817. func (r *RegionNotificationEndpointsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionNotificationEndpointsTestIamPermissionsCall {
  112818. c := &RegionNotificationEndpointsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112819. c.project = project
  112820. c.region = region
  112821. c.resource = resource
  112822. c.testpermissionsrequest = testpermissionsrequest
  112823. return c
  112824. }
  112825. // Fields allows partial responses to be retrieved. See
  112826. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112827. // for more information.
  112828. func (c *RegionNotificationEndpointsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsTestIamPermissionsCall {
  112829. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112830. return c
  112831. }
  112832. // Context sets the context to be used in this call's Do method. Any
  112833. // pending HTTP request will be aborted if the provided context is
  112834. // canceled.
  112835. func (c *RegionNotificationEndpointsTestIamPermissionsCall) Context(ctx context.Context) *RegionNotificationEndpointsTestIamPermissionsCall {
  112836. c.ctx_ = ctx
  112837. return c
  112838. }
  112839. // Header returns an http.Header that can be modified by the caller to
  112840. // add HTTP headers to the request.
  112841. func (c *RegionNotificationEndpointsTestIamPermissionsCall) Header() http.Header {
  112842. if c.header_ == nil {
  112843. c.header_ = make(http.Header)
  112844. }
  112845. return c.header_
  112846. }
  112847. func (c *RegionNotificationEndpointsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  112848. reqHeaders := make(http.Header)
  112849. for k, v := range c.header_ {
  112850. reqHeaders[k] = v
  112851. }
  112852. reqHeaders.Set("User-Agent", c.s.userAgent())
  112853. var body io.Reader = nil
  112854. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  112855. if err != nil {
  112856. return nil, err
  112857. }
  112858. reqHeaders.Set("Content-Type", "application/json")
  112859. c.urlParams_.Set("alt", alt)
  112860. c.urlParams_.Set("prettyPrint", "false")
  112861. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/notificationEndpoints/{resource}/testIamPermissions")
  112862. urls += "?" + c.urlParams_.Encode()
  112863. req, err := http.NewRequest("POST", urls, body)
  112864. if err != nil {
  112865. return nil, err
  112866. }
  112867. req.Header = reqHeaders
  112868. googleapi.Expand(req.URL, map[string]string{
  112869. "project": c.project,
  112870. "region": c.region,
  112871. "resource": c.resource,
  112872. })
  112873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112874. }
  112875. // Do executes the "compute.regionNotificationEndpoints.testIamPermissions" call.
  112876. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  112877. // non-2xx status code is an error. Response headers are in either
  112878. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  112879. // returned at all) in error.(*googleapi.Error).Header. Use
  112880. // googleapi.IsNotModified to check whether the returned error was
  112881. // because http.StatusNotModified was returned.
  112882. func (c *RegionNotificationEndpointsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  112883. gensupport.SetOptions(c.urlParams_, opts...)
  112884. res, err := c.doRequest("json")
  112885. if res != nil && res.StatusCode == http.StatusNotModified {
  112886. if res.Body != nil {
  112887. res.Body.Close()
  112888. }
  112889. return nil, &googleapi.Error{
  112890. Code: res.StatusCode,
  112891. Header: res.Header,
  112892. }
  112893. }
  112894. if err != nil {
  112895. return nil, err
  112896. }
  112897. defer googleapi.CloseBody(res)
  112898. if err := googleapi.CheckResponse(res); err != nil {
  112899. return nil, err
  112900. }
  112901. ret := &TestPermissionsResponse{
  112902. ServerResponse: googleapi.ServerResponse{
  112903. Header: res.Header,
  112904. HTTPStatusCode: res.StatusCode,
  112905. },
  112906. }
  112907. target := &ret
  112908. if err := gensupport.DecodeResponse(target, res); err != nil {
  112909. return nil, err
  112910. }
  112911. return ret, nil
  112912. // {
  112913. // "description": "Returns permissions that a caller has on the specified resource.",
  112914. // "httpMethod": "POST",
  112915. // "id": "compute.regionNotificationEndpoints.testIamPermissions",
  112916. // "parameterOrder": [
  112917. // "project",
  112918. // "region",
  112919. // "resource"
  112920. // ],
  112921. // "parameters": {
  112922. // "project": {
  112923. // "description": "Project ID for this request.",
  112924. // "location": "path",
  112925. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112926. // "required": true,
  112927. // "type": "string"
  112928. // },
  112929. // "region": {
  112930. // "description": "The name of the region for this request.",
  112931. // "location": "path",
  112932. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112933. // "required": true,
  112934. // "type": "string"
  112935. // },
  112936. // "resource": {
  112937. // "description": "Name or id of the resource for this request.",
  112938. // "location": "path",
  112939. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112940. // "required": true,
  112941. // "type": "string"
  112942. // }
  112943. // },
  112944. // "path": "{project}/regions/{region}/notificationEndpoints/{resource}/testIamPermissions",
  112945. // "request": {
  112946. // "$ref": "TestPermissionsRequest"
  112947. // },
  112948. // "response": {
  112949. // "$ref": "TestPermissionsResponse"
  112950. // },
  112951. // "scopes": [
  112952. // "https://www.googleapis.com/auth/cloud-platform",
  112953. // "https://www.googleapis.com/auth/compute",
  112954. // "https://www.googleapis.com/auth/compute.readonly"
  112955. // ]
  112956. // }
  112957. }
  112958. // method id "compute.regionOperations.delete":
  112959. type RegionOperationsDeleteCall struct {
  112960. s *Service
  112961. project string
  112962. region string
  112963. operation string
  112964. urlParams_ gensupport.URLParams
  112965. ctx_ context.Context
  112966. header_ http.Header
  112967. }
  112968. // Delete: Deletes the specified region-specific Operations resource.
  112969. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  112970. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  112971. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112972. c.project = project
  112973. c.region = region
  112974. c.operation = operation
  112975. return c
  112976. }
  112977. // Fields allows partial responses to be retrieved. See
  112978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112979. // for more information.
  112980. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  112981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112982. return c
  112983. }
  112984. // Context sets the context to be used in this call's Do method. Any
  112985. // pending HTTP request will be aborted if the provided context is
  112986. // canceled.
  112987. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  112988. c.ctx_ = ctx
  112989. return c
  112990. }
  112991. // Header returns an http.Header that can be modified by the caller to
  112992. // add HTTP headers to the request.
  112993. func (c *RegionOperationsDeleteCall) Header() http.Header {
  112994. if c.header_ == nil {
  112995. c.header_ = make(http.Header)
  112996. }
  112997. return c.header_
  112998. }
  112999. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  113000. reqHeaders := make(http.Header)
  113001. for k, v := range c.header_ {
  113002. reqHeaders[k] = v
  113003. }
  113004. reqHeaders.Set("User-Agent", c.s.userAgent())
  113005. var body io.Reader = nil
  113006. c.urlParams_.Set("alt", alt)
  113007. c.urlParams_.Set("prettyPrint", "false")
  113008. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  113009. urls += "?" + c.urlParams_.Encode()
  113010. req, err := http.NewRequest("DELETE", urls, body)
  113011. if err != nil {
  113012. return nil, err
  113013. }
  113014. req.Header = reqHeaders
  113015. googleapi.Expand(req.URL, map[string]string{
  113016. "project": c.project,
  113017. "region": c.region,
  113018. "operation": c.operation,
  113019. })
  113020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113021. }
  113022. // Do executes the "compute.regionOperations.delete" call.
  113023. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  113024. gensupport.SetOptions(c.urlParams_, opts...)
  113025. res, err := c.doRequest("json")
  113026. if err != nil {
  113027. return err
  113028. }
  113029. defer googleapi.CloseBody(res)
  113030. if err := googleapi.CheckResponse(res); err != nil {
  113031. return err
  113032. }
  113033. return nil
  113034. // {
  113035. // "description": "Deletes the specified region-specific Operations resource.",
  113036. // "httpMethod": "DELETE",
  113037. // "id": "compute.regionOperations.delete",
  113038. // "parameterOrder": [
  113039. // "project",
  113040. // "region",
  113041. // "operation"
  113042. // ],
  113043. // "parameters": {
  113044. // "operation": {
  113045. // "description": "Name of the Operations resource to delete.",
  113046. // "location": "path",
  113047. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113048. // "required": true,
  113049. // "type": "string"
  113050. // },
  113051. // "project": {
  113052. // "description": "Project ID for this request.",
  113053. // "location": "path",
  113054. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113055. // "required": true,
  113056. // "type": "string"
  113057. // },
  113058. // "region": {
  113059. // "description": "Name of the region for this request.",
  113060. // "location": "path",
  113061. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113062. // "required": true,
  113063. // "type": "string"
  113064. // }
  113065. // },
  113066. // "path": "{project}/regions/{region}/operations/{operation}",
  113067. // "scopes": [
  113068. // "https://www.googleapis.com/auth/cloud-platform",
  113069. // "https://www.googleapis.com/auth/compute"
  113070. // ]
  113071. // }
  113072. }
  113073. // method id "compute.regionOperations.get":
  113074. type RegionOperationsGetCall struct {
  113075. s *Service
  113076. project string
  113077. region string
  113078. operation string
  113079. urlParams_ gensupport.URLParams
  113080. ifNoneMatch_ string
  113081. ctx_ context.Context
  113082. header_ http.Header
  113083. }
  113084. // Get: Retrieves the specified region-specific Operations resource.
  113085. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  113086. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  113087. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113088. c.project = project
  113089. c.region = region
  113090. c.operation = operation
  113091. return c
  113092. }
  113093. // Fields allows partial responses to be retrieved. See
  113094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113095. // for more information.
  113096. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  113097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113098. return c
  113099. }
  113100. // IfNoneMatch sets the optional parameter which makes the operation
  113101. // fail if the object's ETag matches the given value. This is useful for
  113102. // getting updates only after the object has changed since the last
  113103. // request. Use googleapi.IsNotModified to check whether the response
  113104. // error from Do is the result of In-None-Match.
  113105. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  113106. c.ifNoneMatch_ = entityTag
  113107. return c
  113108. }
  113109. // Context sets the context to be used in this call's Do method. Any
  113110. // pending HTTP request will be aborted if the provided context is
  113111. // canceled.
  113112. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  113113. c.ctx_ = ctx
  113114. return c
  113115. }
  113116. // Header returns an http.Header that can be modified by the caller to
  113117. // add HTTP headers to the request.
  113118. func (c *RegionOperationsGetCall) Header() http.Header {
  113119. if c.header_ == nil {
  113120. c.header_ = make(http.Header)
  113121. }
  113122. return c.header_
  113123. }
  113124. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  113125. reqHeaders := make(http.Header)
  113126. for k, v := range c.header_ {
  113127. reqHeaders[k] = v
  113128. }
  113129. reqHeaders.Set("User-Agent", c.s.userAgent())
  113130. if c.ifNoneMatch_ != "" {
  113131. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113132. }
  113133. var body io.Reader = nil
  113134. c.urlParams_.Set("alt", alt)
  113135. c.urlParams_.Set("prettyPrint", "false")
  113136. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  113137. urls += "?" + c.urlParams_.Encode()
  113138. req, err := http.NewRequest("GET", urls, body)
  113139. if err != nil {
  113140. return nil, err
  113141. }
  113142. req.Header = reqHeaders
  113143. googleapi.Expand(req.URL, map[string]string{
  113144. "project": c.project,
  113145. "region": c.region,
  113146. "operation": c.operation,
  113147. })
  113148. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113149. }
  113150. // Do executes the "compute.regionOperations.get" call.
  113151. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113152. // status code is an error. Response headers are in either
  113153. // *Operation.ServerResponse.Header or (if a response was returned at
  113154. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113155. // to check whether the returned error was because
  113156. // http.StatusNotModified was returned.
  113157. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113158. gensupport.SetOptions(c.urlParams_, opts...)
  113159. res, err := c.doRequest("json")
  113160. if res != nil && res.StatusCode == http.StatusNotModified {
  113161. if res.Body != nil {
  113162. res.Body.Close()
  113163. }
  113164. return nil, &googleapi.Error{
  113165. Code: res.StatusCode,
  113166. Header: res.Header,
  113167. }
  113168. }
  113169. if err != nil {
  113170. return nil, err
  113171. }
  113172. defer googleapi.CloseBody(res)
  113173. if err := googleapi.CheckResponse(res); err != nil {
  113174. return nil, err
  113175. }
  113176. ret := &Operation{
  113177. ServerResponse: googleapi.ServerResponse{
  113178. Header: res.Header,
  113179. HTTPStatusCode: res.StatusCode,
  113180. },
  113181. }
  113182. target := &ret
  113183. if err := gensupport.DecodeResponse(target, res); err != nil {
  113184. return nil, err
  113185. }
  113186. return ret, nil
  113187. // {
  113188. // "description": "Retrieves the specified region-specific Operations resource.",
  113189. // "httpMethod": "GET",
  113190. // "id": "compute.regionOperations.get",
  113191. // "parameterOrder": [
  113192. // "project",
  113193. // "region",
  113194. // "operation"
  113195. // ],
  113196. // "parameters": {
  113197. // "operation": {
  113198. // "description": "Name of the Operations resource to return.",
  113199. // "location": "path",
  113200. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113201. // "required": true,
  113202. // "type": "string"
  113203. // },
  113204. // "project": {
  113205. // "description": "Project ID for this request.",
  113206. // "location": "path",
  113207. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113208. // "required": true,
  113209. // "type": "string"
  113210. // },
  113211. // "region": {
  113212. // "description": "Name of the region for this request.",
  113213. // "location": "path",
  113214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113215. // "required": true,
  113216. // "type": "string"
  113217. // }
  113218. // },
  113219. // "path": "{project}/regions/{region}/operations/{operation}",
  113220. // "response": {
  113221. // "$ref": "Operation"
  113222. // },
  113223. // "scopes": [
  113224. // "https://www.googleapis.com/auth/cloud-platform",
  113225. // "https://www.googleapis.com/auth/compute",
  113226. // "https://www.googleapis.com/auth/compute.readonly"
  113227. // ]
  113228. // }
  113229. }
  113230. // method id "compute.regionOperations.list":
  113231. type RegionOperationsListCall struct {
  113232. s *Service
  113233. project string
  113234. region string
  113235. urlParams_ gensupport.URLParams
  113236. ifNoneMatch_ string
  113237. ctx_ context.Context
  113238. header_ http.Header
  113239. }
  113240. // List: Retrieves a list of Operation resources contained within the
  113241. // specified region.
  113242. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  113243. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  113244. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113245. c.project = project
  113246. c.region = region
  113247. return c
  113248. }
  113249. // Filter sets the optional parameter "filter": A filter expression that
  113250. // filters resources listed in the response. The expression must specify
  113251. // the field name, a comparison operator, and the value that you want to
  113252. // use for filtering. The value must be a string, a number, or a
  113253. // boolean. The comparison operator must be either =, !=, >, or <.
  113254. //
  113255. // For example, if you are filtering Compute Engine instances, you can
  113256. // exclude instances named example-instance by specifying name !=
  113257. // example-instance.
  113258. //
  113259. // You can also filter nested fields. For example, you could specify
  113260. // scheduling.automaticRestart = false to include instances only if they
  113261. // are not scheduled for automatic restarts. You can use filtering on
  113262. // nested fields to filter based on resource labels.
  113263. //
  113264. // To filter on multiple expressions, provide each separate expression
  113265. // within parentheses. For example, (scheduling.automaticRestart = true)
  113266. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  113267. // AND expression. However, you can include AND and OR expressions
  113268. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  113269. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  113270. // true).
  113271. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  113272. c.urlParams_.Set("filter", filter)
  113273. return c
  113274. }
  113275. // MaxResults sets the optional parameter "maxResults": The maximum
  113276. // number of results per page that should be returned. If the number of
  113277. // available results is larger than maxResults, Compute Engine returns a
  113278. // nextPageToken that can be used to get the next page of results in
  113279. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  113280. // (Default: 500)
  113281. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  113282. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  113283. return c
  113284. }
  113285. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  113286. // a certain order. By default, results are returned in alphanumerical
  113287. // order based on the resource name.
  113288. //
  113289. // You can also sort results in descending order based on the creation
  113290. // timestamp using orderBy="creationTimestamp desc". This sorts results
  113291. // based on the creationTimestamp field in reverse chronological order
  113292. // (newest result first). Use this to sort resources like operations so
  113293. // that the newest operation is returned first.
  113294. //
  113295. // Currently, only sorting by name or creationTimestamp desc is
  113296. // supported.
  113297. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  113298. c.urlParams_.Set("orderBy", orderBy)
  113299. return c
  113300. }
  113301. // PageToken sets the optional parameter "pageToken": Specifies a page
  113302. // token to use. Set pageToken to the nextPageToken returned by a
  113303. // previous list request to get the next page of results.
  113304. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  113305. c.urlParams_.Set("pageToken", pageToken)
  113306. return c
  113307. }
  113308. // Fields allows partial responses to be retrieved. See
  113309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113310. // for more information.
  113311. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  113312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113313. return c
  113314. }
  113315. // IfNoneMatch sets the optional parameter which makes the operation
  113316. // fail if the object's ETag matches the given value. This is useful for
  113317. // getting updates only after the object has changed since the last
  113318. // request. Use googleapi.IsNotModified to check whether the response
  113319. // error from Do is the result of In-None-Match.
  113320. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  113321. c.ifNoneMatch_ = entityTag
  113322. return c
  113323. }
  113324. // Context sets the context to be used in this call's Do method. Any
  113325. // pending HTTP request will be aborted if the provided context is
  113326. // canceled.
  113327. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  113328. c.ctx_ = ctx
  113329. return c
  113330. }
  113331. // Header returns an http.Header that can be modified by the caller to
  113332. // add HTTP headers to the request.
  113333. func (c *RegionOperationsListCall) Header() http.Header {
  113334. if c.header_ == nil {
  113335. c.header_ = make(http.Header)
  113336. }
  113337. return c.header_
  113338. }
  113339. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  113340. reqHeaders := make(http.Header)
  113341. for k, v := range c.header_ {
  113342. reqHeaders[k] = v
  113343. }
  113344. reqHeaders.Set("User-Agent", c.s.userAgent())
  113345. if c.ifNoneMatch_ != "" {
  113346. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113347. }
  113348. var body io.Reader = nil
  113349. c.urlParams_.Set("alt", alt)
  113350. c.urlParams_.Set("prettyPrint", "false")
  113351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  113352. urls += "?" + c.urlParams_.Encode()
  113353. req, err := http.NewRequest("GET", urls, body)
  113354. if err != nil {
  113355. return nil, err
  113356. }
  113357. req.Header = reqHeaders
  113358. googleapi.Expand(req.URL, map[string]string{
  113359. "project": c.project,
  113360. "region": c.region,
  113361. })
  113362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113363. }
  113364. // Do executes the "compute.regionOperations.list" call.
  113365. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  113366. // status code is an error. Response headers are in either
  113367. // *OperationList.ServerResponse.Header or (if a response was returned
  113368. // at all) in error.(*googleapi.Error).Header. Use
  113369. // googleapi.IsNotModified to check whether the returned error was
  113370. // because http.StatusNotModified was returned.
  113371. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  113372. gensupport.SetOptions(c.urlParams_, opts...)
  113373. res, err := c.doRequest("json")
  113374. if res != nil && res.StatusCode == http.StatusNotModified {
  113375. if res.Body != nil {
  113376. res.Body.Close()
  113377. }
  113378. return nil, &googleapi.Error{
  113379. Code: res.StatusCode,
  113380. Header: res.Header,
  113381. }
  113382. }
  113383. if err != nil {
  113384. return nil, err
  113385. }
  113386. defer googleapi.CloseBody(res)
  113387. if err := googleapi.CheckResponse(res); err != nil {
  113388. return nil, err
  113389. }
  113390. ret := &OperationList{
  113391. ServerResponse: googleapi.ServerResponse{
  113392. Header: res.Header,
  113393. HTTPStatusCode: res.StatusCode,
  113394. },
  113395. }
  113396. target := &ret
  113397. if err := gensupport.DecodeResponse(target, res); err != nil {
  113398. return nil, err
  113399. }
  113400. return ret, nil
  113401. // {
  113402. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  113403. // "httpMethod": "GET",
  113404. // "id": "compute.regionOperations.list",
  113405. // "parameterOrder": [
  113406. // "project",
  113407. // "region"
  113408. // ],
  113409. // "parameters": {
  113410. // "filter": {
  113411. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  113412. // "location": "query",
  113413. // "type": "string"
  113414. // },
  113415. // "maxResults": {
  113416. // "default": "500",
  113417. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  113418. // "format": "uint32",
  113419. // "location": "query",
  113420. // "minimum": "0",
  113421. // "type": "integer"
  113422. // },
  113423. // "orderBy": {
  113424. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  113425. // "location": "query",
  113426. // "type": "string"
  113427. // },
  113428. // "pageToken": {
  113429. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  113430. // "location": "query",
  113431. // "type": "string"
  113432. // },
  113433. // "project": {
  113434. // "description": "Project ID for this request.",
  113435. // "location": "path",
  113436. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113437. // "required": true,
  113438. // "type": "string"
  113439. // },
  113440. // "region": {
  113441. // "description": "Name of the region for this request.",
  113442. // "location": "path",
  113443. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113444. // "required": true,
  113445. // "type": "string"
  113446. // }
  113447. // },
  113448. // "path": "{project}/regions/{region}/operations",
  113449. // "response": {
  113450. // "$ref": "OperationList"
  113451. // },
  113452. // "scopes": [
  113453. // "https://www.googleapis.com/auth/cloud-platform",
  113454. // "https://www.googleapis.com/auth/compute",
  113455. // "https://www.googleapis.com/auth/compute.readonly"
  113456. // ]
  113457. // }
  113458. }
  113459. // Pages invokes f for each page of results.
  113460. // A non-nil error returned from f will halt the iteration.
  113461. // The provided context supersedes any context provided to the Context method.
  113462. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  113463. c.ctx_ = ctx
  113464. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  113465. for {
  113466. x, err := c.Do()
  113467. if err != nil {
  113468. return err
  113469. }
  113470. if err := f(x); err != nil {
  113471. return err
  113472. }
  113473. if x.NextPageToken == "" {
  113474. return nil
  113475. }
  113476. c.PageToken(x.NextPageToken)
  113477. }
  113478. }
  113479. // method id "compute.regionOperations.wait":
  113480. type RegionOperationsWaitCall struct {
  113481. s *Service
  113482. project string
  113483. region string
  113484. operation string
  113485. urlParams_ gensupport.URLParams
  113486. ctx_ context.Context
  113487. header_ http.Header
  113488. }
  113489. // Wait: Waits for the specified region-specific Operations resource
  113490. // until it is done or timeout, and retrieves the specified Operations
  113491. // resource. 1. Immediately returns when the operation is already done.
  113492. // 2. Waits for no more than the default deadline (2 minutes, subject to
  113493. // change) and then returns the current state of the operation, which
  113494. // may be DONE or still in progress. 3. Is best-effort: a. The server
  113495. // can wait less than the default deadline or zero seconds, in overload
  113496. // situations. b. There is no guarantee that the operation is actually
  113497. // done when returns. 4. User should be prepared to retry if the
  113498. // operation is not DONE.
  113499. func (r *RegionOperationsService) Wait(project string, region string, operation string) *RegionOperationsWaitCall {
  113500. c := &RegionOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113501. c.project = project
  113502. c.region = region
  113503. c.operation = operation
  113504. return c
  113505. }
  113506. // Fields allows partial responses to be retrieved. See
  113507. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113508. // for more information.
  113509. func (c *RegionOperationsWaitCall) Fields(s ...googleapi.Field) *RegionOperationsWaitCall {
  113510. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113511. return c
  113512. }
  113513. // Context sets the context to be used in this call's Do method. Any
  113514. // pending HTTP request will be aborted if the provided context is
  113515. // canceled.
  113516. func (c *RegionOperationsWaitCall) Context(ctx context.Context) *RegionOperationsWaitCall {
  113517. c.ctx_ = ctx
  113518. return c
  113519. }
  113520. // Header returns an http.Header that can be modified by the caller to
  113521. // add HTTP headers to the request.
  113522. func (c *RegionOperationsWaitCall) Header() http.Header {
  113523. if c.header_ == nil {
  113524. c.header_ = make(http.Header)
  113525. }
  113526. return c.header_
  113527. }
  113528. func (c *RegionOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  113529. reqHeaders := make(http.Header)
  113530. for k, v := range c.header_ {
  113531. reqHeaders[k] = v
  113532. }
  113533. reqHeaders.Set("User-Agent", c.s.userAgent())
  113534. var body io.Reader = nil
  113535. c.urlParams_.Set("alt", alt)
  113536. c.urlParams_.Set("prettyPrint", "false")
  113537. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}/wait")
  113538. urls += "?" + c.urlParams_.Encode()
  113539. req, err := http.NewRequest("POST", urls, body)
  113540. if err != nil {
  113541. return nil, err
  113542. }
  113543. req.Header = reqHeaders
  113544. googleapi.Expand(req.URL, map[string]string{
  113545. "project": c.project,
  113546. "region": c.region,
  113547. "operation": c.operation,
  113548. })
  113549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113550. }
  113551. // Do executes the "compute.regionOperations.wait" call.
  113552. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113553. // status code is an error. Response headers are in either
  113554. // *Operation.ServerResponse.Header or (if a response was returned at
  113555. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113556. // to check whether the returned error was because
  113557. // http.StatusNotModified was returned.
  113558. func (c *RegionOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113559. gensupport.SetOptions(c.urlParams_, opts...)
  113560. res, err := c.doRequest("json")
  113561. if res != nil && res.StatusCode == http.StatusNotModified {
  113562. if res.Body != nil {
  113563. res.Body.Close()
  113564. }
  113565. return nil, &googleapi.Error{
  113566. Code: res.StatusCode,
  113567. Header: res.Header,
  113568. }
  113569. }
  113570. if err != nil {
  113571. return nil, err
  113572. }
  113573. defer googleapi.CloseBody(res)
  113574. if err := googleapi.CheckResponse(res); err != nil {
  113575. return nil, err
  113576. }
  113577. ret := &Operation{
  113578. ServerResponse: googleapi.ServerResponse{
  113579. Header: res.Header,
  113580. HTTPStatusCode: res.StatusCode,
  113581. },
  113582. }
  113583. target := &ret
  113584. if err := gensupport.DecodeResponse(target, res); err != nil {
  113585. return nil, err
  113586. }
  113587. return ret, nil
  113588. // {
  113589. // "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.",
  113590. // "httpMethod": "POST",
  113591. // "id": "compute.regionOperations.wait",
  113592. // "parameterOrder": [
  113593. // "project",
  113594. // "region",
  113595. // "operation"
  113596. // ],
  113597. // "parameters": {
  113598. // "operation": {
  113599. // "description": "Name of the Operations resource to return.",
  113600. // "location": "path",
  113601. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113602. // "required": true,
  113603. // "type": "string"
  113604. // },
  113605. // "project": {
  113606. // "description": "Project ID for this request.",
  113607. // "location": "path",
  113608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113609. // "required": true,
  113610. // "type": "string"
  113611. // },
  113612. // "region": {
  113613. // "description": "Name of the region for this request.",
  113614. // "location": "path",
  113615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113616. // "required": true,
  113617. // "type": "string"
  113618. // }
  113619. // },
  113620. // "path": "{project}/regions/{region}/operations/{operation}/wait",
  113621. // "response": {
  113622. // "$ref": "Operation"
  113623. // },
  113624. // "scopes": [
  113625. // "https://www.googleapis.com/auth/cloud-platform",
  113626. // "https://www.googleapis.com/auth/compute",
  113627. // "https://www.googleapis.com/auth/compute.readonly"
  113628. // ]
  113629. // }
  113630. }
  113631. // method id "compute.regionSslCertificates.delete":
  113632. type RegionSslCertificatesDeleteCall struct {
  113633. s *Service
  113634. project string
  113635. region string
  113636. sslCertificate string
  113637. urlParams_ gensupport.URLParams
  113638. ctx_ context.Context
  113639. header_ http.Header
  113640. }
  113641. // Delete: Deletes the specified SslCertificate resource in the region.
  113642. func (r *RegionSslCertificatesService) Delete(project string, region string, sslCertificate string) *RegionSslCertificatesDeleteCall {
  113643. c := &RegionSslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113644. c.project = project
  113645. c.region = region
  113646. c.sslCertificate = sslCertificate
  113647. return c
  113648. }
  113649. // RequestId sets the optional parameter "requestId": An optional
  113650. // request ID to identify requests. Specify a unique request ID so that
  113651. // if you must retry your request, the server will know to ignore the
  113652. // request if it has already been completed.
  113653. //
  113654. // For example, consider a situation where you make an initial request
  113655. // and the request times out. If you make the request again with the
  113656. // same request ID, the server can check if original operation with the
  113657. // same request ID was received, and if so, will ignore the second
  113658. // request. This prevents clients from accidentally creating duplicate
  113659. // commitments.
  113660. //
  113661. // The request ID must be a valid UUID with the exception that zero UUID
  113662. // is not supported (00000000-0000-0000-0000-000000000000).
  113663. func (c *RegionSslCertificatesDeleteCall) RequestId(requestId string) *RegionSslCertificatesDeleteCall {
  113664. c.urlParams_.Set("requestId", requestId)
  113665. return c
  113666. }
  113667. // Fields allows partial responses to be retrieved. See
  113668. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113669. // for more information.
  113670. func (c *RegionSslCertificatesDeleteCall) Fields(s ...googleapi.Field) *RegionSslCertificatesDeleteCall {
  113671. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113672. return c
  113673. }
  113674. // Context sets the context to be used in this call's Do method. Any
  113675. // pending HTTP request will be aborted if the provided context is
  113676. // canceled.
  113677. func (c *RegionSslCertificatesDeleteCall) Context(ctx context.Context) *RegionSslCertificatesDeleteCall {
  113678. c.ctx_ = ctx
  113679. return c
  113680. }
  113681. // Header returns an http.Header that can be modified by the caller to
  113682. // add HTTP headers to the request.
  113683. func (c *RegionSslCertificatesDeleteCall) Header() http.Header {
  113684. if c.header_ == nil {
  113685. c.header_ = make(http.Header)
  113686. }
  113687. return c.header_
  113688. }
  113689. func (c *RegionSslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  113690. reqHeaders := make(http.Header)
  113691. for k, v := range c.header_ {
  113692. reqHeaders[k] = v
  113693. }
  113694. reqHeaders.Set("User-Agent", c.s.userAgent())
  113695. var body io.Reader = nil
  113696. c.urlParams_.Set("alt", alt)
  113697. c.urlParams_.Set("prettyPrint", "false")
  113698. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates/{sslCertificate}")
  113699. urls += "?" + c.urlParams_.Encode()
  113700. req, err := http.NewRequest("DELETE", urls, body)
  113701. if err != nil {
  113702. return nil, err
  113703. }
  113704. req.Header = reqHeaders
  113705. googleapi.Expand(req.URL, map[string]string{
  113706. "project": c.project,
  113707. "region": c.region,
  113708. "sslCertificate": c.sslCertificate,
  113709. })
  113710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113711. }
  113712. // Do executes the "compute.regionSslCertificates.delete" call.
  113713. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113714. // status code is an error. Response headers are in either
  113715. // *Operation.ServerResponse.Header or (if a response was returned at
  113716. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113717. // to check whether the returned error was because
  113718. // http.StatusNotModified was returned.
  113719. func (c *RegionSslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113720. gensupport.SetOptions(c.urlParams_, opts...)
  113721. res, err := c.doRequest("json")
  113722. if res != nil && res.StatusCode == http.StatusNotModified {
  113723. if res.Body != nil {
  113724. res.Body.Close()
  113725. }
  113726. return nil, &googleapi.Error{
  113727. Code: res.StatusCode,
  113728. Header: res.Header,
  113729. }
  113730. }
  113731. if err != nil {
  113732. return nil, err
  113733. }
  113734. defer googleapi.CloseBody(res)
  113735. if err := googleapi.CheckResponse(res); err != nil {
  113736. return nil, err
  113737. }
  113738. ret := &Operation{
  113739. ServerResponse: googleapi.ServerResponse{
  113740. Header: res.Header,
  113741. HTTPStatusCode: res.StatusCode,
  113742. },
  113743. }
  113744. target := &ret
  113745. if err := gensupport.DecodeResponse(target, res); err != nil {
  113746. return nil, err
  113747. }
  113748. return ret, nil
  113749. // {
  113750. // "description": "Deletes the specified SslCertificate resource in the region.",
  113751. // "httpMethod": "DELETE",
  113752. // "id": "compute.regionSslCertificates.delete",
  113753. // "parameterOrder": [
  113754. // "project",
  113755. // "region",
  113756. // "sslCertificate"
  113757. // ],
  113758. // "parameters": {
  113759. // "project": {
  113760. // "description": "Project ID for this request.",
  113761. // "location": "path",
  113762. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113763. // "required": true,
  113764. // "type": "string"
  113765. // },
  113766. // "region": {
  113767. // "description": "Name of the region scoping this request.",
  113768. // "location": "path",
  113769. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113770. // "required": true,
  113771. // "type": "string"
  113772. // },
  113773. // "requestId": {
  113774. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113775. // "location": "query",
  113776. // "type": "string"
  113777. // },
  113778. // "sslCertificate": {
  113779. // "description": "Name of the SslCertificate resource to delete.",
  113780. // "location": "path",
  113781. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113782. // "required": true,
  113783. // "type": "string"
  113784. // }
  113785. // },
  113786. // "path": "{project}/regions/{region}/sslCertificates/{sslCertificate}",
  113787. // "response": {
  113788. // "$ref": "Operation"
  113789. // },
  113790. // "scopes": [
  113791. // "https://www.googleapis.com/auth/cloud-platform",
  113792. // "https://www.googleapis.com/auth/compute"
  113793. // ]
  113794. // }
  113795. }
  113796. // method id "compute.regionSslCertificates.get":
  113797. type RegionSslCertificatesGetCall struct {
  113798. s *Service
  113799. project string
  113800. region string
  113801. sslCertificate string
  113802. urlParams_ gensupport.URLParams
  113803. ifNoneMatch_ string
  113804. ctx_ context.Context
  113805. header_ http.Header
  113806. }
  113807. // Get: Returns the specified SslCertificate resource in the specified
  113808. // region. Get a list of available SSL certificates by making a list()
  113809. // request.
  113810. func (r *RegionSslCertificatesService) Get(project string, region string, sslCertificate string) *RegionSslCertificatesGetCall {
  113811. c := &RegionSslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113812. c.project = project
  113813. c.region = region
  113814. c.sslCertificate = sslCertificate
  113815. return c
  113816. }
  113817. // Fields allows partial responses to be retrieved. See
  113818. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113819. // for more information.
  113820. func (c *RegionSslCertificatesGetCall) Fields(s ...googleapi.Field) *RegionSslCertificatesGetCall {
  113821. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113822. return c
  113823. }
  113824. // IfNoneMatch sets the optional parameter which makes the operation
  113825. // fail if the object's ETag matches the given value. This is useful for
  113826. // getting updates only after the object has changed since the last
  113827. // request. Use googleapi.IsNotModified to check whether the response
  113828. // error from Do is the result of In-None-Match.
  113829. func (c *RegionSslCertificatesGetCall) IfNoneMatch(entityTag string) *RegionSslCertificatesGetCall {
  113830. c.ifNoneMatch_ = entityTag
  113831. return c
  113832. }
  113833. // Context sets the context to be used in this call's Do method. Any
  113834. // pending HTTP request will be aborted if the provided context is
  113835. // canceled.
  113836. func (c *RegionSslCertificatesGetCall) Context(ctx context.Context) *RegionSslCertificatesGetCall {
  113837. c.ctx_ = ctx
  113838. return c
  113839. }
  113840. // Header returns an http.Header that can be modified by the caller to
  113841. // add HTTP headers to the request.
  113842. func (c *RegionSslCertificatesGetCall) Header() http.Header {
  113843. if c.header_ == nil {
  113844. c.header_ = make(http.Header)
  113845. }
  113846. return c.header_
  113847. }
  113848. func (c *RegionSslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  113849. reqHeaders := make(http.Header)
  113850. for k, v := range c.header_ {
  113851. reqHeaders[k] = v
  113852. }
  113853. reqHeaders.Set("User-Agent", c.s.userAgent())
  113854. if c.ifNoneMatch_ != "" {
  113855. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113856. }
  113857. var body io.Reader = nil
  113858. c.urlParams_.Set("alt", alt)
  113859. c.urlParams_.Set("prettyPrint", "false")
  113860. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates/{sslCertificate}")
  113861. urls += "?" + c.urlParams_.Encode()
  113862. req, err := http.NewRequest("GET", urls, body)
  113863. if err != nil {
  113864. return nil, err
  113865. }
  113866. req.Header = reqHeaders
  113867. googleapi.Expand(req.URL, map[string]string{
  113868. "project": c.project,
  113869. "region": c.region,
  113870. "sslCertificate": c.sslCertificate,
  113871. })
  113872. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113873. }
  113874. // Do executes the "compute.regionSslCertificates.get" call.
  113875. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  113876. // status code is an error. Response headers are in either
  113877. // *SslCertificate.ServerResponse.Header or (if a response was returned
  113878. // at all) in error.(*googleapi.Error).Header. Use
  113879. // googleapi.IsNotModified to check whether the returned error was
  113880. // because http.StatusNotModified was returned.
  113881. func (c *RegionSslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  113882. gensupport.SetOptions(c.urlParams_, opts...)
  113883. res, err := c.doRequest("json")
  113884. if res != nil && res.StatusCode == http.StatusNotModified {
  113885. if res.Body != nil {
  113886. res.Body.Close()
  113887. }
  113888. return nil, &googleapi.Error{
  113889. Code: res.StatusCode,
  113890. Header: res.Header,
  113891. }
  113892. }
  113893. if err != nil {
  113894. return nil, err
  113895. }
  113896. defer googleapi.CloseBody(res)
  113897. if err := googleapi.CheckResponse(res); err != nil {
  113898. return nil, err
  113899. }
  113900. ret := &SslCertificate{
  113901. ServerResponse: googleapi.ServerResponse{
  113902. Header: res.Header,
  113903. HTTPStatusCode: res.StatusCode,
  113904. },
  113905. }
  113906. target := &ret
  113907. if err := gensupport.DecodeResponse(target, res); err != nil {
  113908. return nil, err
  113909. }
  113910. return ret, nil
  113911. // {
  113912. // "description": "Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request.",
  113913. // "httpMethod": "GET",
  113914. // "id": "compute.regionSslCertificates.get",
  113915. // "parameterOrder": [
  113916. // "project",
  113917. // "region",
  113918. // "sslCertificate"
  113919. // ],
  113920. // "parameters": {
  113921. // "project": {
  113922. // "description": "Project ID for this request.",
  113923. // "location": "path",
  113924. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113925. // "required": true,
  113926. // "type": "string"
  113927. // },
  113928. // "region": {
  113929. // "description": "Name of the region scoping this request.",
  113930. // "location": "path",
  113931. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113932. // "required": true,
  113933. // "type": "string"
  113934. // },
  113935. // "sslCertificate": {
  113936. // "description": "Name of the SslCertificate resource to return.",
  113937. // "location": "path",
  113938. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113939. // "required": true,
  113940. // "type": "string"
  113941. // }
  113942. // },
  113943. // "path": "{project}/regions/{region}/sslCertificates/{sslCertificate}",
  113944. // "response": {
  113945. // "$ref": "SslCertificate"
  113946. // },
  113947. // "scopes": [
  113948. // "https://www.googleapis.com/auth/cloud-platform",
  113949. // "https://www.googleapis.com/auth/compute",
  113950. // "https://www.googleapis.com/auth/compute.readonly"
  113951. // ]
  113952. // }
  113953. }
  113954. // method id "compute.regionSslCertificates.insert":
  113955. type RegionSslCertificatesInsertCall struct {
  113956. s *Service
  113957. project string
  113958. region string
  113959. sslcertificate *SslCertificate
  113960. urlParams_ gensupport.URLParams
  113961. ctx_ context.Context
  113962. header_ http.Header
  113963. }
  113964. // Insert: Creates a SslCertificate resource in the specified project
  113965. // and region using the data included in the request
  113966. func (r *RegionSslCertificatesService) Insert(project string, region string, sslcertificate *SslCertificate) *RegionSslCertificatesInsertCall {
  113967. c := &RegionSslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113968. c.project = project
  113969. c.region = region
  113970. c.sslcertificate = sslcertificate
  113971. return c
  113972. }
  113973. // RequestId sets the optional parameter "requestId": An optional
  113974. // request ID to identify requests. Specify a unique request ID so that
  113975. // if you must retry your request, the server will know to ignore the
  113976. // request if it has already been completed.
  113977. //
  113978. // For example, consider a situation where you make an initial request
  113979. // and the request times out. If you make the request again with the
  113980. // same request ID, the server can check if original operation with the
  113981. // same request ID was received, and if so, will ignore the second
  113982. // request. This prevents clients from accidentally creating duplicate
  113983. // commitments.
  113984. //
  113985. // The request ID must be a valid UUID with the exception that zero UUID
  113986. // is not supported (00000000-0000-0000-0000-000000000000).
  113987. func (c *RegionSslCertificatesInsertCall) RequestId(requestId string) *RegionSslCertificatesInsertCall {
  113988. c.urlParams_.Set("requestId", requestId)
  113989. return c
  113990. }
  113991. // Fields allows partial responses to be retrieved. See
  113992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113993. // for more information.
  113994. func (c *RegionSslCertificatesInsertCall) Fields(s ...googleapi.Field) *RegionSslCertificatesInsertCall {
  113995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113996. return c
  113997. }
  113998. // Context sets the context to be used in this call's Do method. Any
  113999. // pending HTTP request will be aborted if the provided context is
  114000. // canceled.
  114001. func (c *RegionSslCertificatesInsertCall) Context(ctx context.Context) *RegionSslCertificatesInsertCall {
  114002. c.ctx_ = ctx
  114003. return c
  114004. }
  114005. // Header returns an http.Header that can be modified by the caller to
  114006. // add HTTP headers to the request.
  114007. func (c *RegionSslCertificatesInsertCall) Header() http.Header {
  114008. if c.header_ == nil {
  114009. c.header_ = make(http.Header)
  114010. }
  114011. return c.header_
  114012. }
  114013. func (c *RegionSslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  114014. reqHeaders := make(http.Header)
  114015. for k, v := range c.header_ {
  114016. reqHeaders[k] = v
  114017. }
  114018. reqHeaders.Set("User-Agent", c.s.userAgent())
  114019. var body io.Reader = nil
  114020. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  114021. if err != nil {
  114022. return nil, err
  114023. }
  114024. reqHeaders.Set("Content-Type", "application/json")
  114025. c.urlParams_.Set("alt", alt)
  114026. c.urlParams_.Set("prettyPrint", "false")
  114027. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates")
  114028. urls += "?" + c.urlParams_.Encode()
  114029. req, err := http.NewRequest("POST", urls, body)
  114030. if err != nil {
  114031. return nil, err
  114032. }
  114033. req.Header = reqHeaders
  114034. googleapi.Expand(req.URL, map[string]string{
  114035. "project": c.project,
  114036. "region": c.region,
  114037. })
  114038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114039. }
  114040. // Do executes the "compute.regionSslCertificates.insert" call.
  114041. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114042. // status code is an error. Response headers are in either
  114043. // *Operation.ServerResponse.Header or (if a response was returned at
  114044. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114045. // to check whether the returned error was because
  114046. // http.StatusNotModified was returned.
  114047. func (c *RegionSslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114048. gensupport.SetOptions(c.urlParams_, opts...)
  114049. res, err := c.doRequest("json")
  114050. if res != nil && res.StatusCode == http.StatusNotModified {
  114051. if res.Body != nil {
  114052. res.Body.Close()
  114053. }
  114054. return nil, &googleapi.Error{
  114055. Code: res.StatusCode,
  114056. Header: res.Header,
  114057. }
  114058. }
  114059. if err != nil {
  114060. return nil, err
  114061. }
  114062. defer googleapi.CloseBody(res)
  114063. if err := googleapi.CheckResponse(res); err != nil {
  114064. return nil, err
  114065. }
  114066. ret := &Operation{
  114067. ServerResponse: googleapi.ServerResponse{
  114068. Header: res.Header,
  114069. HTTPStatusCode: res.StatusCode,
  114070. },
  114071. }
  114072. target := &ret
  114073. if err := gensupport.DecodeResponse(target, res); err != nil {
  114074. return nil, err
  114075. }
  114076. return ret, nil
  114077. // {
  114078. // "description": "Creates a SslCertificate resource in the specified project and region using the data included in the request",
  114079. // "httpMethod": "POST",
  114080. // "id": "compute.regionSslCertificates.insert",
  114081. // "parameterOrder": [
  114082. // "project",
  114083. // "region"
  114084. // ],
  114085. // "parameters": {
  114086. // "project": {
  114087. // "description": "Project ID for this request.",
  114088. // "location": "path",
  114089. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114090. // "required": true,
  114091. // "type": "string"
  114092. // },
  114093. // "region": {
  114094. // "description": "Name of the region scoping this request.",
  114095. // "location": "path",
  114096. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114097. // "required": true,
  114098. // "type": "string"
  114099. // },
  114100. // "requestId": {
  114101. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114102. // "location": "query",
  114103. // "type": "string"
  114104. // }
  114105. // },
  114106. // "path": "{project}/regions/{region}/sslCertificates",
  114107. // "request": {
  114108. // "$ref": "SslCertificate"
  114109. // },
  114110. // "response": {
  114111. // "$ref": "Operation"
  114112. // },
  114113. // "scopes": [
  114114. // "https://www.googleapis.com/auth/cloud-platform",
  114115. // "https://www.googleapis.com/auth/compute"
  114116. // ]
  114117. // }
  114118. }
  114119. // method id "compute.regionSslCertificates.list":
  114120. type RegionSslCertificatesListCall struct {
  114121. s *Service
  114122. project string
  114123. region string
  114124. urlParams_ gensupport.URLParams
  114125. ifNoneMatch_ string
  114126. ctx_ context.Context
  114127. header_ http.Header
  114128. }
  114129. // List: Retrieves the list of SslCertificate resources available to the
  114130. // specified project in the specified region.
  114131. func (r *RegionSslCertificatesService) List(project string, region string) *RegionSslCertificatesListCall {
  114132. c := &RegionSslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114133. c.project = project
  114134. c.region = region
  114135. return c
  114136. }
  114137. // Filter sets the optional parameter "filter": A filter expression that
  114138. // filters resources listed in the response. The expression must specify
  114139. // the field name, a comparison operator, and the value that you want to
  114140. // use for filtering. The value must be a string, a number, or a
  114141. // boolean. The comparison operator must be either =, !=, >, or <.
  114142. //
  114143. // For example, if you are filtering Compute Engine instances, you can
  114144. // exclude instances named example-instance by specifying name !=
  114145. // example-instance.
  114146. //
  114147. // You can also filter nested fields. For example, you could specify
  114148. // scheduling.automaticRestart = false to include instances only if they
  114149. // are not scheduled for automatic restarts. You can use filtering on
  114150. // nested fields to filter based on resource labels.
  114151. //
  114152. // To filter on multiple expressions, provide each separate expression
  114153. // within parentheses. For example, (scheduling.automaticRestart = true)
  114154. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  114155. // AND expression. However, you can include AND and OR expressions
  114156. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  114157. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  114158. // true).
  114159. func (c *RegionSslCertificatesListCall) Filter(filter string) *RegionSslCertificatesListCall {
  114160. c.urlParams_.Set("filter", filter)
  114161. return c
  114162. }
  114163. // MaxResults sets the optional parameter "maxResults": The maximum
  114164. // number of results per page that should be returned. If the number of
  114165. // available results is larger than maxResults, Compute Engine returns a
  114166. // nextPageToken that can be used to get the next page of results in
  114167. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  114168. // (Default: 500)
  114169. func (c *RegionSslCertificatesListCall) MaxResults(maxResults int64) *RegionSslCertificatesListCall {
  114170. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  114171. return c
  114172. }
  114173. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  114174. // a certain order. By default, results are returned in alphanumerical
  114175. // order based on the resource name.
  114176. //
  114177. // You can also sort results in descending order based on the creation
  114178. // timestamp using orderBy="creationTimestamp desc". This sorts results
  114179. // based on the creationTimestamp field in reverse chronological order
  114180. // (newest result first). Use this to sort resources like operations so
  114181. // that the newest operation is returned first.
  114182. //
  114183. // Currently, only sorting by name or creationTimestamp desc is
  114184. // supported.
  114185. func (c *RegionSslCertificatesListCall) OrderBy(orderBy string) *RegionSslCertificatesListCall {
  114186. c.urlParams_.Set("orderBy", orderBy)
  114187. return c
  114188. }
  114189. // PageToken sets the optional parameter "pageToken": Specifies a page
  114190. // token to use. Set pageToken to the nextPageToken returned by a
  114191. // previous list request to get the next page of results.
  114192. func (c *RegionSslCertificatesListCall) PageToken(pageToken string) *RegionSslCertificatesListCall {
  114193. c.urlParams_.Set("pageToken", pageToken)
  114194. return c
  114195. }
  114196. // Fields allows partial responses to be retrieved. See
  114197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114198. // for more information.
  114199. func (c *RegionSslCertificatesListCall) Fields(s ...googleapi.Field) *RegionSslCertificatesListCall {
  114200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114201. return c
  114202. }
  114203. // IfNoneMatch sets the optional parameter which makes the operation
  114204. // fail if the object's ETag matches the given value. This is useful for
  114205. // getting updates only after the object has changed since the last
  114206. // request. Use googleapi.IsNotModified to check whether the response
  114207. // error from Do is the result of In-None-Match.
  114208. func (c *RegionSslCertificatesListCall) IfNoneMatch(entityTag string) *RegionSslCertificatesListCall {
  114209. c.ifNoneMatch_ = entityTag
  114210. return c
  114211. }
  114212. // Context sets the context to be used in this call's Do method. Any
  114213. // pending HTTP request will be aborted if the provided context is
  114214. // canceled.
  114215. func (c *RegionSslCertificatesListCall) Context(ctx context.Context) *RegionSslCertificatesListCall {
  114216. c.ctx_ = ctx
  114217. return c
  114218. }
  114219. // Header returns an http.Header that can be modified by the caller to
  114220. // add HTTP headers to the request.
  114221. func (c *RegionSslCertificatesListCall) Header() http.Header {
  114222. if c.header_ == nil {
  114223. c.header_ = make(http.Header)
  114224. }
  114225. return c.header_
  114226. }
  114227. func (c *RegionSslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  114228. reqHeaders := make(http.Header)
  114229. for k, v := range c.header_ {
  114230. reqHeaders[k] = v
  114231. }
  114232. reqHeaders.Set("User-Agent", c.s.userAgent())
  114233. if c.ifNoneMatch_ != "" {
  114234. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114235. }
  114236. var body io.Reader = nil
  114237. c.urlParams_.Set("alt", alt)
  114238. c.urlParams_.Set("prettyPrint", "false")
  114239. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates")
  114240. urls += "?" + c.urlParams_.Encode()
  114241. req, err := http.NewRequest("GET", urls, body)
  114242. if err != nil {
  114243. return nil, err
  114244. }
  114245. req.Header = reqHeaders
  114246. googleapi.Expand(req.URL, map[string]string{
  114247. "project": c.project,
  114248. "region": c.region,
  114249. })
  114250. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114251. }
  114252. // Do executes the "compute.regionSslCertificates.list" call.
  114253. // Exactly one of *SslCertificateList or error will be non-nil. Any
  114254. // non-2xx status code is an error. Response headers are in either
  114255. // *SslCertificateList.ServerResponse.Header or (if a response was
  114256. // returned at all) in error.(*googleapi.Error).Header. Use
  114257. // googleapi.IsNotModified to check whether the returned error was
  114258. // because http.StatusNotModified was returned.
  114259. func (c *RegionSslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  114260. gensupport.SetOptions(c.urlParams_, opts...)
  114261. res, err := c.doRequest("json")
  114262. if res != nil && res.StatusCode == http.StatusNotModified {
  114263. if res.Body != nil {
  114264. res.Body.Close()
  114265. }
  114266. return nil, &googleapi.Error{
  114267. Code: res.StatusCode,
  114268. Header: res.Header,
  114269. }
  114270. }
  114271. if err != nil {
  114272. return nil, err
  114273. }
  114274. defer googleapi.CloseBody(res)
  114275. if err := googleapi.CheckResponse(res); err != nil {
  114276. return nil, err
  114277. }
  114278. ret := &SslCertificateList{
  114279. ServerResponse: googleapi.ServerResponse{
  114280. Header: res.Header,
  114281. HTTPStatusCode: res.StatusCode,
  114282. },
  114283. }
  114284. target := &ret
  114285. if err := gensupport.DecodeResponse(target, res); err != nil {
  114286. return nil, err
  114287. }
  114288. return ret, nil
  114289. // {
  114290. // "description": "Retrieves the list of SslCertificate resources available to the specified project in the specified region.",
  114291. // "httpMethod": "GET",
  114292. // "id": "compute.regionSslCertificates.list",
  114293. // "parameterOrder": [
  114294. // "project",
  114295. // "region"
  114296. // ],
  114297. // "parameters": {
  114298. // "filter": {
  114299. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  114300. // "location": "query",
  114301. // "type": "string"
  114302. // },
  114303. // "maxResults": {
  114304. // "default": "500",
  114305. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  114306. // "format": "uint32",
  114307. // "location": "query",
  114308. // "minimum": "0",
  114309. // "type": "integer"
  114310. // },
  114311. // "orderBy": {
  114312. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  114313. // "location": "query",
  114314. // "type": "string"
  114315. // },
  114316. // "pageToken": {
  114317. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  114318. // "location": "query",
  114319. // "type": "string"
  114320. // },
  114321. // "project": {
  114322. // "description": "Project ID for this request.",
  114323. // "location": "path",
  114324. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114325. // "required": true,
  114326. // "type": "string"
  114327. // },
  114328. // "region": {
  114329. // "description": "Name of the region scoping this request.",
  114330. // "location": "path",
  114331. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114332. // "required": true,
  114333. // "type": "string"
  114334. // }
  114335. // },
  114336. // "path": "{project}/regions/{region}/sslCertificates",
  114337. // "response": {
  114338. // "$ref": "SslCertificateList"
  114339. // },
  114340. // "scopes": [
  114341. // "https://www.googleapis.com/auth/cloud-platform",
  114342. // "https://www.googleapis.com/auth/compute",
  114343. // "https://www.googleapis.com/auth/compute.readonly"
  114344. // ]
  114345. // }
  114346. }
  114347. // Pages invokes f for each page of results.
  114348. // A non-nil error returned from f will halt the iteration.
  114349. // The provided context supersedes any context provided to the Context method.
  114350. func (c *RegionSslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  114351. c.ctx_ = ctx
  114352. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  114353. for {
  114354. x, err := c.Do()
  114355. if err != nil {
  114356. return err
  114357. }
  114358. if err := f(x); err != nil {
  114359. return err
  114360. }
  114361. if x.NextPageToken == "" {
  114362. return nil
  114363. }
  114364. c.PageToken(x.NextPageToken)
  114365. }
  114366. }
  114367. // method id "compute.regionSslCertificates.testIamPermissions":
  114368. type RegionSslCertificatesTestIamPermissionsCall struct {
  114369. s *Service
  114370. project string
  114371. region string
  114372. resource string
  114373. testpermissionsrequest *TestPermissionsRequest
  114374. urlParams_ gensupport.URLParams
  114375. ctx_ context.Context
  114376. header_ http.Header
  114377. }
  114378. // TestIamPermissions: Returns permissions that a caller has on the
  114379. // specified resource and region.
  114380. func (r *RegionSslCertificatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionSslCertificatesTestIamPermissionsCall {
  114381. c := &RegionSslCertificatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114382. c.project = project
  114383. c.region = region
  114384. c.resource = resource
  114385. c.testpermissionsrequest = testpermissionsrequest
  114386. return c
  114387. }
  114388. // Fields allows partial responses to be retrieved. See
  114389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114390. // for more information.
  114391. func (c *RegionSslCertificatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionSslCertificatesTestIamPermissionsCall {
  114392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114393. return c
  114394. }
  114395. // Context sets the context to be used in this call's Do method. Any
  114396. // pending HTTP request will be aborted if the provided context is
  114397. // canceled.
  114398. func (c *RegionSslCertificatesTestIamPermissionsCall) Context(ctx context.Context) *RegionSslCertificatesTestIamPermissionsCall {
  114399. c.ctx_ = ctx
  114400. return c
  114401. }
  114402. // Header returns an http.Header that can be modified by the caller to
  114403. // add HTTP headers to the request.
  114404. func (c *RegionSslCertificatesTestIamPermissionsCall) Header() http.Header {
  114405. if c.header_ == nil {
  114406. c.header_ = make(http.Header)
  114407. }
  114408. return c.header_
  114409. }
  114410. func (c *RegionSslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  114411. reqHeaders := make(http.Header)
  114412. for k, v := range c.header_ {
  114413. reqHeaders[k] = v
  114414. }
  114415. reqHeaders.Set("User-Agent", c.s.userAgent())
  114416. var body io.Reader = nil
  114417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  114418. if err != nil {
  114419. return nil, err
  114420. }
  114421. reqHeaders.Set("Content-Type", "application/json")
  114422. c.urlParams_.Set("alt", alt)
  114423. c.urlParams_.Set("prettyPrint", "false")
  114424. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates/{resource}/testIamPermissions")
  114425. urls += "?" + c.urlParams_.Encode()
  114426. req, err := http.NewRequest("POST", urls, body)
  114427. if err != nil {
  114428. return nil, err
  114429. }
  114430. req.Header = reqHeaders
  114431. googleapi.Expand(req.URL, map[string]string{
  114432. "project": c.project,
  114433. "region": c.region,
  114434. "resource": c.resource,
  114435. })
  114436. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114437. }
  114438. // Do executes the "compute.regionSslCertificates.testIamPermissions" call.
  114439. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  114440. // non-2xx status code is an error. Response headers are in either
  114441. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  114442. // returned at all) in error.(*googleapi.Error).Header. Use
  114443. // googleapi.IsNotModified to check whether the returned error was
  114444. // because http.StatusNotModified was returned.
  114445. func (c *RegionSslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  114446. gensupport.SetOptions(c.urlParams_, opts...)
  114447. res, err := c.doRequest("json")
  114448. if res != nil && res.StatusCode == http.StatusNotModified {
  114449. if res.Body != nil {
  114450. res.Body.Close()
  114451. }
  114452. return nil, &googleapi.Error{
  114453. Code: res.StatusCode,
  114454. Header: res.Header,
  114455. }
  114456. }
  114457. if err != nil {
  114458. return nil, err
  114459. }
  114460. defer googleapi.CloseBody(res)
  114461. if err := googleapi.CheckResponse(res); err != nil {
  114462. return nil, err
  114463. }
  114464. ret := &TestPermissionsResponse{
  114465. ServerResponse: googleapi.ServerResponse{
  114466. Header: res.Header,
  114467. HTTPStatusCode: res.StatusCode,
  114468. },
  114469. }
  114470. target := &ret
  114471. if err := gensupport.DecodeResponse(target, res); err != nil {
  114472. return nil, err
  114473. }
  114474. return ret, nil
  114475. // {
  114476. // "description": "Returns permissions that a caller has on the specified resource and region.",
  114477. // "httpMethod": "POST",
  114478. // "id": "compute.regionSslCertificates.testIamPermissions",
  114479. // "parameterOrder": [
  114480. // "project",
  114481. // "region",
  114482. // "resource"
  114483. // ],
  114484. // "parameters": {
  114485. // "project": {
  114486. // "description": "Project ID for this request.",
  114487. // "location": "path",
  114488. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114489. // "required": true,
  114490. // "type": "string"
  114491. // },
  114492. // "region": {
  114493. // "description": "The name of the region for this request.",
  114494. // "location": "path",
  114495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114496. // "required": true,
  114497. // "type": "string"
  114498. // },
  114499. // "resource": {
  114500. // "description": "Name or id of the resource for this request.",
  114501. // "location": "path",
  114502. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114503. // "required": true,
  114504. // "type": "string"
  114505. // }
  114506. // },
  114507. // "path": "{project}/regions/{region}/sslCertificates/{resource}/testIamPermissions",
  114508. // "request": {
  114509. // "$ref": "TestPermissionsRequest"
  114510. // },
  114511. // "response": {
  114512. // "$ref": "TestPermissionsResponse"
  114513. // },
  114514. // "scopes": [
  114515. // "https://www.googleapis.com/auth/cloud-platform",
  114516. // "https://www.googleapis.com/auth/compute",
  114517. // "https://www.googleapis.com/auth/compute.readonly"
  114518. // ]
  114519. // }
  114520. }
  114521. // method id "compute.regionTargetHttpProxies.delete":
  114522. type RegionTargetHttpProxiesDeleteCall struct {
  114523. s *Service
  114524. project string
  114525. region string
  114526. targetHttpProxy string
  114527. urlParams_ gensupport.URLParams
  114528. ctx_ context.Context
  114529. header_ http.Header
  114530. }
  114531. // Delete: Deletes the specified TargetHttpProxy resource.
  114532. func (r *RegionTargetHttpProxiesService) Delete(project string, region string, targetHttpProxy string) *RegionTargetHttpProxiesDeleteCall {
  114533. c := &RegionTargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114534. c.project = project
  114535. c.region = region
  114536. c.targetHttpProxy = targetHttpProxy
  114537. return c
  114538. }
  114539. // RequestId sets the optional parameter "requestId": An optional
  114540. // request ID to identify requests. Specify a unique request ID so that
  114541. // if you must retry your request, the server will know to ignore the
  114542. // request if it has already been completed.
  114543. //
  114544. // For example, consider a situation where you make an initial request
  114545. // and the request times out. If you make the request again with the
  114546. // same request ID, the server can check if original operation with the
  114547. // same request ID was received, and if so, will ignore the second
  114548. // request. This prevents clients from accidentally creating duplicate
  114549. // commitments.
  114550. //
  114551. // The request ID must be a valid UUID with the exception that zero UUID
  114552. // is not supported (00000000-0000-0000-0000-000000000000).
  114553. func (c *RegionTargetHttpProxiesDeleteCall) RequestId(requestId string) *RegionTargetHttpProxiesDeleteCall {
  114554. c.urlParams_.Set("requestId", requestId)
  114555. return c
  114556. }
  114557. // Fields allows partial responses to be retrieved. See
  114558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114559. // for more information.
  114560. func (c *RegionTargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesDeleteCall {
  114561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114562. return c
  114563. }
  114564. // Context sets the context to be used in this call's Do method. Any
  114565. // pending HTTP request will be aborted if the provided context is
  114566. // canceled.
  114567. func (c *RegionTargetHttpProxiesDeleteCall) Context(ctx context.Context) *RegionTargetHttpProxiesDeleteCall {
  114568. c.ctx_ = ctx
  114569. return c
  114570. }
  114571. // Header returns an http.Header that can be modified by the caller to
  114572. // add HTTP headers to the request.
  114573. func (c *RegionTargetHttpProxiesDeleteCall) Header() http.Header {
  114574. if c.header_ == nil {
  114575. c.header_ = make(http.Header)
  114576. }
  114577. return c.header_
  114578. }
  114579. func (c *RegionTargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  114580. reqHeaders := make(http.Header)
  114581. for k, v := range c.header_ {
  114582. reqHeaders[k] = v
  114583. }
  114584. reqHeaders.Set("User-Agent", c.s.userAgent())
  114585. var body io.Reader = nil
  114586. c.urlParams_.Set("alt", alt)
  114587. c.urlParams_.Set("prettyPrint", "false")
  114588. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}")
  114589. urls += "?" + c.urlParams_.Encode()
  114590. req, err := http.NewRequest("DELETE", urls, body)
  114591. if err != nil {
  114592. return nil, err
  114593. }
  114594. req.Header = reqHeaders
  114595. googleapi.Expand(req.URL, map[string]string{
  114596. "project": c.project,
  114597. "region": c.region,
  114598. "targetHttpProxy": c.targetHttpProxy,
  114599. })
  114600. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114601. }
  114602. // Do executes the "compute.regionTargetHttpProxies.delete" call.
  114603. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114604. // status code is an error. Response headers are in either
  114605. // *Operation.ServerResponse.Header or (if a response was returned at
  114606. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114607. // to check whether the returned error was because
  114608. // http.StatusNotModified was returned.
  114609. func (c *RegionTargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114610. gensupport.SetOptions(c.urlParams_, opts...)
  114611. res, err := c.doRequest("json")
  114612. if res != nil && res.StatusCode == http.StatusNotModified {
  114613. if res.Body != nil {
  114614. res.Body.Close()
  114615. }
  114616. return nil, &googleapi.Error{
  114617. Code: res.StatusCode,
  114618. Header: res.Header,
  114619. }
  114620. }
  114621. if err != nil {
  114622. return nil, err
  114623. }
  114624. defer googleapi.CloseBody(res)
  114625. if err := googleapi.CheckResponse(res); err != nil {
  114626. return nil, err
  114627. }
  114628. ret := &Operation{
  114629. ServerResponse: googleapi.ServerResponse{
  114630. Header: res.Header,
  114631. HTTPStatusCode: res.StatusCode,
  114632. },
  114633. }
  114634. target := &ret
  114635. if err := gensupport.DecodeResponse(target, res); err != nil {
  114636. return nil, err
  114637. }
  114638. return ret, nil
  114639. // {
  114640. // "description": "Deletes the specified TargetHttpProxy resource.",
  114641. // "httpMethod": "DELETE",
  114642. // "id": "compute.regionTargetHttpProxies.delete",
  114643. // "parameterOrder": [
  114644. // "project",
  114645. // "region",
  114646. // "targetHttpProxy"
  114647. // ],
  114648. // "parameters": {
  114649. // "project": {
  114650. // "description": "Project ID for this request.",
  114651. // "location": "path",
  114652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114653. // "required": true,
  114654. // "type": "string"
  114655. // },
  114656. // "region": {
  114657. // "description": "Name of the region scoping this request.",
  114658. // "location": "path",
  114659. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114660. // "required": true,
  114661. // "type": "string"
  114662. // },
  114663. // "requestId": {
  114664. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114665. // "location": "query",
  114666. // "type": "string"
  114667. // },
  114668. // "targetHttpProxy": {
  114669. // "description": "Name of the TargetHttpProxy resource to delete.",
  114670. // "location": "path",
  114671. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114672. // "required": true,
  114673. // "type": "string"
  114674. // }
  114675. // },
  114676. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
  114677. // "response": {
  114678. // "$ref": "Operation"
  114679. // },
  114680. // "scopes": [
  114681. // "https://www.googleapis.com/auth/cloud-platform",
  114682. // "https://www.googleapis.com/auth/compute"
  114683. // ]
  114684. // }
  114685. }
  114686. // method id "compute.regionTargetHttpProxies.get":
  114687. type RegionTargetHttpProxiesGetCall struct {
  114688. s *Service
  114689. project string
  114690. region string
  114691. targetHttpProxy string
  114692. urlParams_ gensupport.URLParams
  114693. ifNoneMatch_ string
  114694. ctx_ context.Context
  114695. header_ http.Header
  114696. }
  114697. // Get: Returns the specified TargetHttpProxy resource in the specified
  114698. // region. Gets a list of available target HTTP proxies by making a
  114699. // list() request.
  114700. func (r *RegionTargetHttpProxiesService) Get(project string, region string, targetHttpProxy string) *RegionTargetHttpProxiesGetCall {
  114701. c := &RegionTargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114702. c.project = project
  114703. c.region = region
  114704. c.targetHttpProxy = targetHttpProxy
  114705. return c
  114706. }
  114707. // Fields allows partial responses to be retrieved. See
  114708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114709. // for more information.
  114710. func (c *RegionTargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesGetCall {
  114711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114712. return c
  114713. }
  114714. // IfNoneMatch sets the optional parameter which makes the operation
  114715. // fail if the object's ETag matches the given value. This is useful for
  114716. // getting updates only after the object has changed since the last
  114717. // request. Use googleapi.IsNotModified to check whether the response
  114718. // error from Do is the result of In-None-Match.
  114719. func (c *RegionTargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *RegionTargetHttpProxiesGetCall {
  114720. c.ifNoneMatch_ = entityTag
  114721. return c
  114722. }
  114723. // Context sets the context to be used in this call's Do method. Any
  114724. // pending HTTP request will be aborted if the provided context is
  114725. // canceled.
  114726. func (c *RegionTargetHttpProxiesGetCall) Context(ctx context.Context) *RegionTargetHttpProxiesGetCall {
  114727. c.ctx_ = ctx
  114728. return c
  114729. }
  114730. // Header returns an http.Header that can be modified by the caller to
  114731. // add HTTP headers to the request.
  114732. func (c *RegionTargetHttpProxiesGetCall) Header() http.Header {
  114733. if c.header_ == nil {
  114734. c.header_ = make(http.Header)
  114735. }
  114736. return c.header_
  114737. }
  114738. func (c *RegionTargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  114739. reqHeaders := make(http.Header)
  114740. for k, v := range c.header_ {
  114741. reqHeaders[k] = v
  114742. }
  114743. reqHeaders.Set("User-Agent", c.s.userAgent())
  114744. if c.ifNoneMatch_ != "" {
  114745. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114746. }
  114747. var body io.Reader = nil
  114748. c.urlParams_.Set("alt", alt)
  114749. c.urlParams_.Set("prettyPrint", "false")
  114750. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}")
  114751. urls += "?" + c.urlParams_.Encode()
  114752. req, err := http.NewRequest("GET", urls, body)
  114753. if err != nil {
  114754. return nil, err
  114755. }
  114756. req.Header = reqHeaders
  114757. googleapi.Expand(req.URL, map[string]string{
  114758. "project": c.project,
  114759. "region": c.region,
  114760. "targetHttpProxy": c.targetHttpProxy,
  114761. })
  114762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114763. }
  114764. // Do executes the "compute.regionTargetHttpProxies.get" call.
  114765. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  114766. // status code is an error. Response headers are in either
  114767. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  114768. // at all) in error.(*googleapi.Error).Header. Use
  114769. // googleapi.IsNotModified to check whether the returned error was
  114770. // because http.StatusNotModified was returned.
  114771. func (c *RegionTargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  114772. gensupport.SetOptions(c.urlParams_, opts...)
  114773. res, err := c.doRequest("json")
  114774. if res != nil && res.StatusCode == http.StatusNotModified {
  114775. if res.Body != nil {
  114776. res.Body.Close()
  114777. }
  114778. return nil, &googleapi.Error{
  114779. Code: res.StatusCode,
  114780. Header: res.Header,
  114781. }
  114782. }
  114783. if err != nil {
  114784. return nil, err
  114785. }
  114786. defer googleapi.CloseBody(res)
  114787. if err := googleapi.CheckResponse(res); err != nil {
  114788. return nil, err
  114789. }
  114790. ret := &TargetHttpProxy{
  114791. ServerResponse: googleapi.ServerResponse{
  114792. Header: res.Header,
  114793. HTTPStatusCode: res.StatusCode,
  114794. },
  114795. }
  114796. target := &ret
  114797. if err := gensupport.DecodeResponse(target, res); err != nil {
  114798. return nil, err
  114799. }
  114800. return ret, nil
  114801. // {
  114802. // "description": "Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request.",
  114803. // "httpMethod": "GET",
  114804. // "id": "compute.regionTargetHttpProxies.get",
  114805. // "parameterOrder": [
  114806. // "project",
  114807. // "region",
  114808. // "targetHttpProxy"
  114809. // ],
  114810. // "parameters": {
  114811. // "project": {
  114812. // "description": "Project ID for this request.",
  114813. // "location": "path",
  114814. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114815. // "required": true,
  114816. // "type": "string"
  114817. // },
  114818. // "region": {
  114819. // "description": "Name of the region scoping this request.",
  114820. // "location": "path",
  114821. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114822. // "required": true,
  114823. // "type": "string"
  114824. // },
  114825. // "targetHttpProxy": {
  114826. // "description": "Name of the TargetHttpProxy resource to return.",
  114827. // "location": "path",
  114828. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114829. // "required": true,
  114830. // "type": "string"
  114831. // }
  114832. // },
  114833. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
  114834. // "response": {
  114835. // "$ref": "TargetHttpProxy"
  114836. // },
  114837. // "scopes": [
  114838. // "https://www.googleapis.com/auth/cloud-platform",
  114839. // "https://www.googleapis.com/auth/compute",
  114840. // "https://www.googleapis.com/auth/compute.readonly"
  114841. // ]
  114842. // }
  114843. }
  114844. // method id "compute.regionTargetHttpProxies.insert":
  114845. type RegionTargetHttpProxiesInsertCall struct {
  114846. s *Service
  114847. project string
  114848. region string
  114849. targethttpproxy *TargetHttpProxy
  114850. urlParams_ gensupport.URLParams
  114851. ctx_ context.Context
  114852. header_ http.Header
  114853. }
  114854. // Insert: Creates a TargetHttpProxy resource in the specified project
  114855. // and region using the data included in the request.
  114856. func (r *RegionTargetHttpProxiesService) Insert(project string, region string, targethttpproxy *TargetHttpProxy) *RegionTargetHttpProxiesInsertCall {
  114857. c := &RegionTargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114858. c.project = project
  114859. c.region = region
  114860. c.targethttpproxy = targethttpproxy
  114861. return c
  114862. }
  114863. // RequestId sets the optional parameter "requestId": An optional
  114864. // request ID to identify requests. Specify a unique request ID so that
  114865. // if you must retry your request, the server will know to ignore the
  114866. // request if it has already been completed.
  114867. //
  114868. // For example, consider a situation where you make an initial request
  114869. // and the request times out. If you make the request again with the
  114870. // same request ID, the server can check if original operation with the
  114871. // same request ID was received, and if so, will ignore the second
  114872. // request. This prevents clients from accidentally creating duplicate
  114873. // commitments.
  114874. //
  114875. // The request ID must be a valid UUID with the exception that zero UUID
  114876. // is not supported (00000000-0000-0000-0000-000000000000).
  114877. func (c *RegionTargetHttpProxiesInsertCall) RequestId(requestId string) *RegionTargetHttpProxiesInsertCall {
  114878. c.urlParams_.Set("requestId", requestId)
  114879. return c
  114880. }
  114881. // Fields allows partial responses to be retrieved. See
  114882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114883. // for more information.
  114884. func (c *RegionTargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesInsertCall {
  114885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114886. return c
  114887. }
  114888. // Context sets the context to be used in this call's Do method. Any
  114889. // pending HTTP request will be aborted if the provided context is
  114890. // canceled.
  114891. func (c *RegionTargetHttpProxiesInsertCall) Context(ctx context.Context) *RegionTargetHttpProxiesInsertCall {
  114892. c.ctx_ = ctx
  114893. return c
  114894. }
  114895. // Header returns an http.Header that can be modified by the caller to
  114896. // add HTTP headers to the request.
  114897. func (c *RegionTargetHttpProxiesInsertCall) Header() http.Header {
  114898. if c.header_ == nil {
  114899. c.header_ = make(http.Header)
  114900. }
  114901. return c.header_
  114902. }
  114903. func (c *RegionTargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  114904. reqHeaders := make(http.Header)
  114905. for k, v := range c.header_ {
  114906. reqHeaders[k] = v
  114907. }
  114908. reqHeaders.Set("User-Agent", c.s.userAgent())
  114909. var body io.Reader = nil
  114910. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  114911. if err != nil {
  114912. return nil, err
  114913. }
  114914. reqHeaders.Set("Content-Type", "application/json")
  114915. c.urlParams_.Set("alt", alt)
  114916. c.urlParams_.Set("prettyPrint", "false")
  114917. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies")
  114918. urls += "?" + c.urlParams_.Encode()
  114919. req, err := http.NewRequest("POST", urls, body)
  114920. if err != nil {
  114921. return nil, err
  114922. }
  114923. req.Header = reqHeaders
  114924. googleapi.Expand(req.URL, map[string]string{
  114925. "project": c.project,
  114926. "region": c.region,
  114927. })
  114928. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114929. }
  114930. // Do executes the "compute.regionTargetHttpProxies.insert" call.
  114931. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114932. // status code is an error. Response headers are in either
  114933. // *Operation.ServerResponse.Header or (if a response was returned at
  114934. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114935. // to check whether the returned error was because
  114936. // http.StatusNotModified was returned.
  114937. func (c *RegionTargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114938. gensupport.SetOptions(c.urlParams_, opts...)
  114939. res, err := c.doRequest("json")
  114940. if res != nil && res.StatusCode == http.StatusNotModified {
  114941. if res.Body != nil {
  114942. res.Body.Close()
  114943. }
  114944. return nil, &googleapi.Error{
  114945. Code: res.StatusCode,
  114946. Header: res.Header,
  114947. }
  114948. }
  114949. if err != nil {
  114950. return nil, err
  114951. }
  114952. defer googleapi.CloseBody(res)
  114953. if err := googleapi.CheckResponse(res); err != nil {
  114954. return nil, err
  114955. }
  114956. ret := &Operation{
  114957. ServerResponse: googleapi.ServerResponse{
  114958. Header: res.Header,
  114959. HTTPStatusCode: res.StatusCode,
  114960. },
  114961. }
  114962. target := &ret
  114963. if err := gensupport.DecodeResponse(target, res); err != nil {
  114964. return nil, err
  114965. }
  114966. return ret, nil
  114967. // {
  114968. // "description": "Creates a TargetHttpProxy resource in the specified project and region using the data included in the request.",
  114969. // "httpMethod": "POST",
  114970. // "id": "compute.regionTargetHttpProxies.insert",
  114971. // "parameterOrder": [
  114972. // "project",
  114973. // "region"
  114974. // ],
  114975. // "parameters": {
  114976. // "project": {
  114977. // "description": "Project ID for this request.",
  114978. // "location": "path",
  114979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114980. // "required": true,
  114981. // "type": "string"
  114982. // },
  114983. // "region": {
  114984. // "description": "Name of the region scoping this request.",
  114985. // "location": "path",
  114986. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114987. // "required": true,
  114988. // "type": "string"
  114989. // },
  114990. // "requestId": {
  114991. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114992. // "location": "query",
  114993. // "type": "string"
  114994. // }
  114995. // },
  114996. // "path": "{project}/regions/{region}/targetHttpProxies",
  114997. // "request": {
  114998. // "$ref": "TargetHttpProxy"
  114999. // },
  115000. // "response": {
  115001. // "$ref": "Operation"
  115002. // },
  115003. // "scopes": [
  115004. // "https://www.googleapis.com/auth/cloud-platform",
  115005. // "https://www.googleapis.com/auth/compute"
  115006. // ]
  115007. // }
  115008. }
  115009. // method id "compute.regionTargetHttpProxies.list":
  115010. type RegionTargetHttpProxiesListCall struct {
  115011. s *Service
  115012. project string
  115013. region string
  115014. urlParams_ gensupport.URLParams
  115015. ifNoneMatch_ string
  115016. ctx_ context.Context
  115017. header_ http.Header
  115018. }
  115019. // List: Retrieves the list of TargetHttpProxy resources available to
  115020. // the specified project in the specified region.
  115021. func (r *RegionTargetHttpProxiesService) List(project string, region string) *RegionTargetHttpProxiesListCall {
  115022. c := &RegionTargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115023. c.project = project
  115024. c.region = region
  115025. return c
  115026. }
  115027. // Filter sets the optional parameter "filter": A filter expression that
  115028. // filters resources listed in the response. The expression must specify
  115029. // the field name, a comparison operator, and the value that you want to
  115030. // use for filtering. The value must be a string, a number, or a
  115031. // boolean. The comparison operator must be either =, !=, >, or <.
  115032. //
  115033. // For example, if you are filtering Compute Engine instances, you can
  115034. // exclude instances named example-instance by specifying name !=
  115035. // example-instance.
  115036. //
  115037. // You can also filter nested fields. For example, you could specify
  115038. // scheduling.automaticRestart = false to include instances only if they
  115039. // are not scheduled for automatic restarts. You can use filtering on
  115040. // nested fields to filter based on resource labels.
  115041. //
  115042. // To filter on multiple expressions, provide each separate expression
  115043. // within parentheses. For example, (scheduling.automaticRestart = true)
  115044. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  115045. // AND expression. However, you can include AND and OR expressions
  115046. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  115047. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  115048. // true).
  115049. func (c *RegionTargetHttpProxiesListCall) Filter(filter string) *RegionTargetHttpProxiesListCall {
  115050. c.urlParams_.Set("filter", filter)
  115051. return c
  115052. }
  115053. // MaxResults sets the optional parameter "maxResults": The maximum
  115054. // number of results per page that should be returned. If the number of
  115055. // available results is larger than maxResults, Compute Engine returns a
  115056. // nextPageToken that can be used to get the next page of results in
  115057. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  115058. // (Default: 500)
  115059. func (c *RegionTargetHttpProxiesListCall) MaxResults(maxResults int64) *RegionTargetHttpProxiesListCall {
  115060. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  115061. return c
  115062. }
  115063. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  115064. // a certain order. By default, results are returned in alphanumerical
  115065. // order based on the resource name.
  115066. //
  115067. // You can also sort results in descending order based on the creation
  115068. // timestamp using orderBy="creationTimestamp desc". This sorts results
  115069. // based on the creationTimestamp field in reverse chronological order
  115070. // (newest result first). Use this to sort resources like operations so
  115071. // that the newest operation is returned first.
  115072. //
  115073. // Currently, only sorting by name or creationTimestamp desc is
  115074. // supported.
  115075. func (c *RegionTargetHttpProxiesListCall) OrderBy(orderBy string) *RegionTargetHttpProxiesListCall {
  115076. c.urlParams_.Set("orderBy", orderBy)
  115077. return c
  115078. }
  115079. // PageToken sets the optional parameter "pageToken": Specifies a page
  115080. // token to use. Set pageToken to the nextPageToken returned by a
  115081. // previous list request to get the next page of results.
  115082. func (c *RegionTargetHttpProxiesListCall) PageToken(pageToken string) *RegionTargetHttpProxiesListCall {
  115083. c.urlParams_.Set("pageToken", pageToken)
  115084. return c
  115085. }
  115086. // Fields allows partial responses to be retrieved. See
  115087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115088. // for more information.
  115089. func (c *RegionTargetHttpProxiesListCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesListCall {
  115090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115091. return c
  115092. }
  115093. // IfNoneMatch sets the optional parameter which makes the operation
  115094. // fail if the object's ETag matches the given value. This is useful for
  115095. // getting updates only after the object has changed since the last
  115096. // request. Use googleapi.IsNotModified to check whether the response
  115097. // error from Do is the result of In-None-Match.
  115098. func (c *RegionTargetHttpProxiesListCall) IfNoneMatch(entityTag string) *RegionTargetHttpProxiesListCall {
  115099. c.ifNoneMatch_ = entityTag
  115100. return c
  115101. }
  115102. // Context sets the context to be used in this call's Do method. Any
  115103. // pending HTTP request will be aborted if the provided context is
  115104. // canceled.
  115105. func (c *RegionTargetHttpProxiesListCall) Context(ctx context.Context) *RegionTargetHttpProxiesListCall {
  115106. c.ctx_ = ctx
  115107. return c
  115108. }
  115109. // Header returns an http.Header that can be modified by the caller to
  115110. // add HTTP headers to the request.
  115111. func (c *RegionTargetHttpProxiesListCall) Header() http.Header {
  115112. if c.header_ == nil {
  115113. c.header_ = make(http.Header)
  115114. }
  115115. return c.header_
  115116. }
  115117. func (c *RegionTargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  115118. reqHeaders := make(http.Header)
  115119. for k, v := range c.header_ {
  115120. reqHeaders[k] = v
  115121. }
  115122. reqHeaders.Set("User-Agent", c.s.userAgent())
  115123. if c.ifNoneMatch_ != "" {
  115124. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  115125. }
  115126. var body io.Reader = nil
  115127. c.urlParams_.Set("alt", alt)
  115128. c.urlParams_.Set("prettyPrint", "false")
  115129. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies")
  115130. urls += "?" + c.urlParams_.Encode()
  115131. req, err := http.NewRequest("GET", urls, body)
  115132. if err != nil {
  115133. return nil, err
  115134. }
  115135. req.Header = reqHeaders
  115136. googleapi.Expand(req.URL, map[string]string{
  115137. "project": c.project,
  115138. "region": c.region,
  115139. })
  115140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115141. }
  115142. // Do executes the "compute.regionTargetHttpProxies.list" call.
  115143. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  115144. // non-2xx status code is an error. Response headers are in either
  115145. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  115146. // returned at all) in error.(*googleapi.Error).Header. Use
  115147. // googleapi.IsNotModified to check whether the returned error was
  115148. // because http.StatusNotModified was returned.
  115149. func (c *RegionTargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  115150. gensupport.SetOptions(c.urlParams_, opts...)
  115151. res, err := c.doRequest("json")
  115152. if res != nil && res.StatusCode == http.StatusNotModified {
  115153. if res.Body != nil {
  115154. res.Body.Close()
  115155. }
  115156. return nil, &googleapi.Error{
  115157. Code: res.StatusCode,
  115158. Header: res.Header,
  115159. }
  115160. }
  115161. if err != nil {
  115162. return nil, err
  115163. }
  115164. defer googleapi.CloseBody(res)
  115165. if err := googleapi.CheckResponse(res); err != nil {
  115166. return nil, err
  115167. }
  115168. ret := &TargetHttpProxyList{
  115169. ServerResponse: googleapi.ServerResponse{
  115170. Header: res.Header,
  115171. HTTPStatusCode: res.StatusCode,
  115172. },
  115173. }
  115174. target := &ret
  115175. if err := gensupport.DecodeResponse(target, res); err != nil {
  115176. return nil, err
  115177. }
  115178. return ret, nil
  115179. // {
  115180. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region.",
  115181. // "httpMethod": "GET",
  115182. // "id": "compute.regionTargetHttpProxies.list",
  115183. // "parameterOrder": [
  115184. // "project",
  115185. // "region"
  115186. // ],
  115187. // "parameters": {
  115188. // "filter": {
  115189. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  115190. // "location": "query",
  115191. // "type": "string"
  115192. // },
  115193. // "maxResults": {
  115194. // "default": "500",
  115195. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  115196. // "format": "uint32",
  115197. // "location": "query",
  115198. // "minimum": "0",
  115199. // "type": "integer"
  115200. // },
  115201. // "orderBy": {
  115202. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  115203. // "location": "query",
  115204. // "type": "string"
  115205. // },
  115206. // "pageToken": {
  115207. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  115208. // "location": "query",
  115209. // "type": "string"
  115210. // },
  115211. // "project": {
  115212. // "description": "Project ID for this request.",
  115213. // "location": "path",
  115214. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115215. // "required": true,
  115216. // "type": "string"
  115217. // },
  115218. // "region": {
  115219. // "description": "Name of the region scoping this request.",
  115220. // "location": "path",
  115221. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115222. // "required": true,
  115223. // "type": "string"
  115224. // }
  115225. // },
  115226. // "path": "{project}/regions/{region}/targetHttpProxies",
  115227. // "response": {
  115228. // "$ref": "TargetHttpProxyList"
  115229. // },
  115230. // "scopes": [
  115231. // "https://www.googleapis.com/auth/cloud-platform",
  115232. // "https://www.googleapis.com/auth/compute",
  115233. // "https://www.googleapis.com/auth/compute.readonly"
  115234. // ]
  115235. // }
  115236. }
  115237. // Pages invokes f for each page of results.
  115238. // A non-nil error returned from f will halt the iteration.
  115239. // The provided context supersedes any context provided to the Context method.
  115240. func (c *RegionTargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  115241. c.ctx_ = ctx
  115242. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  115243. for {
  115244. x, err := c.Do()
  115245. if err != nil {
  115246. return err
  115247. }
  115248. if err := f(x); err != nil {
  115249. return err
  115250. }
  115251. if x.NextPageToken == "" {
  115252. return nil
  115253. }
  115254. c.PageToken(x.NextPageToken)
  115255. }
  115256. }
  115257. // method id "compute.regionTargetHttpProxies.setUrlMap":
  115258. type RegionTargetHttpProxiesSetUrlMapCall struct {
  115259. s *Service
  115260. project string
  115261. region string
  115262. targetHttpProxy string
  115263. urlmapreference *UrlMapReference
  115264. urlParams_ gensupport.URLParams
  115265. ctx_ context.Context
  115266. header_ http.Header
  115267. }
  115268. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  115269. func (r *RegionTargetHttpProxiesService) SetUrlMap(project string, region string, targetHttpProxy string, urlmapreference *UrlMapReference) *RegionTargetHttpProxiesSetUrlMapCall {
  115270. c := &RegionTargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115271. c.project = project
  115272. c.region = region
  115273. c.targetHttpProxy = targetHttpProxy
  115274. c.urlmapreference = urlmapreference
  115275. return c
  115276. }
  115277. // RequestId sets the optional parameter "requestId": An optional
  115278. // request ID to identify requests. Specify a unique request ID so that
  115279. // if you must retry your request, the server will know to ignore the
  115280. // request if it has already been completed.
  115281. //
  115282. // For example, consider a situation where you make an initial request
  115283. // and the request times out. If you make the request again with the
  115284. // same request ID, the server can check if original operation with the
  115285. // same request ID was received, and if so, will ignore the second
  115286. // request. This prevents clients from accidentally creating duplicate
  115287. // commitments.
  115288. //
  115289. // The request ID must be a valid UUID with the exception that zero UUID
  115290. // is not supported (00000000-0000-0000-0000-000000000000).
  115291. func (c *RegionTargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *RegionTargetHttpProxiesSetUrlMapCall {
  115292. c.urlParams_.Set("requestId", requestId)
  115293. return c
  115294. }
  115295. // Fields allows partial responses to be retrieved. See
  115296. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115297. // for more information.
  115298. func (c *RegionTargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesSetUrlMapCall {
  115299. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115300. return c
  115301. }
  115302. // Context sets the context to be used in this call's Do method. Any
  115303. // pending HTTP request will be aborted if the provided context is
  115304. // canceled.
  115305. func (c *RegionTargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *RegionTargetHttpProxiesSetUrlMapCall {
  115306. c.ctx_ = ctx
  115307. return c
  115308. }
  115309. // Header returns an http.Header that can be modified by the caller to
  115310. // add HTTP headers to the request.
  115311. func (c *RegionTargetHttpProxiesSetUrlMapCall) Header() http.Header {
  115312. if c.header_ == nil {
  115313. c.header_ = make(http.Header)
  115314. }
  115315. return c.header_
  115316. }
  115317. func (c *RegionTargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  115318. reqHeaders := make(http.Header)
  115319. for k, v := range c.header_ {
  115320. reqHeaders[k] = v
  115321. }
  115322. reqHeaders.Set("User-Agent", c.s.userAgent())
  115323. var body io.Reader = nil
  115324. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  115325. if err != nil {
  115326. return nil, err
  115327. }
  115328. reqHeaders.Set("Content-Type", "application/json")
  115329. c.urlParams_.Set("alt", alt)
  115330. c.urlParams_.Set("prettyPrint", "false")
  115331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  115332. urls += "?" + c.urlParams_.Encode()
  115333. req, err := http.NewRequest("POST", urls, body)
  115334. if err != nil {
  115335. return nil, err
  115336. }
  115337. req.Header = reqHeaders
  115338. googleapi.Expand(req.URL, map[string]string{
  115339. "project": c.project,
  115340. "region": c.region,
  115341. "targetHttpProxy": c.targetHttpProxy,
  115342. })
  115343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115344. }
  115345. // Do executes the "compute.regionTargetHttpProxies.setUrlMap" call.
  115346. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115347. // status code is an error. Response headers are in either
  115348. // *Operation.ServerResponse.Header or (if a response was returned at
  115349. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115350. // to check whether the returned error was because
  115351. // http.StatusNotModified was returned.
  115352. func (c *RegionTargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115353. gensupport.SetOptions(c.urlParams_, opts...)
  115354. res, err := c.doRequest("json")
  115355. if res != nil && res.StatusCode == http.StatusNotModified {
  115356. if res.Body != nil {
  115357. res.Body.Close()
  115358. }
  115359. return nil, &googleapi.Error{
  115360. Code: res.StatusCode,
  115361. Header: res.Header,
  115362. }
  115363. }
  115364. if err != nil {
  115365. return nil, err
  115366. }
  115367. defer googleapi.CloseBody(res)
  115368. if err := googleapi.CheckResponse(res); err != nil {
  115369. return nil, err
  115370. }
  115371. ret := &Operation{
  115372. ServerResponse: googleapi.ServerResponse{
  115373. Header: res.Header,
  115374. HTTPStatusCode: res.StatusCode,
  115375. },
  115376. }
  115377. target := &ret
  115378. if err := gensupport.DecodeResponse(target, res); err != nil {
  115379. return nil, err
  115380. }
  115381. return ret, nil
  115382. // {
  115383. // "description": "Changes the URL map for TargetHttpProxy.",
  115384. // "httpMethod": "POST",
  115385. // "id": "compute.regionTargetHttpProxies.setUrlMap",
  115386. // "parameterOrder": [
  115387. // "project",
  115388. // "region",
  115389. // "targetHttpProxy"
  115390. // ],
  115391. // "parameters": {
  115392. // "project": {
  115393. // "description": "Project ID for this request.",
  115394. // "location": "path",
  115395. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115396. // "required": true,
  115397. // "type": "string"
  115398. // },
  115399. // "region": {
  115400. // "description": "Name of the region scoping this request.",
  115401. // "location": "path",
  115402. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115403. // "required": true,
  115404. // "type": "string"
  115405. // },
  115406. // "requestId": {
  115407. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115408. // "location": "query",
  115409. // "type": "string"
  115410. // },
  115411. // "targetHttpProxy": {
  115412. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  115413. // "location": "path",
  115414. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115415. // "required": true,
  115416. // "type": "string"
  115417. // }
  115418. // },
  115419. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  115420. // "request": {
  115421. // "$ref": "UrlMapReference"
  115422. // },
  115423. // "response": {
  115424. // "$ref": "Operation"
  115425. // },
  115426. // "scopes": [
  115427. // "https://www.googleapis.com/auth/cloud-platform",
  115428. // "https://www.googleapis.com/auth/compute"
  115429. // ]
  115430. // }
  115431. }
  115432. // method id "compute.regionTargetHttpProxies.testIamPermissions":
  115433. type RegionTargetHttpProxiesTestIamPermissionsCall struct {
  115434. s *Service
  115435. project string
  115436. region string
  115437. resource string
  115438. testpermissionsrequest *TestPermissionsRequest
  115439. urlParams_ gensupport.URLParams
  115440. ctx_ context.Context
  115441. header_ http.Header
  115442. }
  115443. // TestIamPermissions: Returns permissions that a caller has on the
  115444. // specified resource.
  115445. func (r *RegionTargetHttpProxiesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionTargetHttpProxiesTestIamPermissionsCall {
  115446. c := &RegionTargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115447. c.project = project
  115448. c.region = region
  115449. c.resource = resource
  115450. c.testpermissionsrequest = testpermissionsrequest
  115451. return c
  115452. }
  115453. // Fields allows partial responses to be retrieved. See
  115454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115455. // for more information.
  115456. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesTestIamPermissionsCall {
  115457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115458. return c
  115459. }
  115460. // Context sets the context to be used in this call's Do method. Any
  115461. // pending HTTP request will be aborted if the provided context is
  115462. // canceled.
  115463. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *RegionTargetHttpProxiesTestIamPermissionsCall {
  115464. c.ctx_ = ctx
  115465. return c
  115466. }
  115467. // Header returns an http.Header that can be modified by the caller to
  115468. // add HTTP headers to the request.
  115469. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  115470. if c.header_ == nil {
  115471. c.header_ = make(http.Header)
  115472. }
  115473. return c.header_
  115474. }
  115475. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  115476. reqHeaders := make(http.Header)
  115477. for k, v := range c.header_ {
  115478. reqHeaders[k] = v
  115479. }
  115480. reqHeaders.Set("User-Agent", c.s.userAgent())
  115481. var body io.Reader = nil
  115482. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  115483. if err != nil {
  115484. return nil, err
  115485. }
  115486. reqHeaders.Set("Content-Type", "application/json")
  115487. c.urlParams_.Set("alt", alt)
  115488. c.urlParams_.Set("prettyPrint", "false")
  115489. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{resource}/testIamPermissions")
  115490. urls += "?" + c.urlParams_.Encode()
  115491. req, err := http.NewRequest("POST", urls, body)
  115492. if err != nil {
  115493. return nil, err
  115494. }
  115495. req.Header = reqHeaders
  115496. googleapi.Expand(req.URL, map[string]string{
  115497. "project": c.project,
  115498. "region": c.region,
  115499. "resource": c.resource,
  115500. })
  115501. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115502. }
  115503. // Do executes the "compute.regionTargetHttpProxies.testIamPermissions" call.
  115504. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  115505. // non-2xx status code is an error. Response headers are in either
  115506. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  115507. // returned at all) in error.(*googleapi.Error).Header. Use
  115508. // googleapi.IsNotModified to check whether the returned error was
  115509. // because http.StatusNotModified was returned.
  115510. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  115511. gensupport.SetOptions(c.urlParams_, opts...)
  115512. res, err := c.doRequest("json")
  115513. if res != nil && res.StatusCode == http.StatusNotModified {
  115514. if res.Body != nil {
  115515. res.Body.Close()
  115516. }
  115517. return nil, &googleapi.Error{
  115518. Code: res.StatusCode,
  115519. Header: res.Header,
  115520. }
  115521. }
  115522. if err != nil {
  115523. return nil, err
  115524. }
  115525. defer googleapi.CloseBody(res)
  115526. if err := googleapi.CheckResponse(res); err != nil {
  115527. return nil, err
  115528. }
  115529. ret := &TestPermissionsResponse{
  115530. ServerResponse: googleapi.ServerResponse{
  115531. Header: res.Header,
  115532. HTTPStatusCode: res.StatusCode,
  115533. },
  115534. }
  115535. target := &ret
  115536. if err := gensupport.DecodeResponse(target, res); err != nil {
  115537. return nil, err
  115538. }
  115539. return ret, nil
  115540. // {
  115541. // "description": "Returns permissions that a caller has on the specified resource.",
  115542. // "httpMethod": "POST",
  115543. // "id": "compute.regionTargetHttpProxies.testIamPermissions",
  115544. // "parameterOrder": [
  115545. // "project",
  115546. // "region",
  115547. // "resource"
  115548. // ],
  115549. // "parameters": {
  115550. // "project": {
  115551. // "description": "Project ID for this request.",
  115552. // "location": "path",
  115553. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115554. // "required": true,
  115555. // "type": "string"
  115556. // },
  115557. // "region": {
  115558. // "description": "The name of the region for this request.",
  115559. // "location": "path",
  115560. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115561. // "required": true,
  115562. // "type": "string"
  115563. // },
  115564. // "resource": {
  115565. // "description": "Name or id of the resource for this request.",
  115566. // "location": "path",
  115567. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115568. // "required": true,
  115569. // "type": "string"
  115570. // }
  115571. // },
  115572. // "path": "{project}/regions/{region}/targetHttpProxies/{resource}/testIamPermissions",
  115573. // "request": {
  115574. // "$ref": "TestPermissionsRequest"
  115575. // },
  115576. // "response": {
  115577. // "$ref": "TestPermissionsResponse"
  115578. // },
  115579. // "scopes": [
  115580. // "https://www.googleapis.com/auth/cloud-platform",
  115581. // "https://www.googleapis.com/auth/compute",
  115582. // "https://www.googleapis.com/auth/compute.readonly"
  115583. // ]
  115584. // }
  115585. }
  115586. // method id "compute.regionTargetHttpsProxies.delete":
  115587. type RegionTargetHttpsProxiesDeleteCall struct {
  115588. s *Service
  115589. project string
  115590. region string
  115591. targetHttpsProxy string
  115592. urlParams_ gensupport.URLParams
  115593. ctx_ context.Context
  115594. header_ http.Header
  115595. }
  115596. // Delete: Deletes the specified TargetHttpsProxy resource.
  115597. func (r *RegionTargetHttpsProxiesService) Delete(project string, region string, targetHttpsProxy string) *RegionTargetHttpsProxiesDeleteCall {
  115598. c := &RegionTargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115599. c.project = project
  115600. c.region = region
  115601. c.targetHttpsProxy = targetHttpsProxy
  115602. return c
  115603. }
  115604. // RequestId sets the optional parameter "requestId": An optional
  115605. // request ID to identify requests. Specify a unique request ID so that
  115606. // if you must retry your request, the server will know to ignore the
  115607. // request if it has already been completed.
  115608. //
  115609. // For example, consider a situation where you make an initial request
  115610. // and the request times out. If you make the request again with the
  115611. // same request ID, the server can check if original operation with the
  115612. // same request ID was received, and if so, will ignore the second
  115613. // request. This prevents clients from accidentally creating duplicate
  115614. // commitments.
  115615. //
  115616. // The request ID must be a valid UUID with the exception that zero UUID
  115617. // is not supported (00000000-0000-0000-0000-000000000000).
  115618. func (c *RegionTargetHttpsProxiesDeleteCall) RequestId(requestId string) *RegionTargetHttpsProxiesDeleteCall {
  115619. c.urlParams_.Set("requestId", requestId)
  115620. return c
  115621. }
  115622. // Fields allows partial responses to be retrieved. See
  115623. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115624. // for more information.
  115625. func (c *RegionTargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesDeleteCall {
  115626. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115627. return c
  115628. }
  115629. // Context sets the context to be used in this call's Do method. Any
  115630. // pending HTTP request will be aborted if the provided context is
  115631. // canceled.
  115632. func (c *RegionTargetHttpsProxiesDeleteCall) Context(ctx context.Context) *RegionTargetHttpsProxiesDeleteCall {
  115633. c.ctx_ = ctx
  115634. return c
  115635. }
  115636. // Header returns an http.Header that can be modified by the caller to
  115637. // add HTTP headers to the request.
  115638. func (c *RegionTargetHttpsProxiesDeleteCall) Header() http.Header {
  115639. if c.header_ == nil {
  115640. c.header_ = make(http.Header)
  115641. }
  115642. return c.header_
  115643. }
  115644. func (c *RegionTargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  115645. reqHeaders := make(http.Header)
  115646. for k, v := range c.header_ {
  115647. reqHeaders[k] = v
  115648. }
  115649. reqHeaders.Set("User-Agent", c.s.userAgent())
  115650. var body io.Reader = nil
  115651. c.urlParams_.Set("alt", alt)
  115652. c.urlParams_.Set("prettyPrint", "false")
  115653. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}")
  115654. urls += "?" + c.urlParams_.Encode()
  115655. req, err := http.NewRequest("DELETE", urls, body)
  115656. if err != nil {
  115657. return nil, err
  115658. }
  115659. req.Header = reqHeaders
  115660. googleapi.Expand(req.URL, map[string]string{
  115661. "project": c.project,
  115662. "region": c.region,
  115663. "targetHttpsProxy": c.targetHttpsProxy,
  115664. })
  115665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115666. }
  115667. // Do executes the "compute.regionTargetHttpsProxies.delete" call.
  115668. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115669. // status code is an error. Response headers are in either
  115670. // *Operation.ServerResponse.Header or (if a response was returned at
  115671. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115672. // to check whether the returned error was because
  115673. // http.StatusNotModified was returned.
  115674. func (c *RegionTargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115675. gensupport.SetOptions(c.urlParams_, opts...)
  115676. res, err := c.doRequest("json")
  115677. if res != nil && res.StatusCode == http.StatusNotModified {
  115678. if res.Body != nil {
  115679. res.Body.Close()
  115680. }
  115681. return nil, &googleapi.Error{
  115682. Code: res.StatusCode,
  115683. Header: res.Header,
  115684. }
  115685. }
  115686. if err != nil {
  115687. return nil, err
  115688. }
  115689. defer googleapi.CloseBody(res)
  115690. if err := googleapi.CheckResponse(res); err != nil {
  115691. return nil, err
  115692. }
  115693. ret := &Operation{
  115694. ServerResponse: googleapi.ServerResponse{
  115695. Header: res.Header,
  115696. HTTPStatusCode: res.StatusCode,
  115697. },
  115698. }
  115699. target := &ret
  115700. if err := gensupport.DecodeResponse(target, res); err != nil {
  115701. return nil, err
  115702. }
  115703. return ret, nil
  115704. // {
  115705. // "description": "Deletes the specified TargetHttpsProxy resource.",
  115706. // "httpMethod": "DELETE",
  115707. // "id": "compute.regionTargetHttpsProxies.delete",
  115708. // "parameterOrder": [
  115709. // "project",
  115710. // "region",
  115711. // "targetHttpsProxy"
  115712. // ],
  115713. // "parameters": {
  115714. // "project": {
  115715. // "description": "Project ID for this request.",
  115716. // "location": "path",
  115717. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115718. // "required": true,
  115719. // "type": "string"
  115720. // },
  115721. // "region": {
  115722. // "description": "Name of the region scoping this request.",
  115723. // "location": "path",
  115724. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115725. // "required": true,
  115726. // "type": "string"
  115727. // },
  115728. // "requestId": {
  115729. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115730. // "location": "query",
  115731. // "type": "string"
  115732. // },
  115733. // "targetHttpsProxy": {
  115734. // "description": "Name of the TargetHttpsProxy resource to delete.",
  115735. // "location": "path",
  115736. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115737. // "required": true,
  115738. // "type": "string"
  115739. // }
  115740. // },
  115741. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
  115742. // "response": {
  115743. // "$ref": "Operation"
  115744. // },
  115745. // "scopes": [
  115746. // "https://www.googleapis.com/auth/cloud-platform",
  115747. // "https://www.googleapis.com/auth/compute"
  115748. // ]
  115749. // }
  115750. }
  115751. // method id "compute.regionTargetHttpsProxies.get":
  115752. type RegionTargetHttpsProxiesGetCall struct {
  115753. s *Service
  115754. project string
  115755. region string
  115756. targetHttpsProxy string
  115757. urlParams_ gensupport.URLParams
  115758. ifNoneMatch_ string
  115759. ctx_ context.Context
  115760. header_ http.Header
  115761. }
  115762. // Get: Returns the specified TargetHttpsProxy resource in the specified
  115763. // region. Gets a list of available target HTTP proxies by making a
  115764. // list() request.
  115765. func (r *RegionTargetHttpsProxiesService) Get(project string, region string, targetHttpsProxy string) *RegionTargetHttpsProxiesGetCall {
  115766. c := &RegionTargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115767. c.project = project
  115768. c.region = region
  115769. c.targetHttpsProxy = targetHttpsProxy
  115770. return c
  115771. }
  115772. // Fields allows partial responses to be retrieved. See
  115773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115774. // for more information.
  115775. func (c *RegionTargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesGetCall {
  115776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115777. return c
  115778. }
  115779. // IfNoneMatch sets the optional parameter which makes the operation
  115780. // fail if the object's ETag matches the given value. This is useful for
  115781. // getting updates only after the object has changed since the last
  115782. // request. Use googleapi.IsNotModified to check whether the response
  115783. // error from Do is the result of In-None-Match.
  115784. func (c *RegionTargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *RegionTargetHttpsProxiesGetCall {
  115785. c.ifNoneMatch_ = entityTag
  115786. return c
  115787. }
  115788. // Context sets the context to be used in this call's Do method. Any
  115789. // pending HTTP request will be aborted if the provided context is
  115790. // canceled.
  115791. func (c *RegionTargetHttpsProxiesGetCall) Context(ctx context.Context) *RegionTargetHttpsProxiesGetCall {
  115792. c.ctx_ = ctx
  115793. return c
  115794. }
  115795. // Header returns an http.Header that can be modified by the caller to
  115796. // add HTTP headers to the request.
  115797. func (c *RegionTargetHttpsProxiesGetCall) Header() http.Header {
  115798. if c.header_ == nil {
  115799. c.header_ = make(http.Header)
  115800. }
  115801. return c.header_
  115802. }
  115803. func (c *RegionTargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  115804. reqHeaders := make(http.Header)
  115805. for k, v := range c.header_ {
  115806. reqHeaders[k] = v
  115807. }
  115808. reqHeaders.Set("User-Agent", c.s.userAgent())
  115809. if c.ifNoneMatch_ != "" {
  115810. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  115811. }
  115812. var body io.Reader = nil
  115813. c.urlParams_.Set("alt", alt)
  115814. c.urlParams_.Set("prettyPrint", "false")
  115815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}")
  115816. urls += "?" + c.urlParams_.Encode()
  115817. req, err := http.NewRequest("GET", urls, body)
  115818. if err != nil {
  115819. return nil, err
  115820. }
  115821. req.Header = reqHeaders
  115822. googleapi.Expand(req.URL, map[string]string{
  115823. "project": c.project,
  115824. "region": c.region,
  115825. "targetHttpsProxy": c.targetHttpsProxy,
  115826. })
  115827. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115828. }
  115829. // Do executes the "compute.regionTargetHttpsProxies.get" call.
  115830. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  115831. // non-2xx status code is an error. Response headers are in either
  115832. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  115833. // returned at all) in error.(*googleapi.Error).Header. Use
  115834. // googleapi.IsNotModified to check whether the returned error was
  115835. // because http.StatusNotModified was returned.
  115836. func (c *RegionTargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  115837. gensupport.SetOptions(c.urlParams_, opts...)
  115838. res, err := c.doRequest("json")
  115839. if res != nil && res.StatusCode == http.StatusNotModified {
  115840. if res.Body != nil {
  115841. res.Body.Close()
  115842. }
  115843. return nil, &googleapi.Error{
  115844. Code: res.StatusCode,
  115845. Header: res.Header,
  115846. }
  115847. }
  115848. if err != nil {
  115849. return nil, err
  115850. }
  115851. defer googleapi.CloseBody(res)
  115852. if err := googleapi.CheckResponse(res); err != nil {
  115853. return nil, err
  115854. }
  115855. ret := &TargetHttpsProxy{
  115856. ServerResponse: googleapi.ServerResponse{
  115857. Header: res.Header,
  115858. HTTPStatusCode: res.StatusCode,
  115859. },
  115860. }
  115861. target := &ret
  115862. if err := gensupport.DecodeResponse(target, res); err != nil {
  115863. return nil, err
  115864. }
  115865. return ret, nil
  115866. // {
  115867. // "description": "Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request.",
  115868. // "httpMethod": "GET",
  115869. // "id": "compute.regionTargetHttpsProxies.get",
  115870. // "parameterOrder": [
  115871. // "project",
  115872. // "region",
  115873. // "targetHttpsProxy"
  115874. // ],
  115875. // "parameters": {
  115876. // "project": {
  115877. // "description": "Project ID for this request.",
  115878. // "location": "path",
  115879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115880. // "required": true,
  115881. // "type": "string"
  115882. // },
  115883. // "region": {
  115884. // "description": "Name of the region scoping this request.",
  115885. // "location": "path",
  115886. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115887. // "required": true,
  115888. // "type": "string"
  115889. // },
  115890. // "targetHttpsProxy": {
  115891. // "description": "Name of the TargetHttpsProxy resource to return.",
  115892. // "location": "path",
  115893. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115894. // "required": true,
  115895. // "type": "string"
  115896. // }
  115897. // },
  115898. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
  115899. // "response": {
  115900. // "$ref": "TargetHttpsProxy"
  115901. // },
  115902. // "scopes": [
  115903. // "https://www.googleapis.com/auth/cloud-platform",
  115904. // "https://www.googleapis.com/auth/compute",
  115905. // "https://www.googleapis.com/auth/compute.readonly"
  115906. // ]
  115907. // }
  115908. }
  115909. // method id "compute.regionTargetHttpsProxies.insert":
  115910. type RegionTargetHttpsProxiesInsertCall struct {
  115911. s *Service
  115912. project string
  115913. region string
  115914. targethttpsproxy *TargetHttpsProxy
  115915. urlParams_ gensupport.URLParams
  115916. ctx_ context.Context
  115917. header_ http.Header
  115918. }
  115919. // Insert: Creates a TargetHttpsProxy resource in the specified project
  115920. // and region using the data included in the request.
  115921. func (r *RegionTargetHttpsProxiesService) Insert(project string, region string, targethttpsproxy *TargetHttpsProxy) *RegionTargetHttpsProxiesInsertCall {
  115922. c := &RegionTargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115923. c.project = project
  115924. c.region = region
  115925. c.targethttpsproxy = targethttpsproxy
  115926. return c
  115927. }
  115928. // RequestId sets the optional parameter "requestId": An optional
  115929. // request ID to identify requests. Specify a unique request ID so that
  115930. // if you must retry your request, the server will know to ignore the
  115931. // request if it has already been completed.
  115932. //
  115933. // For example, consider a situation where you make an initial request
  115934. // and the request times out. If you make the request again with the
  115935. // same request ID, the server can check if original operation with the
  115936. // same request ID was received, and if so, will ignore the second
  115937. // request. This prevents clients from accidentally creating duplicate
  115938. // commitments.
  115939. //
  115940. // The request ID must be a valid UUID with the exception that zero UUID
  115941. // is not supported (00000000-0000-0000-0000-000000000000).
  115942. func (c *RegionTargetHttpsProxiesInsertCall) RequestId(requestId string) *RegionTargetHttpsProxiesInsertCall {
  115943. c.urlParams_.Set("requestId", requestId)
  115944. return c
  115945. }
  115946. // Fields allows partial responses to be retrieved. See
  115947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115948. // for more information.
  115949. func (c *RegionTargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesInsertCall {
  115950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115951. return c
  115952. }
  115953. // Context sets the context to be used in this call's Do method. Any
  115954. // pending HTTP request will be aborted if the provided context is
  115955. // canceled.
  115956. func (c *RegionTargetHttpsProxiesInsertCall) Context(ctx context.Context) *RegionTargetHttpsProxiesInsertCall {
  115957. c.ctx_ = ctx
  115958. return c
  115959. }
  115960. // Header returns an http.Header that can be modified by the caller to
  115961. // add HTTP headers to the request.
  115962. func (c *RegionTargetHttpsProxiesInsertCall) Header() http.Header {
  115963. if c.header_ == nil {
  115964. c.header_ = make(http.Header)
  115965. }
  115966. return c.header_
  115967. }
  115968. func (c *RegionTargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  115969. reqHeaders := make(http.Header)
  115970. for k, v := range c.header_ {
  115971. reqHeaders[k] = v
  115972. }
  115973. reqHeaders.Set("User-Agent", c.s.userAgent())
  115974. var body io.Reader = nil
  115975. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  115976. if err != nil {
  115977. return nil, err
  115978. }
  115979. reqHeaders.Set("Content-Type", "application/json")
  115980. c.urlParams_.Set("alt", alt)
  115981. c.urlParams_.Set("prettyPrint", "false")
  115982. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies")
  115983. urls += "?" + c.urlParams_.Encode()
  115984. req, err := http.NewRequest("POST", urls, body)
  115985. if err != nil {
  115986. return nil, err
  115987. }
  115988. req.Header = reqHeaders
  115989. googleapi.Expand(req.URL, map[string]string{
  115990. "project": c.project,
  115991. "region": c.region,
  115992. })
  115993. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115994. }
  115995. // Do executes the "compute.regionTargetHttpsProxies.insert" call.
  115996. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115997. // status code is an error. Response headers are in either
  115998. // *Operation.ServerResponse.Header or (if a response was returned at
  115999. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116000. // to check whether the returned error was because
  116001. // http.StatusNotModified was returned.
  116002. func (c *RegionTargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116003. gensupport.SetOptions(c.urlParams_, opts...)
  116004. res, err := c.doRequest("json")
  116005. if res != nil && res.StatusCode == http.StatusNotModified {
  116006. if res.Body != nil {
  116007. res.Body.Close()
  116008. }
  116009. return nil, &googleapi.Error{
  116010. Code: res.StatusCode,
  116011. Header: res.Header,
  116012. }
  116013. }
  116014. if err != nil {
  116015. return nil, err
  116016. }
  116017. defer googleapi.CloseBody(res)
  116018. if err := googleapi.CheckResponse(res); err != nil {
  116019. return nil, err
  116020. }
  116021. ret := &Operation{
  116022. ServerResponse: googleapi.ServerResponse{
  116023. Header: res.Header,
  116024. HTTPStatusCode: res.StatusCode,
  116025. },
  116026. }
  116027. target := &ret
  116028. if err := gensupport.DecodeResponse(target, res); err != nil {
  116029. return nil, err
  116030. }
  116031. return ret, nil
  116032. // {
  116033. // "description": "Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request.",
  116034. // "httpMethod": "POST",
  116035. // "id": "compute.regionTargetHttpsProxies.insert",
  116036. // "parameterOrder": [
  116037. // "project",
  116038. // "region"
  116039. // ],
  116040. // "parameters": {
  116041. // "project": {
  116042. // "description": "Project ID for this request.",
  116043. // "location": "path",
  116044. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116045. // "required": true,
  116046. // "type": "string"
  116047. // },
  116048. // "region": {
  116049. // "description": "Name of the region scoping this request.",
  116050. // "location": "path",
  116051. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116052. // "required": true,
  116053. // "type": "string"
  116054. // },
  116055. // "requestId": {
  116056. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  116057. // "location": "query",
  116058. // "type": "string"
  116059. // }
  116060. // },
  116061. // "path": "{project}/regions/{region}/targetHttpsProxies",
  116062. // "request": {
  116063. // "$ref": "TargetHttpsProxy"
  116064. // },
  116065. // "response": {
  116066. // "$ref": "Operation"
  116067. // },
  116068. // "scopes": [
  116069. // "https://www.googleapis.com/auth/cloud-platform",
  116070. // "https://www.googleapis.com/auth/compute"
  116071. // ]
  116072. // }
  116073. }
  116074. // method id "compute.regionTargetHttpsProxies.list":
  116075. type RegionTargetHttpsProxiesListCall struct {
  116076. s *Service
  116077. project string
  116078. region string
  116079. urlParams_ gensupport.URLParams
  116080. ifNoneMatch_ string
  116081. ctx_ context.Context
  116082. header_ http.Header
  116083. }
  116084. // List: Retrieves the list of TargetHttpsProxy resources available to
  116085. // the specified project in the specified region.
  116086. func (r *RegionTargetHttpsProxiesService) List(project string, region string) *RegionTargetHttpsProxiesListCall {
  116087. c := &RegionTargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116088. c.project = project
  116089. c.region = region
  116090. return c
  116091. }
  116092. // Filter sets the optional parameter "filter": A filter expression that
  116093. // filters resources listed in the response. The expression must specify
  116094. // the field name, a comparison operator, and the value that you want to
  116095. // use for filtering. The value must be a string, a number, or a
  116096. // boolean. The comparison operator must be either =, !=, >, or <.
  116097. //
  116098. // For example, if you are filtering Compute Engine instances, you can
  116099. // exclude instances named example-instance by specifying name !=
  116100. // example-instance.
  116101. //
  116102. // You can also filter nested fields. For example, you could specify
  116103. // scheduling.automaticRestart = false to include instances only if they
  116104. // are not scheduled for automatic restarts. You can use filtering on
  116105. // nested fields to filter based on resource labels.
  116106. //
  116107. // To filter on multiple expressions, provide each separate expression
  116108. // within parentheses. For example, (scheduling.automaticRestart = true)
  116109. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  116110. // AND expression. However, you can include AND and OR expressions
  116111. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  116112. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  116113. // true).
  116114. func (c *RegionTargetHttpsProxiesListCall) Filter(filter string) *RegionTargetHttpsProxiesListCall {
  116115. c.urlParams_.Set("filter", filter)
  116116. return c
  116117. }
  116118. // MaxResults sets the optional parameter "maxResults": The maximum
  116119. // number of results per page that should be returned. If the number of
  116120. // available results is larger than maxResults, Compute Engine returns a
  116121. // nextPageToken that can be used to get the next page of results in
  116122. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  116123. // (Default: 500)
  116124. func (c *RegionTargetHttpsProxiesListCall) MaxResults(maxResults int64) *RegionTargetHttpsProxiesListCall {
  116125. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  116126. return c
  116127. }
  116128. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  116129. // a certain order. By default, results are returned in alphanumerical
  116130. // order based on the resource name.
  116131. //
  116132. // You can also sort results in descending order based on the creation
  116133. // timestamp using orderBy="creationTimestamp desc". This sorts results
  116134. // based on the creationTimestamp field in reverse chronological order
  116135. // (newest result first). Use this to sort resources like operations so
  116136. // that the newest operation is returned first.
  116137. //
  116138. // Currently, only sorting by name or creationTimestamp desc is
  116139. // supported.
  116140. func (c *RegionTargetHttpsProxiesListCall) OrderBy(orderBy string) *RegionTargetHttpsProxiesListCall {
  116141. c.urlParams_.Set("orderBy", orderBy)
  116142. return c
  116143. }
  116144. // PageToken sets the optional parameter "pageToken": Specifies a page
  116145. // token to use. Set pageToken to the nextPageToken returned by a
  116146. // previous list request to get the next page of results.
  116147. func (c *RegionTargetHttpsProxiesListCall) PageToken(pageToken string) *RegionTargetHttpsProxiesListCall {
  116148. c.urlParams_.Set("pageToken", pageToken)
  116149. return c
  116150. }
  116151. // Fields allows partial responses to be retrieved. See
  116152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116153. // for more information.
  116154. func (c *RegionTargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesListCall {
  116155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116156. return c
  116157. }
  116158. // IfNoneMatch sets the optional parameter which makes the operation
  116159. // fail if the object's ETag matches the given value. This is useful for
  116160. // getting updates only after the object has changed since the last
  116161. // request. Use googleapi.IsNotModified to check whether the response
  116162. // error from Do is the result of In-None-Match.
  116163. func (c *RegionTargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *RegionTargetHttpsProxiesListCall {
  116164. c.ifNoneMatch_ = entityTag
  116165. return c
  116166. }
  116167. // Context sets the context to be used in this call's Do method. Any
  116168. // pending HTTP request will be aborted if the provided context is
  116169. // canceled.
  116170. func (c *RegionTargetHttpsProxiesListCall) Context(ctx context.Context) *RegionTargetHttpsProxiesListCall {
  116171. c.ctx_ = ctx
  116172. return c
  116173. }
  116174. // Header returns an http.Header that can be modified by the caller to
  116175. // add HTTP headers to the request.
  116176. func (c *RegionTargetHttpsProxiesListCall) Header() http.Header {
  116177. if c.header_ == nil {
  116178. c.header_ = make(http.Header)
  116179. }
  116180. return c.header_
  116181. }
  116182. func (c *RegionTargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  116183. reqHeaders := make(http.Header)
  116184. for k, v := range c.header_ {
  116185. reqHeaders[k] = v
  116186. }
  116187. reqHeaders.Set("User-Agent", c.s.userAgent())
  116188. if c.ifNoneMatch_ != "" {
  116189. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  116190. }
  116191. var body io.Reader = nil
  116192. c.urlParams_.Set("alt", alt)
  116193. c.urlParams_.Set("prettyPrint", "false")
  116194. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies")
  116195. urls += "?" + c.urlParams_.Encode()
  116196. req, err := http.NewRequest("GET", urls, body)
  116197. if err != nil {
  116198. return nil, err
  116199. }
  116200. req.Header = reqHeaders
  116201. googleapi.Expand(req.URL, map[string]string{
  116202. "project": c.project,
  116203. "region": c.region,
  116204. })
  116205. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116206. }
  116207. // Do executes the "compute.regionTargetHttpsProxies.list" call.
  116208. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  116209. // non-2xx status code is an error. Response headers are in either
  116210. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  116211. // returned at all) in error.(*googleapi.Error).Header. Use
  116212. // googleapi.IsNotModified to check whether the returned error was
  116213. // because http.StatusNotModified was returned.
  116214. func (c *RegionTargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  116215. gensupport.SetOptions(c.urlParams_, opts...)
  116216. res, err := c.doRequest("json")
  116217. if res != nil && res.StatusCode == http.StatusNotModified {
  116218. if res.Body != nil {
  116219. res.Body.Close()
  116220. }
  116221. return nil, &googleapi.Error{
  116222. Code: res.StatusCode,
  116223. Header: res.Header,
  116224. }
  116225. }
  116226. if err != nil {
  116227. return nil, err
  116228. }
  116229. defer googleapi.CloseBody(res)
  116230. if err := googleapi.CheckResponse(res); err != nil {
  116231. return nil, err
  116232. }
  116233. ret := &TargetHttpsProxyList{
  116234. ServerResponse: googleapi.ServerResponse{
  116235. Header: res.Header,
  116236. HTTPStatusCode: res.StatusCode,
  116237. },
  116238. }
  116239. target := &ret
  116240. if err := gensupport.DecodeResponse(target, res); err != nil {
  116241. return nil, err
  116242. }
  116243. return ret, nil
  116244. // {
  116245. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region.",
  116246. // "httpMethod": "GET",
  116247. // "id": "compute.regionTargetHttpsProxies.list",
  116248. // "parameterOrder": [
  116249. // "project",
  116250. // "region"
  116251. // ],
  116252. // "parameters": {
  116253. // "filter": {
  116254. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  116255. // "location": "query",
  116256. // "type": "string"
  116257. // },
  116258. // "maxResults": {
  116259. // "default": "500",
  116260. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  116261. // "format": "uint32",
  116262. // "location": "query",
  116263. // "minimum": "0",
  116264. // "type": "integer"
  116265. // },
  116266. // "orderBy": {
  116267. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  116268. // "location": "query",
  116269. // "type": "string"
  116270. // },
  116271. // "pageToken": {
  116272. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  116273. // "location": "query",
  116274. // "type": "string"
  116275. // },
  116276. // "project": {
  116277. // "description": "Project ID for this request.",
  116278. // "location": "path",
  116279. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116280. // "required": true,
  116281. // "type": "string"
  116282. // },
  116283. // "region": {
  116284. // "description": "Name of the region scoping this request.",
  116285. // "location": "path",
  116286. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116287. // "required": true,
  116288. // "type": "string"
  116289. // }
  116290. // },
  116291. // "path": "{project}/regions/{region}/targetHttpsProxies",
  116292. // "response": {
  116293. // "$ref": "TargetHttpsProxyList"
  116294. // },
  116295. // "scopes": [
  116296. // "https://www.googleapis.com/auth/cloud-platform",
  116297. // "https://www.googleapis.com/auth/compute",
  116298. // "https://www.googleapis.com/auth/compute.readonly"
  116299. // ]
  116300. // }
  116301. }
  116302. // Pages invokes f for each page of results.
  116303. // A non-nil error returned from f will halt the iteration.
  116304. // The provided context supersedes any context provided to the Context method.
  116305. func (c *RegionTargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  116306. c.ctx_ = ctx
  116307. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  116308. for {
  116309. x, err := c.Do()
  116310. if err != nil {
  116311. return err
  116312. }
  116313. if err := f(x); err != nil {
  116314. return err
  116315. }
  116316. if x.NextPageToken == "" {
  116317. return nil
  116318. }
  116319. c.PageToken(x.NextPageToken)
  116320. }
  116321. }
  116322. // method id "compute.regionTargetHttpsProxies.setSslCertificates":
  116323. type RegionTargetHttpsProxiesSetSslCertificatesCall struct {
  116324. s *Service
  116325. project string
  116326. region string
  116327. targetHttpsProxy string
  116328. regiontargethttpsproxiessetsslcertificatesrequest *RegionTargetHttpsProxiesSetSslCertificatesRequest
  116329. urlParams_ gensupport.URLParams
  116330. ctx_ context.Context
  116331. header_ http.Header
  116332. }
  116333. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  116334. func (r *RegionTargetHttpsProxiesService) SetSslCertificates(project string, region string, targetHttpsProxy string, regiontargethttpsproxiessetsslcertificatesrequest *RegionTargetHttpsProxiesSetSslCertificatesRequest) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  116335. c := &RegionTargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116336. c.project = project
  116337. c.region = region
  116338. c.targetHttpsProxy = targetHttpsProxy
  116339. c.regiontargethttpsproxiessetsslcertificatesrequest = regiontargethttpsproxiessetsslcertificatesrequest
  116340. return c
  116341. }
  116342. // RequestId sets the optional parameter "requestId": An optional
  116343. // request ID to identify requests. Specify a unique request ID so that
  116344. // if you must retry your request, the server will know to ignore the
  116345. // request if it has already been completed.
  116346. //
  116347. // For example, consider a situation where you make an initial request
  116348. // and the request times out. If you make the request again with the
  116349. // same request ID, the server can check if original operation with the
  116350. // same request ID was received, and if so, will ignore the second
  116351. // request. This prevents clients from accidentally creating duplicate
  116352. // commitments.
  116353. //
  116354. // The request ID must be a valid UUID with the exception that zero UUID
  116355. // is not supported (00000000-0000-0000-0000-000000000000).
  116356. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  116357. c.urlParams_.Set("requestId", requestId)
  116358. return c
  116359. }
  116360. // Fields allows partial responses to be retrieved. See
  116361. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116362. // for more information.
  116363. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  116364. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116365. return c
  116366. }
  116367. // Context sets the context to be used in this call's Do method. Any
  116368. // pending HTTP request will be aborted if the provided context is
  116369. // canceled.
  116370. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  116371. c.ctx_ = ctx
  116372. return c
  116373. }
  116374. // Header returns an http.Header that can be modified by the caller to
  116375. // add HTTP headers to the request.
  116376. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  116377. if c.header_ == nil {
  116378. c.header_ = make(http.Header)
  116379. }
  116380. return c.header_
  116381. }
  116382. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  116383. reqHeaders := make(http.Header)
  116384. for k, v := range c.header_ {
  116385. reqHeaders[k] = v
  116386. }
  116387. reqHeaders.Set("User-Agent", c.s.userAgent())
  116388. var body io.Reader = nil
  116389. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiontargethttpsproxiessetsslcertificatesrequest)
  116390. if err != nil {
  116391. return nil, err
  116392. }
  116393. reqHeaders.Set("Content-Type", "application/json")
  116394. c.urlParams_.Set("alt", alt)
  116395. c.urlParams_.Set("prettyPrint", "false")
  116396. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  116397. urls += "?" + c.urlParams_.Encode()
  116398. req, err := http.NewRequest("POST", urls, body)
  116399. if err != nil {
  116400. return nil, err
  116401. }
  116402. req.Header = reqHeaders
  116403. googleapi.Expand(req.URL, map[string]string{
  116404. "project": c.project,
  116405. "region": c.region,
  116406. "targetHttpsProxy": c.targetHttpsProxy,
  116407. })
  116408. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116409. }
  116410. // Do executes the "compute.regionTargetHttpsProxies.setSslCertificates" call.
  116411. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116412. // status code is an error. Response headers are in either
  116413. // *Operation.ServerResponse.Header or (if a response was returned at
  116414. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116415. // to check whether the returned error was because
  116416. // http.StatusNotModified was returned.
  116417. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116418. gensupport.SetOptions(c.urlParams_, opts...)
  116419. res, err := c.doRequest("json")
  116420. if res != nil && res.StatusCode == http.StatusNotModified {
  116421. if res.Body != nil {
  116422. res.Body.Close()
  116423. }
  116424. return nil, &googleapi.Error{
  116425. Code: res.StatusCode,
  116426. Header: res.Header,
  116427. }
  116428. }
  116429. if err != nil {
  116430. return nil, err
  116431. }
  116432. defer googleapi.CloseBody(res)
  116433. if err := googleapi.CheckResponse(res); err != nil {
  116434. return nil, err
  116435. }
  116436. ret := &Operation{
  116437. ServerResponse: googleapi.ServerResponse{
  116438. Header: res.Header,
  116439. HTTPStatusCode: res.StatusCode,
  116440. },
  116441. }
  116442. target := &ret
  116443. if err := gensupport.DecodeResponse(target, res); err != nil {
  116444. return nil, err
  116445. }
  116446. return ret, nil
  116447. // {
  116448. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  116449. // "httpMethod": "POST",
  116450. // "id": "compute.regionTargetHttpsProxies.setSslCertificates",
  116451. // "parameterOrder": [
  116452. // "project",
  116453. // "region",
  116454. // "targetHttpsProxy"
  116455. // ],
  116456. // "parameters": {
  116457. // "project": {
  116458. // "description": "Project ID for this request.",
  116459. // "location": "path",
  116460. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116461. // "required": true,
  116462. // "type": "string"
  116463. // },
  116464. // "region": {
  116465. // "description": "Name of the region scoping this request.",
  116466. // "location": "path",
  116467. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116468. // "required": true,
  116469. // "type": "string"
  116470. // },
  116471. // "requestId": {
  116472. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  116473. // "location": "query",
  116474. // "type": "string"
  116475. // },
  116476. // "targetHttpsProxy": {
  116477. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  116478. // "location": "path",
  116479. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116480. // "required": true,
  116481. // "type": "string"
  116482. // }
  116483. // },
  116484. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  116485. // "request": {
  116486. // "$ref": "RegionTargetHttpsProxiesSetSslCertificatesRequest"
  116487. // },
  116488. // "response": {
  116489. // "$ref": "Operation"
  116490. // },
  116491. // "scopes": [
  116492. // "https://www.googleapis.com/auth/cloud-platform",
  116493. // "https://www.googleapis.com/auth/compute"
  116494. // ]
  116495. // }
  116496. }
  116497. // method id "compute.regionTargetHttpsProxies.setUrlMap":
  116498. type RegionTargetHttpsProxiesSetUrlMapCall struct {
  116499. s *Service
  116500. project string
  116501. region string
  116502. targetHttpsProxy string
  116503. urlmapreference *UrlMapReference
  116504. urlParams_ gensupport.URLParams
  116505. ctx_ context.Context
  116506. header_ http.Header
  116507. }
  116508. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  116509. func (r *RegionTargetHttpsProxiesService) SetUrlMap(project string, region string, targetHttpsProxy string, urlmapreference *UrlMapReference) *RegionTargetHttpsProxiesSetUrlMapCall {
  116510. c := &RegionTargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116511. c.project = project
  116512. c.region = region
  116513. c.targetHttpsProxy = targetHttpsProxy
  116514. c.urlmapreference = urlmapreference
  116515. return c
  116516. }
  116517. // RequestId sets the optional parameter "requestId": An optional
  116518. // request ID to identify requests. Specify a unique request ID so that
  116519. // if you must retry your request, the server will know to ignore the
  116520. // request if it has already been completed.
  116521. //
  116522. // For example, consider a situation where you make an initial request
  116523. // and the request times out. If you make the request again with the
  116524. // same request ID, the server can check if original operation with the
  116525. // same request ID was received, and if so, will ignore the second
  116526. // request. This prevents clients from accidentally creating duplicate
  116527. // commitments.
  116528. //
  116529. // The request ID must be a valid UUID with the exception that zero UUID
  116530. // is not supported (00000000-0000-0000-0000-000000000000).
  116531. func (c *RegionTargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *RegionTargetHttpsProxiesSetUrlMapCall {
  116532. c.urlParams_.Set("requestId", requestId)
  116533. return c
  116534. }
  116535. // Fields allows partial responses to be retrieved. See
  116536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116537. // for more information.
  116538. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesSetUrlMapCall {
  116539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116540. return c
  116541. }
  116542. // Context sets the context to be used in this call's Do method. Any
  116543. // pending HTTP request will be aborted if the provided context is
  116544. // canceled.
  116545. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *RegionTargetHttpsProxiesSetUrlMapCall {
  116546. c.ctx_ = ctx
  116547. return c
  116548. }
  116549. // Header returns an http.Header that can be modified by the caller to
  116550. // add HTTP headers to the request.
  116551. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  116552. if c.header_ == nil {
  116553. c.header_ = make(http.Header)
  116554. }
  116555. return c.header_
  116556. }
  116557. func (c *RegionTargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  116558. reqHeaders := make(http.Header)
  116559. for k, v := range c.header_ {
  116560. reqHeaders[k] = v
  116561. }
  116562. reqHeaders.Set("User-Agent", c.s.userAgent())
  116563. var body io.Reader = nil
  116564. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  116565. if err != nil {
  116566. return nil, err
  116567. }
  116568. reqHeaders.Set("Content-Type", "application/json")
  116569. c.urlParams_.Set("alt", alt)
  116570. c.urlParams_.Set("prettyPrint", "false")
  116571. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  116572. urls += "?" + c.urlParams_.Encode()
  116573. req, err := http.NewRequest("POST", urls, body)
  116574. if err != nil {
  116575. return nil, err
  116576. }
  116577. req.Header = reqHeaders
  116578. googleapi.Expand(req.URL, map[string]string{
  116579. "project": c.project,
  116580. "region": c.region,
  116581. "targetHttpsProxy": c.targetHttpsProxy,
  116582. })
  116583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116584. }
  116585. // Do executes the "compute.regionTargetHttpsProxies.setUrlMap" call.
  116586. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116587. // status code is an error. Response headers are in either
  116588. // *Operation.ServerResponse.Header or (if a response was returned at
  116589. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116590. // to check whether the returned error was because
  116591. // http.StatusNotModified was returned.
  116592. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116593. gensupport.SetOptions(c.urlParams_, opts...)
  116594. res, err := c.doRequest("json")
  116595. if res != nil && res.StatusCode == http.StatusNotModified {
  116596. if res.Body != nil {
  116597. res.Body.Close()
  116598. }
  116599. return nil, &googleapi.Error{
  116600. Code: res.StatusCode,
  116601. Header: res.Header,
  116602. }
  116603. }
  116604. if err != nil {
  116605. return nil, err
  116606. }
  116607. defer googleapi.CloseBody(res)
  116608. if err := googleapi.CheckResponse(res); err != nil {
  116609. return nil, err
  116610. }
  116611. ret := &Operation{
  116612. ServerResponse: googleapi.ServerResponse{
  116613. Header: res.Header,
  116614. HTTPStatusCode: res.StatusCode,
  116615. },
  116616. }
  116617. target := &ret
  116618. if err := gensupport.DecodeResponse(target, res); err != nil {
  116619. return nil, err
  116620. }
  116621. return ret, nil
  116622. // {
  116623. // "description": "Changes the URL map for TargetHttpsProxy.",
  116624. // "httpMethod": "POST",
  116625. // "id": "compute.regionTargetHttpsProxies.setUrlMap",
  116626. // "parameterOrder": [
  116627. // "project",
  116628. // "region",
  116629. // "targetHttpsProxy"
  116630. // ],
  116631. // "parameters": {
  116632. // "project": {
  116633. // "description": "Project ID for this request.",
  116634. // "location": "path",
  116635. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116636. // "required": true,
  116637. // "type": "string"
  116638. // },
  116639. // "region": {
  116640. // "description": "Name of the region scoping this request.",
  116641. // "location": "path",
  116642. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116643. // "required": true,
  116644. // "type": "string"
  116645. // },
  116646. // "requestId": {
  116647. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  116648. // "location": "query",
  116649. // "type": "string"
  116650. // },
  116651. // "targetHttpsProxy": {
  116652. // "description": "Name of the TargetHttpsProxy to set a URL map for.",
  116653. // "location": "path",
  116654. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116655. // "required": true,
  116656. // "type": "string"
  116657. // }
  116658. // },
  116659. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  116660. // "request": {
  116661. // "$ref": "UrlMapReference"
  116662. // },
  116663. // "response": {
  116664. // "$ref": "Operation"
  116665. // },
  116666. // "scopes": [
  116667. // "https://www.googleapis.com/auth/cloud-platform",
  116668. // "https://www.googleapis.com/auth/compute"
  116669. // ]
  116670. // }
  116671. }
  116672. // method id "compute.regionTargetHttpsProxies.testIamPermissions":
  116673. type RegionTargetHttpsProxiesTestIamPermissionsCall struct {
  116674. s *Service
  116675. project string
  116676. region string
  116677. resource string
  116678. testpermissionsrequest *TestPermissionsRequest
  116679. urlParams_ gensupport.URLParams
  116680. ctx_ context.Context
  116681. header_ http.Header
  116682. }
  116683. // TestIamPermissions: Returns permissions that a caller has on the
  116684. // specified resource.
  116685. func (r *RegionTargetHttpsProxiesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionTargetHttpsProxiesTestIamPermissionsCall {
  116686. c := &RegionTargetHttpsProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116687. c.project = project
  116688. c.region = region
  116689. c.resource = resource
  116690. c.testpermissionsrequest = testpermissionsrequest
  116691. return c
  116692. }
  116693. // Fields allows partial responses to be retrieved. See
  116694. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116695. // for more information.
  116696. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesTestIamPermissionsCall {
  116697. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116698. return c
  116699. }
  116700. // Context sets the context to be used in this call's Do method. Any
  116701. // pending HTTP request will be aborted if the provided context is
  116702. // canceled.
  116703. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Context(ctx context.Context) *RegionTargetHttpsProxiesTestIamPermissionsCall {
  116704. c.ctx_ = ctx
  116705. return c
  116706. }
  116707. // Header returns an http.Header that can be modified by the caller to
  116708. // add HTTP headers to the request.
  116709. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Header() http.Header {
  116710. if c.header_ == nil {
  116711. c.header_ = make(http.Header)
  116712. }
  116713. return c.header_
  116714. }
  116715. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  116716. reqHeaders := make(http.Header)
  116717. for k, v := range c.header_ {
  116718. reqHeaders[k] = v
  116719. }
  116720. reqHeaders.Set("User-Agent", c.s.userAgent())
  116721. var body io.Reader = nil
  116722. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  116723. if err != nil {
  116724. return nil, err
  116725. }
  116726. reqHeaders.Set("Content-Type", "application/json")
  116727. c.urlParams_.Set("alt", alt)
  116728. c.urlParams_.Set("prettyPrint", "false")
  116729. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{resource}/testIamPermissions")
  116730. urls += "?" + c.urlParams_.Encode()
  116731. req, err := http.NewRequest("POST", urls, body)
  116732. if err != nil {
  116733. return nil, err
  116734. }
  116735. req.Header = reqHeaders
  116736. googleapi.Expand(req.URL, map[string]string{
  116737. "project": c.project,
  116738. "region": c.region,
  116739. "resource": c.resource,
  116740. })
  116741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116742. }
  116743. // Do executes the "compute.regionTargetHttpsProxies.testIamPermissions" call.
  116744. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  116745. // non-2xx status code is an error. Response headers are in either
  116746. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  116747. // returned at all) in error.(*googleapi.Error).Header. Use
  116748. // googleapi.IsNotModified to check whether the returned error was
  116749. // because http.StatusNotModified was returned.
  116750. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  116751. gensupport.SetOptions(c.urlParams_, opts...)
  116752. res, err := c.doRequest("json")
  116753. if res != nil && res.StatusCode == http.StatusNotModified {
  116754. if res.Body != nil {
  116755. res.Body.Close()
  116756. }
  116757. return nil, &googleapi.Error{
  116758. Code: res.StatusCode,
  116759. Header: res.Header,
  116760. }
  116761. }
  116762. if err != nil {
  116763. return nil, err
  116764. }
  116765. defer googleapi.CloseBody(res)
  116766. if err := googleapi.CheckResponse(res); err != nil {
  116767. return nil, err
  116768. }
  116769. ret := &TestPermissionsResponse{
  116770. ServerResponse: googleapi.ServerResponse{
  116771. Header: res.Header,
  116772. HTTPStatusCode: res.StatusCode,
  116773. },
  116774. }
  116775. target := &ret
  116776. if err := gensupport.DecodeResponse(target, res); err != nil {
  116777. return nil, err
  116778. }
  116779. return ret, nil
  116780. // {
  116781. // "description": "Returns permissions that a caller has on the specified resource.",
  116782. // "httpMethod": "POST",
  116783. // "id": "compute.regionTargetHttpsProxies.testIamPermissions",
  116784. // "parameterOrder": [
  116785. // "project",
  116786. // "region",
  116787. // "resource"
  116788. // ],
  116789. // "parameters": {
  116790. // "project": {
  116791. // "description": "Project ID for this request.",
  116792. // "location": "path",
  116793. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116794. // "required": true,
  116795. // "type": "string"
  116796. // },
  116797. // "region": {
  116798. // "description": "The name of the region for this request.",
  116799. // "location": "path",
  116800. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116801. // "required": true,
  116802. // "type": "string"
  116803. // },
  116804. // "resource": {
  116805. // "description": "Name or id of the resource for this request.",
  116806. // "location": "path",
  116807. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116808. // "required": true,
  116809. // "type": "string"
  116810. // }
  116811. // },
  116812. // "path": "{project}/regions/{region}/targetHttpsProxies/{resource}/testIamPermissions",
  116813. // "request": {
  116814. // "$ref": "TestPermissionsRequest"
  116815. // },
  116816. // "response": {
  116817. // "$ref": "TestPermissionsResponse"
  116818. // },
  116819. // "scopes": [
  116820. // "https://www.googleapis.com/auth/cloud-platform",
  116821. // "https://www.googleapis.com/auth/compute",
  116822. // "https://www.googleapis.com/auth/compute.readonly"
  116823. // ]
  116824. // }
  116825. }
  116826. // method id "compute.regionUrlMaps.delete":
  116827. type RegionUrlMapsDeleteCall struct {
  116828. s *Service
  116829. project string
  116830. region string
  116831. urlMap string
  116832. urlParams_ gensupport.URLParams
  116833. ctx_ context.Context
  116834. header_ http.Header
  116835. }
  116836. // Delete: Deletes the specified UrlMap resource.
  116837. func (r *RegionUrlMapsService) Delete(project string, region string, urlMap string) *RegionUrlMapsDeleteCall {
  116838. c := &RegionUrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116839. c.project = project
  116840. c.region = region
  116841. c.urlMap = urlMap
  116842. return c
  116843. }
  116844. // RequestId sets the optional parameter "requestId": begin_interface:
  116845. // MixerMutationRequestBuilder Request ID to support idempotency.
  116846. func (c *RegionUrlMapsDeleteCall) RequestId(requestId string) *RegionUrlMapsDeleteCall {
  116847. c.urlParams_.Set("requestId", requestId)
  116848. return c
  116849. }
  116850. // Fields allows partial responses to be retrieved. See
  116851. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116852. // for more information.
  116853. func (c *RegionUrlMapsDeleteCall) Fields(s ...googleapi.Field) *RegionUrlMapsDeleteCall {
  116854. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116855. return c
  116856. }
  116857. // Context sets the context to be used in this call's Do method. Any
  116858. // pending HTTP request will be aborted if the provided context is
  116859. // canceled.
  116860. func (c *RegionUrlMapsDeleteCall) Context(ctx context.Context) *RegionUrlMapsDeleteCall {
  116861. c.ctx_ = ctx
  116862. return c
  116863. }
  116864. // Header returns an http.Header that can be modified by the caller to
  116865. // add HTTP headers to the request.
  116866. func (c *RegionUrlMapsDeleteCall) Header() http.Header {
  116867. if c.header_ == nil {
  116868. c.header_ = make(http.Header)
  116869. }
  116870. return c.header_
  116871. }
  116872. func (c *RegionUrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  116873. reqHeaders := make(http.Header)
  116874. for k, v := range c.header_ {
  116875. reqHeaders[k] = v
  116876. }
  116877. reqHeaders.Set("User-Agent", c.s.userAgent())
  116878. var body io.Reader = nil
  116879. c.urlParams_.Set("alt", alt)
  116880. c.urlParams_.Set("prettyPrint", "false")
  116881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  116882. urls += "?" + c.urlParams_.Encode()
  116883. req, err := http.NewRequest("DELETE", urls, body)
  116884. if err != nil {
  116885. return nil, err
  116886. }
  116887. req.Header = reqHeaders
  116888. googleapi.Expand(req.URL, map[string]string{
  116889. "project": c.project,
  116890. "region": c.region,
  116891. "urlMap": c.urlMap,
  116892. })
  116893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116894. }
  116895. // Do executes the "compute.regionUrlMaps.delete" call.
  116896. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116897. // status code is an error. Response headers are in either
  116898. // *Operation.ServerResponse.Header or (if a response was returned at
  116899. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116900. // to check whether the returned error was because
  116901. // http.StatusNotModified was returned.
  116902. func (c *RegionUrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116903. gensupport.SetOptions(c.urlParams_, opts...)
  116904. res, err := c.doRequest("json")
  116905. if res != nil && res.StatusCode == http.StatusNotModified {
  116906. if res.Body != nil {
  116907. res.Body.Close()
  116908. }
  116909. return nil, &googleapi.Error{
  116910. Code: res.StatusCode,
  116911. Header: res.Header,
  116912. }
  116913. }
  116914. if err != nil {
  116915. return nil, err
  116916. }
  116917. defer googleapi.CloseBody(res)
  116918. if err := googleapi.CheckResponse(res); err != nil {
  116919. return nil, err
  116920. }
  116921. ret := &Operation{
  116922. ServerResponse: googleapi.ServerResponse{
  116923. Header: res.Header,
  116924. HTTPStatusCode: res.StatusCode,
  116925. },
  116926. }
  116927. target := &ret
  116928. if err := gensupport.DecodeResponse(target, res); err != nil {
  116929. return nil, err
  116930. }
  116931. return ret, nil
  116932. // {
  116933. // "description": "Deletes the specified UrlMap resource.",
  116934. // "httpMethod": "DELETE",
  116935. // "id": "compute.regionUrlMaps.delete",
  116936. // "parameterOrder": [
  116937. // "project",
  116938. // "region",
  116939. // "urlMap"
  116940. // ],
  116941. // "parameters": {
  116942. // "project": {
  116943. // "description": "Project ID for this request.",
  116944. // "location": "path",
  116945. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116946. // "required": true,
  116947. // "type": "string"
  116948. // },
  116949. // "region": {
  116950. // "description": "Name of the region scoping this request.",
  116951. // "location": "path",
  116952. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116953. // "required": true,
  116954. // "type": "string"
  116955. // },
  116956. // "requestId": {
  116957. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  116958. // "location": "query",
  116959. // "type": "string"
  116960. // },
  116961. // "urlMap": {
  116962. // "description": "Name of the UrlMap resource to delete.",
  116963. // "location": "path",
  116964. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116965. // "required": true,
  116966. // "type": "string"
  116967. // }
  116968. // },
  116969. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  116970. // "response": {
  116971. // "$ref": "Operation"
  116972. // },
  116973. // "scopes": [
  116974. // "https://www.googleapis.com/auth/cloud-platform",
  116975. // "https://www.googleapis.com/auth/compute"
  116976. // ]
  116977. // }
  116978. }
  116979. // method id "compute.regionUrlMaps.get":
  116980. type RegionUrlMapsGetCall struct {
  116981. s *Service
  116982. project string
  116983. region string
  116984. urlMap string
  116985. urlParams_ gensupport.URLParams
  116986. ifNoneMatch_ string
  116987. ctx_ context.Context
  116988. header_ http.Header
  116989. }
  116990. // Get: Returns the specified UrlMap resource. Gets a list of available
  116991. // URL maps by making a list() request.
  116992. func (r *RegionUrlMapsService) Get(project string, region string, urlMap string) *RegionUrlMapsGetCall {
  116993. c := &RegionUrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116994. c.project = project
  116995. c.region = region
  116996. c.urlMap = urlMap
  116997. return c
  116998. }
  116999. // Fields allows partial responses to be retrieved. See
  117000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117001. // for more information.
  117002. func (c *RegionUrlMapsGetCall) Fields(s ...googleapi.Field) *RegionUrlMapsGetCall {
  117003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117004. return c
  117005. }
  117006. // IfNoneMatch sets the optional parameter which makes the operation
  117007. // fail if the object's ETag matches the given value. This is useful for
  117008. // getting updates only after the object has changed since the last
  117009. // request. Use googleapi.IsNotModified to check whether the response
  117010. // error from Do is the result of In-None-Match.
  117011. func (c *RegionUrlMapsGetCall) IfNoneMatch(entityTag string) *RegionUrlMapsGetCall {
  117012. c.ifNoneMatch_ = entityTag
  117013. return c
  117014. }
  117015. // Context sets the context to be used in this call's Do method. Any
  117016. // pending HTTP request will be aborted if the provided context is
  117017. // canceled.
  117018. func (c *RegionUrlMapsGetCall) Context(ctx context.Context) *RegionUrlMapsGetCall {
  117019. c.ctx_ = ctx
  117020. return c
  117021. }
  117022. // Header returns an http.Header that can be modified by the caller to
  117023. // add HTTP headers to the request.
  117024. func (c *RegionUrlMapsGetCall) Header() http.Header {
  117025. if c.header_ == nil {
  117026. c.header_ = make(http.Header)
  117027. }
  117028. return c.header_
  117029. }
  117030. func (c *RegionUrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  117031. reqHeaders := make(http.Header)
  117032. for k, v := range c.header_ {
  117033. reqHeaders[k] = v
  117034. }
  117035. reqHeaders.Set("User-Agent", c.s.userAgent())
  117036. if c.ifNoneMatch_ != "" {
  117037. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117038. }
  117039. var body io.Reader = nil
  117040. c.urlParams_.Set("alt", alt)
  117041. c.urlParams_.Set("prettyPrint", "false")
  117042. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  117043. urls += "?" + c.urlParams_.Encode()
  117044. req, err := http.NewRequest("GET", urls, body)
  117045. if err != nil {
  117046. return nil, err
  117047. }
  117048. req.Header = reqHeaders
  117049. googleapi.Expand(req.URL, map[string]string{
  117050. "project": c.project,
  117051. "region": c.region,
  117052. "urlMap": c.urlMap,
  117053. })
  117054. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117055. }
  117056. // Do executes the "compute.regionUrlMaps.get" call.
  117057. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  117058. // code is an error. Response headers are in either
  117059. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  117060. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  117061. // check whether the returned error was because http.StatusNotModified
  117062. // was returned.
  117063. func (c *RegionUrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  117064. gensupport.SetOptions(c.urlParams_, opts...)
  117065. res, err := c.doRequest("json")
  117066. if res != nil && res.StatusCode == http.StatusNotModified {
  117067. if res.Body != nil {
  117068. res.Body.Close()
  117069. }
  117070. return nil, &googleapi.Error{
  117071. Code: res.StatusCode,
  117072. Header: res.Header,
  117073. }
  117074. }
  117075. if err != nil {
  117076. return nil, err
  117077. }
  117078. defer googleapi.CloseBody(res)
  117079. if err := googleapi.CheckResponse(res); err != nil {
  117080. return nil, err
  117081. }
  117082. ret := &UrlMap{
  117083. ServerResponse: googleapi.ServerResponse{
  117084. Header: res.Header,
  117085. HTTPStatusCode: res.StatusCode,
  117086. },
  117087. }
  117088. target := &ret
  117089. if err := gensupport.DecodeResponse(target, res); err != nil {
  117090. return nil, err
  117091. }
  117092. return ret, nil
  117093. // {
  117094. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  117095. // "httpMethod": "GET",
  117096. // "id": "compute.regionUrlMaps.get",
  117097. // "parameterOrder": [
  117098. // "project",
  117099. // "region",
  117100. // "urlMap"
  117101. // ],
  117102. // "parameters": {
  117103. // "project": {
  117104. // "description": "Project ID for this request.",
  117105. // "location": "path",
  117106. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117107. // "required": true,
  117108. // "type": "string"
  117109. // },
  117110. // "region": {
  117111. // "description": "Name of the region scoping this request.",
  117112. // "location": "path",
  117113. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117114. // "required": true,
  117115. // "type": "string"
  117116. // },
  117117. // "urlMap": {
  117118. // "description": "Name of the UrlMap resource to return.",
  117119. // "location": "path",
  117120. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  117121. // "required": true,
  117122. // "type": "string"
  117123. // }
  117124. // },
  117125. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  117126. // "response": {
  117127. // "$ref": "UrlMap"
  117128. // },
  117129. // "scopes": [
  117130. // "https://www.googleapis.com/auth/cloud-platform",
  117131. // "https://www.googleapis.com/auth/compute",
  117132. // "https://www.googleapis.com/auth/compute.readonly"
  117133. // ]
  117134. // }
  117135. }
  117136. // method id "compute.regionUrlMaps.insert":
  117137. type RegionUrlMapsInsertCall struct {
  117138. s *Service
  117139. project string
  117140. region string
  117141. urlmap *UrlMap
  117142. urlParams_ gensupport.URLParams
  117143. ctx_ context.Context
  117144. header_ http.Header
  117145. }
  117146. // Insert: Creates a UrlMap resource in the specified project using the
  117147. // data included in the request.
  117148. func (r *RegionUrlMapsService) Insert(project string, region string, urlmap *UrlMap) *RegionUrlMapsInsertCall {
  117149. c := &RegionUrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117150. c.project = project
  117151. c.region = region
  117152. c.urlmap = urlmap
  117153. return c
  117154. }
  117155. // RequestId sets the optional parameter "requestId": begin_interface:
  117156. // MixerMutationRequestBuilder Request ID to support idempotency.
  117157. func (c *RegionUrlMapsInsertCall) RequestId(requestId string) *RegionUrlMapsInsertCall {
  117158. c.urlParams_.Set("requestId", requestId)
  117159. return c
  117160. }
  117161. // Fields allows partial responses to be retrieved. See
  117162. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117163. // for more information.
  117164. func (c *RegionUrlMapsInsertCall) Fields(s ...googleapi.Field) *RegionUrlMapsInsertCall {
  117165. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117166. return c
  117167. }
  117168. // Context sets the context to be used in this call's Do method. Any
  117169. // pending HTTP request will be aborted if the provided context is
  117170. // canceled.
  117171. func (c *RegionUrlMapsInsertCall) Context(ctx context.Context) *RegionUrlMapsInsertCall {
  117172. c.ctx_ = ctx
  117173. return c
  117174. }
  117175. // Header returns an http.Header that can be modified by the caller to
  117176. // add HTTP headers to the request.
  117177. func (c *RegionUrlMapsInsertCall) Header() http.Header {
  117178. if c.header_ == nil {
  117179. c.header_ = make(http.Header)
  117180. }
  117181. return c.header_
  117182. }
  117183. func (c *RegionUrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  117184. reqHeaders := make(http.Header)
  117185. for k, v := range c.header_ {
  117186. reqHeaders[k] = v
  117187. }
  117188. reqHeaders.Set("User-Agent", c.s.userAgent())
  117189. var body io.Reader = nil
  117190. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  117191. if err != nil {
  117192. return nil, err
  117193. }
  117194. reqHeaders.Set("Content-Type", "application/json")
  117195. c.urlParams_.Set("alt", alt)
  117196. c.urlParams_.Set("prettyPrint", "false")
  117197. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps")
  117198. urls += "?" + c.urlParams_.Encode()
  117199. req, err := http.NewRequest("POST", urls, body)
  117200. if err != nil {
  117201. return nil, err
  117202. }
  117203. req.Header = reqHeaders
  117204. googleapi.Expand(req.URL, map[string]string{
  117205. "project": c.project,
  117206. "region": c.region,
  117207. })
  117208. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117209. }
  117210. // Do executes the "compute.regionUrlMaps.insert" call.
  117211. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117212. // status code is an error. Response headers are in either
  117213. // *Operation.ServerResponse.Header or (if a response was returned at
  117214. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117215. // to check whether the returned error was because
  117216. // http.StatusNotModified was returned.
  117217. func (c *RegionUrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117218. gensupport.SetOptions(c.urlParams_, opts...)
  117219. res, err := c.doRequest("json")
  117220. if res != nil && res.StatusCode == http.StatusNotModified {
  117221. if res.Body != nil {
  117222. res.Body.Close()
  117223. }
  117224. return nil, &googleapi.Error{
  117225. Code: res.StatusCode,
  117226. Header: res.Header,
  117227. }
  117228. }
  117229. if err != nil {
  117230. return nil, err
  117231. }
  117232. defer googleapi.CloseBody(res)
  117233. if err := googleapi.CheckResponse(res); err != nil {
  117234. return nil, err
  117235. }
  117236. ret := &Operation{
  117237. ServerResponse: googleapi.ServerResponse{
  117238. Header: res.Header,
  117239. HTTPStatusCode: res.StatusCode,
  117240. },
  117241. }
  117242. target := &ret
  117243. if err := gensupport.DecodeResponse(target, res); err != nil {
  117244. return nil, err
  117245. }
  117246. return ret, nil
  117247. // {
  117248. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  117249. // "httpMethod": "POST",
  117250. // "id": "compute.regionUrlMaps.insert",
  117251. // "parameterOrder": [
  117252. // "project",
  117253. // "region"
  117254. // ],
  117255. // "parameters": {
  117256. // "project": {
  117257. // "description": "Project ID for this request.",
  117258. // "location": "path",
  117259. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117260. // "required": true,
  117261. // "type": "string"
  117262. // },
  117263. // "region": {
  117264. // "description": "Name of the region scoping this request.",
  117265. // "location": "path",
  117266. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117267. // "required": true,
  117268. // "type": "string"
  117269. // },
  117270. // "requestId": {
  117271. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  117272. // "location": "query",
  117273. // "type": "string"
  117274. // }
  117275. // },
  117276. // "path": "{project}/regions/{region}/urlMaps",
  117277. // "request": {
  117278. // "$ref": "UrlMap"
  117279. // },
  117280. // "response": {
  117281. // "$ref": "Operation"
  117282. // },
  117283. // "scopes": [
  117284. // "https://www.googleapis.com/auth/cloud-platform",
  117285. // "https://www.googleapis.com/auth/compute"
  117286. // ]
  117287. // }
  117288. }
  117289. // method id "compute.regionUrlMaps.invalidateCache":
  117290. type RegionUrlMapsInvalidateCacheCall struct {
  117291. s *Service
  117292. project string
  117293. region string
  117294. urlMap string
  117295. cacheinvalidationrule *CacheInvalidationRule
  117296. urlParams_ gensupport.URLParams
  117297. ctx_ context.Context
  117298. header_ http.Header
  117299. }
  117300. // InvalidateCache: Initiates a cache invalidation operation,
  117301. // invalidating the specified path, scoped to the specified UrlMap.
  117302. func (r *RegionUrlMapsService) InvalidateCache(project string, region string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *RegionUrlMapsInvalidateCacheCall {
  117303. c := &RegionUrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117304. c.project = project
  117305. c.region = region
  117306. c.urlMap = urlMap
  117307. c.cacheinvalidationrule = cacheinvalidationrule
  117308. return c
  117309. }
  117310. // RequestId sets the optional parameter "requestId": begin_interface:
  117311. // MixerMutationRequestBuilder Request ID to support idempotency.
  117312. func (c *RegionUrlMapsInvalidateCacheCall) RequestId(requestId string) *RegionUrlMapsInvalidateCacheCall {
  117313. c.urlParams_.Set("requestId", requestId)
  117314. return c
  117315. }
  117316. // Fields allows partial responses to be retrieved. See
  117317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117318. // for more information.
  117319. func (c *RegionUrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *RegionUrlMapsInvalidateCacheCall {
  117320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117321. return c
  117322. }
  117323. // Context sets the context to be used in this call's Do method. Any
  117324. // pending HTTP request will be aborted if the provided context is
  117325. // canceled.
  117326. func (c *RegionUrlMapsInvalidateCacheCall) Context(ctx context.Context) *RegionUrlMapsInvalidateCacheCall {
  117327. c.ctx_ = ctx
  117328. return c
  117329. }
  117330. // Header returns an http.Header that can be modified by the caller to
  117331. // add HTTP headers to the request.
  117332. func (c *RegionUrlMapsInvalidateCacheCall) Header() http.Header {
  117333. if c.header_ == nil {
  117334. c.header_ = make(http.Header)
  117335. }
  117336. return c.header_
  117337. }
  117338. func (c *RegionUrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  117339. reqHeaders := make(http.Header)
  117340. for k, v := range c.header_ {
  117341. reqHeaders[k] = v
  117342. }
  117343. reqHeaders.Set("User-Agent", c.s.userAgent())
  117344. var body io.Reader = nil
  117345. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  117346. if err != nil {
  117347. return nil, err
  117348. }
  117349. reqHeaders.Set("Content-Type", "application/json")
  117350. c.urlParams_.Set("alt", alt)
  117351. c.urlParams_.Set("prettyPrint", "false")
  117352. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}/invalidateCache")
  117353. urls += "?" + c.urlParams_.Encode()
  117354. req, err := http.NewRequest("POST", urls, body)
  117355. if err != nil {
  117356. return nil, err
  117357. }
  117358. req.Header = reqHeaders
  117359. googleapi.Expand(req.URL, map[string]string{
  117360. "project": c.project,
  117361. "region": c.region,
  117362. "urlMap": c.urlMap,
  117363. })
  117364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117365. }
  117366. // Do executes the "compute.regionUrlMaps.invalidateCache" call.
  117367. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117368. // status code is an error. Response headers are in either
  117369. // *Operation.ServerResponse.Header or (if a response was returned at
  117370. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117371. // to check whether the returned error was because
  117372. // http.StatusNotModified was returned.
  117373. func (c *RegionUrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117374. gensupport.SetOptions(c.urlParams_, opts...)
  117375. res, err := c.doRequest("json")
  117376. if res != nil && res.StatusCode == http.StatusNotModified {
  117377. if res.Body != nil {
  117378. res.Body.Close()
  117379. }
  117380. return nil, &googleapi.Error{
  117381. Code: res.StatusCode,
  117382. Header: res.Header,
  117383. }
  117384. }
  117385. if err != nil {
  117386. return nil, err
  117387. }
  117388. defer googleapi.CloseBody(res)
  117389. if err := googleapi.CheckResponse(res); err != nil {
  117390. return nil, err
  117391. }
  117392. ret := &Operation{
  117393. ServerResponse: googleapi.ServerResponse{
  117394. Header: res.Header,
  117395. HTTPStatusCode: res.StatusCode,
  117396. },
  117397. }
  117398. target := &ret
  117399. if err := gensupport.DecodeResponse(target, res); err != nil {
  117400. return nil, err
  117401. }
  117402. return ret, nil
  117403. // {
  117404. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  117405. // "httpMethod": "POST",
  117406. // "id": "compute.regionUrlMaps.invalidateCache",
  117407. // "parameterOrder": [
  117408. // "project",
  117409. // "region",
  117410. // "urlMap"
  117411. // ],
  117412. // "parameters": {
  117413. // "project": {
  117414. // "description": "Project ID for this request.",
  117415. // "location": "path",
  117416. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117417. // "required": true,
  117418. // "type": "string"
  117419. // },
  117420. // "region": {
  117421. // "description": "Name of the region scoping this request.",
  117422. // "location": "path",
  117423. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117424. // "required": true,
  117425. // "type": "string"
  117426. // },
  117427. // "requestId": {
  117428. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  117429. // "location": "query",
  117430. // "type": "string"
  117431. // },
  117432. // "urlMap": {
  117433. // "description": "Name of the UrlMap scoping this request.",
  117434. // "location": "path",
  117435. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  117436. // "required": true,
  117437. // "type": "string"
  117438. // }
  117439. // },
  117440. // "path": "{project}/regions/{region}/urlMaps/{urlMap}/invalidateCache",
  117441. // "request": {
  117442. // "$ref": "CacheInvalidationRule"
  117443. // },
  117444. // "response": {
  117445. // "$ref": "Operation"
  117446. // },
  117447. // "scopes": [
  117448. // "https://www.googleapis.com/auth/cloud-platform",
  117449. // "https://www.googleapis.com/auth/compute"
  117450. // ]
  117451. // }
  117452. }
  117453. // method id "compute.regionUrlMaps.list":
  117454. type RegionUrlMapsListCall struct {
  117455. s *Service
  117456. project string
  117457. region string
  117458. urlParams_ gensupport.URLParams
  117459. ifNoneMatch_ string
  117460. ctx_ context.Context
  117461. header_ http.Header
  117462. }
  117463. // List: Retrieves the list of UrlMap resources available to the
  117464. // specified project in the specified region.
  117465. func (r *RegionUrlMapsService) List(project string, region string) *RegionUrlMapsListCall {
  117466. c := &RegionUrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117467. c.project = project
  117468. c.region = region
  117469. return c
  117470. }
  117471. // Filter sets the optional parameter "filter": A filter expression that
  117472. // filters resources listed in the response. The expression must specify
  117473. // the field name, a comparison operator, and the value that you want to
  117474. // use for filtering. The value must be a string, a number, or a
  117475. // boolean. The comparison operator must be either =, !=, >, or <.
  117476. //
  117477. // For example, if you are filtering Compute Engine instances, you can
  117478. // exclude instances named example-instance by specifying name !=
  117479. // example-instance.
  117480. //
  117481. // You can also filter nested fields. For example, you could specify
  117482. // scheduling.automaticRestart = false to include instances only if they
  117483. // are not scheduled for automatic restarts. You can use filtering on
  117484. // nested fields to filter based on resource labels.
  117485. //
  117486. // To filter on multiple expressions, provide each separate expression
  117487. // within parentheses. For example, (scheduling.automaticRestart = true)
  117488. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  117489. // AND expression. However, you can include AND and OR expressions
  117490. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  117491. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  117492. // true).
  117493. func (c *RegionUrlMapsListCall) Filter(filter string) *RegionUrlMapsListCall {
  117494. c.urlParams_.Set("filter", filter)
  117495. return c
  117496. }
  117497. // MaxResults sets the optional parameter "maxResults": The maximum
  117498. // number of results per page that should be returned. If the number of
  117499. // available results is larger than maxResults, Compute Engine returns a
  117500. // nextPageToken that can be used to get the next page of results in
  117501. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  117502. // (Default: 500)
  117503. func (c *RegionUrlMapsListCall) MaxResults(maxResults int64) *RegionUrlMapsListCall {
  117504. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  117505. return c
  117506. }
  117507. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  117508. // a certain order. By default, results are returned in alphanumerical
  117509. // order based on the resource name.
  117510. //
  117511. // You can also sort results in descending order based on the creation
  117512. // timestamp using orderBy="creationTimestamp desc". This sorts results
  117513. // based on the creationTimestamp field in reverse chronological order
  117514. // (newest result first). Use this to sort resources like operations so
  117515. // that the newest operation is returned first.
  117516. //
  117517. // Currently, only sorting by name or creationTimestamp desc is
  117518. // supported.
  117519. func (c *RegionUrlMapsListCall) OrderBy(orderBy string) *RegionUrlMapsListCall {
  117520. c.urlParams_.Set("orderBy", orderBy)
  117521. return c
  117522. }
  117523. // PageToken sets the optional parameter "pageToken": Specifies a page
  117524. // token to use. Set pageToken to the nextPageToken returned by a
  117525. // previous list request to get the next page of results.
  117526. func (c *RegionUrlMapsListCall) PageToken(pageToken string) *RegionUrlMapsListCall {
  117527. c.urlParams_.Set("pageToken", pageToken)
  117528. return c
  117529. }
  117530. // Fields allows partial responses to be retrieved. See
  117531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117532. // for more information.
  117533. func (c *RegionUrlMapsListCall) Fields(s ...googleapi.Field) *RegionUrlMapsListCall {
  117534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117535. return c
  117536. }
  117537. // IfNoneMatch sets the optional parameter which makes the operation
  117538. // fail if the object's ETag matches the given value. This is useful for
  117539. // getting updates only after the object has changed since the last
  117540. // request. Use googleapi.IsNotModified to check whether the response
  117541. // error from Do is the result of In-None-Match.
  117542. func (c *RegionUrlMapsListCall) IfNoneMatch(entityTag string) *RegionUrlMapsListCall {
  117543. c.ifNoneMatch_ = entityTag
  117544. return c
  117545. }
  117546. // Context sets the context to be used in this call's Do method. Any
  117547. // pending HTTP request will be aborted if the provided context is
  117548. // canceled.
  117549. func (c *RegionUrlMapsListCall) Context(ctx context.Context) *RegionUrlMapsListCall {
  117550. c.ctx_ = ctx
  117551. return c
  117552. }
  117553. // Header returns an http.Header that can be modified by the caller to
  117554. // add HTTP headers to the request.
  117555. func (c *RegionUrlMapsListCall) Header() http.Header {
  117556. if c.header_ == nil {
  117557. c.header_ = make(http.Header)
  117558. }
  117559. return c.header_
  117560. }
  117561. func (c *RegionUrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  117562. reqHeaders := make(http.Header)
  117563. for k, v := range c.header_ {
  117564. reqHeaders[k] = v
  117565. }
  117566. reqHeaders.Set("User-Agent", c.s.userAgent())
  117567. if c.ifNoneMatch_ != "" {
  117568. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117569. }
  117570. var body io.Reader = nil
  117571. c.urlParams_.Set("alt", alt)
  117572. c.urlParams_.Set("prettyPrint", "false")
  117573. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps")
  117574. urls += "?" + c.urlParams_.Encode()
  117575. req, err := http.NewRequest("GET", urls, body)
  117576. if err != nil {
  117577. return nil, err
  117578. }
  117579. req.Header = reqHeaders
  117580. googleapi.Expand(req.URL, map[string]string{
  117581. "project": c.project,
  117582. "region": c.region,
  117583. })
  117584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117585. }
  117586. // Do executes the "compute.regionUrlMaps.list" call.
  117587. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  117588. // status code is an error. Response headers are in either
  117589. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  117590. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117591. // to check whether the returned error was because
  117592. // http.StatusNotModified was returned.
  117593. func (c *RegionUrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  117594. gensupport.SetOptions(c.urlParams_, opts...)
  117595. res, err := c.doRequest("json")
  117596. if res != nil && res.StatusCode == http.StatusNotModified {
  117597. if res.Body != nil {
  117598. res.Body.Close()
  117599. }
  117600. return nil, &googleapi.Error{
  117601. Code: res.StatusCode,
  117602. Header: res.Header,
  117603. }
  117604. }
  117605. if err != nil {
  117606. return nil, err
  117607. }
  117608. defer googleapi.CloseBody(res)
  117609. if err := googleapi.CheckResponse(res); err != nil {
  117610. return nil, err
  117611. }
  117612. ret := &UrlMapList{
  117613. ServerResponse: googleapi.ServerResponse{
  117614. Header: res.Header,
  117615. HTTPStatusCode: res.StatusCode,
  117616. },
  117617. }
  117618. target := &ret
  117619. if err := gensupport.DecodeResponse(target, res); err != nil {
  117620. return nil, err
  117621. }
  117622. return ret, nil
  117623. // {
  117624. // "description": "Retrieves the list of UrlMap resources available to the specified project in the specified region.",
  117625. // "httpMethod": "GET",
  117626. // "id": "compute.regionUrlMaps.list",
  117627. // "parameterOrder": [
  117628. // "project",
  117629. // "region"
  117630. // ],
  117631. // "parameters": {
  117632. // "filter": {
  117633. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  117634. // "location": "query",
  117635. // "type": "string"
  117636. // },
  117637. // "maxResults": {
  117638. // "default": "500",
  117639. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  117640. // "format": "uint32",
  117641. // "location": "query",
  117642. // "minimum": "0",
  117643. // "type": "integer"
  117644. // },
  117645. // "orderBy": {
  117646. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  117647. // "location": "query",
  117648. // "type": "string"
  117649. // },
  117650. // "pageToken": {
  117651. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  117652. // "location": "query",
  117653. // "type": "string"
  117654. // },
  117655. // "project": {
  117656. // "description": "Project ID for this request.",
  117657. // "location": "path",
  117658. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117659. // "required": true,
  117660. // "type": "string"
  117661. // },
  117662. // "region": {
  117663. // "description": "Name of the region scoping this request.",
  117664. // "location": "path",
  117665. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117666. // "required": true,
  117667. // "type": "string"
  117668. // }
  117669. // },
  117670. // "path": "{project}/regions/{region}/urlMaps",
  117671. // "response": {
  117672. // "$ref": "UrlMapList"
  117673. // },
  117674. // "scopes": [
  117675. // "https://www.googleapis.com/auth/cloud-platform",
  117676. // "https://www.googleapis.com/auth/compute",
  117677. // "https://www.googleapis.com/auth/compute.readonly"
  117678. // ]
  117679. // }
  117680. }
  117681. // Pages invokes f for each page of results.
  117682. // A non-nil error returned from f will halt the iteration.
  117683. // The provided context supersedes any context provided to the Context method.
  117684. func (c *RegionUrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  117685. c.ctx_ = ctx
  117686. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  117687. for {
  117688. x, err := c.Do()
  117689. if err != nil {
  117690. return err
  117691. }
  117692. if err := f(x); err != nil {
  117693. return err
  117694. }
  117695. if x.NextPageToken == "" {
  117696. return nil
  117697. }
  117698. c.PageToken(x.NextPageToken)
  117699. }
  117700. }
  117701. // method id "compute.regionUrlMaps.patch":
  117702. type RegionUrlMapsPatchCall struct {
  117703. s *Service
  117704. project string
  117705. region string
  117706. urlMap string
  117707. urlmap *UrlMap
  117708. urlParams_ gensupport.URLParams
  117709. ctx_ context.Context
  117710. header_ http.Header
  117711. }
  117712. // Patch: Patches the specified UrlMap resource with the data included
  117713. // in the request. This method supports PATCH semantics and uses JSON
  117714. // merge patch format and processing rules.
  117715. func (r *RegionUrlMapsService) Patch(project string, region string, urlMap string, urlmap *UrlMap) *RegionUrlMapsPatchCall {
  117716. c := &RegionUrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117717. c.project = project
  117718. c.region = region
  117719. c.urlMap = urlMap
  117720. c.urlmap = urlmap
  117721. return c
  117722. }
  117723. // RequestId sets the optional parameter "requestId": begin_interface:
  117724. // MixerMutationRequestBuilder Request ID to support idempotency.
  117725. func (c *RegionUrlMapsPatchCall) RequestId(requestId string) *RegionUrlMapsPatchCall {
  117726. c.urlParams_.Set("requestId", requestId)
  117727. return c
  117728. }
  117729. // Fields allows partial responses to be retrieved. See
  117730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117731. // for more information.
  117732. func (c *RegionUrlMapsPatchCall) Fields(s ...googleapi.Field) *RegionUrlMapsPatchCall {
  117733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117734. return c
  117735. }
  117736. // Context sets the context to be used in this call's Do method. Any
  117737. // pending HTTP request will be aborted if the provided context is
  117738. // canceled.
  117739. func (c *RegionUrlMapsPatchCall) Context(ctx context.Context) *RegionUrlMapsPatchCall {
  117740. c.ctx_ = ctx
  117741. return c
  117742. }
  117743. // Header returns an http.Header that can be modified by the caller to
  117744. // add HTTP headers to the request.
  117745. func (c *RegionUrlMapsPatchCall) Header() http.Header {
  117746. if c.header_ == nil {
  117747. c.header_ = make(http.Header)
  117748. }
  117749. return c.header_
  117750. }
  117751. func (c *RegionUrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  117752. reqHeaders := make(http.Header)
  117753. for k, v := range c.header_ {
  117754. reqHeaders[k] = v
  117755. }
  117756. reqHeaders.Set("User-Agent", c.s.userAgent())
  117757. var body io.Reader = nil
  117758. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  117759. if err != nil {
  117760. return nil, err
  117761. }
  117762. reqHeaders.Set("Content-Type", "application/json")
  117763. c.urlParams_.Set("alt", alt)
  117764. c.urlParams_.Set("prettyPrint", "false")
  117765. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  117766. urls += "?" + c.urlParams_.Encode()
  117767. req, err := http.NewRequest("PATCH", urls, body)
  117768. if err != nil {
  117769. return nil, err
  117770. }
  117771. req.Header = reqHeaders
  117772. googleapi.Expand(req.URL, map[string]string{
  117773. "project": c.project,
  117774. "region": c.region,
  117775. "urlMap": c.urlMap,
  117776. })
  117777. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117778. }
  117779. // Do executes the "compute.regionUrlMaps.patch" call.
  117780. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117781. // status code is an error. Response headers are in either
  117782. // *Operation.ServerResponse.Header or (if a response was returned at
  117783. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117784. // to check whether the returned error was because
  117785. // http.StatusNotModified was returned.
  117786. func (c *RegionUrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117787. gensupport.SetOptions(c.urlParams_, opts...)
  117788. res, err := c.doRequest("json")
  117789. if res != nil && res.StatusCode == http.StatusNotModified {
  117790. if res.Body != nil {
  117791. res.Body.Close()
  117792. }
  117793. return nil, &googleapi.Error{
  117794. Code: res.StatusCode,
  117795. Header: res.Header,
  117796. }
  117797. }
  117798. if err != nil {
  117799. return nil, err
  117800. }
  117801. defer googleapi.CloseBody(res)
  117802. if err := googleapi.CheckResponse(res); err != nil {
  117803. return nil, err
  117804. }
  117805. ret := &Operation{
  117806. ServerResponse: googleapi.ServerResponse{
  117807. Header: res.Header,
  117808. HTTPStatusCode: res.StatusCode,
  117809. },
  117810. }
  117811. target := &ret
  117812. if err := gensupport.DecodeResponse(target, res); err != nil {
  117813. return nil, err
  117814. }
  117815. return ret, nil
  117816. // {
  117817. // "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.",
  117818. // "httpMethod": "PATCH",
  117819. // "id": "compute.regionUrlMaps.patch",
  117820. // "parameterOrder": [
  117821. // "project",
  117822. // "region",
  117823. // "urlMap"
  117824. // ],
  117825. // "parameters": {
  117826. // "project": {
  117827. // "description": "Project ID for this request.",
  117828. // "location": "path",
  117829. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117830. // "required": true,
  117831. // "type": "string"
  117832. // },
  117833. // "region": {
  117834. // "description": "Name of the region scoping this request.",
  117835. // "location": "path",
  117836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117837. // "required": true,
  117838. // "type": "string"
  117839. // },
  117840. // "requestId": {
  117841. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  117842. // "location": "query",
  117843. // "type": "string"
  117844. // },
  117845. // "urlMap": {
  117846. // "description": "Name of the UrlMap resource to patch.",
  117847. // "location": "path",
  117848. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  117849. // "required": true,
  117850. // "type": "string"
  117851. // }
  117852. // },
  117853. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  117854. // "request": {
  117855. // "$ref": "UrlMap"
  117856. // },
  117857. // "response": {
  117858. // "$ref": "Operation"
  117859. // },
  117860. // "scopes": [
  117861. // "https://www.googleapis.com/auth/cloud-platform",
  117862. // "https://www.googleapis.com/auth/compute"
  117863. // ]
  117864. // }
  117865. }
  117866. // method id "compute.regionUrlMaps.testIamPermissions":
  117867. type RegionUrlMapsTestIamPermissionsCall struct {
  117868. s *Service
  117869. project string
  117870. region string
  117871. resource string
  117872. testpermissionsrequest *TestPermissionsRequest
  117873. urlParams_ gensupport.URLParams
  117874. ctx_ context.Context
  117875. header_ http.Header
  117876. }
  117877. // TestIamPermissions: Returns permissions that a caller has on the
  117878. // specified resource.
  117879. func (r *RegionUrlMapsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionUrlMapsTestIamPermissionsCall {
  117880. c := &RegionUrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117881. c.project = project
  117882. c.region = region
  117883. c.resource = resource
  117884. c.testpermissionsrequest = testpermissionsrequest
  117885. return c
  117886. }
  117887. // Fields allows partial responses to be retrieved. See
  117888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117889. // for more information.
  117890. func (c *RegionUrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionUrlMapsTestIamPermissionsCall {
  117891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117892. return c
  117893. }
  117894. // Context sets the context to be used in this call's Do method. Any
  117895. // pending HTTP request will be aborted if the provided context is
  117896. // canceled.
  117897. func (c *RegionUrlMapsTestIamPermissionsCall) Context(ctx context.Context) *RegionUrlMapsTestIamPermissionsCall {
  117898. c.ctx_ = ctx
  117899. return c
  117900. }
  117901. // Header returns an http.Header that can be modified by the caller to
  117902. // add HTTP headers to the request.
  117903. func (c *RegionUrlMapsTestIamPermissionsCall) Header() http.Header {
  117904. if c.header_ == nil {
  117905. c.header_ = make(http.Header)
  117906. }
  117907. return c.header_
  117908. }
  117909. func (c *RegionUrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  117910. reqHeaders := make(http.Header)
  117911. for k, v := range c.header_ {
  117912. reqHeaders[k] = v
  117913. }
  117914. reqHeaders.Set("User-Agent", c.s.userAgent())
  117915. var body io.Reader = nil
  117916. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  117917. if err != nil {
  117918. return nil, err
  117919. }
  117920. reqHeaders.Set("Content-Type", "application/json")
  117921. c.urlParams_.Set("alt", alt)
  117922. c.urlParams_.Set("prettyPrint", "false")
  117923. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{resource}/testIamPermissions")
  117924. urls += "?" + c.urlParams_.Encode()
  117925. req, err := http.NewRequest("POST", urls, body)
  117926. if err != nil {
  117927. return nil, err
  117928. }
  117929. req.Header = reqHeaders
  117930. googleapi.Expand(req.URL, map[string]string{
  117931. "project": c.project,
  117932. "region": c.region,
  117933. "resource": c.resource,
  117934. })
  117935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117936. }
  117937. // Do executes the "compute.regionUrlMaps.testIamPermissions" call.
  117938. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  117939. // non-2xx status code is an error. Response headers are in either
  117940. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  117941. // returned at all) in error.(*googleapi.Error).Header. Use
  117942. // googleapi.IsNotModified to check whether the returned error was
  117943. // because http.StatusNotModified was returned.
  117944. func (c *RegionUrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  117945. gensupport.SetOptions(c.urlParams_, opts...)
  117946. res, err := c.doRequest("json")
  117947. if res != nil && res.StatusCode == http.StatusNotModified {
  117948. if res.Body != nil {
  117949. res.Body.Close()
  117950. }
  117951. return nil, &googleapi.Error{
  117952. Code: res.StatusCode,
  117953. Header: res.Header,
  117954. }
  117955. }
  117956. if err != nil {
  117957. return nil, err
  117958. }
  117959. defer googleapi.CloseBody(res)
  117960. if err := googleapi.CheckResponse(res); err != nil {
  117961. return nil, err
  117962. }
  117963. ret := &TestPermissionsResponse{
  117964. ServerResponse: googleapi.ServerResponse{
  117965. Header: res.Header,
  117966. HTTPStatusCode: res.StatusCode,
  117967. },
  117968. }
  117969. target := &ret
  117970. if err := gensupport.DecodeResponse(target, res); err != nil {
  117971. return nil, err
  117972. }
  117973. return ret, nil
  117974. // {
  117975. // "description": "Returns permissions that a caller has on the specified resource.",
  117976. // "httpMethod": "POST",
  117977. // "id": "compute.regionUrlMaps.testIamPermissions",
  117978. // "parameterOrder": [
  117979. // "project",
  117980. // "region",
  117981. // "resource"
  117982. // ],
  117983. // "parameters": {
  117984. // "project": {
  117985. // "description": "Project ID for this request.",
  117986. // "location": "path",
  117987. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117988. // "required": true,
  117989. // "type": "string"
  117990. // },
  117991. // "region": {
  117992. // "description": "The name of the region for this request.",
  117993. // "location": "path",
  117994. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117995. // "required": true,
  117996. // "type": "string"
  117997. // },
  117998. // "resource": {
  117999. // "description": "Name or id of the resource for this request.",
  118000. // "location": "path",
  118001. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118002. // "required": true,
  118003. // "type": "string"
  118004. // }
  118005. // },
  118006. // "path": "{project}/regions/{region}/urlMaps/{resource}/testIamPermissions",
  118007. // "request": {
  118008. // "$ref": "TestPermissionsRequest"
  118009. // },
  118010. // "response": {
  118011. // "$ref": "TestPermissionsResponse"
  118012. // },
  118013. // "scopes": [
  118014. // "https://www.googleapis.com/auth/cloud-platform",
  118015. // "https://www.googleapis.com/auth/compute",
  118016. // "https://www.googleapis.com/auth/compute.readonly"
  118017. // ]
  118018. // }
  118019. }
  118020. // method id "compute.regionUrlMaps.update":
  118021. type RegionUrlMapsUpdateCall struct {
  118022. s *Service
  118023. project string
  118024. region string
  118025. urlMap string
  118026. urlmap *UrlMap
  118027. urlParams_ gensupport.URLParams
  118028. ctx_ context.Context
  118029. header_ http.Header
  118030. }
  118031. // Update: Updates the specified UrlMap resource with the data included
  118032. // in the request.
  118033. func (r *RegionUrlMapsService) Update(project string, region string, urlMap string, urlmap *UrlMap) *RegionUrlMapsUpdateCall {
  118034. c := &RegionUrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118035. c.project = project
  118036. c.region = region
  118037. c.urlMap = urlMap
  118038. c.urlmap = urlmap
  118039. return c
  118040. }
  118041. // RequestId sets the optional parameter "requestId": begin_interface:
  118042. // MixerMutationRequestBuilder Request ID to support idempotency.
  118043. func (c *RegionUrlMapsUpdateCall) RequestId(requestId string) *RegionUrlMapsUpdateCall {
  118044. c.urlParams_.Set("requestId", requestId)
  118045. return c
  118046. }
  118047. // Fields allows partial responses to be retrieved. See
  118048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118049. // for more information.
  118050. func (c *RegionUrlMapsUpdateCall) Fields(s ...googleapi.Field) *RegionUrlMapsUpdateCall {
  118051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118052. return c
  118053. }
  118054. // Context sets the context to be used in this call's Do method. Any
  118055. // pending HTTP request will be aborted if the provided context is
  118056. // canceled.
  118057. func (c *RegionUrlMapsUpdateCall) Context(ctx context.Context) *RegionUrlMapsUpdateCall {
  118058. c.ctx_ = ctx
  118059. return c
  118060. }
  118061. // Header returns an http.Header that can be modified by the caller to
  118062. // add HTTP headers to the request.
  118063. func (c *RegionUrlMapsUpdateCall) Header() http.Header {
  118064. if c.header_ == nil {
  118065. c.header_ = make(http.Header)
  118066. }
  118067. return c.header_
  118068. }
  118069. func (c *RegionUrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  118070. reqHeaders := make(http.Header)
  118071. for k, v := range c.header_ {
  118072. reqHeaders[k] = v
  118073. }
  118074. reqHeaders.Set("User-Agent", c.s.userAgent())
  118075. var body io.Reader = nil
  118076. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  118077. if err != nil {
  118078. return nil, err
  118079. }
  118080. reqHeaders.Set("Content-Type", "application/json")
  118081. c.urlParams_.Set("alt", alt)
  118082. c.urlParams_.Set("prettyPrint", "false")
  118083. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  118084. urls += "?" + c.urlParams_.Encode()
  118085. req, err := http.NewRequest("PUT", urls, body)
  118086. if err != nil {
  118087. return nil, err
  118088. }
  118089. req.Header = reqHeaders
  118090. googleapi.Expand(req.URL, map[string]string{
  118091. "project": c.project,
  118092. "region": c.region,
  118093. "urlMap": c.urlMap,
  118094. })
  118095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118096. }
  118097. // Do executes the "compute.regionUrlMaps.update" call.
  118098. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  118099. // status code is an error. Response headers are in either
  118100. // *Operation.ServerResponse.Header or (if a response was returned at
  118101. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118102. // to check whether the returned error was because
  118103. // http.StatusNotModified was returned.
  118104. func (c *RegionUrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  118105. gensupport.SetOptions(c.urlParams_, opts...)
  118106. res, err := c.doRequest("json")
  118107. if res != nil && res.StatusCode == http.StatusNotModified {
  118108. if res.Body != nil {
  118109. res.Body.Close()
  118110. }
  118111. return nil, &googleapi.Error{
  118112. Code: res.StatusCode,
  118113. Header: res.Header,
  118114. }
  118115. }
  118116. if err != nil {
  118117. return nil, err
  118118. }
  118119. defer googleapi.CloseBody(res)
  118120. if err := googleapi.CheckResponse(res); err != nil {
  118121. return nil, err
  118122. }
  118123. ret := &Operation{
  118124. ServerResponse: googleapi.ServerResponse{
  118125. Header: res.Header,
  118126. HTTPStatusCode: res.StatusCode,
  118127. },
  118128. }
  118129. target := &ret
  118130. if err := gensupport.DecodeResponse(target, res); err != nil {
  118131. return nil, err
  118132. }
  118133. return ret, nil
  118134. // {
  118135. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  118136. // "httpMethod": "PUT",
  118137. // "id": "compute.regionUrlMaps.update",
  118138. // "parameterOrder": [
  118139. // "project",
  118140. // "region",
  118141. // "urlMap"
  118142. // ],
  118143. // "parameters": {
  118144. // "project": {
  118145. // "description": "Project ID for this request.",
  118146. // "location": "path",
  118147. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118148. // "required": true,
  118149. // "type": "string"
  118150. // },
  118151. // "region": {
  118152. // "description": "Name of the region scoping this request.",
  118153. // "location": "path",
  118154. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118155. // "required": true,
  118156. // "type": "string"
  118157. // },
  118158. // "requestId": {
  118159. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  118160. // "location": "query",
  118161. // "type": "string"
  118162. // },
  118163. // "urlMap": {
  118164. // "description": "Name of the UrlMap resource to update.",
  118165. // "location": "path",
  118166. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118167. // "required": true,
  118168. // "type": "string"
  118169. // }
  118170. // },
  118171. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  118172. // "request": {
  118173. // "$ref": "UrlMap"
  118174. // },
  118175. // "response": {
  118176. // "$ref": "Operation"
  118177. // },
  118178. // "scopes": [
  118179. // "https://www.googleapis.com/auth/cloud-platform",
  118180. // "https://www.googleapis.com/auth/compute"
  118181. // ]
  118182. // }
  118183. }
  118184. // method id "compute.regionUrlMaps.validate":
  118185. type RegionUrlMapsValidateCall struct {
  118186. s *Service
  118187. project string
  118188. region string
  118189. urlMap string
  118190. regionurlmapsvalidaterequest *RegionUrlMapsValidateRequest
  118191. urlParams_ gensupport.URLParams
  118192. ctx_ context.Context
  118193. header_ http.Header
  118194. }
  118195. // Validate: Runs static validation for the UrlMap. In particular, the
  118196. // tests of the provided UrlMap will be run. Calling this method does
  118197. // NOT create the UrlMap.
  118198. func (r *RegionUrlMapsService) Validate(project string, region string, urlMap string, regionurlmapsvalidaterequest *RegionUrlMapsValidateRequest) *RegionUrlMapsValidateCall {
  118199. c := &RegionUrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118200. c.project = project
  118201. c.region = region
  118202. c.urlMap = urlMap
  118203. c.regionurlmapsvalidaterequest = regionurlmapsvalidaterequest
  118204. return c
  118205. }
  118206. // Fields allows partial responses to be retrieved. See
  118207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118208. // for more information.
  118209. func (c *RegionUrlMapsValidateCall) Fields(s ...googleapi.Field) *RegionUrlMapsValidateCall {
  118210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118211. return c
  118212. }
  118213. // Context sets the context to be used in this call's Do method. Any
  118214. // pending HTTP request will be aborted if the provided context is
  118215. // canceled.
  118216. func (c *RegionUrlMapsValidateCall) Context(ctx context.Context) *RegionUrlMapsValidateCall {
  118217. c.ctx_ = ctx
  118218. return c
  118219. }
  118220. // Header returns an http.Header that can be modified by the caller to
  118221. // add HTTP headers to the request.
  118222. func (c *RegionUrlMapsValidateCall) Header() http.Header {
  118223. if c.header_ == nil {
  118224. c.header_ = make(http.Header)
  118225. }
  118226. return c.header_
  118227. }
  118228. func (c *RegionUrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  118229. reqHeaders := make(http.Header)
  118230. for k, v := range c.header_ {
  118231. reqHeaders[k] = v
  118232. }
  118233. reqHeaders.Set("User-Agent", c.s.userAgent())
  118234. var body io.Reader = nil
  118235. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionurlmapsvalidaterequest)
  118236. if err != nil {
  118237. return nil, err
  118238. }
  118239. reqHeaders.Set("Content-Type", "application/json")
  118240. c.urlParams_.Set("alt", alt)
  118241. c.urlParams_.Set("prettyPrint", "false")
  118242. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}/validate")
  118243. urls += "?" + c.urlParams_.Encode()
  118244. req, err := http.NewRequest("POST", urls, body)
  118245. if err != nil {
  118246. return nil, err
  118247. }
  118248. req.Header = reqHeaders
  118249. googleapi.Expand(req.URL, map[string]string{
  118250. "project": c.project,
  118251. "region": c.region,
  118252. "urlMap": c.urlMap,
  118253. })
  118254. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118255. }
  118256. // Do executes the "compute.regionUrlMaps.validate" call.
  118257. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  118258. // non-2xx status code is an error. Response headers are in either
  118259. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  118260. // returned at all) in error.(*googleapi.Error).Header. Use
  118261. // googleapi.IsNotModified to check whether the returned error was
  118262. // because http.StatusNotModified was returned.
  118263. func (c *RegionUrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  118264. gensupport.SetOptions(c.urlParams_, opts...)
  118265. res, err := c.doRequest("json")
  118266. if res != nil && res.StatusCode == http.StatusNotModified {
  118267. if res.Body != nil {
  118268. res.Body.Close()
  118269. }
  118270. return nil, &googleapi.Error{
  118271. Code: res.StatusCode,
  118272. Header: res.Header,
  118273. }
  118274. }
  118275. if err != nil {
  118276. return nil, err
  118277. }
  118278. defer googleapi.CloseBody(res)
  118279. if err := googleapi.CheckResponse(res); err != nil {
  118280. return nil, err
  118281. }
  118282. ret := &UrlMapsValidateResponse{
  118283. ServerResponse: googleapi.ServerResponse{
  118284. Header: res.Header,
  118285. HTTPStatusCode: res.StatusCode,
  118286. },
  118287. }
  118288. target := &ret
  118289. if err := gensupport.DecodeResponse(target, res); err != nil {
  118290. return nil, err
  118291. }
  118292. return ret, nil
  118293. // {
  118294. // "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.",
  118295. // "httpMethod": "POST",
  118296. // "id": "compute.regionUrlMaps.validate",
  118297. // "parameterOrder": [
  118298. // "project",
  118299. // "region",
  118300. // "urlMap"
  118301. // ],
  118302. // "parameters": {
  118303. // "project": {
  118304. // "description": "Project ID for this request.",
  118305. // "location": "path",
  118306. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118307. // "required": true,
  118308. // "type": "string"
  118309. // },
  118310. // "region": {
  118311. // "description": "Name of the region scoping this request.",
  118312. // "location": "path",
  118313. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118314. // "required": true,
  118315. // "type": "string"
  118316. // },
  118317. // "urlMap": {
  118318. // "description": "Name of the UrlMap resource to be validated as.",
  118319. // "location": "path",
  118320. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118321. // "required": true,
  118322. // "type": "string"
  118323. // }
  118324. // },
  118325. // "path": "{project}/regions/{region}/urlMaps/{urlMap}/validate",
  118326. // "request": {
  118327. // "$ref": "RegionUrlMapsValidateRequest"
  118328. // },
  118329. // "response": {
  118330. // "$ref": "UrlMapsValidateResponse"
  118331. // },
  118332. // "scopes": [
  118333. // "https://www.googleapis.com/auth/cloud-platform",
  118334. // "https://www.googleapis.com/auth/compute"
  118335. // ]
  118336. // }
  118337. }
  118338. // method id "compute.regions.get":
  118339. type RegionsGetCall struct {
  118340. s *Service
  118341. project string
  118342. region string
  118343. urlParams_ gensupport.URLParams
  118344. ifNoneMatch_ string
  118345. ctx_ context.Context
  118346. header_ http.Header
  118347. }
  118348. // Get: Returns the specified Region resource. Gets a list of available
  118349. // regions by making a list() request.
  118350. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  118351. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  118352. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118353. c.project = project
  118354. c.region = region
  118355. return c
  118356. }
  118357. // Fields allows partial responses to be retrieved. See
  118358. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118359. // for more information.
  118360. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  118361. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118362. return c
  118363. }
  118364. // IfNoneMatch sets the optional parameter which makes the operation
  118365. // fail if the object's ETag matches the given value. This is useful for
  118366. // getting updates only after the object has changed since the last
  118367. // request. Use googleapi.IsNotModified to check whether the response
  118368. // error from Do is the result of In-None-Match.
  118369. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  118370. c.ifNoneMatch_ = entityTag
  118371. return c
  118372. }
  118373. // Context sets the context to be used in this call's Do method. Any
  118374. // pending HTTP request will be aborted if the provided context is
  118375. // canceled.
  118376. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  118377. c.ctx_ = ctx
  118378. return c
  118379. }
  118380. // Header returns an http.Header that can be modified by the caller to
  118381. // add HTTP headers to the request.
  118382. func (c *RegionsGetCall) Header() http.Header {
  118383. if c.header_ == nil {
  118384. c.header_ = make(http.Header)
  118385. }
  118386. return c.header_
  118387. }
  118388. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  118389. reqHeaders := make(http.Header)
  118390. for k, v := range c.header_ {
  118391. reqHeaders[k] = v
  118392. }
  118393. reqHeaders.Set("User-Agent", c.s.userAgent())
  118394. if c.ifNoneMatch_ != "" {
  118395. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118396. }
  118397. var body io.Reader = nil
  118398. c.urlParams_.Set("alt", alt)
  118399. c.urlParams_.Set("prettyPrint", "false")
  118400. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  118401. urls += "?" + c.urlParams_.Encode()
  118402. req, err := http.NewRequest("GET", urls, body)
  118403. if err != nil {
  118404. return nil, err
  118405. }
  118406. req.Header = reqHeaders
  118407. googleapi.Expand(req.URL, map[string]string{
  118408. "project": c.project,
  118409. "region": c.region,
  118410. })
  118411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118412. }
  118413. // Do executes the "compute.regions.get" call.
  118414. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  118415. // code is an error. Response headers are in either
  118416. // *Region.ServerResponse.Header or (if a response was returned at all)
  118417. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  118418. // check whether the returned error was because http.StatusNotModified
  118419. // was returned.
  118420. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  118421. gensupport.SetOptions(c.urlParams_, opts...)
  118422. res, err := c.doRequest("json")
  118423. if res != nil && res.StatusCode == http.StatusNotModified {
  118424. if res.Body != nil {
  118425. res.Body.Close()
  118426. }
  118427. return nil, &googleapi.Error{
  118428. Code: res.StatusCode,
  118429. Header: res.Header,
  118430. }
  118431. }
  118432. if err != nil {
  118433. return nil, err
  118434. }
  118435. defer googleapi.CloseBody(res)
  118436. if err := googleapi.CheckResponse(res); err != nil {
  118437. return nil, err
  118438. }
  118439. ret := &Region{
  118440. ServerResponse: googleapi.ServerResponse{
  118441. Header: res.Header,
  118442. HTTPStatusCode: res.StatusCode,
  118443. },
  118444. }
  118445. target := &ret
  118446. if err := gensupport.DecodeResponse(target, res); err != nil {
  118447. return nil, err
  118448. }
  118449. return ret, nil
  118450. // {
  118451. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  118452. // "httpMethod": "GET",
  118453. // "id": "compute.regions.get",
  118454. // "parameterOrder": [
  118455. // "project",
  118456. // "region"
  118457. // ],
  118458. // "parameters": {
  118459. // "project": {
  118460. // "description": "Project ID for this request.",
  118461. // "location": "path",
  118462. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118463. // "required": true,
  118464. // "type": "string"
  118465. // },
  118466. // "region": {
  118467. // "description": "Name of the region resource to return.",
  118468. // "location": "path",
  118469. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118470. // "required": true,
  118471. // "type": "string"
  118472. // }
  118473. // },
  118474. // "path": "{project}/regions/{region}",
  118475. // "response": {
  118476. // "$ref": "Region"
  118477. // },
  118478. // "scopes": [
  118479. // "https://www.googleapis.com/auth/cloud-platform",
  118480. // "https://www.googleapis.com/auth/compute",
  118481. // "https://www.googleapis.com/auth/compute.readonly"
  118482. // ]
  118483. // }
  118484. }
  118485. // method id "compute.regions.list":
  118486. type RegionsListCall struct {
  118487. s *Service
  118488. project string
  118489. urlParams_ gensupport.URLParams
  118490. ifNoneMatch_ string
  118491. ctx_ context.Context
  118492. header_ http.Header
  118493. }
  118494. // List: Retrieves the list of region resources available to the
  118495. // specified project.
  118496. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  118497. func (r *RegionsService) List(project string) *RegionsListCall {
  118498. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118499. c.project = project
  118500. return c
  118501. }
  118502. // Filter sets the optional parameter "filter": A filter expression that
  118503. // filters resources listed in the response. The expression must specify
  118504. // the field name, a comparison operator, and the value that you want to
  118505. // use for filtering. The value must be a string, a number, or a
  118506. // boolean. The comparison operator must be either =, !=, >, or <.
  118507. //
  118508. // For example, if you are filtering Compute Engine instances, you can
  118509. // exclude instances named example-instance by specifying name !=
  118510. // example-instance.
  118511. //
  118512. // You can also filter nested fields. For example, you could specify
  118513. // scheduling.automaticRestart = false to include instances only if they
  118514. // are not scheduled for automatic restarts. You can use filtering on
  118515. // nested fields to filter based on resource labels.
  118516. //
  118517. // To filter on multiple expressions, provide each separate expression
  118518. // within parentheses. For example, (scheduling.automaticRestart = true)
  118519. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  118520. // AND expression. However, you can include AND and OR expressions
  118521. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  118522. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  118523. // true).
  118524. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  118525. c.urlParams_.Set("filter", filter)
  118526. return c
  118527. }
  118528. // MaxResults sets the optional parameter "maxResults": The maximum
  118529. // number of results per page that should be returned. If the number of
  118530. // available results is larger than maxResults, Compute Engine returns a
  118531. // nextPageToken that can be used to get the next page of results in
  118532. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  118533. // (Default: 500)
  118534. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  118535. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  118536. return c
  118537. }
  118538. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  118539. // a certain order. By default, results are returned in alphanumerical
  118540. // order based on the resource name.
  118541. //
  118542. // You can also sort results in descending order based on the creation
  118543. // timestamp using orderBy="creationTimestamp desc". This sorts results
  118544. // based on the creationTimestamp field in reverse chronological order
  118545. // (newest result first). Use this to sort resources like operations so
  118546. // that the newest operation is returned first.
  118547. //
  118548. // Currently, only sorting by name or creationTimestamp desc is
  118549. // supported.
  118550. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  118551. c.urlParams_.Set("orderBy", orderBy)
  118552. return c
  118553. }
  118554. // PageToken sets the optional parameter "pageToken": Specifies a page
  118555. // token to use. Set pageToken to the nextPageToken returned by a
  118556. // previous list request to get the next page of results.
  118557. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  118558. c.urlParams_.Set("pageToken", pageToken)
  118559. return c
  118560. }
  118561. // Fields allows partial responses to be retrieved. See
  118562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118563. // for more information.
  118564. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  118565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118566. return c
  118567. }
  118568. // IfNoneMatch sets the optional parameter which makes the operation
  118569. // fail if the object's ETag matches the given value. This is useful for
  118570. // getting updates only after the object has changed since the last
  118571. // request. Use googleapi.IsNotModified to check whether the response
  118572. // error from Do is the result of In-None-Match.
  118573. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  118574. c.ifNoneMatch_ = entityTag
  118575. return c
  118576. }
  118577. // Context sets the context to be used in this call's Do method. Any
  118578. // pending HTTP request will be aborted if the provided context is
  118579. // canceled.
  118580. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  118581. c.ctx_ = ctx
  118582. return c
  118583. }
  118584. // Header returns an http.Header that can be modified by the caller to
  118585. // add HTTP headers to the request.
  118586. func (c *RegionsListCall) Header() http.Header {
  118587. if c.header_ == nil {
  118588. c.header_ = make(http.Header)
  118589. }
  118590. return c.header_
  118591. }
  118592. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  118593. reqHeaders := make(http.Header)
  118594. for k, v := range c.header_ {
  118595. reqHeaders[k] = v
  118596. }
  118597. reqHeaders.Set("User-Agent", c.s.userAgent())
  118598. if c.ifNoneMatch_ != "" {
  118599. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118600. }
  118601. var body io.Reader = nil
  118602. c.urlParams_.Set("alt", alt)
  118603. c.urlParams_.Set("prettyPrint", "false")
  118604. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  118605. urls += "?" + c.urlParams_.Encode()
  118606. req, err := http.NewRequest("GET", urls, body)
  118607. if err != nil {
  118608. return nil, err
  118609. }
  118610. req.Header = reqHeaders
  118611. googleapi.Expand(req.URL, map[string]string{
  118612. "project": c.project,
  118613. })
  118614. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118615. }
  118616. // Do executes the "compute.regions.list" call.
  118617. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  118618. // status code is an error. Response headers are in either
  118619. // *RegionList.ServerResponse.Header or (if a response was returned at
  118620. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118621. // to check whether the returned error was because
  118622. // http.StatusNotModified was returned.
  118623. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  118624. gensupport.SetOptions(c.urlParams_, opts...)
  118625. res, err := c.doRequest("json")
  118626. if res != nil && res.StatusCode == http.StatusNotModified {
  118627. if res.Body != nil {
  118628. res.Body.Close()
  118629. }
  118630. return nil, &googleapi.Error{
  118631. Code: res.StatusCode,
  118632. Header: res.Header,
  118633. }
  118634. }
  118635. if err != nil {
  118636. return nil, err
  118637. }
  118638. defer googleapi.CloseBody(res)
  118639. if err := googleapi.CheckResponse(res); err != nil {
  118640. return nil, err
  118641. }
  118642. ret := &RegionList{
  118643. ServerResponse: googleapi.ServerResponse{
  118644. Header: res.Header,
  118645. HTTPStatusCode: res.StatusCode,
  118646. },
  118647. }
  118648. target := &ret
  118649. if err := gensupport.DecodeResponse(target, res); err != nil {
  118650. return nil, err
  118651. }
  118652. return ret, nil
  118653. // {
  118654. // "description": "Retrieves the list of region resources available to the specified project.",
  118655. // "httpMethod": "GET",
  118656. // "id": "compute.regions.list",
  118657. // "parameterOrder": [
  118658. // "project"
  118659. // ],
  118660. // "parameters": {
  118661. // "filter": {
  118662. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  118663. // "location": "query",
  118664. // "type": "string"
  118665. // },
  118666. // "maxResults": {
  118667. // "default": "500",
  118668. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  118669. // "format": "uint32",
  118670. // "location": "query",
  118671. // "minimum": "0",
  118672. // "type": "integer"
  118673. // },
  118674. // "orderBy": {
  118675. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  118676. // "location": "query",
  118677. // "type": "string"
  118678. // },
  118679. // "pageToken": {
  118680. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  118681. // "location": "query",
  118682. // "type": "string"
  118683. // },
  118684. // "project": {
  118685. // "description": "Project ID for this request.",
  118686. // "location": "path",
  118687. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118688. // "required": true,
  118689. // "type": "string"
  118690. // }
  118691. // },
  118692. // "path": "{project}/regions",
  118693. // "response": {
  118694. // "$ref": "RegionList"
  118695. // },
  118696. // "scopes": [
  118697. // "https://www.googleapis.com/auth/cloud-platform",
  118698. // "https://www.googleapis.com/auth/compute",
  118699. // "https://www.googleapis.com/auth/compute.readonly"
  118700. // ]
  118701. // }
  118702. }
  118703. // Pages invokes f for each page of results.
  118704. // A non-nil error returned from f will halt the iteration.
  118705. // The provided context supersedes any context provided to the Context method.
  118706. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  118707. c.ctx_ = ctx
  118708. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  118709. for {
  118710. x, err := c.Do()
  118711. if err != nil {
  118712. return err
  118713. }
  118714. if err := f(x); err != nil {
  118715. return err
  118716. }
  118717. if x.NextPageToken == "" {
  118718. return nil
  118719. }
  118720. c.PageToken(x.NextPageToken)
  118721. }
  118722. }
  118723. // method id "compute.reservations.aggregatedList":
  118724. type ReservationsAggregatedListCall struct {
  118725. s *Service
  118726. project string
  118727. urlParams_ gensupport.URLParams
  118728. ifNoneMatch_ string
  118729. ctx_ context.Context
  118730. header_ http.Header
  118731. }
  118732. // AggregatedList: Retrieves an aggregated list of reservations.
  118733. func (r *ReservationsService) AggregatedList(project string) *ReservationsAggregatedListCall {
  118734. c := &ReservationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118735. c.project = project
  118736. return c
  118737. }
  118738. // Filter sets the optional parameter "filter": A filter expression that
  118739. // filters resources listed in the response. The expression must specify
  118740. // the field name, a comparison operator, and the value that you want to
  118741. // use for filtering. The value must be a string, a number, or a
  118742. // boolean. The comparison operator must be either =, !=, >, or <.
  118743. //
  118744. // For example, if you are filtering Compute Engine instances, you can
  118745. // exclude instances named example-instance by specifying name !=
  118746. // example-instance.
  118747. //
  118748. // You can also filter nested fields. For example, you could specify
  118749. // scheduling.automaticRestart = false to include instances only if they
  118750. // are not scheduled for automatic restarts. You can use filtering on
  118751. // nested fields to filter based on resource labels.
  118752. //
  118753. // To filter on multiple expressions, provide each separate expression
  118754. // within parentheses. For example, (scheduling.automaticRestart = true)
  118755. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  118756. // AND expression. However, you can include AND and OR expressions
  118757. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  118758. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  118759. // true).
  118760. func (c *ReservationsAggregatedListCall) Filter(filter string) *ReservationsAggregatedListCall {
  118761. c.urlParams_.Set("filter", filter)
  118762. return c
  118763. }
  118764. // MaxResults sets the optional parameter "maxResults": The maximum
  118765. // number of results per page that should be returned. If the number of
  118766. // available results is larger than maxResults, Compute Engine returns a
  118767. // nextPageToken that can be used to get the next page of results in
  118768. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  118769. // (Default: 500)
  118770. func (c *ReservationsAggregatedListCall) MaxResults(maxResults int64) *ReservationsAggregatedListCall {
  118771. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  118772. return c
  118773. }
  118774. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  118775. // a certain order. By default, results are returned in alphanumerical
  118776. // order based on the resource name.
  118777. //
  118778. // You can also sort results in descending order based on the creation
  118779. // timestamp using orderBy="creationTimestamp desc". This sorts results
  118780. // based on the creationTimestamp field in reverse chronological order
  118781. // (newest result first). Use this to sort resources like operations so
  118782. // that the newest operation is returned first.
  118783. //
  118784. // Currently, only sorting by name or creationTimestamp desc is
  118785. // supported.
  118786. func (c *ReservationsAggregatedListCall) OrderBy(orderBy string) *ReservationsAggregatedListCall {
  118787. c.urlParams_.Set("orderBy", orderBy)
  118788. return c
  118789. }
  118790. // PageToken sets the optional parameter "pageToken": Specifies a page
  118791. // token to use. Set pageToken to the nextPageToken returned by a
  118792. // previous list request to get the next page of results.
  118793. func (c *ReservationsAggregatedListCall) PageToken(pageToken string) *ReservationsAggregatedListCall {
  118794. c.urlParams_.Set("pageToken", pageToken)
  118795. return c
  118796. }
  118797. // Fields allows partial responses to be retrieved. See
  118798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118799. // for more information.
  118800. func (c *ReservationsAggregatedListCall) Fields(s ...googleapi.Field) *ReservationsAggregatedListCall {
  118801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118802. return c
  118803. }
  118804. // IfNoneMatch sets the optional parameter which makes the operation
  118805. // fail if the object's ETag matches the given value. This is useful for
  118806. // getting updates only after the object has changed since the last
  118807. // request. Use googleapi.IsNotModified to check whether the response
  118808. // error from Do is the result of In-None-Match.
  118809. func (c *ReservationsAggregatedListCall) IfNoneMatch(entityTag string) *ReservationsAggregatedListCall {
  118810. c.ifNoneMatch_ = entityTag
  118811. return c
  118812. }
  118813. // Context sets the context to be used in this call's Do method. Any
  118814. // pending HTTP request will be aborted if the provided context is
  118815. // canceled.
  118816. func (c *ReservationsAggregatedListCall) Context(ctx context.Context) *ReservationsAggregatedListCall {
  118817. c.ctx_ = ctx
  118818. return c
  118819. }
  118820. // Header returns an http.Header that can be modified by the caller to
  118821. // add HTTP headers to the request.
  118822. func (c *ReservationsAggregatedListCall) Header() http.Header {
  118823. if c.header_ == nil {
  118824. c.header_ = make(http.Header)
  118825. }
  118826. return c.header_
  118827. }
  118828. func (c *ReservationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  118829. reqHeaders := make(http.Header)
  118830. for k, v := range c.header_ {
  118831. reqHeaders[k] = v
  118832. }
  118833. reqHeaders.Set("User-Agent", c.s.userAgent())
  118834. if c.ifNoneMatch_ != "" {
  118835. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118836. }
  118837. var body io.Reader = nil
  118838. c.urlParams_.Set("alt", alt)
  118839. c.urlParams_.Set("prettyPrint", "false")
  118840. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/reservations")
  118841. urls += "?" + c.urlParams_.Encode()
  118842. req, err := http.NewRequest("GET", urls, body)
  118843. if err != nil {
  118844. return nil, err
  118845. }
  118846. req.Header = reqHeaders
  118847. googleapi.Expand(req.URL, map[string]string{
  118848. "project": c.project,
  118849. })
  118850. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118851. }
  118852. // Do executes the "compute.reservations.aggregatedList" call.
  118853. // Exactly one of *ReservationAggregatedList or error will be non-nil.
  118854. // Any non-2xx status code is an error. Response headers are in either
  118855. // *ReservationAggregatedList.ServerResponse.Header or (if a response
  118856. // was returned at all) in error.(*googleapi.Error).Header. Use
  118857. // googleapi.IsNotModified to check whether the returned error was
  118858. // because http.StatusNotModified was returned.
  118859. func (c *ReservationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*ReservationAggregatedList, error) {
  118860. gensupport.SetOptions(c.urlParams_, opts...)
  118861. res, err := c.doRequest("json")
  118862. if res != nil && res.StatusCode == http.StatusNotModified {
  118863. if res.Body != nil {
  118864. res.Body.Close()
  118865. }
  118866. return nil, &googleapi.Error{
  118867. Code: res.StatusCode,
  118868. Header: res.Header,
  118869. }
  118870. }
  118871. if err != nil {
  118872. return nil, err
  118873. }
  118874. defer googleapi.CloseBody(res)
  118875. if err := googleapi.CheckResponse(res); err != nil {
  118876. return nil, err
  118877. }
  118878. ret := &ReservationAggregatedList{
  118879. ServerResponse: googleapi.ServerResponse{
  118880. Header: res.Header,
  118881. HTTPStatusCode: res.StatusCode,
  118882. },
  118883. }
  118884. target := &ret
  118885. if err := gensupport.DecodeResponse(target, res); err != nil {
  118886. return nil, err
  118887. }
  118888. return ret, nil
  118889. // {
  118890. // "description": "Retrieves an aggregated list of reservations.",
  118891. // "httpMethod": "GET",
  118892. // "id": "compute.reservations.aggregatedList",
  118893. // "parameterOrder": [
  118894. // "project"
  118895. // ],
  118896. // "parameters": {
  118897. // "filter": {
  118898. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  118899. // "location": "query",
  118900. // "type": "string"
  118901. // },
  118902. // "maxResults": {
  118903. // "default": "500",
  118904. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  118905. // "format": "uint32",
  118906. // "location": "query",
  118907. // "minimum": "0",
  118908. // "type": "integer"
  118909. // },
  118910. // "orderBy": {
  118911. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  118912. // "location": "query",
  118913. // "type": "string"
  118914. // },
  118915. // "pageToken": {
  118916. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  118917. // "location": "query",
  118918. // "type": "string"
  118919. // },
  118920. // "project": {
  118921. // "description": "Project ID for this request.",
  118922. // "location": "path",
  118923. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118924. // "required": true,
  118925. // "type": "string"
  118926. // }
  118927. // },
  118928. // "path": "{project}/aggregated/reservations",
  118929. // "response": {
  118930. // "$ref": "ReservationAggregatedList"
  118931. // },
  118932. // "scopes": [
  118933. // "https://www.googleapis.com/auth/cloud-platform",
  118934. // "https://www.googleapis.com/auth/compute",
  118935. // "https://www.googleapis.com/auth/compute.readonly"
  118936. // ]
  118937. // }
  118938. }
  118939. // Pages invokes f for each page of results.
  118940. // A non-nil error returned from f will halt the iteration.
  118941. // The provided context supersedes any context provided to the Context method.
  118942. func (c *ReservationsAggregatedListCall) Pages(ctx context.Context, f func(*ReservationAggregatedList) error) error {
  118943. c.ctx_ = ctx
  118944. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  118945. for {
  118946. x, err := c.Do()
  118947. if err != nil {
  118948. return err
  118949. }
  118950. if err := f(x); err != nil {
  118951. return err
  118952. }
  118953. if x.NextPageToken == "" {
  118954. return nil
  118955. }
  118956. c.PageToken(x.NextPageToken)
  118957. }
  118958. }
  118959. // method id "compute.reservations.delete":
  118960. type ReservationsDeleteCall struct {
  118961. s *Service
  118962. project string
  118963. zone string
  118964. reservation string
  118965. urlParams_ gensupport.URLParams
  118966. ctx_ context.Context
  118967. header_ http.Header
  118968. }
  118969. // Delete: Deletes the specified reservation.
  118970. func (r *ReservationsService) Delete(project string, zone string, reservation string) *ReservationsDeleteCall {
  118971. c := &ReservationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118972. c.project = project
  118973. c.zone = zone
  118974. c.reservation = reservation
  118975. return c
  118976. }
  118977. // RequestId sets the optional parameter "requestId": An optional
  118978. // request ID to identify requests. Specify a unique request ID so that
  118979. // if you must retry your request, the server will know to ignore the
  118980. // request if it has already been completed.
  118981. //
  118982. // For example, consider a situation where you make an initial request
  118983. // and the request times out. If you make the request again with the
  118984. // same request ID, the server can check if original operation with the
  118985. // same request ID was received, and if so, will ignore the second
  118986. // request. This prevents clients from accidentally creating duplicate
  118987. // commitments.
  118988. //
  118989. // The request ID must be a valid UUID with the exception that zero UUID
  118990. // is not supported (00000000-0000-0000-0000-000000000000).
  118991. func (c *ReservationsDeleteCall) RequestId(requestId string) *ReservationsDeleteCall {
  118992. c.urlParams_.Set("requestId", requestId)
  118993. return c
  118994. }
  118995. // Fields allows partial responses to be retrieved. See
  118996. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118997. // for more information.
  118998. func (c *ReservationsDeleteCall) Fields(s ...googleapi.Field) *ReservationsDeleteCall {
  118999. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119000. return c
  119001. }
  119002. // Context sets the context to be used in this call's Do method. Any
  119003. // pending HTTP request will be aborted if the provided context is
  119004. // canceled.
  119005. func (c *ReservationsDeleteCall) Context(ctx context.Context) *ReservationsDeleteCall {
  119006. c.ctx_ = ctx
  119007. return c
  119008. }
  119009. // Header returns an http.Header that can be modified by the caller to
  119010. // add HTTP headers to the request.
  119011. func (c *ReservationsDeleteCall) Header() http.Header {
  119012. if c.header_ == nil {
  119013. c.header_ = make(http.Header)
  119014. }
  119015. return c.header_
  119016. }
  119017. func (c *ReservationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  119018. reqHeaders := make(http.Header)
  119019. for k, v := range c.header_ {
  119020. reqHeaders[k] = v
  119021. }
  119022. reqHeaders.Set("User-Agent", c.s.userAgent())
  119023. var body io.Reader = nil
  119024. c.urlParams_.Set("alt", alt)
  119025. c.urlParams_.Set("prettyPrint", "false")
  119026. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/reservations/{reservation}")
  119027. urls += "?" + c.urlParams_.Encode()
  119028. req, err := http.NewRequest("DELETE", urls, body)
  119029. if err != nil {
  119030. return nil, err
  119031. }
  119032. req.Header = reqHeaders
  119033. googleapi.Expand(req.URL, map[string]string{
  119034. "project": c.project,
  119035. "zone": c.zone,
  119036. "reservation": c.reservation,
  119037. })
  119038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119039. }
  119040. // Do executes the "compute.reservations.delete" call.
  119041. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119042. // status code is an error. Response headers are in either
  119043. // *Operation.ServerResponse.Header or (if a response was returned at
  119044. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119045. // to check whether the returned error was because
  119046. // http.StatusNotModified was returned.
  119047. func (c *ReservationsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119048. gensupport.SetOptions(c.urlParams_, opts...)
  119049. res, err := c.doRequest("json")
  119050. if res != nil && res.StatusCode == http.StatusNotModified {
  119051. if res.Body != nil {
  119052. res.Body.Close()
  119053. }
  119054. return nil, &googleapi.Error{
  119055. Code: res.StatusCode,
  119056. Header: res.Header,
  119057. }
  119058. }
  119059. if err != nil {
  119060. return nil, err
  119061. }
  119062. defer googleapi.CloseBody(res)
  119063. if err := googleapi.CheckResponse(res); err != nil {
  119064. return nil, err
  119065. }
  119066. ret := &Operation{
  119067. ServerResponse: googleapi.ServerResponse{
  119068. Header: res.Header,
  119069. HTTPStatusCode: res.StatusCode,
  119070. },
  119071. }
  119072. target := &ret
  119073. if err := gensupport.DecodeResponse(target, res); err != nil {
  119074. return nil, err
  119075. }
  119076. return ret, nil
  119077. // {
  119078. // "description": "Deletes the specified reservation.",
  119079. // "httpMethod": "DELETE",
  119080. // "id": "compute.reservations.delete",
  119081. // "parameterOrder": [
  119082. // "project",
  119083. // "zone",
  119084. // "reservation"
  119085. // ],
  119086. // "parameters": {
  119087. // "project": {
  119088. // "description": "Project ID for this request.",
  119089. // "location": "path",
  119090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119091. // "required": true,
  119092. // "type": "string"
  119093. // },
  119094. // "requestId": {
  119095. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  119096. // "location": "query",
  119097. // "type": "string"
  119098. // },
  119099. // "reservation": {
  119100. // "description": "Name of the reservation to delete.",
  119101. // "location": "path",
  119102. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  119103. // "required": true,
  119104. // "type": "string"
  119105. // },
  119106. // "zone": {
  119107. // "description": "Name of the zone for this request.",
  119108. // "location": "path",
  119109. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119110. // "required": true,
  119111. // "type": "string"
  119112. // }
  119113. // },
  119114. // "path": "{project}/zones/{zone}/reservations/{reservation}",
  119115. // "response": {
  119116. // "$ref": "Operation"
  119117. // },
  119118. // "scopes": [
  119119. // "https://www.googleapis.com/auth/cloud-platform",
  119120. // "https://www.googleapis.com/auth/compute"
  119121. // ]
  119122. // }
  119123. }
  119124. // method id "compute.reservations.get":
  119125. type ReservationsGetCall struct {
  119126. s *Service
  119127. project string
  119128. zone string
  119129. reservation string
  119130. urlParams_ gensupport.URLParams
  119131. ifNoneMatch_ string
  119132. ctx_ context.Context
  119133. header_ http.Header
  119134. }
  119135. // Get: Retrieves all information of the specified reservation.
  119136. func (r *ReservationsService) Get(project string, zone string, reservation string) *ReservationsGetCall {
  119137. c := &ReservationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119138. c.project = project
  119139. c.zone = zone
  119140. c.reservation = reservation
  119141. return c
  119142. }
  119143. // Fields allows partial responses to be retrieved. See
  119144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119145. // for more information.
  119146. func (c *ReservationsGetCall) Fields(s ...googleapi.Field) *ReservationsGetCall {
  119147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119148. return c
  119149. }
  119150. // IfNoneMatch sets the optional parameter which makes the operation
  119151. // fail if the object's ETag matches the given value. This is useful for
  119152. // getting updates only after the object has changed since the last
  119153. // request. Use googleapi.IsNotModified to check whether the response
  119154. // error from Do is the result of In-None-Match.
  119155. func (c *ReservationsGetCall) IfNoneMatch(entityTag string) *ReservationsGetCall {
  119156. c.ifNoneMatch_ = entityTag
  119157. return c
  119158. }
  119159. // Context sets the context to be used in this call's Do method. Any
  119160. // pending HTTP request will be aborted if the provided context is
  119161. // canceled.
  119162. func (c *ReservationsGetCall) Context(ctx context.Context) *ReservationsGetCall {
  119163. c.ctx_ = ctx
  119164. return c
  119165. }
  119166. // Header returns an http.Header that can be modified by the caller to
  119167. // add HTTP headers to the request.
  119168. func (c *ReservationsGetCall) Header() http.Header {
  119169. if c.header_ == nil {
  119170. c.header_ = make(http.Header)
  119171. }
  119172. return c.header_
  119173. }
  119174. func (c *ReservationsGetCall) doRequest(alt string) (*http.Response, error) {
  119175. reqHeaders := make(http.Header)
  119176. for k, v := range c.header_ {
  119177. reqHeaders[k] = v
  119178. }
  119179. reqHeaders.Set("User-Agent", c.s.userAgent())
  119180. if c.ifNoneMatch_ != "" {
  119181. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119182. }
  119183. var body io.Reader = nil
  119184. c.urlParams_.Set("alt", alt)
  119185. c.urlParams_.Set("prettyPrint", "false")
  119186. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/reservations/{reservation}")
  119187. urls += "?" + c.urlParams_.Encode()
  119188. req, err := http.NewRequest("GET", urls, body)
  119189. if err != nil {
  119190. return nil, err
  119191. }
  119192. req.Header = reqHeaders
  119193. googleapi.Expand(req.URL, map[string]string{
  119194. "project": c.project,
  119195. "zone": c.zone,
  119196. "reservation": c.reservation,
  119197. })
  119198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119199. }
  119200. // Do executes the "compute.reservations.get" call.
  119201. // Exactly one of *Reservation or error will be non-nil. Any non-2xx
  119202. // status code is an error. Response headers are in either
  119203. // *Reservation.ServerResponse.Header or (if a response was returned at
  119204. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119205. // to check whether the returned error was because
  119206. // http.StatusNotModified was returned.
  119207. func (c *ReservationsGetCall) Do(opts ...googleapi.CallOption) (*Reservation, error) {
  119208. gensupport.SetOptions(c.urlParams_, opts...)
  119209. res, err := c.doRequest("json")
  119210. if res != nil && res.StatusCode == http.StatusNotModified {
  119211. if res.Body != nil {
  119212. res.Body.Close()
  119213. }
  119214. return nil, &googleapi.Error{
  119215. Code: res.StatusCode,
  119216. Header: res.Header,
  119217. }
  119218. }
  119219. if err != nil {
  119220. return nil, err
  119221. }
  119222. defer googleapi.CloseBody(res)
  119223. if err := googleapi.CheckResponse(res); err != nil {
  119224. return nil, err
  119225. }
  119226. ret := &Reservation{
  119227. ServerResponse: googleapi.ServerResponse{
  119228. Header: res.Header,
  119229. HTTPStatusCode: res.StatusCode,
  119230. },
  119231. }
  119232. target := &ret
  119233. if err := gensupport.DecodeResponse(target, res); err != nil {
  119234. return nil, err
  119235. }
  119236. return ret, nil
  119237. // {
  119238. // "description": "Retrieves all information of the specified reservation.",
  119239. // "httpMethod": "GET",
  119240. // "id": "compute.reservations.get",
  119241. // "parameterOrder": [
  119242. // "project",
  119243. // "zone",
  119244. // "reservation"
  119245. // ],
  119246. // "parameters": {
  119247. // "project": {
  119248. // "description": "Project ID for this request.",
  119249. // "location": "path",
  119250. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119251. // "required": true,
  119252. // "type": "string"
  119253. // },
  119254. // "reservation": {
  119255. // "description": "Name of the reservation to retrieve.",
  119256. // "location": "path",
  119257. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  119258. // "required": true,
  119259. // "type": "string"
  119260. // },
  119261. // "zone": {
  119262. // "description": "Name of the zone for this request.",
  119263. // "location": "path",
  119264. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119265. // "required": true,
  119266. // "type": "string"
  119267. // }
  119268. // },
  119269. // "path": "{project}/zones/{zone}/reservations/{reservation}",
  119270. // "response": {
  119271. // "$ref": "Reservation"
  119272. // },
  119273. // "scopes": [
  119274. // "https://www.googleapis.com/auth/cloud-platform",
  119275. // "https://www.googleapis.com/auth/compute",
  119276. // "https://www.googleapis.com/auth/compute.readonly"
  119277. // ]
  119278. // }
  119279. }
  119280. // method id "compute.reservations.getIamPolicy":
  119281. type ReservationsGetIamPolicyCall struct {
  119282. s *Service
  119283. project string
  119284. zone string
  119285. resource string
  119286. urlParams_ gensupport.URLParams
  119287. ifNoneMatch_ string
  119288. ctx_ context.Context
  119289. header_ http.Header
  119290. }
  119291. // GetIamPolicy: Gets the access control policy for a resource. May be
  119292. // empty if no such policy or resource exists.
  119293. func (r *ReservationsService) GetIamPolicy(project string, zone string, resource string) *ReservationsGetIamPolicyCall {
  119294. c := &ReservationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119295. c.project = project
  119296. c.zone = zone
  119297. c.resource = resource
  119298. return c
  119299. }
  119300. // Fields allows partial responses to be retrieved. See
  119301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119302. // for more information.
  119303. func (c *ReservationsGetIamPolicyCall) Fields(s ...googleapi.Field) *ReservationsGetIamPolicyCall {
  119304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119305. return c
  119306. }
  119307. // IfNoneMatch sets the optional parameter which makes the operation
  119308. // fail if the object's ETag matches the given value. This is useful for
  119309. // getting updates only after the object has changed since the last
  119310. // request. Use googleapi.IsNotModified to check whether the response
  119311. // error from Do is the result of In-None-Match.
  119312. func (c *ReservationsGetIamPolicyCall) IfNoneMatch(entityTag string) *ReservationsGetIamPolicyCall {
  119313. c.ifNoneMatch_ = entityTag
  119314. return c
  119315. }
  119316. // Context sets the context to be used in this call's Do method. Any
  119317. // pending HTTP request will be aborted if the provided context is
  119318. // canceled.
  119319. func (c *ReservationsGetIamPolicyCall) Context(ctx context.Context) *ReservationsGetIamPolicyCall {
  119320. c.ctx_ = ctx
  119321. return c
  119322. }
  119323. // Header returns an http.Header that can be modified by the caller to
  119324. // add HTTP headers to the request.
  119325. func (c *ReservationsGetIamPolicyCall) Header() http.Header {
  119326. if c.header_ == nil {
  119327. c.header_ = make(http.Header)
  119328. }
  119329. return c.header_
  119330. }
  119331. func (c *ReservationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  119332. reqHeaders := make(http.Header)
  119333. for k, v := range c.header_ {
  119334. reqHeaders[k] = v
  119335. }
  119336. reqHeaders.Set("User-Agent", c.s.userAgent())
  119337. if c.ifNoneMatch_ != "" {
  119338. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119339. }
  119340. var body io.Reader = nil
  119341. c.urlParams_.Set("alt", alt)
  119342. c.urlParams_.Set("prettyPrint", "false")
  119343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/reservations/{resource}/getIamPolicy")
  119344. urls += "?" + c.urlParams_.Encode()
  119345. req, err := http.NewRequest("GET", urls, body)
  119346. if err != nil {
  119347. return nil, err
  119348. }
  119349. req.Header = reqHeaders
  119350. googleapi.Expand(req.URL, map[string]string{
  119351. "project": c.project,
  119352. "zone": c.zone,
  119353. "resource": c.resource,
  119354. })
  119355. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119356. }
  119357. // Do executes the "compute.reservations.getIamPolicy" call.
  119358. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  119359. // code is an error. Response headers are in either
  119360. // *Policy.ServerResponse.Header or (if a response was returned at all)
  119361. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  119362. // check whether the returned error was because http.StatusNotModified
  119363. // was returned.
  119364. func (c *ReservationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  119365. gensupport.SetOptions(c.urlParams_, opts...)
  119366. res, err := c.doRequest("json")
  119367. if res != nil && res.StatusCode == http.StatusNotModified {
  119368. if res.Body != nil {
  119369. res.Body.Close()
  119370. }
  119371. return nil, &googleapi.Error{
  119372. Code: res.StatusCode,
  119373. Header: res.Header,
  119374. }
  119375. }
  119376. if err != nil {
  119377. return nil, err
  119378. }
  119379. defer googleapi.CloseBody(res)
  119380. if err := googleapi.CheckResponse(res); err != nil {
  119381. return nil, err
  119382. }
  119383. ret := &Policy{
  119384. ServerResponse: googleapi.ServerResponse{
  119385. Header: res.Header,
  119386. HTTPStatusCode: res.StatusCode,
  119387. },
  119388. }
  119389. target := &ret
  119390. if err := gensupport.DecodeResponse(target, res); err != nil {
  119391. return nil, err
  119392. }
  119393. return ret, nil
  119394. // {
  119395. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  119396. // "httpMethod": "GET",
  119397. // "id": "compute.reservations.getIamPolicy",
  119398. // "parameterOrder": [
  119399. // "project",
  119400. // "zone",
  119401. // "resource"
  119402. // ],
  119403. // "parameters": {
  119404. // "project": {
  119405. // "description": "Project ID for this request.",
  119406. // "location": "path",
  119407. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119408. // "required": true,
  119409. // "type": "string"
  119410. // },
  119411. // "resource": {
  119412. // "description": "Name or id of the resource for this request.",
  119413. // "location": "path",
  119414. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  119415. // "required": true,
  119416. // "type": "string"
  119417. // },
  119418. // "zone": {
  119419. // "description": "The name of the zone for this request.",
  119420. // "location": "path",
  119421. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119422. // "required": true,
  119423. // "type": "string"
  119424. // }
  119425. // },
  119426. // "path": "{project}/zones/{zone}/reservations/{resource}/getIamPolicy",
  119427. // "response": {
  119428. // "$ref": "Policy"
  119429. // },
  119430. // "scopes": [
  119431. // "https://www.googleapis.com/auth/cloud-platform",
  119432. // "https://www.googleapis.com/auth/compute",
  119433. // "https://www.googleapis.com/auth/compute.readonly"
  119434. // ]
  119435. // }
  119436. }
  119437. // method id "compute.reservations.insert":
  119438. type ReservationsInsertCall struct {
  119439. s *Service
  119440. project string
  119441. zone string
  119442. reservation *Reservation
  119443. urlParams_ gensupport.URLParams
  119444. ctx_ context.Context
  119445. header_ http.Header
  119446. }
  119447. // Insert: Creates a new reservation.
  119448. func (r *ReservationsService) Insert(project string, zone string, reservation *Reservation) *ReservationsInsertCall {
  119449. c := &ReservationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119450. c.project = project
  119451. c.zone = zone
  119452. c.reservation = reservation
  119453. return c
  119454. }
  119455. // RequestId sets the optional parameter "requestId": An optional
  119456. // request ID to identify requests. Specify a unique request ID so that
  119457. // if you must retry your request, the server will know to ignore the
  119458. // request if it has already been completed.
  119459. //
  119460. // For example, consider a situation where you make an initial request
  119461. // and the request times out. If you make the request again with the
  119462. // same request ID, the server can check if original operation with the
  119463. // same request ID was received, and if so, will ignore the second
  119464. // request. This prevents clients from accidentally creating duplicate
  119465. // commitments.
  119466. //
  119467. // The request ID must be a valid UUID with the exception that zero UUID
  119468. // is not supported (00000000-0000-0000-0000-000000000000).
  119469. func (c *ReservationsInsertCall) RequestId(requestId string) *ReservationsInsertCall {
  119470. c.urlParams_.Set("requestId", requestId)
  119471. return c
  119472. }
  119473. // Fields allows partial responses to be retrieved. See
  119474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119475. // for more information.
  119476. func (c *ReservationsInsertCall) Fields(s ...googleapi.Field) *ReservationsInsertCall {
  119477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119478. return c
  119479. }
  119480. // Context sets the context to be used in this call's Do method. Any
  119481. // pending HTTP request will be aborted if the provided context is
  119482. // canceled.
  119483. func (c *ReservationsInsertCall) Context(ctx context.Context) *ReservationsInsertCall {
  119484. c.ctx_ = ctx
  119485. return c
  119486. }
  119487. // Header returns an http.Header that can be modified by the caller to
  119488. // add HTTP headers to the request.
  119489. func (c *ReservationsInsertCall) Header() http.Header {
  119490. if c.header_ == nil {
  119491. c.header_ = make(http.Header)
  119492. }
  119493. return c.header_
  119494. }
  119495. func (c *ReservationsInsertCall) doRequest(alt string) (*http.Response, error) {
  119496. reqHeaders := make(http.Header)
  119497. for k, v := range c.header_ {
  119498. reqHeaders[k] = v
  119499. }
  119500. reqHeaders.Set("User-Agent", c.s.userAgent())
  119501. var body io.Reader = nil
  119502. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation)
  119503. if err != nil {
  119504. return nil, err
  119505. }
  119506. reqHeaders.Set("Content-Type", "application/json")
  119507. c.urlParams_.Set("alt", alt)
  119508. c.urlParams_.Set("prettyPrint", "false")
  119509. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/reservations")
  119510. urls += "?" + c.urlParams_.Encode()
  119511. req, err := http.NewRequest("POST", urls, body)
  119512. if err != nil {
  119513. return nil, err
  119514. }
  119515. req.Header = reqHeaders
  119516. googleapi.Expand(req.URL, map[string]string{
  119517. "project": c.project,
  119518. "zone": c.zone,
  119519. })
  119520. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119521. }
  119522. // Do executes the "compute.reservations.insert" call.
  119523. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119524. // status code is an error. Response headers are in either
  119525. // *Operation.ServerResponse.Header or (if a response was returned at
  119526. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119527. // to check whether the returned error was because
  119528. // http.StatusNotModified was returned.
  119529. func (c *ReservationsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119530. gensupport.SetOptions(c.urlParams_, opts...)
  119531. res, err := c.doRequest("json")
  119532. if res != nil && res.StatusCode == http.StatusNotModified {
  119533. if res.Body != nil {
  119534. res.Body.Close()
  119535. }
  119536. return nil, &googleapi.Error{
  119537. Code: res.StatusCode,
  119538. Header: res.Header,
  119539. }
  119540. }
  119541. if err != nil {
  119542. return nil, err
  119543. }
  119544. defer googleapi.CloseBody(res)
  119545. if err := googleapi.CheckResponse(res); err != nil {
  119546. return nil, err
  119547. }
  119548. ret := &Operation{
  119549. ServerResponse: googleapi.ServerResponse{
  119550. Header: res.Header,
  119551. HTTPStatusCode: res.StatusCode,
  119552. },
  119553. }
  119554. target := &ret
  119555. if err := gensupport.DecodeResponse(target, res); err != nil {
  119556. return nil, err
  119557. }
  119558. return ret, nil
  119559. // {
  119560. // "description": "Creates a new reservation.",
  119561. // "httpMethod": "POST",
  119562. // "id": "compute.reservations.insert",
  119563. // "parameterOrder": [
  119564. // "project",
  119565. // "zone"
  119566. // ],
  119567. // "parameters": {
  119568. // "project": {
  119569. // "description": "Project ID for this request.",
  119570. // "location": "path",
  119571. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119572. // "required": true,
  119573. // "type": "string"
  119574. // },
  119575. // "requestId": {
  119576. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  119577. // "location": "query",
  119578. // "type": "string"
  119579. // },
  119580. // "zone": {
  119581. // "description": "Name of the zone for this request.",
  119582. // "location": "path",
  119583. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119584. // "required": true,
  119585. // "type": "string"
  119586. // }
  119587. // },
  119588. // "path": "{project}/zones/{zone}/reservations",
  119589. // "request": {
  119590. // "$ref": "Reservation"
  119591. // },
  119592. // "response": {
  119593. // "$ref": "Operation"
  119594. // },
  119595. // "scopes": [
  119596. // "https://www.googleapis.com/auth/cloud-platform",
  119597. // "https://www.googleapis.com/auth/compute"
  119598. // ]
  119599. // }
  119600. }
  119601. // method id "compute.reservations.list":
  119602. type ReservationsListCall struct {
  119603. s *Service
  119604. project string
  119605. zone string
  119606. urlParams_ gensupport.URLParams
  119607. ifNoneMatch_ string
  119608. ctx_ context.Context
  119609. header_ http.Header
  119610. }
  119611. // List: A list all the reservations that have been configured for the
  119612. // specified project in specified zone.
  119613. func (r *ReservationsService) List(project string, zone string) *ReservationsListCall {
  119614. c := &ReservationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119615. c.project = project
  119616. c.zone = zone
  119617. return c
  119618. }
  119619. // Filter sets the optional parameter "filter": A filter expression that
  119620. // filters resources listed in the response. The expression must specify
  119621. // the field name, a comparison operator, and the value that you want to
  119622. // use for filtering. The value must be a string, a number, or a
  119623. // boolean. The comparison operator must be either =, !=, >, or <.
  119624. //
  119625. // For example, if you are filtering Compute Engine instances, you can
  119626. // exclude instances named example-instance by specifying name !=
  119627. // example-instance.
  119628. //
  119629. // You can also filter nested fields. For example, you could specify
  119630. // scheduling.automaticRestart = false to include instances only if they
  119631. // are not scheduled for automatic restarts. You can use filtering on
  119632. // nested fields to filter based on resource labels.
  119633. //
  119634. // To filter on multiple expressions, provide each separate expression
  119635. // within parentheses. For example, (scheduling.automaticRestart = true)
  119636. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  119637. // AND expression. However, you can include AND and OR expressions
  119638. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  119639. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  119640. // true).
  119641. func (c *ReservationsListCall) Filter(filter string) *ReservationsListCall {
  119642. c.urlParams_.Set("filter", filter)
  119643. return c
  119644. }
  119645. // MaxResults sets the optional parameter "maxResults": The maximum
  119646. // number of results per page that should be returned. If the number of
  119647. // available results is larger than maxResults, Compute Engine returns a
  119648. // nextPageToken that can be used to get the next page of results in
  119649. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  119650. // (Default: 500)
  119651. func (c *ReservationsListCall) MaxResults(maxResults int64) *ReservationsListCall {
  119652. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  119653. return c
  119654. }
  119655. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  119656. // a certain order. By default, results are returned in alphanumerical
  119657. // order based on the resource name.
  119658. //
  119659. // You can also sort results in descending order based on the creation
  119660. // timestamp using orderBy="creationTimestamp desc". This sorts results
  119661. // based on the creationTimestamp field in reverse chronological order
  119662. // (newest result first). Use this to sort resources like operations so
  119663. // that the newest operation is returned first.
  119664. //
  119665. // Currently, only sorting by name or creationTimestamp desc is
  119666. // supported.
  119667. func (c *ReservationsListCall) OrderBy(orderBy string) *ReservationsListCall {
  119668. c.urlParams_.Set("orderBy", orderBy)
  119669. return c
  119670. }
  119671. // PageToken sets the optional parameter "pageToken": Specifies a page
  119672. // token to use. Set pageToken to the nextPageToken returned by a
  119673. // previous list request to get the next page of results.
  119674. func (c *ReservationsListCall) PageToken(pageToken string) *ReservationsListCall {
  119675. c.urlParams_.Set("pageToken", pageToken)
  119676. return c
  119677. }
  119678. // Fields allows partial responses to be retrieved. See
  119679. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119680. // for more information.
  119681. func (c *ReservationsListCall) Fields(s ...googleapi.Field) *ReservationsListCall {
  119682. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119683. return c
  119684. }
  119685. // IfNoneMatch sets the optional parameter which makes the operation
  119686. // fail if the object's ETag matches the given value. This is useful for
  119687. // getting updates only after the object has changed since the last
  119688. // request. Use googleapi.IsNotModified to check whether the response
  119689. // error from Do is the result of In-None-Match.
  119690. func (c *ReservationsListCall) IfNoneMatch(entityTag string) *ReservationsListCall {
  119691. c.ifNoneMatch_ = entityTag
  119692. return c
  119693. }
  119694. // Context sets the context to be used in this call's Do method. Any
  119695. // pending HTTP request will be aborted if the provided context is
  119696. // canceled.
  119697. func (c *ReservationsListCall) Context(ctx context.Context) *ReservationsListCall {
  119698. c.ctx_ = ctx
  119699. return c
  119700. }
  119701. // Header returns an http.Header that can be modified by the caller to
  119702. // add HTTP headers to the request.
  119703. func (c *ReservationsListCall) Header() http.Header {
  119704. if c.header_ == nil {
  119705. c.header_ = make(http.Header)
  119706. }
  119707. return c.header_
  119708. }
  119709. func (c *ReservationsListCall) doRequest(alt string) (*http.Response, error) {
  119710. reqHeaders := make(http.Header)
  119711. for k, v := range c.header_ {
  119712. reqHeaders[k] = v
  119713. }
  119714. reqHeaders.Set("User-Agent", c.s.userAgent())
  119715. if c.ifNoneMatch_ != "" {
  119716. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119717. }
  119718. var body io.Reader = nil
  119719. c.urlParams_.Set("alt", alt)
  119720. c.urlParams_.Set("prettyPrint", "false")
  119721. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/reservations")
  119722. urls += "?" + c.urlParams_.Encode()
  119723. req, err := http.NewRequest("GET", urls, body)
  119724. if err != nil {
  119725. return nil, err
  119726. }
  119727. req.Header = reqHeaders
  119728. googleapi.Expand(req.URL, map[string]string{
  119729. "project": c.project,
  119730. "zone": c.zone,
  119731. })
  119732. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119733. }
  119734. // Do executes the "compute.reservations.list" call.
  119735. // Exactly one of *ReservationList or error will be non-nil. Any non-2xx
  119736. // status code is an error. Response headers are in either
  119737. // *ReservationList.ServerResponse.Header or (if a response was returned
  119738. // at all) in error.(*googleapi.Error).Header. Use
  119739. // googleapi.IsNotModified to check whether the returned error was
  119740. // because http.StatusNotModified was returned.
  119741. func (c *ReservationsListCall) Do(opts ...googleapi.CallOption) (*ReservationList, error) {
  119742. gensupport.SetOptions(c.urlParams_, opts...)
  119743. res, err := c.doRequest("json")
  119744. if res != nil && res.StatusCode == http.StatusNotModified {
  119745. if res.Body != nil {
  119746. res.Body.Close()
  119747. }
  119748. return nil, &googleapi.Error{
  119749. Code: res.StatusCode,
  119750. Header: res.Header,
  119751. }
  119752. }
  119753. if err != nil {
  119754. return nil, err
  119755. }
  119756. defer googleapi.CloseBody(res)
  119757. if err := googleapi.CheckResponse(res); err != nil {
  119758. return nil, err
  119759. }
  119760. ret := &ReservationList{
  119761. ServerResponse: googleapi.ServerResponse{
  119762. Header: res.Header,
  119763. HTTPStatusCode: res.StatusCode,
  119764. },
  119765. }
  119766. target := &ret
  119767. if err := gensupport.DecodeResponse(target, res); err != nil {
  119768. return nil, err
  119769. }
  119770. return ret, nil
  119771. // {
  119772. // "description": "A list all the reservations that have been configured for the specified project in specified zone.",
  119773. // "httpMethod": "GET",
  119774. // "id": "compute.reservations.list",
  119775. // "parameterOrder": [
  119776. // "project",
  119777. // "zone"
  119778. // ],
  119779. // "parameters": {
  119780. // "filter": {
  119781. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  119782. // "location": "query",
  119783. // "type": "string"
  119784. // },
  119785. // "maxResults": {
  119786. // "default": "500",
  119787. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  119788. // "format": "uint32",
  119789. // "location": "query",
  119790. // "minimum": "0",
  119791. // "type": "integer"
  119792. // },
  119793. // "orderBy": {
  119794. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  119795. // "location": "query",
  119796. // "type": "string"
  119797. // },
  119798. // "pageToken": {
  119799. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  119800. // "location": "query",
  119801. // "type": "string"
  119802. // },
  119803. // "project": {
  119804. // "description": "Project ID for this request.",
  119805. // "location": "path",
  119806. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119807. // "required": true,
  119808. // "type": "string"
  119809. // },
  119810. // "zone": {
  119811. // "description": "Name of the zone for this request.",
  119812. // "location": "path",
  119813. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119814. // "required": true,
  119815. // "type": "string"
  119816. // }
  119817. // },
  119818. // "path": "{project}/zones/{zone}/reservations",
  119819. // "response": {
  119820. // "$ref": "ReservationList"
  119821. // },
  119822. // "scopes": [
  119823. // "https://www.googleapis.com/auth/cloud-platform",
  119824. // "https://www.googleapis.com/auth/compute",
  119825. // "https://www.googleapis.com/auth/compute.readonly"
  119826. // ]
  119827. // }
  119828. }
  119829. // Pages invokes f for each page of results.
  119830. // A non-nil error returned from f will halt the iteration.
  119831. // The provided context supersedes any context provided to the Context method.
  119832. func (c *ReservationsListCall) Pages(ctx context.Context, f func(*ReservationList) error) error {
  119833. c.ctx_ = ctx
  119834. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  119835. for {
  119836. x, err := c.Do()
  119837. if err != nil {
  119838. return err
  119839. }
  119840. if err := f(x); err != nil {
  119841. return err
  119842. }
  119843. if x.NextPageToken == "" {
  119844. return nil
  119845. }
  119846. c.PageToken(x.NextPageToken)
  119847. }
  119848. }
  119849. // method id "compute.reservations.resize":
  119850. type ReservationsResizeCall struct {
  119851. s *Service
  119852. project string
  119853. zone string
  119854. reservation string
  119855. reservationsresizerequest *ReservationsResizeRequest
  119856. urlParams_ gensupport.URLParams
  119857. ctx_ context.Context
  119858. header_ http.Header
  119859. }
  119860. // Resize: Resizes the reservation (applicable to standalone
  119861. // reservations only)
  119862. func (r *ReservationsService) Resize(project string, zone string, reservation string, reservationsresizerequest *ReservationsResizeRequest) *ReservationsResizeCall {
  119863. c := &ReservationsResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119864. c.project = project
  119865. c.zone = zone
  119866. c.reservation = reservation
  119867. c.reservationsresizerequest = reservationsresizerequest
  119868. return c
  119869. }
  119870. // RequestId sets the optional parameter "requestId": An optional
  119871. // request ID to identify requests. Specify a unique request ID so that
  119872. // if you must retry your request, the server will know to ignore the
  119873. // request if it has already been completed.
  119874. //
  119875. // For example, consider a situation where you make an initial request
  119876. // and the request times out. If you make the request again with the
  119877. // same request ID, the server can check if original operation with the
  119878. // same request ID was received, and if so, will ignore the second
  119879. // request. This prevents clients from accidentally creating duplicate
  119880. // commitments.
  119881. //
  119882. // The request ID must be a valid UUID with the exception that zero UUID
  119883. // is not supported (00000000-0000-0000-0000-000000000000).
  119884. func (c *ReservationsResizeCall) RequestId(requestId string) *ReservationsResizeCall {
  119885. c.urlParams_.Set("requestId", requestId)
  119886. return c
  119887. }
  119888. // Fields allows partial responses to be retrieved. See
  119889. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119890. // for more information.
  119891. func (c *ReservationsResizeCall) Fields(s ...googleapi.Field) *ReservationsResizeCall {
  119892. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119893. return c
  119894. }
  119895. // Context sets the context to be used in this call's Do method. Any
  119896. // pending HTTP request will be aborted if the provided context is
  119897. // canceled.
  119898. func (c *ReservationsResizeCall) Context(ctx context.Context) *ReservationsResizeCall {
  119899. c.ctx_ = ctx
  119900. return c
  119901. }
  119902. // Header returns an http.Header that can be modified by the caller to
  119903. // add HTTP headers to the request.
  119904. func (c *ReservationsResizeCall) Header() http.Header {
  119905. if c.header_ == nil {
  119906. c.header_ = make(http.Header)
  119907. }
  119908. return c.header_
  119909. }
  119910. func (c *ReservationsResizeCall) doRequest(alt string) (*http.Response, error) {
  119911. reqHeaders := make(http.Header)
  119912. for k, v := range c.header_ {
  119913. reqHeaders[k] = v
  119914. }
  119915. reqHeaders.Set("User-Agent", c.s.userAgent())
  119916. var body io.Reader = nil
  119917. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservationsresizerequest)
  119918. if err != nil {
  119919. return nil, err
  119920. }
  119921. reqHeaders.Set("Content-Type", "application/json")
  119922. c.urlParams_.Set("alt", alt)
  119923. c.urlParams_.Set("prettyPrint", "false")
  119924. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/reservations/{reservation}/resize")
  119925. urls += "?" + c.urlParams_.Encode()
  119926. req, err := http.NewRequest("POST", urls, body)
  119927. if err != nil {
  119928. return nil, err
  119929. }
  119930. req.Header = reqHeaders
  119931. googleapi.Expand(req.URL, map[string]string{
  119932. "project": c.project,
  119933. "zone": c.zone,
  119934. "reservation": c.reservation,
  119935. })
  119936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119937. }
  119938. // Do executes the "compute.reservations.resize" call.
  119939. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119940. // status code is an error. Response headers are in either
  119941. // *Operation.ServerResponse.Header or (if a response was returned at
  119942. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119943. // to check whether the returned error was because
  119944. // http.StatusNotModified was returned.
  119945. func (c *ReservationsResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119946. gensupport.SetOptions(c.urlParams_, opts...)
  119947. res, err := c.doRequest("json")
  119948. if res != nil && res.StatusCode == http.StatusNotModified {
  119949. if res.Body != nil {
  119950. res.Body.Close()
  119951. }
  119952. return nil, &googleapi.Error{
  119953. Code: res.StatusCode,
  119954. Header: res.Header,
  119955. }
  119956. }
  119957. if err != nil {
  119958. return nil, err
  119959. }
  119960. defer googleapi.CloseBody(res)
  119961. if err := googleapi.CheckResponse(res); err != nil {
  119962. return nil, err
  119963. }
  119964. ret := &Operation{
  119965. ServerResponse: googleapi.ServerResponse{
  119966. Header: res.Header,
  119967. HTTPStatusCode: res.StatusCode,
  119968. },
  119969. }
  119970. target := &ret
  119971. if err := gensupport.DecodeResponse(target, res); err != nil {
  119972. return nil, err
  119973. }
  119974. return ret, nil
  119975. // {
  119976. // "description": "Resizes the reservation (applicable to standalone reservations only)",
  119977. // "httpMethod": "POST",
  119978. // "id": "compute.reservations.resize",
  119979. // "parameterOrder": [
  119980. // "project",
  119981. // "zone",
  119982. // "reservation"
  119983. // ],
  119984. // "parameters": {
  119985. // "project": {
  119986. // "description": "Project ID for this request.",
  119987. // "location": "path",
  119988. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119989. // "required": true,
  119990. // "type": "string"
  119991. // },
  119992. // "requestId": {
  119993. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  119994. // "location": "query",
  119995. // "type": "string"
  119996. // },
  119997. // "reservation": {
  119998. // "description": "Name of the reservation to update.",
  119999. // "location": "path",
  120000. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120001. // "required": true,
  120002. // "type": "string"
  120003. // },
  120004. // "zone": {
  120005. // "description": "Name of the zone for this request.",
  120006. // "location": "path",
  120007. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120008. // "required": true,
  120009. // "type": "string"
  120010. // }
  120011. // },
  120012. // "path": "{project}/zones/{zone}/reservations/{reservation}/resize",
  120013. // "request": {
  120014. // "$ref": "ReservationsResizeRequest"
  120015. // },
  120016. // "response": {
  120017. // "$ref": "Operation"
  120018. // },
  120019. // "scopes": [
  120020. // "https://www.googleapis.com/auth/cloud-platform",
  120021. // "https://www.googleapis.com/auth/compute"
  120022. // ]
  120023. // }
  120024. }
  120025. // method id "compute.reservations.setIamPolicy":
  120026. type ReservationsSetIamPolicyCall struct {
  120027. s *Service
  120028. project string
  120029. zone string
  120030. resource string
  120031. zonesetpolicyrequest *ZoneSetPolicyRequest
  120032. urlParams_ gensupport.URLParams
  120033. ctx_ context.Context
  120034. header_ http.Header
  120035. }
  120036. // SetIamPolicy: Sets the access control policy on the specified
  120037. // resource. Replaces any existing policy.
  120038. func (r *ReservationsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *ReservationsSetIamPolicyCall {
  120039. c := &ReservationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120040. c.project = project
  120041. c.zone = zone
  120042. c.resource = resource
  120043. c.zonesetpolicyrequest = zonesetpolicyrequest
  120044. return c
  120045. }
  120046. // Fields allows partial responses to be retrieved. See
  120047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120048. // for more information.
  120049. func (c *ReservationsSetIamPolicyCall) Fields(s ...googleapi.Field) *ReservationsSetIamPolicyCall {
  120050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120051. return c
  120052. }
  120053. // Context sets the context to be used in this call's Do method. Any
  120054. // pending HTTP request will be aborted if the provided context is
  120055. // canceled.
  120056. func (c *ReservationsSetIamPolicyCall) Context(ctx context.Context) *ReservationsSetIamPolicyCall {
  120057. c.ctx_ = ctx
  120058. return c
  120059. }
  120060. // Header returns an http.Header that can be modified by the caller to
  120061. // add HTTP headers to the request.
  120062. func (c *ReservationsSetIamPolicyCall) Header() http.Header {
  120063. if c.header_ == nil {
  120064. c.header_ = make(http.Header)
  120065. }
  120066. return c.header_
  120067. }
  120068. func (c *ReservationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  120069. reqHeaders := make(http.Header)
  120070. for k, v := range c.header_ {
  120071. reqHeaders[k] = v
  120072. }
  120073. reqHeaders.Set("User-Agent", c.s.userAgent())
  120074. var body io.Reader = nil
  120075. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  120076. if err != nil {
  120077. return nil, err
  120078. }
  120079. reqHeaders.Set("Content-Type", "application/json")
  120080. c.urlParams_.Set("alt", alt)
  120081. c.urlParams_.Set("prettyPrint", "false")
  120082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/reservations/{resource}/setIamPolicy")
  120083. urls += "?" + c.urlParams_.Encode()
  120084. req, err := http.NewRequest("POST", urls, body)
  120085. if err != nil {
  120086. return nil, err
  120087. }
  120088. req.Header = reqHeaders
  120089. googleapi.Expand(req.URL, map[string]string{
  120090. "project": c.project,
  120091. "zone": c.zone,
  120092. "resource": c.resource,
  120093. })
  120094. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120095. }
  120096. // Do executes the "compute.reservations.setIamPolicy" call.
  120097. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  120098. // code is an error. Response headers are in either
  120099. // *Policy.ServerResponse.Header or (if a response was returned at all)
  120100. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  120101. // check whether the returned error was because http.StatusNotModified
  120102. // was returned.
  120103. func (c *ReservationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  120104. gensupport.SetOptions(c.urlParams_, opts...)
  120105. res, err := c.doRequest("json")
  120106. if res != nil && res.StatusCode == http.StatusNotModified {
  120107. if res.Body != nil {
  120108. res.Body.Close()
  120109. }
  120110. return nil, &googleapi.Error{
  120111. Code: res.StatusCode,
  120112. Header: res.Header,
  120113. }
  120114. }
  120115. if err != nil {
  120116. return nil, err
  120117. }
  120118. defer googleapi.CloseBody(res)
  120119. if err := googleapi.CheckResponse(res); err != nil {
  120120. return nil, err
  120121. }
  120122. ret := &Policy{
  120123. ServerResponse: googleapi.ServerResponse{
  120124. Header: res.Header,
  120125. HTTPStatusCode: res.StatusCode,
  120126. },
  120127. }
  120128. target := &ret
  120129. if err := gensupport.DecodeResponse(target, res); err != nil {
  120130. return nil, err
  120131. }
  120132. return ret, nil
  120133. // {
  120134. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  120135. // "httpMethod": "POST",
  120136. // "id": "compute.reservations.setIamPolicy",
  120137. // "parameterOrder": [
  120138. // "project",
  120139. // "zone",
  120140. // "resource"
  120141. // ],
  120142. // "parameters": {
  120143. // "project": {
  120144. // "description": "Project ID for this request.",
  120145. // "location": "path",
  120146. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120147. // "required": true,
  120148. // "type": "string"
  120149. // },
  120150. // "resource": {
  120151. // "description": "Name or id of the resource for this request.",
  120152. // "location": "path",
  120153. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  120154. // "required": true,
  120155. // "type": "string"
  120156. // },
  120157. // "zone": {
  120158. // "description": "The name of the zone for this request.",
  120159. // "location": "path",
  120160. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120161. // "required": true,
  120162. // "type": "string"
  120163. // }
  120164. // },
  120165. // "path": "{project}/zones/{zone}/reservations/{resource}/setIamPolicy",
  120166. // "request": {
  120167. // "$ref": "ZoneSetPolicyRequest"
  120168. // },
  120169. // "response": {
  120170. // "$ref": "Policy"
  120171. // },
  120172. // "scopes": [
  120173. // "https://www.googleapis.com/auth/cloud-platform",
  120174. // "https://www.googleapis.com/auth/compute"
  120175. // ]
  120176. // }
  120177. }
  120178. // method id "compute.reservations.testIamPermissions":
  120179. type ReservationsTestIamPermissionsCall struct {
  120180. s *Service
  120181. project string
  120182. zone string
  120183. resource string
  120184. testpermissionsrequest *TestPermissionsRequest
  120185. urlParams_ gensupport.URLParams
  120186. ctx_ context.Context
  120187. header_ http.Header
  120188. }
  120189. // TestIamPermissions: Returns permissions that a caller has on the
  120190. // specified resource.
  120191. func (r *ReservationsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *ReservationsTestIamPermissionsCall {
  120192. c := &ReservationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120193. c.project = project
  120194. c.zone = zone
  120195. c.resource = resource
  120196. c.testpermissionsrequest = testpermissionsrequest
  120197. return c
  120198. }
  120199. // Fields allows partial responses to be retrieved. See
  120200. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120201. // for more information.
  120202. func (c *ReservationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ReservationsTestIamPermissionsCall {
  120203. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120204. return c
  120205. }
  120206. // Context sets the context to be used in this call's Do method. Any
  120207. // pending HTTP request will be aborted if the provided context is
  120208. // canceled.
  120209. func (c *ReservationsTestIamPermissionsCall) Context(ctx context.Context) *ReservationsTestIamPermissionsCall {
  120210. c.ctx_ = ctx
  120211. return c
  120212. }
  120213. // Header returns an http.Header that can be modified by the caller to
  120214. // add HTTP headers to the request.
  120215. func (c *ReservationsTestIamPermissionsCall) Header() http.Header {
  120216. if c.header_ == nil {
  120217. c.header_ = make(http.Header)
  120218. }
  120219. return c.header_
  120220. }
  120221. func (c *ReservationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  120222. reqHeaders := make(http.Header)
  120223. for k, v := range c.header_ {
  120224. reqHeaders[k] = v
  120225. }
  120226. reqHeaders.Set("User-Agent", c.s.userAgent())
  120227. var body io.Reader = nil
  120228. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  120229. if err != nil {
  120230. return nil, err
  120231. }
  120232. reqHeaders.Set("Content-Type", "application/json")
  120233. c.urlParams_.Set("alt", alt)
  120234. c.urlParams_.Set("prettyPrint", "false")
  120235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/reservations/{resource}/testIamPermissions")
  120236. urls += "?" + c.urlParams_.Encode()
  120237. req, err := http.NewRequest("POST", urls, body)
  120238. if err != nil {
  120239. return nil, err
  120240. }
  120241. req.Header = reqHeaders
  120242. googleapi.Expand(req.URL, map[string]string{
  120243. "project": c.project,
  120244. "zone": c.zone,
  120245. "resource": c.resource,
  120246. })
  120247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120248. }
  120249. // Do executes the "compute.reservations.testIamPermissions" call.
  120250. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  120251. // non-2xx status code is an error. Response headers are in either
  120252. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  120253. // returned at all) in error.(*googleapi.Error).Header. Use
  120254. // googleapi.IsNotModified to check whether the returned error was
  120255. // because http.StatusNotModified was returned.
  120256. func (c *ReservationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  120257. gensupport.SetOptions(c.urlParams_, opts...)
  120258. res, err := c.doRequest("json")
  120259. if res != nil && res.StatusCode == http.StatusNotModified {
  120260. if res.Body != nil {
  120261. res.Body.Close()
  120262. }
  120263. return nil, &googleapi.Error{
  120264. Code: res.StatusCode,
  120265. Header: res.Header,
  120266. }
  120267. }
  120268. if err != nil {
  120269. return nil, err
  120270. }
  120271. defer googleapi.CloseBody(res)
  120272. if err := googleapi.CheckResponse(res); err != nil {
  120273. return nil, err
  120274. }
  120275. ret := &TestPermissionsResponse{
  120276. ServerResponse: googleapi.ServerResponse{
  120277. Header: res.Header,
  120278. HTTPStatusCode: res.StatusCode,
  120279. },
  120280. }
  120281. target := &ret
  120282. if err := gensupport.DecodeResponse(target, res); err != nil {
  120283. return nil, err
  120284. }
  120285. return ret, nil
  120286. // {
  120287. // "description": "Returns permissions that a caller has on the specified resource.",
  120288. // "httpMethod": "POST",
  120289. // "id": "compute.reservations.testIamPermissions",
  120290. // "parameterOrder": [
  120291. // "project",
  120292. // "zone",
  120293. // "resource"
  120294. // ],
  120295. // "parameters": {
  120296. // "project": {
  120297. // "description": "Project ID for this request.",
  120298. // "location": "path",
  120299. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120300. // "required": true,
  120301. // "type": "string"
  120302. // },
  120303. // "resource": {
  120304. // "description": "Name or id of the resource for this request.",
  120305. // "location": "path",
  120306. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  120307. // "required": true,
  120308. // "type": "string"
  120309. // },
  120310. // "zone": {
  120311. // "description": "The name of the zone for this request.",
  120312. // "location": "path",
  120313. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120314. // "required": true,
  120315. // "type": "string"
  120316. // }
  120317. // },
  120318. // "path": "{project}/zones/{zone}/reservations/{resource}/testIamPermissions",
  120319. // "request": {
  120320. // "$ref": "TestPermissionsRequest"
  120321. // },
  120322. // "response": {
  120323. // "$ref": "TestPermissionsResponse"
  120324. // },
  120325. // "scopes": [
  120326. // "https://www.googleapis.com/auth/cloud-platform",
  120327. // "https://www.googleapis.com/auth/compute",
  120328. // "https://www.googleapis.com/auth/compute.readonly"
  120329. // ]
  120330. // }
  120331. }
  120332. // method id "compute.resourcePolicies.aggregatedList":
  120333. type ResourcePoliciesAggregatedListCall struct {
  120334. s *Service
  120335. project string
  120336. urlParams_ gensupport.URLParams
  120337. ifNoneMatch_ string
  120338. ctx_ context.Context
  120339. header_ http.Header
  120340. }
  120341. // AggregatedList: Retrieves an aggregated list of resource policies.
  120342. func (r *ResourcePoliciesService) AggregatedList(project string) *ResourcePoliciesAggregatedListCall {
  120343. c := &ResourcePoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120344. c.project = project
  120345. return c
  120346. }
  120347. // Filter sets the optional parameter "filter": A filter expression that
  120348. // filters resources listed in the response. The expression must specify
  120349. // the field name, a comparison operator, and the value that you want to
  120350. // use for filtering. The value must be a string, a number, or a
  120351. // boolean. The comparison operator must be either =, !=, >, or <.
  120352. //
  120353. // For example, if you are filtering Compute Engine instances, you can
  120354. // exclude instances named example-instance by specifying name !=
  120355. // example-instance.
  120356. //
  120357. // You can also filter nested fields. For example, you could specify
  120358. // scheduling.automaticRestart = false to include instances only if they
  120359. // are not scheduled for automatic restarts. You can use filtering on
  120360. // nested fields to filter based on resource labels.
  120361. //
  120362. // To filter on multiple expressions, provide each separate expression
  120363. // within parentheses. For example, (scheduling.automaticRestart = true)
  120364. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  120365. // AND expression. However, you can include AND and OR expressions
  120366. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  120367. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  120368. // true).
  120369. func (c *ResourcePoliciesAggregatedListCall) Filter(filter string) *ResourcePoliciesAggregatedListCall {
  120370. c.urlParams_.Set("filter", filter)
  120371. return c
  120372. }
  120373. // MaxResults sets the optional parameter "maxResults": The maximum
  120374. // number of results per page that should be returned. If the number of
  120375. // available results is larger than maxResults, Compute Engine returns a
  120376. // nextPageToken that can be used to get the next page of results in
  120377. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  120378. // (Default: 500)
  120379. func (c *ResourcePoliciesAggregatedListCall) MaxResults(maxResults int64) *ResourcePoliciesAggregatedListCall {
  120380. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  120381. return c
  120382. }
  120383. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  120384. // a certain order. By default, results are returned in alphanumerical
  120385. // order based on the resource name.
  120386. //
  120387. // You can also sort results in descending order based on the creation
  120388. // timestamp using orderBy="creationTimestamp desc". This sorts results
  120389. // based on the creationTimestamp field in reverse chronological order
  120390. // (newest result first). Use this to sort resources like operations so
  120391. // that the newest operation is returned first.
  120392. //
  120393. // Currently, only sorting by name or creationTimestamp desc is
  120394. // supported.
  120395. func (c *ResourcePoliciesAggregatedListCall) OrderBy(orderBy string) *ResourcePoliciesAggregatedListCall {
  120396. c.urlParams_.Set("orderBy", orderBy)
  120397. return c
  120398. }
  120399. // PageToken sets the optional parameter "pageToken": Specifies a page
  120400. // token to use. Set pageToken to the nextPageToken returned by a
  120401. // previous list request to get the next page of results.
  120402. func (c *ResourcePoliciesAggregatedListCall) PageToken(pageToken string) *ResourcePoliciesAggregatedListCall {
  120403. c.urlParams_.Set("pageToken", pageToken)
  120404. return c
  120405. }
  120406. // Fields allows partial responses to be retrieved. See
  120407. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120408. // for more information.
  120409. func (c *ResourcePoliciesAggregatedListCall) Fields(s ...googleapi.Field) *ResourcePoliciesAggregatedListCall {
  120410. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120411. return c
  120412. }
  120413. // IfNoneMatch sets the optional parameter which makes the operation
  120414. // fail if the object's ETag matches the given value. This is useful for
  120415. // getting updates only after the object has changed since the last
  120416. // request. Use googleapi.IsNotModified to check whether the response
  120417. // error from Do is the result of In-None-Match.
  120418. func (c *ResourcePoliciesAggregatedListCall) IfNoneMatch(entityTag string) *ResourcePoliciesAggregatedListCall {
  120419. c.ifNoneMatch_ = entityTag
  120420. return c
  120421. }
  120422. // Context sets the context to be used in this call's Do method. Any
  120423. // pending HTTP request will be aborted if the provided context is
  120424. // canceled.
  120425. func (c *ResourcePoliciesAggregatedListCall) Context(ctx context.Context) *ResourcePoliciesAggregatedListCall {
  120426. c.ctx_ = ctx
  120427. return c
  120428. }
  120429. // Header returns an http.Header that can be modified by the caller to
  120430. // add HTTP headers to the request.
  120431. func (c *ResourcePoliciesAggregatedListCall) Header() http.Header {
  120432. if c.header_ == nil {
  120433. c.header_ = make(http.Header)
  120434. }
  120435. return c.header_
  120436. }
  120437. func (c *ResourcePoliciesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  120438. reqHeaders := make(http.Header)
  120439. for k, v := range c.header_ {
  120440. reqHeaders[k] = v
  120441. }
  120442. reqHeaders.Set("User-Agent", c.s.userAgent())
  120443. if c.ifNoneMatch_ != "" {
  120444. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  120445. }
  120446. var body io.Reader = nil
  120447. c.urlParams_.Set("alt", alt)
  120448. c.urlParams_.Set("prettyPrint", "false")
  120449. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/resourcePolicies")
  120450. urls += "?" + c.urlParams_.Encode()
  120451. req, err := http.NewRequest("GET", urls, body)
  120452. if err != nil {
  120453. return nil, err
  120454. }
  120455. req.Header = reqHeaders
  120456. googleapi.Expand(req.URL, map[string]string{
  120457. "project": c.project,
  120458. })
  120459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120460. }
  120461. // Do executes the "compute.resourcePolicies.aggregatedList" call.
  120462. // Exactly one of *ResourcePolicyAggregatedList or error will be
  120463. // non-nil. Any non-2xx status code is an error. Response headers are in
  120464. // either *ResourcePolicyAggregatedList.ServerResponse.Header or (if a
  120465. // response was returned at all) in error.(*googleapi.Error).Header. Use
  120466. // googleapi.IsNotModified to check whether the returned error was
  120467. // because http.StatusNotModified was returned.
  120468. func (c *ResourcePoliciesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyAggregatedList, error) {
  120469. gensupport.SetOptions(c.urlParams_, opts...)
  120470. res, err := c.doRequest("json")
  120471. if res != nil && res.StatusCode == http.StatusNotModified {
  120472. if res.Body != nil {
  120473. res.Body.Close()
  120474. }
  120475. return nil, &googleapi.Error{
  120476. Code: res.StatusCode,
  120477. Header: res.Header,
  120478. }
  120479. }
  120480. if err != nil {
  120481. return nil, err
  120482. }
  120483. defer googleapi.CloseBody(res)
  120484. if err := googleapi.CheckResponse(res); err != nil {
  120485. return nil, err
  120486. }
  120487. ret := &ResourcePolicyAggregatedList{
  120488. ServerResponse: googleapi.ServerResponse{
  120489. Header: res.Header,
  120490. HTTPStatusCode: res.StatusCode,
  120491. },
  120492. }
  120493. target := &ret
  120494. if err := gensupport.DecodeResponse(target, res); err != nil {
  120495. return nil, err
  120496. }
  120497. return ret, nil
  120498. // {
  120499. // "description": "Retrieves an aggregated list of resource policies.",
  120500. // "httpMethod": "GET",
  120501. // "id": "compute.resourcePolicies.aggregatedList",
  120502. // "parameterOrder": [
  120503. // "project"
  120504. // ],
  120505. // "parameters": {
  120506. // "filter": {
  120507. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  120508. // "location": "query",
  120509. // "type": "string"
  120510. // },
  120511. // "maxResults": {
  120512. // "default": "500",
  120513. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  120514. // "format": "uint32",
  120515. // "location": "query",
  120516. // "minimum": "0",
  120517. // "type": "integer"
  120518. // },
  120519. // "orderBy": {
  120520. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  120521. // "location": "query",
  120522. // "type": "string"
  120523. // },
  120524. // "pageToken": {
  120525. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  120526. // "location": "query",
  120527. // "type": "string"
  120528. // },
  120529. // "project": {
  120530. // "description": "Project ID for this request.",
  120531. // "location": "path",
  120532. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120533. // "required": true,
  120534. // "type": "string"
  120535. // }
  120536. // },
  120537. // "path": "{project}/aggregated/resourcePolicies",
  120538. // "response": {
  120539. // "$ref": "ResourcePolicyAggregatedList"
  120540. // },
  120541. // "scopes": [
  120542. // "https://www.googleapis.com/auth/cloud-platform",
  120543. // "https://www.googleapis.com/auth/compute",
  120544. // "https://www.googleapis.com/auth/compute.readonly"
  120545. // ]
  120546. // }
  120547. }
  120548. // Pages invokes f for each page of results.
  120549. // A non-nil error returned from f will halt the iteration.
  120550. // The provided context supersedes any context provided to the Context method.
  120551. func (c *ResourcePoliciesAggregatedListCall) Pages(ctx context.Context, f func(*ResourcePolicyAggregatedList) error) error {
  120552. c.ctx_ = ctx
  120553. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  120554. for {
  120555. x, err := c.Do()
  120556. if err != nil {
  120557. return err
  120558. }
  120559. if err := f(x); err != nil {
  120560. return err
  120561. }
  120562. if x.NextPageToken == "" {
  120563. return nil
  120564. }
  120565. c.PageToken(x.NextPageToken)
  120566. }
  120567. }
  120568. // method id "compute.resourcePolicies.delete":
  120569. type ResourcePoliciesDeleteCall struct {
  120570. s *Service
  120571. project string
  120572. region string
  120573. resourcePolicy string
  120574. urlParams_ gensupport.URLParams
  120575. ctx_ context.Context
  120576. header_ http.Header
  120577. }
  120578. // Delete: Deletes the specified resource policy.
  120579. func (r *ResourcePoliciesService) Delete(project string, region string, resourcePolicy string) *ResourcePoliciesDeleteCall {
  120580. c := &ResourcePoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120581. c.project = project
  120582. c.region = region
  120583. c.resourcePolicy = resourcePolicy
  120584. return c
  120585. }
  120586. // RequestId sets the optional parameter "requestId": An optional
  120587. // request ID to identify requests. Specify a unique request ID so that
  120588. // if you must retry your request, the server will know to ignore the
  120589. // request if it has already been completed.
  120590. //
  120591. // For example, consider a situation where you make an initial request
  120592. // and the request times out. If you make the request again with the
  120593. // same request ID, the server can check if original operation with the
  120594. // same request ID was received, and if so, will ignore the second
  120595. // request. This prevents clients from accidentally creating duplicate
  120596. // commitments.
  120597. //
  120598. // The request ID must be a valid UUID with the exception that zero UUID
  120599. // is not supported (00000000-0000-0000-0000-000000000000).
  120600. func (c *ResourcePoliciesDeleteCall) RequestId(requestId string) *ResourcePoliciesDeleteCall {
  120601. c.urlParams_.Set("requestId", requestId)
  120602. return c
  120603. }
  120604. // Fields allows partial responses to be retrieved. See
  120605. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120606. // for more information.
  120607. func (c *ResourcePoliciesDeleteCall) Fields(s ...googleapi.Field) *ResourcePoliciesDeleteCall {
  120608. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120609. return c
  120610. }
  120611. // Context sets the context to be used in this call's Do method. Any
  120612. // pending HTTP request will be aborted if the provided context is
  120613. // canceled.
  120614. func (c *ResourcePoliciesDeleteCall) Context(ctx context.Context) *ResourcePoliciesDeleteCall {
  120615. c.ctx_ = ctx
  120616. return c
  120617. }
  120618. // Header returns an http.Header that can be modified by the caller to
  120619. // add HTTP headers to the request.
  120620. func (c *ResourcePoliciesDeleteCall) Header() http.Header {
  120621. if c.header_ == nil {
  120622. c.header_ = make(http.Header)
  120623. }
  120624. return c.header_
  120625. }
  120626. func (c *ResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  120627. reqHeaders := make(http.Header)
  120628. for k, v := range c.header_ {
  120629. reqHeaders[k] = v
  120630. }
  120631. reqHeaders.Set("User-Agent", c.s.userAgent())
  120632. var body io.Reader = nil
  120633. c.urlParams_.Set("alt", alt)
  120634. c.urlParams_.Set("prettyPrint", "false")
  120635. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  120636. urls += "?" + c.urlParams_.Encode()
  120637. req, err := http.NewRequest("DELETE", urls, body)
  120638. if err != nil {
  120639. return nil, err
  120640. }
  120641. req.Header = reqHeaders
  120642. googleapi.Expand(req.URL, map[string]string{
  120643. "project": c.project,
  120644. "region": c.region,
  120645. "resourcePolicy": c.resourcePolicy,
  120646. })
  120647. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120648. }
  120649. // Do executes the "compute.resourcePolicies.delete" call.
  120650. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  120651. // status code is an error. Response headers are in either
  120652. // *Operation.ServerResponse.Header or (if a response was returned at
  120653. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  120654. // to check whether the returned error was because
  120655. // http.StatusNotModified was returned.
  120656. func (c *ResourcePoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  120657. gensupport.SetOptions(c.urlParams_, opts...)
  120658. res, err := c.doRequest("json")
  120659. if res != nil && res.StatusCode == http.StatusNotModified {
  120660. if res.Body != nil {
  120661. res.Body.Close()
  120662. }
  120663. return nil, &googleapi.Error{
  120664. Code: res.StatusCode,
  120665. Header: res.Header,
  120666. }
  120667. }
  120668. if err != nil {
  120669. return nil, err
  120670. }
  120671. defer googleapi.CloseBody(res)
  120672. if err := googleapi.CheckResponse(res); err != nil {
  120673. return nil, err
  120674. }
  120675. ret := &Operation{
  120676. ServerResponse: googleapi.ServerResponse{
  120677. Header: res.Header,
  120678. HTTPStatusCode: res.StatusCode,
  120679. },
  120680. }
  120681. target := &ret
  120682. if err := gensupport.DecodeResponse(target, res); err != nil {
  120683. return nil, err
  120684. }
  120685. return ret, nil
  120686. // {
  120687. // "description": "Deletes the specified resource policy.",
  120688. // "httpMethod": "DELETE",
  120689. // "id": "compute.resourcePolicies.delete",
  120690. // "parameterOrder": [
  120691. // "project",
  120692. // "region",
  120693. // "resourcePolicy"
  120694. // ],
  120695. // "parameters": {
  120696. // "project": {
  120697. // "description": "Project ID for this request.",
  120698. // "location": "path",
  120699. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120700. // "required": true,
  120701. // "type": "string"
  120702. // },
  120703. // "region": {
  120704. // "description": "Name of the region for this request.",
  120705. // "location": "path",
  120706. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120707. // "required": true,
  120708. // "type": "string"
  120709. // },
  120710. // "requestId": {
  120711. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  120712. // "location": "query",
  120713. // "type": "string"
  120714. // },
  120715. // "resourcePolicy": {
  120716. // "description": "Name of the resource policy to delete.",
  120717. // "location": "path",
  120718. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  120719. // "required": true,
  120720. // "type": "string"
  120721. // }
  120722. // },
  120723. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  120724. // "response": {
  120725. // "$ref": "Operation"
  120726. // },
  120727. // "scopes": [
  120728. // "https://www.googleapis.com/auth/cloud-platform",
  120729. // "https://www.googleapis.com/auth/compute"
  120730. // ]
  120731. // }
  120732. }
  120733. // method id "compute.resourcePolicies.get":
  120734. type ResourcePoliciesGetCall struct {
  120735. s *Service
  120736. project string
  120737. region string
  120738. resourcePolicy string
  120739. urlParams_ gensupport.URLParams
  120740. ifNoneMatch_ string
  120741. ctx_ context.Context
  120742. header_ http.Header
  120743. }
  120744. // Get: Retrieves all information of the specified resource policy.
  120745. func (r *ResourcePoliciesService) Get(project string, region string, resourcePolicy string) *ResourcePoliciesGetCall {
  120746. c := &ResourcePoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120747. c.project = project
  120748. c.region = region
  120749. c.resourcePolicy = resourcePolicy
  120750. return c
  120751. }
  120752. // Fields allows partial responses to be retrieved. See
  120753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120754. // for more information.
  120755. func (c *ResourcePoliciesGetCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetCall {
  120756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120757. return c
  120758. }
  120759. // IfNoneMatch sets the optional parameter which makes the operation
  120760. // fail if the object's ETag matches the given value. This is useful for
  120761. // getting updates only after the object has changed since the last
  120762. // request. Use googleapi.IsNotModified to check whether the response
  120763. // error from Do is the result of In-None-Match.
  120764. func (c *ResourcePoliciesGetCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetCall {
  120765. c.ifNoneMatch_ = entityTag
  120766. return c
  120767. }
  120768. // Context sets the context to be used in this call's Do method. Any
  120769. // pending HTTP request will be aborted if the provided context is
  120770. // canceled.
  120771. func (c *ResourcePoliciesGetCall) Context(ctx context.Context) *ResourcePoliciesGetCall {
  120772. c.ctx_ = ctx
  120773. return c
  120774. }
  120775. // Header returns an http.Header that can be modified by the caller to
  120776. // add HTTP headers to the request.
  120777. func (c *ResourcePoliciesGetCall) Header() http.Header {
  120778. if c.header_ == nil {
  120779. c.header_ = make(http.Header)
  120780. }
  120781. return c.header_
  120782. }
  120783. func (c *ResourcePoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  120784. reqHeaders := make(http.Header)
  120785. for k, v := range c.header_ {
  120786. reqHeaders[k] = v
  120787. }
  120788. reqHeaders.Set("User-Agent", c.s.userAgent())
  120789. if c.ifNoneMatch_ != "" {
  120790. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  120791. }
  120792. var body io.Reader = nil
  120793. c.urlParams_.Set("alt", alt)
  120794. c.urlParams_.Set("prettyPrint", "false")
  120795. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  120796. urls += "?" + c.urlParams_.Encode()
  120797. req, err := http.NewRequest("GET", urls, body)
  120798. if err != nil {
  120799. return nil, err
  120800. }
  120801. req.Header = reqHeaders
  120802. googleapi.Expand(req.URL, map[string]string{
  120803. "project": c.project,
  120804. "region": c.region,
  120805. "resourcePolicy": c.resourcePolicy,
  120806. })
  120807. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120808. }
  120809. // Do executes the "compute.resourcePolicies.get" call.
  120810. // Exactly one of *ResourcePolicy or error will be non-nil. Any non-2xx
  120811. // status code is an error. Response headers are in either
  120812. // *ResourcePolicy.ServerResponse.Header or (if a response was returned
  120813. // at all) in error.(*googleapi.Error).Header. Use
  120814. // googleapi.IsNotModified to check whether the returned error was
  120815. // because http.StatusNotModified was returned.
  120816. func (c *ResourcePoliciesGetCall) Do(opts ...googleapi.CallOption) (*ResourcePolicy, error) {
  120817. gensupport.SetOptions(c.urlParams_, opts...)
  120818. res, err := c.doRequest("json")
  120819. if res != nil && res.StatusCode == http.StatusNotModified {
  120820. if res.Body != nil {
  120821. res.Body.Close()
  120822. }
  120823. return nil, &googleapi.Error{
  120824. Code: res.StatusCode,
  120825. Header: res.Header,
  120826. }
  120827. }
  120828. if err != nil {
  120829. return nil, err
  120830. }
  120831. defer googleapi.CloseBody(res)
  120832. if err := googleapi.CheckResponse(res); err != nil {
  120833. return nil, err
  120834. }
  120835. ret := &ResourcePolicy{
  120836. ServerResponse: googleapi.ServerResponse{
  120837. Header: res.Header,
  120838. HTTPStatusCode: res.StatusCode,
  120839. },
  120840. }
  120841. target := &ret
  120842. if err := gensupport.DecodeResponse(target, res); err != nil {
  120843. return nil, err
  120844. }
  120845. return ret, nil
  120846. // {
  120847. // "description": "Retrieves all information of the specified resource policy.",
  120848. // "httpMethod": "GET",
  120849. // "id": "compute.resourcePolicies.get",
  120850. // "parameterOrder": [
  120851. // "project",
  120852. // "region",
  120853. // "resourcePolicy"
  120854. // ],
  120855. // "parameters": {
  120856. // "project": {
  120857. // "description": "Project ID for this request.",
  120858. // "location": "path",
  120859. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120860. // "required": true,
  120861. // "type": "string"
  120862. // },
  120863. // "region": {
  120864. // "description": "Name of the region for this request.",
  120865. // "location": "path",
  120866. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120867. // "required": true,
  120868. // "type": "string"
  120869. // },
  120870. // "resourcePolicy": {
  120871. // "description": "Name of the resource policy to retrieve.",
  120872. // "location": "path",
  120873. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  120874. // "required": true,
  120875. // "type": "string"
  120876. // }
  120877. // },
  120878. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  120879. // "response": {
  120880. // "$ref": "ResourcePolicy"
  120881. // },
  120882. // "scopes": [
  120883. // "https://www.googleapis.com/auth/cloud-platform",
  120884. // "https://www.googleapis.com/auth/compute",
  120885. // "https://www.googleapis.com/auth/compute.readonly"
  120886. // ]
  120887. // }
  120888. }
  120889. // method id "compute.resourcePolicies.getIamPolicy":
  120890. type ResourcePoliciesGetIamPolicyCall struct {
  120891. s *Service
  120892. project string
  120893. region string
  120894. resource string
  120895. urlParams_ gensupport.URLParams
  120896. ifNoneMatch_ string
  120897. ctx_ context.Context
  120898. header_ http.Header
  120899. }
  120900. // GetIamPolicy: Gets the access control policy for a resource. May be
  120901. // empty if no such policy or resource exists.
  120902. func (r *ResourcePoliciesService) GetIamPolicy(project string, region string, resource string) *ResourcePoliciesGetIamPolicyCall {
  120903. c := &ResourcePoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120904. c.project = project
  120905. c.region = region
  120906. c.resource = resource
  120907. return c
  120908. }
  120909. // Fields allows partial responses to be retrieved. See
  120910. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120911. // for more information.
  120912. func (c *ResourcePoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetIamPolicyCall {
  120913. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120914. return c
  120915. }
  120916. // IfNoneMatch sets the optional parameter which makes the operation
  120917. // fail if the object's ETag matches the given value. This is useful for
  120918. // getting updates only after the object has changed since the last
  120919. // request. Use googleapi.IsNotModified to check whether the response
  120920. // error from Do is the result of In-None-Match.
  120921. func (c *ResourcePoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetIamPolicyCall {
  120922. c.ifNoneMatch_ = entityTag
  120923. return c
  120924. }
  120925. // Context sets the context to be used in this call's Do method. Any
  120926. // pending HTTP request will be aborted if the provided context is
  120927. // canceled.
  120928. func (c *ResourcePoliciesGetIamPolicyCall) Context(ctx context.Context) *ResourcePoliciesGetIamPolicyCall {
  120929. c.ctx_ = ctx
  120930. return c
  120931. }
  120932. // Header returns an http.Header that can be modified by the caller to
  120933. // add HTTP headers to the request.
  120934. func (c *ResourcePoliciesGetIamPolicyCall) Header() http.Header {
  120935. if c.header_ == nil {
  120936. c.header_ = make(http.Header)
  120937. }
  120938. return c.header_
  120939. }
  120940. func (c *ResourcePoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  120941. reqHeaders := make(http.Header)
  120942. for k, v := range c.header_ {
  120943. reqHeaders[k] = v
  120944. }
  120945. reqHeaders.Set("User-Agent", c.s.userAgent())
  120946. if c.ifNoneMatch_ != "" {
  120947. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  120948. }
  120949. var body io.Reader = nil
  120950. c.urlParams_.Set("alt", alt)
  120951. c.urlParams_.Set("prettyPrint", "false")
  120952. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy")
  120953. urls += "?" + c.urlParams_.Encode()
  120954. req, err := http.NewRequest("GET", urls, body)
  120955. if err != nil {
  120956. return nil, err
  120957. }
  120958. req.Header = reqHeaders
  120959. googleapi.Expand(req.URL, map[string]string{
  120960. "project": c.project,
  120961. "region": c.region,
  120962. "resource": c.resource,
  120963. })
  120964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120965. }
  120966. // Do executes the "compute.resourcePolicies.getIamPolicy" call.
  120967. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  120968. // code is an error. Response headers are in either
  120969. // *Policy.ServerResponse.Header or (if a response was returned at all)
  120970. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  120971. // check whether the returned error was because http.StatusNotModified
  120972. // was returned.
  120973. func (c *ResourcePoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  120974. gensupport.SetOptions(c.urlParams_, opts...)
  120975. res, err := c.doRequest("json")
  120976. if res != nil && res.StatusCode == http.StatusNotModified {
  120977. if res.Body != nil {
  120978. res.Body.Close()
  120979. }
  120980. return nil, &googleapi.Error{
  120981. Code: res.StatusCode,
  120982. Header: res.Header,
  120983. }
  120984. }
  120985. if err != nil {
  120986. return nil, err
  120987. }
  120988. defer googleapi.CloseBody(res)
  120989. if err := googleapi.CheckResponse(res); err != nil {
  120990. return nil, err
  120991. }
  120992. ret := &Policy{
  120993. ServerResponse: googleapi.ServerResponse{
  120994. Header: res.Header,
  120995. HTTPStatusCode: res.StatusCode,
  120996. },
  120997. }
  120998. target := &ret
  120999. if err := gensupport.DecodeResponse(target, res); err != nil {
  121000. return nil, err
  121001. }
  121002. return ret, nil
  121003. // {
  121004. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  121005. // "httpMethod": "GET",
  121006. // "id": "compute.resourcePolicies.getIamPolicy",
  121007. // "parameterOrder": [
  121008. // "project",
  121009. // "region",
  121010. // "resource"
  121011. // ],
  121012. // "parameters": {
  121013. // "project": {
  121014. // "description": "Project ID for this request.",
  121015. // "location": "path",
  121016. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121017. // "required": true,
  121018. // "type": "string"
  121019. // },
  121020. // "region": {
  121021. // "description": "The name of the region for this request.",
  121022. // "location": "path",
  121023. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121024. // "required": true,
  121025. // "type": "string"
  121026. // },
  121027. // "resource": {
  121028. // "description": "Name or id of the resource for this request.",
  121029. // "location": "path",
  121030. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  121031. // "required": true,
  121032. // "type": "string"
  121033. // }
  121034. // },
  121035. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy",
  121036. // "response": {
  121037. // "$ref": "Policy"
  121038. // },
  121039. // "scopes": [
  121040. // "https://www.googleapis.com/auth/cloud-platform",
  121041. // "https://www.googleapis.com/auth/compute",
  121042. // "https://www.googleapis.com/auth/compute.readonly"
  121043. // ]
  121044. // }
  121045. }
  121046. // method id "compute.resourcePolicies.insert":
  121047. type ResourcePoliciesInsertCall struct {
  121048. s *Service
  121049. project string
  121050. region string
  121051. resourcepolicy *ResourcePolicy
  121052. urlParams_ gensupport.URLParams
  121053. ctx_ context.Context
  121054. header_ http.Header
  121055. }
  121056. // Insert: Creates a new resource policy.
  121057. func (r *ResourcePoliciesService) Insert(project string, region string, resourcepolicy *ResourcePolicy) *ResourcePoliciesInsertCall {
  121058. c := &ResourcePoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121059. c.project = project
  121060. c.region = region
  121061. c.resourcepolicy = resourcepolicy
  121062. return c
  121063. }
  121064. // RequestId sets the optional parameter "requestId": An optional
  121065. // request ID to identify requests. Specify a unique request ID so that
  121066. // if you must retry your request, the server will know to ignore the
  121067. // request if it has already been completed.
  121068. //
  121069. // For example, consider a situation where you make an initial request
  121070. // and the request times out. If you make the request again with the
  121071. // same request ID, the server can check if original operation with the
  121072. // same request ID was received, and if so, will ignore the second
  121073. // request. This prevents clients from accidentally creating duplicate
  121074. // commitments.
  121075. //
  121076. // The request ID must be a valid UUID with the exception that zero UUID
  121077. // is not supported (00000000-0000-0000-0000-000000000000).
  121078. func (c *ResourcePoliciesInsertCall) RequestId(requestId string) *ResourcePoliciesInsertCall {
  121079. c.urlParams_.Set("requestId", requestId)
  121080. return c
  121081. }
  121082. // Fields allows partial responses to be retrieved. See
  121083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121084. // for more information.
  121085. func (c *ResourcePoliciesInsertCall) Fields(s ...googleapi.Field) *ResourcePoliciesInsertCall {
  121086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121087. return c
  121088. }
  121089. // Context sets the context to be used in this call's Do method. Any
  121090. // pending HTTP request will be aborted if the provided context is
  121091. // canceled.
  121092. func (c *ResourcePoliciesInsertCall) Context(ctx context.Context) *ResourcePoliciesInsertCall {
  121093. c.ctx_ = ctx
  121094. return c
  121095. }
  121096. // Header returns an http.Header that can be modified by the caller to
  121097. // add HTTP headers to the request.
  121098. func (c *ResourcePoliciesInsertCall) Header() http.Header {
  121099. if c.header_ == nil {
  121100. c.header_ = make(http.Header)
  121101. }
  121102. return c.header_
  121103. }
  121104. func (c *ResourcePoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  121105. reqHeaders := make(http.Header)
  121106. for k, v := range c.header_ {
  121107. reqHeaders[k] = v
  121108. }
  121109. reqHeaders.Set("User-Agent", c.s.userAgent())
  121110. var body io.Reader = nil
  121111. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy)
  121112. if err != nil {
  121113. return nil, err
  121114. }
  121115. reqHeaders.Set("Content-Type", "application/json")
  121116. c.urlParams_.Set("alt", alt)
  121117. c.urlParams_.Set("prettyPrint", "false")
  121118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  121119. urls += "?" + c.urlParams_.Encode()
  121120. req, err := http.NewRequest("POST", urls, body)
  121121. if err != nil {
  121122. return nil, err
  121123. }
  121124. req.Header = reqHeaders
  121125. googleapi.Expand(req.URL, map[string]string{
  121126. "project": c.project,
  121127. "region": c.region,
  121128. })
  121129. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121130. }
  121131. // Do executes the "compute.resourcePolicies.insert" call.
  121132. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  121133. // status code is an error. Response headers are in either
  121134. // *Operation.ServerResponse.Header or (if a response was returned at
  121135. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  121136. // to check whether the returned error was because
  121137. // http.StatusNotModified was returned.
  121138. func (c *ResourcePoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  121139. gensupport.SetOptions(c.urlParams_, opts...)
  121140. res, err := c.doRequest("json")
  121141. if res != nil && res.StatusCode == http.StatusNotModified {
  121142. if res.Body != nil {
  121143. res.Body.Close()
  121144. }
  121145. return nil, &googleapi.Error{
  121146. Code: res.StatusCode,
  121147. Header: res.Header,
  121148. }
  121149. }
  121150. if err != nil {
  121151. return nil, err
  121152. }
  121153. defer googleapi.CloseBody(res)
  121154. if err := googleapi.CheckResponse(res); err != nil {
  121155. return nil, err
  121156. }
  121157. ret := &Operation{
  121158. ServerResponse: googleapi.ServerResponse{
  121159. Header: res.Header,
  121160. HTTPStatusCode: res.StatusCode,
  121161. },
  121162. }
  121163. target := &ret
  121164. if err := gensupport.DecodeResponse(target, res); err != nil {
  121165. return nil, err
  121166. }
  121167. return ret, nil
  121168. // {
  121169. // "description": "Creates a new resource policy.",
  121170. // "httpMethod": "POST",
  121171. // "id": "compute.resourcePolicies.insert",
  121172. // "parameterOrder": [
  121173. // "project",
  121174. // "region"
  121175. // ],
  121176. // "parameters": {
  121177. // "project": {
  121178. // "description": "Project ID for this request.",
  121179. // "location": "path",
  121180. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121181. // "required": true,
  121182. // "type": "string"
  121183. // },
  121184. // "region": {
  121185. // "description": "Name of the region for this request.",
  121186. // "location": "path",
  121187. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121188. // "required": true,
  121189. // "type": "string"
  121190. // },
  121191. // "requestId": {
  121192. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  121193. // "location": "query",
  121194. // "type": "string"
  121195. // }
  121196. // },
  121197. // "path": "{project}/regions/{region}/resourcePolicies",
  121198. // "request": {
  121199. // "$ref": "ResourcePolicy"
  121200. // },
  121201. // "response": {
  121202. // "$ref": "Operation"
  121203. // },
  121204. // "scopes": [
  121205. // "https://www.googleapis.com/auth/cloud-platform",
  121206. // "https://www.googleapis.com/auth/compute"
  121207. // ]
  121208. // }
  121209. }
  121210. // method id "compute.resourcePolicies.list":
  121211. type ResourcePoliciesListCall struct {
  121212. s *Service
  121213. project string
  121214. region string
  121215. urlParams_ gensupport.URLParams
  121216. ifNoneMatch_ string
  121217. ctx_ context.Context
  121218. header_ http.Header
  121219. }
  121220. // List: A list all the resource policies that have been configured for
  121221. // the specified project in specified region.
  121222. func (r *ResourcePoliciesService) List(project string, region string) *ResourcePoliciesListCall {
  121223. c := &ResourcePoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121224. c.project = project
  121225. c.region = region
  121226. return c
  121227. }
  121228. // Filter sets the optional parameter "filter": A filter expression that
  121229. // filters resources listed in the response. The expression must specify
  121230. // the field name, a comparison operator, and the value that you want to
  121231. // use for filtering. The value must be a string, a number, or a
  121232. // boolean. The comparison operator must be either =, !=, >, or <.
  121233. //
  121234. // For example, if you are filtering Compute Engine instances, you can
  121235. // exclude instances named example-instance by specifying name !=
  121236. // example-instance.
  121237. //
  121238. // You can also filter nested fields. For example, you could specify
  121239. // scheduling.automaticRestart = false to include instances only if they
  121240. // are not scheduled for automatic restarts. You can use filtering on
  121241. // nested fields to filter based on resource labels.
  121242. //
  121243. // To filter on multiple expressions, provide each separate expression
  121244. // within parentheses. For example, (scheduling.automaticRestart = true)
  121245. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  121246. // AND expression. However, you can include AND and OR expressions
  121247. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  121248. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  121249. // true).
  121250. func (c *ResourcePoliciesListCall) Filter(filter string) *ResourcePoliciesListCall {
  121251. c.urlParams_.Set("filter", filter)
  121252. return c
  121253. }
  121254. // MaxResults sets the optional parameter "maxResults": The maximum
  121255. // number of results per page that should be returned. If the number of
  121256. // available results is larger than maxResults, Compute Engine returns a
  121257. // nextPageToken that can be used to get the next page of results in
  121258. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  121259. // (Default: 500)
  121260. func (c *ResourcePoliciesListCall) MaxResults(maxResults int64) *ResourcePoliciesListCall {
  121261. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  121262. return c
  121263. }
  121264. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  121265. // a certain order. By default, results are returned in alphanumerical
  121266. // order based on the resource name.
  121267. //
  121268. // You can also sort results in descending order based on the creation
  121269. // timestamp using orderBy="creationTimestamp desc". This sorts results
  121270. // based on the creationTimestamp field in reverse chronological order
  121271. // (newest result first). Use this to sort resources like operations so
  121272. // that the newest operation is returned first.
  121273. //
  121274. // Currently, only sorting by name or creationTimestamp desc is
  121275. // supported.
  121276. func (c *ResourcePoliciesListCall) OrderBy(orderBy string) *ResourcePoliciesListCall {
  121277. c.urlParams_.Set("orderBy", orderBy)
  121278. return c
  121279. }
  121280. // PageToken sets the optional parameter "pageToken": Specifies a page
  121281. // token to use. Set pageToken to the nextPageToken returned by a
  121282. // previous list request to get the next page of results.
  121283. func (c *ResourcePoliciesListCall) PageToken(pageToken string) *ResourcePoliciesListCall {
  121284. c.urlParams_.Set("pageToken", pageToken)
  121285. return c
  121286. }
  121287. // Fields allows partial responses to be retrieved. See
  121288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121289. // for more information.
  121290. func (c *ResourcePoliciesListCall) Fields(s ...googleapi.Field) *ResourcePoliciesListCall {
  121291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121292. return c
  121293. }
  121294. // IfNoneMatch sets the optional parameter which makes the operation
  121295. // fail if the object's ETag matches the given value. This is useful for
  121296. // getting updates only after the object has changed since the last
  121297. // request. Use googleapi.IsNotModified to check whether the response
  121298. // error from Do is the result of In-None-Match.
  121299. func (c *ResourcePoliciesListCall) IfNoneMatch(entityTag string) *ResourcePoliciesListCall {
  121300. c.ifNoneMatch_ = entityTag
  121301. return c
  121302. }
  121303. // Context sets the context to be used in this call's Do method. Any
  121304. // pending HTTP request will be aborted if the provided context is
  121305. // canceled.
  121306. func (c *ResourcePoliciesListCall) Context(ctx context.Context) *ResourcePoliciesListCall {
  121307. c.ctx_ = ctx
  121308. return c
  121309. }
  121310. // Header returns an http.Header that can be modified by the caller to
  121311. // add HTTP headers to the request.
  121312. func (c *ResourcePoliciesListCall) Header() http.Header {
  121313. if c.header_ == nil {
  121314. c.header_ = make(http.Header)
  121315. }
  121316. return c.header_
  121317. }
  121318. func (c *ResourcePoliciesListCall) doRequest(alt string) (*http.Response, error) {
  121319. reqHeaders := make(http.Header)
  121320. for k, v := range c.header_ {
  121321. reqHeaders[k] = v
  121322. }
  121323. reqHeaders.Set("User-Agent", c.s.userAgent())
  121324. if c.ifNoneMatch_ != "" {
  121325. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  121326. }
  121327. var body io.Reader = nil
  121328. c.urlParams_.Set("alt", alt)
  121329. c.urlParams_.Set("prettyPrint", "false")
  121330. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  121331. urls += "?" + c.urlParams_.Encode()
  121332. req, err := http.NewRequest("GET", urls, body)
  121333. if err != nil {
  121334. return nil, err
  121335. }
  121336. req.Header = reqHeaders
  121337. googleapi.Expand(req.URL, map[string]string{
  121338. "project": c.project,
  121339. "region": c.region,
  121340. })
  121341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121342. }
  121343. // Do executes the "compute.resourcePolicies.list" call.
  121344. // Exactly one of *ResourcePolicyList or error will be non-nil. Any
  121345. // non-2xx status code is an error. Response headers are in either
  121346. // *ResourcePolicyList.ServerResponse.Header or (if a response was
  121347. // returned at all) in error.(*googleapi.Error).Header. Use
  121348. // googleapi.IsNotModified to check whether the returned error was
  121349. // because http.StatusNotModified was returned.
  121350. func (c *ResourcePoliciesListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyList, error) {
  121351. gensupport.SetOptions(c.urlParams_, opts...)
  121352. res, err := c.doRequest("json")
  121353. if res != nil && res.StatusCode == http.StatusNotModified {
  121354. if res.Body != nil {
  121355. res.Body.Close()
  121356. }
  121357. return nil, &googleapi.Error{
  121358. Code: res.StatusCode,
  121359. Header: res.Header,
  121360. }
  121361. }
  121362. if err != nil {
  121363. return nil, err
  121364. }
  121365. defer googleapi.CloseBody(res)
  121366. if err := googleapi.CheckResponse(res); err != nil {
  121367. return nil, err
  121368. }
  121369. ret := &ResourcePolicyList{
  121370. ServerResponse: googleapi.ServerResponse{
  121371. Header: res.Header,
  121372. HTTPStatusCode: res.StatusCode,
  121373. },
  121374. }
  121375. target := &ret
  121376. if err := gensupport.DecodeResponse(target, res); err != nil {
  121377. return nil, err
  121378. }
  121379. return ret, nil
  121380. // {
  121381. // "description": "A list all the resource policies that have been configured for the specified project in specified region.",
  121382. // "httpMethod": "GET",
  121383. // "id": "compute.resourcePolicies.list",
  121384. // "parameterOrder": [
  121385. // "project",
  121386. // "region"
  121387. // ],
  121388. // "parameters": {
  121389. // "filter": {
  121390. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  121391. // "location": "query",
  121392. // "type": "string"
  121393. // },
  121394. // "maxResults": {
  121395. // "default": "500",
  121396. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  121397. // "format": "uint32",
  121398. // "location": "query",
  121399. // "minimum": "0",
  121400. // "type": "integer"
  121401. // },
  121402. // "orderBy": {
  121403. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  121404. // "location": "query",
  121405. // "type": "string"
  121406. // },
  121407. // "pageToken": {
  121408. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  121409. // "location": "query",
  121410. // "type": "string"
  121411. // },
  121412. // "project": {
  121413. // "description": "Project ID for this request.",
  121414. // "location": "path",
  121415. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121416. // "required": true,
  121417. // "type": "string"
  121418. // },
  121419. // "region": {
  121420. // "description": "Name of the region for this request.",
  121421. // "location": "path",
  121422. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121423. // "required": true,
  121424. // "type": "string"
  121425. // }
  121426. // },
  121427. // "path": "{project}/regions/{region}/resourcePolicies",
  121428. // "response": {
  121429. // "$ref": "ResourcePolicyList"
  121430. // },
  121431. // "scopes": [
  121432. // "https://www.googleapis.com/auth/cloud-platform",
  121433. // "https://www.googleapis.com/auth/compute",
  121434. // "https://www.googleapis.com/auth/compute.readonly"
  121435. // ]
  121436. // }
  121437. }
  121438. // Pages invokes f for each page of results.
  121439. // A non-nil error returned from f will halt the iteration.
  121440. // The provided context supersedes any context provided to the Context method.
  121441. func (c *ResourcePoliciesListCall) Pages(ctx context.Context, f func(*ResourcePolicyList) error) error {
  121442. c.ctx_ = ctx
  121443. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  121444. for {
  121445. x, err := c.Do()
  121446. if err != nil {
  121447. return err
  121448. }
  121449. if err := f(x); err != nil {
  121450. return err
  121451. }
  121452. if x.NextPageToken == "" {
  121453. return nil
  121454. }
  121455. c.PageToken(x.NextPageToken)
  121456. }
  121457. }
  121458. // method id "compute.resourcePolicies.setIamPolicy":
  121459. type ResourcePoliciesSetIamPolicyCall struct {
  121460. s *Service
  121461. project string
  121462. region string
  121463. resource string
  121464. regionsetpolicyrequest *RegionSetPolicyRequest
  121465. urlParams_ gensupport.URLParams
  121466. ctx_ context.Context
  121467. header_ http.Header
  121468. }
  121469. // SetIamPolicy: Sets the access control policy on the specified
  121470. // resource. Replaces any existing policy.
  121471. func (r *ResourcePoliciesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *ResourcePoliciesSetIamPolicyCall {
  121472. c := &ResourcePoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121473. c.project = project
  121474. c.region = region
  121475. c.resource = resource
  121476. c.regionsetpolicyrequest = regionsetpolicyrequest
  121477. return c
  121478. }
  121479. // Fields allows partial responses to be retrieved. See
  121480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121481. // for more information.
  121482. func (c *ResourcePoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ResourcePoliciesSetIamPolicyCall {
  121483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121484. return c
  121485. }
  121486. // Context sets the context to be used in this call's Do method. Any
  121487. // pending HTTP request will be aborted if the provided context is
  121488. // canceled.
  121489. func (c *ResourcePoliciesSetIamPolicyCall) Context(ctx context.Context) *ResourcePoliciesSetIamPolicyCall {
  121490. c.ctx_ = ctx
  121491. return c
  121492. }
  121493. // Header returns an http.Header that can be modified by the caller to
  121494. // add HTTP headers to the request.
  121495. func (c *ResourcePoliciesSetIamPolicyCall) Header() http.Header {
  121496. if c.header_ == nil {
  121497. c.header_ = make(http.Header)
  121498. }
  121499. return c.header_
  121500. }
  121501. func (c *ResourcePoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  121502. reqHeaders := make(http.Header)
  121503. for k, v := range c.header_ {
  121504. reqHeaders[k] = v
  121505. }
  121506. reqHeaders.Set("User-Agent", c.s.userAgent())
  121507. var body io.Reader = nil
  121508. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  121509. if err != nil {
  121510. return nil, err
  121511. }
  121512. reqHeaders.Set("Content-Type", "application/json")
  121513. c.urlParams_.Set("alt", alt)
  121514. c.urlParams_.Set("prettyPrint", "false")
  121515. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy")
  121516. urls += "?" + c.urlParams_.Encode()
  121517. req, err := http.NewRequest("POST", urls, body)
  121518. if err != nil {
  121519. return nil, err
  121520. }
  121521. req.Header = reqHeaders
  121522. googleapi.Expand(req.URL, map[string]string{
  121523. "project": c.project,
  121524. "region": c.region,
  121525. "resource": c.resource,
  121526. })
  121527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121528. }
  121529. // Do executes the "compute.resourcePolicies.setIamPolicy" call.
  121530. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  121531. // code is an error. Response headers are in either
  121532. // *Policy.ServerResponse.Header or (if a response was returned at all)
  121533. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  121534. // check whether the returned error was because http.StatusNotModified
  121535. // was returned.
  121536. func (c *ResourcePoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  121537. gensupport.SetOptions(c.urlParams_, opts...)
  121538. res, err := c.doRequest("json")
  121539. if res != nil && res.StatusCode == http.StatusNotModified {
  121540. if res.Body != nil {
  121541. res.Body.Close()
  121542. }
  121543. return nil, &googleapi.Error{
  121544. Code: res.StatusCode,
  121545. Header: res.Header,
  121546. }
  121547. }
  121548. if err != nil {
  121549. return nil, err
  121550. }
  121551. defer googleapi.CloseBody(res)
  121552. if err := googleapi.CheckResponse(res); err != nil {
  121553. return nil, err
  121554. }
  121555. ret := &Policy{
  121556. ServerResponse: googleapi.ServerResponse{
  121557. Header: res.Header,
  121558. HTTPStatusCode: res.StatusCode,
  121559. },
  121560. }
  121561. target := &ret
  121562. if err := gensupport.DecodeResponse(target, res); err != nil {
  121563. return nil, err
  121564. }
  121565. return ret, nil
  121566. // {
  121567. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  121568. // "httpMethod": "POST",
  121569. // "id": "compute.resourcePolicies.setIamPolicy",
  121570. // "parameterOrder": [
  121571. // "project",
  121572. // "region",
  121573. // "resource"
  121574. // ],
  121575. // "parameters": {
  121576. // "project": {
  121577. // "description": "Project ID for this request.",
  121578. // "location": "path",
  121579. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121580. // "required": true,
  121581. // "type": "string"
  121582. // },
  121583. // "region": {
  121584. // "description": "The name of the region for this request.",
  121585. // "location": "path",
  121586. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121587. // "required": true,
  121588. // "type": "string"
  121589. // },
  121590. // "resource": {
  121591. // "description": "Name or id of the resource for this request.",
  121592. // "location": "path",
  121593. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  121594. // "required": true,
  121595. // "type": "string"
  121596. // }
  121597. // },
  121598. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy",
  121599. // "request": {
  121600. // "$ref": "RegionSetPolicyRequest"
  121601. // },
  121602. // "response": {
  121603. // "$ref": "Policy"
  121604. // },
  121605. // "scopes": [
  121606. // "https://www.googleapis.com/auth/cloud-platform",
  121607. // "https://www.googleapis.com/auth/compute"
  121608. // ]
  121609. // }
  121610. }
  121611. // method id "compute.resourcePolicies.testIamPermissions":
  121612. type ResourcePoliciesTestIamPermissionsCall struct {
  121613. s *Service
  121614. project string
  121615. region string
  121616. resource string
  121617. testpermissionsrequest *TestPermissionsRequest
  121618. urlParams_ gensupport.URLParams
  121619. ctx_ context.Context
  121620. header_ http.Header
  121621. }
  121622. // TestIamPermissions: Returns permissions that a caller has on the
  121623. // specified resource.
  121624. func (r *ResourcePoliciesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ResourcePoliciesTestIamPermissionsCall {
  121625. c := &ResourcePoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121626. c.project = project
  121627. c.region = region
  121628. c.resource = resource
  121629. c.testpermissionsrequest = testpermissionsrequest
  121630. return c
  121631. }
  121632. // Fields allows partial responses to be retrieved. See
  121633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121634. // for more information.
  121635. func (c *ResourcePoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ResourcePoliciesTestIamPermissionsCall {
  121636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121637. return c
  121638. }
  121639. // Context sets the context to be used in this call's Do method. Any
  121640. // pending HTTP request will be aborted if the provided context is
  121641. // canceled.
  121642. func (c *ResourcePoliciesTestIamPermissionsCall) Context(ctx context.Context) *ResourcePoliciesTestIamPermissionsCall {
  121643. c.ctx_ = ctx
  121644. return c
  121645. }
  121646. // Header returns an http.Header that can be modified by the caller to
  121647. // add HTTP headers to the request.
  121648. func (c *ResourcePoliciesTestIamPermissionsCall) Header() http.Header {
  121649. if c.header_ == nil {
  121650. c.header_ = make(http.Header)
  121651. }
  121652. return c.header_
  121653. }
  121654. func (c *ResourcePoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  121655. reqHeaders := make(http.Header)
  121656. for k, v := range c.header_ {
  121657. reqHeaders[k] = v
  121658. }
  121659. reqHeaders.Set("User-Agent", c.s.userAgent())
  121660. var body io.Reader = nil
  121661. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  121662. if err != nil {
  121663. return nil, err
  121664. }
  121665. reqHeaders.Set("Content-Type", "application/json")
  121666. c.urlParams_.Set("alt", alt)
  121667. c.urlParams_.Set("prettyPrint", "false")
  121668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions")
  121669. urls += "?" + c.urlParams_.Encode()
  121670. req, err := http.NewRequest("POST", urls, body)
  121671. if err != nil {
  121672. return nil, err
  121673. }
  121674. req.Header = reqHeaders
  121675. googleapi.Expand(req.URL, map[string]string{
  121676. "project": c.project,
  121677. "region": c.region,
  121678. "resource": c.resource,
  121679. })
  121680. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121681. }
  121682. // Do executes the "compute.resourcePolicies.testIamPermissions" call.
  121683. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  121684. // non-2xx status code is an error. Response headers are in either
  121685. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  121686. // returned at all) in error.(*googleapi.Error).Header. Use
  121687. // googleapi.IsNotModified to check whether the returned error was
  121688. // because http.StatusNotModified was returned.
  121689. func (c *ResourcePoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  121690. gensupport.SetOptions(c.urlParams_, opts...)
  121691. res, err := c.doRequest("json")
  121692. if res != nil && res.StatusCode == http.StatusNotModified {
  121693. if res.Body != nil {
  121694. res.Body.Close()
  121695. }
  121696. return nil, &googleapi.Error{
  121697. Code: res.StatusCode,
  121698. Header: res.Header,
  121699. }
  121700. }
  121701. if err != nil {
  121702. return nil, err
  121703. }
  121704. defer googleapi.CloseBody(res)
  121705. if err := googleapi.CheckResponse(res); err != nil {
  121706. return nil, err
  121707. }
  121708. ret := &TestPermissionsResponse{
  121709. ServerResponse: googleapi.ServerResponse{
  121710. Header: res.Header,
  121711. HTTPStatusCode: res.StatusCode,
  121712. },
  121713. }
  121714. target := &ret
  121715. if err := gensupport.DecodeResponse(target, res); err != nil {
  121716. return nil, err
  121717. }
  121718. return ret, nil
  121719. // {
  121720. // "description": "Returns permissions that a caller has on the specified resource.",
  121721. // "httpMethod": "POST",
  121722. // "id": "compute.resourcePolicies.testIamPermissions",
  121723. // "parameterOrder": [
  121724. // "project",
  121725. // "region",
  121726. // "resource"
  121727. // ],
  121728. // "parameters": {
  121729. // "project": {
  121730. // "description": "Project ID for this request.",
  121731. // "location": "path",
  121732. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121733. // "required": true,
  121734. // "type": "string"
  121735. // },
  121736. // "region": {
  121737. // "description": "The name of the region for this request.",
  121738. // "location": "path",
  121739. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121740. // "required": true,
  121741. // "type": "string"
  121742. // },
  121743. // "resource": {
  121744. // "description": "Name or id of the resource for this request.",
  121745. // "location": "path",
  121746. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  121747. // "required": true,
  121748. // "type": "string"
  121749. // }
  121750. // },
  121751. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions",
  121752. // "request": {
  121753. // "$ref": "TestPermissionsRequest"
  121754. // },
  121755. // "response": {
  121756. // "$ref": "TestPermissionsResponse"
  121757. // },
  121758. // "scopes": [
  121759. // "https://www.googleapis.com/auth/cloud-platform",
  121760. // "https://www.googleapis.com/auth/compute",
  121761. // "https://www.googleapis.com/auth/compute.readonly"
  121762. // ]
  121763. // }
  121764. }
  121765. // method id "compute.routers.aggregatedList":
  121766. type RoutersAggregatedListCall struct {
  121767. s *Service
  121768. project string
  121769. urlParams_ gensupport.URLParams
  121770. ifNoneMatch_ string
  121771. ctx_ context.Context
  121772. header_ http.Header
  121773. }
  121774. // AggregatedList: Retrieves an aggregated list of routers.
  121775. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  121776. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121777. c.project = project
  121778. return c
  121779. }
  121780. // Filter sets the optional parameter "filter": A filter expression that
  121781. // filters resources listed in the response. The expression must specify
  121782. // the field name, a comparison operator, and the value that you want to
  121783. // use for filtering. The value must be a string, a number, or a
  121784. // boolean. The comparison operator must be either =, !=, >, or <.
  121785. //
  121786. // For example, if you are filtering Compute Engine instances, you can
  121787. // exclude instances named example-instance by specifying name !=
  121788. // example-instance.
  121789. //
  121790. // You can also filter nested fields. For example, you could specify
  121791. // scheduling.automaticRestart = false to include instances only if they
  121792. // are not scheduled for automatic restarts. You can use filtering on
  121793. // nested fields to filter based on resource labels.
  121794. //
  121795. // To filter on multiple expressions, provide each separate expression
  121796. // within parentheses. For example, (scheduling.automaticRestart = true)
  121797. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  121798. // AND expression. However, you can include AND and OR expressions
  121799. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  121800. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  121801. // true).
  121802. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  121803. c.urlParams_.Set("filter", filter)
  121804. return c
  121805. }
  121806. // MaxResults sets the optional parameter "maxResults": The maximum
  121807. // number of results per page that should be returned. If the number of
  121808. // available results is larger than maxResults, Compute Engine returns a
  121809. // nextPageToken that can be used to get the next page of results in
  121810. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  121811. // (Default: 500)
  121812. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  121813. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  121814. return c
  121815. }
  121816. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  121817. // a certain order. By default, results are returned in alphanumerical
  121818. // order based on the resource name.
  121819. //
  121820. // You can also sort results in descending order based on the creation
  121821. // timestamp using orderBy="creationTimestamp desc". This sorts results
  121822. // based on the creationTimestamp field in reverse chronological order
  121823. // (newest result first). Use this to sort resources like operations so
  121824. // that the newest operation is returned first.
  121825. //
  121826. // Currently, only sorting by name or creationTimestamp desc is
  121827. // supported.
  121828. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  121829. c.urlParams_.Set("orderBy", orderBy)
  121830. return c
  121831. }
  121832. // PageToken sets the optional parameter "pageToken": Specifies a page
  121833. // token to use. Set pageToken to the nextPageToken returned by a
  121834. // previous list request to get the next page of results.
  121835. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  121836. c.urlParams_.Set("pageToken", pageToken)
  121837. return c
  121838. }
  121839. // Fields allows partial responses to be retrieved. See
  121840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121841. // for more information.
  121842. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  121843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121844. return c
  121845. }
  121846. // IfNoneMatch sets the optional parameter which makes the operation
  121847. // fail if the object's ETag matches the given value. This is useful for
  121848. // getting updates only after the object has changed since the last
  121849. // request. Use googleapi.IsNotModified to check whether the response
  121850. // error from Do is the result of In-None-Match.
  121851. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  121852. c.ifNoneMatch_ = entityTag
  121853. return c
  121854. }
  121855. // Context sets the context to be used in this call's Do method. Any
  121856. // pending HTTP request will be aborted if the provided context is
  121857. // canceled.
  121858. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  121859. c.ctx_ = ctx
  121860. return c
  121861. }
  121862. // Header returns an http.Header that can be modified by the caller to
  121863. // add HTTP headers to the request.
  121864. func (c *RoutersAggregatedListCall) Header() http.Header {
  121865. if c.header_ == nil {
  121866. c.header_ = make(http.Header)
  121867. }
  121868. return c.header_
  121869. }
  121870. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  121871. reqHeaders := make(http.Header)
  121872. for k, v := range c.header_ {
  121873. reqHeaders[k] = v
  121874. }
  121875. reqHeaders.Set("User-Agent", c.s.userAgent())
  121876. if c.ifNoneMatch_ != "" {
  121877. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  121878. }
  121879. var body io.Reader = nil
  121880. c.urlParams_.Set("alt", alt)
  121881. c.urlParams_.Set("prettyPrint", "false")
  121882. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  121883. urls += "?" + c.urlParams_.Encode()
  121884. req, err := http.NewRequest("GET", urls, body)
  121885. if err != nil {
  121886. return nil, err
  121887. }
  121888. req.Header = reqHeaders
  121889. googleapi.Expand(req.URL, map[string]string{
  121890. "project": c.project,
  121891. })
  121892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121893. }
  121894. // Do executes the "compute.routers.aggregatedList" call.
  121895. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  121896. // non-2xx status code is an error. Response headers are in either
  121897. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  121898. // returned at all) in error.(*googleapi.Error).Header. Use
  121899. // googleapi.IsNotModified to check whether the returned error was
  121900. // because http.StatusNotModified was returned.
  121901. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  121902. gensupport.SetOptions(c.urlParams_, opts...)
  121903. res, err := c.doRequest("json")
  121904. if res != nil && res.StatusCode == http.StatusNotModified {
  121905. if res.Body != nil {
  121906. res.Body.Close()
  121907. }
  121908. return nil, &googleapi.Error{
  121909. Code: res.StatusCode,
  121910. Header: res.Header,
  121911. }
  121912. }
  121913. if err != nil {
  121914. return nil, err
  121915. }
  121916. defer googleapi.CloseBody(res)
  121917. if err := googleapi.CheckResponse(res); err != nil {
  121918. return nil, err
  121919. }
  121920. ret := &RouterAggregatedList{
  121921. ServerResponse: googleapi.ServerResponse{
  121922. Header: res.Header,
  121923. HTTPStatusCode: res.StatusCode,
  121924. },
  121925. }
  121926. target := &ret
  121927. if err := gensupport.DecodeResponse(target, res); err != nil {
  121928. return nil, err
  121929. }
  121930. return ret, nil
  121931. // {
  121932. // "description": "Retrieves an aggregated list of routers.",
  121933. // "httpMethod": "GET",
  121934. // "id": "compute.routers.aggregatedList",
  121935. // "parameterOrder": [
  121936. // "project"
  121937. // ],
  121938. // "parameters": {
  121939. // "filter": {
  121940. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  121941. // "location": "query",
  121942. // "type": "string"
  121943. // },
  121944. // "maxResults": {
  121945. // "default": "500",
  121946. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  121947. // "format": "uint32",
  121948. // "location": "query",
  121949. // "minimum": "0",
  121950. // "type": "integer"
  121951. // },
  121952. // "orderBy": {
  121953. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  121954. // "location": "query",
  121955. // "type": "string"
  121956. // },
  121957. // "pageToken": {
  121958. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  121959. // "location": "query",
  121960. // "type": "string"
  121961. // },
  121962. // "project": {
  121963. // "description": "Project ID for this request.",
  121964. // "location": "path",
  121965. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121966. // "required": true,
  121967. // "type": "string"
  121968. // }
  121969. // },
  121970. // "path": "{project}/aggregated/routers",
  121971. // "response": {
  121972. // "$ref": "RouterAggregatedList"
  121973. // },
  121974. // "scopes": [
  121975. // "https://www.googleapis.com/auth/cloud-platform",
  121976. // "https://www.googleapis.com/auth/compute",
  121977. // "https://www.googleapis.com/auth/compute.readonly"
  121978. // ]
  121979. // }
  121980. }
  121981. // Pages invokes f for each page of results.
  121982. // A non-nil error returned from f will halt the iteration.
  121983. // The provided context supersedes any context provided to the Context method.
  121984. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  121985. c.ctx_ = ctx
  121986. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  121987. for {
  121988. x, err := c.Do()
  121989. if err != nil {
  121990. return err
  121991. }
  121992. if err := f(x); err != nil {
  121993. return err
  121994. }
  121995. if x.NextPageToken == "" {
  121996. return nil
  121997. }
  121998. c.PageToken(x.NextPageToken)
  121999. }
  122000. }
  122001. // method id "compute.routers.delete":
  122002. type RoutersDeleteCall struct {
  122003. s *Service
  122004. project string
  122005. region string
  122006. router string
  122007. urlParams_ gensupport.URLParams
  122008. ctx_ context.Context
  122009. header_ http.Header
  122010. }
  122011. // Delete: Deletes the specified Router resource.
  122012. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  122013. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122014. c.project = project
  122015. c.region = region
  122016. c.router = router
  122017. return c
  122018. }
  122019. // RequestId sets the optional parameter "requestId": An optional
  122020. // request ID to identify requests. Specify a unique request ID so that
  122021. // if you must retry your request, the server will know to ignore the
  122022. // request if it has already been completed.
  122023. //
  122024. // For example, consider a situation where you make an initial request
  122025. // and the request times out. If you make the request again with the
  122026. // same request ID, the server can check if original operation with the
  122027. // same request ID was received, and if so, will ignore the second
  122028. // request. This prevents clients from accidentally creating duplicate
  122029. // commitments.
  122030. //
  122031. // The request ID must be a valid UUID with the exception that zero UUID
  122032. // is not supported (00000000-0000-0000-0000-000000000000).
  122033. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  122034. c.urlParams_.Set("requestId", requestId)
  122035. return c
  122036. }
  122037. // Fields allows partial responses to be retrieved. See
  122038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122039. // for more information.
  122040. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  122041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122042. return c
  122043. }
  122044. // Context sets the context to be used in this call's Do method. Any
  122045. // pending HTTP request will be aborted if the provided context is
  122046. // canceled.
  122047. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  122048. c.ctx_ = ctx
  122049. return c
  122050. }
  122051. // Header returns an http.Header that can be modified by the caller to
  122052. // add HTTP headers to the request.
  122053. func (c *RoutersDeleteCall) Header() http.Header {
  122054. if c.header_ == nil {
  122055. c.header_ = make(http.Header)
  122056. }
  122057. return c.header_
  122058. }
  122059. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  122060. reqHeaders := make(http.Header)
  122061. for k, v := range c.header_ {
  122062. reqHeaders[k] = v
  122063. }
  122064. reqHeaders.Set("User-Agent", c.s.userAgent())
  122065. var body io.Reader = nil
  122066. c.urlParams_.Set("alt", alt)
  122067. c.urlParams_.Set("prettyPrint", "false")
  122068. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  122069. urls += "?" + c.urlParams_.Encode()
  122070. req, err := http.NewRequest("DELETE", urls, body)
  122071. if err != nil {
  122072. return nil, err
  122073. }
  122074. req.Header = reqHeaders
  122075. googleapi.Expand(req.URL, map[string]string{
  122076. "project": c.project,
  122077. "region": c.region,
  122078. "router": c.router,
  122079. })
  122080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122081. }
  122082. // Do executes the "compute.routers.delete" call.
  122083. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  122084. // status code is an error. Response headers are in either
  122085. // *Operation.ServerResponse.Header or (if a response was returned at
  122086. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  122087. // to check whether the returned error was because
  122088. // http.StatusNotModified was returned.
  122089. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  122090. gensupport.SetOptions(c.urlParams_, opts...)
  122091. res, err := c.doRequest("json")
  122092. if res != nil && res.StatusCode == http.StatusNotModified {
  122093. if res.Body != nil {
  122094. res.Body.Close()
  122095. }
  122096. return nil, &googleapi.Error{
  122097. Code: res.StatusCode,
  122098. Header: res.Header,
  122099. }
  122100. }
  122101. if err != nil {
  122102. return nil, err
  122103. }
  122104. defer googleapi.CloseBody(res)
  122105. if err := googleapi.CheckResponse(res); err != nil {
  122106. return nil, err
  122107. }
  122108. ret := &Operation{
  122109. ServerResponse: googleapi.ServerResponse{
  122110. Header: res.Header,
  122111. HTTPStatusCode: res.StatusCode,
  122112. },
  122113. }
  122114. target := &ret
  122115. if err := gensupport.DecodeResponse(target, res); err != nil {
  122116. return nil, err
  122117. }
  122118. return ret, nil
  122119. // {
  122120. // "description": "Deletes the specified Router resource.",
  122121. // "httpMethod": "DELETE",
  122122. // "id": "compute.routers.delete",
  122123. // "parameterOrder": [
  122124. // "project",
  122125. // "region",
  122126. // "router"
  122127. // ],
  122128. // "parameters": {
  122129. // "project": {
  122130. // "description": "Project ID for this request.",
  122131. // "location": "path",
  122132. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122133. // "required": true,
  122134. // "type": "string"
  122135. // },
  122136. // "region": {
  122137. // "description": "Name of the region for this request.",
  122138. // "location": "path",
  122139. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122140. // "required": true,
  122141. // "type": "string"
  122142. // },
  122143. // "requestId": {
  122144. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  122145. // "location": "query",
  122146. // "type": "string"
  122147. // },
  122148. // "router": {
  122149. // "description": "Name of the Router resource to delete.",
  122150. // "location": "path",
  122151. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  122152. // "required": true,
  122153. // "type": "string"
  122154. // }
  122155. // },
  122156. // "path": "{project}/regions/{region}/routers/{router}",
  122157. // "response": {
  122158. // "$ref": "Operation"
  122159. // },
  122160. // "scopes": [
  122161. // "https://www.googleapis.com/auth/cloud-platform",
  122162. // "https://www.googleapis.com/auth/compute"
  122163. // ]
  122164. // }
  122165. }
  122166. // method id "compute.routers.get":
  122167. type RoutersGetCall struct {
  122168. s *Service
  122169. project string
  122170. region string
  122171. router string
  122172. urlParams_ gensupport.URLParams
  122173. ifNoneMatch_ string
  122174. ctx_ context.Context
  122175. header_ http.Header
  122176. }
  122177. // Get: Returns the specified Router resource. Gets a list of available
  122178. // routers by making a list() request.
  122179. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  122180. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122181. c.project = project
  122182. c.region = region
  122183. c.router = router
  122184. return c
  122185. }
  122186. // Fields allows partial responses to be retrieved. See
  122187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122188. // for more information.
  122189. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  122190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122191. return c
  122192. }
  122193. // IfNoneMatch sets the optional parameter which makes the operation
  122194. // fail if the object's ETag matches the given value. This is useful for
  122195. // getting updates only after the object has changed since the last
  122196. // request. Use googleapi.IsNotModified to check whether the response
  122197. // error from Do is the result of In-None-Match.
  122198. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  122199. c.ifNoneMatch_ = entityTag
  122200. return c
  122201. }
  122202. // Context sets the context to be used in this call's Do method. Any
  122203. // pending HTTP request will be aborted if the provided context is
  122204. // canceled.
  122205. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  122206. c.ctx_ = ctx
  122207. return c
  122208. }
  122209. // Header returns an http.Header that can be modified by the caller to
  122210. // add HTTP headers to the request.
  122211. func (c *RoutersGetCall) Header() http.Header {
  122212. if c.header_ == nil {
  122213. c.header_ = make(http.Header)
  122214. }
  122215. return c.header_
  122216. }
  122217. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  122218. reqHeaders := make(http.Header)
  122219. for k, v := range c.header_ {
  122220. reqHeaders[k] = v
  122221. }
  122222. reqHeaders.Set("User-Agent", c.s.userAgent())
  122223. if c.ifNoneMatch_ != "" {
  122224. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122225. }
  122226. var body io.Reader = nil
  122227. c.urlParams_.Set("alt", alt)
  122228. c.urlParams_.Set("prettyPrint", "false")
  122229. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  122230. urls += "?" + c.urlParams_.Encode()
  122231. req, err := http.NewRequest("GET", urls, body)
  122232. if err != nil {
  122233. return nil, err
  122234. }
  122235. req.Header = reqHeaders
  122236. googleapi.Expand(req.URL, map[string]string{
  122237. "project": c.project,
  122238. "region": c.region,
  122239. "router": c.router,
  122240. })
  122241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122242. }
  122243. // Do executes the "compute.routers.get" call.
  122244. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  122245. // code is an error. Response headers are in either
  122246. // *Router.ServerResponse.Header or (if a response was returned at all)
  122247. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  122248. // check whether the returned error was because http.StatusNotModified
  122249. // was returned.
  122250. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  122251. gensupport.SetOptions(c.urlParams_, opts...)
  122252. res, err := c.doRequest("json")
  122253. if res != nil && res.StatusCode == http.StatusNotModified {
  122254. if res.Body != nil {
  122255. res.Body.Close()
  122256. }
  122257. return nil, &googleapi.Error{
  122258. Code: res.StatusCode,
  122259. Header: res.Header,
  122260. }
  122261. }
  122262. if err != nil {
  122263. return nil, err
  122264. }
  122265. defer googleapi.CloseBody(res)
  122266. if err := googleapi.CheckResponse(res); err != nil {
  122267. return nil, err
  122268. }
  122269. ret := &Router{
  122270. ServerResponse: googleapi.ServerResponse{
  122271. Header: res.Header,
  122272. HTTPStatusCode: res.StatusCode,
  122273. },
  122274. }
  122275. target := &ret
  122276. if err := gensupport.DecodeResponse(target, res); err != nil {
  122277. return nil, err
  122278. }
  122279. return ret, nil
  122280. // {
  122281. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  122282. // "httpMethod": "GET",
  122283. // "id": "compute.routers.get",
  122284. // "parameterOrder": [
  122285. // "project",
  122286. // "region",
  122287. // "router"
  122288. // ],
  122289. // "parameters": {
  122290. // "project": {
  122291. // "description": "Project ID for this request.",
  122292. // "location": "path",
  122293. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122294. // "required": true,
  122295. // "type": "string"
  122296. // },
  122297. // "region": {
  122298. // "description": "Name of the region for this request.",
  122299. // "location": "path",
  122300. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122301. // "required": true,
  122302. // "type": "string"
  122303. // },
  122304. // "router": {
  122305. // "description": "Name of the Router resource to return.",
  122306. // "location": "path",
  122307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  122308. // "required": true,
  122309. // "type": "string"
  122310. // }
  122311. // },
  122312. // "path": "{project}/regions/{region}/routers/{router}",
  122313. // "response": {
  122314. // "$ref": "Router"
  122315. // },
  122316. // "scopes": [
  122317. // "https://www.googleapis.com/auth/cloud-platform",
  122318. // "https://www.googleapis.com/auth/compute",
  122319. // "https://www.googleapis.com/auth/compute.readonly"
  122320. // ]
  122321. // }
  122322. }
  122323. // method id "compute.routers.getNatMappingInfo":
  122324. type RoutersGetNatMappingInfoCall struct {
  122325. s *Service
  122326. project string
  122327. region string
  122328. router string
  122329. urlParams_ gensupport.URLParams
  122330. ifNoneMatch_ string
  122331. ctx_ context.Context
  122332. header_ http.Header
  122333. }
  122334. // GetNatMappingInfo: Retrieves runtime Nat mapping information of VM
  122335. // endpoints.
  122336. func (r *RoutersService) GetNatMappingInfo(project string, region string, router string) *RoutersGetNatMappingInfoCall {
  122337. c := &RoutersGetNatMappingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122338. c.project = project
  122339. c.region = region
  122340. c.router = router
  122341. return c
  122342. }
  122343. // Filter sets the optional parameter "filter": A filter expression that
  122344. // filters resources listed in the response. The expression must specify
  122345. // the field name, a comparison operator, and the value that you want to
  122346. // use for filtering. The value must be a string, a number, or a
  122347. // boolean. The comparison operator must be either =, !=, >, or <.
  122348. //
  122349. // For example, if you are filtering Compute Engine instances, you can
  122350. // exclude instances named example-instance by specifying name !=
  122351. // example-instance.
  122352. //
  122353. // You can also filter nested fields. For example, you could specify
  122354. // scheduling.automaticRestart = false to include instances only if they
  122355. // are not scheduled for automatic restarts. You can use filtering on
  122356. // nested fields to filter based on resource labels.
  122357. //
  122358. // To filter on multiple expressions, provide each separate expression
  122359. // within parentheses. For example, (scheduling.automaticRestart = true)
  122360. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  122361. // AND expression. However, you can include AND and OR expressions
  122362. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  122363. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  122364. // true).
  122365. func (c *RoutersGetNatMappingInfoCall) Filter(filter string) *RoutersGetNatMappingInfoCall {
  122366. c.urlParams_.Set("filter", filter)
  122367. return c
  122368. }
  122369. // MaxResults sets the optional parameter "maxResults": The maximum
  122370. // number of results per page that should be returned. If the number of
  122371. // available results is larger than maxResults, Compute Engine returns a
  122372. // nextPageToken that can be used to get the next page of results in
  122373. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  122374. // (Default: 500)
  122375. func (c *RoutersGetNatMappingInfoCall) MaxResults(maxResults int64) *RoutersGetNatMappingInfoCall {
  122376. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  122377. return c
  122378. }
  122379. // NatName sets the optional parameter "natName": Name of the nat
  122380. // service to filter the Nat Mapping information. If it is omitted, all
  122381. // nats for this router will be returned. Name should conform to
  122382. // RFC1035.
  122383. func (c *RoutersGetNatMappingInfoCall) NatName(natName string) *RoutersGetNatMappingInfoCall {
  122384. c.urlParams_.Set("natName", natName)
  122385. return c
  122386. }
  122387. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  122388. // a certain order. By default, results are returned in alphanumerical
  122389. // order based on the resource name.
  122390. //
  122391. // You can also sort results in descending order based on the creation
  122392. // timestamp using orderBy="creationTimestamp desc". This sorts results
  122393. // based on the creationTimestamp field in reverse chronological order
  122394. // (newest result first). Use this to sort resources like operations so
  122395. // that the newest operation is returned first.
  122396. //
  122397. // Currently, only sorting by name or creationTimestamp desc is
  122398. // supported.
  122399. func (c *RoutersGetNatMappingInfoCall) OrderBy(orderBy string) *RoutersGetNatMappingInfoCall {
  122400. c.urlParams_.Set("orderBy", orderBy)
  122401. return c
  122402. }
  122403. // PageToken sets the optional parameter "pageToken": Specifies a page
  122404. // token to use. Set pageToken to the nextPageToken returned by a
  122405. // previous list request to get the next page of results.
  122406. func (c *RoutersGetNatMappingInfoCall) PageToken(pageToken string) *RoutersGetNatMappingInfoCall {
  122407. c.urlParams_.Set("pageToken", pageToken)
  122408. return c
  122409. }
  122410. // Fields allows partial responses to be retrieved. See
  122411. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122412. // for more information.
  122413. func (c *RoutersGetNatMappingInfoCall) Fields(s ...googleapi.Field) *RoutersGetNatMappingInfoCall {
  122414. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122415. return c
  122416. }
  122417. // IfNoneMatch sets the optional parameter which makes the operation
  122418. // fail if the object's ETag matches the given value. This is useful for
  122419. // getting updates only after the object has changed since the last
  122420. // request. Use googleapi.IsNotModified to check whether the response
  122421. // error from Do is the result of In-None-Match.
  122422. func (c *RoutersGetNatMappingInfoCall) IfNoneMatch(entityTag string) *RoutersGetNatMappingInfoCall {
  122423. c.ifNoneMatch_ = entityTag
  122424. return c
  122425. }
  122426. // Context sets the context to be used in this call's Do method. Any
  122427. // pending HTTP request will be aborted if the provided context is
  122428. // canceled.
  122429. func (c *RoutersGetNatMappingInfoCall) Context(ctx context.Context) *RoutersGetNatMappingInfoCall {
  122430. c.ctx_ = ctx
  122431. return c
  122432. }
  122433. // Header returns an http.Header that can be modified by the caller to
  122434. // add HTTP headers to the request.
  122435. func (c *RoutersGetNatMappingInfoCall) Header() http.Header {
  122436. if c.header_ == nil {
  122437. c.header_ = make(http.Header)
  122438. }
  122439. return c.header_
  122440. }
  122441. func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, error) {
  122442. reqHeaders := make(http.Header)
  122443. for k, v := range c.header_ {
  122444. reqHeaders[k] = v
  122445. }
  122446. reqHeaders.Set("User-Agent", c.s.userAgent())
  122447. if c.ifNoneMatch_ != "" {
  122448. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122449. }
  122450. var body io.Reader = nil
  122451. c.urlParams_.Set("alt", alt)
  122452. c.urlParams_.Set("prettyPrint", "false")
  122453. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getNatMappingInfo")
  122454. urls += "?" + c.urlParams_.Encode()
  122455. req, err := http.NewRequest("GET", urls, body)
  122456. if err != nil {
  122457. return nil, err
  122458. }
  122459. req.Header = reqHeaders
  122460. googleapi.Expand(req.URL, map[string]string{
  122461. "project": c.project,
  122462. "region": c.region,
  122463. "router": c.router,
  122464. })
  122465. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122466. }
  122467. // Do executes the "compute.routers.getNatMappingInfo" call.
  122468. // Exactly one of *VmEndpointNatMappingsList or error will be non-nil.
  122469. // Any non-2xx status code is an error. Response headers are in either
  122470. // *VmEndpointNatMappingsList.ServerResponse.Header or (if a response
  122471. // was returned at all) in error.(*googleapi.Error).Header. Use
  122472. // googleapi.IsNotModified to check whether the returned error was
  122473. // because http.StatusNotModified was returned.
  122474. func (c *RoutersGetNatMappingInfoCall) Do(opts ...googleapi.CallOption) (*VmEndpointNatMappingsList, error) {
  122475. gensupport.SetOptions(c.urlParams_, opts...)
  122476. res, err := c.doRequest("json")
  122477. if res != nil && res.StatusCode == http.StatusNotModified {
  122478. if res.Body != nil {
  122479. res.Body.Close()
  122480. }
  122481. return nil, &googleapi.Error{
  122482. Code: res.StatusCode,
  122483. Header: res.Header,
  122484. }
  122485. }
  122486. if err != nil {
  122487. return nil, err
  122488. }
  122489. defer googleapi.CloseBody(res)
  122490. if err := googleapi.CheckResponse(res); err != nil {
  122491. return nil, err
  122492. }
  122493. ret := &VmEndpointNatMappingsList{
  122494. ServerResponse: googleapi.ServerResponse{
  122495. Header: res.Header,
  122496. HTTPStatusCode: res.StatusCode,
  122497. },
  122498. }
  122499. target := &ret
  122500. if err := gensupport.DecodeResponse(target, res); err != nil {
  122501. return nil, err
  122502. }
  122503. return ret, nil
  122504. // {
  122505. // "description": "Retrieves runtime Nat mapping information of VM endpoints.",
  122506. // "httpMethod": "GET",
  122507. // "id": "compute.routers.getNatMappingInfo",
  122508. // "parameterOrder": [
  122509. // "project",
  122510. // "region",
  122511. // "router"
  122512. // ],
  122513. // "parameters": {
  122514. // "filter": {
  122515. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  122516. // "location": "query",
  122517. // "type": "string"
  122518. // },
  122519. // "maxResults": {
  122520. // "default": "500",
  122521. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  122522. // "format": "uint32",
  122523. // "location": "query",
  122524. // "minimum": "0",
  122525. // "type": "integer"
  122526. // },
  122527. // "natName": {
  122528. // "description": "Name of the nat service to filter the Nat Mapping information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035.",
  122529. // "location": "query",
  122530. // "type": "string"
  122531. // },
  122532. // "orderBy": {
  122533. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  122534. // "location": "query",
  122535. // "type": "string"
  122536. // },
  122537. // "pageToken": {
  122538. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  122539. // "location": "query",
  122540. // "type": "string"
  122541. // },
  122542. // "project": {
  122543. // "description": "Project ID for this request.",
  122544. // "location": "path",
  122545. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122546. // "required": true,
  122547. // "type": "string"
  122548. // },
  122549. // "region": {
  122550. // "description": "Name of the region for this request.",
  122551. // "location": "path",
  122552. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122553. // "required": true,
  122554. // "type": "string"
  122555. // },
  122556. // "router": {
  122557. // "description": "Name of the Router resource to query for Nat Mapping information of VM endpoints.",
  122558. // "location": "path",
  122559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  122560. // "required": true,
  122561. // "type": "string"
  122562. // }
  122563. // },
  122564. // "path": "{project}/regions/{region}/routers/{router}/getNatMappingInfo",
  122565. // "response": {
  122566. // "$ref": "VmEndpointNatMappingsList"
  122567. // },
  122568. // "scopes": [
  122569. // "https://www.googleapis.com/auth/cloud-platform",
  122570. // "https://www.googleapis.com/auth/compute",
  122571. // "https://www.googleapis.com/auth/compute.readonly"
  122572. // ]
  122573. // }
  122574. }
  122575. // Pages invokes f for each page of results.
  122576. // A non-nil error returned from f will halt the iteration.
  122577. // The provided context supersedes any context provided to the Context method.
  122578. func (c *RoutersGetNatMappingInfoCall) Pages(ctx context.Context, f func(*VmEndpointNatMappingsList) error) error {
  122579. c.ctx_ = ctx
  122580. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  122581. for {
  122582. x, err := c.Do()
  122583. if err != nil {
  122584. return err
  122585. }
  122586. if err := f(x); err != nil {
  122587. return err
  122588. }
  122589. if x.NextPageToken == "" {
  122590. return nil
  122591. }
  122592. c.PageToken(x.NextPageToken)
  122593. }
  122594. }
  122595. // method id "compute.routers.getRouterStatus":
  122596. type RoutersGetRouterStatusCall struct {
  122597. s *Service
  122598. project string
  122599. region string
  122600. router string
  122601. urlParams_ gensupport.URLParams
  122602. ifNoneMatch_ string
  122603. ctx_ context.Context
  122604. header_ http.Header
  122605. }
  122606. // GetRouterStatus: Retrieves runtime information of the specified
  122607. // router.
  122608. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  122609. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122610. c.project = project
  122611. c.region = region
  122612. c.router = router
  122613. return c
  122614. }
  122615. // Fields allows partial responses to be retrieved. See
  122616. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122617. // for more information.
  122618. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  122619. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122620. return c
  122621. }
  122622. // IfNoneMatch sets the optional parameter which makes the operation
  122623. // fail if the object's ETag matches the given value. This is useful for
  122624. // getting updates only after the object has changed since the last
  122625. // request. Use googleapi.IsNotModified to check whether the response
  122626. // error from Do is the result of In-None-Match.
  122627. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  122628. c.ifNoneMatch_ = entityTag
  122629. return c
  122630. }
  122631. // Context sets the context to be used in this call's Do method. Any
  122632. // pending HTTP request will be aborted if the provided context is
  122633. // canceled.
  122634. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  122635. c.ctx_ = ctx
  122636. return c
  122637. }
  122638. // Header returns an http.Header that can be modified by the caller to
  122639. // add HTTP headers to the request.
  122640. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  122641. if c.header_ == nil {
  122642. c.header_ = make(http.Header)
  122643. }
  122644. return c.header_
  122645. }
  122646. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  122647. reqHeaders := make(http.Header)
  122648. for k, v := range c.header_ {
  122649. reqHeaders[k] = v
  122650. }
  122651. reqHeaders.Set("User-Agent", c.s.userAgent())
  122652. if c.ifNoneMatch_ != "" {
  122653. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122654. }
  122655. var body io.Reader = nil
  122656. c.urlParams_.Set("alt", alt)
  122657. c.urlParams_.Set("prettyPrint", "false")
  122658. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  122659. urls += "?" + c.urlParams_.Encode()
  122660. req, err := http.NewRequest("GET", urls, body)
  122661. if err != nil {
  122662. return nil, err
  122663. }
  122664. req.Header = reqHeaders
  122665. googleapi.Expand(req.URL, map[string]string{
  122666. "project": c.project,
  122667. "region": c.region,
  122668. "router": c.router,
  122669. })
  122670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122671. }
  122672. // Do executes the "compute.routers.getRouterStatus" call.
  122673. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  122674. // non-2xx status code is an error. Response headers are in either
  122675. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  122676. // returned at all) in error.(*googleapi.Error).Header. Use
  122677. // googleapi.IsNotModified to check whether the returned error was
  122678. // because http.StatusNotModified was returned.
  122679. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, 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 := &RouterStatusResponse{
  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": "Retrieves runtime information of the specified router.",
  122711. // "httpMethod": "GET",
  122712. // "id": "compute.routers.getRouterStatus",
  122713. // "parameterOrder": [
  122714. // "project",
  122715. // "region",
  122716. // "router"
  122717. // ],
  122718. // "parameters": {
  122719. // "project": {
  122720. // "description": "Project ID for this request.",
  122721. // "location": "path",
  122722. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122723. // "required": true,
  122724. // "type": "string"
  122725. // },
  122726. // "region": {
  122727. // "description": "Name of the region for this request.",
  122728. // "location": "path",
  122729. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122730. // "required": true,
  122731. // "type": "string"
  122732. // },
  122733. // "router": {
  122734. // "description": "Name of the Router resource to query.",
  122735. // "location": "path",
  122736. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  122737. // "required": true,
  122738. // "type": "string"
  122739. // }
  122740. // },
  122741. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  122742. // "response": {
  122743. // "$ref": "RouterStatusResponse"
  122744. // },
  122745. // "scopes": [
  122746. // "https://www.googleapis.com/auth/cloud-platform",
  122747. // "https://www.googleapis.com/auth/compute",
  122748. // "https://www.googleapis.com/auth/compute.readonly"
  122749. // ]
  122750. // }
  122751. }
  122752. // method id "compute.routers.insert":
  122753. type RoutersInsertCall struct {
  122754. s *Service
  122755. project string
  122756. region string
  122757. router *Router
  122758. urlParams_ gensupport.URLParams
  122759. ctx_ context.Context
  122760. header_ http.Header
  122761. }
  122762. // Insert: Creates a Router resource in the specified project and region
  122763. // using the data included in the request.
  122764. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  122765. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122766. c.project = project
  122767. c.region = region
  122768. c.router = router
  122769. return c
  122770. }
  122771. // RequestId sets the optional parameter "requestId": An optional
  122772. // request ID to identify requests. Specify a unique request ID so that
  122773. // if you must retry your request, the server will know to ignore the
  122774. // request if it has already been completed.
  122775. //
  122776. // For example, consider a situation where you make an initial request
  122777. // and the request times out. If you make the request again with the
  122778. // same request ID, the server can check if original operation with the
  122779. // same request ID was received, and if so, will ignore the second
  122780. // request. This prevents clients from accidentally creating duplicate
  122781. // commitments.
  122782. //
  122783. // The request ID must be a valid UUID with the exception that zero UUID
  122784. // is not supported (00000000-0000-0000-0000-000000000000).
  122785. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  122786. c.urlParams_.Set("requestId", requestId)
  122787. return c
  122788. }
  122789. // Fields allows partial responses to be retrieved. See
  122790. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122791. // for more information.
  122792. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  122793. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122794. return c
  122795. }
  122796. // Context sets the context to be used in this call's Do method. Any
  122797. // pending HTTP request will be aborted if the provided context is
  122798. // canceled.
  122799. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  122800. c.ctx_ = ctx
  122801. return c
  122802. }
  122803. // Header returns an http.Header that can be modified by the caller to
  122804. // add HTTP headers to the request.
  122805. func (c *RoutersInsertCall) Header() http.Header {
  122806. if c.header_ == nil {
  122807. c.header_ = make(http.Header)
  122808. }
  122809. return c.header_
  122810. }
  122811. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  122812. reqHeaders := make(http.Header)
  122813. for k, v := range c.header_ {
  122814. reqHeaders[k] = v
  122815. }
  122816. reqHeaders.Set("User-Agent", c.s.userAgent())
  122817. var body io.Reader = nil
  122818. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  122819. if err != nil {
  122820. return nil, err
  122821. }
  122822. reqHeaders.Set("Content-Type", "application/json")
  122823. c.urlParams_.Set("alt", alt)
  122824. c.urlParams_.Set("prettyPrint", "false")
  122825. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  122826. urls += "?" + c.urlParams_.Encode()
  122827. req, err := http.NewRequest("POST", urls, body)
  122828. if err != nil {
  122829. return nil, err
  122830. }
  122831. req.Header = reqHeaders
  122832. googleapi.Expand(req.URL, map[string]string{
  122833. "project": c.project,
  122834. "region": c.region,
  122835. })
  122836. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122837. }
  122838. // Do executes the "compute.routers.insert" call.
  122839. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  122840. // status code is an error. Response headers are in either
  122841. // *Operation.ServerResponse.Header or (if a response was returned at
  122842. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  122843. // to check whether the returned error was because
  122844. // http.StatusNotModified was returned.
  122845. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  122846. gensupport.SetOptions(c.urlParams_, opts...)
  122847. res, err := c.doRequest("json")
  122848. if res != nil && res.StatusCode == http.StatusNotModified {
  122849. if res.Body != nil {
  122850. res.Body.Close()
  122851. }
  122852. return nil, &googleapi.Error{
  122853. Code: res.StatusCode,
  122854. Header: res.Header,
  122855. }
  122856. }
  122857. if err != nil {
  122858. return nil, err
  122859. }
  122860. defer googleapi.CloseBody(res)
  122861. if err := googleapi.CheckResponse(res); err != nil {
  122862. return nil, err
  122863. }
  122864. ret := &Operation{
  122865. ServerResponse: googleapi.ServerResponse{
  122866. Header: res.Header,
  122867. HTTPStatusCode: res.StatusCode,
  122868. },
  122869. }
  122870. target := &ret
  122871. if err := gensupport.DecodeResponse(target, res); err != nil {
  122872. return nil, err
  122873. }
  122874. return ret, nil
  122875. // {
  122876. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  122877. // "httpMethod": "POST",
  122878. // "id": "compute.routers.insert",
  122879. // "parameterOrder": [
  122880. // "project",
  122881. // "region"
  122882. // ],
  122883. // "parameters": {
  122884. // "project": {
  122885. // "description": "Project ID for this request.",
  122886. // "location": "path",
  122887. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122888. // "required": true,
  122889. // "type": "string"
  122890. // },
  122891. // "region": {
  122892. // "description": "Name of the region for this request.",
  122893. // "location": "path",
  122894. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122895. // "required": true,
  122896. // "type": "string"
  122897. // },
  122898. // "requestId": {
  122899. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  122900. // "location": "query",
  122901. // "type": "string"
  122902. // }
  122903. // },
  122904. // "path": "{project}/regions/{region}/routers",
  122905. // "request": {
  122906. // "$ref": "Router"
  122907. // },
  122908. // "response": {
  122909. // "$ref": "Operation"
  122910. // },
  122911. // "scopes": [
  122912. // "https://www.googleapis.com/auth/cloud-platform",
  122913. // "https://www.googleapis.com/auth/compute"
  122914. // ]
  122915. // }
  122916. }
  122917. // method id "compute.routers.list":
  122918. type RoutersListCall struct {
  122919. s *Service
  122920. project string
  122921. region string
  122922. urlParams_ gensupport.URLParams
  122923. ifNoneMatch_ string
  122924. ctx_ context.Context
  122925. header_ http.Header
  122926. }
  122927. // List: Retrieves a list of Router resources available to the specified
  122928. // project.
  122929. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  122930. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122931. c.project = project
  122932. c.region = region
  122933. return c
  122934. }
  122935. // Filter sets the optional parameter "filter": A filter expression that
  122936. // filters resources listed in the response. The expression must specify
  122937. // the field name, a comparison operator, and the value that you want to
  122938. // use for filtering. The value must be a string, a number, or a
  122939. // boolean. The comparison operator must be either =, !=, >, or <.
  122940. //
  122941. // For example, if you are filtering Compute Engine instances, you can
  122942. // exclude instances named example-instance by specifying name !=
  122943. // example-instance.
  122944. //
  122945. // You can also filter nested fields. For example, you could specify
  122946. // scheduling.automaticRestart = false to include instances only if they
  122947. // are not scheduled for automatic restarts. You can use filtering on
  122948. // nested fields to filter based on resource labels.
  122949. //
  122950. // To filter on multiple expressions, provide each separate expression
  122951. // within parentheses. For example, (scheduling.automaticRestart = true)
  122952. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  122953. // AND expression. However, you can include AND and OR expressions
  122954. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  122955. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  122956. // true).
  122957. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  122958. c.urlParams_.Set("filter", filter)
  122959. return c
  122960. }
  122961. // MaxResults sets the optional parameter "maxResults": The maximum
  122962. // number of results per page that should be returned. If the number of
  122963. // available results is larger than maxResults, Compute Engine returns a
  122964. // nextPageToken that can be used to get the next page of results in
  122965. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  122966. // (Default: 500)
  122967. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  122968. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  122969. return c
  122970. }
  122971. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  122972. // a certain order. By default, results are returned in alphanumerical
  122973. // order based on the resource name.
  122974. //
  122975. // You can also sort results in descending order based on the creation
  122976. // timestamp using orderBy="creationTimestamp desc". This sorts results
  122977. // based on the creationTimestamp field in reverse chronological order
  122978. // (newest result first). Use this to sort resources like operations so
  122979. // that the newest operation is returned first.
  122980. //
  122981. // Currently, only sorting by name or creationTimestamp desc is
  122982. // supported.
  122983. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  122984. c.urlParams_.Set("orderBy", orderBy)
  122985. return c
  122986. }
  122987. // PageToken sets the optional parameter "pageToken": Specifies a page
  122988. // token to use. Set pageToken to the nextPageToken returned by a
  122989. // previous list request to get the next page of results.
  122990. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  122991. c.urlParams_.Set("pageToken", pageToken)
  122992. return c
  122993. }
  122994. // Fields allows partial responses to be retrieved. See
  122995. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122996. // for more information.
  122997. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  122998. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122999. return c
  123000. }
  123001. // IfNoneMatch sets the optional parameter which makes the operation
  123002. // fail if the object's ETag matches the given value. This is useful for
  123003. // getting updates only after the object has changed since the last
  123004. // request. Use googleapi.IsNotModified to check whether the response
  123005. // error from Do is the result of In-None-Match.
  123006. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  123007. c.ifNoneMatch_ = entityTag
  123008. return c
  123009. }
  123010. // Context sets the context to be used in this call's Do method. Any
  123011. // pending HTTP request will be aborted if the provided context is
  123012. // canceled.
  123013. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  123014. c.ctx_ = ctx
  123015. return c
  123016. }
  123017. // Header returns an http.Header that can be modified by the caller to
  123018. // add HTTP headers to the request.
  123019. func (c *RoutersListCall) Header() http.Header {
  123020. if c.header_ == nil {
  123021. c.header_ = make(http.Header)
  123022. }
  123023. return c.header_
  123024. }
  123025. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  123026. reqHeaders := make(http.Header)
  123027. for k, v := range c.header_ {
  123028. reqHeaders[k] = v
  123029. }
  123030. reqHeaders.Set("User-Agent", c.s.userAgent())
  123031. if c.ifNoneMatch_ != "" {
  123032. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  123033. }
  123034. var body io.Reader = nil
  123035. c.urlParams_.Set("alt", alt)
  123036. c.urlParams_.Set("prettyPrint", "false")
  123037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  123038. urls += "?" + c.urlParams_.Encode()
  123039. req, err := http.NewRequest("GET", urls, body)
  123040. if err != nil {
  123041. return nil, err
  123042. }
  123043. req.Header = reqHeaders
  123044. googleapi.Expand(req.URL, map[string]string{
  123045. "project": c.project,
  123046. "region": c.region,
  123047. })
  123048. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123049. }
  123050. // Do executes the "compute.routers.list" call.
  123051. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  123052. // status code is an error. Response headers are in either
  123053. // *RouterList.ServerResponse.Header or (if a response was returned at
  123054. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123055. // to check whether the returned error was because
  123056. // http.StatusNotModified was returned.
  123057. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  123058. gensupport.SetOptions(c.urlParams_, opts...)
  123059. res, err := c.doRequest("json")
  123060. if res != nil && res.StatusCode == http.StatusNotModified {
  123061. if res.Body != nil {
  123062. res.Body.Close()
  123063. }
  123064. return nil, &googleapi.Error{
  123065. Code: res.StatusCode,
  123066. Header: res.Header,
  123067. }
  123068. }
  123069. if err != nil {
  123070. return nil, err
  123071. }
  123072. defer googleapi.CloseBody(res)
  123073. if err := googleapi.CheckResponse(res); err != nil {
  123074. return nil, err
  123075. }
  123076. ret := &RouterList{
  123077. ServerResponse: googleapi.ServerResponse{
  123078. Header: res.Header,
  123079. HTTPStatusCode: res.StatusCode,
  123080. },
  123081. }
  123082. target := &ret
  123083. if err := gensupport.DecodeResponse(target, res); err != nil {
  123084. return nil, err
  123085. }
  123086. return ret, nil
  123087. // {
  123088. // "description": "Retrieves a list of Router resources available to the specified project.",
  123089. // "httpMethod": "GET",
  123090. // "id": "compute.routers.list",
  123091. // "parameterOrder": [
  123092. // "project",
  123093. // "region"
  123094. // ],
  123095. // "parameters": {
  123096. // "filter": {
  123097. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  123098. // "location": "query",
  123099. // "type": "string"
  123100. // },
  123101. // "maxResults": {
  123102. // "default": "500",
  123103. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  123104. // "format": "uint32",
  123105. // "location": "query",
  123106. // "minimum": "0",
  123107. // "type": "integer"
  123108. // },
  123109. // "orderBy": {
  123110. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  123111. // "location": "query",
  123112. // "type": "string"
  123113. // },
  123114. // "pageToken": {
  123115. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  123116. // "location": "query",
  123117. // "type": "string"
  123118. // },
  123119. // "project": {
  123120. // "description": "Project ID for this request.",
  123121. // "location": "path",
  123122. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123123. // "required": true,
  123124. // "type": "string"
  123125. // },
  123126. // "region": {
  123127. // "description": "Name of the region for this request.",
  123128. // "location": "path",
  123129. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  123130. // "required": true,
  123131. // "type": "string"
  123132. // }
  123133. // },
  123134. // "path": "{project}/regions/{region}/routers",
  123135. // "response": {
  123136. // "$ref": "RouterList"
  123137. // },
  123138. // "scopes": [
  123139. // "https://www.googleapis.com/auth/cloud-platform",
  123140. // "https://www.googleapis.com/auth/compute",
  123141. // "https://www.googleapis.com/auth/compute.readonly"
  123142. // ]
  123143. // }
  123144. }
  123145. // Pages invokes f for each page of results.
  123146. // A non-nil error returned from f will halt the iteration.
  123147. // The provided context supersedes any context provided to the Context method.
  123148. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  123149. c.ctx_ = ctx
  123150. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  123151. for {
  123152. x, err := c.Do()
  123153. if err != nil {
  123154. return err
  123155. }
  123156. if err := f(x); err != nil {
  123157. return err
  123158. }
  123159. if x.NextPageToken == "" {
  123160. return nil
  123161. }
  123162. c.PageToken(x.NextPageToken)
  123163. }
  123164. }
  123165. // method id "compute.routers.patch":
  123166. type RoutersPatchCall struct {
  123167. s *Service
  123168. project string
  123169. region string
  123170. router string
  123171. router2 *Router
  123172. urlParams_ gensupport.URLParams
  123173. ctx_ context.Context
  123174. header_ http.Header
  123175. }
  123176. // Patch: Patches the specified Router resource with the data included
  123177. // in the request. This method supports PATCH semantics and uses JSON
  123178. // merge patch format and processing rules.
  123179. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  123180. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123181. c.project = project
  123182. c.region = region
  123183. c.router = router
  123184. c.router2 = router2
  123185. return c
  123186. }
  123187. // RequestId sets the optional parameter "requestId": An optional
  123188. // request ID to identify requests. Specify a unique request ID so that
  123189. // if you must retry your request, the server will know to ignore the
  123190. // request if it has already been completed.
  123191. //
  123192. // For example, consider a situation where you make an initial request
  123193. // and the request times out. If you make the request again with the
  123194. // same request ID, the server can check if original operation with the
  123195. // same request ID was received, and if so, will ignore the second
  123196. // request. This prevents clients from accidentally creating duplicate
  123197. // commitments.
  123198. //
  123199. // The request ID must be a valid UUID with the exception that zero UUID
  123200. // is not supported (00000000-0000-0000-0000-000000000000).
  123201. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  123202. c.urlParams_.Set("requestId", requestId)
  123203. return c
  123204. }
  123205. // Fields allows partial responses to be retrieved. See
  123206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123207. // for more information.
  123208. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  123209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123210. return c
  123211. }
  123212. // Context sets the context to be used in this call's Do method. Any
  123213. // pending HTTP request will be aborted if the provided context is
  123214. // canceled.
  123215. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  123216. c.ctx_ = ctx
  123217. return c
  123218. }
  123219. // Header returns an http.Header that can be modified by the caller to
  123220. // add HTTP headers to the request.
  123221. func (c *RoutersPatchCall) Header() http.Header {
  123222. if c.header_ == nil {
  123223. c.header_ = make(http.Header)
  123224. }
  123225. return c.header_
  123226. }
  123227. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  123228. reqHeaders := make(http.Header)
  123229. for k, v := range c.header_ {
  123230. reqHeaders[k] = v
  123231. }
  123232. reqHeaders.Set("User-Agent", c.s.userAgent())
  123233. var body io.Reader = nil
  123234. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  123235. if err != nil {
  123236. return nil, err
  123237. }
  123238. reqHeaders.Set("Content-Type", "application/json")
  123239. c.urlParams_.Set("alt", alt)
  123240. c.urlParams_.Set("prettyPrint", "false")
  123241. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  123242. urls += "?" + c.urlParams_.Encode()
  123243. req, err := http.NewRequest("PATCH", urls, body)
  123244. if err != nil {
  123245. return nil, err
  123246. }
  123247. req.Header = reqHeaders
  123248. googleapi.Expand(req.URL, map[string]string{
  123249. "project": c.project,
  123250. "region": c.region,
  123251. "router": c.router,
  123252. })
  123253. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123254. }
  123255. // Do executes the "compute.routers.patch" call.
  123256. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123257. // status code is an error. Response headers are in either
  123258. // *Operation.ServerResponse.Header or (if a response was returned at
  123259. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123260. // to check whether the returned error was because
  123261. // http.StatusNotModified was returned.
  123262. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123263. gensupport.SetOptions(c.urlParams_, opts...)
  123264. res, err := c.doRequest("json")
  123265. if res != nil && res.StatusCode == http.StatusNotModified {
  123266. if res.Body != nil {
  123267. res.Body.Close()
  123268. }
  123269. return nil, &googleapi.Error{
  123270. Code: res.StatusCode,
  123271. Header: res.Header,
  123272. }
  123273. }
  123274. if err != nil {
  123275. return nil, err
  123276. }
  123277. defer googleapi.CloseBody(res)
  123278. if err := googleapi.CheckResponse(res); err != nil {
  123279. return nil, err
  123280. }
  123281. ret := &Operation{
  123282. ServerResponse: googleapi.ServerResponse{
  123283. Header: res.Header,
  123284. HTTPStatusCode: res.StatusCode,
  123285. },
  123286. }
  123287. target := &ret
  123288. if err := gensupport.DecodeResponse(target, res); err != nil {
  123289. return nil, err
  123290. }
  123291. return ret, nil
  123292. // {
  123293. // "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.",
  123294. // "httpMethod": "PATCH",
  123295. // "id": "compute.routers.patch",
  123296. // "parameterOrder": [
  123297. // "project",
  123298. // "region",
  123299. // "router"
  123300. // ],
  123301. // "parameters": {
  123302. // "project": {
  123303. // "description": "Project ID for this request.",
  123304. // "location": "path",
  123305. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123306. // "required": true,
  123307. // "type": "string"
  123308. // },
  123309. // "region": {
  123310. // "description": "Name of the region for this request.",
  123311. // "location": "path",
  123312. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  123313. // "required": true,
  123314. // "type": "string"
  123315. // },
  123316. // "requestId": {
  123317. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  123318. // "location": "query",
  123319. // "type": "string"
  123320. // },
  123321. // "router": {
  123322. // "description": "Name of the Router resource to patch.",
  123323. // "location": "path",
  123324. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123325. // "required": true,
  123326. // "type": "string"
  123327. // }
  123328. // },
  123329. // "path": "{project}/regions/{region}/routers/{router}",
  123330. // "request": {
  123331. // "$ref": "Router"
  123332. // },
  123333. // "response": {
  123334. // "$ref": "Operation"
  123335. // },
  123336. // "scopes": [
  123337. // "https://www.googleapis.com/auth/cloud-platform",
  123338. // "https://www.googleapis.com/auth/compute"
  123339. // ]
  123340. // }
  123341. }
  123342. // method id "compute.routers.preview":
  123343. type RoutersPreviewCall struct {
  123344. s *Service
  123345. project string
  123346. region string
  123347. router string
  123348. router2 *Router
  123349. urlParams_ gensupport.URLParams
  123350. ctx_ context.Context
  123351. header_ http.Header
  123352. }
  123353. // Preview: Preview fields auto-generated during router create and
  123354. // update operations. Calling this method does NOT create or update the
  123355. // router.
  123356. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  123357. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123358. c.project = project
  123359. c.region = region
  123360. c.router = router
  123361. c.router2 = router2
  123362. return c
  123363. }
  123364. // Fields allows partial responses to be retrieved. See
  123365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123366. // for more information.
  123367. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  123368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123369. return c
  123370. }
  123371. // Context sets the context to be used in this call's Do method. Any
  123372. // pending HTTP request will be aborted if the provided context is
  123373. // canceled.
  123374. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  123375. c.ctx_ = ctx
  123376. return c
  123377. }
  123378. // Header returns an http.Header that can be modified by the caller to
  123379. // add HTTP headers to the request.
  123380. func (c *RoutersPreviewCall) Header() http.Header {
  123381. if c.header_ == nil {
  123382. c.header_ = make(http.Header)
  123383. }
  123384. return c.header_
  123385. }
  123386. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  123387. reqHeaders := make(http.Header)
  123388. for k, v := range c.header_ {
  123389. reqHeaders[k] = v
  123390. }
  123391. reqHeaders.Set("User-Agent", c.s.userAgent())
  123392. var body io.Reader = nil
  123393. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  123394. if err != nil {
  123395. return nil, err
  123396. }
  123397. reqHeaders.Set("Content-Type", "application/json")
  123398. c.urlParams_.Set("alt", alt)
  123399. c.urlParams_.Set("prettyPrint", "false")
  123400. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  123401. urls += "?" + c.urlParams_.Encode()
  123402. req, err := http.NewRequest("POST", urls, body)
  123403. if err != nil {
  123404. return nil, err
  123405. }
  123406. req.Header = reqHeaders
  123407. googleapi.Expand(req.URL, map[string]string{
  123408. "project": c.project,
  123409. "region": c.region,
  123410. "router": c.router,
  123411. })
  123412. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123413. }
  123414. // Do executes the "compute.routers.preview" call.
  123415. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  123416. // non-2xx status code is an error. Response headers are in either
  123417. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  123418. // returned at all) in error.(*googleapi.Error).Header. Use
  123419. // googleapi.IsNotModified to check whether the returned error was
  123420. // because http.StatusNotModified was returned.
  123421. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  123422. gensupport.SetOptions(c.urlParams_, opts...)
  123423. res, err := c.doRequest("json")
  123424. if res != nil && res.StatusCode == http.StatusNotModified {
  123425. if res.Body != nil {
  123426. res.Body.Close()
  123427. }
  123428. return nil, &googleapi.Error{
  123429. Code: res.StatusCode,
  123430. Header: res.Header,
  123431. }
  123432. }
  123433. if err != nil {
  123434. return nil, err
  123435. }
  123436. defer googleapi.CloseBody(res)
  123437. if err := googleapi.CheckResponse(res); err != nil {
  123438. return nil, err
  123439. }
  123440. ret := &RoutersPreviewResponse{
  123441. ServerResponse: googleapi.ServerResponse{
  123442. Header: res.Header,
  123443. HTTPStatusCode: res.StatusCode,
  123444. },
  123445. }
  123446. target := &ret
  123447. if err := gensupport.DecodeResponse(target, res); err != nil {
  123448. return nil, err
  123449. }
  123450. return ret, nil
  123451. // {
  123452. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  123453. // "httpMethod": "POST",
  123454. // "id": "compute.routers.preview",
  123455. // "parameterOrder": [
  123456. // "project",
  123457. // "region",
  123458. // "router"
  123459. // ],
  123460. // "parameters": {
  123461. // "project": {
  123462. // "description": "Project ID for this request.",
  123463. // "location": "path",
  123464. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123465. // "required": true,
  123466. // "type": "string"
  123467. // },
  123468. // "region": {
  123469. // "description": "Name of the region for this request.",
  123470. // "location": "path",
  123471. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  123472. // "required": true,
  123473. // "type": "string"
  123474. // },
  123475. // "router": {
  123476. // "description": "Name of the Router resource to query.",
  123477. // "location": "path",
  123478. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123479. // "required": true,
  123480. // "type": "string"
  123481. // }
  123482. // },
  123483. // "path": "{project}/regions/{region}/routers/{router}/preview",
  123484. // "request": {
  123485. // "$ref": "Router"
  123486. // },
  123487. // "response": {
  123488. // "$ref": "RoutersPreviewResponse"
  123489. // },
  123490. // "scopes": [
  123491. // "https://www.googleapis.com/auth/cloud-platform",
  123492. // "https://www.googleapis.com/auth/compute",
  123493. // "https://www.googleapis.com/auth/compute.readonly"
  123494. // ]
  123495. // }
  123496. }
  123497. // method id "compute.routers.testIamPermissions":
  123498. type RoutersTestIamPermissionsCall struct {
  123499. s *Service
  123500. project string
  123501. region string
  123502. resource string
  123503. testpermissionsrequest *TestPermissionsRequest
  123504. urlParams_ gensupport.URLParams
  123505. ctx_ context.Context
  123506. header_ http.Header
  123507. }
  123508. // TestIamPermissions: Returns permissions that a caller has on the
  123509. // specified resource.
  123510. func (r *RoutersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutersTestIamPermissionsCall {
  123511. c := &RoutersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123512. c.project = project
  123513. c.region = region
  123514. c.resource = resource
  123515. c.testpermissionsrequest = testpermissionsrequest
  123516. return c
  123517. }
  123518. // Fields allows partial responses to be retrieved. See
  123519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123520. // for more information.
  123521. func (c *RoutersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutersTestIamPermissionsCall {
  123522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123523. return c
  123524. }
  123525. // Context sets the context to be used in this call's Do method. Any
  123526. // pending HTTP request will be aborted if the provided context is
  123527. // canceled.
  123528. func (c *RoutersTestIamPermissionsCall) Context(ctx context.Context) *RoutersTestIamPermissionsCall {
  123529. c.ctx_ = ctx
  123530. return c
  123531. }
  123532. // Header returns an http.Header that can be modified by the caller to
  123533. // add HTTP headers to the request.
  123534. func (c *RoutersTestIamPermissionsCall) Header() http.Header {
  123535. if c.header_ == nil {
  123536. c.header_ = make(http.Header)
  123537. }
  123538. return c.header_
  123539. }
  123540. func (c *RoutersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  123541. reqHeaders := make(http.Header)
  123542. for k, v := range c.header_ {
  123543. reqHeaders[k] = v
  123544. }
  123545. reqHeaders.Set("User-Agent", c.s.userAgent())
  123546. var body io.Reader = nil
  123547. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  123548. if err != nil {
  123549. return nil, err
  123550. }
  123551. reqHeaders.Set("Content-Type", "application/json")
  123552. c.urlParams_.Set("alt", alt)
  123553. c.urlParams_.Set("prettyPrint", "false")
  123554. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{resource}/testIamPermissions")
  123555. urls += "?" + c.urlParams_.Encode()
  123556. req, err := http.NewRequest("POST", urls, body)
  123557. if err != nil {
  123558. return nil, err
  123559. }
  123560. req.Header = reqHeaders
  123561. googleapi.Expand(req.URL, map[string]string{
  123562. "project": c.project,
  123563. "region": c.region,
  123564. "resource": c.resource,
  123565. })
  123566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123567. }
  123568. // Do executes the "compute.routers.testIamPermissions" call.
  123569. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  123570. // non-2xx status code is an error. Response headers are in either
  123571. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  123572. // returned at all) in error.(*googleapi.Error).Header. Use
  123573. // googleapi.IsNotModified to check whether the returned error was
  123574. // because http.StatusNotModified was returned.
  123575. func (c *RoutersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  123576. gensupport.SetOptions(c.urlParams_, opts...)
  123577. res, err := c.doRequest("json")
  123578. if res != nil && res.StatusCode == http.StatusNotModified {
  123579. if res.Body != nil {
  123580. res.Body.Close()
  123581. }
  123582. return nil, &googleapi.Error{
  123583. Code: res.StatusCode,
  123584. Header: res.Header,
  123585. }
  123586. }
  123587. if err != nil {
  123588. return nil, err
  123589. }
  123590. defer googleapi.CloseBody(res)
  123591. if err := googleapi.CheckResponse(res); err != nil {
  123592. return nil, err
  123593. }
  123594. ret := &TestPermissionsResponse{
  123595. ServerResponse: googleapi.ServerResponse{
  123596. Header: res.Header,
  123597. HTTPStatusCode: res.StatusCode,
  123598. },
  123599. }
  123600. target := &ret
  123601. if err := gensupport.DecodeResponse(target, res); err != nil {
  123602. return nil, err
  123603. }
  123604. return ret, nil
  123605. // {
  123606. // "description": "Returns permissions that a caller has on the specified resource.",
  123607. // "httpMethod": "POST",
  123608. // "id": "compute.routers.testIamPermissions",
  123609. // "parameterOrder": [
  123610. // "project",
  123611. // "region",
  123612. // "resource"
  123613. // ],
  123614. // "parameters": {
  123615. // "project": {
  123616. // "description": "Project ID for this request.",
  123617. // "location": "path",
  123618. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123619. // "required": true,
  123620. // "type": "string"
  123621. // },
  123622. // "region": {
  123623. // "description": "The name of the region for this request.",
  123624. // "location": "path",
  123625. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  123626. // "required": true,
  123627. // "type": "string"
  123628. // },
  123629. // "resource": {
  123630. // "description": "Name or id of the resource for this request.",
  123631. // "location": "path",
  123632. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123633. // "required": true,
  123634. // "type": "string"
  123635. // }
  123636. // },
  123637. // "path": "{project}/regions/{region}/routers/{resource}/testIamPermissions",
  123638. // "request": {
  123639. // "$ref": "TestPermissionsRequest"
  123640. // },
  123641. // "response": {
  123642. // "$ref": "TestPermissionsResponse"
  123643. // },
  123644. // "scopes": [
  123645. // "https://www.googleapis.com/auth/cloud-platform",
  123646. // "https://www.googleapis.com/auth/compute",
  123647. // "https://www.googleapis.com/auth/compute.readonly"
  123648. // ]
  123649. // }
  123650. }
  123651. // method id "compute.routers.update":
  123652. type RoutersUpdateCall struct {
  123653. s *Service
  123654. project string
  123655. region string
  123656. router string
  123657. router2 *Router
  123658. urlParams_ gensupport.URLParams
  123659. ctx_ context.Context
  123660. header_ http.Header
  123661. }
  123662. // Update: Updates the specified Router resource with the data included
  123663. // in the request.
  123664. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  123665. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123666. c.project = project
  123667. c.region = region
  123668. c.router = router
  123669. c.router2 = router2
  123670. return c
  123671. }
  123672. // RequestId sets the optional parameter "requestId": An optional
  123673. // request ID to identify requests. Specify a unique request ID so that
  123674. // if you must retry your request, the server will know to ignore the
  123675. // request if it has already been completed.
  123676. //
  123677. // For example, consider a situation where you make an initial request
  123678. // and the request times out. If you make the request again with the
  123679. // same request ID, the server can check if original operation with the
  123680. // same request ID was received, and if so, will ignore the second
  123681. // request. This prevents clients from accidentally creating duplicate
  123682. // commitments.
  123683. //
  123684. // The request ID must be a valid UUID with the exception that zero UUID
  123685. // is not supported (00000000-0000-0000-0000-000000000000).
  123686. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  123687. c.urlParams_.Set("requestId", requestId)
  123688. return c
  123689. }
  123690. // Fields allows partial responses to be retrieved. See
  123691. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123692. // for more information.
  123693. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  123694. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123695. return c
  123696. }
  123697. // Context sets the context to be used in this call's Do method. Any
  123698. // pending HTTP request will be aborted if the provided context is
  123699. // canceled.
  123700. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  123701. c.ctx_ = ctx
  123702. return c
  123703. }
  123704. // Header returns an http.Header that can be modified by the caller to
  123705. // add HTTP headers to the request.
  123706. func (c *RoutersUpdateCall) Header() http.Header {
  123707. if c.header_ == nil {
  123708. c.header_ = make(http.Header)
  123709. }
  123710. return c.header_
  123711. }
  123712. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  123713. reqHeaders := make(http.Header)
  123714. for k, v := range c.header_ {
  123715. reqHeaders[k] = v
  123716. }
  123717. reqHeaders.Set("User-Agent", c.s.userAgent())
  123718. var body io.Reader = nil
  123719. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  123720. if err != nil {
  123721. return nil, err
  123722. }
  123723. reqHeaders.Set("Content-Type", "application/json")
  123724. c.urlParams_.Set("alt", alt)
  123725. c.urlParams_.Set("prettyPrint", "false")
  123726. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  123727. urls += "?" + c.urlParams_.Encode()
  123728. req, err := http.NewRequest("PUT", urls, body)
  123729. if err != nil {
  123730. return nil, err
  123731. }
  123732. req.Header = reqHeaders
  123733. googleapi.Expand(req.URL, map[string]string{
  123734. "project": c.project,
  123735. "region": c.region,
  123736. "router": c.router,
  123737. })
  123738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123739. }
  123740. // Do executes the "compute.routers.update" call.
  123741. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123742. // status code is an error. Response headers are in either
  123743. // *Operation.ServerResponse.Header or (if a response was returned at
  123744. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123745. // to check whether the returned error was because
  123746. // http.StatusNotModified was returned.
  123747. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123748. gensupport.SetOptions(c.urlParams_, opts...)
  123749. res, err := c.doRequest("json")
  123750. if res != nil && res.StatusCode == http.StatusNotModified {
  123751. if res.Body != nil {
  123752. res.Body.Close()
  123753. }
  123754. return nil, &googleapi.Error{
  123755. Code: res.StatusCode,
  123756. Header: res.Header,
  123757. }
  123758. }
  123759. if err != nil {
  123760. return nil, err
  123761. }
  123762. defer googleapi.CloseBody(res)
  123763. if err := googleapi.CheckResponse(res); err != nil {
  123764. return nil, err
  123765. }
  123766. ret := &Operation{
  123767. ServerResponse: googleapi.ServerResponse{
  123768. Header: res.Header,
  123769. HTTPStatusCode: res.StatusCode,
  123770. },
  123771. }
  123772. target := &ret
  123773. if err := gensupport.DecodeResponse(target, res); err != nil {
  123774. return nil, err
  123775. }
  123776. return ret, nil
  123777. // {
  123778. // "description": "Updates the specified Router resource with the data included in the request.",
  123779. // "httpMethod": "PUT",
  123780. // "id": "compute.routers.update",
  123781. // "parameterOrder": [
  123782. // "project",
  123783. // "region",
  123784. // "router"
  123785. // ],
  123786. // "parameters": {
  123787. // "project": {
  123788. // "description": "Project ID for this request.",
  123789. // "location": "path",
  123790. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123791. // "required": true,
  123792. // "type": "string"
  123793. // },
  123794. // "region": {
  123795. // "description": "Name of the region for this request.",
  123796. // "location": "path",
  123797. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  123798. // "required": true,
  123799. // "type": "string"
  123800. // },
  123801. // "requestId": {
  123802. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  123803. // "location": "query",
  123804. // "type": "string"
  123805. // },
  123806. // "router": {
  123807. // "description": "Name of the Router resource to update.",
  123808. // "location": "path",
  123809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123810. // "required": true,
  123811. // "type": "string"
  123812. // }
  123813. // },
  123814. // "path": "{project}/regions/{region}/routers/{router}",
  123815. // "request": {
  123816. // "$ref": "Router"
  123817. // },
  123818. // "response": {
  123819. // "$ref": "Operation"
  123820. // },
  123821. // "scopes": [
  123822. // "https://www.googleapis.com/auth/cloud-platform",
  123823. // "https://www.googleapis.com/auth/compute"
  123824. // ]
  123825. // }
  123826. }
  123827. // method id "compute.routes.delete":
  123828. type RoutesDeleteCall struct {
  123829. s *Service
  123830. project string
  123831. route string
  123832. urlParams_ gensupport.URLParams
  123833. ctx_ context.Context
  123834. header_ http.Header
  123835. }
  123836. // Delete: Deletes the specified Route resource.
  123837. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  123838. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  123839. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123840. c.project = project
  123841. c.route = route
  123842. return c
  123843. }
  123844. // RequestId sets the optional parameter "requestId": An optional
  123845. // request ID to identify requests. Specify a unique request ID so that
  123846. // if you must retry your request, the server will know to ignore the
  123847. // request if it has already been completed.
  123848. //
  123849. // For example, consider a situation where you make an initial request
  123850. // and the request times out. If you make the request again with the
  123851. // same request ID, the server can check if original operation with the
  123852. // same request ID was received, and if so, will ignore the second
  123853. // request. This prevents clients from accidentally creating duplicate
  123854. // commitments.
  123855. //
  123856. // The request ID must be a valid UUID with the exception that zero UUID
  123857. // is not supported (00000000-0000-0000-0000-000000000000).
  123858. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  123859. c.urlParams_.Set("requestId", requestId)
  123860. return c
  123861. }
  123862. // Fields allows partial responses to be retrieved. See
  123863. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123864. // for more information.
  123865. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  123866. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123867. return c
  123868. }
  123869. // Context sets the context to be used in this call's Do method. Any
  123870. // pending HTTP request will be aborted if the provided context is
  123871. // canceled.
  123872. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  123873. c.ctx_ = ctx
  123874. return c
  123875. }
  123876. // Header returns an http.Header that can be modified by the caller to
  123877. // add HTTP headers to the request.
  123878. func (c *RoutesDeleteCall) Header() http.Header {
  123879. if c.header_ == nil {
  123880. c.header_ = make(http.Header)
  123881. }
  123882. return c.header_
  123883. }
  123884. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  123885. reqHeaders := make(http.Header)
  123886. for k, v := range c.header_ {
  123887. reqHeaders[k] = v
  123888. }
  123889. reqHeaders.Set("User-Agent", c.s.userAgent())
  123890. var body io.Reader = nil
  123891. c.urlParams_.Set("alt", alt)
  123892. c.urlParams_.Set("prettyPrint", "false")
  123893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  123894. urls += "?" + c.urlParams_.Encode()
  123895. req, err := http.NewRequest("DELETE", urls, body)
  123896. if err != nil {
  123897. return nil, err
  123898. }
  123899. req.Header = reqHeaders
  123900. googleapi.Expand(req.URL, map[string]string{
  123901. "project": c.project,
  123902. "route": c.route,
  123903. })
  123904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123905. }
  123906. // Do executes the "compute.routes.delete" call.
  123907. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123908. // status code is an error. Response headers are in either
  123909. // *Operation.ServerResponse.Header or (if a response was returned at
  123910. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123911. // to check whether the returned error was because
  123912. // http.StatusNotModified was returned.
  123913. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123914. gensupport.SetOptions(c.urlParams_, opts...)
  123915. res, err := c.doRequest("json")
  123916. if res != nil && res.StatusCode == http.StatusNotModified {
  123917. if res.Body != nil {
  123918. res.Body.Close()
  123919. }
  123920. return nil, &googleapi.Error{
  123921. Code: res.StatusCode,
  123922. Header: res.Header,
  123923. }
  123924. }
  123925. if err != nil {
  123926. return nil, err
  123927. }
  123928. defer googleapi.CloseBody(res)
  123929. if err := googleapi.CheckResponse(res); err != nil {
  123930. return nil, err
  123931. }
  123932. ret := &Operation{
  123933. ServerResponse: googleapi.ServerResponse{
  123934. Header: res.Header,
  123935. HTTPStatusCode: res.StatusCode,
  123936. },
  123937. }
  123938. target := &ret
  123939. if err := gensupport.DecodeResponse(target, res); err != nil {
  123940. return nil, err
  123941. }
  123942. return ret, nil
  123943. // {
  123944. // "description": "Deletes the specified Route resource.",
  123945. // "httpMethod": "DELETE",
  123946. // "id": "compute.routes.delete",
  123947. // "parameterOrder": [
  123948. // "project",
  123949. // "route"
  123950. // ],
  123951. // "parameters": {
  123952. // "project": {
  123953. // "description": "Project ID for this request.",
  123954. // "location": "path",
  123955. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123956. // "required": true,
  123957. // "type": "string"
  123958. // },
  123959. // "requestId": {
  123960. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  123961. // "location": "query",
  123962. // "type": "string"
  123963. // },
  123964. // "route": {
  123965. // "description": "Name of the Route resource to delete.",
  123966. // "location": "path",
  123967. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123968. // "required": true,
  123969. // "type": "string"
  123970. // }
  123971. // },
  123972. // "path": "{project}/global/routes/{route}",
  123973. // "response": {
  123974. // "$ref": "Operation"
  123975. // },
  123976. // "scopes": [
  123977. // "https://www.googleapis.com/auth/cloud-platform",
  123978. // "https://www.googleapis.com/auth/compute"
  123979. // ]
  123980. // }
  123981. }
  123982. // method id "compute.routes.get":
  123983. type RoutesGetCall struct {
  123984. s *Service
  123985. project string
  123986. route string
  123987. urlParams_ gensupport.URLParams
  123988. ifNoneMatch_ string
  123989. ctx_ context.Context
  123990. header_ http.Header
  123991. }
  123992. // Get: Returns the specified Route resource. Gets a list of available
  123993. // routes by making a list() request.
  123994. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  123995. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  123996. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123997. c.project = project
  123998. c.route = route
  123999. return c
  124000. }
  124001. // Fields allows partial responses to be retrieved. See
  124002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124003. // for more information.
  124004. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  124005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124006. return c
  124007. }
  124008. // IfNoneMatch sets the optional parameter which makes the operation
  124009. // fail if the object's ETag matches the given value. This is useful for
  124010. // getting updates only after the object has changed since the last
  124011. // request. Use googleapi.IsNotModified to check whether the response
  124012. // error from Do is the result of In-None-Match.
  124013. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  124014. c.ifNoneMatch_ = entityTag
  124015. return c
  124016. }
  124017. // Context sets the context to be used in this call's Do method. Any
  124018. // pending HTTP request will be aborted if the provided context is
  124019. // canceled.
  124020. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  124021. c.ctx_ = ctx
  124022. return c
  124023. }
  124024. // Header returns an http.Header that can be modified by the caller to
  124025. // add HTTP headers to the request.
  124026. func (c *RoutesGetCall) Header() http.Header {
  124027. if c.header_ == nil {
  124028. c.header_ = make(http.Header)
  124029. }
  124030. return c.header_
  124031. }
  124032. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  124033. reqHeaders := make(http.Header)
  124034. for k, v := range c.header_ {
  124035. reqHeaders[k] = v
  124036. }
  124037. reqHeaders.Set("User-Agent", c.s.userAgent())
  124038. if c.ifNoneMatch_ != "" {
  124039. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  124040. }
  124041. var body io.Reader = nil
  124042. c.urlParams_.Set("alt", alt)
  124043. c.urlParams_.Set("prettyPrint", "false")
  124044. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  124045. urls += "?" + c.urlParams_.Encode()
  124046. req, err := http.NewRequest("GET", urls, body)
  124047. if err != nil {
  124048. return nil, err
  124049. }
  124050. req.Header = reqHeaders
  124051. googleapi.Expand(req.URL, map[string]string{
  124052. "project": c.project,
  124053. "route": c.route,
  124054. })
  124055. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124056. }
  124057. // Do executes the "compute.routes.get" call.
  124058. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  124059. // code is an error. Response headers are in either
  124060. // *Route.ServerResponse.Header or (if a response was returned at all)
  124061. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  124062. // check whether the returned error was because http.StatusNotModified
  124063. // was returned.
  124064. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  124065. gensupport.SetOptions(c.urlParams_, opts...)
  124066. res, err := c.doRequest("json")
  124067. if res != nil && res.StatusCode == http.StatusNotModified {
  124068. if res.Body != nil {
  124069. res.Body.Close()
  124070. }
  124071. return nil, &googleapi.Error{
  124072. Code: res.StatusCode,
  124073. Header: res.Header,
  124074. }
  124075. }
  124076. if err != nil {
  124077. return nil, err
  124078. }
  124079. defer googleapi.CloseBody(res)
  124080. if err := googleapi.CheckResponse(res); err != nil {
  124081. return nil, err
  124082. }
  124083. ret := &Route{
  124084. ServerResponse: googleapi.ServerResponse{
  124085. Header: res.Header,
  124086. HTTPStatusCode: res.StatusCode,
  124087. },
  124088. }
  124089. target := &ret
  124090. if err := gensupport.DecodeResponse(target, res); err != nil {
  124091. return nil, err
  124092. }
  124093. return ret, nil
  124094. // {
  124095. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  124096. // "httpMethod": "GET",
  124097. // "id": "compute.routes.get",
  124098. // "parameterOrder": [
  124099. // "project",
  124100. // "route"
  124101. // ],
  124102. // "parameters": {
  124103. // "project": {
  124104. // "description": "Project ID for this request.",
  124105. // "location": "path",
  124106. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124107. // "required": true,
  124108. // "type": "string"
  124109. // },
  124110. // "route": {
  124111. // "description": "Name of the Route resource to return.",
  124112. // "location": "path",
  124113. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  124114. // "required": true,
  124115. // "type": "string"
  124116. // }
  124117. // },
  124118. // "path": "{project}/global/routes/{route}",
  124119. // "response": {
  124120. // "$ref": "Route"
  124121. // },
  124122. // "scopes": [
  124123. // "https://www.googleapis.com/auth/cloud-platform",
  124124. // "https://www.googleapis.com/auth/compute",
  124125. // "https://www.googleapis.com/auth/compute.readonly"
  124126. // ]
  124127. // }
  124128. }
  124129. // method id "compute.routes.insert":
  124130. type RoutesInsertCall struct {
  124131. s *Service
  124132. project string
  124133. route *Route
  124134. urlParams_ gensupport.URLParams
  124135. ctx_ context.Context
  124136. header_ http.Header
  124137. }
  124138. // Insert: Creates a Route resource in the specified project using the
  124139. // data included in the request.
  124140. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  124141. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  124142. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124143. c.project = project
  124144. c.route = route
  124145. return c
  124146. }
  124147. // RequestId sets the optional parameter "requestId": An optional
  124148. // request ID to identify requests. Specify a unique request ID so that
  124149. // if you must retry your request, the server will know to ignore the
  124150. // request if it has already been completed.
  124151. //
  124152. // For example, consider a situation where you make an initial request
  124153. // and the request times out. If you make the request again with the
  124154. // same request ID, the server can check if original operation with the
  124155. // same request ID was received, and if so, will ignore the second
  124156. // request. This prevents clients from accidentally creating duplicate
  124157. // commitments.
  124158. //
  124159. // The request ID must be a valid UUID with the exception that zero UUID
  124160. // is not supported (00000000-0000-0000-0000-000000000000).
  124161. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  124162. c.urlParams_.Set("requestId", requestId)
  124163. return c
  124164. }
  124165. // Fields allows partial responses to be retrieved. See
  124166. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124167. // for more information.
  124168. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  124169. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124170. return c
  124171. }
  124172. // Context sets the context to be used in this call's Do method. Any
  124173. // pending HTTP request will be aborted if the provided context is
  124174. // canceled.
  124175. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  124176. c.ctx_ = ctx
  124177. return c
  124178. }
  124179. // Header returns an http.Header that can be modified by the caller to
  124180. // add HTTP headers to the request.
  124181. func (c *RoutesInsertCall) Header() http.Header {
  124182. if c.header_ == nil {
  124183. c.header_ = make(http.Header)
  124184. }
  124185. return c.header_
  124186. }
  124187. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  124188. reqHeaders := make(http.Header)
  124189. for k, v := range c.header_ {
  124190. reqHeaders[k] = v
  124191. }
  124192. reqHeaders.Set("User-Agent", c.s.userAgent())
  124193. var body io.Reader = nil
  124194. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  124195. if err != nil {
  124196. return nil, err
  124197. }
  124198. reqHeaders.Set("Content-Type", "application/json")
  124199. c.urlParams_.Set("alt", alt)
  124200. c.urlParams_.Set("prettyPrint", "false")
  124201. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  124202. urls += "?" + c.urlParams_.Encode()
  124203. req, err := http.NewRequest("POST", urls, body)
  124204. if err != nil {
  124205. return nil, err
  124206. }
  124207. req.Header = reqHeaders
  124208. googleapi.Expand(req.URL, map[string]string{
  124209. "project": c.project,
  124210. })
  124211. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124212. }
  124213. // Do executes the "compute.routes.insert" call.
  124214. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  124215. // status code is an error. Response headers are in either
  124216. // *Operation.ServerResponse.Header or (if a response was returned at
  124217. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  124218. // to check whether the returned error was because
  124219. // http.StatusNotModified was returned.
  124220. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  124221. gensupport.SetOptions(c.urlParams_, opts...)
  124222. res, err := c.doRequest("json")
  124223. if res != nil && res.StatusCode == http.StatusNotModified {
  124224. if res.Body != nil {
  124225. res.Body.Close()
  124226. }
  124227. return nil, &googleapi.Error{
  124228. Code: res.StatusCode,
  124229. Header: res.Header,
  124230. }
  124231. }
  124232. if err != nil {
  124233. return nil, err
  124234. }
  124235. defer googleapi.CloseBody(res)
  124236. if err := googleapi.CheckResponse(res); err != nil {
  124237. return nil, err
  124238. }
  124239. ret := &Operation{
  124240. ServerResponse: googleapi.ServerResponse{
  124241. Header: res.Header,
  124242. HTTPStatusCode: res.StatusCode,
  124243. },
  124244. }
  124245. target := &ret
  124246. if err := gensupport.DecodeResponse(target, res); err != nil {
  124247. return nil, err
  124248. }
  124249. return ret, nil
  124250. // {
  124251. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  124252. // "httpMethod": "POST",
  124253. // "id": "compute.routes.insert",
  124254. // "parameterOrder": [
  124255. // "project"
  124256. // ],
  124257. // "parameters": {
  124258. // "project": {
  124259. // "description": "Project ID for this request.",
  124260. // "location": "path",
  124261. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124262. // "required": true,
  124263. // "type": "string"
  124264. // },
  124265. // "requestId": {
  124266. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  124267. // "location": "query",
  124268. // "type": "string"
  124269. // }
  124270. // },
  124271. // "path": "{project}/global/routes",
  124272. // "request": {
  124273. // "$ref": "Route"
  124274. // },
  124275. // "response": {
  124276. // "$ref": "Operation"
  124277. // },
  124278. // "scopes": [
  124279. // "https://www.googleapis.com/auth/cloud-platform",
  124280. // "https://www.googleapis.com/auth/compute"
  124281. // ]
  124282. // }
  124283. }
  124284. // method id "compute.routes.list":
  124285. type RoutesListCall struct {
  124286. s *Service
  124287. project string
  124288. urlParams_ gensupport.URLParams
  124289. ifNoneMatch_ string
  124290. ctx_ context.Context
  124291. header_ http.Header
  124292. }
  124293. // List: Retrieves the list of Route resources available to the
  124294. // specified project.
  124295. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  124296. func (r *RoutesService) List(project string) *RoutesListCall {
  124297. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124298. c.project = project
  124299. return c
  124300. }
  124301. // Filter sets the optional parameter "filter": A filter expression that
  124302. // filters resources listed in the response. The expression must specify
  124303. // the field name, a comparison operator, and the value that you want to
  124304. // use for filtering. The value must be a string, a number, or a
  124305. // boolean. The comparison operator must be either =, !=, >, or <.
  124306. //
  124307. // For example, if you are filtering Compute Engine instances, you can
  124308. // exclude instances named example-instance by specifying name !=
  124309. // example-instance.
  124310. //
  124311. // You can also filter nested fields. For example, you could specify
  124312. // scheduling.automaticRestart = false to include instances only if they
  124313. // are not scheduled for automatic restarts. You can use filtering on
  124314. // nested fields to filter based on resource labels.
  124315. //
  124316. // To filter on multiple expressions, provide each separate expression
  124317. // within parentheses. For example, (scheduling.automaticRestart = true)
  124318. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  124319. // AND expression. However, you can include AND and OR expressions
  124320. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  124321. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  124322. // true).
  124323. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  124324. c.urlParams_.Set("filter", filter)
  124325. return c
  124326. }
  124327. // MaxResults sets the optional parameter "maxResults": The maximum
  124328. // number of results per page that should be returned. If the number of
  124329. // available results is larger than maxResults, Compute Engine returns a
  124330. // nextPageToken that can be used to get the next page of results in
  124331. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  124332. // (Default: 500)
  124333. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  124334. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  124335. return c
  124336. }
  124337. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  124338. // a certain order. By default, results are returned in alphanumerical
  124339. // order based on the resource name.
  124340. //
  124341. // You can also sort results in descending order based on the creation
  124342. // timestamp using orderBy="creationTimestamp desc". This sorts results
  124343. // based on the creationTimestamp field in reverse chronological order
  124344. // (newest result first). Use this to sort resources like operations so
  124345. // that the newest operation is returned first.
  124346. //
  124347. // Currently, only sorting by name or creationTimestamp desc is
  124348. // supported.
  124349. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  124350. c.urlParams_.Set("orderBy", orderBy)
  124351. return c
  124352. }
  124353. // PageToken sets the optional parameter "pageToken": Specifies a page
  124354. // token to use. Set pageToken to the nextPageToken returned by a
  124355. // previous list request to get the next page of results.
  124356. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  124357. c.urlParams_.Set("pageToken", pageToken)
  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 *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  124364. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124365. return c
  124366. }
  124367. // IfNoneMatch sets the optional parameter which makes the operation
  124368. // fail if the object's ETag matches the given value. This is useful for
  124369. // getting updates only after the object has changed since the last
  124370. // request. Use googleapi.IsNotModified to check whether the response
  124371. // error from Do is the result of In-None-Match.
  124372. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  124373. c.ifNoneMatch_ = entityTag
  124374. return c
  124375. }
  124376. // Context sets the context to be used in this call's Do method. Any
  124377. // pending HTTP request will be aborted if the provided context is
  124378. // canceled.
  124379. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  124380. c.ctx_ = ctx
  124381. return c
  124382. }
  124383. // Header returns an http.Header that can be modified by the caller to
  124384. // add HTTP headers to the request.
  124385. func (c *RoutesListCall) Header() http.Header {
  124386. if c.header_ == nil {
  124387. c.header_ = make(http.Header)
  124388. }
  124389. return c.header_
  124390. }
  124391. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  124392. reqHeaders := make(http.Header)
  124393. for k, v := range c.header_ {
  124394. reqHeaders[k] = v
  124395. }
  124396. reqHeaders.Set("User-Agent", c.s.userAgent())
  124397. if c.ifNoneMatch_ != "" {
  124398. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  124399. }
  124400. var body io.Reader = nil
  124401. c.urlParams_.Set("alt", alt)
  124402. c.urlParams_.Set("prettyPrint", "false")
  124403. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  124404. urls += "?" + c.urlParams_.Encode()
  124405. req, err := http.NewRequest("GET", urls, body)
  124406. if err != nil {
  124407. return nil, err
  124408. }
  124409. req.Header = reqHeaders
  124410. googleapi.Expand(req.URL, map[string]string{
  124411. "project": c.project,
  124412. })
  124413. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124414. }
  124415. // Do executes the "compute.routes.list" call.
  124416. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  124417. // status code is an error. Response headers are in either
  124418. // *RouteList.ServerResponse.Header or (if a response was returned at
  124419. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  124420. // to check whether the returned error was because
  124421. // http.StatusNotModified was returned.
  124422. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  124423. gensupport.SetOptions(c.urlParams_, opts...)
  124424. res, err := c.doRequest("json")
  124425. if res != nil && res.StatusCode == http.StatusNotModified {
  124426. if res.Body != nil {
  124427. res.Body.Close()
  124428. }
  124429. return nil, &googleapi.Error{
  124430. Code: res.StatusCode,
  124431. Header: res.Header,
  124432. }
  124433. }
  124434. if err != nil {
  124435. return nil, err
  124436. }
  124437. defer googleapi.CloseBody(res)
  124438. if err := googleapi.CheckResponse(res); err != nil {
  124439. return nil, err
  124440. }
  124441. ret := &RouteList{
  124442. ServerResponse: googleapi.ServerResponse{
  124443. Header: res.Header,
  124444. HTTPStatusCode: res.StatusCode,
  124445. },
  124446. }
  124447. target := &ret
  124448. if err := gensupport.DecodeResponse(target, res); err != nil {
  124449. return nil, err
  124450. }
  124451. return ret, nil
  124452. // {
  124453. // "description": "Retrieves the list of Route resources available to the specified project.",
  124454. // "httpMethod": "GET",
  124455. // "id": "compute.routes.list",
  124456. // "parameterOrder": [
  124457. // "project"
  124458. // ],
  124459. // "parameters": {
  124460. // "filter": {
  124461. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  124462. // "location": "query",
  124463. // "type": "string"
  124464. // },
  124465. // "maxResults": {
  124466. // "default": "500",
  124467. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  124468. // "format": "uint32",
  124469. // "location": "query",
  124470. // "minimum": "0",
  124471. // "type": "integer"
  124472. // },
  124473. // "orderBy": {
  124474. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  124475. // "location": "query",
  124476. // "type": "string"
  124477. // },
  124478. // "pageToken": {
  124479. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  124480. // "location": "query",
  124481. // "type": "string"
  124482. // },
  124483. // "project": {
  124484. // "description": "Project ID for this request.",
  124485. // "location": "path",
  124486. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124487. // "required": true,
  124488. // "type": "string"
  124489. // }
  124490. // },
  124491. // "path": "{project}/global/routes",
  124492. // "response": {
  124493. // "$ref": "RouteList"
  124494. // },
  124495. // "scopes": [
  124496. // "https://www.googleapis.com/auth/cloud-platform",
  124497. // "https://www.googleapis.com/auth/compute",
  124498. // "https://www.googleapis.com/auth/compute.readonly"
  124499. // ]
  124500. // }
  124501. }
  124502. // Pages invokes f for each page of results.
  124503. // A non-nil error returned from f will halt the iteration.
  124504. // The provided context supersedes any context provided to the Context method.
  124505. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  124506. c.ctx_ = ctx
  124507. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  124508. for {
  124509. x, err := c.Do()
  124510. if err != nil {
  124511. return err
  124512. }
  124513. if err := f(x); err != nil {
  124514. return err
  124515. }
  124516. if x.NextPageToken == "" {
  124517. return nil
  124518. }
  124519. c.PageToken(x.NextPageToken)
  124520. }
  124521. }
  124522. // method id "compute.routes.testIamPermissions":
  124523. type RoutesTestIamPermissionsCall struct {
  124524. s *Service
  124525. project string
  124526. resource string
  124527. testpermissionsrequest *TestPermissionsRequest
  124528. urlParams_ gensupport.URLParams
  124529. ctx_ context.Context
  124530. header_ http.Header
  124531. }
  124532. // TestIamPermissions: Returns permissions that a caller has on the
  124533. // specified resource.
  124534. func (r *RoutesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutesTestIamPermissionsCall {
  124535. c := &RoutesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124536. c.project = project
  124537. c.resource = resource
  124538. c.testpermissionsrequest = testpermissionsrequest
  124539. return c
  124540. }
  124541. // Fields allows partial responses to be retrieved. See
  124542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124543. // for more information.
  124544. func (c *RoutesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutesTestIamPermissionsCall {
  124545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124546. return c
  124547. }
  124548. // Context sets the context to be used in this call's Do method. Any
  124549. // pending HTTP request will be aborted if the provided context is
  124550. // canceled.
  124551. func (c *RoutesTestIamPermissionsCall) Context(ctx context.Context) *RoutesTestIamPermissionsCall {
  124552. c.ctx_ = ctx
  124553. return c
  124554. }
  124555. // Header returns an http.Header that can be modified by the caller to
  124556. // add HTTP headers to the request.
  124557. func (c *RoutesTestIamPermissionsCall) Header() http.Header {
  124558. if c.header_ == nil {
  124559. c.header_ = make(http.Header)
  124560. }
  124561. return c.header_
  124562. }
  124563. func (c *RoutesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  124564. reqHeaders := make(http.Header)
  124565. for k, v := range c.header_ {
  124566. reqHeaders[k] = v
  124567. }
  124568. reqHeaders.Set("User-Agent", c.s.userAgent())
  124569. var body io.Reader = nil
  124570. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  124571. if err != nil {
  124572. return nil, err
  124573. }
  124574. reqHeaders.Set("Content-Type", "application/json")
  124575. c.urlParams_.Set("alt", alt)
  124576. c.urlParams_.Set("prettyPrint", "false")
  124577. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{resource}/testIamPermissions")
  124578. urls += "?" + c.urlParams_.Encode()
  124579. req, err := http.NewRequest("POST", urls, body)
  124580. if err != nil {
  124581. return nil, err
  124582. }
  124583. req.Header = reqHeaders
  124584. googleapi.Expand(req.URL, map[string]string{
  124585. "project": c.project,
  124586. "resource": c.resource,
  124587. })
  124588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124589. }
  124590. // Do executes the "compute.routes.testIamPermissions" call.
  124591. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  124592. // non-2xx status code is an error. Response headers are in either
  124593. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  124594. // returned at all) in error.(*googleapi.Error).Header. Use
  124595. // googleapi.IsNotModified to check whether the returned error was
  124596. // because http.StatusNotModified was returned.
  124597. func (c *RoutesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  124598. gensupport.SetOptions(c.urlParams_, opts...)
  124599. res, err := c.doRequest("json")
  124600. if res != nil && res.StatusCode == http.StatusNotModified {
  124601. if res.Body != nil {
  124602. res.Body.Close()
  124603. }
  124604. return nil, &googleapi.Error{
  124605. Code: res.StatusCode,
  124606. Header: res.Header,
  124607. }
  124608. }
  124609. if err != nil {
  124610. return nil, err
  124611. }
  124612. defer googleapi.CloseBody(res)
  124613. if err := googleapi.CheckResponse(res); err != nil {
  124614. return nil, err
  124615. }
  124616. ret := &TestPermissionsResponse{
  124617. ServerResponse: googleapi.ServerResponse{
  124618. Header: res.Header,
  124619. HTTPStatusCode: res.StatusCode,
  124620. },
  124621. }
  124622. target := &ret
  124623. if err := gensupport.DecodeResponse(target, res); err != nil {
  124624. return nil, err
  124625. }
  124626. return ret, nil
  124627. // {
  124628. // "description": "Returns permissions that a caller has on the specified resource.",
  124629. // "httpMethod": "POST",
  124630. // "id": "compute.routes.testIamPermissions",
  124631. // "parameterOrder": [
  124632. // "project",
  124633. // "resource"
  124634. // ],
  124635. // "parameters": {
  124636. // "project": {
  124637. // "description": "Project ID for this request.",
  124638. // "location": "path",
  124639. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124640. // "required": true,
  124641. // "type": "string"
  124642. // },
  124643. // "resource": {
  124644. // "description": "Name or id of the resource for this request.",
  124645. // "location": "path",
  124646. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  124647. // "required": true,
  124648. // "type": "string"
  124649. // }
  124650. // },
  124651. // "path": "{project}/global/routes/{resource}/testIamPermissions",
  124652. // "request": {
  124653. // "$ref": "TestPermissionsRequest"
  124654. // },
  124655. // "response": {
  124656. // "$ref": "TestPermissionsResponse"
  124657. // },
  124658. // "scopes": [
  124659. // "https://www.googleapis.com/auth/cloud-platform",
  124660. // "https://www.googleapis.com/auth/compute",
  124661. // "https://www.googleapis.com/auth/compute.readonly"
  124662. // ]
  124663. // }
  124664. }
  124665. // method id "compute.securityPolicies.addRule":
  124666. type SecurityPoliciesAddRuleCall struct {
  124667. s *Service
  124668. project string
  124669. securityPolicy string
  124670. securitypolicyrule *SecurityPolicyRule
  124671. urlParams_ gensupport.URLParams
  124672. ctx_ context.Context
  124673. header_ http.Header
  124674. }
  124675. // AddRule: Inserts a rule into a security policy.
  124676. func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
  124677. c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124678. c.project = project
  124679. c.securityPolicy = securityPolicy
  124680. c.securitypolicyrule = securitypolicyrule
  124681. return c
  124682. }
  124683. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  124684. // request will not be committed.
  124685. func (c *SecurityPoliciesAddRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesAddRuleCall {
  124686. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  124687. return c
  124688. }
  124689. // Fields allows partial responses to be retrieved. See
  124690. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124691. // for more information.
  124692. func (c *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
  124693. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124694. return c
  124695. }
  124696. // Context sets the context to be used in this call's Do method. Any
  124697. // pending HTTP request will be aborted if the provided context is
  124698. // canceled.
  124699. func (c *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
  124700. c.ctx_ = ctx
  124701. return c
  124702. }
  124703. // Header returns an http.Header that can be modified by the caller to
  124704. // add HTTP headers to the request.
  124705. func (c *SecurityPoliciesAddRuleCall) Header() http.Header {
  124706. if c.header_ == nil {
  124707. c.header_ = make(http.Header)
  124708. }
  124709. return c.header_
  124710. }
  124711. func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  124712. reqHeaders := make(http.Header)
  124713. for k, v := range c.header_ {
  124714. reqHeaders[k] = v
  124715. }
  124716. reqHeaders.Set("User-Agent", c.s.userAgent())
  124717. var body io.Reader = nil
  124718. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  124719. if err != nil {
  124720. return nil, err
  124721. }
  124722. reqHeaders.Set("Content-Type", "application/json")
  124723. c.urlParams_.Set("alt", alt)
  124724. c.urlParams_.Set("prettyPrint", "false")
  124725. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/addRule")
  124726. urls += "?" + c.urlParams_.Encode()
  124727. req, err := http.NewRequest("POST", urls, body)
  124728. if err != nil {
  124729. return nil, err
  124730. }
  124731. req.Header = reqHeaders
  124732. googleapi.Expand(req.URL, map[string]string{
  124733. "project": c.project,
  124734. "securityPolicy": c.securityPolicy,
  124735. })
  124736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124737. }
  124738. // Do executes the "compute.securityPolicies.addRule" call.
  124739. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  124740. // status code is an error. Response headers are in either
  124741. // *Operation.ServerResponse.Header or (if a response was returned at
  124742. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  124743. // to check whether the returned error was because
  124744. // http.StatusNotModified was returned.
  124745. func (c *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  124746. gensupport.SetOptions(c.urlParams_, opts...)
  124747. res, err := c.doRequest("json")
  124748. if res != nil && res.StatusCode == http.StatusNotModified {
  124749. if res.Body != nil {
  124750. res.Body.Close()
  124751. }
  124752. return nil, &googleapi.Error{
  124753. Code: res.StatusCode,
  124754. Header: res.Header,
  124755. }
  124756. }
  124757. if err != nil {
  124758. return nil, err
  124759. }
  124760. defer googleapi.CloseBody(res)
  124761. if err := googleapi.CheckResponse(res); err != nil {
  124762. return nil, err
  124763. }
  124764. ret := &Operation{
  124765. ServerResponse: googleapi.ServerResponse{
  124766. Header: res.Header,
  124767. HTTPStatusCode: res.StatusCode,
  124768. },
  124769. }
  124770. target := &ret
  124771. if err := gensupport.DecodeResponse(target, res); err != nil {
  124772. return nil, err
  124773. }
  124774. return ret, nil
  124775. // {
  124776. // "description": "Inserts a rule into a security policy.",
  124777. // "httpMethod": "POST",
  124778. // "id": "compute.securityPolicies.addRule",
  124779. // "parameterOrder": [
  124780. // "project",
  124781. // "securityPolicy"
  124782. // ],
  124783. // "parameters": {
  124784. // "project": {
  124785. // "description": "Project ID for this request.",
  124786. // "location": "path",
  124787. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124788. // "required": true,
  124789. // "type": "string"
  124790. // },
  124791. // "securityPolicy": {
  124792. // "description": "Name of the security policy to update.",
  124793. // "location": "path",
  124794. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  124795. // "required": true,
  124796. // "type": "string"
  124797. // },
  124798. // "validateOnly": {
  124799. // "description": "If true, the request will not be committed.",
  124800. // "location": "query",
  124801. // "type": "boolean"
  124802. // }
  124803. // },
  124804. // "path": "{project}/global/securityPolicies/{securityPolicy}/addRule",
  124805. // "request": {
  124806. // "$ref": "SecurityPolicyRule"
  124807. // },
  124808. // "response": {
  124809. // "$ref": "Operation"
  124810. // },
  124811. // "scopes": [
  124812. // "https://www.googleapis.com/auth/cloud-platform",
  124813. // "https://www.googleapis.com/auth/compute"
  124814. // ]
  124815. // }
  124816. }
  124817. // method id "compute.securityPolicies.delete":
  124818. type SecurityPoliciesDeleteCall struct {
  124819. s *Service
  124820. project string
  124821. securityPolicy string
  124822. urlParams_ gensupport.URLParams
  124823. ctx_ context.Context
  124824. header_ http.Header
  124825. }
  124826. // Delete: Deletes the specified policy.
  124827. func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
  124828. c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124829. c.project = project
  124830. c.securityPolicy = securityPolicy
  124831. return c
  124832. }
  124833. // RequestId sets the optional parameter "requestId": An optional
  124834. // request ID to identify requests. Specify a unique request ID so that
  124835. // if you must retry your request, the server will know to ignore the
  124836. // request if it has already been completed.
  124837. //
  124838. // For example, consider a situation where you make an initial request
  124839. // and the request times out. If you make the request again with the
  124840. // same request ID, the server can check if original operation with the
  124841. // same request ID was received, and if so, will ignore the second
  124842. // request. This prevents clients from accidentally creating duplicate
  124843. // commitments.
  124844. //
  124845. // The request ID must be a valid UUID with the exception that zero UUID
  124846. // is not supported (00000000-0000-0000-0000-000000000000).
  124847. func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
  124848. c.urlParams_.Set("requestId", requestId)
  124849. return c
  124850. }
  124851. // Fields allows partial responses to be retrieved. See
  124852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124853. // for more information.
  124854. func (c *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
  124855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124856. return c
  124857. }
  124858. // Context sets the context to be used in this call's Do method. Any
  124859. // pending HTTP request will be aborted if the provided context is
  124860. // canceled.
  124861. func (c *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
  124862. c.ctx_ = ctx
  124863. return c
  124864. }
  124865. // Header returns an http.Header that can be modified by the caller to
  124866. // add HTTP headers to the request.
  124867. func (c *SecurityPoliciesDeleteCall) Header() http.Header {
  124868. if c.header_ == nil {
  124869. c.header_ = make(http.Header)
  124870. }
  124871. return c.header_
  124872. }
  124873. func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  124874. reqHeaders := make(http.Header)
  124875. for k, v := range c.header_ {
  124876. reqHeaders[k] = v
  124877. }
  124878. reqHeaders.Set("User-Agent", c.s.userAgent())
  124879. var body io.Reader = nil
  124880. c.urlParams_.Set("alt", alt)
  124881. c.urlParams_.Set("prettyPrint", "false")
  124882. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  124883. urls += "?" + c.urlParams_.Encode()
  124884. req, err := http.NewRequest("DELETE", urls, body)
  124885. if err != nil {
  124886. return nil, err
  124887. }
  124888. req.Header = reqHeaders
  124889. googleapi.Expand(req.URL, map[string]string{
  124890. "project": c.project,
  124891. "securityPolicy": c.securityPolicy,
  124892. })
  124893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124894. }
  124895. // Do executes the "compute.securityPolicies.delete" call.
  124896. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  124897. // status code is an error. Response headers are in either
  124898. // *Operation.ServerResponse.Header or (if a response was returned at
  124899. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  124900. // to check whether the returned error was because
  124901. // http.StatusNotModified was returned.
  124902. func (c *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  124903. gensupport.SetOptions(c.urlParams_, opts...)
  124904. res, err := c.doRequest("json")
  124905. if res != nil && res.StatusCode == http.StatusNotModified {
  124906. if res.Body != nil {
  124907. res.Body.Close()
  124908. }
  124909. return nil, &googleapi.Error{
  124910. Code: res.StatusCode,
  124911. Header: res.Header,
  124912. }
  124913. }
  124914. if err != nil {
  124915. return nil, err
  124916. }
  124917. defer googleapi.CloseBody(res)
  124918. if err := googleapi.CheckResponse(res); err != nil {
  124919. return nil, err
  124920. }
  124921. ret := &Operation{
  124922. ServerResponse: googleapi.ServerResponse{
  124923. Header: res.Header,
  124924. HTTPStatusCode: res.StatusCode,
  124925. },
  124926. }
  124927. target := &ret
  124928. if err := gensupport.DecodeResponse(target, res); err != nil {
  124929. return nil, err
  124930. }
  124931. return ret, nil
  124932. // {
  124933. // "description": "Deletes the specified policy.",
  124934. // "httpMethod": "DELETE",
  124935. // "id": "compute.securityPolicies.delete",
  124936. // "parameterOrder": [
  124937. // "project",
  124938. // "securityPolicy"
  124939. // ],
  124940. // "parameters": {
  124941. // "project": {
  124942. // "description": "Project ID for this request.",
  124943. // "location": "path",
  124944. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124945. // "required": true,
  124946. // "type": "string"
  124947. // },
  124948. // "requestId": {
  124949. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  124950. // "location": "query",
  124951. // "type": "string"
  124952. // },
  124953. // "securityPolicy": {
  124954. // "description": "Name of the security policy to delete.",
  124955. // "location": "path",
  124956. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  124957. // "required": true,
  124958. // "type": "string"
  124959. // }
  124960. // },
  124961. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  124962. // "response": {
  124963. // "$ref": "Operation"
  124964. // },
  124965. // "scopes": [
  124966. // "https://www.googleapis.com/auth/cloud-platform",
  124967. // "https://www.googleapis.com/auth/compute"
  124968. // ]
  124969. // }
  124970. }
  124971. // method id "compute.securityPolicies.get":
  124972. type SecurityPoliciesGetCall struct {
  124973. s *Service
  124974. project string
  124975. securityPolicy string
  124976. urlParams_ gensupport.URLParams
  124977. ifNoneMatch_ string
  124978. ctx_ context.Context
  124979. header_ http.Header
  124980. }
  124981. // Get: List all of the ordered rules present in a single specified
  124982. // policy.
  124983. func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
  124984. c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124985. c.project = project
  124986. c.securityPolicy = securityPolicy
  124987. return c
  124988. }
  124989. // Fields allows partial responses to be retrieved. See
  124990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124991. // for more information.
  124992. func (c *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
  124993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124994. return c
  124995. }
  124996. // IfNoneMatch sets the optional parameter which makes the operation
  124997. // fail if the object's ETag matches the given value. This is useful for
  124998. // getting updates only after the object has changed since the last
  124999. // request. Use googleapi.IsNotModified to check whether the response
  125000. // error from Do is the result of In-None-Match.
  125001. func (c *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
  125002. c.ifNoneMatch_ = entityTag
  125003. return c
  125004. }
  125005. // Context sets the context to be used in this call's Do method. Any
  125006. // pending HTTP request will be aborted if the provided context is
  125007. // canceled.
  125008. func (c *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
  125009. c.ctx_ = ctx
  125010. return c
  125011. }
  125012. // Header returns an http.Header that can be modified by the caller to
  125013. // add HTTP headers to the request.
  125014. func (c *SecurityPoliciesGetCall) Header() http.Header {
  125015. if c.header_ == nil {
  125016. c.header_ = make(http.Header)
  125017. }
  125018. return c.header_
  125019. }
  125020. func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  125021. reqHeaders := make(http.Header)
  125022. for k, v := range c.header_ {
  125023. reqHeaders[k] = v
  125024. }
  125025. reqHeaders.Set("User-Agent", c.s.userAgent())
  125026. if c.ifNoneMatch_ != "" {
  125027. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  125028. }
  125029. var body io.Reader = nil
  125030. c.urlParams_.Set("alt", alt)
  125031. c.urlParams_.Set("prettyPrint", "false")
  125032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  125033. urls += "?" + c.urlParams_.Encode()
  125034. req, err := http.NewRequest("GET", urls, body)
  125035. if err != nil {
  125036. return nil, err
  125037. }
  125038. req.Header = reqHeaders
  125039. googleapi.Expand(req.URL, map[string]string{
  125040. "project": c.project,
  125041. "securityPolicy": c.securityPolicy,
  125042. })
  125043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125044. }
  125045. // Do executes the "compute.securityPolicies.get" call.
  125046. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  125047. // status code is an error. Response headers are in either
  125048. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  125049. // at all) in error.(*googleapi.Error).Header. Use
  125050. // googleapi.IsNotModified to check whether the returned error was
  125051. // because http.StatusNotModified was returned.
  125052. func (c *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  125053. gensupport.SetOptions(c.urlParams_, opts...)
  125054. res, err := c.doRequest("json")
  125055. if res != nil && res.StatusCode == http.StatusNotModified {
  125056. if res.Body != nil {
  125057. res.Body.Close()
  125058. }
  125059. return nil, &googleapi.Error{
  125060. Code: res.StatusCode,
  125061. Header: res.Header,
  125062. }
  125063. }
  125064. if err != nil {
  125065. return nil, err
  125066. }
  125067. defer googleapi.CloseBody(res)
  125068. if err := googleapi.CheckResponse(res); err != nil {
  125069. return nil, err
  125070. }
  125071. ret := &SecurityPolicy{
  125072. ServerResponse: googleapi.ServerResponse{
  125073. Header: res.Header,
  125074. HTTPStatusCode: res.StatusCode,
  125075. },
  125076. }
  125077. target := &ret
  125078. if err := gensupport.DecodeResponse(target, res); err != nil {
  125079. return nil, err
  125080. }
  125081. return ret, nil
  125082. // {
  125083. // "description": "List all of the ordered rules present in a single specified policy.",
  125084. // "httpMethod": "GET",
  125085. // "id": "compute.securityPolicies.get",
  125086. // "parameterOrder": [
  125087. // "project",
  125088. // "securityPolicy"
  125089. // ],
  125090. // "parameters": {
  125091. // "project": {
  125092. // "description": "Project ID for this request.",
  125093. // "location": "path",
  125094. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125095. // "required": true,
  125096. // "type": "string"
  125097. // },
  125098. // "securityPolicy": {
  125099. // "description": "Name of the security policy to get.",
  125100. // "location": "path",
  125101. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  125102. // "required": true,
  125103. // "type": "string"
  125104. // }
  125105. // },
  125106. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  125107. // "response": {
  125108. // "$ref": "SecurityPolicy"
  125109. // },
  125110. // "scopes": [
  125111. // "https://www.googleapis.com/auth/cloud-platform",
  125112. // "https://www.googleapis.com/auth/compute",
  125113. // "https://www.googleapis.com/auth/compute.readonly"
  125114. // ]
  125115. // }
  125116. }
  125117. // method id "compute.securityPolicies.getRule":
  125118. type SecurityPoliciesGetRuleCall struct {
  125119. s *Service
  125120. project string
  125121. securityPolicy string
  125122. urlParams_ gensupport.URLParams
  125123. ifNoneMatch_ string
  125124. ctx_ context.Context
  125125. header_ http.Header
  125126. }
  125127. // GetRule: Gets a rule at the specified priority.
  125128. func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
  125129. c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125130. c.project = project
  125131. c.securityPolicy = securityPolicy
  125132. return c
  125133. }
  125134. // Priority sets the optional parameter "priority": The priority of the
  125135. // rule to get from the security policy.
  125136. func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
  125137. c.urlParams_.Set("priority", fmt.Sprint(priority))
  125138. return c
  125139. }
  125140. // Fields allows partial responses to be retrieved. See
  125141. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125142. // for more information.
  125143. func (c *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
  125144. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125145. return c
  125146. }
  125147. // IfNoneMatch sets the optional parameter which makes the operation
  125148. // fail if the object's ETag matches the given value. This is useful for
  125149. // getting updates only after the object has changed since the last
  125150. // request. Use googleapi.IsNotModified to check whether the response
  125151. // error from Do is the result of In-None-Match.
  125152. func (c *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
  125153. c.ifNoneMatch_ = entityTag
  125154. return c
  125155. }
  125156. // Context sets the context to be used in this call's Do method. Any
  125157. // pending HTTP request will be aborted if the provided context is
  125158. // canceled.
  125159. func (c *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
  125160. c.ctx_ = ctx
  125161. return c
  125162. }
  125163. // Header returns an http.Header that can be modified by the caller to
  125164. // add HTTP headers to the request.
  125165. func (c *SecurityPoliciesGetRuleCall) Header() http.Header {
  125166. if c.header_ == nil {
  125167. c.header_ = make(http.Header)
  125168. }
  125169. return c.header_
  125170. }
  125171. func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  125172. reqHeaders := make(http.Header)
  125173. for k, v := range c.header_ {
  125174. reqHeaders[k] = v
  125175. }
  125176. reqHeaders.Set("User-Agent", c.s.userAgent())
  125177. if c.ifNoneMatch_ != "" {
  125178. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  125179. }
  125180. var body io.Reader = nil
  125181. c.urlParams_.Set("alt", alt)
  125182. c.urlParams_.Set("prettyPrint", "false")
  125183. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/getRule")
  125184. urls += "?" + c.urlParams_.Encode()
  125185. req, err := http.NewRequest("GET", urls, body)
  125186. if err != nil {
  125187. return nil, err
  125188. }
  125189. req.Header = reqHeaders
  125190. googleapi.Expand(req.URL, map[string]string{
  125191. "project": c.project,
  125192. "securityPolicy": c.securityPolicy,
  125193. })
  125194. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125195. }
  125196. // Do executes the "compute.securityPolicies.getRule" call.
  125197. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  125198. // non-2xx status code is an error. Response headers are in either
  125199. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  125200. // returned at all) in error.(*googleapi.Error).Header. Use
  125201. // googleapi.IsNotModified to check whether the returned error was
  125202. // because http.StatusNotModified was returned.
  125203. func (c *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  125204. gensupport.SetOptions(c.urlParams_, opts...)
  125205. res, err := c.doRequest("json")
  125206. if res != nil && res.StatusCode == http.StatusNotModified {
  125207. if res.Body != nil {
  125208. res.Body.Close()
  125209. }
  125210. return nil, &googleapi.Error{
  125211. Code: res.StatusCode,
  125212. Header: res.Header,
  125213. }
  125214. }
  125215. if err != nil {
  125216. return nil, err
  125217. }
  125218. defer googleapi.CloseBody(res)
  125219. if err := googleapi.CheckResponse(res); err != nil {
  125220. return nil, err
  125221. }
  125222. ret := &SecurityPolicyRule{
  125223. ServerResponse: googleapi.ServerResponse{
  125224. Header: res.Header,
  125225. HTTPStatusCode: res.StatusCode,
  125226. },
  125227. }
  125228. target := &ret
  125229. if err := gensupport.DecodeResponse(target, res); err != nil {
  125230. return nil, err
  125231. }
  125232. return ret, nil
  125233. // {
  125234. // "description": "Gets a rule at the specified priority.",
  125235. // "httpMethod": "GET",
  125236. // "id": "compute.securityPolicies.getRule",
  125237. // "parameterOrder": [
  125238. // "project",
  125239. // "securityPolicy"
  125240. // ],
  125241. // "parameters": {
  125242. // "priority": {
  125243. // "description": "The priority of the rule to get from the security policy.",
  125244. // "format": "int32",
  125245. // "location": "query",
  125246. // "type": "integer"
  125247. // },
  125248. // "project": {
  125249. // "description": "Project ID for this request.",
  125250. // "location": "path",
  125251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125252. // "required": true,
  125253. // "type": "string"
  125254. // },
  125255. // "securityPolicy": {
  125256. // "description": "Name of the security policy to which the queried rule belongs.",
  125257. // "location": "path",
  125258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  125259. // "required": true,
  125260. // "type": "string"
  125261. // }
  125262. // },
  125263. // "path": "{project}/global/securityPolicies/{securityPolicy}/getRule",
  125264. // "response": {
  125265. // "$ref": "SecurityPolicyRule"
  125266. // },
  125267. // "scopes": [
  125268. // "https://www.googleapis.com/auth/cloud-platform",
  125269. // "https://www.googleapis.com/auth/compute",
  125270. // "https://www.googleapis.com/auth/compute.readonly"
  125271. // ]
  125272. // }
  125273. }
  125274. // method id "compute.securityPolicies.insert":
  125275. type SecurityPoliciesInsertCall struct {
  125276. s *Service
  125277. project string
  125278. securitypolicy *SecurityPolicy
  125279. urlParams_ gensupport.URLParams
  125280. ctx_ context.Context
  125281. header_ http.Header
  125282. }
  125283. // Insert: Creates a new policy in the specified project using the data
  125284. // included in the request.
  125285. func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
  125286. c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125287. c.project = project
  125288. c.securitypolicy = securitypolicy
  125289. return c
  125290. }
  125291. // RequestId sets the optional parameter "requestId": An optional
  125292. // request ID to identify requests. Specify a unique request ID so that
  125293. // if you must retry your request, the server will know to ignore the
  125294. // request if it has already been completed.
  125295. //
  125296. // For example, consider a situation where you make an initial request
  125297. // and the request times out. If you make the request again with the
  125298. // same request ID, the server can check if original operation with the
  125299. // same request ID was received, and if so, will ignore the second
  125300. // request. This prevents clients from accidentally creating duplicate
  125301. // commitments.
  125302. //
  125303. // The request ID must be a valid UUID with the exception that zero UUID
  125304. // is not supported (00000000-0000-0000-0000-000000000000).
  125305. func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
  125306. c.urlParams_.Set("requestId", requestId)
  125307. return c
  125308. }
  125309. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  125310. // request will not be committed.
  125311. func (c *SecurityPoliciesInsertCall) ValidateOnly(validateOnly bool) *SecurityPoliciesInsertCall {
  125312. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  125313. return c
  125314. }
  125315. // Fields allows partial responses to be retrieved. See
  125316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125317. // for more information.
  125318. func (c *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
  125319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125320. return c
  125321. }
  125322. // Context sets the context to be used in this call's Do method. Any
  125323. // pending HTTP request will be aborted if the provided context is
  125324. // canceled.
  125325. func (c *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
  125326. c.ctx_ = ctx
  125327. return c
  125328. }
  125329. // Header returns an http.Header that can be modified by the caller to
  125330. // add HTTP headers to the request.
  125331. func (c *SecurityPoliciesInsertCall) Header() http.Header {
  125332. if c.header_ == nil {
  125333. c.header_ = make(http.Header)
  125334. }
  125335. return c.header_
  125336. }
  125337. func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  125338. reqHeaders := make(http.Header)
  125339. for k, v := range c.header_ {
  125340. reqHeaders[k] = v
  125341. }
  125342. reqHeaders.Set("User-Agent", c.s.userAgent())
  125343. var body io.Reader = nil
  125344. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  125345. if err != nil {
  125346. return nil, err
  125347. }
  125348. reqHeaders.Set("Content-Type", "application/json")
  125349. c.urlParams_.Set("alt", alt)
  125350. c.urlParams_.Set("prettyPrint", "false")
  125351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  125352. urls += "?" + c.urlParams_.Encode()
  125353. req, err := http.NewRequest("POST", urls, body)
  125354. if err != nil {
  125355. return nil, err
  125356. }
  125357. req.Header = reqHeaders
  125358. googleapi.Expand(req.URL, map[string]string{
  125359. "project": c.project,
  125360. })
  125361. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125362. }
  125363. // Do executes the "compute.securityPolicies.insert" call.
  125364. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  125365. // status code is an error. Response headers are in either
  125366. // *Operation.ServerResponse.Header or (if a response was returned at
  125367. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  125368. // to check whether the returned error was because
  125369. // http.StatusNotModified was returned.
  125370. func (c *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  125371. gensupport.SetOptions(c.urlParams_, opts...)
  125372. res, err := c.doRequest("json")
  125373. if res != nil && res.StatusCode == http.StatusNotModified {
  125374. if res.Body != nil {
  125375. res.Body.Close()
  125376. }
  125377. return nil, &googleapi.Error{
  125378. Code: res.StatusCode,
  125379. Header: res.Header,
  125380. }
  125381. }
  125382. if err != nil {
  125383. return nil, err
  125384. }
  125385. defer googleapi.CloseBody(res)
  125386. if err := googleapi.CheckResponse(res); err != nil {
  125387. return nil, err
  125388. }
  125389. ret := &Operation{
  125390. ServerResponse: googleapi.ServerResponse{
  125391. Header: res.Header,
  125392. HTTPStatusCode: res.StatusCode,
  125393. },
  125394. }
  125395. target := &ret
  125396. if err := gensupport.DecodeResponse(target, res); err != nil {
  125397. return nil, err
  125398. }
  125399. return ret, nil
  125400. // {
  125401. // "description": "Creates a new policy in the specified project using the data included in the request.",
  125402. // "httpMethod": "POST",
  125403. // "id": "compute.securityPolicies.insert",
  125404. // "parameterOrder": [
  125405. // "project"
  125406. // ],
  125407. // "parameters": {
  125408. // "project": {
  125409. // "description": "Project ID for this request.",
  125410. // "location": "path",
  125411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125412. // "required": true,
  125413. // "type": "string"
  125414. // },
  125415. // "requestId": {
  125416. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  125417. // "location": "query",
  125418. // "type": "string"
  125419. // },
  125420. // "validateOnly": {
  125421. // "description": "If true, the request will not be committed.",
  125422. // "location": "query",
  125423. // "type": "boolean"
  125424. // }
  125425. // },
  125426. // "path": "{project}/global/securityPolicies",
  125427. // "request": {
  125428. // "$ref": "SecurityPolicy"
  125429. // },
  125430. // "response": {
  125431. // "$ref": "Operation"
  125432. // },
  125433. // "scopes": [
  125434. // "https://www.googleapis.com/auth/cloud-platform",
  125435. // "https://www.googleapis.com/auth/compute"
  125436. // ]
  125437. // }
  125438. }
  125439. // method id "compute.securityPolicies.list":
  125440. type SecurityPoliciesListCall struct {
  125441. s *Service
  125442. project string
  125443. urlParams_ gensupport.URLParams
  125444. ifNoneMatch_ string
  125445. ctx_ context.Context
  125446. header_ http.Header
  125447. }
  125448. // List: List all the policies that have been configured for the
  125449. // specified project.
  125450. func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
  125451. c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125452. c.project = project
  125453. return c
  125454. }
  125455. // Filter sets the optional parameter "filter": A filter expression that
  125456. // filters resources listed in the response. The expression must specify
  125457. // the field name, a comparison operator, and the value that you want to
  125458. // use for filtering. The value must be a string, a number, or a
  125459. // boolean. The comparison operator must be either =, !=, >, or <.
  125460. //
  125461. // For example, if you are filtering Compute Engine instances, you can
  125462. // exclude instances named example-instance by specifying name !=
  125463. // example-instance.
  125464. //
  125465. // You can also filter nested fields. For example, you could specify
  125466. // scheduling.automaticRestart = false to include instances only if they
  125467. // are not scheduled for automatic restarts. You can use filtering on
  125468. // nested fields to filter based on resource labels.
  125469. //
  125470. // To filter on multiple expressions, provide each separate expression
  125471. // within parentheses. For example, (scheduling.automaticRestart = true)
  125472. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  125473. // AND expression. However, you can include AND and OR expressions
  125474. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  125475. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  125476. // true).
  125477. func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
  125478. c.urlParams_.Set("filter", filter)
  125479. return c
  125480. }
  125481. // MaxResults sets the optional parameter "maxResults": The maximum
  125482. // number of results per page that should be returned. If the number of
  125483. // available results is larger than maxResults, Compute Engine returns a
  125484. // nextPageToken that can be used to get the next page of results in
  125485. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  125486. // (Default: 500)
  125487. func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
  125488. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  125489. return c
  125490. }
  125491. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  125492. // a certain order. By default, results are returned in alphanumerical
  125493. // order based on the resource name.
  125494. //
  125495. // You can also sort results in descending order based on the creation
  125496. // timestamp using orderBy="creationTimestamp desc". This sorts results
  125497. // based on the creationTimestamp field in reverse chronological order
  125498. // (newest result first). Use this to sort resources like operations so
  125499. // that the newest operation is returned first.
  125500. //
  125501. // Currently, only sorting by name or creationTimestamp desc is
  125502. // supported.
  125503. func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
  125504. c.urlParams_.Set("orderBy", orderBy)
  125505. return c
  125506. }
  125507. // PageToken sets the optional parameter "pageToken": Specifies a page
  125508. // token to use. Set pageToken to the nextPageToken returned by a
  125509. // previous list request to get the next page of results.
  125510. func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
  125511. c.urlParams_.Set("pageToken", pageToken)
  125512. return c
  125513. }
  125514. // Fields allows partial responses to be retrieved. See
  125515. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125516. // for more information.
  125517. func (c *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
  125518. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125519. return c
  125520. }
  125521. // IfNoneMatch sets the optional parameter which makes the operation
  125522. // fail if the object's ETag matches the given value. This is useful for
  125523. // getting updates only after the object has changed since the last
  125524. // request. Use googleapi.IsNotModified to check whether the response
  125525. // error from Do is the result of In-None-Match.
  125526. func (c *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
  125527. c.ifNoneMatch_ = entityTag
  125528. return c
  125529. }
  125530. // Context sets the context to be used in this call's Do method. Any
  125531. // pending HTTP request will be aborted if the provided context is
  125532. // canceled.
  125533. func (c *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
  125534. c.ctx_ = ctx
  125535. return c
  125536. }
  125537. // Header returns an http.Header that can be modified by the caller to
  125538. // add HTTP headers to the request.
  125539. func (c *SecurityPoliciesListCall) Header() http.Header {
  125540. if c.header_ == nil {
  125541. c.header_ = make(http.Header)
  125542. }
  125543. return c.header_
  125544. }
  125545. func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  125546. reqHeaders := make(http.Header)
  125547. for k, v := range c.header_ {
  125548. reqHeaders[k] = v
  125549. }
  125550. reqHeaders.Set("User-Agent", c.s.userAgent())
  125551. if c.ifNoneMatch_ != "" {
  125552. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  125553. }
  125554. var body io.Reader = nil
  125555. c.urlParams_.Set("alt", alt)
  125556. c.urlParams_.Set("prettyPrint", "false")
  125557. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  125558. urls += "?" + c.urlParams_.Encode()
  125559. req, err := http.NewRequest("GET", urls, body)
  125560. if err != nil {
  125561. return nil, err
  125562. }
  125563. req.Header = reqHeaders
  125564. googleapi.Expand(req.URL, map[string]string{
  125565. "project": c.project,
  125566. })
  125567. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125568. }
  125569. // Do executes the "compute.securityPolicies.list" call.
  125570. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  125571. // non-2xx status code is an error. Response headers are in either
  125572. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  125573. // returned at all) in error.(*googleapi.Error).Header. Use
  125574. // googleapi.IsNotModified to check whether the returned error was
  125575. // because http.StatusNotModified was returned.
  125576. func (c *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  125577. gensupport.SetOptions(c.urlParams_, opts...)
  125578. res, err := c.doRequest("json")
  125579. if res != nil && res.StatusCode == http.StatusNotModified {
  125580. if res.Body != nil {
  125581. res.Body.Close()
  125582. }
  125583. return nil, &googleapi.Error{
  125584. Code: res.StatusCode,
  125585. Header: res.Header,
  125586. }
  125587. }
  125588. if err != nil {
  125589. return nil, err
  125590. }
  125591. defer googleapi.CloseBody(res)
  125592. if err := googleapi.CheckResponse(res); err != nil {
  125593. return nil, err
  125594. }
  125595. ret := &SecurityPolicyList{
  125596. ServerResponse: googleapi.ServerResponse{
  125597. Header: res.Header,
  125598. HTTPStatusCode: res.StatusCode,
  125599. },
  125600. }
  125601. target := &ret
  125602. if err := gensupport.DecodeResponse(target, res); err != nil {
  125603. return nil, err
  125604. }
  125605. return ret, nil
  125606. // {
  125607. // "description": "List all the policies that have been configured for the specified project.",
  125608. // "httpMethod": "GET",
  125609. // "id": "compute.securityPolicies.list",
  125610. // "parameterOrder": [
  125611. // "project"
  125612. // ],
  125613. // "parameters": {
  125614. // "filter": {
  125615. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  125616. // "location": "query",
  125617. // "type": "string"
  125618. // },
  125619. // "maxResults": {
  125620. // "default": "500",
  125621. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  125622. // "format": "uint32",
  125623. // "location": "query",
  125624. // "minimum": "0",
  125625. // "type": "integer"
  125626. // },
  125627. // "orderBy": {
  125628. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  125629. // "location": "query",
  125630. // "type": "string"
  125631. // },
  125632. // "pageToken": {
  125633. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  125634. // "location": "query",
  125635. // "type": "string"
  125636. // },
  125637. // "project": {
  125638. // "description": "Project ID for this request.",
  125639. // "location": "path",
  125640. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125641. // "required": true,
  125642. // "type": "string"
  125643. // }
  125644. // },
  125645. // "path": "{project}/global/securityPolicies",
  125646. // "response": {
  125647. // "$ref": "SecurityPolicyList"
  125648. // },
  125649. // "scopes": [
  125650. // "https://www.googleapis.com/auth/cloud-platform",
  125651. // "https://www.googleapis.com/auth/compute",
  125652. // "https://www.googleapis.com/auth/compute.readonly"
  125653. // ]
  125654. // }
  125655. }
  125656. // Pages invokes f for each page of results.
  125657. // A non-nil error returned from f will halt the iteration.
  125658. // The provided context supersedes any context provided to the Context method.
  125659. func (c *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  125660. c.ctx_ = ctx
  125661. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  125662. for {
  125663. x, err := c.Do()
  125664. if err != nil {
  125665. return err
  125666. }
  125667. if err := f(x); err != nil {
  125668. return err
  125669. }
  125670. if x.NextPageToken == "" {
  125671. return nil
  125672. }
  125673. c.PageToken(x.NextPageToken)
  125674. }
  125675. }
  125676. // method id "compute.securityPolicies.listPreconfiguredExpressionSets":
  125677. type SecurityPoliciesListPreconfiguredExpressionSetsCall struct {
  125678. s *Service
  125679. project string
  125680. urlParams_ gensupport.URLParams
  125681. ifNoneMatch_ string
  125682. ctx_ context.Context
  125683. header_ http.Header
  125684. }
  125685. // ListPreconfiguredExpressionSets: Gets the current list of
  125686. // preconfigured Web Application Firewall (WAF) expressions.
  125687. func (r *SecurityPoliciesService) ListPreconfiguredExpressionSets(project string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  125688. c := &SecurityPoliciesListPreconfiguredExpressionSetsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125689. c.project = project
  125690. return c
  125691. }
  125692. // Filter sets the optional parameter "filter": A filter expression that
  125693. // filters resources listed in the response. The expression must specify
  125694. // the field name, a comparison operator, and the value that you want to
  125695. // use for filtering. The value must be a string, a number, or a
  125696. // boolean. The comparison operator must be either =, !=, >, or <.
  125697. //
  125698. // For example, if you are filtering Compute Engine instances, you can
  125699. // exclude instances named example-instance by specifying name !=
  125700. // example-instance.
  125701. //
  125702. // You can also filter nested fields. For example, you could specify
  125703. // scheduling.automaticRestart = false to include instances only if they
  125704. // are not scheduled for automatic restarts. You can use filtering on
  125705. // nested fields to filter based on resource labels.
  125706. //
  125707. // To filter on multiple expressions, provide each separate expression
  125708. // within parentheses. For example, (scheduling.automaticRestart = true)
  125709. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  125710. // AND expression. However, you can include AND and OR expressions
  125711. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  125712. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  125713. // true).
  125714. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Filter(filter string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  125715. c.urlParams_.Set("filter", filter)
  125716. return c
  125717. }
  125718. // MaxResults sets the optional parameter "maxResults": The maximum
  125719. // number of results per page that should be returned. If the number of
  125720. // available results is larger than maxResults, Compute Engine returns a
  125721. // nextPageToken that can be used to get the next page of results in
  125722. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  125723. // (Default: 500)
  125724. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) MaxResults(maxResults int64) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  125725. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  125726. return c
  125727. }
  125728. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  125729. // a certain order. By default, results are returned in alphanumerical
  125730. // order based on the resource name.
  125731. //
  125732. // You can also sort results in descending order based on the creation
  125733. // timestamp using orderBy="creationTimestamp desc". This sorts results
  125734. // based on the creationTimestamp field in reverse chronological order
  125735. // (newest result first). Use this to sort resources like operations so
  125736. // that the newest operation is returned first.
  125737. //
  125738. // Currently, only sorting by name or creationTimestamp desc is
  125739. // supported.
  125740. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) OrderBy(orderBy string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  125741. c.urlParams_.Set("orderBy", orderBy)
  125742. return c
  125743. }
  125744. // PageToken sets the optional parameter "pageToken": Specifies a page
  125745. // token to use. Set pageToken to the nextPageToken returned by a
  125746. // previous list request to get the next page of results.
  125747. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) PageToken(pageToken string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  125748. c.urlParams_.Set("pageToken", pageToken)
  125749. return c
  125750. }
  125751. // Fields allows partial responses to be retrieved. See
  125752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125753. // for more information.
  125754. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Fields(s ...googleapi.Field) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  125755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125756. return c
  125757. }
  125758. // IfNoneMatch sets the optional parameter which makes the operation
  125759. // fail if the object's ETag matches the given value. This is useful for
  125760. // getting updates only after the object has changed since the last
  125761. // request. Use googleapi.IsNotModified to check whether the response
  125762. // error from Do is the result of In-None-Match.
  125763. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) IfNoneMatch(entityTag string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  125764. c.ifNoneMatch_ = entityTag
  125765. return c
  125766. }
  125767. // Context sets the context to be used in this call's Do method. Any
  125768. // pending HTTP request will be aborted if the provided context is
  125769. // canceled.
  125770. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Context(ctx context.Context) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  125771. c.ctx_ = ctx
  125772. return c
  125773. }
  125774. // Header returns an http.Header that can be modified by the caller to
  125775. // add HTTP headers to the request.
  125776. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Header() http.Header {
  125777. if c.header_ == nil {
  125778. c.header_ = make(http.Header)
  125779. }
  125780. return c.header_
  125781. }
  125782. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt string) (*http.Response, error) {
  125783. reqHeaders := make(http.Header)
  125784. for k, v := range c.header_ {
  125785. reqHeaders[k] = v
  125786. }
  125787. reqHeaders.Set("User-Agent", c.s.userAgent())
  125788. if c.ifNoneMatch_ != "" {
  125789. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  125790. }
  125791. var body io.Reader = nil
  125792. c.urlParams_.Set("alt", alt)
  125793. c.urlParams_.Set("prettyPrint", "false")
  125794. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/listPreconfiguredExpressionSets")
  125795. urls += "?" + c.urlParams_.Encode()
  125796. req, err := http.NewRequest("GET", urls, body)
  125797. if err != nil {
  125798. return nil, err
  125799. }
  125800. req.Header = reqHeaders
  125801. googleapi.Expand(req.URL, map[string]string{
  125802. "project": c.project,
  125803. })
  125804. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125805. }
  125806. // Do executes the "compute.securityPolicies.listPreconfiguredExpressionSets" call.
  125807. // Exactly one of
  125808. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse or error
  125809. // will be non-nil. Any non-2xx status code is an error. Response
  125810. // headers are in either
  125811. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse.ServerRespons
  125812. // e.Header or (if a response was returned at all) in
  125813. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  125814. // whether the returned error was because http.StatusNotModified was
  125815. // returned.
  125816. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Do(opts ...googleapi.CallOption) (*SecurityPoliciesListPreconfiguredExpressionSetsResponse, error) {
  125817. gensupport.SetOptions(c.urlParams_, opts...)
  125818. res, err := c.doRequest("json")
  125819. if res != nil && res.StatusCode == http.StatusNotModified {
  125820. if res.Body != nil {
  125821. res.Body.Close()
  125822. }
  125823. return nil, &googleapi.Error{
  125824. Code: res.StatusCode,
  125825. Header: res.Header,
  125826. }
  125827. }
  125828. if err != nil {
  125829. return nil, err
  125830. }
  125831. defer googleapi.CloseBody(res)
  125832. if err := googleapi.CheckResponse(res); err != nil {
  125833. return nil, err
  125834. }
  125835. ret := &SecurityPoliciesListPreconfiguredExpressionSetsResponse{
  125836. ServerResponse: googleapi.ServerResponse{
  125837. Header: res.Header,
  125838. HTTPStatusCode: res.StatusCode,
  125839. },
  125840. }
  125841. target := &ret
  125842. if err := gensupport.DecodeResponse(target, res); err != nil {
  125843. return nil, err
  125844. }
  125845. return ret, nil
  125846. // {
  125847. // "description": "Gets the current list of preconfigured Web Application Firewall (WAF) expressions.",
  125848. // "httpMethod": "GET",
  125849. // "id": "compute.securityPolicies.listPreconfiguredExpressionSets",
  125850. // "parameterOrder": [
  125851. // "project"
  125852. // ],
  125853. // "parameters": {
  125854. // "filter": {
  125855. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  125856. // "location": "query",
  125857. // "type": "string"
  125858. // },
  125859. // "maxResults": {
  125860. // "default": "500",
  125861. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  125862. // "format": "uint32",
  125863. // "location": "query",
  125864. // "minimum": "0",
  125865. // "type": "integer"
  125866. // },
  125867. // "orderBy": {
  125868. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  125869. // "location": "query",
  125870. // "type": "string"
  125871. // },
  125872. // "pageToken": {
  125873. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  125874. // "location": "query",
  125875. // "type": "string"
  125876. // },
  125877. // "project": {
  125878. // "description": "Project ID for this request.",
  125879. // "location": "path",
  125880. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125881. // "required": true,
  125882. // "type": "string"
  125883. // }
  125884. // },
  125885. // "path": "{project}/global/securityPolicies/listPreconfiguredExpressionSets",
  125886. // "response": {
  125887. // "$ref": "SecurityPoliciesListPreconfiguredExpressionSetsResponse"
  125888. // },
  125889. // "scopes": [
  125890. // "https://www.googleapis.com/auth/cloud-platform",
  125891. // "https://www.googleapis.com/auth/compute"
  125892. // ]
  125893. // }
  125894. }
  125895. // method id "compute.securityPolicies.patch":
  125896. type SecurityPoliciesPatchCall struct {
  125897. s *Service
  125898. project string
  125899. securityPolicy string
  125900. securitypolicy *SecurityPolicy
  125901. urlParams_ gensupport.URLParams
  125902. ctx_ context.Context
  125903. header_ http.Header
  125904. }
  125905. // Patch: Patches the specified policy with the data included in the
  125906. // request.
  125907. func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
  125908. c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125909. c.project = project
  125910. c.securityPolicy = securityPolicy
  125911. c.securitypolicy = securitypolicy
  125912. return c
  125913. }
  125914. // RequestId sets the optional parameter "requestId": An optional
  125915. // request ID to identify requests. Specify a unique request ID so that
  125916. // if you must retry your request, the server will know to ignore the
  125917. // request if it has already been completed.
  125918. //
  125919. // For example, consider a situation where you make an initial request
  125920. // and the request times out. If you make the request again with the
  125921. // same request ID, the server can check if original operation with the
  125922. // same request ID was received, and if so, will ignore the second
  125923. // request. This prevents clients from accidentally creating duplicate
  125924. // commitments.
  125925. //
  125926. // The request ID must be a valid UUID with the exception that zero UUID
  125927. // is not supported (00000000-0000-0000-0000-000000000000).
  125928. func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
  125929. c.urlParams_.Set("requestId", requestId)
  125930. return c
  125931. }
  125932. // Fields allows partial responses to be retrieved. See
  125933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125934. // for more information.
  125935. func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
  125936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125937. return c
  125938. }
  125939. // Context sets the context to be used in this call's Do method. Any
  125940. // pending HTTP request will be aborted if the provided context is
  125941. // canceled.
  125942. func (c *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
  125943. c.ctx_ = ctx
  125944. return c
  125945. }
  125946. // Header returns an http.Header that can be modified by the caller to
  125947. // add HTTP headers to the request.
  125948. func (c *SecurityPoliciesPatchCall) Header() http.Header {
  125949. if c.header_ == nil {
  125950. c.header_ = make(http.Header)
  125951. }
  125952. return c.header_
  125953. }
  125954. func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  125955. reqHeaders := make(http.Header)
  125956. for k, v := range c.header_ {
  125957. reqHeaders[k] = v
  125958. }
  125959. reqHeaders.Set("User-Agent", c.s.userAgent())
  125960. var body io.Reader = nil
  125961. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  125962. if err != nil {
  125963. return nil, err
  125964. }
  125965. reqHeaders.Set("Content-Type", "application/json")
  125966. c.urlParams_.Set("alt", alt)
  125967. c.urlParams_.Set("prettyPrint", "false")
  125968. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  125969. urls += "?" + c.urlParams_.Encode()
  125970. req, err := http.NewRequest("PATCH", urls, body)
  125971. if err != nil {
  125972. return nil, err
  125973. }
  125974. req.Header = reqHeaders
  125975. googleapi.Expand(req.URL, map[string]string{
  125976. "project": c.project,
  125977. "securityPolicy": c.securityPolicy,
  125978. })
  125979. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125980. }
  125981. // Do executes the "compute.securityPolicies.patch" call.
  125982. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  125983. // status code is an error. Response headers are in either
  125984. // *Operation.ServerResponse.Header or (if a response was returned at
  125985. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  125986. // to check whether the returned error was because
  125987. // http.StatusNotModified was returned.
  125988. func (c *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  125989. gensupport.SetOptions(c.urlParams_, opts...)
  125990. res, err := c.doRequest("json")
  125991. if res != nil && res.StatusCode == http.StatusNotModified {
  125992. if res.Body != nil {
  125993. res.Body.Close()
  125994. }
  125995. return nil, &googleapi.Error{
  125996. Code: res.StatusCode,
  125997. Header: res.Header,
  125998. }
  125999. }
  126000. if err != nil {
  126001. return nil, err
  126002. }
  126003. defer googleapi.CloseBody(res)
  126004. if err := googleapi.CheckResponse(res); err != nil {
  126005. return nil, err
  126006. }
  126007. ret := &Operation{
  126008. ServerResponse: googleapi.ServerResponse{
  126009. Header: res.Header,
  126010. HTTPStatusCode: res.StatusCode,
  126011. },
  126012. }
  126013. target := &ret
  126014. if err := gensupport.DecodeResponse(target, res); err != nil {
  126015. return nil, err
  126016. }
  126017. return ret, nil
  126018. // {
  126019. // "description": "Patches the specified policy with the data included in the request.",
  126020. // "httpMethod": "PATCH",
  126021. // "id": "compute.securityPolicies.patch",
  126022. // "parameterOrder": [
  126023. // "project",
  126024. // "securityPolicy"
  126025. // ],
  126026. // "parameters": {
  126027. // "project": {
  126028. // "description": "Project ID for this request.",
  126029. // "location": "path",
  126030. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126031. // "required": true,
  126032. // "type": "string"
  126033. // },
  126034. // "requestId": {
  126035. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  126036. // "location": "query",
  126037. // "type": "string"
  126038. // },
  126039. // "securityPolicy": {
  126040. // "description": "Name of the security policy to update.",
  126041. // "location": "path",
  126042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  126043. // "required": true,
  126044. // "type": "string"
  126045. // }
  126046. // },
  126047. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  126048. // "request": {
  126049. // "$ref": "SecurityPolicy"
  126050. // },
  126051. // "response": {
  126052. // "$ref": "Operation"
  126053. // },
  126054. // "scopes": [
  126055. // "https://www.googleapis.com/auth/cloud-platform",
  126056. // "https://www.googleapis.com/auth/compute"
  126057. // ]
  126058. // }
  126059. }
  126060. // method id "compute.securityPolicies.patchRule":
  126061. type SecurityPoliciesPatchRuleCall struct {
  126062. s *Service
  126063. project string
  126064. securityPolicy string
  126065. securitypolicyrule *SecurityPolicyRule
  126066. urlParams_ gensupport.URLParams
  126067. ctx_ context.Context
  126068. header_ http.Header
  126069. }
  126070. // PatchRule: Patches a rule at the specified priority.
  126071. func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
  126072. c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126073. c.project = project
  126074. c.securityPolicy = securityPolicy
  126075. c.securitypolicyrule = securitypolicyrule
  126076. return c
  126077. }
  126078. // Priority sets the optional parameter "priority": The priority of the
  126079. // rule to patch.
  126080. func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
  126081. c.urlParams_.Set("priority", fmt.Sprint(priority))
  126082. return c
  126083. }
  126084. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  126085. // request will not be committed.
  126086. func (c *SecurityPoliciesPatchRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesPatchRuleCall {
  126087. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  126088. return c
  126089. }
  126090. // Fields allows partial responses to be retrieved. See
  126091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126092. // for more information.
  126093. func (c *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
  126094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126095. return c
  126096. }
  126097. // Context sets the context to be used in this call's Do method. Any
  126098. // pending HTTP request will be aborted if the provided context is
  126099. // canceled.
  126100. func (c *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
  126101. c.ctx_ = ctx
  126102. return c
  126103. }
  126104. // Header returns an http.Header that can be modified by the caller to
  126105. // add HTTP headers to the request.
  126106. func (c *SecurityPoliciesPatchRuleCall) Header() http.Header {
  126107. if c.header_ == nil {
  126108. c.header_ = make(http.Header)
  126109. }
  126110. return c.header_
  126111. }
  126112. func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  126113. reqHeaders := make(http.Header)
  126114. for k, v := range c.header_ {
  126115. reqHeaders[k] = v
  126116. }
  126117. reqHeaders.Set("User-Agent", c.s.userAgent())
  126118. var body io.Reader = nil
  126119. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  126120. if err != nil {
  126121. return nil, err
  126122. }
  126123. reqHeaders.Set("Content-Type", "application/json")
  126124. c.urlParams_.Set("alt", alt)
  126125. c.urlParams_.Set("prettyPrint", "false")
  126126. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/patchRule")
  126127. urls += "?" + c.urlParams_.Encode()
  126128. req, err := http.NewRequest("POST", urls, body)
  126129. if err != nil {
  126130. return nil, err
  126131. }
  126132. req.Header = reqHeaders
  126133. googleapi.Expand(req.URL, map[string]string{
  126134. "project": c.project,
  126135. "securityPolicy": c.securityPolicy,
  126136. })
  126137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126138. }
  126139. // Do executes the "compute.securityPolicies.patchRule" call.
  126140. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  126141. // status code is an error. Response headers are in either
  126142. // *Operation.ServerResponse.Header or (if a response was returned at
  126143. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126144. // to check whether the returned error was because
  126145. // http.StatusNotModified was returned.
  126146. func (c *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  126147. gensupport.SetOptions(c.urlParams_, opts...)
  126148. res, err := c.doRequest("json")
  126149. if res != nil && res.StatusCode == http.StatusNotModified {
  126150. if res.Body != nil {
  126151. res.Body.Close()
  126152. }
  126153. return nil, &googleapi.Error{
  126154. Code: res.StatusCode,
  126155. Header: res.Header,
  126156. }
  126157. }
  126158. if err != nil {
  126159. return nil, err
  126160. }
  126161. defer googleapi.CloseBody(res)
  126162. if err := googleapi.CheckResponse(res); err != nil {
  126163. return nil, err
  126164. }
  126165. ret := &Operation{
  126166. ServerResponse: googleapi.ServerResponse{
  126167. Header: res.Header,
  126168. HTTPStatusCode: res.StatusCode,
  126169. },
  126170. }
  126171. target := &ret
  126172. if err := gensupport.DecodeResponse(target, res); err != nil {
  126173. return nil, err
  126174. }
  126175. return ret, nil
  126176. // {
  126177. // "description": "Patches a rule at the specified priority.",
  126178. // "httpMethod": "POST",
  126179. // "id": "compute.securityPolicies.patchRule",
  126180. // "parameterOrder": [
  126181. // "project",
  126182. // "securityPolicy"
  126183. // ],
  126184. // "parameters": {
  126185. // "priority": {
  126186. // "description": "The priority of the rule to patch.",
  126187. // "format": "int32",
  126188. // "location": "query",
  126189. // "type": "integer"
  126190. // },
  126191. // "project": {
  126192. // "description": "Project ID for this request.",
  126193. // "location": "path",
  126194. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126195. // "required": true,
  126196. // "type": "string"
  126197. // },
  126198. // "securityPolicy": {
  126199. // "description": "Name of the security policy to update.",
  126200. // "location": "path",
  126201. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  126202. // "required": true,
  126203. // "type": "string"
  126204. // },
  126205. // "validateOnly": {
  126206. // "description": "If true, the request will not be committed.",
  126207. // "location": "query",
  126208. // "type": "boolean"
  126209. // }
  126210. // },
  126211. // "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule",
  126212. // "request": {
  126213. // "$ref": "SecurityPolicyRule"
  126214. // },
  126215. // "response": {
  126216. // "$ref": "Operation"
  126217. // },
  126218. // "scopes": [
  126219. // "https://www.googleapis.com/auth/cloud-platform",
  126220. // "https://www.googleapis.com/auth/compute"
  126221. // ]
  126222. // }
  126223. }
  126224. // method id "compute.securityPolicies.removeRule":
  126225. type SecurityPoliciesRemoveRuleCall struct {
  126226. s *Service
  126227. project string
  126228. securityPolicy string
  126229. urlParams_ gensupport.URLParams
  126230. ctx_ context.Context
  126231. header_ http.Header
  126232. }
  126233. // RemoveRule: Deletes a rule at the specified priority.
  126234. func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
  126235. c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126236. c.project = project
  126237. c.securityPolicy = securityPolicy
  126238. return c
  126239. }
  126240. // Priority sets the optional parameter "priority": The priority of the
  126241. // rule to remove from the security policy.
  126242. func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
  126243. c.urlParams_.Set("priority", fmt.Sprint(priority))
  126244. return c
  126245. }
  126246. // Fields allows partial responses to be retrieved. See
  126247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126248. // for more information.
  126249. func (c *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
  126250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126251. return c
  126252. }
  126253. // Context sets the context to be used in this call's Do method. Any
  126254. // pending HTTP request will be aborted if the provided context is
  126255. // canceled.
  126256. func (c *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
  126257. c.ctx_ = ctx
  126258. return c
  126259. }
  126260. // Header returns an http.Header that can be modified by the caller to
  126261. // add HTTP headers to the request.
  126262. func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header {
  126263. if c.header_ == nil {
  126264. c.header_ = make(http.Header)
  126265. }
  126266. return c.header_
  126267. }
  126268. func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  126269. reqHeaders := make(http.Header)
  126270. for k, v := range c.header_ {
  126271. reqHeaders[k] = v
  126272. }
  126273. reqHeaders.Set("User-Agent", c.s.userAgent())
  126274. var body io.Reader = nil
  126275. c.urlParams_.Set("alt", alt)
  126276. c.urlParams_.Set("prettyPrint", "false")
  126277. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/removeRule")
  126278. urls += "?" + c.urlParams_.Encode()
  126279. req, err := http.NewRequest("POST", urls, body)
  126280. if err != nil {
  126281. return nil, err
  126282. }
  126283. req.Header = reqHeaders
  126284. googleapi.Expand(req.URL, map[string]string{
  126285. "project": c.project,
  126286. "securityPolicy": c.securityPolicy,
  126287. })
  126288. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126289. }
  126290. // Do executes the "compute.securityPolicies.removeRule" call.
  126291. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  126292. // status code is an error. Response headers are in either
  126293. // *Operation.ServerResponse.Header or (if a response was returned at
  126294. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126295. // to check whether the returned error was because
  126296. // http.StatusNotModified was returned.
  126297. func (c *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  126298. gensupport.SetOptions(c.urlParams_, opts...)
  126299. res, err := c.doRequest("json")
  126300. if res != nil && res.StatusCode == http.StatusNotModified {
  126301. if res.Body != nil {
  126302. res.Body.Close()
  126303. }
  126304. return nil, &googleapi.Error{
  126305. Code: res.StatusCode,
  126306. Header: res.Header,
  126307. }
  126308. }
  126309. if err != nil {
  126310. return nil, err
  126311. }
  126312. defer googleapi.CloseBody(res)
  126313. if err := googleapi.CheckResponse(res); err != nil {
  126314. return nil, err
  126315. }
  126316. ret := &Operation{
  126317. ServerResponse: googleapi.ServerResponse{
  126318. Header: res.Header,
  126319. HTTPStatusCode: res.StatusCode,
  126320. },
  126321. }
  126322. target := &ret
  126323. if err := gensupport.DecodeResponse(target, res); err != nil {
  126324. return nil, err
  126325. }
  126326. return ret, nil
  126327. // {
  126328. // "description": "Deletes a rule at the specified priority.",
  126329. // "httpMethod": "POST",
  126330. // "id": "compute.securityPolicies.removeRule",
  126331. // "parameterOrder": [
  126332. // "project",
  126333. // "securityPolicy"
  126334. // ],
  126335. // "parameters": {
  126336. // "priority": {
  126337. // "description": "The priority of the rule to remove from the security policy.",
  126338. // "format": "int32",
  126339. // "location": "query",
  126340. // "type": "integer"
  126341. // },
  126342. // "project": {
  126343. // "description": "Project ID for this request.",
  126344. // "location": "path",
  126345. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126346. // "required": true,
  126347. // "type": "string"
  126348. // },
  126349. // "securityPolicy": {
  126350. // "description": "Name of the security policy to update.",
  126351. // "location": "path",
  126352. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  126353. // "required": true,
  126354. // "type": "string"
  126355. // }
  126356. // },
  126357. // "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule",
  126358. // "response": {
  126359. // "$ref": "Operation"
  126360. // },
  126361. // "scopes": [
  126362. // "https://www.googleapis.com/auth/cloud-platform",
  126363. // "https://www.googleapis.com/auth/compute"
  126364. // ]
  126365. // }
  126366. }
  126367. // method id "compute.securityPolicies.setLabels":
  126368. type SecurityPoliciesSetLabelsCall struct {
  126369. s *Service
  126370. project string
  126371. resource string
  126372. globalsetlabelsrequest *GlobalSetLabelsRequest
  126373. urlParams_ gensupport.URLParams
  126374. ctx_ context.Context
  126375. header_ http.Header
  126376. }
  126377. // SetLabels: Sets the labels on a security policy. To learn more about
  126378. // labels, read the Labeling Resources documentation.
  126379. func (r *SecurityPoliciesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SecurityPoliciesSetLabelsCall {
  126380. c := &SecurityPoliciesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126381. c.project = project
  126382. c.resource = resource
  126383. c.globalsetlabelsrequest = globalsetlabelsrequest
  126384. return c
  126385. }
  126386. // Fields allows partial responses to be retrieved. See
  126387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126388. // for more information.
  126389. func (c *SecurityPoliciesSetLabelsCall) Fields(s ...googleapi.Field) *SecurityPoliciesSetLabelsCall {
  126390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126391. return c
  126392. }
  126393. // Context sets the context to be used in this call's Do method. Any
  126394. // pending HTTP request will be aborted if the provided context is
  126395. // canceled.
  126396. func (c *SecurityPoliciesSetLabelsCall) Context(ctx context.Context) *SecurityPoliciesSetLabelsCall {
  126397. c.ctx_ = ctx
  126398. return c
  126399. }
  126400. // Header returns an http.Header that can be modified by the caller to
  126401. // add HTTP headers to the request.
  126402. func (c *SecurityPoliciesSetLabelsCall) Header() http.Header {
  126403. if c.header_ == nil {
  126404. c.header_ = make(http.Header)
  126405. }
  126406. return c.header_
  126407. }
  126408. func (c *SecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  126409. reqHeaders := make(http.Header)
  126410. for k, v := range c.header_ {
  126411. reqHeaders[k] = v
  126412. }
  126413. reqHeaders.Set("User-Agent", c.s.userAgent())
  126414. var body io.Reader = nil
  126415. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  126416. if err != nil {
  126417. return nil, err
  126418. }
  126419. reqHeaders.Set("Content-Type", "application/json")
  126420. c.urlParams_.Set("alt", alt)
  126421. c.urlParams_.Set("prettyPrint", "false")
  126422. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/setLabels")
  126423. urls += "?" + c.urlParams_.Encode()
  126424. req, err := http.NewRequest("POST", urls, body)
  126425. if err != nil {
  126426. return nil, err
  126427. }
  126428. req.Header = reqHeaders
  126429. googleapi.Expand(req.URL, map[string]string{
  126430. "project": c.project,
  126431. "resource": c.resource,
  126432. })
  126433. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126434. }
  126435. // Do executes the "compute.securityPolicies.setLabels" call.
  126436. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  126437. // status code is an error. Response headers are in either
  126438. // *Operation.ServerResponse.Header or (if a response was returned at
  126439. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126440. // to check whether the returned error was because
  126441. // http.StatusNotModified was returned.
  126442. func (c *SecurityPoliciesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  126443. gensupport.SetOptions(c.urlParams_, opts...)
  126444. res, err := c.doRequest("json")
  126445. if res != nil && res.StatusCode == http.StatusNotModified {
  126446. if res.Body != nil {
  126447. res.Body.Close()
  126448. }
  126449. return nil, &googleapi.Error{
  126450. Code: res.StatusCode,
  126451. Header: res.Header,
  126452. }
  126453. }
  126454. if err != nil {
  126455. return nil, err
  126456. }
  126457. defer googleapi.CloseBody(res)
  126458. if err := googleapi.CheckResponse(res); err != nil {
  126459. return nil, err
  126460. }
  126461. ret := &Operation{
  126462. ServerResponse: googleapi.ServerResponse{
  126463. Header: res.Header,
  126464. HTTPStatusCode: res.StatusCode,
  126465. },
  126466. }
  126467. target := &ret
  126468. if err := gensupport.DecodeResponse(target, res); err != nil {
  126469. return nil, err
  126470. }
  126471. return ret, nil
  126472. // {
  126473. // "description": "Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.",
  126474. // "httpMethod": "POST",
  126475. // "id": "compute.securityPolicies.setLabels",
  126476. // "parameterOrder": [
  126477. // "project",
  126478. // "resource"
  126479. // ],
  126480. // "parameters": {
  126481. // "project": {
  126482. // "description": "Project ID for this request.",
  126483. // "location": "path",
  126484. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126485. // "required": true,
  126486. // "type": "string"
  126487. // },
  126488. // "resource": {
  126489. // "description": "Name or id of the resource for this request.",
  126490. // "location": "path",
  126491. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  126492. // "required": true,
  126493. // "type": "string"
  126494. // }
  126495. // },
  126496. // "path": "{project}/global/securityPolicies/{resource}/setLabels",
  126497. // "request": {
  126498. // "$ref": "GlobalSetLabelsRequest"
  126499. // },
  126500. // "response": {
  126501. // "$ref": "Operation"
  126502. // },
  126503. // "scopes": [
  126504. // "https://www.googleapis.com/auth/cloud-platform",
  126505. // "https://www.googleapis.com/auth/compute"
  126506. // ]
  126507. // }
  126508. }
  126509. // method id "compute.securityPolicies.testIamPermissions":
  126510. type SecurityPoliciesTestIamPermissionsCall struct {
  126511. s *Service
  126512. project string
  126513. resource string
  126514. testpermissionsrequest *TestPermissionsRequest
  126515. urlParams_ gensupport.URLParams
  126516. ctx_ context.Context
  126517. header_ http.Header
  126518. }
  126519. // TestIamPermissions: Returns permissions that a caller has on the
  126520. // specified resource.
  126521. func (r *SecurityPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SecurityPoliciesTestIamPermissionsCall {
  126522. c := &SecurityPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126523. c.project = project
  126524. c.resource = resource
  126525. c.testpermissionsrequest = testpermissionsrequest
  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 *SecurityPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SecurityPoliciesTestIamPermissionsCall {
  126532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126533. return c
  126534. }
  126535. // Context sets the context to be used in this call's Do method. Any
  126536. // pending HTTP request will be aborted if the provided context is
  126537. // canceled.
  126538. func (c *SecurityPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SecurityPoliciesTestIamPermissionsCall {
  126539. c.ctx_ = ctx
  126540. return c
  126541. }
  126542. // Header returns an http.Header that can be modified by the caller to
  126543. // add HTTP headers to the request.
  126544. func (c *SecurityPoliciesTestIamPermissionsCall) Header() http.Header {
  126545. if c.header_ == nil {
  126546. c.header_ = make(http.Header)
  126547. }
  126548. return c.header_
  126549. }
  126550. func (c *SecurityPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  126551. reqHeaders := make(http.Header)
  126552. for k, v := range c.header_ {
  126553. reqHeaders[k] = v
  126554. }
  126555. reqHeaders.Set("User-Agent", c.s.userAgent())
  126556. var body io.Reader = nil
  126557. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  126558. if err != nil {
  126559. return nil, err
  126560. }
  126561. reqHeaders.Set("Content-Type", "application/json")
  126562. c.urlParams_.Set("alt", alt)
  126563. c.urlParams_.Set("prettyPrint", "false")
  126564. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/testIamPermissions")
  126565. urls += "?" + c.urlParams_.Encode()
  126566. req, err := http.NewRequest("POST", urls, body)
  126567. if err != nil {
  126568. return nil, err
  126569. }
  126570. req.Header = reqHeaders
  126571. googleapi.Expand(req.URL, map[string]string{
  126572. "project": c.project,
  126573. "resource": c.resource,
  126574. })
  126575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126576. }
  126577. // Do executes the "compute.securityPolicies.testIamPermissions" call.
  126578. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  126579. // non-2xx status code is an error. Response headers are in either
  126580. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  126581. // returned at all) in error.(*googleapi.Error).Header. Use
  126582. // googleapi.IsNotModified to check whether the returned error was
  126583. // because http.StatusNotModified was returned.
  126584. func (c *SecurityPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  126585. gensupport.SetOptions(c.urlParams_, opts...)
  126586. res, err := c.doRequest("json")
  126587. if res != nil && res.StatusCode == http.StatusNotModified {
  126588. if res.Body != nil {
  126589. res.Body.Close()
  126590. }
  126591. return nil, &googleapi.Error{
  126592. Code: res.StatusCode,
  126593. Header: res.Header,
  126594. }
  126595. }
  126596. if err != nil {
  126597. return nil, err
  126598. }
  126599. defer googleapi.CloseBody(res)
  126600. if err := googleapi.CheckResponse(res); err != nil {
  126601. return nil, err
  126602. }
  126603. ret := &TestPermissionsResponse{
  126604. ServerResponse: googleapi.ServerResponse{
  126605. Header: res.Header,
  126606. HTTPStatusCode: res.StatusCode,
  126607. },
  126608. }
  126609. target := &ret
  126610. if err := gensupport.DecodeResponse(target, res); err != nil {
  126611. return nil, err
  126612. }
  126613. return ret, nil
  126614. // {
  126615. // "description": "Returns permissions that a caller has on the specified resource.",
  126616. // "httpMethod": "POST",
  126617. // "id": "compute.securityPolicies.testIamPermissions",
  126618. // "parameterOrder": [
  126619. // "project",
  126620. // "resource"
  126621. // ],
  126622. // "parameters": {
  126623. // "project": {
  126624. // "description": "Project ID for this request.",
  126625. // "location": "path",
  126626. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126627. // "required": true,
  126628. // "type": "string"
  126629. // },
  126630. // "resource": {
  126631. // "description": "Name or id of the resource for this request.",
  126632. // "location": "path",
  126633. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  126634. // "required": true,
  126635. // "type": "string"
  126636. // }
  126637. // },
  126638. // "path": "{project}/global/securityPolicies/{resource}/testIamPermissions",
  126639. // "request": {
  126640. // "$ref": "TestPermissionsRequest"
  126641. // },
  126642. // "response": {
  126643. // "$ref": "TestPermissionsResponse"
  126644. // },
  126645. // "scopes": [
  126646. // "https://www.googleapis.com/auth/cloud-platform",
  126647. // "https://www.googleapis.com/auth/compute",
  126648. // "https://www.googleapis.com/auth/compute.readonly"
  126649. // ]
  126650. // }
  126651. }
  126652. // method id "compute.snapshots.delete":
  126653. type SnapshotsDeleteCall struct {
  126654. s *Service
  126655. project string
  126656. snapshot string
  126657. urlParams_ gensupport.URLParams
  126658. ctx_ context.Context
  126659. header_ http.Header
  126660. }
  126661. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  126662. // deleting a single snapshot might not necessarily delete all the data
  126663. // on that snapshot. If any data on the snapshot that is marked for
  126664. // deletion is needed for subsequent snapshots, the data will be moved
  126665. // to the next corresponding snapshot.
  126666. //
  126667. // For more information, see Deleting snapshots.
  126668. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  126669. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  126670. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126671. c.project = project
  126672. c.snapshot = snapshot
  126673. return c
  126674. }
  126675. // RequestId sets the optional parameter "requestId": An optional
  126676. // request ID to identify requests. Specify a unique request ID so that
  126677. // if you must retry your request, the server will know to ignore the
  126678. // request if it has already been completed.
  126679. //
  126680. // For example, consider a situation where you make an initial request
  126681. // and the request times out. If you make the request again with the
  126682. // same request ID, the server can check if original operation with the
  126683. // same request ID was received, and if so, will ignore the second
  126684. // request. This prevents clients from accidentally creating duplicate
  126685. // commitments.
  126686. //
  126687. // The request ID must be a valid UUID with the exception that zero UUID
  126688. // is not supported (00000000-0000-0000-0000-000000000000).
  126689. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  126690. c.urlParams_.Set("requestId", requestId)
  126691. return c
  126692. }
  126693. // Fields allows partial responses to be retrieved. See
  126694. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126695. // for more information.
  126696. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  126697. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126698. return c
  126699. }
  126700. // Context sets the context to be used in this call's Do method. Any
  126701. // pending HTTP request will be aborted if the provided context is
  126702. // canceled.
  126703. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  126704. c.ctx_ = ctx
  126705. return c
  126706. }
  126707. // Header returns an http.Header that can be modified by the caller to
  126708. // add HTTP headers to the request.
  126709. func (c *SnapshotsDeleteCall) Header() http.Header {
  126710. if c.header_ == nil {
  126711. c.header_ = make(http.Header)
  126712. }
  126713. return c.header_
  126714. }
  126715. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  126716. reqHeaders := make(http.Header)
  126717. for k, v := range c.header_ {
  126718. reqHeaders[k] = v
  126719. }
  126720. reqHeaders.Set("User-Agent", c.s.userAgent())
  126721. var body io.Reader = nil
  126722. c.urlParams_.Set("alt", alt)
  126723. c.urlParams_.Set("prettyPrint", "false")
  126724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  126725. urls += "?" + c.urlParams_.Encode()
  126726. req, err := http.NewRequest("DELETE", urls, body)
  126727. if err != nil {
  126728. return nil, err
  126729. }
  126730. req.Header = reqHeaders
  126731. googleapi.Expand(req.URL, map[string]string{
  126732. "project": c.project,
  126733. "snapshot": c.snapshot,
  126734. })
  126735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126736. }
  126737. // Do executes the "compute.snapshots.delete" call.
  126738. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  126739. // status code is an error. Response headers are in either
  126740. // *Operation.ServerResponse.Header or (if a response was returned at
  126741. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126742. // to check whether the returned error was because
  126743. // http.StatusNotModified was returned.
  126744. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  126745. gensupport.SetOptions(c.urlParams_, opts...)
  126746. res, err := c.doRequest("json")
  126747. if res != nil && res.StatusCode == http.StatusNotModified {
  126748. if res.Body != nil {
  126749. res.Body.Close()
  126750. }
  126751. return nil, &googleapi.Error{
  126752. Code: res.StatusCode,
  126753. Header: res.Header,
  126754. }
  126755. }
  126756. if err != nil {
  126757. return nil, err
  126758. }
  126759. defer googleapi.CloseBody(res)
  126760. if err := googleapi.CheckResponse(res); err != nil {
  126761. return nil, err
  126762. }
  126763. ret := &Operation{
  126764. ServerResponse: googleapi.ServerResponse{
  126765. Header: res.Header,
  126766. HTTPStatusCode: res.StatusCode,
  126767. },
  126768. }
  126769. target := &ret
  126770. if err := gensupport.DecodeResponse(target, res); err != nil {
  126771. return nil, err
  126772. }
  126773. return ret, nil
  126774. // {
  126775. // "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.",
  126776. // "httpMethod": "DELETE",
  126777. // "id": "compute.snapshots.delete",
  126778. // "parameterOrder": [
  126779. // "project",
  126780. // "snapshot"
  126781. // ],
  126782. // "parameters": {
  126783. // "project": {
  126784. // "description": "Project ID for this request.",
  126785. // "location": "path",
  126786. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126787. // "required": true,
  126788. // "type": "string"
  126789. // },
  126790. // "requestId": {
  126791. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  126792. // "location": "query",
  126793. // "type": "string"
  126794. // },
  126795. // "snapshot": {
  126796. // "description": "Name of the Snapshot resource to delete.",
  126797. // "location": "path",
  126798. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  126799. // "required": true,
  126800. // "type": "string"
  126801. // }
  126802. // },
  126803. // "path": "{project}/global/snapshots/{snapshot}",
  126804. // "response": {
  126805. // "$ref": "Operation"
  126806. // },
  126807. // "scopes": [
  126808. // "https://www.googleapis.com/auth/cloud-platform",
  126809. // "https://www.googleapis.com/auth/compute"
  126810. // ]
  126811. // }
  126812. }
  126813. // method id "compute.snapshots.get":
  126814. type SnapshotsGetCall struct {
  126815. s *Service
  126816. project string
  126817. snapshot string
  126818. urlParams_ gensupport.URLParams
  126819. ifNoneMatch_ string
  126820. ctx_ context.Context
  126821. header_ http.Header
  126822. }
  126823. // Get: Returns the specified Snapshot resource. Gets a list of
  126824. // available snapshots by making a list() request.
  126825. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  126826. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  126827. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126828. c.project = project
  126829. c.snapshot = snapshot
  126830. return c
  126831. }
  126832. // Fields allows partial responses to be retrieved. See
  126833. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126834. // for more information.
  126835. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  126836. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126837. return c
  126838. }
  126839. // IfNoneMatch sets the optional parameter which makes the operation
  126840. // fail if the object's ETag matches the given value. This is useful for
  126841. // getting updates only after the object has changed since the last
  126842. // request. Use googleapi.IsNotModified to check whether the response
  126843. // error from Do is the result of In-None-Match.
  126844. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  126845. c.ifNoneMatch_ = entityTag
  126846. return c
  126847. }
  126848. // Context sets the context to be used in this call's Do method. Any
  126849. // pending HTTP request will be aborted if the provided context is
  126850. // canceled.
  126851. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  126852. c.ctx_ = ctx
  126853. return c
  126854. }
  126855. // Header returns an http.Header that can be modified by the caller to
  126856. // add HTTP headers to the request.
  126857. func (c *SnapshotsGetCall) Header() http.Header {
  126858. if c.header_ == nil {
  126859. c.header_ = make(http.Header)
  126860. }
  126861. return c.header_
  126862. }
  126863. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  126864. reqHeaders := make(http.Header)
  126865. for k, v := range c.header_ {
  126866. reqHeaders[k] = v
  126867. }
  126868. reqHeaders.Set("User-Agent", c.s.userAgent())
  126869. if c.ifNoneMatch_ != "" {
  126870. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  126871. }
  126872. var body io.Reader = nil
  126873. c.urlParams_.Set("alt", alt)
  126874. c.urlParams_.Set("prettyPrint", "false")
  126875. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  126876. urls += "?" + c.urlParams_.Encode()
  126877. req, err := http.NewRequest("GET", urls, body)
  126878. if err != nil {
  126879. return nil, err
  126880. }
  126881. req.Header = reqHeaders
  126882. googleapi.Expand(req.URL, map[string]string{
  126883. "project": c.project,
  126884. "snapshot": c.snapshot,
  126885. })
  126886. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126887. }
  126888. // Do executes the "compute.snapshots.get" call.
  126889. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  126890. // code is an error. Response headers are in either
  126891. // *Snapshot.ServerResponse.Header or (if a response was returned at
  126892. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126893. // to check whether the returned error was because
  126894. // http.StatusNotModified was returned.
  126895. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  126896. gensupport.SetOptions(c.urlParams_, opts...)
  126897. res, err := c.doRequest("json")
  126898. if res != nil && res.StatusCode == http.StatusNotModified {
  126899. if res.Body != nil {
  126900. res.Body.Close()
  126901. }
  126902. return nil, &googleapi.Error{
  126903. Code: res.StatusCode,
  126904. Header: res.Header,
  126905. }
  126906. }
  126907. if err != nil {
  126908. return nil, err
  126909. }
  126910. defer googleapi.CloseBody(res)
  126911. if err := googleapi.CheckResponse(res); err != nil {
  126912. return nil, err
  126913. }
  126914. ret := &Snapshot{
  126915. ServerResponse: googleapi.ServerResponse{
  126916. Header: res.Header,
  126917. HTTPStatusCode: res.StatusCode,
  126918. },
  126919. }
  126920. target := &ret
  126921. if err := gensupport.DecodeResponse(target, res); err != nil {
  126922. return nil, err
  126923. }
  126924. return ret, nil
  126925. // {
  126926. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  126927. // "httpMethod": "GET",
  126928. // "id": "compute.snapshots.get",
  126929. // "parameterOrder": [
  126930. // "project",
  126931. // "snapshot"
  126932. // ],
  126933. // "parameters": {
  126934. // "project": {
  126935. // "description": "Project ID for this request.",
  126936. // "location": "path",
  126937. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126938. // "required": true,
  126939. // "type": "string"
  126940. // },
  126941. // "snapshot": {
  126942. // "description": "Name of the Snapshot resource to return.",
  126943. // "location": "path",
  126944. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  126945. // "required": true,
  126946. // "type": "string"
  126947. // }
  126948. // },
  126949. // "path": "{project}/global/snapshots/{snapshot}",
  126950. // "response": {
  126951. // "$ref": "Snapshot"
  126952. // },
  126953. // "scopes": [
  126954. // "https://www.googleapis.com/auth/cloud-platform",
  126955. // "https://www.googleapis.com/auth/compute",
  126956. // "https://www.googleapis.com/auth/compute.readonly"
  126957. // ]
  126958. // }
  126959. }
  126960. // method id "compute.snapshots.getIamPolicy":
  126961. type SnapshotsGetIamPolicyCall struct {
  126962. s *Service
  126963. project string
  126964. resource string
  126965. urlParams_ gensupport.URLParams
  126966. ifNoneMatch_ string
  126967. ctx_ context.Context
  126968. header_ http.Header
  126969. }
  126970. // GetIamPolicy: Gets the access control policy for a resource. May be
  126971. // empty if no such policy or resource exists.
  126972. func (r *SnapshotsService) GetIamPolicy(project string, resource string) *SnapshotsGetIamPolicyCall {
  126973. c := &SnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126974. c.project = project
  126975. c.resource = resource
  126976. return c
  126977. }
  126978. // Fields allows partial responses to be retrieved. See
  126979. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126980. // for more information.
  126981. func (c *SnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsGetIamPolicyCall {
  126982. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126983. return c
  126984. }
  126985. // IfNoneMatch sets the optional parameter which makes the operation
  126986. // fail if the object's ETag matches the given value. This is useful for
  126987. // getting updates only after the object has changed since the last
  126988. // request. Use googleapi.IsNotModified to check whether the response
  126989. // error from Do is the result of In-None-Match.
  126990. func (c *SnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *SnapshotsGetIamPolicyCall {
  126991. c.ifNoneMatch_ = entityTag
  126992. return c
  126993. }
  126994. // Context sets the context to be used in this call's Do method. Any
  126995. // pending HTTP request will be aborted if the provided context is
  126996. // canceled.
  126997. func (c *SnapshotsGetIamPolicyCall) Context(ctx context.Context) *SnapshotsGetIamPolicyCall {
  126998. c.ctx_ = ctx
  126999. return c
  127000. }
  127001. // Header returns an http.Header that can be modified by the caller to
  127002. // add HTTP headers to the request.
  127003. func (c *SnapshotsGetIamPolicyCall) Header() http.Header {
  127004. if c.header_ == nil {
  127005. c.header_ = make(http.Header)
  127006. }
  127007. return c.header_
  127008. }
  127009. func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  127010. reqHeaders := make(http.Header)
  127011. for k, v := range c.header_ {
  127012. reqHeaders[k] = v
  127013. }
  127014. reqHeaders.Set("User-Agent", c.s.userAgent())
  127015. if c.ifNoneMatch_ != "" {
  127016. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  127017. }
  127018. var body io.Reader = nil
  127019. c.urlParams_.Set("alt", alt)
  127020. c.urlParams_.Set("prettyPrint", "false")
  127021. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/getIamPolicy")
  127022. urls += "?" + c.urlParams_.Encode()
  127023. req, err := http.NewRequest("GET", urls, body)
  127024. if err != nil {
  127025. return nil, err
  127026. }
  127027. req.Header = reqHeaders
  127028. googleapi.Expand(req.URL, map[string]string{
  127029. "project": c.project,
  127030. "resource": c.resource,
  127031. })
  127032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127033. }
  127034. // Do executes the "compute.snapshots.getIamPolicy" call.
  127035. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  127036. // code is an error. Response headers are in either
  127037. // *Policy.ServerResponse.Header or (if a response was returned at all)
  127038. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  127039. // check whether the returned error was because http.StatusNotModified
  127040. // was returned.
  127041. func (c *SnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  127042. gensupport.SetOptions(c.urlParams_, opts...)
  127043. res, err := c.doRequest("json")
  127044. if res != nil && res.StatusCode == http.StatusNotModified {
  127045. if res.Body != nil {
  127046. res.Body.Close()
  127047. }
  127048. return nil, &googleapi.Error{
  127049. Code: res.StatusCode,
  127050. Header: res.Header,
  127051. }
  127052. }
  127053. if err != nil {
  127054. return nil, err
  127055. }
  127056. defer googleapi.CloseBody(res)
  127057. if err := googleapi.CheckResponse(res); err != nil {
  127058. return nil, err
  127059. }
  127060. ret := &Policy{
  127061. ServerResponse: googleapi.ServerResponse{
  127062. Header: res.Header,
  127063. HTTPStatusCode: res.StatusCode,
  127064. },
  127065. }
  127066. target := &ret
  127067. if err := gensupport.DecodeResponse(target, res); err != nil {
  127068. return nil, err
  127069. }
  127070. return ret, nil
  127071. // {
  127072. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  127073. // "httpMethod": "GET",
  127074. // "id": "compute.snapshots.getIamPolicy",
  127075. // "parameterOrder": [
  127076. // "project",
  127077. // "resource"
  127078. // ],
  127079. // "parameters": {
  127080. // "project": {
  127081. // "description": "Project ID for this request.",
  127082. // "location": "path",
  127083. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127084. // "required": true,
  127085. // "type": "string"
  127086. // },
  127087. // "resource": {
  127088. // "description": "Name or id of the resource for this request.",
  127089. // "location": "path",
  127090. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  127091. // "required": true,
  127092. // "type": "string"
  127093. // }
  127094. // },
  127095. // "path": "{project}/global/snapshots/{resource}/getIamPolicy",
  127096. // "response": {
  127097. // "$ref": "Policy"
  127098. // },
  127099. // "scopes": [
  127100. // "https://www.googleapis.com/auth/cloud-platform",
  127101. // "https://www.googleapis.com/auth/compute",
  127102. // "https://www.googleapis.com/auth/compute.readonly"
  127103. // ]
  127104. // }
  127105. }
  127106. // method id "compute.snapshots.list":
  127107. type SnapshotsListCall struct {
  127108. s *Service
  127109. project string
  127110. urlParams_ gensupport.URLParams
  127111. ifNoneMatch_ string
  127112. ctx_ context.Context
  127113. header_ http.Header
  127114. }
  127115. // List: Retrieves the list of Snapshot resources contained within the
  127116. // specified project.
  127117. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  127118. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  127119. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127120. c.project = project
  127121. return c
  127122. }
  127123. // Filter sets the optional parameter "filter": A filter expression that
  127124. // filters resources listed in the response. The expression must specify
  127125. // the field name, a comparison operator, and the value that you want to
  127126. // use for filtering. The value must be a string, a number, or a
  127127. // boolean. The comparison operator must be either =, !=, >, or <.
  127128. //
  127129. // For example, if you are filtering Compute Engine instances, you can
  127130. // exclude instances named example-instance by specifying name !=
  127131. // example-instance.
  127132. //
  127133. // You can also filter nested fields. For example, you could specify
  127134. // scheduling.automaticRestart = false to include instances only if they
  127135. // are not scheduled for automatic restarts. You can use filtering on
  127136. // nested fields to filter based on resource labels.
  127137. //
  127138. // To filter on multiple expressions, provide each separate expression
  127139. // within parentheses. For example, (scheduling.automaticRestart = true)
  127140. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  127141. // AND expression. However, you can include AND and OR expressions
  127142. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  127143. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  127144. // true).
  127145. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  127146. c.urlParams_.Set("filter", filter)
  127147. return c
  127148. }
  127149. // MaxResults sets the optional parameter "maxResults": The maximum
  127150. // number of results per page that should be returned. If the number of
  127151. // available results is larger than maxResults, Compute Engine returns a
  127152. // nextPageToken that can be used to get the next page of results in
  127153. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  127154. // (Default: 500)
  127155. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  127156. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  127157. return c
  127158. }
  127159. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  127160. // a certain order. By default, results are returned in alphanumerical
  127161. // order based on the resource name.
  127162. //
  127163. // You can also sort results in descending order based on the creation
  127164. // timestamp using orderBy="creationTimestamp desc". This sorts results
  127165. // based on the creationTimestamp field in reverse chronological order
  127166. // (newest result first). Use this to sort resources like operations so
  127167. // that the newest operation is returned first.
  127168. //
  127169. // Currently, only sorting by name or creationTimestamp desc is
  127170. // supported.
  127171. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  127172. c.urlParams_.Set("orderBy", orderBy)
  127173. return c
  127174. }
  127175. // PageToken sets the optional parameter "pageToken": Specifies a page
  127176. // token to use. Set pageToken to the nextPageToken returned by a
  127177. // previous list request to get the next page of results.
  127178. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  127179. c.urlParams_.Set("pageToken", pageToken)
  127180. return c
  127181. }
  127182. // Fields allows partial responses to be retrieved. See
  127183. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127184. // for more information.
  127185. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  127186. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127187. return c
  127188. }
  127189. // IfNoneMatch sets the optional parameter which makes the operation
  127190. // fail if the object's ETag matches the given value. This is useful for
  127191. // getting updates only after the object has changed since the last
  127192. // request. Use googleapi.IsNotModified to check whether the response
  127193. // error from Do is the result of In-None-Match.
  127194. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  127195. c.ifNoneMatch_ = entityTag
  127196. return c
  127197. }
  127198. // Context sets the context to be used in this call's Do method. Any
  127199. // pending HTTP request will be aborted if the provided context is
  127200. // canceled.
  127201. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  127202. c.ctx_ = ctx
  127203. return c
  127204. }
  127205. // Header returns an http.Header that can be modified by the caller to
  127206. // add HTTP headers to the request.
  127207. func (c *SnapshotsListCall) Header() http.Header {
  127208. if c.header_ == nil {
  127209. c.header_ = make(http.Header)
  127210. }
  127211. return c.header_
  127212. }
  127213. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  127214. reqHeaders := make(http.Header)
  127215. for k, v := range c.header_ {
  127216. reqHeaders[k] = v
  127217. }
  127218. reqHeaders.Set("User-Agent", c.s.userAgent())
  127219. if c.ifNoneMatch_ != "" {
  127220. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  127221. }
  127222. var body io.Reader = nil
  127223. c.urlParams_.Set("alt", alt)
  127224. c.urlParams_.Set("prettyPrint", "false")
  127225. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  127226. urls += "?" + c.urlParams_.Encode()
  127227. req, err := http.NewRequest("GET", urls, body)
  127228. if err != nil {
  127229. return nil, err
  127230. }
  127231. req.Header = reqHeaders
  127232. googleapi.Expand(req.URL, map[string]string{
  127233. "project": c.project,
  127234. })
  127235. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127236. }
  127237. // Do executes the "compute.snapshots.list" call.
  127238. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  127239. // status code is an error. Response headers are in either
  127240. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  127241. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  127242. // to check whether the returned error was because
  127243. // http.StatusNotModified was returned.
  127244. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  127245. gensupport.SetOptions(c.urlParams_, opts...)
  127246. res, err := c.doRequest("json")
  127247. if res != nil && res.StatusCode == http.StatusNotModified {
  127248. if res.Body != nil {
  127249. res.Body.Close()
  127250. }
  127251. return nil, &googleapi.Error{
  127252. Code: res.StatusCode,
  127253. Header: res.Header,
  127254. }
  127255. }
  127256. if err != nil {
  127257. return nil, err
  127258. }
  127259. defer googleapi.CloseBody(res)
  127260. if err := googleapi.CheckResponse(res); err != nil {
  127261. return nil, err
  127262. }
  127263. ret := &SnapshotList{
  127264. ServerResponse: googleapi.ServerResponse{
  127265. Header: res.Header,
  127266. HTTPStatusCode: res.StatusCode,
  127267. },
  127268. }
  127269. target := &ret
  127270. if err := gensupport.DecodeResponse(target, res); err != nil {
  127271. return nil, err
  127272. }
  127273. return ret, nil
  127274. // {
  127275. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  127276. // "httpMethod": "GET",
  127277. // "id": "compute.snapshots.list",
  127278. // "parameterOrder": [
  127279. // "project"
  127280. // ],
  127281. // "parameters": {
  127282. // "filter": {
  127283. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  127284. // "location": "query",
  127285. // "type": "string"
  127286. // },
  127287. // "maxResults": {
  127288. // "default": "500",
  127289. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  127290. // "format": "uint32",
  127291. // "location": "query",
  127292. // "minimum": "0",
  127293. // "type": "integer"
  127294. // },
  127295. // "orderBy": {
  127296. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  127297. // "location": "query",
  127298. // "type": "string"
  127299. // },
  127300. // "pageToken": {
  127301. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  127302. // "location": "query",
  127303. // "type": "string"
  127304. // },
  127305. // "project": {
  127306. // "description": "Project ID for this request.",
  127307. // "location": "path",
  127308. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127309. // "required": true,
  127310. // "type": "string"
  127311. // }
  127312. // },
  127313. // "path": "{project}/global/snapshots",
  127314. // "response": {
  127315. // "$ref": "SnapshotList"
  127316. // },
  127317. // "scopes": [
  127318. // "https://www.googleapis.com/auth/cloud-platform",
  127319. // "https://www.googleapis.com/auth/compute",
  127320. // "https://www.googleapis.com/auth/compute.readonly"
  127321. // ]
  127322. // }
  127323. }
  127324. // Pages invokes f for each page of results.
  127325. // A non-nil error returned from f will halt the iteration.
  127326. // The provided context supersedes any context provided to the Context method.
  127327. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  127328. c.ctx_ = ctx
  127329. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  127330. for {
  127331. x, err := c.Do()
  127332. if err != nil {
  127333. return err
  127334. }
  127335. if err := f(x); err != nil {
  127336. return err
  127337. }
  127338. if x.NextPageToken == "" {
  127339. return nil
  127340. }
  127341. c.PageToken(x.NextPageToken)
  127342. }
  127343. }
  127344. // method id "compute.snapshots.setIamPolicy":
  127345. type SnapshotsSetIamPolicyCall struct {
  127346. s *Service
  127347. project string
  127348. resource string
  127349. globalsetpolicyrequest *GlobalSetPolicyRequest
  127350. urlParams_ gensupport.URLParams
  127351. ctx_ context.Context
  127352. header_ http.Header
  127353. }
  127354. // SetIamPolicy: Sets the access control policy on the specified
  127355. // resource. Replaces any existing policy.
  127356. func (r *SnapshotsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *SnapshotsSetIamPolicyCall {
  127357. c := &SnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127358. c.project = project
  127359. c.resource = resource
  127360. c.globalsetpolicyrequest = globalsetpolicyrequest
  127361. return c
  127362. }
  127363. // Fields allows partial responses to be retrieved. See
  127364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127365. // for more information.
  127366. func (c *SnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsSetIamPolicyCall {
  127367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127368. return c
  127369. }
  127370. // Context sets the context to be used in this call's Do method. Any
  127371. // pending HTTP request will be aborted if the provided context is
  127372. // canceled.
  127373. func (c *SnapshotsSetIamPolicyCall) Context(ctx context.Context) *SnapshotsSetIamPolicyCall {
  127374. c.ctx_ = ctx
  127375. return c
  127376. }
  127377. // Header returns an http.Header that can be modified by the caller to
  127378. // add HTTP headers to the request.
  127379. func (c *SnapshotsSetIamPolicyCall) Header() http.Header {
  127380. if c.header_ == nil {
  127381. c.header_ = make(http.Header)
  127382. }
  127383. return c.header_
  127384. }
  127385. func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  127386. reqHeaders := make(http.Header)
  127387. for k, v := range c.header_ {
  127388. reqHeaders[k] = v
  127389. }
  127390. reqHeaders.Set("User-Agent", c.s.userAgent())
  127391. var body io.Reader = nil
  127392. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  127393. if err != nil {
  127394. return nil, err
  127395. }
  127396. reqHeaders.Set("Content-Type", "application/json")
  127397. c.urlParams_.Set("alt", alt)
  127398. c.urlParams_.Set("prettyPrint", "false")
  127399. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setIamPolicy")
  127400. urls += "?" + c.urlParams_.Encode()
  127401. req, err := http.NewRequest("POST", urls, body)
  127402. if err != nil {
  127403. return nil, err
  127404. }
  127405. req.Header = reqHeaders
  127406. googleapi.Expand(req.URL, map[string]string{
  127407. "project": c.project,
  127408. "resource": c.resource,
  127409. })
  127410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127411. }
  127412. // Do executes the "compute.snapshots.setIamPolicy" call.
  127413. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  127414. // code is an error. Response headers are in either
  127415. // *Policy.ServerResponse.Header or (if a response was returned at all)
  127416. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  127417. // check whether the returned error was because http.StatusNotModified
  127418. // was returned.
  127419. func (c *SnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  127420. gensupport.SetOptions(c.urlParams_, opts...)
  127421. res, err := c.doRequest("json")
  127422. if res != nil && res.StatusCode == http.StatusNotModified {
  127423. if res.Body != nil {
  127424. res.Body.Close()
  127425. }
  127426. return nil, &googleapi.Error{
  127427. Code: res.StatusCode,
  127428. Header: res.Header,
  127429. }
  127430. }
  127431. if err != nil {
  127432. return nil, err
  127433. }
  127434. defer googleapi.CloseBody(res)
  127435. if err := googleapi.CheckResponse(res); err != nil {
  127436. return nil, err
  127437. }
  127438. ret := &Policy{
  127439. ServerResponse: googleapi.ServerResponse{
  127440. Header: res.Header,
  127441. HTTPStatusCode: res.StatusCode,
  127442. },
  127443. }
  127444. target := &ret
  127445. if err := gensupport.DecodeResponse(target, res); err != nil {
  127446. return nil, err
  127447. }
  127448. return ret, nil
  127449. // {
  127450. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  127451. // "httpMethod": "POST",
  127452. // "id": "compute.snapshots.setIamPolicy",
  127453. // "parameterOrder": [
  127454. // "project",
  127455. // "resource"
  127456. // ],
  127457. // "parameters": {
  127458. // "project": {
  127459. // "description": "Project ID for this request.",
  127460. // "location": "path",
  127461. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127462. // "required": true,
  127463. // "type": "string"
  127464. // },
  127465. // "resource": {
  127466. // "description": "Name or id of the resource for this request.",
  127467. // "location": "path",
  127468. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  127469. // "required": true,
  127470. // "type": "string"
  127471. // }
  127472. // },
  127473. // "path": "{project}/global/snapshots/{resource}/setIamPolicy",
  127474. // "request": {
  127475. // "$ref": "GlobalSetPolicyRequest"
  127476. // },
  127477. // "response": {
  127478. // "$ref": "Policy"
  127479. // },
  127480. // "scopes": [
  127481. // "https://www.googleapis.com/auth/cloud-platform",
  127482. // "https://www.googleapis.com/auth/compute"
  127483. // ]
  127484. // }
  127485. }
  127486. // method id "compute.snapshots.setLabels":
  127487. type SnapshotsSetLabelsCall struct {
  127488. s *Service
  127489. project string
  127490. resource string
  127491. globalsetlabelsrequest *GlobalSetLabelsRequest
  127492. urlParams_ gensupport.URLParams
  127493. ctx_ context.Context
  127494. header_ http.Header
  127495. }
  127496. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  127497. // read the Labeling Resources documentation.
  127498. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  127499. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127500. c.project = project
  127501. c.resource = resource
  127502. c.globalsetlabelsrequest = globalsetlabelsrequest
  127503. return c
  127504. }
  127505. // Fields allows partial responses to be retrieved. See
  127506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127507. // for more information.
  127508. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  127509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127510. return c
  127511. }
  127512. // Context sets the context to be used in this call's Do method. Any
  127513. // pending HTTP request will be aborted if the provided context is
  127514. // canceled.
  127515. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  127516. c.ctx_ = ctx
  127517. return c
  127518. }
  127519. // Header returns an http.Header that can be modified by the caller to
  127520. // add HTTP headers to the request.
  127521. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  127522. if c.header_ == nil {
  127523. c.header_ = make(http.Header)
  127524. }
  127525. return c.header_
  127526. }
  127527. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  127528. reqHeaders := make(http.Header)
  127529. for k, v := range c.header_ {
  127530. reqHeaders[k] = v
  127531. }
  127532. reqHeaders.Set("User-Agent", c.s.userAgent())
  127533. var body io.Reader = nil
  127534. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  127535. if err != nil {
  127536. return nil, err
  127537. }
  127538. reqHeaders.Set("Content-Type", "application/json")
  127539. c.urlParams_.Set("alt", alt)
  127540. c.urlParams_.Set("prettyPrint", "false")
  127541. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  127542. urls += "?" + c.urlParams_.Encode()
  127543. req, err := http.NewRequest("POST", urls, body)
  127544. if err != nil {
  127545. return nil, err
  127546. }
  127547. req.Header = reqHeaders
  127548. googleapi.Expand(req.URL, map[string]string{
  127549. "project": c.project,
  127550. "resource": c.resource,
  127551. })
  127552. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127553. }
  127554. // Do executes the "compute.snapshots.setLabels" call.
  127555. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  127556. // status code is an error. Response headers are in either
  127557. // *Operation.ServerResponse.Header or (if a response was returned at
  127558. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  127559. // to check whether the returned error was because
  127560. // http.StatusNotModified was returned.
  127561. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  127562. gensupport.SetOptions(c.urlParams_, opts...)
  127563. res, err := c.doRequest("json")
  127564. if res != nil && res.StatusCode == http.StatusNotModified {
  127565. if res.Body != nil {
  127566. res.Body.Close()
  127567. }
  127568. return nil, &googleapi.Error{
  127569. Code: res.StatusCode,
  127570. Header: res.Header,
  127571. }
  127572. }
  127573. if err != nil {
  127574. return nil, err
  127575. }
  127576. defer googleapi.CloseBody(res)
  127577. if err := googleapi.CheckResponse(res); err != nil {
  127578. return nil, err
  127579. }
  127580. ret := &Operation{
  127581. ServerResponse: googleapi.ServerResponse{
  127582. Header: res.Header,
  127583. HTTPStatusCode: res.StatusCode,
  127584. },
  127585. }
  127586. target := &ret
  127587. if err := gensupport.DecodeResponse(target, res); err != nil {
  127588. return nil, err
  127589. }
  127590. return ret, nil
  127591. // {
  127592. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  127593. // "httpMethod": "POST",
  127594. // "id": "compute.snapshots.setLabels",
  127595. // "parameterOrder": [
  127596. // "project",
  127597. // "resource"
  127598. // ],
  127599. // "parameters": {
  127600. // "project": {
  127601. // "description": "Project ID for this request.",
  127602. // "location": "path",
  127603. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127604. // "required": true,
  127605. // "type": "string"
  127606. // },
  127607. // "resource": {
  127608. // "description": "Name or id of the resource for this request.",
  127609. // "location": "path",
  127610. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  127611. // "required": true,
  127612. // "type": "string"
  127613. // }
  127614. // },
  127615. // "path": "{project}/global/snapshots/{resource}/setLabels",
  127616. // "request": {
  127617. // "$ref": "GlobalSetLabelsRequest"
  127618. // },
  127619. // "response": {
  127620. // "$ref": "Operation"
  127621. // },
  127622. // "scopes": [
  127623. // "https://www.googleapis.com/auth/cloud-platform",
  127624. // "https://www.googleapis.com/auth/compute"
  127625. // ]
  127626. // }
  127627. }
  127628. // method id "compute.snapshots.testIamPermissions":
  127629. type SnapshotsTestIamPermissionsCall struct {
  127630. s *Service
  127631. project string
  127632. resource string
  127633. testpermissionsrequest *TestPermissionsRequest
  127634. urlParams_ gensupport.URLParams
  127635. ctx_ context.Context
  127636. header_ http.Header
  127637. }
  127638. // TestIamPermissions: Returns permissions that a caller has on the
  127639. // specified resource.
  127640. func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
  127641. c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127642. c.project = project
  127643. c.resource = resource
  127644. c.testpermissionsrequest = testpermissionsrequest
  127645. return c
  127646. }
  127647. // Fields allows partial responses to be retrieved. See
  127648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127649. // for more information.
  127650. func (c *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
  127651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127652. return c
  127653. }
  127654. // Context sets the context to be used in this call's Do method. Any
  127655. // pending HTTP request will be aborted if the provided context is
  127656. // canceled.
  127657. func (c *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
  127658. c.ctx_ = ctx
  127659. return c
  127660. }
  127661. // Header returns an http.Header that can be modified by the caller to
  127662. // add HTTP headers to the request.
  127663. func (c *SnapshotsTestIamPermissionsCall) Header() http.Header {
  127664. if c.header_ == nil {
  127665. c.header_ = make(http.Header)
  127666. }
  127667. return c.header_
  127668. }
  127669. func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  127670. reqHeaders := make(http.Header)
  127671. for k, v := range c.header_ {
  127672. reqHeaders[k] = v
  127673. }
  127674. reqHeaders.Set("User-Agent", c.s.userAgent())
  127675. var body io.Reader = nil
  127676. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  127677. if err != nil {
  127678. return nil, err
  127679. }
  127680. reqHeaders.Set("Content-Type", "application/json")
  127681. c.urlParams_.Set("alt", alt)
  127682. c.urlParams_.Set("prettyPrint", "false")
  127683. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/testIamPermissions")
  127684. urls += "?" + c.urlParams_.Encode()
  127685. req, err := http.NewRequest("POST", urls, body)
  127686. if err != nil {
  127687. return nil, err
  127688. }
  127689. req.Header = reqHeaders
  127690. googleapi.Expand(req.URL, map[string]string{
  127691. "project": c.project,
  127692. "resource": c.resource,
  127693. })
  127694. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127695. }
  127696. // Do executes the "compute.snapshots.testIamPermissions" call.
  127697. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  127698. // non-2xx status code is an error. Response headers are in either
  127699. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  127700. // returned at all) in error.(*googleapi.Error).Header. Use
  127701. // googleapi.IsNotModified to check whether the returned error was
  127702. // because http.StatusNotModified was returned.
  127703. func (c *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  127704. gensupport.SetOptions(c.urlParams_, opts...)
  127705. res, err := c.doRequest("json")
  127706. if res != nil && res.StatusCode == http.StatusNotModified {
  127707. if res.Body != nil {
  127708. res.Body.Close()
  127709. }
  127710. return nil, &googleapi.Error{
  127711. Code: res.StatusCode,
  127712. Header: res.Header,
  127713. }
  127714. }
  127715. if err != nil {
  127716. return nil, err
  127717. }
  127718. defer googleapi.CloseBody(res)
  127719. if err := googleapi.CheckResponse(res); err != nil {
  127720. return nil, err
  127721. }
  127722. ret := &TestPermissionsResponse{
  127723. ServerResponse: googleapi.ServerResponse{
  127724. Header: res.Header,
  127725. HTTPStatusCode: res.StatusCode,
  127726. },
  127727. }
  127728. target := &ret
  127729. if err := gensupport.DecodeResponse(target, res); err != nil {
  127730. return nil, err
  127731. }
  127732. return ret, nil
  127733. // {
  127734. // "description": "Returns permissions that a caller has on the specified resource.",
  127735. // "httpMethod": "POST",
  127736. // "id": "compute.snapshots.testIamPermissions",
  127737. // "parameterOrder": [
  127738. // "project",
  127739. // "resource"
  127740. // ],
  127741. // "parameters": {
  127742. // "project": {
  127743. // "description": "Project ID for this request.",
  127744. // "location": "path",
  127745. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127746. // "required": true,
  127747. // "type": "string"
  127748. // },
  127749. // "resource": {
  127750. // "description": "Name or id of the resource for this request.",
  127751. // "location": "path",
  127752. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  127753. // "required": true,
  127754. // "type": "string"
  127755. // }
  127756. // },
  127757. // "path": "{project}/global/snapshots/{resource}/testIamPermissions",
  127758. // "request": {
  127759. // "$ref": "TestPermissionsRequest"
  127760. // },
  127761. // "response": {
  127762. // "$ref": "TestPermissionsResponse"
  127763. // },
  127764. // "scopes": [
  127765. // "https://www.googleapis.com/auth/cloud-platform",
  127766. // "https://www.googleapis.com/auth/compute",
  127767. // "https://www.googleapis.com/auth/compute.readonly"
  127768. // ]
  127769. // }
  127770. }
  127771. // method id "compute.sslCertificates.aggregatedList":
  127772. type SslCertificatesAggregatedListCall struct {
  127773. s *Service
  127774. project string
  127775. urlParams_ gensupport.URLParams
  127776. ifNoneMatch_ string
  127777. ctx_ context.Context
  127778. header_ http.Header
  127779. }
  127780. // AggregatedList: Retrieves the list of all SslCertificate resources,
  127781. // regional and global, available to the specified project.
  127782. func (r *SslCertificatesService) AggregatedList(project string) *SslCertificatesAggregatedListCall {
  127783. c := &SslCertificatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127784. c.project = project
  127785. return c
  127786. }
  127787. // Filter sets the optional parameter "filter": A filter expression that
  127788. // filters resources listed in the response. The expression must specify
  127789. // the field name, a comparison operator, and the value that you want to
  127790. // use for filtering. The value must be a string, a number, or a
  127791. // boolean. The comparison operator must be either =, !=, >, or <.
  127792. //
  127793. // For example, if you are filtering Compute Engine instances, you can
  127794. // exclude instances named example-instance by specifying name !=
  127795. // example-instance.
  127796. //
  127797. // You can also filter nested fields. For example, you could specify
  127798. // scheduling.automaticRestart = false to include instances only if they
  127799. // are not scheduled for automatic restarts. You can use filtering on
  127800. // nested fields to filter based on resource labels.
  127801. //
  127802. // To filter on multiple expressions, provide each separate expression
  127803. // within parentheses. For example, (scheduling.automaticRestart = true)
  127804. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  127805. // AND expression. However, you can include AND and OR expressions
  127806. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  127807. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  127808. // true).
  127809. func (c *SslCertificatesAggregatedListCall) Filter(filter string) *SslCertificatesAggregatedListCall {
  127810. c.urlParams_.Set("filter", filter)
  127811. return c
  127812. }
  127813. // MaxResults sets the optional parameter "maxResults": The maximum
  127814. // number of results per page that should be returned. If the number of
  127815. // available results is larger than maxResults, Compute Engine returns a
  127816. // nextPageToken that can be used to get the next page of results in
  127817. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  127818. // (Default: 500)
  127819. func (c *SslCertificatesAggregatedListCall) MaxResults(maxResults int64) *SslCertificatesAggregatedListCall {
  127820. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  127821. return c
  127822. }
  127823. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  127824. // a certain order. By default, results are returned in alphanumerical
  127825. // order based on the resource name.
  127826. //
  127827. // You can also sort results in descending order based on the creation
  127828. // timestamp using orderBy="creationTimestamp desc". This sorts results
  127829. // based on the creationTimestamp field in reverse chronological order
  127830. // (newest result first). Use this to sort resources like operations so
  127831. // that the newest operation is returned first.
  127832. //
  127833. // Currently, only sorting by name or creationTimestamp desc is
  127834. // supported.
  127835. func (c *SslCertificatesAggregatedListCall) OrderBy(orderBy string) *SslCertificatesAggregatedListCall {
  127836. c.urlParams_.Set("orderBy", orderBy)
  127837. return c
  127838. }
  127839. // PageToken sets the optional parameter "pageToken": Specifies a page
  127840. // token to use. Set pageToken to the nextPageToken returned by a
  127841. // previous list request to get the next page of results.
  127842. func (c *SslCertificatesAggregatedListCall) PageToken(pageToken string) *SslCertificatesAggregatedListCall {
  127843. c.urlParams_.Set("pageToken", pageToken)
  127844. return c
  127845. }
  127846. // Fields allows partial responses to be retrieved. See
  127847. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127848. // for more information.
  127849. func (c *SslCertificatesAggregatedListCall) Fields(s ...googleapi.Field) *SslCertificatesAggregatedListCall {
  127850. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127851. return c
  127852. }
  127853. // IfNoneMatch sets the optional parameter which makes the operation
  127854. // fail if the object's ETag matches the given value. This is useful for
  127855. // getting updates only after the object has changed since the last
  127856. // request. Use googleapi.IsNotModified to check whether the response
  127857. // error from Do is the result of In-None-Match.
  127858. func (c *SslCertificatesAggregatedListCall) IfNoneMatch(entityTag string) *SslCertificatesAggregatedListCall {
  127859. c.ifNoneMatch_ = entityTag
  127860. return c
  127861. }
  127862. // Context sets the context to be used in this call's Do method. Any
  127863. // pending HTTP request will be aborted if the provided context is
  127864. // canceled.
  127865. func (c *SslCertificatesAggregatedListCall) Context(ctx context.Context) *SslCertificatesAggregatedListCall {
  127866. c.ctx_ = ctx
  127867. return c
  127868. }
  127869. // Header returns an http.Header that can be modified by the caller to
  127870. // add HTTP headers to the request.
  127871. func (c *SslCertificatesAggregatedListCall) Header() http.Header {
  127872. if c.header_ == nil {
  127873. c.header_ = make(http.Header)
  127874. }
  127875. return c.header_
  127876. }
  127877. func (c *SslCertificatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  127878. reqHeaders := make(http.Header)
  127879. for k, v := range c.header_ {
  127880. reqHeaders[k] = v
  127881. }
  127882. reqHeaders.Set("User-Agent", c.s.userAgent())
  127883. if c.ifNoneMatch_ != "" {
  127884. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  127885. }
  127886. var body io.Reader = nil
  127887. c.urlParams_.Set("alt", alt)
  127888. c.urlParams_.Set("prettyPrint", "false")
  127889. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/sslCertificates")
  127890. urls += "?" + c.urlParams_.Encode()
  127891. req, err := http.NewRequest("GET", urls, body)
  127892. if err != nil {
  127893. return nil, err
  127894. }
  127895. req.Header = reqHeaders
  127896. googleapi.Expand(req.URL, map[string]string{
  127897. "project": c.project,
  127898. })
  127899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127900. }
  127901. // Do executes the "compute.sslCertificates.aggregatedList" call.
  127902. // Exactly one of *SslCertificateAggregatedList or error will be
  127903. // non-nil. Any non-2xx status code is an error. Response headers are in
  127904. // either *SslCertificateAggregatedList.ServerResponse.Header or (if a
  127905. // response was returned at all) in error.(*googleapi.Error).Header. Use
  127906. // googleapi.IsNotModified to check whether the returned error was
  127907. // because http.StatusNotModified was returned.
  127908. func (c *SslCertificatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*SslCertificateAggregatedList, error) {
  127909. gensupport.SetOptions(c.urlParams_, opts...)
  127910. res, err := c.doRequest("json")
  127911. if res != nil && res.StatusCode == http.StatusNotModified {
  127912. if res.Body != nil {
  127913. res.Body.Close()
  127914. }
  127915. return nil, &googleapi.Error{
  127916. Code: res.StatusCode,
  127917. Header: res.Header,
  127918. }
  127919. }
  127920. if err != nil {
  127921. return nil, err
  127922. }
  127923. defer googleapi.CloseBody(res)
  127924. if err := googleapi.CheckResponse(res); err != nil {
  127925. return nil, err
  127926. }
  127927. ret := &SslCertificateAggregatedList{
  127928. ServerResponse: googleapi.ServerResponse{
  127929. Header: res.Header,
  127930. HTTPStatusCode: res.StatusCode,
  127931. },
  127932. }
  127933. target := &ret
  127934. if err := gensupport.DecodeResponse(target, res); err != nil {
  127935. return nil, err
  127936. }
  127937. return ret, nil
  127938. // {
  127939. // "description": "Retrieves the list of all SslCertificate resources, regional and global, available to the specified project.",
  127940. // "httpMethod": "GET",
  127941. // "id": "compute.sslCertificates.aggregatedList",
  127942. // "parameterOrder": [
  127943. // "project"
  127944. // ],
  127945. // "parameters": {
  127946. // "filter": {
  127947. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  127948. // "location": "query",
  127949. // "type": "string"
  127950. // },
  127951. // "maxResults": {
  127952. // "default": "500",
  127953. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  127954. // "format": "uint32",
  127955. // "location": "query",
  127956. // "minimum": "0",
  127957. // "type": "integer"
  127958. // },
  127959. // "orderBy": {
  127960. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  127961. // "location": "query",
  127962. // "type": "string"
  127963. // },
  127964. // "pageToken": {
  127965. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  127966. // "location": "query",
  127967. // "type": "string"
  127968. // },
  127969. // "project": {
  127970. // "description": "Name of the project scoping this request.",
  127971. // "location": "path",
  127972. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127973. // "required": true,
  127974. // "type": "string"
  127975. // }
  127976. // },
  127977. // "path": "{project}/aggregated/sslCertificates",
  127978. // "response": {
  127979. // "$ref": "SslCertificateAggregatedList"
  127980. // },
  127981. // "scopes": [
  127982. // "https://www.googleapis.com/auth/cloud-platform",
  127983. // "https://www.googleapis.com/auth/compute",
  127984. // "https://www.googleapis.com/auth/compute.readonly"
  127985. // ]
  127986. // }
  127987. }
  127988. // Pages invokes f for each page of results.
  127989. // A non-nil error returned from f will halt the iteration.
  127990. // The provided context supersedes any context provided to the Context method.
  127991. func (c *SslCertificatesAggregatedListCall) Pages(ctx context.Context, f func(*SslCertificateAggregatedList) error) error {
  127992. c.ctx_ = ctx
  127993. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  127994. for {
  127995. x, err := c.Do()
  127996. if err != nil {
  127997. return err
  127998. }
  127999. if err := f(x); err != nil {
  128000. return err
  128001. }
  128002. if x.NextPageToken == "" {
  128003. return nil
  128004. }
  128005. c.PageToken(x.NextPageToken)
  128006. }
  128007. }
  128008. // method id "compute.sslCertificates.delete":
  128009. type SslCertificatesDeleteCall struct {
  128010. s *Service
  128011. project string
  128012. sslCertificate string
  128013. urlParams_ gensupport.URLParams
  128014. ctx_ context.Context
  128015. header_ http.Header
  128016. }
  128017. // Delete: Deletes the specified SslCertificate resource.
  128018. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  128019. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128020. c.project = project
  128021. c.sslCertificate = sslCertificate
  128022. return c
  128023. }
  128024. // RequestId sets the optional parameter "requestId": An optional
  128025. // request ID to identify requests. Specify a unique request ID so that
  128026. // if you must retry your request, the server will know to ignore the
  128027. // request if it has already been completed.
  128028. //
  128029. // For example, consider a situation where you make an initial request
  128030. // and the request times out. If you make the request again with the
  128031. // same request ID, the server can check if original operation with the
  128032. // same request ID was received, and if so, will ignore the second
  128033. // request. This prevents clients from accidentally creating duplicate
  128034. // commitments.
  128035. //
  128036. // The request ID must be a valid UUID with the exception that zero UUID
  128037. // is not supported (00000000-0000-0000-0000-000000000000).
  128038. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  128039. c.urlParams_.Set("requestId", requestId)
  128040. return c
  128041. }
  128042. // Fields allows partial responses to be retrieved. See
  128043. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128044. // for more information.
  128045. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  128046. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128047. return c
  128048. }
  128049. // Context sets the context to be used in this call's Do method. Any
  128050. // pending HTTP request will be aborted if the provided context is
  128051. // canceled.
  128052. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  128053. c.ctx_ = ctx
  128054. return c
  128055. }
  128056. // Header returns an http.Header that can be modified by the caller to
  128057. // add HTTP headers to the request.
  128058. func (c *SslCertificatesDeleteCall) Header() http.Header {
  128059. if c.header_ == nil {
  128060. c.header_ = make(http.Header)
  128061. }
  128062. return c.header_
  128063. }
  128064. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  128065. reqHeaders := make(http.Header)
  128066. for k, v := range c.header_ {
  128067. reqHeaders[k] = v
  128068. }
  128069. reqHeaders.Set("User-Agent", c.s.userAgent())
  128070. var body io.Reader = nil
  128071. c.urlParams_.Set("alt", alt)
  128072. c.urlParams_.Set("prettyPrint", "false")
  128073. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  128074. urls += "?" + c.urlParams_.Encode()
  128075. req, err := http.NewRequest("DELETE", urls, body)
  128076. if err != nil {
  128077. return nil, err
  128078. }
  128079. req.Header = reqHeaders
  128080. googleapi.Expand(req.URL, map[string]string{
  128081. "project": c.project,
  128082. "sslCertificate": c.sslCertificate,
  128083. })
  128084. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128085. }
  128086. // Do executes the "compute.sslCertificates.delete" call.
  128087. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  128088. // status code is an error. Response headers are in either
  128089. // *Operation.ServerResponse.Header or (if a response was returned at
  128090. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  128091. // to check whether the returned error was because
  128092. // http.StatusNotModified was returned.
  128093. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  128094. gensupport.SetOptions(c.urlParams_, opts...)
  128095. res, err := c.doRequest("json")
  128096. if res != nil && res.StatusCode == http.StatusNotModified {
  128097. if res.Body != nil {
  128098. res.Body.Close()
  128099. }
  128100. return nil, &googleapi.Error{
  128101. Code: res.StatusCode,
  128102. Header: res.Header,
  128103. }
  128104. }
  128105. if err != nil {
  128106. return nil, err
  128107. }
  128108. defer googleapi.CloseBody(res)
  128109. if err := googleapi.CheckResponse(res); err != nil {
  128110. return nil, err
  128111. }
  128112. ret := &Operation{
  128113. ServerResponse: googleapi.ServerResponse{
  128114. Header: res.Header,
  128115. HTTPStatusCode: res.StatusCode,
  128116. },
  128117. }
  128118. target := &ret
  128119. if err := gensupport.DecodeResponse(target, res); err != nil {
  128120. return nil, err
  128121. }
  128122. return ret, nil
  128123. // {
  128124. // "description": "Deletes the specified SslCertificate resource.",
  128125. // "httpMethod": "DELETE",
  128126. // "id": "compute.sslCertificates.delete",
  128127. // "parameterOrder": [
  128128. // "project",
  128129. // "sslCertificate"
  128130. // ],
  128131. // "parameters": {
  128132. // "project": {
  128133. // "description": "Project ID for this request.",
  128134. // "location": "path",
  128135. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128136. // "required": true,
  128137. // "type": "string"
  128138. // },
  128139. // "requestId": {
  128140. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  128141. // "location": "query",
  128142. // "type": "string"
  128143. // },
  128144. // "sslCertificate": {
  128145. // "description": "Name of the SslCertificate resource to delete.",
  128146. // "location": "path",
  128147. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  128148. // "required": true,
  128149. // "type": "string"
  128150. // }
  128151. // },
  128152. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  128153. // "response": {
  128154. // "$ref": "Operation"
  128155. // },
  128156. // "scopes": [
  128157. // "https://www.googleapis.com/auth/cloud-platform",
  128158. // "https://www.googleapis.com/auth/compute"
  128159. // ]
  128160. // }
  128161. }
  128162. // method id "compute.sslCertificates.get":
  128163. type SslCertificatesGetCall struct {
  128164. s *Service
  128165. project string
  128166. sslCertificate string
  128167. urlParams_ gensupport.URLParams
  128168. ifNoneMatch_ string
  128169. ctx_ context.Context
  128170. header_ http.Header
  128171. }
  128172. // Get: Returns the specified SslCertificate resource. Gets a list of
  128173. // available SSL certificates by making a list() request.
  128174. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  128175. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128176. c.project = project
  128177. c.sslCertificate = sslCertificate
  128178. return c
  128179. }
  128180. // Fields allows partial responses to be retrieved. See
  128181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128182. // for more information.
  128183. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  128184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128185. return c
  128186. }
  128187. // IfNoneMatch sets the optional parameter which makes the operation
  128188. // fail if the object's ETag matches the given value. This is useful for
  128189. // getting updates only after the object has changed since the last
  128190. // request. Use googleapi.IsNotModified to check whether the response
  128191. // error from Do is the result of In-None-Match.
  128192. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  128193. c.ifNoneMatch_ = entityTag
  128194. return c
  128195. }
  128196. // Context sets the context to be used in this call's Do method. Any
  128197. // pending HTTP request will be aborted if the provided context is
  128198. // canceled.
  128199. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  128200. c.ctx_ = ctx
  128201. return c
  128202. }
  128203. // Header returns an http.Header that can be modified by the caller to
  128204. // add HTTP headers to the request.
  128205. func (c *SslCertificatesGetCall) Header() http.Header {
  128206. if c.header_ == nil {
  128207. c.header_ = make(http.Header)
  128208. }
  128209. return c.header_
  128210. }
  128211. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  128212. reqHeaders := make(http.Header)
  128213. for k, v := range c.header_ {
  128214. reqHeaders[k] = v
  128215. }
  128216. reqHeaders.Set("User-Agent", c.s.userAgent())
  128217. if c.ifNoneMatch_ != "" {
  128218. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  128219. }
  128220. var body io.Reader = nil
  128221. c.urlParams_.Set("alt", alt)
  128222. c.urlParams_.Set("prettyPrint", "false")
  128223. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  128224. urls += "?" + c.urlParams_.Encode()
  128225. req, err := http.NewRequest("GET", urls, body)
  128226. if err != nil {
  128227. return nil, err
  128228. }
  128229. req.Header = reqHeaders
  128230. googleapi.Expand(req.URL, map[string]string{
  128231. "project": c.project,
  128232. "sslCertificate": c.sslCertificate,
  128233. })
  128234. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128235. }
  128236. // Do executes the "compute.sslCertificates.get" call.
  128237. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  128238. // status code is an error. Response headers are in either
  128239. // *SslCertificate.ServerResponse.Header or (if a response was returned
  128240. // at all) in error.(*googleapi.Error).Header. Use
  128241. // googleapi.IsNotModified to check whether the returned error was
  128242. // because http.StatusNotModified was returned.
  128243. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  128244. gensupport.SetOptions(c.urlParams_, opts...)
  128245. res, err := c.doRequest("json")
  128246. if res != nil && res.StatusCode == http.StatusNotModified {
  128247. if res.Body != nil {
  128248. res.Body.Close()
  128249. }
  128250. return nil, &googleapi.Error{
  128251. Code: res.StatusCode,
  128252. Header: res.Header,
  128253. }
  128254. }
  128255. if err != nil {
  128256. return nil, err
  128257. }
  128258. defer googleapi.CloseBody(res)
  128259. if err := googleapi.CheckResponse(res); err != nil {
  128260. return nil, err
  128261. }
  128262. ret := &SslCertificate{
  128263. ServerResponse: googleapi.ServerResponse{
  128264. Header: res.Header,
  128265. HTTPStatusCode: res.StatusCode,
  128266. },
  128267. }
  128268. target := &ret
  128269. if err := gensupport.DecodeResponse(target, res); err != nil {
  128270. return nil, err
  128271. }
  128272. return ret, nil
  128273. // {
  128274. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  128275. // "httpMethod": "GET",
  128276. // "id": "compute.sslCertificates.get",
  128277. // "parameterOrder": [
  128278. // "project",
  128279. // "sslCertificate"
  128280. // ],
  128281. // "parameters": {
  128282. // "project": {
  128283. // "description": "Project ID for this request.",
  128284. // "location": "path",
  128285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128286. // "required": true,
  128287. // "type": "string"
  128288. // },
  128289. // "sslCertificate": {
  128290. // "description": "Name of the SslCertificate resource to return.",
  128291. // "location": "path",
  128292. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  128293. // "required": true,
  128294. // "type": "string"
  128295. // }
  128296. // },
  128297. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  128298. // "response": {
  128299. // "$ref": "SslCertificate"
  128300. // },
  128301. // "scopes": [
  128302. // "https://www.googleapis.com/auth/cloud-platform",
  128303. // "https://www.googleapis.com/auth/compute",
  128304. // "https://www.googleapis.com/auth/compute.readonly"
  128305. // ]
  128306. // }
  128307. }
  128308. // method id "compute.sslCertificates.insert":
  128309. type SslCertificatesInsertCall struct {
  128310. s *Service
  128311. project string
  128312. sslcertificate *SslCertificate
  128313. urlParams_ gensupport.URLParams
  128314. ctx_ context.Context
  128315. header_ http.Header
  128316. }
  128317. // Insert: Creates a SslCertificate resource in the specified project
  128318. // using the data included in the request.
  128319. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  128320. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128321. c.project = project
  128322. c.sslcertificate = sslcertificate
  128323. return c
  128324. }
  128325. // RequestId sets the optional parameter "requestId": An optional
  128326. // request ID to identify requests. Specify a unique request ID so that
  128327. // if you must retry your request, the server will know to ignore the
  128328. // request if it has already been completed.
  128329. //
  128330. // For example, consider a situation where you make an initial request
  128331. // and the request times out. If you make the request again with the
  128332. // same request ID, the server can check if original operation with the
  128333. // same request ID was received, and if so, will ignore the second
  128334. // request. This prevents clients from accidentally creating duplicate
  128335. // commitments.
  128336. //
  128337. // The request ID must be a valid UUID with the exception that zero UUID
  128338. // is not supported (00000000-0000-0000-0000-000000000000).
  128339. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  128340. c.urlParams_.Set("requestId", requestId)
  128341. return c
  128342. }
  128343. // Fields allows partial responses to be retrieved. See
  128344. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128345. // for more information.
  128346. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  128347. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128348. return c
  128349. }
  128350. // Context sets the context to be used in this call's Do method. Any
  128351. // pending HTTP request will be aborted if the provided context is
  128352. // canceled.
  128353. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  128354. c.ctx_ = ctx
  128355. return c
  128356. }
  128357. // Header returns an http.Header that can be modified by the caller to
  128358. // add HTTP headers to the request.
  128359. func (c *SslCertificatesInsertCall) Header() http.Header {
  128360. if c.header_ == nil {
  128361. c.header_ = make(http.Header)
  128362. }
  128363. return c.header_
  128364. }
  128365. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  128366. reqHeaders := make(http.Header)
  128367. for k, v := range c.header_ {
  128368. reqHeaders[k] = v
  128369. }
  128370. reqHeaders.Set("User-Agent", c.s.userAgent())
  128371. var body io.Reader = nil
  128372. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  128373. if err != nil {
  128374. return nil, err
  128375. }
  128376. reqHeaders.Set("Content-Type", "application/json")
  128377. c.urlParams_.Set("alt", alt)
  128378. c.urlParams_.Set("prettyPrint", "false")
  128379. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  128380. urls += "?" + c.urlParams_.Encode()
  128381. req, err := http.NewRequest("POST", urls, body)
  128382. if err != nil {
  128383. return nil, err
  128384. }
  128385. req.Header = reqHeaders
  128386. googleapi.Expand(req.URL, map[string]string{
  128387. "project": c.project,
  128388. })
  128389. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128390. }
  128391. // Do executes the "compute.sslCertificates.insert" call.
  128392. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  128393. // status code is an error. Response headers are in either
  128394. // *Operation.ServerResponse.Header or (if a response was returned at
  128395. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  128396. // to check whether the returned error was because
  128397. // http.StatusNotModified was returned.
  128398. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  128399. gensupport.SetOptions(c.urlParams_, opts...)
  128400. res, err := c.doRequest("json")
  128401. if res != nil && res.StatusCode == http.StatusNotModified {
  128402. if res.Body != nil {
  128403. res.Body.Close()
  128404. }
  128405. return nil, &googleapi.Error{
  128406. Code: res.StatusCode,
  128407. Header: res.Header,
  128408. }
  128409. }
  128410. if err != nil {
  128411. return nil, err
  128412. }
  128413. defer googleapi.CloseBody(res)
  128414. if err := googleapi.CheckResponse(res); err != nil {
  128415. return nil, err
  128416. }
  128417. ret := &Operation{
  128418. ServerResponse: googleapi.ServerResponse{
  128419. Header: res.Header,
  128420. HTTPStatusCode: res.StatusCode,
  128421. },
  128422. }
  128423. target := &ret
  128424. if err := gensupport.DecodeResponse(target, res); err != nil {
  128425. return nil, err
  128426. }
  128427. return ret, nil
  128428. // {
  128429. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  128430. // "httpMethod": "POST",
  128431. // "id": "compute.sslCertificates.insert",
  128432. // "parameterOrder": [
  128433. // "project"
  128434. // ],
  128435. // "parameters": {
  128436. // "project": {
  128437. // "description": "Project ID for this request.",
  128438. // "location": "path",
  128439. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128440. // "required": true,
  128441. // "type": "string"
  128442. // },
  128443. // "requestId": {
  128444. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  128445. // "location": "query",
  128446. // "type": "string"
  128447. // }
  128448. // },
  128449. // "path": "{project}/global/sslCertificates",
  128450. // "request": {
  128451. // "$ref": "SslCertificate"
  128452. // },
  128453. // "response": {
  128454. // "$ref": "Operation"
  128455. // },
  128456. // "scopes": [
  128457. // "https://www.googleapis.com/auth/cloud-platform",
  128458. // "https://www.googleapis.com/auth/compute"
  128459. // ]
  128460. // }
  128461. }
  128462. // method id "compute.sslCertificates.list":
  128463. type SslCertificatesListCall struct {
  128464. s *Service
  128465. project string
  128466. urlParams_ gensupport.URLParams
  128467. ifNoneMatch_ string
  128468. ctx_ context.Context
  128469. header_ http.Header
  128470. }
  128471. // List: Retrieves the list of SslCertificate resources available to the
  128472. // specified project.
  128473. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  128474. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128475. c.project = project
  128476. return c
  128477. }
  128478. // Filter sets the optional parameter "filter": A filter expression that
  128479. // filters resources listed in the response. The expression must specify
  128480. // the field name, a comparison operator, and the value that you want to
  128481. // use for filtering. The value must be a string, a number, or a
  128482. // boolean. The comparison operator must be either =, !=, >, or <.
  128483. //
  128484. // For example, if you are filtering Compute Engine instances, you can
  128485. // exclude instances named example-instance by specifying name !=
  128486. // example-instance.
  128487. //
  128488. // You can also filter nested fields. For example, you could specify
  128489. // scheduling.automaticRestart = false to include instances only if they
  128490. // are not scheduled for automatic restarts. You can use filtering on
  128491. // nested fields to filter based on resource labels.
  128492. //
  128493. // To filter on multiple expressions, provide each separate expression
  128494. // within parentheses. For example, (scheduling.automaticRestart = true)
  128495. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  128496. // AND expression. However, you can include AND and OR expressions
  128497. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  128498. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  128499. // true).
  128500. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  128501. c.urlParams_.Set("filter", filter)
  128502. return c
  128503. }
  128504. // MaxResults sets the optional parameter "maxResults": The maximum
  128505. // number of results per page that should be returned. If the number of
  128506. // available results is larger than maxResults, Compute Engine returns a
  128507. // nextPageToken that can be used to get the next page of results in
  128508. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  128509. // (Default: 500)
  128510. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  128511. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  128512. return c
  128513. }
  128514. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  128515. // a certain order. By default, results are returned in alphanumerical
  128516. // order based on the resource name.
  128517. //
  128518. // You can also sort results in descending order based on the creation
  128519. // timestamp using orderBy="creationTimestamp desc". This sorts results
  128520. // based on the creationTimestamp field in reverse chronological order
  128521. // (newest result first). Use this to sort resources like operations so
  128522. // that the newest operation is returned first.
  128523. //
  128524. // Currently, only sorting by name or creationTimestamp desc is
  128525. // supported.
  128526. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  128527. c.urlParams_.Set("orderBy", orderBy)
  128528. return c
  128529. }
  128530. // PageToken sets the optional parameter "pageToken": Specifies a page
  128531. // token to use. Set pageToken to the nextPageToken returned by a
  128532. // previous list request to get the next page of results.
  128533. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  128534. c.urlParams_.Set("pageToken", pageToken)
  128535. return c
  128536. }
  128537. // Fields allows partial responses to be retrieved. See
  128538. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128539. // for more information.
  128540. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  128541. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128542. return c
  128543. }
  128544. // IfNoneMatch sets the optional parameter which makes the operation
  128545. // fail if the object's ETag matches the given value. This is useful for
  128546. // getting updates only after the object has changed since the last
  128547. // request. Use googleapi.IsNotModified to check whether the response
  128548. // error from Do is the result of In-None-Match.
  128549. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  128550. c.ifNoneMatch_ = entityTag
  128551. return c
  128552. }
  128553. // Context sets the context to be used in this call's Do method. Any
  128554. // pending HTTP request will be aborted if the provided context is
  128555. // canceled.
  128556. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  128557. c.ctx_ = ctx
  128558. return c
  128559. }
  128560. // Header returns an http.Header that can be modified by the caller to
  128561. // add HTTP headers to the request.
  128562. func (c *SslCertificatesListCall) Header() http.Header {
  128563. if c.header_ == nil {
  128564. c.header_ = make(http.Header)
  128565. }
  128566. return c.header_
  128567. }
  128568. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  128569. reqHeaders := make(http.Header)
  128570. for k, v := range c.header_ {
  128571. reqHeaders[k] = v
  128572. }
  128573. reqHeaders.Set("User-Agent", c.s.userAgent())
  128574. if c.ifNoneMatch_ != "" {
  128575. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  128576. }
  128577. var body io.Reader = nil
  128578. c.urlParams_.Set("alt", alt)
  128579. c.urlParams_.Set("prettyPrint", "false")
  128580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  128581. urls += "?" + c.urlParams_.Encode()
  128582. req, err := http.NewRequest("GET", urls, body)
  128583. if err != nil {
  128584. return nil, err
  128585. }
  128586. req.Header = reqHeaders
  128587. googleapi.Expand(req.URL, map[string]string{
  128588. "project": c.project,
  128589. })
  128590. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128591. }
  128592. // Do executes the "compute.sslCertificates.list" call.
  128593. // Exactly one of *SslCertificateList or error will be non-nil. Any
  128594. // non-2xx status code is an error. Response headers are in either
  128595. // *SslCertificateList.ServerResponse.Header or (if a response was
  128596. // returned at all) in error.(*googleapi.Error).Header. Use
  128597. // googleapi.IsNotModified to check whether the returned error was
  128598. // because http.StatusNotModified was returned.
  128599. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  128600. gensupport.SetOptions(c.urlParams_, opts...)
  128601. res, err := c.doRequest("json")
  128602. if res != nil && res.StatusCode == http.StatusNotModified {
  128603. if res.Body != nil {
  128604. res.Body.Close()
  128605. }
  128606. return nil, &googleapi.Error{
  128607. Code: res.StatusCode,
  128608. Header: res.Header,
  128609. }
  128610. }
  128611. if err != nil {
  128612. return nil, err
  128613. }
  128614. defer googleapi.CloseBody(res)
  128615. if err := googleapi.CheckResponse(res); err != nil {
  128616. return nil, err
  128617. }
  128618. ret := &SslCertificateList{
  128619. ServerResponse: googleapi.ServerResponse{
  128620. Header: res.Header,
  128621. HTTPStatusCode: res.StatusCode,
  128622. },
  128623. }
  128624. target := &ret
  128625. if err := gensupport.DecodeResponse(target, res); err != nil {
  128626. return nil, err
  128627. }
  128628. return ret, nil
  128629. // {
  128630. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  128631. // "httpMethod": "GET",
  128632. // "id": "compute.sslCertificates.list",
  128633. // "parameterOrder": [
  128634. // "project"
  128635. // ],
  128636. // "parameters": {
  128637. // "filter": {
  128638. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  128639. // "location": "query",
  128640. // "type": "string"
  128641. // },
  128642. // "maxResults": {
  128643. // "default": "500",
  128644. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  128645. // "format": "uint32",
  128646. // "location": "query",
  128647. // "minimum": "0",
  128648. // "type": "integer"
  128649. // },
  128650. // "orderBy": {
  128651. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  128652. // "location": "query",
  128653. // "type": "string"
  128654. // },
  128655. // "pageToken": {
  128656. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  128657. // "location": "query",
  128658. // "type": "string"
  128659. // },
  128660. // "project": {
  128661. // "description": "Project ID for this request.",
  128662. // "location": "path",
  128663. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128664. // "required": true,
  128665. // "type": "string"
  128666. // }
  128667. // },
  128668. // "path": "{project}/global/sslCertificates",
  128669. // "response": {
  128670. // "$ref": "SslCertificateList"
  128671. // },
  128672. // "scopes": [
  128673. // "https://www.googleapis.com/auth/cloud-platform",
  128674. // "https://www.googleapis.com/auth/compute",
  128675. // "https://www.googleapis.com/auth/compute.readonly"
  128676. // ]
  128677. // }
  128678. }
  128679. // Pages invokes f for each page of results.
  128680. // A non-nil error returned from f will halt the iteration.
  128681. // The provided context supersedes any context provided to the Context method.
  128682. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  128683. c.ctx_ = ctx
  128684. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  128685. for {
  128686. x, err := c.Do()
  128687. if err != nil {
  128688. return err
  128689. }
  128690. if err := f(x); err != nil {
  128691. return err
  128692. }
  128693. if x.NextPageToken == "" {
  128694. return nil
  128695. }
  128696. c.PageToken(x.NextPageToken)
  128697. }
  128698. }
  128699. // method id "compute.sslCertificates.testIamPermissions":
  128700. type SslCertificatesTestIamPermissionsCall struct {
  128701. s *Service
  128702. project string
  128703. resource string
  128704. testpermissionsrequest *TestPermissionsRequest
  128705. urlParams_ gensupport.URLParams
  128706. ctx_ context.Context
  128707. header_ http.Header
  128708. }
  128709. // TestIamPermissions: Returns permissions that a caller has on the
  128710. // specified resource.
  128711. func (r *SslCertificatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslCertificatesTestIamPermissionsCall {
  128712. c := &SslCertificatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128713. c.project = project
  128714. c.resource = resource
  128715. c.testpermissionsrequest = testpermissionsrequest
  128716. return c
  128717. }
  128718. // Fields allows partial responses to be retrieved. See
  128719. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128720. // for more information.
  128721. func (c *SslCertificatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslCertificatesTestIamPermissionsCall {
  128722. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128723. return c
  128724. }
  128725. // Context sets the context to be used in this call's Do method. Any
  128726. // pending HTTP request will be aborted if the provided context is
  128727. // canceled.
  128728. func (c *SslCertificatesTestIamPermissionsCall) Context(ctx context.Context) *SslCertificatesTestIamPermissionsCall {
  128729. c.ctx_ = ctx
  128730. return c
  128731. }
  128732. // Header returns an http.Header that can be modified by the caller to
  128733. // add HTTP headers to the request.
  128734. func (c *SslCertificatesTestIamPermissionsCall) Header() http.Header {
  128735. if c.header_ == nil {
  128736. c.header_ = make(http.Header)
  128737. }
  128738. return c.header_
  128739. }
  128740. func (c *SslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  128741. reqHeaders := make(http.Header)
  128742. for k, v := range c.header_ {
  128743. reqHeaders[k] = v
  128744. }
  128745. reqHeaders.Set("User-Agent", c.s.userAgent())
  128746. var body io.Reader = nil
  128747. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  128748. if err != nil {
  128749. return nil, err
  128750. }
  128751. reqHeaders.Set("Content-Type", "application/json")
  128752. c.urlParams_.Set("alt", alt)
  128753. c.urlParams_.Set("prettyPrint", "false")
  128754. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{resource}/testIamPermissions")
  128755. urls += "?" + c.urlParams_.Encode()
  128756. req, err := http.NewRequest("POST", urls, body)
  128757. if err != nil {
  128758. return nil, err
  128759. }
  128760. req.Header = reqHeaders
  128761. googleapi.Expand(req.URL, map[string]string{
  128762. "project": c.project,
  128763. "resource": c.resource,
  128764. })
  128765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128766. }
  128767. // Do executes the "compute.sslCertificates.testIamPermissions" call.
  128768. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  128769. // non-2xx status code is an error. Response headers are in either
  128770. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  128771. // returned at all) in error.(*googleapi.Error).Header. Use
  128772. // googleapi.IsNotModified to check whether the returned error was
  128773. // because http.StatusNotModified was returned.
  128774. func (c *SslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  128775. gensupport.SetOptions(c.urlParams_, opts...)
  128776. res, err := c.doRequest("json")
  128777. if res != nil && res.StatusCode == http.StatusNotModified {
  128778. if res.Body != nil {
  128779. res.Body.Close()
  128780. }
  128781. return nil, &googleapi.Error{
  128782. Code: res.StatusCode,
  128783. Header: res.Header,
  128784. }
  128785. }
  128786. if err != nil {
  128787. return nil, err
  128788. }
  128789. defer googleapi.CloseBody(res)
  128790. if err := googleapi.CheckResponse(res); err != nil {
  128791. return nil, err
  128792. }
  128793. ret := &TestPermissionsResponse{
  128794. ServerResponse: googleapi.ServerResponse{
  128795. Header: res.Header,
  128796. HTTPStatusCode: res.StatusCode,
  128797. },
  128798. }
  128799. target := &ret
  128800. if err := gensupport.DecodeResponse(target, res); err != nil {
  128801. return nil, err
  128802. }
  128803. return ret, nil
  128804. // {
  128805. // "description": "Returns permissions that a caller has on the specified resource.",
  128806. // "httpMethod": "POST",
  128807. // "id": "compute.sslCertificates.testIamPermissions",
  128808. // "parameterOrder": [
  128809. // "project",
  128810. // "resource"
  128811. // ],
  128812. // "parameters": {
  128813. // "project": {
  128814. // "description": "Project ID for this request.",
  128815. // "location": "path",
  128816. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128817. // "required": true,
  128818. // "type": "string"
  128819. // },
  128820. // "resource": {
  128821. // "description": "Name or id of the resource for this request.",
  128822. // "location": "path",
  128823. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  128824. // "required": true,
  128825. // "type": "string"
  128826. // }
  128827. // },
  128828. // "path": "{project}/global/sslCertificates/{resource}/testIamPermissions",
  128829. // "request": {
  128830. // "$ref": "TestPermissionsRequest"
  128831. // },
  128832. // "response": {
  128833. // "$ref": "TestPermissionsResponse"
  128834. // },
  128835. // "scopes": [
  128836. // "https://www.googleapis.com/auth/cloud-platform",
  128837. // "https://www.googleapis.com/auth/compute",
  128838. // "https://www.googleapis.com/auth/compute.readonly"
  128839. // ]
  128840. // }
  128841. }
  128842. // method id "compute.sslPolicies.delete":
  128843. type SslPoliciesDeleteCall struct {
  128844. s *Service
  128845. project string
  128846. sslPolicy string
  128847. urlParams_ gensupport.URLParams
  128848. ctx_ context.Context
  128849. header_ http.Header
  128850. }
  128851. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  128852. // be deleted only if it is not in use by any TargetHttpsProxy or
  128853. // TargetSslProxy resources.
  128854. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  128855. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128856. c.project = project
  128857. c.sslPolicy = sslPolicy
  128858. return c
  128859. }
  128860. // RequestId sets the optional parameter "requestId": An optional
  128861. // request ID to identify requests. Specify a unique request ID so that
  128862. // if you must retry your request, the server will know to ignore the
  128863. // request if it has already been completed.
  128864. //
  128865. // For example, consider a situation where you make an initial request
  128866. // and the request times out. If you make the request again with the
  128867. // same request ID, the server can check if original operation with the
  128868. // same request ID was received, and if so, will ignore the second
  128869. // request. This prevents clients from accidentally creating duplicate
  128870. // commitments.
  128871. //
  128872. // The request ID must be a valid UUID with the exception that zero UUID
  128873. // is not supported (00000000-0000-0000-0000-000000000000).
  128874. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  128875. c.urlParams_.Set("requestId", requestId)
  128876. return c
  128877. }
  128878. // Fields allows partial responses to be retrieved. See
  128879. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128880. // for more information.
  128881. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  128882. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128883. return c
  128884. }
  128885. // Context sets the context to be used in this call's Do method. Any
  128886. // pending HTTP request will be aborted if the provided context is
  128887. // canceled.
  128888. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  128889. c.ctx_ = ctx
  128890. return c
  128891. }
  128892. // Header returns an http.Header that can be modified by the caller to
  128893. // add HTTP headers to the request.
  128894. func (c *SslPoliciesDeleteCall) Header() http.Header {
  128895. if c.header_ == nil {
  128896. c.header_ = make(http.Header)
  128897. }
  128898. return c.header_
  128899. }
  128900. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  128901. reqHeaders := make(http.Header)
  128902. for k, v := range c.header_ {
  128903. reqHeaders[k] = v
  128904. }
  128905. reqHeaders.Set("User-Agent", c.s.userAgent())
  128906. var body io.Reader = nil
  128907. c.urlParams_.Set("alt", alt)
  128908. c.urlParams_.Set("prettyPrint", "false")
  128909. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  128910. urls += "?" + c.urlParams_.Encode()
  128911. req, err := http.NewRequest("DELETE", urls, body)
  128912. if err != nil {
  128913. return nil, err
  128914. }
  128915. req.Header = reqHeaders
  128916. googleapi.Expand(req.URL, map[string]string{
  128917. "project": c.project,
  128918. "sslPolicy": c.sslPolicy,
  128919. })
  128920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128921. }
  128922. // Do executes the "compute.sslPolicies.delete" call.
  128923. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  128924. // status code is an error. Response headers are in either
  128925. // *Operation.ServerResponse.Header or (if a response was returned at
  128926. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  128927. // to check whether the returned error was because
  128928. // http.StatusNotModified was returned.
  128929. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  128930. gensupport.SetOptions(c.urlParams_, opts...)
  128931. res, err := c.doRequest("json")
  128932. if res != nil && res.StatusCode == http.StatusNotModified {
  128933. if res.Body != nil {
  128934. res.Body.Close()
  128935. }
  128936. return nil, &googleapi.Error{
  128937. Code: res.StatusCode,
  128938. Header: res.Header,
  128939. }
  128940. }
  128941. if err != nil {
  128942. return nil, err
  128943. }
  128944. defer googleapi.CloseBody(res)
  128945. if err := googleapi.CheckResponse(res); err != nil {
  128946. return nil, err
  128947. }
  128948. ret := &Operation{
  128949. ServerResponse: googleapi.ServerResponse{
  128950. Header: res.Header,
  128951. HTTPStatusCode: res.StatusCode,
  128952. },
  128953. }
  128954. target := &ret
  128955. if err := gensupport.DecodeResponse(target, res); err != nil {
  128956. return nil, err
  128957. }
  128958. return ret, nil
  128959. // {
  128960. // "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.",
  128961. // "httpMethod": "DELETE",
  128962. // "id": "compute.sslPolicies.delete",
  128963. // "parameterOrder": [
  128964. // "project",
  128965. // "sslPolicy"
  128966. // ],
  128967. // "parameters": {
  128968. // "project": {
  128969. // "description": "Project ID for this request.",
  128970. // "location": "path",
  128971. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128972. // "required": true,
  128973. // "type": "string"
  128974. // },
  128975. // "requestId": {
  128976. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  128977. // "location": "query",
  128978. // "type": "string"
  128979. // },
  128980. // "sslPolicy": {
  128981. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  128982. // "location": "path",
  128983. // "required": true,
  128984. // "type": "string"
  128985. // }
  128986. // },
  128987. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  128988. // "response": {
  128989. // "$ref": "Operation"
  128990. // },
  128991. // "scopes": [
  128992. // "https://www.googleapis.com/auth/cloud-platform",
  128993. // "https://www.googleapis.com/auth/compute"
  128994. // ]
  128995. // }
  128996. }
  128997. // method id "compute.sslPolicies.get":
  128998. type SslPoliciesGetCall struct {
  128999. s *Service
  129000. project string
  129001. sslPolicy string
  129002. urlParams_ gensupport.URLParams
  129003. ifNoneMatch_ string
  129004. ctx_ context.Context
  129005. header_ http.Header
  129006. }
  129007. // Get: Lists all of the ordered rules present in a single specified
  129008. // policy.
  129009. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  129010. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129011. c.project = project
  129012. c.sslPolicy = sslPolicy
  129013. return c
  129014. }
  129015. // Fields allows partial responses to be retrieved. See
  129016. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129017. // for more information.
  129018. func (c *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  129019. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129020. return c
  129021. }
  129022. // IfNoneMatch sets the optional parameter which makes the operation
  129023. // fail if the object's ETag matches the given value. This is useful for
  129024. // getting updates only after the object has changed since the last
  129025. // request. Use googleapi.IsNotModified to check whether the response
  129026. // error from Do is the result of In-None-Match.
  129027. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  129028. c.ifNoneMatch_ = entityTag
  129029. return c
  129030. }
  129031. // Context sets the context to be used in this call's Do method. Any
  129032. // pending HTTP request will be aborted if the provided context is
  129033. // canceled.
  129034. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  129035. c.ctx_ = ctx
  129036. return c
  129037. }
  129038. // Header returns an http.Header that can be modified by the caller to
  129039. // add HTTP headers to the request.
  129040. func (c *SslPoliciesGetCall) Header() http.Header {
  129041. if c.header_ == nil {
  129042. c.header_ = make(http.Header)
  129043. }
  129044. return c.header_
  129045. }
  129046. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  129047. reqHeaders := make(http.Header)
  129048. for k, v := range c.header_ {
  129049. reqHeaders[k] = v
  129050. }
  129051. reqHeaders.Set("User-Agent", c.s.userAgent())
  129052. if c.ifNoneMatch_ != "" {
  129053. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  129054. }
  129055. var body io.Reader = nil
  129056. c.urlParams_.Set("alt", alt)
  129057. c.urlParams_.Set("prettyPrint", "false")
  129058. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  129059. urls += "?" + c.urlParams_.Encode()
  129060. req, err := http.NewRequest("GET", urls, body)
  129061. if err != nil {
  129062. return nil, err
  129063. }
  129064. req.Header = reqHeaders
  129065. googleapi.Expand(req.URL, map[string]string{
  129066. "project": c.project,
  129067. "sslPolicy": c.sslPolicy,
  129068. })
  129069. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129070. }
  129071. // Do executes the "compute.sslPolicies.get" call.
  129072. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  129073. // status code is an error. Response headers are in either
  129074. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  129075. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  129076. // to check whether the returned error was because
  129077. // http.StatusNotModified was returned.
  129078. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  129079. gensupport.SetOptions(c.urlParams_, opts...)
  129080. res, err := c.doRequest("json")
  129081. if res != nil && res.StatusCode == http.StatusNotModified {
  129082. if res.Body != nil {
  129083. res.Body.Close()
  129084. }
  129085. return nil, &googleapi.Error{
  129086. Code: res.StatusCode,
  129087. Header: res.Header,
  129088. }
  129089. }
  129090. if err != nil {
  129091. return nil, err
  129092. }
  129093. defer googleapi.CloseBody(res)
  129094. if err := googleapi.CheckResponse(res); err != nil {
  129095. return nil, err
  129096. }
  129097. ret := &SslPolicy{
  129098. ServerResponse: googleapi.ServerResponse{
  129099. Header: res.Header,
  129100. HTTPStatusCode: res.StatusCode,
  129101. },
  129102. }
  129103. target := &ret
  129104. if err := gensupport.DecodeResponse(target, res); err != nil {
  129105. return nil, err
  129106. }
  129107. return ret, nil
  129108. // {
  129109. // "description": "Lists all of the ordered rules present in a single specified policy.",
  129110. // "httpMethod": "GET",
  129111. // "id": "compute.sslPolicies.get",
  129112. // "parameterOrder": [
  129113. // "project",
  129114. // "sslPolicy"
  129115. // ],
  129116. // "parameters": {
  129117. // "project": {
  129118. // "description": "Project ID for this request.",
  129119. // "location": "path",
  129120. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129121. // "required": true,
  129122. // "type": "string"
  129123. // },
  129124. // "sslPolicy": {
  129125. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  129126. // "location": "path",
  129127. // "required": true,
  129128. // "type": "string"
  129129. // }
  129130. // },
  129131. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  129132. // "response": {
  129133. // "$ref": "SslPolicy"
  129134. // },
  129135. // "scopes": [
  129136. // "https://www.googleapis.com/auth/cloud-platform",
  129137. // "https://www.googleapis.com/auth/compute",
  129138. // "https://www.googleapis.com/auth/compute.readonly"
  129139. // ]
  129140. // }
  129141. }
  129142. // method id "compute.sslPolicies.insert":
  129143. type SslPoliciesInsertCall struct {
  129144. s *Service
  129145. project string
  129146. sslpolicy *SslPolicy
  129147. urlParams_ gensupport.URLParams
  129148. ctx_ context.Context
  129149. header_ http.Header
  129150. }
  129151. // Insert: Returns the specified SSL policy resource. Gets a list of
  129152. // available SSL policies by making a list() request.
  129153. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  129154. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129155. c.project = project
  129156. c.sslpolicy = sslpolicy
  129157. return c
  129158. }
  129159. // RequestId sets the optional parameter "requestId": An optional
  129160. // request ID to identify requests. Specify a unique request ID so that
  129161. // if you must retry your request, the server will know to ignore the
  129162. // request if it has already been completed.
  129163. //
  129164. // For example, consider a situation where you make an initial request
  129165. // and the request times out. If you make the request again with the
  129166. // same request ID, the server can check if original operation with the
  129167. // same request ID was received, and if so, will ignore the second
  129168. // request. This prevents clients from accidentally creating duplicate
  129169. // commitments.
  129170. //
  129171. // The request ID must be a valid UUID with the exception that zero UUID
  129172. // is not supported (00000000-0000-0000-0000-000000000000).
  129173. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  129174. c.urlParams_.Set("requestId", requestId)
  129175. return c
  129176. }
  129177. // Fields allows partial responses to be retrieved. See
  129178. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129179. // for more information.
  129180. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  129181. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129182. return c
  129183. }
  129184. // Context sets the context to be used in this call's Do method. Any
  129185. // pending HTTP request will be aborted if the provided context is
  129186. // canceled.
  129187. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  129188. c.ctx_ = ctx
  129189. return c
  129190. }
  129191. // Header returns an http.Header that can be modified by the caller to
  129192. // add HTTP headers to the request.
  129193. func (c *SslPoliciesInsertCall) Header() http.Header {
  129194. if c.header_ == nil {
  129195. c.header_ = make(http.Header)
  129196. }
  129197. return c.header_
  129198. }
  129199. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  129200. reqHeaders := make(http.Header)
  129201. for k, v := range c.header_ {
  129202. reqHeaders[k] = v
  129203. }
  129204. reqHeaders.Set("User-Agent", c.s.userAgent())
  129205. var body io.Reader = nil
  129206. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  129207. if err != nil {
  129208. return nil, err
  129209. }
  129210. reqHeaders.Set("Content-Type", "application/json")
  129211. c.urlParams_.Set("alt", alt)
  129212. c.urlParams_.Set("prettyPrint", "false")
  129213. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  129214. urls += "?" + c.urlParams_.Encode()
  129215. req, err := http.NewRequest("POST", urls, body)
  129216. if err != nil {
  129217. return nil, err
  129218. }
  129219. req.Header = reqHeaders
  129220. googleapi.Expand(req.URL, map[string]string{
  129221. "project": c.project,
  129222. })
  129223. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129224. }
  129225. // Do executes the "compute.sslPolicies.insert" call.
  129226. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  129227. // status code is an error. Response headers are in either
  129228. // *Operation.ServerResponse.Header or (if a response was returned at
  129229. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  129230. // to check whether the returned error was because
  129231. // http.StatusNotModified was returned.
  129232. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  129233. gensupport.SetOptions(c.urlParams_, opts...)
  129234. res, err := c.doRequest("json")
  129235. if res != nil && res.StatusCode == http.StatusNotModified {
  129236. if res.Body != nil {
  129237. res.Body.Close()
  129238. }
  129239. return nil, &googleapi.Error{
  129240. Code: res.StatusCode,
  129241. Header: res.Header,
  129242. }
  129243. }
  129244. if err != nil {
  129245. return nil, err
  129246. }
  129247. defer googleapi.CloseBody(res)
  129248. if err := googleapi.CheckResponse(res); err != nil {
  129249. return nil, err
  129250. }
  129251. ret := &Operation{
  129252. ServerResponse: googleapi.ServerResponse{
  129253. Header: res.Header,
  129254. HTTPStatusCode: res.StatusCode,
  129255. },
  129256. }
  129257. target := &ret
  129258. if err := gensupport.DecodeResponse(target, res); err != nil {
  129259. return nil, err
  129260. }
  129261. return ret, nil
  129262. // {
  129263. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  129264. // "httpMethod": "POST",
  129265. // "id": "compute.sslPolicies.insert",
  129266. // "parameterOrder": [
  129267. // "project"
  129268. // ],
  129269. // "parameters": {
  129270. // "project": {
  129271. // "description": "Project ID for this request.",
  129272. // "location": "path",
  129273. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129274. // "required": true,
  129275. // "type": "string"
  129276. // },
  129277. // "requestId": {
  129278. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  129279. // "location": "query",
  129280. // "type": "string"
  129281. // }
  129282. // },
  129283. // "path": "{project}/global/sslPolicies",
  129284. // "request": {
  129285. // "$ref": "SslPolicy"
  129286. // },
  129287. // "response": {
  129288. // "$ref": "Operation"
  129289. // },
  129290. // "scopes": [
  129291. // "https://www.googleapis.com/auth/cloud-platform",
  129292. // "https://www.googleapis.com/auth/compute"
  129293. // ]
  129294. // }
  129295. }
  129296. // method id "compute.sslPolicies.list":
  129297. type SslPoliciesListCall struct {
  129298. s *Service
  129299. project string
  129300. urlParams_ gensupport.URLParams
  129301. ifNoneMatch_ string
  129302. ctx_ context.Context
  129303. header_ http.Header
  129304. }
  129305. // List: Lists all the SSL policies that have been configured for the
  129306. // specified project.
  129307. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  129308. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129309. c.project = project
  129310. return c
  129311. }
  129312. // Filter sets the optional parameter "filter": A filter expression that
  129313. // filters resources listed in the response. The expression must specify
  129314. // the field name, a comparison operator, and the value that you want to
  129315. // use for filtering. The value must be a string, a number, or a
  129316. // boolean. The comparison operator must be either =, !=, >, or <.
  129317. //
  129318. // For example, if you are filtering Compute Engine instances, you can
  129319. // exclude instances named example-instance by specifying name !=
  129320. // example-instance.
  129321. //
  129322. // You can also filter nested fields. For example, you could specify
  129323. // scheduling.automaticRestart = false to include instances only if they
  129324. // are not scheduled for automatic restarts. You can use filtering on
  129325. // nested fields to filter based on resource labels.
  129326. //
  129327. // To filter on multiple expressions, provide each separate expression
  129328. // within parentheses. For example, (scheduling.automaticRestart = true)
  129329. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  129330. // AND expression. However, you can include AND and OR expressions
  129331. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  129332. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  129333. // true).
  129334. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  129335. c.urlParams_.Set("filter", filter)
  129336. return c
  129337. }
  129338. // MaxResults sets the optional parameter "maxResults": The maximum
  129339. // number of results per page that should be returned. If the number of
  129340. // available results is larger than maxResults, Compute Engine returns a
  129341. // nextPageToken that can be used to get the next page of results in
  129342. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  129343. // (Default: 500)
  129344. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  129345. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  129346. return c
  129347. }
  129348. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  129349. // a certain order. By default, results are returned in alphanumerical
  129350. // order based on the resource name.
  129351. //
  129352. // You can also sort results in descending order based on the creation
  129353. // timestamp using orderBy="creationTimestamp desc". This sorts results
  129354. // based on the creationTimestamp field in reverse chronological order
  129355. // (newest result first). Use this to sort resources like operations so
  129356. // that the newest operation is returned first.
  129357. //
  129358. // Currently, only sorting by name or creationTimestamp desc is
  129359. // supported.
  129360. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  129361. c.urlParams_.Set("orderBy", orderBy)
  129362. return c
  129363. }
  129364. // PageToken sets the optional parameter "pageToken": Specifies a page
  129365. // token to use. Set pageToken to the nextPageToken returned by a
  129366. // previous list request to get the next page of results.
  129367. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  129368. c.urlParams_.Set("pageToken", pageToken)
  129369. return c
  129370. }
  129371. // Fields allows partial responses to be retrieved. See
  129372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129373. // for more information.
  129374. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  129375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129376. return c
  129377. }
  129378. // IfNoneMatch sets the optional parameter which makes the operation
  129379. // fail if the object's ETag matches the given value. This is useful for
  129380. // getting updates only after the object has changed since the last
  129381. // request. Use googleapi.IsNotModified to check whether the response
  129382. // error from Do is the result of In-None-Match.
  129383. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  129384. c.ifNoneMatch_ = entityTag
  129385. return c
  129386. }
  129387. // Context sets the context to be used in this call's Do method. Any
  129388. // pending HTTP request will be aborted if the provided context is
  129389. // canceled.
  129390. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  129391. c.ctx_ = ctx
  129392. return c
  129393. }
  129394. // Header returns an http.Header that can be modified by the caller to
  129395. // add HTTP headers to the request.
  129396. func (c *SslPoliciesListCall) Header() http.Header {
  129397. if c.header_ == nil {
  129398. c.header_ = make(http.Header)
  129399. }
  129400. return c.header_
  129401. }
  129402. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  129403. reqHeaders := make(http.Header)
  129404. for k, v := range c.header_ {
  129405. reqHeaders[k] = v
  129406. }
  129407. reqHeaders.Set("User-Agent", c.s.userAgent())
  129408. if c.ifNoneMatch_ != "" {
  129409. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  129410. }
  129411. var body io.Reader = nil
  129412. c.urlParams_.Set("alt", alt)
  129413. c.urlParams_.Set("prettyPrint", "false")
  129414. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  129415. urls += "?" + c.urlParams_.Encode()
  129416. req, err := http.NewRequest("GET", urls, body)
  129417. if err != nil {
  129418. return nil, err
  129419. }
  129420. req.Header = reqHeaders
  129421. googleapi.Expand(req.URL, map[string]string{
  129422. "project": c.project,
  129423. })
  129424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129425. }
  129426. // Do executes the "compute.sslPolicies.list" call.
  129427. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  129428. // status code is an error. Response headers are in either
  129429. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  129430. // at all) in error.(*googleapi.Error).Header. Use
  129431. // googleapi.IsNotModified to check whether the returned error was
  129432. // because http.StatusNotModified was returned.
  129433. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  129434. gensupport.SetOptions(c.urlParams_, opts...)
  129435. res, err := c.doRequest("json")
  129436. if res != nil && res.StatusCode == http.StatusNotModified {
  129437. if res.Body != nil {
  129438. res.Body.Close()
  129439. }
  129440. return nil, &googleapi.Error{
  129441. Code: res.StatusCode,
  129442. Header: res.Header,
  129443. }
  129444. }
  129445. if err != nil {
  129446. return nil, err
  129447. }
  129448. defer googleapi.CloseBody(res)
  129449. if err := googleapi.CheckResponse(res); err != nil {
  129450. return nil, err
  129451. }
  129452. ret := &SslPoliciesList{
  129453. ServerResponse: googleapi.ServerResponse{
  129454. Header: res.Header,
  129455. HTTPStatusCode: res.StatusCode,
  129456. },
  129457. }
  129458. target := &ret
  129459. if err := gensupport.DecodeResponse(target, res); err != nil {
  129460. return nil, err
  129461. }
  129462. return ret, nil
  129463. // {
  129464. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  129465. // "httpMethod": "GET",
  129466. // "id": "compute.sslPolicies.list",
  129467. // "parameterOrder": [
  129468. // "project"
  129469. // ],
  129470. // "parameters": {
  129471. // "filter": {
  129472. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  129473. // "location": "query",
  129474. // "type": "string"
  129475. // },
  129476. // "maxResults": {
  129477. // "default": "500",
  129478. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  129479. // "format": "uint32",
  129480. // "location": "query",
  129481. // "minimum": "0",
  129482. // "type": "integer"
  129483. // },
  129484. // "orderBy": {
  129485. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  129486. // "location": "query",
  129487. // "type": "string"
  129488. // },
  129489. // "pageToken": {
  129490. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  129491. // "location": "query",
  129492. // "type": "string"
  129493. // },
  129494. // "project": {
  129495. // "description": "Project ID for this request.",
  129496. // "location": "path",
  129497. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129498. // "required": true,
  129499. // "type": "string"
  129500. // }
  129501. // },
  129502. // "path": "{project}/global/sslPolicies",
  129503. // "response": {
  129504. // "$ref": "SslPoliciesList"
  129505. // },
  129506. // "scopes": [
  129507. // "https://www.googleapis.com/auth/cloud-platform",
  129508. // "https://www.googleapis.com/auth/compute",
  129509. // "https://www.googleapis.com/auth/compute.readonly"
  129510. // ]
  129511. // }
  129512. }
  129513. // Pages invokes f for each page of results.
  129514. // A non-nil error returned from f will halt the iteration.
  129515. // The provided context supersedes any context provided to the Context method.
  129516. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  129517. c.ctx_ = ctx
  129518. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  129519. for {
  129520. x, err := c.Do()
  129521. if err != nil {
  129522. return err
  129523. }
  129524. if err := f(x); err != nil {
  129525. return err
  129526. }
  129527. if x.NextPageToken == "" {
  129528. return nil
  129529. }
  129530. c.PageToken(x.NextPageToken)
  129531. }
  129532. }
  129533. // method id "compute.sslPolicies.listAvailableFeatures":
  129534. type SslPoliciesListAvailableFeaturesCall struct {
  129535. s *Service
  129536. project string
  129537. urlParams_ gensupport.URLParams
  129538. ifNoneMatch_ string
  129539. ctx_ context.Context
  129540. header_ http.Header
  129541. }
  129542. // ListAvailableFeatures: Lists all features that can be specified in
  129543. // the SSL policy when using custom profile.
  129544. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  129545. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129546. c.project = project
  129547. return c
  129548. }
  129549. // Filter sets the optional parameter "filter": A filter expression that
  129550. // filters resources listed in the response. The expression must specify
  129551. // the field name, a comparison operator, and the value that you want to
  129552. // use for filtering. The value must be a string, a number, or a
  129553. // boolean. The comparison operator must be either =, !=, >, or <.
  129554. //
  129555. // For example, if you are filtering Compute Engine instances, you can
  129556. // exclude instances named example-instance by specifying name !=
  129557. // example-instance.
  129558. //
  129559. // You can also filter nested fields. For example, you could specify
  129560. // scheduling.automaticRestart = false to include instances only if they
  129561. // are not scheduled for automatic restarts. You can use filtering on
  129562. // nested fields to filter based on resource labels.
  129563. //
  129564. // To filter on multiple expressions, provide each separate expression
  129565. // within parentheses. For example, (scheduling.automaticRestart = true)
  129566. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  129567. // AND expression. However, you can include AND and OR expressions
  129568. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  129569. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  129570. // true).
  129571. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  129572. c.urlParams_.Set("filter", filter)
  129573. return c
  129574. }
  129575. // MaxResults sets the optional parameter "maxResults": The maximum
  129576. // number of results per page that should be returned. If the number of
  129577. // available results is larger than maxResults, Compute Engine returns a
  129578. // nextPageToken that can be used to get the next page of results in
  129579. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  129580. // (Default: 500)
  129581. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  129582. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  129583. return c
  129584. }
  129585. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  129586. // a certain order. By default, results are returned in alphanumerical
  129587. // order based on the resource name.
  129588. //
  129589. // You can also sort results in descending order based on the creation
  129590. // timestamp using orderBy="creationTimestamp desc". This sorts results
  129591. // based on the creationTimestamp field in reverse chronological order
  129592. // (newest result first). Use this to sort resources like operations so
  129593. // that the newest operation is returned first.
  129594. //
  129595. // Currently, only sorting by name or creationTimestamp desc is
  129596. // supported.
  129597. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  129598. c.urlParams_.Set("orderBy", orderBy)
  129599. return c
  129600. }
  129601. // PageToken sets the optional parameter "pageToken": Specifies a page
  129602. // token to use. Set pageToken to the nextPageToken returned by a
  129603. // previous list request to get the next page of results.
  129604. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  129605. c.urlParams_.Set("pageToken", pageToken)
  129606. return c
  129607. }
  129608. // Fields allows partial responses to be retrieved. See
  129609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129610. // for more information.
  129611. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  129612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129613. return c
  129614. }
  129615. // IfNoneMatch sets the optional parameter which makes the operation
  129616. // fail if the object's ETag matches the given value. This is useful for
  129617. // getting updates only after the object has changed since the last
  129618. // request. Use googleapi.IsNotModified to check whether the response
  129619. // error from Do is the result of In-None-Match.
  129620. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  129621. c.ifNoneMatch_ = entityTag
  129622. return c
  129623. }
  129624. // Context sets the context to be used in this call's Do method. Any
  129625. // pending HTTP request will be aborted if the provided context is
  129626. // canceled.
  129627. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  129628. c.ctx_ = ctx
  129629. return c
  129630. }
  129631. // Header returns an http.Header that can be modified by the caller to
  129632. // add HTTP headers to the request.
  129633. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  129634. if c.header_ == nil {
  129635. c.header_ = make(http.Header)
  129636. }
  129637. return c.header_
  129638. }
  129639. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  129640. reqHeaders := make(http.Header)
  129641. for k, v := range c.header_ {
  129642. reqHeaders[k] = v
  129643. }
  129644. reqHeaders.Set("User-Agent", c.s.userAgent())
  129645. if c.ifNoneMatch_ != "" {
  129646. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  129647. }
  129648. var body io.Reader = nil
  129649. c.urlParams_.Set("alt", alt)
  129650. c.urlParams_.Set("prettyPrint", "false")
  129651. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  129652. urls += "?" + c.urlParams_.Encode()
  129653. req, err := http.NewRequest("GET", urls, body)
  129654. if err != nil {
  129655. return nil, err
  129656. }
  129657. req.Header = reqHeaders
  129658. googleapi.Expand(req.URL, map[string]string{
  129659. "project": c.project,
  129660. })
  129661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129662. }
  129663. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  129664. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  129665. // will be non-nil. Any non-2xx status code is an error. Response
  129666. // headers are in either
  129667. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  129668. // (if a response was returned at all) in
  129669. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  129670. // whether the returned error was because http.StatusNotModified was
  129671. // returned.
  129672. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  129673. gensupport.SetOptions(c.urlParams_, opts...)
  129674. res, err := c.doRequest("json")
  129675. if res != nil && res.StatusCode == http.StatusNotModified {
  129676. if res.Body != nil {
  129677. res.Body.Close()
  129678. }
  129679. return nil, &googleapi.Error{
  129680. Code: res.StatusCode,
  129681. Header: res.Header,
  129682. }
  129683. }
  129684. if err != nil {
  129685. return nil, err
  129686. }
  129687. defer googleapi.CloseBody(res)
  129688. if err := googleapi.CheckResponse(res); err != nil {
  129689. return nil, err
  129690. }
  129691. ret := &SslPoliciesListAvailableFeaturesResponse{
  129692. ServerResponse: googleapi.ServerResponse{
  129693. Header: res.Header,
  129694. HTTPStatusCode: res.StatusCode,
  129695. },
  129696. }
  129697. target := &ret
  129698. if err := gensupport.DecodeResponse(target, res); err != nil {
  129699. return nil, err
  129700. }
  129701. return ret, nil
  129702. // {
  129703. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  129704. // "httpMethod": "GET",
  129705. // "id": "compute.sslPolicies.listAvailableFeatures",
  129706. // "parameterOrder": [
  129707. // "project"
  129708. // ],
  129709. // "parameters": {
  129710. // "filter": {
  129711. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  129712. // "location": "query",
  129713. // "type": "string"
  129714. // },
  129715. // "maxResults": {
  129716. // "default": "500",
  129717. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  129718. // "format": "uint32",
  129719. // "location": "query",
  129720. // "minimum": "0",
  129721. // "type": "integer"
  129722. // },
  129723. // "orderBy": {
  129724. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  129725. // "location": "query",
  129726. // "type": "string"
  129727. // },
  129728. // "pageToken": {
  129729. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  129730. // "location": "query",
  129731. // "type": "string"
  129732. // },
  129733. // "project": {
  129734. // "description": "Project ID for this request.",
  129735. // "location": "path",
  129736. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129737. // "required": true,
  129738. // "type": "string"
  129739. // }
  129740. // },
  129741. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  129742. // "response": {
  129743. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  129744. // },
  129745. // "scopes": [
  129746. // "https://www.googleapis.com/auth/cloud-platform",
  129747. // "https://www.googleapis.com/auth/compute",
  129748. // "https://www.googleapis.com/auth/compute.readonly"
  129749. // ]
  129750. // }
  129751. }
  129752. // method id "compute.sslPolicies.patch":
  129753. type SslPoliciesPatchCall struct {
  129754. s *Service
  129755. project string
  129756. sslPolicy string
  129757. sslpolicy *SslPolicy
  129758. urlParams_ gensupport.URLParams
  129759. ctx_ context.Context
  129760. header_ http.Header
  129761. }
  129762. // Patch: Patches the specified SSL policy with the data included in the
  129763. // request.
  129764. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  129765. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129766. c.project = project
  129767. c.sslPolicy = sslPolicy
  129768. c.sslpolicy = sslpolicy
  129769. return c
  129770. }
  129771. // RequestId sets the optional parameter "requestId": An optional
  129772. // request ID to identify requests. Specify a unique request ID so that
  129773. // if you must retry your request, the server will know to ignore the
  129774. // request if it has already been completed.
  129775. //
  129776. // For example, consider a situation where you make an initial request
  129777. // and the request times out. If you make the request again with the
  129778. // same request ID, the server can check if original operation with the
  129779. // same request ID was received, and if so, will ignore the second
  129780. // request. This prevents clients from accidentally creating duplicate
  129781. // commitments.
  129782. //
  129783. // The request ID must be a valid UUID with the exception that zero UUID
  129784. // is not supported (00000000-0000-0000-0000-000000000000).
  129785. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  129786. c.urlParams_.Set("requestId", requestId)
  129787. return c
  129788. }
  129789. // Fields allows partial responses to be retrieved. See
  129790. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129791. // for more information.
  129792. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  129793. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129794. return c
  129795. }
  129796. // Context sets the context to be used in this call's Do method. Any
  129797. // pending HTTP request will be aborted if the provided context is
  129798. // canceled.
  129799. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  129800. c.ctx_ = ctx
  129801. return c
  129802. }
  129803. // Header returns an http.Header that can be modified by the caller to
  129804. // add HTTP headers to the request.
  129805. func (c *SslPoliciesPatchCall) Header() http.Header {
  129806. if c.header_ == nil {
  129807. c.header_ = make(http.Header)
  129808. }
  129809. return c.header_
  129810. }
  129811. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  129812. reqHeaders := make(http.Header)
  129813. for k, v := range c.header_ {
  129814. reqHeaders[k] = v
  129815. }
  129816. reqHeaders.Set("User-Agent", c.s.userAgent())
  129817. var body io.Reader = nil
  129818. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  129819. if err != nil {
  129820. return nil, err
  129821. }
  129822. reqHeaders.Set("Content-Type", "application/json")
  129823. c.urlParams_.Set("alt", alt)
  129824. c.urlParams_.Set("prettyPrint", "false")
  129825. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  129826. urls += "?" + c.urlParams_.Encode()
  129827. req, err := http.NewRequest("PATCH", urls, body)
  129828. if err != nil {
  129829. return nil, err
  129830. }
  129831. req.Header = reqHeaders
  129832. googleapi.Expand(req.URL, map[string]string{
  129833. "project": c.project,
  129834. "sslPolicy": c.sslPolicy,
  129835. })
  129836. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129837. }
  129838. // Do executes the "compute.sslPolicies.patch" call.
  129839. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  129840. // status code is an error. Response headers are in either
  129841. // *Operation.ServerResponse.Header or (if a response was returned at
  129842. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  129843. // to check whether the returned error was because
  129844. // http.StatusNotModified was returned.
  129845. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  129846. gensupport.SetOptions(c.urlParams_, opts...)
  129847. res, err := c.doRequest("json")
  129848. if res != nil && res.StatusCode == http.StatusNotModified {
  129849. if res.Body != nil {
  129850. res.Body.Close()
  129851. }
  129852. return nil, &googleapi.Error{
  129853. Code: res.StatusCode,
  129854. Header: res.Header,
  129855. }
  129856. }
  129857. if err != nil {
  129858. return nil, err
  129859. }
  129860. defer googleapi.CloseBody(res)
  129861. if err := googleapi.CheckResponse(res); err != nil {
  129862. return nil, err
  129863. }
  129864. ret := &Operation{
  129865. ServerResponse: googleapi.ServerResponse{
  129866. Header: res.Header,
  129867. HTTPStatusCode: res.StatusCode,
  129868. },
  129869. }
  129870. target := &ret
  129871. if err := gensupport.DecodeResponse(target, res); err != nil {
  129872. return nil, err
  129873. }
  129874. return ret, nil
  129875. // {
  129876. // "description": "Patches the specified SSL policy with the data included in the request.",
  129877. // "httpMethod": "PATCH",
  129878. // "id": "compute.sslPolicies.patch",
  129879. // "parameterOrder": [
  129880. // "project",
  129881. // "sslPolicy"
  129882. // ],
  129883. // "parameters": {
  129884. // "project": {
  129885. // "description": "Project ID for this request.",
  129886. // "location": "path",
  129887. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129888. // "required": true,
  129889. // "type": "string"
  129890. // },
  129891. // "requestId": {
  129892. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  129893. // "location": "query",
  129894. // "type": "string"
  129895. // },
  129896. // "sslPolicy": {
  129897. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  129898. // "location": "path",
  129899. // "required": true,
  129900. // "type": "string"
  129901. // }
  129902. // },
  129903. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  129904. // "request": {
  129905. // "$ref": "SslPolicy"
  129906. // },
  129907. // "response": {
  129908. // "$ref": "Operation"
  129909. // },
  129910. // "scopes": [
  129911. // "https://www.googleapis.com/auth/cloud-platform",
  129912. // "https://www.googleapis.com/auth/compute"
  129913. // ]
  129914. // }
  129915. }
  129916. // method id "compute.sslPolicies.testIamPermissions":
  129917. type SslPoliciesTestIamPermissionsCall struct {
  129918. s *Service
  129919. project string
  129920. resource string
  129921. testpermissionsrequest *TestPermissionsRequest
  129922. urlParams_ gensupport.URLParams
  129923. ctx_ context.Context
  129924. header_ http.Header
  129925. }
  129926. // TestIamPermissions: Returns permissions that a caller has on the
  129927. // specified resource.
  129928. func (r *SslPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslPoliciesTestIamPermissionsCall {
  129929. c := &SslPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129930. c.project = project
  129931. c.resource = resource
  129932. c.testpermissionsrequest = testpermissionsrequest
  129933. return c
  129934. }
  129935. // Fields allows partial responses to be retrieved. See
  129936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129937. // for more information.
  129938. func (c *SslPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslPoliciesTestIamPermissionsCall {
  129939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129940. return c
  129941. }
  129942. // Context sets the context to be used in this call's Do method. Any
  129943. // pending HTTP request will be aborted if the provided context is
  129944. // canceled.
  129945. func (c *SslPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SslPoliciesTestIamPermissionsCall {
  129946. c.ctx_ = ctx
  129947. return c
  129948. }
  129949. // Header returns an http.Header that can be modified by the caller to
  129950. // add HTTP headers to the request.
  129951. func (c *SslPoliciesTestIamPermissionsCall) Header() http.Header {
  129952. if c.header_ == nil {
  129953. c.header_ = make(http.Header)
  129954. }
  129955. return c.header_
  129956. }
  129957. func (c *SslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  129958. reqHeaders := make(http.Header)
  129959. for k, v := range c.header_ {
  129960. reqHeaders[k] = v
  129961. }
  129962. reqHeaders.Set("User-Agent", c.s.userAgent())
  129963. var body io.Reader = nil
  129964. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  129965. if err != nil {
  129966. return nil, err
  129967. }
  129968. reqHeaders.Set("Content-Type", "application/json")
  129969. c.urlParams_.Set("alt", alt)
  129970. c.urlParams_.Set("prettyPrint", "false")
  129971. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{resource}/testIamPermissions")
  129972. urls += "?" + c.urlParams_.Encode()
  129973. req, err := http.NewRequest("POST", urls, body)
  129974. if err != nil {
  129975. return nil, err
  129976. }
  129977. req.Header = reqHeaders
  129978. googleapi.Expand(req.URL, map[string]string{
  129979. "project": c.project,
  129980. "resource": c.resource,
  129981. })
  129982. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129983. }
  129984. // Do executes the "compute.sslPolicies.testIamPermissions" call.
  129985. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  129986. // non-2xx status code is an error. Response headers are in either
  129987. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  129988. // returned at all) in error.(*googleapi.Error).Header. Use
  129989. // googleapi.IsNotModified to check whether the returned error was
  129990. // because http.StatusNotModified was returned.
  129991. func (c *SslPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  129992. gensupport.SetOptions(c.urlParams_, opts...)
  129993. res, err := c.doRequest("json")
  129994. if res != nil && res.StatusCode == http.StatusNotModified {
  129995. if res.Body != nil {
  129996. res.Body.Close()
  129997. }
  129998. return nil, &googleapi.Error{
  129999. Code: res.StatusCode,
  130000. Header: res.Header,
  130001. }
  130002. }
  130003. if err != nil {
  130004. return nil, err
  130005. }
  130006. defer googleapi.CloseBody(res)
  130007. if err := googleapi.CheckResponse(res); err != nil {
  130008. return nil, err
  130009. }
  130010. ret := &TestPermissionsResponse{
  130011. ServerResponse: googleapi.ServerResponse{
  130012. Header: res.Header,
  130013. HTTPStatusCode: res.StatusCode,
  130014. },
  130015. }
  130016. target := &ret
  130017. if err := gensupport.DecodeResponse(target, res); err != nil {
  130018. return nil, err
  130019. }
  130020. return ret, nil
  130021. // {
  130022. // "description": "Returns permissions that a caller has on the specified resource.",
  130023. // "httpMethod": "POST",
  130024. // "id": "compute.sslPolicies.testIamPermissions",
  130025. // "parameterOrder": [
  130026. // "project",
  130027. // "resource"
  130028. // ],
  130029. // "parameters": {
  130030. // "project": {
  130031. // "description": "Project ID for this request.",
  130032. // "location": "path",
  130033. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130034. // "required": true,
  130035. // "type": "string"
  130036. // },
  130037. // "resource": {
  130038. // "description": "Name or id of the resource for this request.",
  130039. // "location": "path",
  130040. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  130041. // "required": true,
  130042. // "type": "string"
  130043. // }
  130044. // },
  130045. // "path": "{project}/global/sslPolicies/{resource}/testIamPermissions",
  130046. // "request": {
  130047. // "$ref": "TestPermissionsRequest"
  130048. // },
  130049. // "response": {
  130050. // "$ref": "TestPermissionsResponse"
  130051. // },
  130052. // "scopes": [
  130053. // "https://www.googleapis.com/auth/cloud-platform",
  130054. // "https://www.googleapis.com/auth/compute",
  130055. // "https://www.googleapis.com/auth/compute.readonly"
  130056. // ]
  130057. // }
  130058. }
  130059. // method id "compute.subnetworks.aggregatedList":
  130060. type SubnetworksAggregatedListCall struct {
  130061. s *Service
  130062. project string
  130063. urlParams_ gensupport.URLParams
  130064. ifNoneMatch_ string
  130065. ctx_ context.Context
  130066. header_ http.Header
  130067. }
  130068. // AggregatedList: Retrieves an aggregated list of subnetworks.
  130069. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  130070. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130071. c.project = project
  130072. return c
  130073. }
  130074. // Filter sets the optional parameter "filter": A filter expression that
  130075. // filters resources listed in the response. The expression must specify
  130076. // the field name, a comparison operator, and the value that you want to
  130077. // use for filtering. The value must be a string, a number, or a
  130078. // boolean. The comparison operator must be either =, !=, >, or <.
  130079. //
  130080. // For example, if you are filtering Compute Engine instances, you can
  130081. // exclude instances named example-instance by specifying name !=
  130082. // example-instance.
  130083. //
  130084. // You can also filter nested fields. For example, you could specify
  130085. // scheduling.automaticRestart = false to include instances only if they
  130086. // are not scheduled for automatic restarts. You can use filtering on
  130087. // nested fields to filter based on resource labels.
  130088. //
  130089. // To filter on multiple expressions, provide each separate expression
  130090. // within parentheses. For example, (scheduling.automaticRestart = true)
  130091. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  130092. // AND expression. However, you can include AND and OR expressions
  130093. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  130094. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  130095. // true).
  130096. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  130097. c.urlParams_.Set("filter", filter)
  130098. return c
  130099. }
  130100. // MaxResults sets the optional parameter "maxResults": The maximum
  130101. // number of results per page that should be returned. If the number of
  130102. // available results is larger than maxResults, Compute Engine returns a
  130103. // nextPageToken that can be used to get the next page of results in
  130104. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  130105. // (Default: 500)
  130106. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  130107. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  130108. return c
  130109. }
  130110. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  130111. // a certain order. By default, results are returned in alphanumerical
  130112. // order based on the resource name.
  130113. //
  130114. // You can also sort results in descending order based on the creation
  130115. // timestamp using orderBy="creationTimestamp desc". This sorts results
  130116. // based on the creationTimestamp field in reverse chronological order
  130117. // (newest result first). Use this to sort resources like operations so
  130118. // that the newest operation is returned first.
  130119. //
  130120. // Currently, only sorting by name or creationTimestamp desc is
  130121. // supported.
  130122. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  130123. c.urlParams_.Set("orderBy", orderBy)
  130124. return c
  130125. }
  130126. // PageToken sets the optional parameter "pageToken": Specifies a page
  130127. // token to use. Set pageToken to the nextPageToken returned by a
  130128. // previous list request to get the next page of results.
  130129. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  130130. c.urlParams_.Set("pageToken", pageToken)
  130131. return c
  130132. }
  130133. // Fields allows partial responses to be retrieved. See
  130134. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130135. // for more information.
  130136. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  130137. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130138. return c
  130139. }
  130140. // IfNoneMatch sets the optional parameter which makes the operation
  130141. // fail if the object's ETag matches the given value. This is useful for
  130142. // getting updates only after the object has changed since the last
  130143. // request. Use googleapi.IsNotModified to check whether the response
  130144. // error from Do is the result of In-None-Match.
  130145. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  130146. c.ifNoneMatch_ = entityTag
  130147. return c
  130148. }
  130149. // Context sets the context to be used in this call's Do method. Any
  130150. // pending HTTP request will be aborted if the provided context is
  130151. // canceled.
  130152. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  130153. c.ctx_ = ctx
  130154. return c
  130155. }
  130156. // Header returns an http.Header that can be modified by the caller to
  130157. // add HTTP headers to the request.
  130158. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  130159. if c.header_ == nil {
  130160. c.header_ = make(http.Header)
  130161. }
  130162. return c.header_
  130163. }
  130164. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  130165. reqHeaders := make(http.Header)
  130166. for k, v := range c.header_ {
  130167. reqHeaders[k] = v
  130168. }
  130169. reqHeaders.Set("User-Agent", c.s.userAgent())
  130170. if c.ifNoneMatch_ != "" {
  130171. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  130172. }
  130173. var body io.Reader = nil
  130174. c.urlParams_.Set("alt", alt)
  130175. c.urlParams_.Set("prettyPrint", "false")
  130176. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  130177. urls += "?" + c.urlParams_.Encode()
  130178. req, err := http.NewRequest("GET", urls, body)
  130179. if err != nil {
  130180. return nil, err
  130181. }
  130182. req.Header = reqHeaders
  130183. googleapi.Expand(req.URL, map[string]string{
  130184. "project": c.project,
  130185. })
  130186. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130187. }
  130188. // Do executes the "compute.subnetworks.aggregatedList" call.
  130189. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  130190. // Any non-2xx status code is an error. Response headers are in either
  130191. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  130192. // returned at all) in error.(*googleapi.Error).Header. Use
  130193. // googleapi.IsNotModified to check whether the returned error was
  130194. // because http.StatusNotModified was returned.
  130195. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  130196. gensupport.SetOptions(c.urlParams_, opts...)
  130197. res, err := c.doRequest("json")
  130198. if res != nil && res.StatusCode == http.StatusNotModified {
  130199. if res.Body != nil {
  130200. res.Body.Close()
  130201. }
  130202. return nil, &googleapi.Error{
  130203. Code: res.StatusCode,
  130204. Header: res.Header,
  130205. }
  130206. }
  130207. if err != nil {
  130208. return nil, err
  130209. }
  130210. defer googleapi.CloseBody(res)
  130211. if err := googleapi.CheckResponse(res); err != nil {
  130212. return nil, err
  130213. }
  130214. ret := &SubnetworkAggregatedList{
  130215. ServerResponse: googleapi.ServerResponse{
  130216. Header: res.Header,
  130217. HTTPStatusCode: res.StatusCode,
  130218. },
  130219. }
  130220. target := &ret
  130221. if err := gensupport.DecodeResponse(target, res); err != nil {
  130222. return nil, err
  130223. }
  130224. return ret, nil
  130225. // {
  130226. // "description": "Retrieves an aggregated list of subnetworks.",
  130227. // "httpMethod": "GET",
  130228. // "id": "compute.subnetworks.aggregatedList",
  130229. // "parameterOrder": [
  130230. // "project"
  130231. // ],
  130232. // "parameters": {
  130233. // "filter": {
  130234. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  130235. // "location": "query",
  130236. // "type": "string"
  130237. // },
  130238. // "maxResults": {
  130239. // "default": "500",
  130240. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  130241. // "format": "uint32",
  130242. // "location": "query",
  130243. // "minimum": "0",
  130244. // "type": "integer"
  130245. // },
  130246. // "orderBy": {
  130247. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  130248. // "location": "query",
  130249. // "type": "string"
  130250. // },
  130251. // "pageToken": {
  130252. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  130253. // "location": "query",
  130254. // "type": "string"
  130255. // },
  130256. // "project": {
  130257. // "description": "Project ID for this request.",
  130258. // "location": "path",
  130259. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130260. // "required": true,
  130261. // "type": "string"
  130262. // }
  130263. // },
  130264. // "path": "{project}/aggregated/subnetworks",
  130265. // "response": {
  130266. // "$ref": "SubnetworkAggregatedList"
  130267. // },
  130268. // "scopes": [
  130269. // "https://www.googleapis.com/auth/cloud-platform",
  130270. // "https://www.googleapis.com/auth/compute",
  130271. // "https://www.googleapis.com/auth/compute.readonly"
  130272. // ]
  130273. // }
  130274. }
  130275. // Pages invokes f for each page of results.
  130276. // A non-nil error returned from f will halt the iteration.
  130277. // The provided context supersedes any context provided to the Context method.
  130278. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  130279. c.ctx_ = ctx
  130280. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  130281. for {
  130282. x, err := c.Do()
  130283. if err != nil {
  130284. return err
  130285. }
  130286. if err := f(x); err != nil {
  130287. return err
  130288. }
  130289. if x.NextPageToken == "" {
  130290. return nil
  130291. }
  130292. c.PageToken(x.NextPageToken)
  130293. }
  130294. }
  130295. // method id "compute.subnetworks.delete":
  130296. type SubnetworksDeleteCall struct {
  130297. s *Service
  130298. project string
  130299. region string
  130300. subnetwork string
  130301. urlParams_ gensupport.URLParams
  130302. ctx_ context.Context
  130303. header_ http.Header
  130304. }
  130305. // Delete: Deletes the specified subnetwork.
  130306. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  130307. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130308. c.project = project
  130309. c.region = region
  130310. c.subnetwork = subnetwork
  130311. return c
  130312. }
  130313. // RequestId sets the optional parameter "requestId": An optional
  130314. // request ID to identify requests. Specify a unique request ID so that
  130315. // if you must retry your request, the server will know to ignore the
  130316. // request if it has already been completed.
  130317. //
  130318. // For example, consider a situation where you make an initial request
  130319. // and the request times out. If you make the request again with the
  130320. // same request ID, the server can check if original operation with the
  130321. // same request ID was received, and if so, will ignore the second
  130322. // request. This prevents clients from accidentally creating duplicate
  130323. // commitments.
  130324. //
  130325. // The request ID must be a valid UUID with the exception that zero UUID
  130326. // is not supported (00000000-0000-0000-0000-000000000000).
  130327. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  130328. c.urlParams_.Set("requestId", requestId)
  130329. return c
  130330. }
  130331. // Fields allows partial responses to be retrieved. See
  130332. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130333. // for more information.
  130334. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  130335. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130336. return c
  130337. }
  130338. // Context sets the context to be used in this call's Do method. Any
  130339. // pending HTTP request will be aborted if the provided context is
  130340. // canceled.
  130341. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  130342. c.ctx_ = ctx
  130343. return c
  130344. }
  130345. // Header returns an http.Header that can be modified by the caller to
  130346. // add HTTP headers to the request.
  130347. func (c *SubnetworksDeleteCall) Header() http.Header {
  130348. if c.header_ == nil {
  130349. c.header_ = make(http.Header)
  130350. }
  130351. return c.header_
  130352. }
  130353. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  130354. reqHeaders := make(http.Header)
  130355. for k, v := range c.header_ {
  130356. reqHeaders[k] = v
  130357. }
  130358. reqHeaders.Set("User-Agent", c.s.userAgent())
  130359. var body io.Reader = nil
  130360. c.urlParams_.Set("alt", alt)
  130361. c.urlParams_.Set("prettyPrint", "false")
  130362. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  130363. urls += "?" + c.urlParams_.Encode()
  130364. req, err := http.NewRequest("DELETE", urls, body)
  130365. if err != nil {
  130366. return nil, err
  130367. }
  130368. req.Header = reqHeaders
  130369. googleapi.Expand(req.URL, map[string]string{
  130370. "project": c.project,
  130371. "region": c.region,
  130372. "subnetwork": c.subnetwork,
  130373. })
  130374. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130375. }
  130376. // Do executes the "compute.subnetworks.delete" call.
  130377. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  130378. // status code is an error. Response headers are in either
  130379. // *Operation.ServerResponse.Header or (if a response was returned at
  130380. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  130381. // to check whether the returned error was because
  130382. // http.StatusNotModified was returned.
  130383. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  130384. gensupport.SetOptions(c.urlParams_, opts...)
  130385. res, err := c.doRequest("json")
  130386. if res != nil && res.StatusCode == http.StatusNotModified {
  130387. if res.Body != nil {
  130388. res.Body.Close()
  130389. }
  130390. return nil, &googleapi.Error{
  130391. Code: res.StatusCode,
  130392. Header: res.Header,
  130393. }
  130394. }
  130395. if err != nil {
  130396. return nil, err
  130397. }
  130398. defer googleapi.CloseBody(res)
  130399. if err := googleapi.CheckResponse(res); err != nil {
  130400. return nil, err
  130401. }
  130402. ret := &Operation{
  130403. ServerResponse: googleapi.ServerResponse{
  130404. Header: res.Header,
  130405. HTTPStatusCode: res.StatusCode,
  130406. },
  130407. }
  130408. target := &ret
  130409. if err := gensupport.DecodeResponse(target, res); err != nil {
  130410. return nil, err
  130411. }
  130412. return ret, nil
  130413. // {
  130414. // "description": "Deletes the specified subnetwork.",
  130415. // "httpMethod": "DELETE",
  130416. // "id": "compute.subnetworks.delete",
  130417. // "parameterOrder": [
  130418. // "project",
  130419. // "region",
  130420. // "subnetwork"
  130421. // ],
  130422. // "parameters": {
  130423. // "project": {
  130424. // "description": "Project ID for this request.",
  130425. // "location": "path",
  130426. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130427. // "required": true,
  130428. // "type": "string"
  130429. // },
  130430. // "region": {
  130431. // "description": "Name of the region scoping this request.",
  130432. // "location": "path",
  130433. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  130434. // "required": true,
  130435. // "type": "string"
  130436. // },
  130437. // "requestId": {
  130438. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  130439. // "location": "query",
  130440. // "type": "string"
  130441. // },
  130442. // "subnetwork": {
  130443. // "description": "Name of the Subnetwork resource to delete.",
  130444. // "location": "path",
  130445. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  130446. // "required": true,
  130447. // "type": "string"
  130448. // }
  130449. // },
  130450. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  130451. // "response": {
  130452. // "$ref": "Operation"
  130453. // },
  130454. // "scopes": [
  130455. // "https://www.googleapis.com/auth/cloud-platform",
  130456. // "https://www.googleapis.com/auth/compute"
  130457. // ]
  130458. // }
  130459. }
  130460. // method id "compute.subnetworks.expandIpCidrRange":
  130461. type SubnetworksExpandIpCidrRangeCall struct {
  130462. s *Service
  130463. project string
  130464. region string
  130465. subnetwork string
  130466. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  130467. urlParams_ gensupport.URLParams
  130468. ctx_ context.Context
  130469. header_ http.Header
  130470. }
  130471. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  130472. // specified value.
  130473. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  130474. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130475. c.project = project
  130476. c.region = region
  130477. c.subnetwork = subnetwork
  130478. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  130479. return c
  130480. }
  130481. // RequestId sets the optional parameter "requestId": An optional
  130482. // request ID to identify requests. Specify a unique request ID so that
  130483. // if you must retry your request, the server will know to ignore the
  130484. // request if it has already been completed.
  130485. //
  130486. // For example, consider a situation where you make an initial request
  130487. // and the request times out. If you make the request again with the
  130488. // same request ID, the server can check if original operation with the
  130489. // same request ID was received, and if so, will ignore the second
  130490. // request. This prevents clients from accidentally creating duplicate
  130491. // commitments.
  130492. //
  130493. // The request ID must be a valid UUID with the exception that zero UUID
  130494. // is not supported (00000000-0000-0000-0000-000000000000).
  130495. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  130496. c.urlParams_.Set("requestId", requestId)
  130497. return c
  130498. }
  130499. // Fields allows partial responses to be retrieved. See
  130500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130501. // for more information.
  130502. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  130503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130504. return c
  130505. }
  130506. // Context sets the context to be used in this call's Do method. Any
  130507. // pending HTTP request will be aborted if the provided context is
  130508. // canceled.
  130509. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  130510. c.ctx_ = ctx
  130511. return c
  130512. }
  130513. // Header returns an http.Header that can be modified by the caller to
  130514. // add HTTP headers to the request.
  130515. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  130516. if c.header_ == nil {
  130517. c.header_ = make(http.Header)
  130518. }
  130519. return c.header_
  130520. }
  130521. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  130522. reqHeaders := make(http.Header)
  130523. for k, v := range c.header_ {
  130524. reqHeaders[k] = v
  130525. }
  130526. reqHeaders.Set("User-Agent", c.s.userAgent())
  130527. var body io.Reader = nil
  130528. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  130529. if err != nil {
  130530. return nil, err
  130531. }
  130532. reqHeaders.Set("Content-Type", "application/json")
  130533. c.urlParams_.Set("alt", alt)
  130534. c.urlParams_.Set("prettyPrint", "false")
  130535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  130536. urls += "?" + c.urlParams_.Encode()
  130537. req, err := http.NewRequest("POST", urls, body)
  130538. if err != nil {
  130539. return nil, err
  130540. }
  130541. req.Header = reqHeaders
  130542. googleapi.Expand(req.URL, map[string]string{
  130543. "project": c.project,
  130544. "region": c.region,
  130545. "subnetwork": c.subnetwork,
  130546. })
  130547. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130548. }
  130549. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  130550. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  130551. // status code is an error. Response headers are in either
  130552. // *Operation.ServerResponse.Header or (if a response was returned at
  130553. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  130554. // to check whether the returned error was because
  130555. // http.StatusNotModified was returned.
  130556. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  130557. gensupport.SetOptions(c.urlParams_, opts...)
  130558. res, err := c.doRequest("json")
  130559. if res != nil && res.StatusCode == http.StatusNotModified {
  130560. if res.Body != nil {
  130561. res.Body.Close()
  130562. }
  130563. return nil, &googleapi.Error{
  130564. Code: res.StatusCode,
  130565. Header: res.Header,
  130566. }
  130567. }
  130568. if err != nil {
  130569. return nil, err
  130570. }
  130571. defer googleapi.CloseBody(res)
  130572. if err := googleapi.CheckResponse(res); err != nil {
  130573. return nil, err
  130574. }
  130575. ret := &Operation{
  130576. ServerResponse: googleapi.ServerResponse{
  130577. Header: res.Header,
  130578. HTTPStatusCode: res.StatusCode,
  130579. },
  130580. }
  130581. target := &ret
  130582. if err := gensupport.DecodeResponse(target, res); err != nil {
  130583. return nil, err
  130584. }
  130585. return ret, nil
  130586. // {
  130587. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  130588. // "httpMethod": "POST",
  130589. // "id": "compute.subnetworks.expandIpCidrRange",
  130590. // "parameterOrder": [
  130591. // "project",
  130592. // "region",
  130593. // "subnetwork"
  130594. // ],
  130595. // "parameters": {
  130596. // "project": {
  130597. // "description": "Project ID for this request.",
  130598. // "location": "path",
  130599. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130600. // "required": true,
  130601. // "type": "string"
  130602. // },
  130603. // "region": {
  130604. // "description": "Name of the region scoping this request.",
  130605. // "location": "path",
  130606. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  130607. // "required": true,
  130608. // "type": "string"
  130609. // },
  130610. // "requestId": {
  130611. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  130612. // "location": "query",
  130613. // "type": "string"
  130614. // },
  130615. // "subnetwork": {
  130616. // "description": "Name of the Subnetwork resource to update.",
  130617. // "location": "path",
  130618. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  130619. // "required": true,
  130620. // "type": "string"
  130621. // }
  130622. // },
  130623. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  130624. // "request": {
  130625. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  130626. // },
  130627. // "response": {
  130628. // "$ref": "Operation"
  130629. // },
  130630. // "scopes": [
  130631. // "https://www.googleapis.com/auth/cloud-platform",
  130632. // "https://www.googleapis.com/auth/compute"
  130633. // ]
  130634. // }
  130635. }
  130636. // method id "compute.subnetworks.get":
  130637. type SubnetworksGetCall struct {
  130638. s *Service
  130639. project string
  130640. region string
  130641. subnetwork string
  130642. urlParams_ gensupport.URLParams
  130643. ifNoneMatch_ string
  130644. ctx_ context.Context
  130645. header_ http.Header
  130646. }
  130647. // Get: Returns the specified subnetwork. Gets a list of available
  130648. // subnetworks list() request.
  130649. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  130650. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130651. c.project = project
  130652. c.region = region
  130653. c.subnetwork = subnetwork
  130654. return c
  130655. }
  130656. // Fields allows partial responses to be retrieved. See
  130657. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130658. // for more information.
  130659. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  130660. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130661. return c
  130662. }
  130663. // IfNoneMatch sets the optional parameter which makes the operation
  130664. // fail if the object's ETag matches the given value. This is useful for
  130665. // getting updates only after the object has changed since the last
  130666. // request. Use googleapi.IsNotModified to check whether the response
  130667. // error from Do is the result of In-None-Match.
  130668. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  130669. c.ifNoneMatch_ = entityTag
  130670. return c
  130671. }
  130672. // Context sets the context to be used in this call's Do method. Any
  130673. // pending HTTP request will be aborted if the provided context is
  130674. // canceled.
  130675. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  130676. c.ctx_ = ctx
  130677. return c
  130678. }
  130679. // Header returns an http.Header that can be modified by the caller to
  130680. // add HTTP headers to the request.
  130681. func (c *SubnetworksGetCall) Header() http.Header {
  130682. if c.header_ == nil {
  130683. c.header_ = make(http.Header)
  130684. }
  130685. return c.header_
  130686. }
  130687. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  130688. reqHeaders := make(http.Header)
  130689. for k, v := range c.header_ {
  130690. reqHeaders[k] = v
  130691. }
  130692. reqHeaders.Set("User-Agent", c.s.userAgent())
  130693. if c.ifNoneMatch_ != "" {
  130694. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  130695. }
  130696. var body io.Reader = nil
  130697. c.urlParams_.Set("alt", alt)
  130698. c.urlParams_.Set("prettyPrint", "false")
  130699. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  130700. urls += "?" + c.urlParams_.Encode()
  130701. req, err := http.NewRequest("GET", urls, body)
  130702. if err != nil {
  130703. return nil, err
  130704. }
  130705. req.Header = reqHeaders
  130706. googleapi.Expand(req.URL, map[string]string{
  130707. "project": c.project,
  130708. "region": c.region,
  130709. "subnetwork": c.subnetwork,
  130710. })
  130711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130712. }
  130713. // Do executes the "compute.subnetworks.get" call.
  130714. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  130715. // status code is an error. Response headers are in either
  130716. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  130717. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  130718. // to check whether the returned error was because
  130719. // http.StatusNotModified was returned.
  130720. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  130721. gensupport.SetOptions(c.urlParams_, opts...)
  130722. res, err := c.doRequest("json")
  130723. if res != nil && res.StatusCode == http.StatusNotModified {
  130724. if res.Body != nil {
  130725. res.Body.Close()
  130726. }
  130727. return nil, &googleapi.Error{
  130728. Code: res.StatusCode,
  130729. Header: res.Header,
  130730. }
  130731. }
  130732. if err != nil {
  130733. return nil, err
  130734. }
  130735. defer googleapi.CloseBody(res)
  130736. if err := googleapi.CheckResponse(res); err != nil {
  130737. return nil, err
  130738. }
  130739. ret := &Subnetwork{
  130740. ServerResponse: googleapi.ServerResponse{
  130741. Header: res.Header,
  130742. HTTPStatusCode: res.StatusCode,
  130743. },
  130744. }
  130745. target := &ret
  130746. if err := gensupport.DecodeResponse(target, res); err != nil {
  130747. return nil, err
  130748. }
  130749. return ret, nil
  130750. // {
  130751. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  130752. // "httpMethod": "GET",
  130753. // "id": "compute.subnetworks.get",
  130754. // "parameterOrder": [
  130755. // "project",
  130756. // "region",
  130757. // "subnetwork"
  130758. // ],
  130759. // "parameters": {
  130760. // "project": {
  130761. // "description": "Project ID for this request.",
  130762. // "location": "path",
  130763. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130764. // "required": true,
  130765. // "type": "string"
  130766. // },
  130767. // "region": {
  130768. // "description": "Name of the region scoping this request.",
  130769. // "location": "path",
  130770. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  130771. // "required": true,
  130772. // "type": "string"
  130773. // },
  130774. // "subnetwork": {
  130775. // "description": "Name of the Subnetwork resource to return.",
  130776. // "location": "path",
  130777. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  130778. // "required": true,
  130779. // "type": "string"
  130780. // }
  130781. // },
  130782. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  130783. // "response": {
  130784. // "$ref": "Subnetwork"
  130785. // },
  130786. // "scopes": [
  130787. // "https://www.googleapis.com/auth/cloud-platform",
  130788. // "https://www.googleapis.com/auth/compute",
  130789. // "https://www.googleapis.com/auth/compute.readonly"
  130790. // ]
  130791. // }
  130792. }
  130793. // method id "compute.subnetworks.getIamPolicy":
  130794. type SubnetworksGetIamPolicyCall struct {
  130795. s *Service
  130796. project string
  130797. region string
  130798. resource string
  130799. urlParams_ gensupport.URLParams
  130800. ifNoneMatch_ string
  130801. ctx_ context.Context
  130802. header_ http.Header
  130803. }
  130804. // GetIamPolicy: Gets the access control policy for a resource. May be
  130805. // empty if no such policy or resource exists.
  130806. func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
  130807. c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130808. c.project = project
  130809. c.region = region
  130810. c.resource = resource
  130811. return c
  130812. }
  130813. // Fields allows partial responses to be retrieved. See
  130814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130815. // for more information.
  130816. func (c *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
  130817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130818. return c
  130819. }
  130820. // IfNoneMatch sets the optional parameter which makes the operation
  130821. // fail if the object's ETag matches the given value. This is useful for
  130822. // getting updates only after the object has changed since the last
  130823. // request. Use googleapi.IsNotModified to check whether the response
  130824. // error from Do is the result of In-None-Match.
  130825. func (c *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
  130826. c.ifNoneMatch_ = entityTag
  130827. return c
  130828. }
  130829. // Context sets the context to be used in this call's Do method. Any
  130830. // pending HTTP request will be aborted if the provided context is
  130831. // canceled.
  130832. func (c *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
  130833. c.ctx_ = ctx
  130834. return c
  130835. }
  130836. // Header returns an http.Header that can be modified by the caller to
  130837. // add HTTP headers to the request.
  130838. func (c *SubnetworksGetIamPolicyCall) Header() http.Header {
  130839. if c.header_ == nil {
  130840. c.header_ = make(http.Header)
  130841. }
  130842. return c.header_
  130843. }
  130844. func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  130845. reqHeaders := make(http.Header)
  130846. for k, v := range c.header_ {
  130847. reqHeaders[k] = v
  130848. }
  130849. reqHeaders.Set("User-Agent", c.s.userAgent())
  130850. if c.ifNoneMatch_ != "" {
  130851. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  130852. }
  130853. var body io.Reader = nil
  130854. c.urlParams_.Set("alt", alt)
  130855. c.urlParams_.Set("prettyPrint", "false")
  130856. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
  130857. urls += "?" + c.urlParams_.Encode()
  130858. req, err := http.NewRequest("GET", urls, body)
  130859. if err != nil {
  130860. return nil, err
  130861. }
  130862. req.Header = reqHeaders
  130863. googleapi.Expand(req.URL, map[string]string{
  130864. "project": c.project,
  130865. "region": c.region,
  130866. "resource": c.resource,
  130867. })
  130868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130869. }
  130870. // Do executes the "compute.subnetworks.getIamPolicy" call.
  130871. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  130872. // code is an error. Response headers are in either
  130873. // *Policy.ServerResponse.Header or (if a response was returned at all)
  130874. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  130875. // check whether the returned error was because http.StatusNotModified
  130876. // was returned.
  130877. func (c *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  130878. gensupport.SetOptions(c.urlParams_, opts...)
  130879. res, err := c.doRequest("json")
  130880. if res != nil && res.StatusCode == http.StatusNotModified {
  130881. if res.Body != nil {
  130882. res.Body.Close()
  130883. }
  130884. return nil, &googleapi.Error{
  130885. Code: res.StatusCode,
  130886. Header: res.Header,
  130887. }
  130888. }
  130889. if err != nil {
  130890. return nil, err
  130891. }
  130892. defer googleapi.CloseBody(res)
  130893. if err := googleapi.CheckResponse(res); err != nil {
  130894. return nil, err
  130895. }
  130896. ret := &Policy{
  130897. ServerResponse: googleapi.ServerResponse{
  130898. Header: res.Header,
  130899. HTTPStatusCode: res.StatusCode,
  130900. },
  130901. }
  130902. target := &ret
  130903. if err := gensupport.DecodeResponse(target, res); err != nil {
  130904. return nil, err
  130905. }
  130906. return ret, nil
  130907. // {
  130908. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  130909. // "httpMethod": "GET",
  130910. // "id": "compute.subnetworks.getIamPolicy",
  130911. // "parameterOrder": [
  130912. // "project",
  130913. // "region",
  130914. // "resource"
  130915. // ],
  130916. // "parameters": {
  130917. // "project": {
  130918. // "description": "Project ID for this request.",
  130919. // "location": "path",
  130920. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130921. // "required": true,
  130922. // "type": "string"
  130923. // },
  130924. // "region": {
  130925. // "description": "The name of the region for this request.",
  130926. // "location": "path",
  130927. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  130928. // "required": true,
  130929. // "type": "string"
  130930. // },
  130931. // "resource": {
  130932. // "description": "Name or id of the resource for this request.",
  130933. // "location": "path",
  130934. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  130935. // "required": true,
  130936. // "type": "string"
  130937. // }
  130938. // },
  130939. // "path": "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
  130940. // "response": {
  130941. // "$ref": "Policy"
  130942. // },
  130943. // "scopes": [
  130944. // "https://www.googleapis.com/auth/cloud-platform",
  130945. // "https://www.googleapis.com/auth/compute",
  130946. // "https://www.googleapis.com/auth/compute.readonly"
  130947. // ]
  130948. // }
  130949. }
  130950. // method id "compute.subnetworks.insert":
  130951. type SubnetworksInsertCall struct {
  130952. s *Service
  130953. project string
  130954. region string
  130955. subnetwork *Subnetwork
  130956. urlParams_ gensupport.URLParams
  130957. ctx_ context.Context
  130958. header_ http.Header
  130959. }
  130960. // Insert: Creates a subnetwork in the specified project using the data
  130961. // included in the request.
  130962. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  130963. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130964. c.project = project
  130965. c.region = region
  130966. c.subnetwork = subnetwork
  130967. return c
  130968. }
  130969. // RequestId sets the optional parameter "requestId": An optional
  130970. // request ID to identify requests. Specify a unique request ID so that
  130971. // if you must retry your request, the server will know to ignore the
  130972. // request if it has already been completed.
  130973. //
  130974. // For example, consider a situation where you make an initial request
  130975. // and the request times out. If you make the request again with the
  130976. // same request ID, the server can check if original operation with the
  130977. // same request ID was received, and if so, will ignore the second
  130978. // request. This prevents clients from accidentally creating duplicate
  130979. // commitments.
  130980. //
  130981. // The request ID must be a valid UUID with the exception that zero UUID
  130982. // is not supported (00000000-0000-0000-0000-000000000000).
  130983. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  130984. c.urlParams_.Set("requestId", requestId)
  130985. return c
  130986. }
  130987. // Fields allows partial responses to be retrieved. See
  130988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130989. // for more information.
  130990. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  130991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130992. return c
  130993. }
  130994. // Context sets the context to be used in this call's Do method. Any
  130995. // pending HTTP request will be aborted if the provided context is
  130996. // canceled.
  130997. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  130998. c.ctx_ = ctx
  130999. return c
  131000. }
  131001. // Header returns an http.Header that can be modified by the caller to
  131002. // add HTTP headers to the request.
  131003. func (c *SubnetworksInsertCall) Header() http.Header {
  131004. if c.header_ == nil {
  131005. c.header_ = make(http.Header)
  131006. }
  131007. return c.header_
  131008. }
  131009. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  131010. reqHeaders := make(http.Header)
  131011. for k, v := range c.header_ {
  131012. reqHeaders[k] = v
  131013. }
  131014. reqHeaders.Set("User-Agent", c.s.userAgent())
  131015. var body io.Reader = nil
  131016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  131017. if err != nil {
  131018. return nil, err
  131019. }
  131020. reqHeaders.Set("Content-Type", "application/json")
  131021. c.urlParams_.Set("alt", alt)
  131022. c.urlParams_.Set("prettyPrint", "false")
  131023. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  131024. urls += "?" + c.urlParams_.Encode()
  131025. req, err := http.NewRequest("POST", urls, body)
  131026. if err != nil {
  131027. return nil, err
  131028. }
  131029. req.Header = reqHeaders
  131030. googleapi.Expand(req.URL, map[string]string{
  131031. "project": c.project,
  131032. "region": c.region,
  131033. })
  131034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131035. }
  131036. // Do executes the "compute.subnetworks.insert" call.
  131037. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  131038. // status code is an error. Response headers are in either
  131039. // *Operation.ServerResponse.Header or (if a response was returned at
  131040. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  131041. // to check whether the returned error was because
  131042. // http.StatusNotModified was returned.
  131043. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  131044. gensupport.SetOptions(c.urlParams_, opts...)
  131045. res, err := c.doRequest("json")
  131046. if res != nil && res.StatusCode == http.StatusNotModified {
  131047. if res.Body != nil {
  131048. res.Body.Close()
  131049. }
  131050. return nil, &googleapi.Error{
  131051. Code: res.StatusCode,
  131052. Header: res.Header,
  131053. }
  131054. }
  131055. if err != nil {
  131056. return nil, err
  131057. }
  131058. defer googleapi.CloseBody(res)
  131059. if err := googleapi.CheckResponse(res); err != nil {
  131060. return nil, err
  131061. }
  131062. ret := &Operation{
  131063. ServerResponse: googleapi.ServerResponse{
  131064. Header: res.Header,
  131065. HTTPStatusCode: res.StatusCode,
  131066. },
  131067. }
  131068. target := &ret
  131069. if err := gensupport.DecodeResponse(target, res); err != nil {
  131070. return nil, err
  131071. }
  131072. return ret, nil
  131073. // {
  131074. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  131075. // "httpMethod": "POST",
  131076. // "id": "compute.subnetworks.insert",
  131077. // "parameterOrder": [
  131078. // "project",
  131079. // "region"
  131080. // ],
  131081. // "parameters": {
  131082. // "project": {
  131083. // "description": "Project ID for this request.",
  131084. // "location": "path",
  131085. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131086. // "required": true,
  131087. // "type": "string"
  131088. // },
  131089. // "region": {
  131090. // "description": "Name of the region scoping this request.",
  131091. // "location": "path",
  131092. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  131093. // "required": true,
  131094. // "type": "string"
  131095. // },
  131096. // "requestId": {
  131097. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  131098. // "location": "query",
  131099. // "type": "string"
  131100. // }
  131101. // },
  131102. // "path": "{project}/regions/{region}/subnetworks",
  131103. // "request": {
  131104. // "$ref": "Subnetwork"
  131105. // },
  131106. // "response": {
  131107. // "$ref": "Operation"
  131108. // },
  131109. // "scopes": [
  131110. // "https://www.googleapis.com/auth/cloud-platform",
  131111. // "https://www.googleapis.com/auth/compute"
  131112. // ]
  131113. // }
  131114. }
  131115. // method id "compute.subnetworks.list":
  131116. type SubnetworksListCall struct {
  131117. s *Service
  131118. project string
  131119. region string
  131120. urlParams_ gensupport.URLParams
  131121. ifNoneMatch_ string
  131122. ctx_ context.Context
  131123. header_ http.Header
  131124. }
  131125. // List: Retrieves a list of subnetworks available to the specified
  131126. // project.
  131127. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  131128. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131129. c.project = project
  131130. c.region = region
  131131. return c
  131132. }
  131133. // Filter sets the optional parameter "filter": A filter expression that
  131134. // filters resources listed in the response. The expression must specify
  131135. // the field name, a comparison operator, and the value that you want to
  131136. // use for filtering. The value must be a string, a number, or a
  131137. // boolean. The comparison operator must be either =, !=, >, or <.
  131138. //
  131139. // For example, if you are filtering Compute Engine instances, you can
  131140. // exclude instances named example-instance by specifying name !=
  131141. // example-instance.
  131142. //
  131143. // You can also filter nested fields. For example, you could specify
  131144. // scheduling.automaticRestart = false to include instances only if they
  131145. // are not scheduled for automatic restarts. You can use filtering on
  131146. // nested fields to filter based on resource labels.
  131147. //
  131148. // To filter on multiple expressions, provide each separate expression
  131149. // within parentheses. For example, (scheduling.automaticRestart = true)
  131150. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  131151. // AND expression. However, you can include AND and OR expressions
  131152. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  131153. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  131154. // true).
  131155. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  131156. c.urlParams_.Set("filter", filter)
  131157. return c
  131158. }
  131159. // MaxResults sets the optional parameter "maxResults": The maximum
  131160. // number of results per page that should be returned. If the number of
  131161. // available results is larger than maxResults, Compute Engine returns a
  131162. // nextPageToken that can be used to get the next page of results in
  131163. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  131164. // (Default: 500)
  131165. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  131166. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  131167. return c
  131168. }
  131169. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  131170. // a certain order. By default, results are returned in alphanumerical
  131171. // order based on the resource name.
  131172. //
  131173. // You can also sort results in descending order based on the creation
  131174. // timestamp using orderBy="creationTimestamp desc". This sorts results
  131175. // based on the creationTimestamp field in reverse chronological order
  131176. // (newest result first). Use this to sort resources like operations so
  131177. // that the newest operation is returned first.
  131178. //
  131179. // Currently, only sorting by name or creationTimestamp desc is
  131180. // supported.
  131181. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  131182. c.urlParams_.Set("orderBy", orderBy)
  131183. return c
  131184. }
  131185. // PageToken sets the optional parameter "pageToken": Specifies a page
  131186. // token to use. Set pageToken to the nextPageToken returned by a
  131187. // previous list request to get the next page of results.
  131188. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  131189. c.urlParams_.Set("pageToken", pageToken)
  131190. return c
  131191. }
  131192. // Fields allows partial responses to be retrieved. See
  131193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131194. // for more information.
  131195. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  131196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131197. return c
  131198. }
  131199. // IfNoneMatch sets the optional parameter which makes the operation
  131200. // fail if the object's ETag matches the given value. This is useful for
  131201. // getting updates only after the object has changed since the last
  131202. // request. Use googleapi.IsNotModified to check whether the response
  131203. // error from Do is the result of In-None-Match.
  131204. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  131205. c.ifNoneMatch_ = entityTag
  131206. return c
  131207. }
  131208. // Context sets the context to be used in this call's Do method. Any
  131209. // pending HTTP request will be aborted if the provided context is
  131210. // canceled.
  131211. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  131212. c.ctx_ = ctx
  131213. return c
  131214. }
  131215. // Header returns an http.Header that can be modified by the caller to
  131216. // add HTTP headers to the request.
  131217. func (c *SubnetworksListCall) Header() http.Header {
  131218. if c.header_ == nil {
  131219. c.header_ = make(http.Header)
  131220. }
  131221. return c.header_
  131222. }
  131223. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  131224. reqHeaders := make(http.Header)
  131225. for k, v := range c.header_ {
  131226. reqHeaders[k] = v
  131227. }
  131228. reqHeaders.Set("User-Agent", c.s.userAgent())
  131229. if c.ifNoneMatch_ != "" {
  131230. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  131231. }
  131232. var body io.Reader = nil
  131233. c.urlParams_.Set("alt", alt)
  131234. c.urlParams_.Set("prettyPrint", "false")
  131235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  131236. urls += "?" + c.urlParams_.Encode()
  131237. req, err := http.NewRequest("GET", urls, body)
  131238. if err != nil {
  131239. return nil, err
  131240. }
  131241. req.Header = reqHeaders
  131242. googleapi.Expand(req.URL, map[string]string{
  131243. "project": c.project,
  131244. "region": c.region,
  131245. })
  131246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131247. }
  131248. // Do executes the "compute.subnetworks.list" call.
  131249. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  131250. // status code is an error. Response headers are in either
  131251. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  131252. // at all) in error.(*googleapi.Error).Header. Use
  131253. // googleapi.IsNotModified to check whether the returned error was
  131254. // because http.StatusNotModified was returned.
  131255. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  131256. gensupport.SetOptions(c.urlParams_, opts...)
  131257. res, err := c.doRequest("json")
  131258. if res != nil && res.StatusCode == http.StatusNotModified {
  131259. if res.Body != nil {
  131260. res.Body.Close()
  131261. }
  131262. return nil, &googleapi.Error{
  131263. Code: res.StatusCode,
  131264. Header: res.Header,
  131265. }
  131266. }
  131267. if err != nil {
  131268. return nil, err
  131269. }
  131270. defer googleapi.CloseBody(res)
  131271. if err := googleapi.CheckResponse(res); err != nil {
  131272. return nil, err
  131273. }
  131274. ret := &SubnetworkList{
  131275. ServerResponse: googleapi.ServerResponse{
  131276. Header: res.Header,
  131277. HTTPStatusCode: res.StatusCode,
  131278. },
  131279. }
  131280. target := &ret
  131281. if err := gensupport.DecodeResponse(target, res); err != nil {
  131282. return nil, err
  131283. }
  131284. return ret, nil
  131285. // {
  131286. // "description": "Retrieves a list of subnetworks available to the specified project.",
  131287. // "httpMethod": "GET",
  131288. // "id": "compute.subnetworks.list",
  131289. // "parameterOrder": [
  131290. // "project",
  131291. // "region"
  131292. // ],
  131293. // "parameters": {
  131294. // "filter": {
  131295. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  131296. // "location": "query",
  131297. // "type": "string"
  131298. // },
  131299. // "maxResults": {
  131300. // "default": "500",
  131301. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  131302. // "format": "uint32",
  131303. // "location": "query",
  131304. // "minimum": "0",
  131305. // "type": "integer"
  131306. // },
  131307. // "orderBy": {
  131308. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  131309. // "location": "query",
  131310. // "type": "string"
  131311. // },
  131312. // "pageToken": {
  131313. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  131314. // "location": "query",
  131315. // "type": "string"
  131316. // },
  131317. // "project": {
  131318. // "description": "Project ID for this request.",
  131319. // "location": "path",
  131320. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131321. // "required": true,
  131322. // "type": "string"
  131323. // },
  131324. // "region": {
  131325. // "description": "Name of the region scoping this request.",
  131326. // "location": "path",
  131327. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  131328. // "required": true,
  131329. // "type": "string"
  131330. // }
  131331. // },
  131332. // "path": "{project}/regions/{region}/subnetworks",
  131333. // "response": {
  131334. // "$ref": "SubnetworkList"
  131335. // },
  131336. // "scopes": [
  131337. // "https://www.googleapis.com/auth/cloud-platform",
  131338. // "https://www.googleapis.com/auth/compute",
  131339. // "https://www.googleapis.com/auth/compute.readonly"
  131340. // ]
  131341. // }
  131342. }
  131343. // Pages invokes f for each page of results.
  131344. // A non-nil error returned from f will halt the iteration.
  131345. // The provided context supersedes any context provided to the Context method.
  131346. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  131347. c.ctx_ = ctx
  131348. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  131349. for {
  131350. x, err := c.Do()
  131351. if err != nil {
  131352. return err
  131353. }
  131354. if err := f(x); err != nil {
  131355. return err
  131356. }
  131357. if x.NextPageToken == "" {
  131358. return nil
  131359. }
  131360. c.PageToken(x.NextPageToken)
  131361. }
  131362. }
  131363. // method id "compute.subnetworks.listUsable":
  131364. type SubnetworksListUsableCall struct {
  131365. s *Service
  131366. project string
  131367. urlParams_ gensupport.URLParams
  131368. ifNoneMatch_ string
  131369. ctx_ context.Context
  131370. header_ http.Header
  131371. }
  131372. // ListUsable: Retrieves an aggregated list of usable subnetworks.
  131373. func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
  131374. c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131375. c.project = project
  131376. return c
  131377. }
  131378. // Filter sets the optional parameter "filter": A filter expression that
  131379. // filters resources listed in the response. The expression must specify
  131380. // the field name, a comparison operator, and the value that you want to
  131381. // use for filtering. The value must be a string, a number, or a
  131382. // boolean. The comparison operator must be either =, !=, >, or <.
  131383. //
  131384. // For example, if you are filtering Compute Engine instances, you can
  131385. // exclude instances named example-instance by specifying name !=
  131386. // example-instance.
  131387. //
  131388. // You can also filter nested fields. For example, you could specify
  131389. // scheduling.automaticRestart = false to include instances only if they
  131390. // are not scheduled for automatic restarts. You can use filtering on
  131391. // nested fields to filter based on resource labels.
  131392. //
  131393. // To filter on multiple expressions, provide each separate expression
  131394. // within parentheses. For example, (scheduling.automaticRestart = true)
  131395. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  131396. // AND expression. However, you can include AND and OR expressions
  131397. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  131398. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  131399. // true).
  131400. func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
  131401. c.urlParams_.Set("filter", filter)
  131402. return c
  131403. }
  131404. // MaxResults sets the optional parameter "maxResults": The maximum
  131405. // number of results per page that should be returned. If the number of
  131406. // available results is larger than maxResults, Compute Engine returns a
  131407. // nextPageToken that can be used to get the next page of results in
  131408. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  131409. // (Default: 500)
  131410. func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
  131411. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  131412. return c
  131413. }
  131414. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  131415. // a certain order. By default, results are returned in alphanumerical
  131416. // order based on the resource name.
  131417. //
  131418. // You can also sort results in descending order based on the creation
  131419. // timestamp using orderBy="creationTimestamp desc". This sorts results
  131420. // based on the creationTimestamp field in reverse chronological order
  131421. // (newest result first). Use this to sort resources like operations so
  131422. // that the newest operation is returned first.
  131423. //
  131424. // Currently, only sorting by name or creationTimestamp desc is
  131425. // supported.
  131426. func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
  131427. c.urlParams_.Set("orderBy", orderBy)
  131428. return c
  131429. }
  131430. // PageToken sets the optional parameter "pageToken": Specifies a page
  131431. // token to use. Set pageToken to the nextPageToken returned by a
  131432. // previous list request to get the next page of results.
  131433. func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
  131434. c.urlParams_.Set("pageToken", pageToken)
  131435. return c
  131436. }
  131437. // Fields allows partial responses to be retrieved. See
  131438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131439. // for more information.
  131440. func (c *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
  131441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131442. return c
  131443. }
  131444. // IfNoneMatch sets the optional parameter which makes the operation
  131445. // fail if the object's ETag matches the given value. This is useful for
  131446. // getting updates only after the object has changed since the last
  131447. // request. Use googleapi.IsNotModified to check whether the response
  131448. // error from Do is the result of In-None-Match.
  131449. func (c *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
  131450. c.ifNoneMatch_ = entityTag
  131451. return c
  131452. }
  131453. // Context sets the context to be used in this call's Do method. Any
  131454. // pending HTTP request will be aborted if the provided context is
  131455. // canceled.
  131456. func (c *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
  131457. c.ctx_ = ctx
  131458. return c
  131459. }
  131460. // Header returns an http.Header that can be modified by the caller to
  131461. // add HTTP headers to the request.
  131462. func (c *SubnetworksListUsableCall) Header() http.Header {
  131463. if c.header_ == nil {
  131464. c.header_ = make(http.Header)
  131465. }
  131466. return c.header_
  131467. }
  131468. func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
  131469. reqHeaders := make(http.Header)
  131470. for k, v := range c.header_ {
  131471. reqHeaders[k] = v
  131472. }
  131473. reqHeaders.Set("User-Agent", c.s.userAgent())
  131474. if c.ifNoneMatch_ != "" {
  131475. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  131476. }
  131477. var body io.Reader = nil
  131478. c.urlParams_.Set("alt", alt)
  131479. c.urlParams_.Set("prettyPrint", "false")
  131480. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks/listUsable")
  131481. urls += "?" + c.urlParams_.Encode()
  131482. req, err := http.NewRequest("GET", urls, body)
  131483. if err != nil {
  131484. return nil, err
  131485. }
  131486. req.Header = reqHeaders
  131487. googleapi.Expand(req.URL, map[string]string{
  131488. "project": c.project,
  131489. })
  131490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131491. }
  131492. // Do executes the "compute.subnetworks.listUsable" call.
  131493. // Exactly one of *UsableSubnetworksAggregatedList or error will be
  131494. // non-nil. Any non-2xx status code is an error. Response headers are in
  131495. // either *UsableSubnetworksAggregatedList.ServerResponse.Header or (if
  131496. // a response was returned at all) in error.(*googleapi.Error).Header.
  131497. // Use googleapi.IsNotModified to check whether the returned error was
  131498. // because http.StatusNotModified was returned.
  131499. func (c *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, error) {
  131500. gensupport.SetOptions(c.urlParams_, opts...)
  131501. res, err := c.doRequest("json")
  131502. if res != nil && res.StatusCode == http.StatusNotModified {
  131503. if res.Body != nil {
  131504. res.Body.Close()
  131505. }
  131506. return nil, &googleapi.Error{
  131507. Code: res.StatusCode,
  131508. Header: res.Header,
  131509. }
  131510. }
  131511. if err != nil {
  131512. return nil, err
  131513. }
  131514. defer googleapi.CloseBody(res)
  131515. if err := googleapi.CheckResponse(res); err != nil {
  131516. return nil, err
  131517. }
  131518. ret := &UsableSubnetworksAggregatedList{
  131519. ServerResponse: googleapi.ServerResponse{
  131520. Header: res.Header,
  131521. HTTPStatusCode: res.StatusCode,
  131522. },
  131523. }
  131524. target := &ret
  131525. if err := gensupport.DecodeResponse(target, res); err != nil {
  131526. return nil, err
  131527. }
  131528. return ret, nil
  131529. // {
  131530. // "description": "Retrieves an aggregated list of usable subnetworks.",
  131531. // "httpMethod": "GET",
  131532. // "id": "compute.subnetworks.listUsable",
  131533. // "parameterOrder": [
  131534. // "project"
  131535. // ],
  131536. // "parameters": {
  131537. // "filter": {
  131538. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  131539. // "location": "query",
  131540. // "type": "string"
  131541. // },
  131542. // "maxResults": {
  131543. // "default": "500",
  131544. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  131545. // "format": "uint32",
  131546. // "location": "query",
  131547. // "minimum": "0",
  131548. // "type": "integer"
  131549. // },
  131550. // "orderBy": {
  131551. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  131552. // "location": "query",
  131553. // "type": "string"
  131554. // },
  131555. // "pageToken": {
  131556. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  131557. // "location": "query",
  131558. // "type": "string"
  131559. // },
  131560. // "project": {
  131561. // "description": "Project ID for this request.",
  131562. // "location": "path",
  131563. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131564. // "required": true,
  131565. // "type": "string"
  131566. // }
  131567. // },
  131568. // "path": "{project}/aggregated/subnetworks/listUsable",
  131569. // "response": {
  131570. // "$ref": "UsableSubnetworksAggregatedList"
  131571. // },
  131572. // "scopes": [
  131573. // "https://www.googleapis.com/auth/cloud-platform",
  131574. // "https://www.googleapis.com/auth/compute",
  131575. // "https://www.googleapis.com/auth/compute.readonly"
  131576. // ]
  131577. // }
  131578. }
  131579. // Pages invokes f for each page of results.
  131580. // A non-nil error returned from f will halt the iteration.
  131581. // The provided context supersedes any context provided to the Context method.
  131582. func (c *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) error) error {
  131583. c.ctx_ = ctx
  131584. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  131585. for {
  131586. x, err := c.Do()
  131587. if err != nil {
  131588. return err
  131589. }
  131590. if err := f(x); err != nil {
  131591. return err
  131592. }
  131593. if x.NextPageToken == "" {
  131594. return nil
  131595. }
  131596. c.PageToken(x.NextPageToken)
  131597. }
  131598. }
  131599. // method id "compute.subnetworks.patch":
  131600. type SubnetworksPatchCall struct {
  131601. s *Service
  131602. project string
  131603. region string
  131604. subnetwork string
  131605. subnetwork2 *Subnetwork
  131606. urlParams_ gensupport.URLParams
  131607. ctx_ context.Context
  131608. header_ http.Header
  131609. }
  131610. // Patch: Patches the specified subnetwork with the data included in the
  131611. // request. Only certain fields can up updated with a patch request as
  131612. // indicated in the field descriptions. You must specify the current
  131613. // fingeprint of the subnetwork resource being patched.
  131614. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  131615. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131616. c.project = project
  131617. c.region = region
  131618. c.subnetwork = subnetwork
  131619. c.subnetwork2 = subnetwork2
  131620. return c
  131621. }
  131622. // DrainTimeoutSeconds sets the optional parameter
  131623. // "drainTimeoutSeconds": The drain timeout specifies the upper bound in
  131624. // seconds on the amount of time allowed to drain connections from the
  131625. // current ACTIVE subnetwork to the current BACKUP subnetwork. The drain
  131626. // timeout is only applicable when the following conditions are true: -
  131627. // the subnetwork being patched has purpose =
  131628. // INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role
  131629. // = BACKUP - the patch request is setting the role to ACTIVE. Note that
  131630. // after this patch operation the roles of the ACTIVE and BACKUP
  131631. // subnetworks will be swapped.
  131632. func (c *SubnetworksPatchCall) DrainTimeoutSeconds(drainTimeoutSeconds int64) *SubnetworksPatchCall {
  131633. c.urlParams_.Set("drainTimeoutSeconds", fmt.Sprint(drainTimeoutSeconds))
  131634. return c
  131635. }
  131636. // RequestId sets the optional parameter "requestId": An optional
  131637. // request ID to identify requests. Specify a unique request ID so that
  131638. // if you must retry your request, the server will know to ignore the
  131639. // request if it has already been completed.
  131640. //
  131641. // For example, consider a situation where you make an initial request
  131642. // and the request times out. If you make the request again with the
  131643. // same request ID, the server can check if original operation with the
  131644. // same request ID was received, and if so, will ignore the second
  131645. // request. This prevents clients from accidentally creating duplicate
  131646. // commitments.
  131647. //
  131648. // The request ID must be a valid UUID with the exception that zero UUID
  131649. // is not supported (00000000-0000-0000-0000-000000000000).
  131650. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  131651. c.urlParams_.Set("requestId", requestId)
  131652. return c
  131653. }
  131654. // Fields allows partial responses to be retrieved. See
  131655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131656. // for more information.
  131657. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  131658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131659. return c
  131660. }
  131661. // Context sets the context to be used in this call's Do method. Any
  131662. // pending HTTP request will be aborted if the provided context is
  131663. // canceled.
  131664. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  131665. c.ctx_ = ctx
  131666. return c
  131667. }
  131668. // Header returns an http.Header that can be modified by the caller to
  131669. // add HTTP headers to the request.
  131670. func (c *SubnetworksPatchCall) Header() http.Header {
  131671. if c.header_ == nil {
  131672. c.header_ = make(http.Header)
  131673. }
  131674. return c.header_
  131675. }
  131676. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  131677. reqHeaders := make(http.Header)
  131678. for k, v := range c.header_ {
  131679. reqHeaders[k] = v
  131680. }
  131681. reqHeaders.Set("User-Agent", c.s.userAgent())
  131682. var body io.Reader = nil
  131683. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  131684. if err != nil {
  131685. return nil, err
  131686. }
  131687. reqHeaders.Set("Content-Type", "application/json")
  131688. c.urlParams_.Set("alt", alt)
  131689. c.urlParams_.Set("prettyPrint", "false")
  131690. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  131691. urls += "?" + c.urlParams_.Encode()
  131692. req, err := http.NewRequest("PATCH", urls, body)
  131693. if err != nil {
  131694. return nil, err
  131695. }
  131696. req.Header = reqHeaders
  131697. googleapi.Expand(req.URL, map[string]string{
  131698. "project": c.project,
  131699. "region": c.region,
  131700. "subnetwork": c.subnetwork,
  131701. })
  131702. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131703. }
  131704. // Do executes the "compute.subnetworks.patch" call.
  131705. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  131706. // status code is an error. Response headers are in either
  131707. // *Operation.ServerResponse.Header or (if a response was returned at
  131708. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  131709. // to check whether the returned error was because
  131710. // http.StatusNotModified was returned.
  131711. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  131712. gensupport.SetOptions(c.urlParams_, opts...)
  131713. res, err := c.doRequest("json")
  131714. if res != nil && res.StatusCode == http.StatusNotModified {
  131715. if res.Body != nil {
  131716. res.Body.Close()
  131717. }
  131718. return nil, &googleapi.Error{
  131719. Code: res.StatusCode,
  131720. Header: res.Header,
  131721. }
  131722. }
  131723. if err != nil {
  131724. return nil, err
  131725. }
  131726. defer googleapi.CloseBody(res)
  131727. if err := googleapi.CheckResponse(res); err != nil {
  131728. return nil, err
  131729. }
  131730. ret := &Operation{
  131731. ServerResponse: googleapi.ServerResponse{
  131732. Header: res.Header,
  131733. HTTPStatusCode: res.StatusCode,
  131734. },
  131735. }
  131736. target := &ret
  131737. if err := gensupport.DecodeResponse(target, res); err != nil {
  131738. return nil, err
  131739. }
  131740. return ret, nil
  131741. // {
  131742. // "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.",
  131743. // "httpMethod": "PATCH",
  131744. // "id": "compute.subnetworks.patch",
  131745. // "parameterOrder": [
  131746. // "project",
  131747. // "region",
  131748. // "subnetwork"
  131749. // ],
  131750. // "parameters": {
  131751. // "drainTimeoutSeconds": {
  131752. // "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.",
  131753. // "format": "int32",
  131754. // "location": "query",
  131755. // "type": "integer"
  131756. // },
  131757. // "project": {
  131758. // "description": "Project ID for this request.",
  131759. // "location": "path",
  131760. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131761. // "required": true,
  131762. // "type": "string"
  131763. // },
  131764. // "region": {
  131765. // "description": "Name of the region scoping this request.",
  131766. // "location": "path",
  131767. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  131768. // "required": true,
  131769. // "type": "string"
  131770. // },
  131771. // "requestId": {
  131772. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  131773. // "location": "query",
  131774. // "type": "string"
  131775. // },
  131776. // "subnetwork": {
  131777. // "description": "Name of the Subnetwork resource to patch.",
  131778. // "location": "path",
  131779. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  131780. // "required": true,
  131781. // "type": "string"
  131782. // }
  131783. // },
  131784. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  131785. // "request": {
  131786. // "$ref": "Subnetwork"
  131787. // },
  131788. // "response": {
  131789. // "$ref": "Operation"
  131790. // },
  131791. // "scopes": [
  131792. // "https://www.googleapis.com/auth/cloud-platform",
  131793. // "https://www.googleapis.com/auth/compute"
  131794. // ]
  131795. // }
  131796. }
  131797. // method id "compute.subnetworks.setIamPolicy":
  131798. type SubnetworksSetIamPolicyCall struct {
  131799. s *Service
  131800. project string
  131801. region string
  131802. resource string
  131803. regionsetpolicyrequest *RegionSetPolicyRequest
  131804. urlParams_ gensupport.URLParams
  131805. ctx_ context.Context
  131806. header_ http.Header
  131807. }
  131808. // SetIamPolicy: Sets the access control policy on the specified
  131809. // resource. Replaces any existing policy.
  131810. func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
  131811. c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131812. c.project = project
  131813. c.region = region
  131814. c.resource = resource
  131815. c.regionsetpolicyrequest = regionsetpolicyrequest
  131816. return c
  131817. }
  131818. // Fields allows partial responses to be retrieved. See
  131819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131820. // for more information.
  131821. func (c *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
  131822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131823. return c
  131824. }
  131825. // Context sets the context to be used in this call's Do method. Any
  131826. // pending HTTP request will be aborted if the provided context is
  131827. // canceled.
  131828. func (c *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
  131829. c.ctx_ = ctx
  131830. return c
  131831. }
  131832. // Header returns an http.Header that can be modified by the caller to
  131833. // add HTTP headers to the request.
  131834. func (c *SubnetworksSetIamPolicyCall) Header() http.Header {
  131835. if c.header_ == nil {
  131836. c.header_ = make(http.Header)
  131837. }
  131838. return c.header_
  131839. }
  131840. func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  131841. reqHeaders := make(http.Header)
  131842. for k, v := range c.header_ {
  131843. reqHeaders[k] = v
  131844. }
  131845. reqHeaders.Set("User-Agent", c.s.userAgent())
  131846. var body io.Reader = nil
  131847. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  131848. if err != nil {
  131849. return nil, err
  131850. }
  131851. reqHeaders.Set("Content-Type", "application/json")
  131852. c.urlParams_.Set("alt", alt)
  131853. c.urlParams_.Set("prettyPrint", "false")
  131854. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
  131855. urls += "?" + c.urlParams_.Encode()
  131856. req, err := http.NewRequest("POST", urls, body)
  131857. if err != nil {
  131858. return nil, err
  131859. }
  131860. req.Header = reqHeaders
  131861. googleapi.Expand(req.URL, map[string]string{
  131862. "project": c.project,
  131863. "region": c.region,
  131864. "resource": c.resource,
  131865. })
  131866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131867. }
  131868. // Do executes the "compute.subnetworks.setIamPolicy" call.
  131869. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  131870. // code is an error. Response headers are in either
  131871. // *Policy.ServerResponse.Header or (if a response was returned at all)
  131872. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  131873. // check whether the returned error was because http.StatusNotModified
  131874. // was returned.
  131875. func (c *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  131876. gensupport.SetOptions(c.urlParams_, opts...)
  131877. res, err := c.doRequest("json")
  131878. if res != nil && res.StatusCode == http.StatusNotModified {
  131879. if res.Body != nil {
  131880. res.Body.Close()
  131881. }
  131882. return nil, &googleapi.Error{
  131883. Code: res.StatusCode,
  131884. Header: res.Header,
  131885. }
  131886. }
  131887. if err != nil {
  131888. return nil, err
  131889. }
  131890. defer googleapi.CloseBody(res)
  131891. if err := googleapi.CheckResponse(res); err != nil {
  131892. return nil, err
  131893. }
  131894. ret := &Policy{
  131895. ServerResponse: googleapi.ServerResponse{
  131896. Header: res.Header,
  131897. HTTPStatusCode: res.StatusCode,
  131898. },
  131899. }
  131900. target := &ret
  131901. if err := gensupport.DecodeResponse(target, res); err != nil {
  131902. return nil, err
  131903. }
  131904. return ret, nil
  131905. // {
  131906. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  131907. // "httpMethod": "POST",
  131908. // "id": "compute.subnetworks.setIamPolicy",
  131909. // "parameterOrder": [
  131910. // "project",
  131911. // "region",
  131912. // "resource"
  131913. // ],
  131914. // "parameters": {
  131915. // "project": {
  131916. // "description": "Project ID for this request.",
  131917. // "location": "path",
  131918. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131919. // "required": true,
  131920. // "type": "string"
  131921. // },
  131922. // "region": {
  131923. // "description": "The name of the region for this request.",
  131924. // "location": "path",
  131925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  131926. // "required": true,
  131927. // "type": "string"
  131928. // },
  131929. // "resource": {
  131930. // "description": "Name or id of the resource for this request.",
  131931. // "location": "path",
  131932. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  131933. // "required": true,
  131934. // "type": "string"
  131935. // }
  131936. // },
  131937. // "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
  131938. // "request": {
  131939. // "$ref": "RegionSetPolicyRequest"
  131940. // },
  131941. // "response": {
  131942. // "$ref": "Policy"
  131943. // },
  131944. // "scopes": [
  131945. // "https://www.googleapis.com/auth/cloud-platform",
  131946. // "https://www.googleapis.com/auth/compute"
  131947. // ]
  131948. // }
  131949. }
  131950. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  131951. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  131952. s *Service
  131953. project string
  131954. region string
  131955. subnetwork string
  131956. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  131957. urlParams_ gensupport.URLParams
  131958. ctx_ context.Context
  131959. header_ http.Header
  131960. }
  131961. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  131962. // Google services without assigning external IP addresses through
  131963. // Private Google Access.
  131964. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  131965. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131966. c.project = project
  131967. c.region = region
  131968. c.subnetwork = subnetwork
  131969. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  131970. return c
  131971. }
  131972. // RequestId sets the optional parameter "requestId": An optional
  131973. // request ID to identify requests. Specify a unique request ID so that
  131974. // if you must retry your request, the server will know to ignore the
  131975. // request if it has already been completed.
  131976. //
  131977. // For example, consider a situation where you make an initial request
  131978. // and the request times out. If you make the request again with the
  131979. // same request ID, the server can check if original operation with the
  131980. // same request ID was received, and if so, will ignore the second
  131981. // request. This prevents clients from accidentally creating duplicate
  131982. // commitments.
  131983. //
  131984. // The request ID must be a valid UUID with the exception that zero UUID
  131985. // is not supported (00000000-0000-0000-0000-000000000000).
  131986. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  131987. c.urlParams_.Set("requestId", requestId)
  131988. return c
  131989. }
  131990. // Fields allows partial responses to be retrieved. See
  131991. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131992. // for more information.
  131993. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  131994. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131995. return c
  131996. }
  131997. // Context sets the context to be used in this call's Do method. Any
  131998. // pending HTTP request will be aborted if the provided context is
  131999. // canceled.
  132000. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  132001. c.ctx_ = ctx
  132002. return c
  132003. }
  132004. // Header returns an http.Header that can be modified by the caller to
  132005. // add HTTP headers to the request.
  132006. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  132007. if c.header_ == nil {
  132008. c.header_ = make(http.Header)
  132009. }
  132010. return c.header_
  132011. }
  132012. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  132013. reqHeaders := make(http.Header)
  132014. for k, v := range c.header_ {
  132015. reqHeaders[k] = v
  132016. }
  132017. reqHeaders.Set("User-Agent", c.s.userAgent())
  132018. var body io.Reader = nil
  132019. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  132020. if err != nil {
  132021. return nil, err
  132022. }
  132023. reqHeaders.Set("Content-Type", "application/json")
  132024. c.urlParams_.Set("alt", alt)
  132025. c.urlParams_.Set("prettyPrint", "false")
  132026. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  132027. urls += "?" + c.urlParams_.Encode()
  132028. req, err := http.NewRequest("POST", urls, body)
  132029. if err != nil {
  132030. return nil, err
  132031. }
  132032. req.Header = reqHeaders
  132033. googleapi.Expand(req.URL, map[string]string{
  132034. "project": c.project,
  132035. "region": c.region,
  132036. "subnetwork": c.subnetwork,
  132037. })
  132038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132039. }
  132040. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  132041. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  132042. // status code is an error. Response headers are in either
  132043. // *Operation.ServerResponse.Header or (if a response was returned at
  132044. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  132045. // to check whether the returned error was because
  132046. // http.StatusNotModified was returned.
  132047. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  132048. gensupport.SetOptions(c.urlParams_, opts...)
  132049. res, err := c.doRequest("json")
  132050. if res != nil && res.StatusCode == http.StatusNotModified {
  132051. if res.Body != nil {
  132052. res.Body.Close()
  132053. }
  132054. return nil, &googleapi.Error{
  132055. Code: res.StatusCode,
  132056. Header: res.Header,
  132057. }
  132058. }
  132059. if err != nil {
  132060. return nil, err
  132061. }
  132062. defer googleapi.CloseBody(res)
  132063. if err := googleapi.CheckResponse(res); err != nil {
  132064. return nil, err
  132065. }
  132066. ret := &Operation{
  132067. ServerResponse: googleapi.ServerResponse{
  132068. Header: res.Header,
  132069. HTTPStatusCode: res.StatusCode,
  132070. },
  132071. }
  132072. target := &ret
  132073. if err := gensupport.DecodeResponse(target, res); err != nil {
  132074. return nil, err
  132075. }
  132076. return ret, nil
  132077. // {
  132078. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  132079. // "httpMethod": "POST",
  132080. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  132081. // "parameterOrder": [
  132082. // "project",
  132083. // "region",
  132084. // "subnetwork"
  132085. // ],
  132086. // "parameters": {
  132087. // "project": {
  132088. // "description": "Project ID for this request.",
  132089. // "location": "path",
  132090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132091. // "required": true,
  132092. // "type": "string"
  132093. // },
  132094. // "region": {
  132095. // "description": "Name of the region scoping this request.",
  132096. // "location": "path",
  132097. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  132098. // "required": true,
  132099. // "type": "string"
  132100. // },
  132101. // "requestId": {
  132102. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  132103. // "location": "query",
  132104. // "type": "string"
  132105. // },
  132106. // "subnetwork": {
  132107. // "description": "Name of the Subnetwork resource.",
  132108. // "location": "path",
  132109. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  132110. // "required": true,
  132111. // "type": "string"
  132112. // }
  132113. // },
  132114. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  132115. // "request": {
  132116. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  132117. // },
  132118. // "response": {
  132119. // "$ref": "Operation"
  132120. // },
  132121. // "scopes": [
  132122. // "https://www.googleapis.com/auth/cloud-platform",
  132123. // "https://www.googleapis.com/auth/compute"
  132124. // ]
  132125. // }
  132126. }
  132127. // method id "compute.subnetworks.testIamPermissions":
  132128. type SubnetworksTestIamPermissionsCall struct {
  132129. s *Service
  132130. project string
  132131. region string
  132132. resource string
  132133. testpermissionsrequest *TestPermissionsRequest
  132134. urlParams_ gensupport.URLParams
  132135. ctx_ context.Context
  132136. header_ http.Header
  132137. }
  132138. // TestIamPermissions: Returns permissions that a caller has on the
  132139. // specified resource.
  132140. func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
  132141. c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132142. c.project = project
  132143. c.region = region
  132144. c.resource = resource
  132145. c.testpermissionsrequest = testpermissionsrequest
  132146. return c
  132147. }
  132148. // Fields allows partial responses to be retrieved. See
  132149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132150. // for more information.
  132151. func (c *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
  132152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132153. return c
  132154. }
  132155. // Context sets the context to be used in this call's Do method. Any
  132156. // pending HTTP request will be aborted if the provided context is
  132157. // canceled.
  132158. func (c *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
  132159. c.ctx_ = ctx
  132160. return c
  132161. }
  132162. // Header returns an http.Header that can be modified by the caller to
  132163. // add HTTP headers to the request.
  132164. func (c *SubnetworksTestIamPermissionsCall) Header() http.Header {
  132165. if c.header_ == nil {
  132166. c.header_ = make(http.Header)
  132167. }
  132168. return c.header_
  132169. }
  132170. func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  132171. reqHeaders := make(http.Header)
  132172. for k, v := range c.header_ {
  132173. reqHeaders[k] = v
  132174. }
  132175. reqHeaders.Set("User-Agent", c.s.userAgent())
  132176. var body io.Reader = nil
  132177. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  132178. if err != nil {
  132179. return nil, err
  132180. }
  132181. reqHeaders.Set("Content-Type", "application/json")
  132182. c.urlParams_.Set("alt", alt)
  132183. c.urlParams_.Set("prettyPrint", "false")
  132184. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
  132185. urls += "?" + c.urlParams_.Encode()
  132186. req, err := http.NewRequest("POST", urls, body)
  132187. if err != nil {
  132188. return nil, err
  132189. }
  132190. req.Header = reqHeaders
  132191. googleapi.Expand(req.URL, map[string]string{
  132192. "project": c.project,
  132193. "region": c.region,
  132194. "resource": c.resource,
  132195. })
  132196. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132197. }
  132198. // Do executes the "compute.subnetworks.testIamPermissions" call.
  132199. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  132200. // non-2xx status code is an error. Response headers are in either
  132201. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  132202. // returned at all) in error.(*googleapi.Error).Header. Use
  132203. // googleapi.IsNotModified to check whether the returned error was
  132204. // because http.StatusNotModified was returned.
  132205. func (c *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  132206. gensupport.SetOptions(c.urlParams_, opts...)
  132207. res, err := c.doRequest("json")
  132208. if res != nil && res.StatusCode == http.StatusNotModified {
  132209. if res.Body != nil {
  132210. res.Body.Close()
  132211. }
  132212. return nil, &googleapi.Error{
  132213. Code: res.StatusCode,
  132214. Header: res.Header,
  132215. }
  132216. }
  132217. if err != nil {
  132218. return nil, err
  132219. }
  132220. defer googleapi.CloseBody(res)
  132221. if err := googleapi.CheckResponse(res); err != nil {
  132222. return nil, err
  132223. }
  132224. ret := &TestPermissionsResponse{
  132225. ServerResponse: googleapi.ServerResponse{
  132226. Header: res.Header,
  132227. HTTPStatusCode: res.StatusCode,
  132228. },
  132229. }
  132230. target := &ret
  132231. if err := gensupport.DecodeResponse(target, res); err != nil {
  132232. return nil, err
  132233. }
  132234. return ret, nil
  132235. // {
  132236. // "description": "Returns permissions that a caller has on the specified resource.",
  132237. // "httpMethod": "POST",
  132238. // "id": "compute.subnetworks.testIamPermissions",
  132239. // "parameterOrder": [
  132240. // "project",
  132241. // "region",
  132242. // "resource"
  132243. // ],
  132244. // "parameters": {
  132245. // "project": {
  132246. // "description": "Project ID for this request.",
  132247. // "location": "path",
  132248. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132249. // "required": true,
  132250. // "type": "string"
  132251. // },
  132252. // "region": {
  132253. // "description": "The name of the region for this request.",
  132254. // "location": "path",
  132255. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  132256. // "required": true,
  132257. // "type": "string"
  132258. // },
  132259. // "resource": {
  132260. // "description": "Name or id of the resource for this request.",
  132261. // "location": "path",
  132262. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  132263. // "required": true,
  132264. // "type": "string"
  132265. // }
  132266. // },
  132267. // "path": "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
  132268. // "request": {
  132269. // "$ref": "TestPermissionsRequest"
  132270. // },
  132271. // "response": {
  132272. // "$ref": "TestPermissionsResponse"
  132273. // },
  132274. // "scopes": [
  132275. // "https://www.googleapis.com/auth/cloud-platform",
  132276. // "https://www.googleapis.com/auth/compute",
  132277. // "https://www.googleapis.com/auth/compute.readonly"
  132278. // ]
  132279. // }
  132280. }
  132281. // method id "compute.targetHttpProxies.aggregatedList":
  132282. type TargetHttpProxiesAggregatedListCall struct {
  132283. s *Service
  132284. project string
  132285. urlParams_ gensupport.URLParams
  132286. ifNoneMatch_ string
  132287. ctx_ context.Context
  132288. header_ http.Header
  132289. }
  132290. // AggregatedList: Retrieves the list of all TargetHttpProxy resources,
  132291. // regional and global, available to the specified project.
  132292. func (r *TargetHttpProxiesService) AggregatedList(project string) *TargetHttpProxiesAggregatedListCall {
  132293. c := &TargetHttpProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132294. c.project = project
  132295. return c
  132296. }
  132297. // Filter sets the optional parameter "filter": A filter expression that
  132298. // filters resources listed in the response. The expression must specify
  132299. // the field name, a comparison operator, and the value that you want to
  132300. // use for filtering. The value must be a string, a number, or a
  132301. // boolean. The comparison operator must be either =, !=, >, or <.
  132302. //
  132303. // For example, if you are filtering Compute Engine instances, you can
  132304. // exclude instances named example-instance by specifying name !=
  132305. // example-instance.
  132306. //
  132307. // You can also filter nested fields. For example, you could specify
  132308. // scheduling.automaticRestart = false to include instances only if they
  132309. // are not scheduled for automatic restarts. You can use filtering on
  132310. // nested fields to filter based on resource labels.
  132311. //
  132312. // To filter on multiple expressions, provide each separate expression
  132313. // within parentheses. For example, (scheduling.automaticRestart = true)
  132314. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  132315. // AND expression. However, you can include AND and OR expressions
  132316. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  132317. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  132318. // true).
  132319. func (c *TargetHttpProxiesAggregatedListCall) Filter(filter string) *TargetHttpProxiesAggregatedListCall {
  132320. c.urlParams_.Set("filter", filter)
  132321. return c
  132322. }
  132323. // MaxResults sets the optional parameter "maxResults": The maximum
  132324. // number of results per page that should be returned. If the number of
  132325. // available results is larger than maxResults, Compute Engine returns a
  132326. // nextPageToken that can be used to get the next page of results in
  132327. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  132328. // (Default: 500)
  132329. func (c *TargetHttpProxiesAggregatedListCall) MaxResults(maxResults int64) *TargetHttpProxiesAggregatedListCall {
  132330. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  132331. return c
  132332. }
  132333. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  132334. // a certain order. By default, results are returned in alphanumerical
  132335. // order based on the resource name.
  132336. //
  132337. // You can also sort results in descending order based on the creation
  132338. // timestamp using orderBy="creationTimestamp desc". This sorts results
  132339. // based on the creationTimestamp field in reverse chronological order
  132340. // (newest result first). Use this to sort resources like operations so
  132341. // that the newest operation is returned first.
  132342. //
  132343. // Currently, only sorting by name or creationTimestamp desc is
  132344. // supported.
  132345. func (c *TargetHttpProxiesAggregatedListCall) OrderBy(orderBy string) *TargetHttpProxiesAggregatedListCall {
  132346. c.urlParams_.Set("orderBy", orderBy)
  132347. return c
  132348. }
  132349. // PageToken sets the optional parameter "pageToken": Specifies a page
  132350. // token to use. Set pageToken to the nextPageToken returned by a
  132351. // previous list request to get the next page of results.
  132352. func (c *TargetHttpProxiesAggregatedListCall) PageToken(pageToken string) *TargetHttpProxiesAggregatedListCall {
  132353. c.urlParams_.Set("pageToken", pageToken)
  132354. return c
  132355. }
  132356. // Fields allows partial responses to be retrieved. See
  132357. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132358. // for more information.
  132359. func (c *TargetHttpProxiesAggregatedListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesAggregatedListCall {
  132360. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132361. return c
  132362. }
  132363. // IfNoneMatch sets the optional parameter which makes the operation
  132364. // fail if the object's ETag matches the given value. This is useful for
  132365. // getting updates only after the object has changed since the last
  132366. // request. Use googleapi.IsNotModified to check whether the response
  132367. // error from Do is the result of In-None-Match.
  132368. func (c *TargetHttpProxiesAggregatedListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesAggregatedListCall {
  132369. c.ifNoneMatch_ = entityTag
  132370. return c
  132371. }
  132372. // Context sets the context to be used in this call's Do method. Any
  132373. // pending HTTP request will be aborted if the provided context is
  132374. // canceled.
  132375. func (c *TargetHttpProxiesAggregatedListCall) Context(ctx context.Context) *TargetHttpProxiesAggregatedListCall {
  132376. c.ctx_ = ctx
  132377. return c
  132378. }
  132379. // Header returns an http.Header that can be modified by the caller to
  132380. // add HTTP headers to the request.
  132381. func (c *TargetHttpProxiesAggregatedListCall) Header() http.Header {
  132382. if c.header_ == nil {
  132383. c.header_ = make(http.Header)
  132384. }
  132385. return c.header_
  132386. }
  132387. func (c *TargetHttpProxiesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  132388. reqHeaders := make(http.Header)
  132389. for k, v := range c.header_ {
  132390. reqHeaders[k] = v
  132391. }
  132392. reqHeaders.Set("User-Agent", c.s.userAgent())
  132393. if c.ifNoneMatch_ != "" {
  132394. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  132395. }
  132396. var body io.Reader = nil
  132397. c.urlParams_.Set("alt", alt)
  132398. c.urlParams_.Set("prettyPrint", "false")
  132399. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetHttpProxies")
  132400. urls += "?" + c.urlParams_.Encode()
  132401. req, err := http.NewRequest("GET", urls, body)
  132402. if err != nil {
  132403. return nil, err
  132404. }
  132405. req.Header = reqHeaders
  132406. googleapi.Expand(req.URL, map[string]string{
  132407. "project": c.project,
  132408. })
  132409. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132410. }
  132411. // Do executes the "compute.targetHttpProxies.aggregatedList" call.
  132412. // Exactly one of *TargetHttpProxyAggregatedList or error will be
  132413. // non-nil. Any non-2xx status code is an error. Response headers are in
  132414. // either *TargetHttpProxyAggregatedList.ServerResponse.Header or (if a
  132415. // response was returned at all) in error.(*googleapi.Error).Header. Use
  132416. // googleapi.IsNotModified to check whether the returned error was
  132417. // because http.StatusNotModified was returned.
  132418. func (c *TargetHttpProxiesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyAggregatedList, error) {
  132419. gensupport.SetOptions(c.urlParams_, opts...)
  132420. res, err := c.doRequest("json")
  132421. if res != nil && res.StatusCode == http.StatusNotModified {
  132422. if res.Body != nil {
  132423. res.Body.Close()
  132424. }
  132425. return nil, &googleapi.Error{
  132426. Code: res.StatusCode,
  132427. Header: res.Header,
  132428. }
  132429. }
  132430. if err != nil {
  132431. return nil, err
  132432. }
  132433. defer googleapi.CloseBody(res)
  132434. if err := googleapi.CheckResponse(res); err != nil {
  132435. return nil, err
  132436. }
  132437. ret := &TargetHttpProxyAggregatedList{
  132438. ServerResponse: googleapi.ServerResponse{
  132439. Header: res.Header,
  132440. HTTPStatusCode: res.StatusCode,
  132441. },
  132442. }
  132443. target := &ret
  132444. if err := gensupport.DecodeResponse(target, res); err != nil {
  132445. return nil, err
  132446. }
  132447. return ret, nil
  132448. // {
  132449. // "description": "Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project.",
  132450. // "httpMethod": "GET",
  132451. // "id": "compute.targetHttpProxies.aggregatedList",
  132452. // "parameterOrder": [
  132453. // "project"
  132454. // ],
  132455. // "parameters": {
  132456. // "filter": {
  132457. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  132458. // "location": "query",
  132459. // "type": "string"
  132460. // },
  132461. // "maxResults": {
  132462. // "default": "500",
  132463. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  132464. // "format": "uint32",
  132465. // "location": "query",
  132466. // "minimum": "0",
  132467. // "type": "integer"
  132468. // },
  132469. // "orderBy": {
  132470. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  132471. // "location": "query",
  132472. // "type": "string"
  132473. // },
  132474. // "pageToken": {
  132475. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  132476. // "location": "query",
  132477. // "type": "string"
  132478. // },
  132479. // "project": {
  132480. // "description": "Name of the project scoping this request.",
  132481. // "location": "path",
  132482. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132483. // "required": true,
  132484. // "type": "string"
  132485. // }
  132486. // },
  132487. // "path": "{project}/aggregated/targetHttpProxies",
  132488. // "response": {
  132489. // "$ref": "TargetHttpProxyAggregatedList"
  132490. // },
  132491. // "scopes": [
  132492. // "https://www.googleapis.com/auth/cloud-platform",
  132493. // "https://www.googleapis.com/auth/compute",
  132494. // "https://www.googleapis.com/auth/compute.readonly"
  132495. // ]
  132496. // }
  132497. }
  132498. // Pages invokes f for each page of results.
  132499. // A non-nil error returned from f will halt the iteration.
  132500. // The provided context supersedes any context provided to the Context method.
  132501. func (c *TargetHttpProxiesAggregatedListCall) Pages(ctx context.Context, f func(*TargetHttpProxyAggregatedList) error) error {
  132502. c.ctx_ = ctx
  132503. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  132504. for {
  132505. x, err := c.Do()
  132506. if err != nil {
  132507. return err
  132508. }
  132509. if err := f(x); err != nil {
  132510. return err
  132511. }
  132512. if x.NextPageToken == "" {
  132513. return nil
  132514. }
  132515. c.PageToken(x.NextPageToken)
  132516. }
  132517. }
  132518. // method id "compute.targetHttpProxies.delete":
  132519. type TargetHttpProxiesDeleteCall struct {
  132520. s *Service
  132521. project string
  132522. targetHttpProxy string
  132523. urlParams_ gensupport.URLParams
  132524. ctx_ context.Context
  132525. header_ http.Header
  132526. }
  132527. // Delete: Deletes the specified TargetHttpProxy resource.
  132528. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  132529. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  132530. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132531. c.project = project
  132532. c.targetHttpProxy = targetHttpProxy
  132533. return c
  132534. }
  132535. // RequestId sets the optional parameter "requestId": An optional
  132536. // request ID to identify requests. Specify a unique request ID so that
  132537. // if you must retry your request, the server will know to ignore the
  132538. // request if it has already been completed.
  132539. //
  132540. // For example, consider a situation where you make an initial request
  132541. // and the request times out. If you make the request again with the
  132542. // same request ID, the server can check if original operation with the
  132543. // same request ID was received, and if so, will ignore the second
  132544. // request. This prevents clients from accidentally creating duplicate
  132545. // commitments.
  132546. //
  132547. // The request ID must be a valid UUID with the exception that zero UUID
  132548. // is not supported (00000000-0000-0000-0000-000000000000).
  132549. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  132550. c.urlParams_.Set("requestId", requestId)
  132551. return c
  132552. }
  132553. // Fields allows partial responses to be retrieved. See
  132554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132555. // for more information.
  132556. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  132557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132558. return c
  132559. }
  132560. // Context sets the context to be used in this call's Do method. Any
  132561. // pending HTTP request will be aborted if the provided context is
  132562. // canceled.
  132563. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  132564. c.ctx_ = ctx
  132565. return c
  132566. }
  132567. // Header returns an http.Header that can be modified by the caller to
  132568. // add HTTP headers to the request.
  132569. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  132570. if c.header_ == nil {
  132571. c.header_ = make(http.Header)
  132572. }
  132573. return c.header_
  132574. }
  132575. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  132576. reqHeaders := make(http.Header)
  132577. for k, v := range c.header_ {
  132578. reqHeaders[k] = v
  132579. }
  132580. reqHeaders.Set("User-Agent", c.s.userAgent())
  132581. var body io.Reader = nil
  132582. c.urlParams_.Set("alt", alt)
  132583. c.urlParams_.Set("prettyPrint", "false")
  132584. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  132585. urls += "?" + c.urlParams_.Encode()
  132586. req, err := http.NewRequest("DELETE", urls, body)
  132587. if err != nil {
  132588. return nil, err
  132589. }
  132590. req.Header = reqHeaders
  132591. googleapi.Expand(req.URL, map[string]string{
  132592. "project": c.project,
  132593. "targetHttpProxy": c.targetHttpProxy,
  132594. })
  132595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132596. }
  132597. // Do executes the "compute.targetHttpProxies.delete" call.
  132598. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  132599. // status code is an error. Response headers are in either
  132600. // *Operation.ServerResponse.Header or (if a response was returned at
  132601. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  132602. // to check whether the returned error was because
  132603. // http.StatusNotModified was returned.
  132604. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  132605. gensupport.SetOptions(c.urlParams_, opts...)
  132606. res, err := c.doRequest("json")
  132607. if res != nil && res.StatusCode == http.StatusNotModified {
  132608. if res.Body != nil {
  132609. res.Body.Close()
  132610. }
  132611. return nil, &googleapi.Error{
  132612. Code: res.StatusCode,
  132613. Header: res.Header,
  132614. }
  132615. }
  132616. if err != nil {
  132617. return nil, err
  132618. }
  132619. defer googleapi.CloseBody(res)
  132620. if err := googleapi.CheckResponse(res); err != nil {
  132621. return nil, err
  132622. }
  132623. ret := &Operation{
  132624. ServerResponse: googleapi.ServerResponse{
  132625. Header: res.Header,
  132626. HTTPStatusCode: res.StatusCode,
  132627. },
  132628. }
  132629. target := &ret
  132630. if err := gensupport.DecodeResponse(target, res); err != nil {
  132631. return nil, err
  132632. }
  132633. return ret, nil
  132634. // {
  132635. // "description": "Deletes the specified TargetHttpProxy resource.",
  132636. // "httpMethod": "DELETE",
  132637. // "id": "compute.targetHttpProxies.delete",
  132638. // "parameterOrder": [
  132639. // "project",
  132640. // "targetHttpProxy"
  132641. // ],
  132642. // "parameters": {
  132643. // "project": {
  132644. // "description": "Project ID for this request.",
  132645. // "location": "path",
  132646. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132647. // "required": true,
  132648. // "type": "string"
  132649. // },
  132650. // "requestId": {
  132651. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  132652. // "location": "query",
  132653. // "type": "string"
  132654. // },
  132655. // "targetHttpProxy": {
  132656. // "description": "Name of the TargetHttpProxy resource to delete.",
  132657. // "location": "path",
  132658. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  132659. // "required": true,
  132660. // "type": "string"
  132661. // }
  132662. // },
  132663. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  132664. // "response": {
  132665. // "$ref": "Operation"
  132666. // },
  132667. // "scopes": [
  132668. // "https://www.googleapis.com/auth/cloud-platform",
  132669. // "https://www.googleapis.com/auth/compute"
  132670. // ]
  132671. // }
  132672. }
  132673. // method id "compute.targetHttpProxies.get":
  132674. type TargetHttpProxiesGetCall struct {
  132675. s *Service
  132676. project string
  132677. targetHttpProxy string
  132678. urlParams_ gensupport.URLParams
  132679. ifNoneMatch_ string
  132680. ctx_ context.Context
  132681. header_ http.Header
  132682. }
  132683. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  132684. // available target HTTP proxies by making a list() request.
  132685. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  132686. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  132687. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132688. c.project = project
  132689. c.targetHttpProxy = targetHttpProxy
  132690. return c
  132691. }
  132692. // Fields allows partial responses to be retrieved. See
  132693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132694. // for more information.
  132695. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  132696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132697. return c
  132698. }
  132699. // IfNoneMatch sets the optional parameter which makes the operation
  132700. // fail if the object's ETag matches the given value. This is useful for
  132701. // getting updates only after the object has changed since the last
  132702. // request. Use googleapi.IsNotModified to check whether the response
  132703. // error from Do is the result of In-None-Match.
  132704. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  132705. c.ifNoneMatch_ = entityTag
  132706. return c
  132707. }
  132708. // Context sets the context to be used in this call's Do method. Any
  132709. // pending HTTP request will be aborted if the provided context is
  132710. // canceled.
  132711. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  132712. c.ctx_ = ctx
  132713. return c
  132714. }
  132715. // Header returns an http.Header that can be modified by the caller to
  132716. // add HTTP headers to the request.
  132717. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  132718. if c.header_ == nil {
  132719. c.header_ = make(http.Header)
  132720. }
  132721. return c.header_
  132722. }
  132723. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  132724. reqHeaders := make(http.Header)
  132725. for k, v := range c.header_ {
  132726. reqHeaders[k] = v
  132727. }
  132728. reqHeaders.Set("User-Agent", c.s.userAgent())
  132729. if c.ifNoneMatch_ != "" {
  132730. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  132731. }
  132732. var body io.Reader = nil
  132733. c.urlParams_.Set("alt", alt)
  132734. c.urlParams_.Set("prettyPrint", "false")
  132735. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  132736. urls += "?" + c.urlParams_.Encode()
  132737. req, err := http.NewRequest("GET", urls, body)
  132738. if err != nil {
  132739. return nil, err
  132740. }
  132741. req.Header = reqHeaders
  132742. googleapi.Expand(req.URL, map[string]string{
  132743. "project": c.project,
  132744. "targetHttpProxy": c.targetHttpProxy,
  132745. })
  132746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132747. }
  132748. // Do executes the "compute.targetHttpProxies.get" call.
  132749. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  132750. // status code is an error. Response headers are in either
  132751. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  132752. // at all) in error.(*googleapi.Error).Header. Use
  132753. // googleapi.IsNotModified to check whether the returned error was
  132754. // because http.StatusNotModified was returned.
  132755. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  132756. gensupport.SetOptions(c.urlParams_, opts...)
  132757. res, err := c.doRequest("json")
  132758. if res != nil && res.StatusCode == http.StatusNotModified {
  132759. if res.Body != nil {
  132760. res.Body.Close()
  132761. }
  132762. return nil, &googleapi.Error{
  132763. Code: res.StatusCode,
  132764. Header: res.Header,
  132765. }
  132766. }
  132767. if err != nil {
  132768. return nil, err
  132769. }
  132770. defer googleapi.CloseBody(res)
  132771. if err := googleapi.CheckResponse(res); err != nil {
  132772. return nil, err
  132773. }
  132774. ret := &TargetHttpProxy{
  132775. ServerResponse: googleapi.ServerResponse{
  132776. Header: res.Header,
  132777. HTTPStatusCode: res.StatusCode,
  132778. },
  132779. }
  132780. target := &ret
  132781. if err := gensupport.DecodeResponse(target, res); err != nil {
  132782. return nil, err
  132783. }
  132784. return ret, nil
  132785. // {
  132786. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  132787. // "httpMethod": "GET",
  132788. // "id": "compute.targetHttpProxies.get",
  132789. // "parameterOrder": [
  132790. // "project",
  132791. // "targetHttpProxy"
  132792. // ],
  132793. // "parameters": {
  132794. // "project": {
  132795. // "description": "Project ID for this request.",
  132796. // "location": "path",
  132797. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132798. // "required": true,
  132799. // "type": "string"
  132800. // },
  132801. // "targetHttpProxy": {
  132802. // "description": "Name of the TargetHttpProxy resource to return.",
  132803. // "location": "path",
  132804. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  132805. // "required": true,
  132806. // "type": "string"
  132807. // }
  132808. // },
  132809. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  132810. // "response": {
  132811. // "$ref": "TargetHttpProxy"
  132812. // },
  132813. // "scopes": [
  132814. // "https://www.googleapis.com/auth/cloud-platform",
  132815. // "https://www.googleapis.com/auth/compute",
  132816. // "https://www.googleapis.com/auth/compute.readonly"
  132817. // ]
  132818. // }
  132819. }
  132820. // method id "compute.targetHttpProxies.insert":
  132821. type TargetHttpProxiesInsertCall struct {
  132822. s *Service
  132823. project string
  132824. targethttpproxy *TargetHttpProxy
  132825. urlParams_ gensupport.URLParams
  132826. ctx_ context.Context
  132827. header_ http.Header
  132828. }
  132829. // Insert: Creates a TargetHttpProxy resource in the specified project
  132830. // using the data included in the request.
  132831. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  132832. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  132833. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132834. c.project = project
  132835. c.targethttpproxy = targethttpproxy
  132836. return c
  132837. }
  132838. // RequestId sets the optional parameter "requestId": An optional
  132839. // request ID to identify requests. Specify a unique request ID so that
  132840. // if you must retry your request, the server will know to ignore the
  132841. // request if it has already been completed.
  132842. //
  132843. // For example, consider a situation where you make an initial request
  132844. // and the request times out. If you make the request again with the
  132845. // same request ID, the server can check if original operation with the
  132846. // same request ID was received, and if so, will ignore the second
  132847. // request. This prevents clients from accidentally creating duplicate
  132848. // commitments.
  132849. //
  132850. // The request ID must be a valid UUID with the exception that zero UUID
  132851. // is not supported (00000000-0000-0000-0000-000000000000).
  132852. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  132853. c.urlParams_.Set("requestId", requestId)
  132854. return c
  132855. }
  132856. // Fields allows partial responses to be retrieved. See
  132857. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132858. // for more information.
  132859. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  132860. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132861. return c
  132862. }
  132863. // Context sets the context to be used in this call's Do method. Any
  132864. // pending HTTP request will be aborted if the provided context is
  132865. // canceled.
  132866. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  132867. c.ctx_ = ctx
  132868. return c
  132869. }
  132870. // Header returns an http.Header that can be modified by the caller to
  132871. // add HTTP headers to the request.
  132872. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  132873. if c.header_ == nil {
  132874. c.header_ = make(http.Header)
  132875. }
  132876. return c.header_
  132877. }
  132878. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  132879. reqHeaders := make(http.Header)
  132880. for k, v := range c.header_ {
  132881. reqHeaders[k] = v
  132882. }
  132883. reqHeaders.Set("User-Agent", c.s.userAgent())
  132884. var body io.Reader = nil
  132885. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  132886. if err != nil {
  132887. return nil, err
  132888. }
  132889. reqHeaders.Set("Content-Type", "application/json")
  132890. c.urlParams_.Set("alt", alt)
  132891. c.urlParams_.Set("prettyPrint", "false")
  132892. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  132893. urls += "?" + c.urlParams_.Encode()
  132894. req, err := http.NewRequest("POST", urls, body)
  132895. if err != nil {
  132896. return nil, err
  132897. }
  132898. req.Header = reqHeaders
  132899. googleapi.Expand(req.URL, map[string]string{
  132900. "project": c.project,
  132901. })
  132902. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132903. }
  132904. // Do executes the "compute.targetHttpProxies.insert" call.
  132905. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  132906. // status code is an error. Response headers are in either
  132907. // *Operation.ServerResponse.Header or (if a response was returned at
  132908. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  132909. // to check whether the returned error was because
  132910. // http.StatusNotModified was returned.
  132911. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  132912. gensupport.SetOptions(c.urlParams_, opts...)
  132913. res, err := c.doRequest("json")
  132914. if res != nil && res.StatusCode == http.StatusNotModified {
  132915. if res.Body != nil {
  132916. res.Body.Close()
  132917. }
  132918. return nil, &googleapi.Error{
  132919. Code: res.StatusCode,
  132920. Header: res.Header,
  132921. }
  132922. }
  132923. if err != nil {
  132924. return nil, err
  132925. }
  132926. defer googleapi.CloseBody(res)
  132927. if err := googleapi.CheckResponse(res); err != nil {
  132928. return nil, err
  132929. }
  132930. ret := &Operation{
  132931. ServerResponse: googleapi.ServerResponse{
  132932. Header: res.Header,
  132933. HTTPStatusCode: res.StatusCode,
  132934. },
  132935. }
  132936. target := &ret
  132937. if err := gensupport.DecodeResponse(target, res); err != nil {
  132938. return nil, err
  132939. }
  132940. return ret, nil
  132941. // {
  132942. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  132943. // "httpMethod": "POST",
  132944. // "id": "compute.targetHttpProxies.insert",
  132945. // "parameterOrder": [
  132946. // "project"
  132947. // ],
  132948. // "parameters": {
  132949. // "project": {
  132950. // "description": "Project ID for this request.",
  132951. // "location": "path",
  132952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132953. // "required": true,
  132954. // "type": "string"
  132955. // },
  132956. // "requestId": {
  132957. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  132958. // "location": "query",
  132959. // "type": "string"
  132960. // }
  132961. // },
  132962. // "path": "{project}/global/targetHttpProxies",
  132963. // "request": {
  132964. // "$ref": "TargetHttpProxy"
  132965. // },
  132966. // "response": {
  132967. // "$ref": "Operation"
  132968. // },
  132969. // "scopes": [
  132970. // "https://www.googleapis.com/auth/cloud-platform",
  132971. // "https://www.googleapis.com/auth/compute"
  132972. // ]
  132973. // }
  132974. }
  132975. // method id "compute.targetHttpProxies.list":
  132976. type TargetHttpProxiesListCall struct {
  132977. s *Service
  132978. project string
  132979. urlParams_ gensupport.URLParams
  132980. ifNoneMatch_ string
  132981. ctx_ context.Context
  132982. header_ http.Header
  132983. }
  132984. // List: Retrieves the list of TargetHttpProxy resources available to
  132985. // the specified project.
  132986. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  132987. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  132988. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132989. c.project = project
  132990. return c
  132991. }
  132992. // Filter sets the optional parameter "filter": A filter expression that
  132993. // filters resources listed in the response. The expression must specify
  132994. // the field name, a comparison operator, and the value that you want to
  132995. // use for filtering. The value must be a string, a number, or a
  132996. // boolean. The comparison operator must be either =, !=, >, or <.
  132997. //
  132998. // For example, if you are filtering Compute Engine instances, you can
  132999. // exclude instances named example-instance by specifying name !=
  133000. // example-instance.
  133001. //
  133002. // You can also filter nested fields. For example, you could specify
  133003. // scheduling.automaticRestart = false to include instances only if they
  133004. // are not scheduled for automatic restarts. You can use filtering on
  133005. // nested fields to filter based on resource labels.
  133006. //
  133007. // To filter on multiple expressions, provide each separate expression
  133008. // within parentheses. For example, (scheduling.automaticRestart = true)
  133009. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  133010. // AND expression. However, you can include AND and OR expressions
  133011. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  133012. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  133013. // true).
  133014. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  133015. c.urlParams_.Set("filter", filter)
  133016. return c
  133017. }
  133018. // MaxResults sets the optional parameter "maxResults": The maximum
  133019. // number of results per page that should be returned. If the number of
  133020. // available results is larger than maxResults, Compute Engine returns a
  133021. // nextPageToken that can be used to get the next page of results in
  133022. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  133023. // (Default: 500)
  133024. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  133025. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  133026. return c
  133027. }
  133028. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  133029. // a certain order. By default, results are returned in alphanumerical
  133030. // order based on the resource name.
  133031. //
  133032. // You can also sort results in descending order based on the creation
  133033. // timestamp using orderBy="creationTimestamp desc". This sorts results
  133034. // based on the creationTimestamp field in reverse chronological order
  133035. // (newest result first). Use this to sort resources like operations so
  133036. // that the newest operation is returned first.
  133037. //
  133038. // Currently, only sorting by name or creationTimestamp desc is
  133039. // supported.
  133040. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  133041. c.urlParams_.Set("orderBy", orderBy)
  133042. return c
  133043. }
  133044. // PageToken sets the optional parameter "pageToken": Specifies a page
  133045. // token to use. Set pageToken to the nextPageToken returned by a
  133046. // previous list request to get the next page of results.
  133047. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  133048. c.urlParams_.Set("pageToken", pageToken)
  133049. return c
  133050. }
  133051. // Fields allows partial responses to be retrieved. See
  133052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133053. // for more information.
  133054. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  133055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133056. return c
  133057. }
  133058. // IfNoneMatch sets the optional parameter which makes the operation
  133059. // fail if the object's ETag matches the given value. This is useful for
  133060. // getting updates only after the object has changed since the last
  133061. // request. Use googleapi.IsNotModified to check whether the response
  133062. // error from Do is the result of In-None-Match.
  133063. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  133064. c.ifNoneMatch_ = entityTag
  133065. return c
  133066. }
  133067. // Context sets the context to be used in this call's Do method. Any
  133068. // pending HTTP request will be aborted if the provided context is
  133069. // canceled.
  133070. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  133071. c.ctx_ = ctx
  133072. return c
  133073. }
  133074. // Header returns an http.Header that can be modified by the caller to
  133075. // add HTTP headers to the request.
  133076. func (c *TargetHttpProxiesListCall) Header() http.Header {
  133077. if c.header_ == nil {
  133078. c.header_ = make(http.Header)
  133079. }
  133080. return c.header_
  133081. }
  133082. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  133083. reqHeaders := make(http.Header)
  133084. for k, v := range c.header_ {
  133085. reqHeaders[k] = v
  133086. }
  133087. reqHeaders.Set("User-Agent", c.s.userAgent())
  133088. if c.ifNoneMatch_ != "" {
  133089. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  133090. }
  133091. var body io.Reader = nil
  133092. c.urlParams_.Set("alt", alt)
  133093. c.urlParams_.Set("prettyPrint", "false")
  133094. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  133095. urls += "?" + c.urlParams_.Encode()
  133096. req, err := http.NewRequest("GET", urls, body)
  133097. if err != nil {
  133098. return nil, err
  133099. }
  133100. req.Header = reqHeaders
  133101. googleapi.Expand(req.URL, map[string]string{
  133102. "project": c.project,
  133103. })
  133104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133105. }
  133106. // Do executes the "compute.targetHttpProxies.list" call.
  133107. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  133108. // non-2xx status code is an error. Response headers are in either
  133109. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  133110. // returned at all) in error.(*googleapi.Error).Header. Use
  133111. // googleapi.IsNotModified to check whether the returned error was
  133112. // because http.StatusNotModified was returned.
  133113. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  133114. gensupport.SetOptions(c.urlParams_, opts...)
  133115. res, err := c.doRequest("json")
  133116. if res != nil && res.StatusCode == http.StatusNotModified {
  133117. if res.Body != nil {
  133118. res.Body.Close()
  133119. }
  133120. return nil, &googleapi.Error{
  133121. Code: res.StatusCode,
  133122. Header: res.Header,
  133123. }
  133124. }
  133125. if err != nil {
  133126. return nil, err
  133127. }
  133128. defer googleapi.CloseBody(res)
  133129. if err := googleapi.CheckResponse(res); err != nil {
  133130. return nil, err
  133131. }
  133132. ret := &TargetHttpProxyList{
  133133. ServerResponse: googleapi.ServerResponse{
  133134. Header: res.Header,
  133135. HTTPStatusCode: res.StatusCode,
  133136. },
  133137. }
  133138. target := &ret
  133139. if err := gensupport.DecodeResponse(target, res); err != nil {
  133140. return nil, err
  133141. }
  133142. return ret, nil
  133143. // {
  133144. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  133145. // "httpMethod": "GET",
  133146. // "id": "compute.targetHttpProxies.list",
  133147. // "parameterOrder": [
  133148. // "project"
  133149. // ],
  133150. // "parameters": {
  133151. // "filter": {
  133152. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  133153. // "location": "query",
  133154. // "type": "string"
  133155. // },
  133156. // "maxResults": {
  133157. // "default": "500",
  133158. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  133159. // "format": "uint32",
  133160. // "location": "query",
  133161. // "minimum": "0",
  133162. // "type": "integer"
  133163. // },
  133164. // "orderBy": {
  133165. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  133166. // "location": "query",
  133167. // "type": "string"
  133168. // },
  133169. // "pageToken": {
  133170. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  133171. // "location": "query",
  133172. // "type": "string"
  133173. // },
  133174. // "project": {
  133175. // "description": "Project ID for this request.",
  133176. // "location": "path",
  133177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133178. // "required": true,
  133179. // "type": "string"
  133180. // }
  133181. // },
  133182. // "path": "{project}/global/targetHttpProxies",
  133183. // "response": {
  133184. // "$ref": "TargetHttpProxyList"
  133185. // },
  133186. // "scopes": [
  133187. // "https://www.googleapis.com/auth/cloud-platform",
  133188. // "https://www.googleapis.com/auth/compute",
  133189. // "https://www.googleapis.com/auth/compute.readonly"
  133190. // ]
  133191. // }
  133192. }
  133193. // Pages invokes f for each page of results.
  133194. // A non-nil error returned from f will halt the iteration.
  133195. // The provided context supersedes any context provided to the Context method.
  133196. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  133197. c.ctx_ = ctx
  133198. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  133199. for {
  133200. x, err := c.Do()
  133201. if err != nil {
  133202. return err
  133203. }
  133204. if err := f(x); err != nil {
  133205. return err
  133206. }
  133207. if x.NextPageToken == "" {
  133208. return nil
  133209. }
  133210. c.PageToken(x.NextPageToken)
  133211. }
  133212. }
  133213. // method id "compute.targetHttpProxies.setUrlMap":
  133214. type TargetHttpProxiesSetUrlMapCall struct {
  133215. s *Service
  133216. project string
  133217. targetHttpProxy string
  133218. urlmapreference *UrlMapReference
  133219. urlParams_ gensupport.URLParams
  133220. ctx_ context.Context
  133221. header_ http.Header
  133222. }
  133223. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  133224. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  133225. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  133226. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133227. c.project = project
  133228. c.targetHttpProxy = targetHttpProxy
  133229. c.urlmapreference = urlmapreference
  133230. return c
  133231. }
  133232. // RequestId sets the optional parameter "requestId": An optional
  133233. // request ID to identify requests. Specify a unique request ID so that
  133234. // if you must retry your request, the server will know to ignore the
  133235. // request if it has already been completed.
  133236. //
  133237. // For example, consider a situation where you make an initial request
  133238. // and the request times out. If you make the request again with the
  133239. // same request ID, the server can check if original operation with the
  133240. // same request ID was received, and if so, will ignore the second
  133241. // request. This prevents clients from accidentally creating duplicate
  133242. // commitments.
  133243. //
  133244. // The request ID must be a valid UUID with the exception that zero UUID
  133245. // is not supported (00000000-0000-0000-0000-000000000000).
  133246. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  133247. c.urlParams_.Set("requestId", requestId)
  133248. return c
  133249. }
  133250. // Fields allows partial responses to be retrieved. See
  133251. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133252. // for more information.
  133253. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  133254. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133255. return c
  133256. }
  133257. // Context sets the context to be used in this call's Do method. Any
  133258. // pending HTTP request will be aborted if the provided context is
  133259. // canceled.
  133260. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  133261. c.ctx_ = ctx
  133262. return c
  133263. }
  133264. // Header returns an http.Header that can be modified by the caller to
  133265. // add HTTP headers to the request.
  133266. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  133267. if c.header_ == nil {
  133268. c.header_ = make(http.Header)
  133269. }
  133270. return c.header_
  133271. }
  133272. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  133273. reqHeaders := make(http.Header)
  133274. for k, v := range c.header_ {
  133275. reqHeaders[k] = v
  133276. }
  133277. reqHeaders.Set("User-Agent", c.s.userAgent())
  133278. var body io.Reader = nil
  133279. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  133280. if err != nil {
  133281. return nil, err
  133282. }
  133283. reqHeaders.Set("Content-Type", "application/json")
  133284. c.urlParams_.Set("alt", alt)
  133285. c.urlParams_.Set("prettyPrint", "false")
  133286. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  133287. urls += "?" + c.urlParams_.Encode()
  133288. req, err := http.NewRequest("POST", urls, body)
  133289. if err != nil {
  133290. return nil, err
  133291. }
  133292. req.Header = reqHeaders
  133293. googleapi.Expand(req.URL, map[string]string{
  133294. "project": c.project,
  133295. "targetHttpProxy": c.targetHttpProxy,
  133296. })
  133297. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133298. }
  133299. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  133300. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  133301. // status code is an error. Response headers are in either
  133302. // *Operation.ServerResponse.Header or (if a response was returned at
  133303. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  133304. // to check whether the returned error was because
  133305. // http.StatusNotModified was returned.
  133306. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  133307. gensupport.SetOptions(c.urlParams_, opts...)
  133308. res, err := c.doRequest("json")
  133309. if res != nil && res.StatusCode == http.StatusNotModified {
  133310. if res.Body != nil {
  133311. res.Body.Close()
  133312. }
  133313. return nil, &googleapi.Error{
  133314. Code: res.StatusCode,
  133315. Header: res.Header,
  133316. }
  133317. }
  133318. if err != nil {
  133319. return nil, err
  133320. }
  133321. defer googleapi.CloseBody(res)
  133322. if err := googleapi.CheckResponse(res); err != nil {
  133323. return nil, err
  133324. }
  133325. ret := &Operation{
  133326. ServerResponse: googleapi.ServerResponse{
  133327. Header: res.Header,
  133328. HTTPStatusCode: res.StatusCode,
  133329. },
  133330. }
  133331. target := &ret
  133332. if err := gensupport.DecodeResponse(target, res); err != nil {
  133333. return nil, err
  133334. }
  133335. return ret, nil
  133336. // {
  133337. // "description": "Changes the URL map for TargetHttpProxy.",
  133338. // "httpMethod": "POST",
  133339. // "id": "compute.targetHttpProxies.setUrlMap",
  133340. // "parameterOrder": [
  133341. // "project",
  133342. // "targetHttpProxy"
  133343. // ],
  133344. // "parameters": {
  133345. // "project": {
  133346. // "description": "Project ID for this request.",
  133347. // "location": "path",
  133348. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133349. // "required": true,
  133350. // "type": "string"
  133351. // },
  133352. // "requestId": {
  133353. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  133354. // "location": "query",
  133355. // "type": "string"
  133356. // },
  133357. // "targetHttpProxy": {
  133358. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  133359. // "location": "path",
  133360. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  133361. // "required": true,
  133362. // "type": "string"
  133363. // }
  133364. // },
  133365. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  133366. // "request": {
  133367. // "$ref": "UrlMapReference"
  133368. // },
  133369. // "response": {
  133370. // "$ref": "Operation"
  133371. // },
  133372. // "scopes": [
  133373. // "https://www.googleapis.com/auth/cloud-platform",
  133374. // "https://www.googleapis.com/auth/compute"
  133375. // ]
  133376. // }
  133377. }
  133378. // method id "compute.targetHttpProxies.testIamPermissions":
  133379. type TargetHttpProxiesTestIamPermissionsCall struct {
  133380. s *Service
  133381. project string
  133382. resource string
  133383. testpermissionsrequest *TestPermissionsRequest
  133384. urlParams_ gensupport.URLParams
  133385. ctx_ context.Context
  133386. header_ http.Header
  133387. }
  133388. // TestIamPermissions: Returns permissions that a caller has on the
  133389. // specified resource.
  133390. func (r *TargetHttpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpProxiesTestIamPermissionsCall {
  133391. c := &TargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133392. c.project = project
  133393. c.resource = resource
  133394. c.testpermissionsrequest = testpermissionsrequest
  133395. return c
  133396. }
  133397. // Fields allows partial responses to be retrieved. See
  133398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133399. // for more information.
  133400. func (c *TargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpProxiesTestIamPermissionsCall {
  133401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133402. return c
  133403. }
  133404. // Context sets the context to be used in this call's Do method. Any
  133405. // pending HTTP request will be aborted if the provided context is
  133406. // canceled.
  133407. func (c *TargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpProxiesTestIamPermissionsCall {
  133408. c.ctx_ = ctx
  133409. return c
  133410. }
  133411. // Header returns an http.Header that can be modified by the caller to
  133412. // add HTTP headers to the request.
  133413. func (c *TargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  133414. if c.header_ == nil {
  133415. c.header_ = make(http.Header)
  133416. }
  133417. return c.header_
  133418. }
  133419. func (c *TargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  133420. reqHeaders := make(http.Header)
  133421. for k, v := range c.header_ {
  133422. reqHeaders[k] = v
  133423. }
  133424. reqHeaders.Set("User-Agent", c.s.userAgent())
  133425. var body io.Reader = nil
  133426. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  133427. if err != nil {
  133428. return nil, err
  133429. }
  133430. reqHeaders.Set("Content-Type", "application/json")
  133431. c.urlParams_.Set("alt", alt)
  133432. c.urlParams_.Set("prettyPrint", "false")
  133433. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{resource}/testIamPermissions")
  133434. urls += "?" + c.urlParams_.Encode()
  133435. req, err := http.NewRequest("POST", urls, body)
  133436. if err != nil {
  133437. return nil, err
  133438. }
  133439. req.Header = reqHeaders
  133440. googleapi.Expand(req.URL, map[string]string{
  133441. "project": c.project,
  133442. "resource": c.resource,
  133443. })
  133444. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133445. }
  133446. // Do executes the "compute.targetHttpProxies.testIamPermissions" call.
  133447. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  133448. // non-2xx status code is an error. Response headers are in either
  133449. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  133450. // returned at all) in error.(*googleapi.Error).Header. Use
  133451. // googleapi.IsNotModified to check whether the returned error was
  133452. // because http.StatusNotModified was returned.
  133453. func (c *TargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  133454. gensupport.SetOptions(c.urlParams_, opts...)
  133455. res, err := c.doRequest("json")
  133456. if res != nil && res.StatusCode == http.StatusNotModified {
  133457. if res.Body != nil {
  133458. res.Body.Close()
  133459. }
  133460. return nil, &googleapi.Error{
  133461. Code: res.StatusCode,
  133462. Header: res.Header,
  133463. }
  133464. }
  133465. if err != nil {
  133466. return nil, err
  133467. }
  133468. defer googleapi.CloseBody(res)
  133469. if err := googleapi.CheckResponse(res); err != nil {
  133470. return nil, err
  133471. }
  133472. ret := &TestPermissionsResponse{
  133473. ServerResponse: googleapi.ServerResponse{
  133474. Header: res.Header,
  133475. HTTPStatusCode: res.StatusCode,
  133476. },
  133477. }
  133478. target := &ret
  133479. if err := gensupport.DecodeResponse(target, res); err != nil {
  133480. return nil, err
  133481. }
  133482. return ret, nil
  133483. // {
  133484. // "description": "Returns permissions that a caller has on the specified resource.",
  133485. // "httpMethod": "POST",
  133486. // "id": "compute.targetHttpProxies.testIamPermissions",
  133487. // "parameterOrder": [
  133488. // "project",
  133489. // "resource"
  133490. // ],
  133491. // "parameters": {
  133492. // "project": {
  133493. // "description": "Project ID for this request.",
  133494. // "location": "path",
  133495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133496. // "required": true,
  133497. // "type": "string"
  133498. // },
  133499. // "resource": {
  133500. // "description": "Name or id of the resource for this request.",
  133501. // "location": "path",
  133502. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  133503. // "required": true,
  133504. // "type": "string"
  133505. // }
  133506. // },
  133507. // "path": "{project}/global/targetHttpProxies/{resource}/testIamPermissions",
  133508. // "request": {
  133509. // "$ref": "TestPermissionsRequest"
  133510. // },
  133511. // "response": {
  133512. // "$ref": "TestPermissionsResponse"
  133513. // },
  133514. // "scopes": [
  133515. // "https://www.googleapis.com/auth/cloud-platform",
  133516. // "https://www.googleapis.com/auth/compute",
  133517. // "https://www.googleapis.com/auth/compute.readonly"
  133518. // ]
  133519. // }
  133520. }
  133521. // method id "compute.targetHttpsProxies.aggregatedList":
  133522. type TargetHttpsProxiesAggregatedListCall struct {
  133523. s *Service
  133524. project string
  133525. urlParams_ gensupport.URLParams
  133526. ifNoneMatch_ string
  133527. ctx_ context.Context
  133528. header_ http.Header
  133529. }
  133530. // AggregatedList: Retrieves the list of all TargetHttpsProxy resources,
  133531. // regional and global, available to the specified project.
  133532. func (r *TargetHttpsProxiesService) AggregatedList(project string) *TargetHttpsProxiesAggregatedListCall {
  133533. c := &TargetHttpsProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133534. c.project = project
  133535. return c
  133536. }
  133537. // Filter sets the optional parameter "filter": A filter expression that
  133538. // filters resources listed in the response. The expression must specify
  133539. // the field name, a comparison operator, and the value that you want to
  133540. // use for filtering. The value must be a string, a number, or a
  133541. // boolean. The comparison operator must be either =, !=, >, or <.
  133542. //
  133543. // For example, if you are filtering Compute Engine instances, you can
  133544. // exclude instances named example-instance by specifying name !=
  133545. // example-instance.
  133546. //
  133547. // You can also filter nested fields. For example, you could specify
  133548. // scheduling.automaticRestart = false to include instances only if they
  133549. // are not scheduled for automatic restarts. You can use filtering on
  133550. // nested fields to filter based on resource labels.
  133551. //
  133552. // To filter on multiple expressions, provide each separate expression
  133553. // within parentheses. For example, (scheduling.automaticRestart = true)
  133554. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  133555. // AND expression. However, you can include AND and OR expressions
  133556. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  133557. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  133558. // true).
  133559. func (c *TargetHttpsProxiesAggregatedListCall) Filter(filter string) *TargetHttpsProxiesAggregatedListCall {
  133560. c.urlParams_.Set("filter", filter)
  133561. return c
  133562. }
  133563. // MaxResults sets the optional parameter "maxResults": The maximum
  133564. // number of results per page that should be returned. If the number of
  133565. // available results is larger than maxResults, Compute Engine returns a
  133566. // nextPageToken that can be used to get the next page of results in
  133567. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  133568. // (Default: 500)
  133569. func (c *TargetHttpsProxiesAggregatedListCall) MaxResults(maxResults int64) *TargetHttpsProxiesAggregatedListCall {
  133570. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  133571. return c
  133572. }
  133573. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  133574. // a certain order. By default, results are returned in alphanumerical
  133575. // order based on the resource name.
  133576. //
  133577. // You can also sort results in descending order based on the creation
  133578. // timestamp using orderBy="creationTimestamp desc". This sorts results
  133579. // based on the creationTimestamp field in reverse chronological order
  133580. // (newest result first). Use this to sort resources like operations so
  133581. // that the newest operation is returned first.
  133582. //
  133583. // Currently, only sorting by name or creationTimestamp desc is
  133584. // supported.
  133585. func (c *TargetHttpsProxiesAggregatedListCall) OrderBy(orderBy string) *TargetHttpsProxiesAggregatedListCall {
  133586. c.urlParams_.Set("orderBy", orderBy)
  133587. return c
  133588. }
  133589. // PageToken sets the optional parameter "pageToken": Specifies a page
  133590. // token to use. Set pageToken to the nextPageToken returned by a
  133591. // previous list request to get the next page of results.
  133592. func (c *TargetHttpsProxiesAggregatedListCall) PageToken(pageToken string) *TargetHttpsProxiesAggregatedListCall {
  133593. c.urlParams_.Set("pageToken", pageToken)
  133594. return c
  133595. }
  133596. // Fields allows partial responses to be retrieved. See
  133597. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133598. // for more information.
  133599. func (c *TargetHttpsProxiesAggregatedListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesAggregatedListCall {
  133600. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133601. return c
  133602. }
  133603. // IfNoneMatch sets the optional parameter which makes the operation
  133604. // fail if the object's ETag matches the given value. This is useful for
  133605. // getting updates only after the object has changed since the last
  133606. // request. Use googleapi.IsNotModified to check whether the response
  133607. // error from Do is the result of In-None-Match.
  133608. func (c *TargetHttpsProxiesAggregatedListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesAggregatedListCall {
  133609. c.ifNoneMatch_ = entityTag
  133610. return c
  133611. }
  133612. // Context sets the context to be used in this call's Do method. Any
  133613. // pending HTTP request will be aborted if the provided context is
  133614. // canceled.
  133615. func (c *TargetHttpsProxiesAggregatedListCall) Context(ctx context.Context) *TargetHttpsProxiesAggregatedListCall {
  133616. c.ctx_ = ctx
  133617. return c
  133618. }
  133619. // Header returns an http.Header that can be modified by the caller to
  133620. // add HTTP headers to the request.
  133621. func (c *TargetHttpsProxiesAggregatedListCall) Header() http.Header {
  133622. if c.header_ == nil {
  133623. c.header_ = make(http.Header)
  133624. }
  133625. return c.header_
  133626. }
  133627. func (c *TargetHttpsProxiesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  133628. reqHeaders := make(http.Header)
  133629. for k, v := range c.header_ {
  133630. reqHeaders[k] = v
  133631. }
  133632. reqHeaders.Set("User-Agent", c.s.userAgent())
  133633. if c.ifNoneMatch_ != "" {
  133634. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  133635. }
  133636. var body io.Reader = nil
  133637. c.urlParams_.Set("alt", alt)
  133638. c.urlParams_.Set("prettyPrint", "false")
  133639. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetHttpsProxies")
  133640. urls += "?" + c.urlParams_.Encode()
  133641. req, err := http.NewRequest("GET", urls, body)
  133642. if err != nil {
  133643. return nil, err
  133644. }
  133645. req.Header = reqHeaders
  133646. googleapi.Expand(req.URL, map[string]string{
  133647. "project": c.project,
  133648. })
  133649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133650. }
  133651. // Do executes the "compute.targetHttpsProxies.aggregatedList" call.
  133652. // Exactly one of *TargetHttpsProxyAggregatedList or error will be
  133653. // non-nil. Any non-2xx status code is an error. Response headers are in
  133654. // either *TargetHttpsProxyAggregatedList.ServerResponse.Header or (if a
  133655. // response was returned at all) in error.(*googleapi.Error).Header. Use
  133656. // googleapi.IsNotModified to check whether the returned error was
  133657. // because http.StatusNotModified was returned.
  133658. func (c *TargetHttpsProxiesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyAggregatedList, error) {
  133659. gensupport.SetOptions(c.urlParams_, opts...)
  133660. res, err := c.doRequest("json")
  133661. if res != nil && res.StatusCode == http.StatusNotModified {
  133662. if res.Body != nil {
  133663. res.Body.Close()
  133664. }
  133665. return nil, &googleapi.Error{
  133666. Code: res.StatusCode,
  133667. Header: res.Header,
  133668. }
  133669. }
  133670. if err != nil {
  133671. return nil, err
  133672. }
  133673. defer googleapi.CloseBody(res)
  133674. if err := googleapi.CheckResponse(res); err != nil {
  133675. return nil, err
  133676. }
  133677. ret := &TargetHttpsProxyAggregatedList{
  133678. ServerResponse: googleapi.ServerResponse{
  133679. Header: res.Header,
  133680. HTTPStatusCode: res.StatusCode,
  133681. },
  133682. }
  133683. target := &ret
  133684. if err := gensupport.DecodeResponse(target, res); err != nil {
  133685. return nil, err
  133686. }
  133687. return ret, nil
  133688. // {
  133689. // "description": "Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project.",
  133690. // "httpMethod": "GET",
  133691. // "id": "compute.targetHttpsProxies.aggregatedList",
  133692. // "parameterOrder": [
  133693. // "project"
  133694. // ],
  133695. // "parameters": {
  133696. // "filter": {
  133697. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  133698. // "location": "query",
  133699. // "type": "string"
  133700. // },
  133701. // "maxResults": {
  133702. // "default": "500",
  133703. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  133704. // "format": "uint32",
  133705. // "location": "query",
  133706. // "minimum": "0",
  133707. // "type": "integer"
  133708. // },
  133709. // "orderBy": {
  133710. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  133711. // "location": "query",
  133712. // "type": "string"
  133713. // },
  133714. // "pageToken": {
  133715. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  133716. // "location": "query",
  133717. // "type": "string"
  133718. // },
  133719. // "project": {
  133720. // "description": "Name of the project scoping this request.",
  133721. // "location": "path",
  133722. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133723. // "required": true,
  133724. // "type": "string"
  133725. // }
  133726. // },
  133727. // "path": "{project}/aggregated/targetHttpsProxies",
  133728. // "response": {
  133729. // "$ref": "TargetHttpsProxyAggregatedList"
  133730. // },
  133731. // "scopes": [
  133732. // "https://www.googleapis.com/auth/cloud-platform",
  133733. // "https://www.googleapis.com/auth/compute",
  133734. // "https://www.googleapis.com/auth/compute.readonly"
  133735. // ]
  133736. // }
  133737. }
  133738. // Pages invokes f for each page of results.
  133739. // A non-nil error returned from f will halt the iteration.
  133740. // The provided context supersedes any context provided to the Context method.
  133741. func (c *TargetHttpsProxiesAggregatedListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyAggregatedList) error) error {
  133742. c.ctx_ = ctx
  133743. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  133744. for {
  133745. x, err := c.Do()
  133746. if err != nil {
  133747. return err
  133748. }
  133749. if err := f(x); err != nil {
  133750. return err
  133751. }
  133752. if x.NextPageToken == "" {
  133753. return nil
  133754. }
  133755. c.PageToken(x.NextPageToken)
  133756. }
  133757. }
  133758. // method id "compute.targetHttpsProxies.delete":
  133759. type TargetHttpsProxiesDeleteCall struct {
  133760. s *Service
  133761. project string
  133762. targetHttpsProxy string
  133763. urlParams_ gensupport.URLParams
  133764. ctx_ context.Context
  133765. header_ http.Header
  133766. }
  133767. // Delete: Deletes the specified TargetHttpsProxy resource.
  133768. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  133769. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133770. c.project = project
  133771. c.targetHttpsProxy = targetHttpsProxy
  133772. return c
  133773. }
  133774. // RequestId sets the optional parameter "requestId": An optional
  133775. // request ID to identify requests. Specify a unique request ID so that
  133776. // if you must retry your request, the server will know to ignore the
  133777. // request if it has already been completed.
  133778. //
  133779. // For example, consider a situation where you make an initial request
  133780. // and the request times out. If you make the request again with the
  133781. // same request ID, the server can check if original operation with the
  133782. // same request ID was received, and if so, will ignore the second
  133783. // request. This prevents clients from accidentally creating duplicate
  133784. // commitments.
  133785. //
  133786. // The request ID must be a valid UUID with the exception that zero UUID
  133787. // is not supported (00000000-0000-0000-0000-000000000000).
  133788. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  133789. c.urlParams_.Set("requestId", requestId)
  133790. return c
  133791. }
  133792. // Fields allows partial responses to be retrieved. See
  133793. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133794. // for more information.
  133795. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  133796. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133797. return c
  133798. }
  133799. // Context sets the context to be used in this call's Do method. Any
  133800. // pending HTTP request will be aborted if the provided context is
  133801. // canceled.
  133802. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  133803. c.ctx_ = ctx
  133804. return c
  133805. }
  133806. // Header returns an http.Header that can be modified by the caller to
  133807. // add HTTP headers to the request.
  133808. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  133809. if c.header_ == nil {
  133810. c.header_ = make(http.Header)
  133811. }
  133812. return c.header_
  133813. }
  133814. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  133815. reqHeaders := make(http.Header)
  133816. for k, v := range c.header_ {
  133817. reqHeaders[k] = v
  133818. }
  133819. reqHeaders.Set("User-Agent", c.s.userAgent())
  133820. var body io.Reader = nil
  133821. c.urlParams_.Set("alt", alt)
  133822. c.urlParams_.Set("prettyPrint", "false")
  133823. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  133824. urls += "?" + c.urlParams_.Encode()
  133825. req, err := http.NewRequest("DELETE", urls, body)
  133826. if err != nil {
  133827. return nil, err
  133828. }
  133829. req.Header = reqHeaders
  133830. googleapi.Expand(req.URL, map[string]string{
  133831. "project": c.project,
  133832. "targetHttpsProxy": c.targetHttpsProxy,
  133833. })
  133834. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133835. }
  133836. // Do executes the "compute.targetHttpsProxies.delete" call.
  133837. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  133838. // status code is an error. Response headers are in either
  133839. // *Operation.ServerResponse.Header or (if a response was returned at
  133840. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  133841. // to check whether the returned error was because
  133842. // http.StatusNotModified was returned.
  133843. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  133844. gensupport.SetOptions(c.urlParams_, opts...)
  133845. res, err := c.doRequest("json")
  133846. if res != nil && res.StatusCode == http.StatusNotModified {
  133847. if res.Body != nil {
  133848. res.Body.Close()
  133849. }
  133850. return nil, &googleapi.Error{
  133851. Code: res.StatusCode,
  133852. Header: res.Header,
  133853. }
  133854. }
  133855. if err != nil {
  133856. return nil, err
  133857. }
  133858. defer googleapi.CloseBody(res)
  133859. if err := googleapi.CheckResponse(res); err != nil {
  133860. return nil, err
  133861. }
  133862. ret := &Operation{
  133863. ServerResponse: googleapi.ServerResponse{
  133864. Header: res.Header,
  133865. HTTPStatusCode: res.StatusCode,
  133866. },
  133867. }
  133868. target := &ret
  133869. if err := gensupport.DecodeResponse(target, res); err != nil {
  133870. return nil, err
  133871. }
  133872. return ret, nil
  133873. // {
  133874. // "description": "Deletes the specified TargetHttpsProxy resource.",
  133875. // "httpMethod": "DELETE",
  133876. // "id": "compute.targetHttpsProxies.delete",
  133877. // "parameterOrder": [
  133878. // "project",
  133879. // "targetHttpsProxy"
  133880. // ],
  133881. // "parameters": {
  133882. // "project": {
  133883. // "description": "Project ID for this request.",
  133884. // "location": "path",
  133885. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133886. // "required": true,
  133887. // "type": "string"
  133888. // },
  133889. // "requestId": {
  133890. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  133891. // "location": "query",
  133892. // "type": "string"
  133893. // },
  133894. // "targetHttpsProxy": {
  133895. // "description": "Name of the TargetHttpsProxy resource to delete.",
  133896. // "location": "path",
  133897. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  133898. // "required": true,
  133899. // "type": "string"
  133900. // }
  133901. // },
  133902. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  133903. // "response": {
  133904. // "$ref": "Operation"
  133905. // },
  133906. // "scopes": [
  133907. // "https://www.googleapis.com/auth/cloud-platform",
  133908. // "https://www.googleapis.com/auth/compute"
  133909. // ]
  133910. // }
  133911. }
  133912. // method id "compute.targetHttpsProxies.get":
  133913. type TargetHttpsProxiesGetCall struct {
  133914. s *Service
  133915. project string
  133916. targetHttpsProxy string
  133917. urlParams_ gensupport.URLParams
  133918. ifNoneMatch_ string
  133919. ctx_ context.Context
  133920. header_ http.Header
  133921. }
  133922. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  133923. // available target HTTPS proxies by making a list() request.
  133924. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  133925. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133926. c.project = project
  133927. c.targetHttpsProxy = targetHttpsProxy
  133928. return c
  133929. }
  133930. // Fields allows partial responses to be retrieved. See
  133931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133932. // for more information.
  133933. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  133934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133935. return c
  133936. }
  133937. // IfNoneMatch sets the optional parameter which makes the operation
  133938. // fail if the object's ETag matches the given value. This is useful for
  133939. // getting updates only after the object has changed since the last
  133940. // request. Use googleapi.IsNotModified to check whether the response
  133941. // error from Do is the result of In-None-Match.
  133942. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  133943. c.ifNoneMatch_ = entityTag
  133944. return c
  133945. }
  133946. // Context sets the context to be used in this call's Do method. Any
  133947. // pending HTTP request will be aborted if the provided context is
  133948. // canceled.
  133949. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  133950. c.ctx_ = ctx
  133951. return c
  133952. }
  133953. // Header returns an http.Header that can be modified by the caller to
  133954. // add HTTP headers to the request.
  133955. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  133956. if c.header_ == nil {
  133957. c.header_ = make(http.Header)
  133958. }
  133959. return c.header_
  133960. }
  133961. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  133962. reqHeaders := make(http.Header)
  133963. for k, v := range c.header_ {
  133964. reqHeaders[k] = v
  133965. }
  133966. reqHeaders.Set("User-Agent", c.s.userAgent())
  133967. if c.ifNoneMatch_ != "" {
  133968. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  133969. }
  133970. var body io.Reader = nil
  133971. c.urlParams_.Set("alt", alt)
  133972. c.urlParams_.Set("prettyPrint", "false")
  133973. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  133974. urls += "?" + c.urlParams_.Encode()
  133975. req, err := http.NewRequest("GET", urls, body)
  133976. if err != nil {
  133977. return nil, err
  133978. }
  133979. req.Header = reqHeaders
  133980. googleapi.Expand(req.URL, map[string]string{
  133981. "project": c.project,
  133982. "targetHttpsProxy": c.targetHttpsProxy,
  133983. })
  133984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133985. }
  133986. // Do executes the "compute.targetHttpsProxies.get" call.
  133987. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  133988. // non-2xx status code is an error. Response headers are in either
  133989. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  133990. // returned at all) in error.(*googleapi.Error).Header. Use
  133991. // googleapi.IsNotModified to check whether the returned error was
  133992. // because http.StatusNotModified was returned.
  133993. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  133994. gensupport.SetOptions(c.urlParams_, opts...)
  133995. res, err := c.doRequest("json")
  133996. if res != nil && res.StatusCode == http.StatusNotModified {
  133997. if res.Body != nil {
  133998. res.Body.Close()
  133999. }
  134000. return nil, &googleapi.Error{
  134001. Code: res.StatusCode,
  134002. Header: res.Header,
  134003. }
  134004. }
  134005. if err != nil {
  134006. return nil, err
  134007. }
  134008. defer googleapi.CloseBody(res)
  134009. if err := googleapi.CheckResponse(res); err != nil {
  134010. return nil, err
  134011. }
  134012. ret := &TargetHttpsProxy{
  134013. ServerResponse: googleapi.ServerResponse{
  134014. Header: res.Header,
  134015. HTTPStatusCode: res.StatusCode,
  134016. },
  134017. }
  134018. target := &ret
  134019. if err := gensupport.DecodeResponse(target, res); err != nil {
  134020. return nil, err
  134021. }
  134022. return ret, nil
  134023. // {
  134024. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  134025. // "httpMethod": "GET",
  134026. // "id": "compute.targetHttpsProxies.get",
  134027. // "parameterOrder": [
  134028. // "project",
  134029. // "targetHttpsProxy"
  134030. // ],
  134031. // "parameters": {
  134032. // "project": {
  134033. // "description": "Project ID for this request.",
  134034. // "location": "path",
  134035. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134036. // "required": true,
  134037. // "type": "string"
  134038. // },
  134039. // "targetHttpsProxy": {
  134040. // "description": "Name of the TargetHttpsProxy resource to return.",
  134041. // "location": "path",
  134042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  134043. // "required": true,
  134044. // "type": "string"
  134045. // }
  134046. // },
  134047. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  134048. // "response": {
  134049. // "$ref": "TargetHttpsProxy"
  134050. // },
  134051. // "scopes": [
  134052. // "https://www.googleapis.com/auth/cloud-platform",
  134053. // "https://www.googleapis.com/auth/compute",
  134054. // "https://www.googleapis.com/auth/compute.readonly"
  134055. // ]
  134056. // }
  134057. }
  134058. // method id "compute.targetHttpsProxies.insert":
  134059. type TargetHttpsProxiesInsertCall struct {
  134060. s *Service
  134061. project string
  134062. targethttpsproxy *TargetHttpsProxy
  134063. urlParams_ gensupport.URLParams
  134064. ctx_ context.Context
  134065. header_ http.Header
  134066. }
  134067. // Insert: Creates a TargetHttpsProxy resource in the specified project
  134068. // using the data included in the request.
  134069. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  134070. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134071. c.project = project
  134072. c.targethttpsproxy = targethttpsproxy
  134073. return c
  134074. }
  134075. // RequestId sets the optional parameter "requestId": An optional
  134076. // request ID to identify requests. Specify a unique request ID so that
  134077. // if you must retry your request, the server will know to ignore the
  134078. // request if it has already been completed.
  134079. //
  134080. // For example, consider a situation where you make an initial request
  134081. // and the request times out. If you make the request again with the
  134082. // same request ID, the server can check if original operation with the
  134083. // same request ID was received, and if so, will ignore the second
  134084. // request. This prevents clients from accidentally creating duplicate
  134085. // commitments.
  134086. //
  134087. // The request ID must be a valid UUID with the exception that zero UUID
  134088. // is not supported (00000000-0000-0000-0000-000000000000).
  134089. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  134090. c.urlParams_.Set("requestId", requestId)
  134091. return c
  134092. }
  134093. // Fields allows partial responses to be retrieved. See
  134094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134095. // for more information.
  134096. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  134097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134098. return c
  134099. }
  134100. // Context sets the context to be used in this call's Do method. Any
  134101. // pending HTTP request will be aborted if the provided context is
  134102. // canceled.
  134103. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  134104. c.ctx_ = ctx
  134105. return c
  134106. }
  134107. // Header returns an http.Header that can be modified by the caller to
  134108. // add HTTP headers to the request.
  134109. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  134110. if c.header_ == nil {
  134111. c.header_ = make(http.Header)
  134112. }
  134113. return c.header_
  134114. }
  134115. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  134116. reqHeaders := make(http.Header)
  134117. for k, v := range c.header_ {
  134118. reqHeaders[k] = v
  134119. }
  134120. reqHeaders.Set("User-Agent", c.s.userAgent())
  134121. var body io.Reader = nil
  134122. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  134123. if err != nil {
  134124. return nil, err
  134125. }
  134126. reqHeaders.Set("Content-Type", "application/json")
  134127. c.urlParams_.Set("alt", alt)
  134128. c.urlParams_.Set("prettyPrint", "false")
  134129. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  134130. urls += "?" + c.urlParams_.Encode()
  134131. req, err := http.NewRequest("POST", urls, body)
  134132. if err != nil {
  134133. return nil, err
  134134. }
  134135. req.Header = reqHeaders
  134136. googleapi.Expand(req.URL, map[string]string{
  134137. "project": c.project,
  134138. })
  134139. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134140. }
  134141. // Do executes the "compute.targetHttpsProxies.insert" call.
  134142. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  134143. // status code is an error. Response headers are in either
  134144. // *Operation.ServerResponse.Header or (if a response was returned at
  134145. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134146. // to check whether the returned error was because
  134147. // http.StatusNotModified was returned.
  134148. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  134149. gensupport.SetOptions(c.urlParams_, opts...)
  134150. res, err := c.doRequest("json")
  134151. if res != nil && res.StatusCode == http.StatusNotModified {
  134152. if res.Body != nil {
  134153. res.Body.Close()
  134154. }
  134155. return nil, &googleapi.Error{
  134156. Code: res.StatusCode,
  134157. Header: res.Header,
  134158. }
  134159. }
  134160. if err != nil {
  134161. return nil, err
  134162. }
  134163. defer googleapi.CloseBody(res)
  134164. if err := googleapi.CheckResponse(res); err != nil {
  134165. return nil, err
  134166. }
  134167. ret := &Operation{
  134168. ServerResponse: googleapi.ServerResponse{
  134169. Header: res.Header,
  134170. HTTPStatusCode: res.StatusCode,
  134171. },
  134172. }
  134173. target := &ret
  134174. if err := gensupport.DecodeResponse(target, res); err != nil {
  134175. return nil, err
  134176. }
  134177. return ret, nil
  134178. // {
  134179. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  134180. // "httpMethod": "POST",
  134181. // "id": "compute.targetHttpsProxies.insert",
  134182. // "parameterOrder": [
  134183. // "project"
  134184. // ],
  134185. // "parameters": {
  134186. // "project": {
  134187. // "description": "Project ID for this request.",
  134188. // "location": "path",
  134189. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134190. // "required": true,
  134191. // "type": "string"
  134192. // },
  134193. // "requestId": {
  134194. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  134195. // "location": "query",
  134196. // "type": "string"
  134197. // }
  134198. // },
  134199. // "path": "{project}/global/targetHttpsProxies",
  134200. // "request": {
  134201. // "$ref": "TargetHttpsProxy"
  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.targetHttpsProxies.list":
  134213. type TargetHttpsProxiesListCall struct {
  134214. s *Service
  134215. project string
  134216. urlParams_ gensupport.URLParams
  134217. ifNoneMatch_ string
  134218. ctx_ context.Context
  134219. header_ http.Header
  134220. }
  134221. // List: Retrieves the list of TargetHttpsProxy resources available to
  134222. // the specified project.
  134223. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  134224. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134225. c.project = project
  134226. return c
  134227. }
  134228. // Filter sets the optional parameter "filter": A filter expression that
  134229. // filters resources listed in the response. The expression must specify
  134230. // the field name, a comparison operator, and the value that you want to
  134231. // use for filtering. The value must be a string, a number, or a
  134232. // boolean. The comparison operator must be either =, !=, >, or <.
  134233. //
  134234. // For example, if you are filtering Compute Engine instances, you can
  134235. // exclude instances named example-instance by specifying name !=
  134236. // example-instance.
  134237. //
  134238. // You can also filter nested fields. For example, you could specify
  134239. // scheduling.automaticRestart = false to include instances only if they
  134240. // are not scheduled for automatic restarts. You can use filtering on
  134241. // nested fields to filter based on resource labels.
  134242. //
  134243. // To filter on multiple expressions, provide each separate expression
  134244. // within parentheses. For example, (scheduling.automaticRestart = true)
  134245. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  134246. // AND expression. However, you can include AND and OR expressions
  134247. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  134248. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  134249. // true).
  134250. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  134251. c.urlParams_.Set("filter", filter)
  134252. return c
  134253. }
  134254. // MaxResults sets the optional parameter "maxResults": The maximum
  134255. // number of results per page that should be returned. If the number of
  134256. // available results is larger than maxResults, Compute Engine returns a
  134257. // nextPageToken that can be used to get the next page of results in
  134258. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  134259. // (Default: 500)
  134260. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  134261. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  134262. return c
  134263. }
  134264. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  134265. // a certain order. By default, results are returned in alphanumerical
  134266. // order based on the resource name.
  134267. //
  134268. // You can also sort results in descending order based on the creation
  134269. // timestamp using orderBy="creationTimestamp desc". This sorts results
  134270. // based on the creationTimestamp field in reverse chronological order
  134271. // (newest result first). Use this to sort resources like operations so
  134272. // that the newest operation is returned first.
  134273. //
  134274. // Currently, only sorting by name or creationTimestamp desc is
  134275. // supported.
  134276. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  134277. c.urlParams_.Set("orderBy", orderBy)
  134278. return c
  134279. }
  134280. // PageToken sets the optional parameter "pageToken": Specifies a page
  134281. // token to use. Set pageToken to the nextPageToken returned by a
  134282. // previous list request to get the next page of results.
  134283. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  134284. c.urlParams_.Set("pageToken", pageToken)
  134285. return c
  134286. }
  134287. // Fields allows partial responses to be retrieved. See
  134288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134289. // for more information.
  134290. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  134291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134292. return c
  134293. }
  134294. // IfNoneMatch sets the optional parameter which makes the operation
  134295. // fail if the object's ETag matches the given value. This is useful for
  134296. // getting updates only after the object has changed since the last
  134297. // request. Use googleapi.IsNotModified to check whether the response
  134298. // error from Do is the result of In-None-Match.
  134299. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  134300. c.ifNoneMatch_ = entityTag
  134301. return c
  134302. }
  134303. // Context sets the context to be used in this call's Do method. Any
  134304. // pending HTTP request will be aborted if the provided context is
  134305. // canceled.
  134306. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  134307. c.ctx_ = ctx
  134308. return c
  134309. }
  134310. // Header returns an http.Header that can be modified by the caller to
  134311. // add HTTP headers to the request.
  134312. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  134313. if c.header_ == nil {
  134314. c.header_ = make(http.Header)
  134315. }
  134316. return c.header_
  134317. }
  134318. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  134319. reqHeaders := make(http.Header)
  134320. for k, v := range c.header_ {
  134321. reqHeaders[k] = v
  134322. }
  134323. reqHeaders.Set("User-Agent", c.s.userAgent())
  134324. if c.ifNoneMatch_ != "" {
  134325. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  134326. }
  134327. var body io.Reader = nil
  134328. c.urlParams_.Set("alt", alt)
  134329. c.urlParams_.Set("prettyPrint", "false")
  134330. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  134331. urls += "?" + c.urlParams_.Encode()
  134332. req, err := http.NewRequest("GET", urls, body)
  134333. if err != nil {
  134334. return nil, err
  134335. }
  134336. req.Header = reqHeaders
  134337. googleapi.Expand(req.URL, map[string]string{
  134338. "project": c.project,
  134339. })
  134340. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134341. }
  134342. // Do executes the "compute.targetHttpsProxies.list" call.
  134343. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  134344. // non-2xx status code is an error. Response headers are in either
  134345. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  134346. // returned at all) in error.(*googleapi.Error).Header. Use
  134347. // googleapi.IsNotModified to check whether the returned error was
  134348. // because http.StatusNotModified was returned.
  134349. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  134350. gensupport.SetOptions(c.urlParams_, opts...)
  134351. res, err := c.doRequest("json")
  134352. if res != nil && res.StatusCode == http.StatusNotModified {
  134353. if res.Body != nil {
  134354. res.Body.Close()
  134355. }
  134356. return nil, &googleapi.Error{
  134357. Code: res.StatusCode,
  134358. Header: res.Header,
  134359. }
  134360. }
  134361. if err != nil {
  134362. return nil, err
  134363. }
  134364. defer googleapi.CloseBody(res)
  134365. if err := googleapi.CheckResponse(res); err != nil {
  134366. return nil, err
  134367. }
  134368. ret := &TargetHttpsProxyList{
  134369. ServerResponse: googleapi.ServerResponse{
  134370. Header: res.Header,
  134371. HTTPStatusCode: res.StatusCode,
  134372. },
  134373. }
  134374. target := &ret
  134375. if err := gensupport.DecodeResponse(target, res); err != nil {
  134376. return nil, err
  134377. }
  134378. return ret, nil
  134379. // {
  134380. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  134381. // "httpMethod": "GET",
  134382. // "id": "compute.targetHttpsProxies.list",
  134383. // "parameterOrder": [
  134384. // "project"
  134385. // ],
  134386. // "parameters": {
  134387. // "filter": {
  134388. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  134389. // "location": "query",
  134390. // "type": "string"
  134391. // },
  134392. // "maxResults": {
  134393. // "default": "500",
  134394. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  134395. // "format": "uint32",
  134396. // "location": "query",
  134397. // "minimum": "0",
  134398. // "type": "integer"
  134399. // },
  134400. // "orderBy": {
  134401. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  134402. // "location": "query",
  134403. // "type": "string"
  134404. // },
  134405. // "pageToken": {
  134406. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  134407. // "location": "query",
  134408. // "type": "string"
  134409. // },
  134410. // "project": {
  134411. // "description": "Project ID for this request.",
  134412. // "location": "path",
  134413. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134414. // "required": true,
  134415. // "type": "string"
  134416. // }
  134417. // },
  134418. // "path": "{project}/global/targetHttpsProxies",
  134419. // "response": {
  134420. // "$ref": "TargetHttpsProxyList"
  134421. // },
  134422. // "scopes": [
  134423. // "https://www.googleapis.com/auth/cloud-platform",
  134424. // "https://www.googleapis.com/auth/compute",
  134425. // "https://www.googleapis.com/auth/compute.readonly"
  134426. // ]
  134427. // }
  134428. }
  134429. // Pages invokes f for each page of results.
  134430. // A non-nil error returned from f will halt the iteration.
  134431. // The provided context supersedes any context provided to the Context method.
  134432. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  134433. c.ctx_ = ctx
  134434. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  134435. for {
  134436. x, err := c.Do()
  134437. if err != nil {
  134438. return err
  134439. }
  134440. if err := f(x); err != nil {
  134441. return err
  134442. }
  134443. if x.NextPageToken == "" {
  134444. return nil
  134445. }
  134446. c.PageToken(x.NextPageToken)
  134447. }
  134448. }
  134449. // method id "compute.targetHttpsProxies.setQuicOverride":
  134450. type TargetHttpsProxiesSetQuicOverrideCall struct {
  134451. s *Service
  134452. project string
  134453. targetHttpsProxy string
  134454. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  134455. urlParams_ gensupport.URLParams
  134456. ctx_ context.Context
  134457. header_ http.Header
  134458. }
  134459. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  134460. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  134461. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134462. c.project = project
  134463. c.targetHttpsProxy = targetHttpsProxy
  134464. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  134465. return c
  134466. }
  134467. // RequestId sets the optional parameter "requestId": An optional
  134468. // request ID to identify requests. Specify a unique request ID so that
  134469. // if you must retry your request, the server will know to ignore the
  134470. // request if it has already been completed.
  134471. //
  134472. // For example, consider a situation where you make an initial request
  134473. // and the request times out. If you make the request again with the
  134474. // same request ID, the server can check if original operation with the
  134475. // same request ID was received, and if so, will ignore the second
  134476. // request. This prevents clients from accidentally creating duplicate
  134477. // commitments.
  134478. //
  134479. // The request ID must be a valid UUID with the exception that zero UUID
  134480. // is not supported (00000000-0000-0000-0000-000000000000).
  134481. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  134482. c.urlParams_.Set("requestId", requestId)
  134483. return c
  134484. }
  134485. // Fields allows partial responses to be retrieved. See
  134486. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134487. // for more information.
  134488. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  134489. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134490. return c
  134491. }
  134492. // Context sets the context to be used in this call's Do method. Any
  134493. // pending HTTP request will be aborted if the provided context is
  134494. // canceled.
  134495. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  134496. c.ctx_ = ctx
  134497. return c
  134498. }
  134499. // Header returns an http.Header that can be modified by the caller to
  134500. // add HTTP headers to the request.
  134501. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  134502. if c.header_ == nil {
  134503. c.header_ = make(http.Header)
  134504. }
  134505. return c.header_
  134506. }
  134507. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  134508. reqHeaders := make(http.Header)
  134509. for k, v := range c.header_ {
  134510. reqHeaders[k] = v
  134511. }
  134512. reqHeaders.Set("User-Agent", c.s.userAgent())
  134513. var body io.Reader = nil
  134514. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  134515. if err != nil {
  134516. return nil, err
  134517. }
  134518. reqHeaders.Set("Content-Type", "application/json")
  134519. c.urlParams_.Set("alt", alt)
  134520. c.urlParams_.Set("prettyPrint", "false")
  134521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  134522. urls += "?" + c.urlParams_.Encode()
  134523. req, err := http.NewRequest("POST", urls, body)
  134524. if err != nil {
  134525. return nil, err
  134526. }
  134527. req.Header = reqHeaders
  134528. googleapi.Expand(req.URL, map[string]string{
  134529. "project": c.project,
  134530. "targetHttpsProxy": c.targetHttpsProxy,
  134531. })
  134532. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134533. }
  134534. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  134535. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  134536. // status code is an error. Response headers are in either
  134537. // *Operation.ServerResponse.Header or (if a response was returned at
  134538. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134539. // to check whether the returned error was because
  134540. // http.StatusNotModified was returned.
  134541. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  134542. gensupport.SetOptions(c.urlParams_, opts...)
  134543. res, err := c.doRequest("json")
  134544. if res != nil && res.StatusCode == http.StatusNotModified {
  134545. if res.Body != nil {
  134546. res.Body.Close()
  134547. }
  134548. return nil, &googleapi.Error{
  134549. Code: res.StatusCode,
  134550. Header: res.Header,
  134551. }
  134552. }
  134553. if err != nil {
  134554. return nil, err
  134555. }
  134556. defer googleapi.CloseBody(res)
  134557. if err := googleapi.CheckResponse(res); err != nil {
  134558. return nil, err
  134559. }
  134560. ret := &Operation{
  134561. ServerResponse: googleapi.ServerResponse{
  134562. Header: res.Header,
  134563. HTTPStatusCode: res.StatusCode,
  134564. },
  134565. }
  134566. target := &ret
  134567. if err := gensupport.DecodeResponse(target, res); err != nil {
  134568. return nil, err
  134569. }
  134570. return ret, nil
  134571. // {
  134572. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  134573. // "httpMethod": "POST",
  134574. // "id": "compute.targetHttpsProxies.setQuicOverride",
  134575. // "parameterOrder": [
  134576. // "project",
  134577. // "targetHttpsProxy"
  134578. // ],
  134579. // "parameters": {
  134580. // "project": {
  134581. // "description": "Project ID for this request.",
  134582. // "location": "path",
  134583. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134584. // "required": true,
  134585. // "type": "string"
  134586. // },
  134587. // "requestId": {
  134588. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  134589. // "location": "query",
  134590. // "type": "string"
  134591. // },
  134592. // "targetHttpsProxy": {
  134593. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  134594. // "location": "path",
  134595. // "required": true,
  134596. // "type": "string"
  134597. // }
  134598. // },
  134599. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  134600. // "request": {
  134601. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  134602. // },
  134603. // "response": {
  134604. // "$ref": "Operation"
  134605. // },
  134606. // "scopes": [
  134607. // "https://www.googleapis.com/auth/cloud-platform",
  134608. // "https://www.googleapis.com/auth/compute"
  134609. // ]
  134610. // }
  134611. }
  134612. // method id "compute.targetHttpsProxies.setSslCertificates":
  134613. type TargetHttpsProxiesSetSslCertificatesCall struct {
  134614. s *Service
  134615. project string
  134616. targetHttpsProxy string
  134617. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  134618. urlParams_ gensupport.URLParams
  134619. ctx_ context.Context
  134620. header_ http.Header
  134621. }
  134622. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  134623. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  134624. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134625. c.project = project
  134626. c.targetHttpsProxy = targetHttpsProxy
  134627. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  134628. return c
  134629. }
  134630. // RequestId sets the optional parameter "requestId": An optional
  134631. // request ID to identify requests. Specify a unique request ID so that
  134632. // if you must retry your request, the server will know to ignore the
  134633. // request if it has already been completed.
  134634. //
  134635. // For example, consider a situation where you make an initial request
  134636. // and the request times out. If you make the request again with the
  134637. // same request ID, the server can check if original operation with the
  134638. // same request ID was received, and if so, will ignore the second
  134639. // request. This prevents clients from accidentally creating duplicate
  134640. // commitments.
  134641. //
  134642. // The request ID must be a valid UUID with the exception that zero UUID
  134643. // is not supported (00000000-0000-0000-0000-000000000000).
  134644. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  134645. c.urlParams_.Set("requestId", requestId)
  134646. return c
  134647. }
  134648. // Fields allows partial responses to be retrieved. See
  134649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134650. // for more information.
  134651. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  134652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134653. return c
  134654. }
  134655. // Context sets the context to be used in this call's Do method. Any
  134656. // pending HTTP request will be aborted if the provided context is
  134657. // canceled.
  134658. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  134659. c.ctx_ = ctx
  134660. return c
  134661. }
  134662. // Header returns an http.Header that can be modified by the caller to
  134663. // add HTTP headers to the request.
  134664. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  134665. if c.header_ == nil {
  134666. c.header_ = make(http.Header)
  134667. }
  134668. return c.header_
  134669. }
  134670. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  134671. reqHeaders := make(http.Header)
  134672. for k, v := range c.header_ {
  134673. reqHeaders[k] = v
  134674. }
  134675. reqHeaders.Set("User-Agent", c.s.userAgent())
  134676. var body io.Reader = nil
  134677. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  134678. if err != nil {
  134679. return nil, err
  134680. }
  134681. reqHeaders.Set("Content-Type", "application/json")
  134682. c.urlParams_.Set("alt", alt)
  134683. c.urlParams_.Set("prettyPrint", "false")
  134684. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  134685. urls += "?" + c.urlParams_.Encode()
  134686. req, err := http.NewRequest("POST", urls, body)
  134687. if err != nil {
  134688. return nil, err
  134689. }
  134690. req.Header = reqHeaders
  134691. googleapi.Expand(req.URL, map[string]string{
  134692. "project": c.project,
  134693. "targetHttpsProxy": c.targetHttpsProxy,
  134694. })
  134695. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134696. }
  134697. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  134698. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  134699. // status code is an error. Response headers are in either
  134700. // *Operation.ServerResponse.Header or (if a response was returned at
  134701. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134702. // to check whether the returned error was because
  134703. // http.StatusNotModified was returned.
  134704. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  134705. gensupport.SetOptions(c.urlParams_, opts...)
  134706. res, err := c.doRequest("json")
  134707. if res != nil && res.StatusCode == http.StatusNotModified {
  134708. if res.Body != nil {
  134709. res.Body.Close()
  134710. }
  134711. return nil, &googleapi.Error{
  134712. Code: res.StatusCode,
  134713. Header: res.Header,
  134714. }
  134715. }
  134716. if err != nil {
  134717. return nil, err
  134718. }
  134719. defer googleapi.CloseBody(res)
  134720. if err := googleapi.CheckResponse(res); err != nil {
  134721. return nil, err
  134722. }
  134723. ret := &Operation{
  134724. ServerResponse: googleapi.ServerResponse{
  134725. Header: res.Header,
  134726. HTTPStatusCode: res.StatusCode,
  134727. },
  134728. }
  134729. target := &ret
  134730. if err := gensupport.DecodeResponse(target, res); err != nil {
  134731. return nil, err
  134732. }
  134733. return ret, nil
  134734. // {
  134735. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  134736. // "httpMethod": "POST",
  134737. // "id": "compute.targetHttpsProxies.setSslCertificates",
  134738. // "parameterOrder": [
  134739. // "project",
  134740. // "targetHttpsProxy"
  134741. // ],
  134742. // "parameters": {
  134743. // "project": {
  134744. // "description": "Project ID for this request.",
  134745. // "location": "path",
  134746. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134747. // "required": true,
  134748. // "type": "string"
  134749. // },
  134750. // "requestId": {
  134751. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  134752. // "location": "query",
  134753. // "type": "string"
  134754. // },
  134755. // "targetHttpsProxy": {
  134756. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  134757. // "location": "path",
  134758. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  134759. // "required": true,
  134760. // "type": "string"
  134761. // }
  134762. // },
  134763. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  134764. // "request": {
  134765. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  134766. // },
  134767. // "response": {
  134768. // "$ref": "Operation"
  134769. // },
  134770. // "scopes": [
  134771. // "https://www.googleapis.com/auth/cloud-platform",
  134772. // "https://www.googleapis.com/auth/compute"
  134773. // ]
  134774. // }
  134775. }
  134776. // method id "compute.targetHttpsProxies.setSslPolicy":
  134777. type TargetHttpsProxiesSetSslPolicyCall struct {
  134778. s *Service
  134779. project string
  134780. targetHttpsProxy string
  134781. sslpolicyreference *SslPolicyReference
  134782. urlParams_ gensupport.URLParams
  134783. ctx_ context.Context
  134784. header_ http.Header
  134785. }
  134786. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  134787. // policy specifies the server-side support for SSL features. This
  134788. // affects connections between clients and the HTTPS proxy load
  134789. // balancer. They do not affect the connection between the load balancer
  134790. // and the backends.
  134791. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  134792. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134793. c.project = project
  134794. c.targetHttpsProxy = targetHttpsProxy
  134795. c.sslpolicyreference = sslpolicyreference
  134796. return c
  134797. }
  134798. // RequestId sets the optional parameter "requestId": An optional
  134799. // request ID to identify requests. Specify a unique request ID so that
  134800. // if you must retry your request, the server will know to ignore the
  134801. // request if it has already been completed.
  134802. //
  134803. // For example, consider a situation where you make an initial request
  134804. // and the request times out. If you make the request again with the
  134805. // same request ID, the server can check if original operation with the
  134806. // same request ID was received, and if so, will ignore the second
  134807. // request. This prevents clients from accidentally creating duplicate
  134808. // commitments.
  134809. //
  134810. // The request ID must be a valid UUID with the exception that zero UUID
  134811. // is not supported (00000000-0000-0000-0000-000000000000).
  134812. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  134813. c.urlParams_.Set("requestId", requestId)
  134814. return c
  134815. }
  134816. // Fields allows partial responses to be retrieved. See
  134817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134818. // for more information.
  134819. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  134820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134821. return c
  134822. }
  134823. // Context sets the context to be used in this call's Do method. Any
  134824. // pending HTTP request will be aborted if the provided context is
  134825. // canceled.
  134826. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  134827. c.ctx_ = ctx
  134828. return c
  134829. }
  134830. // Header returns an http.Header that can be modified by the caller to
  134831. // add HTTP headers to the request.
  134832. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  134833. if c.header_ == nil {
  134834. c.header_ = make(http.Header)
  134835. }
  134836. return c.header_
  134837. }
  134838. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  134839. reqHeaders := make(http.Header)
  134840. for k, v := range c.header_ {
  134841. reqHeaders[k] = v
  134842. }
  134843. reqHeaders.Set("User-Agent", c.s.userAgent())
  134844. var body io.Reader = nil
  134845. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  134846. if err != nil {
  134847. return nil, err
  134848. }
  134849. reqHeaders.Set("Content-Type", "application/json")
  134850. c.urlParams_.Set("alt", alt)
  134851. c.urlParams_.Set("prettyPrint", "false")
  134852. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  134853. urls += "?" + c.urlParams_.Encode()
  134854. req, err := http.NewRequest("POST", urls, body)
  134855. if err != nil {
  134856. return nil, err
  134857. }
  134858. req.Header = reqHeaders
  134859. googleapi.Expand(req.URL, map[string]string{
  134860. "project": c.project,
  134861. "targetHttpsProxy": c.targetHttpsProxy,
  134862. })
  134863. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134864. }
  134865. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  134866. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  134867. // status code is an error. Response headers are in either
  134868. // *Operation.ServerResponse.Header or (if a response was returned at
  134869. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134870. // to check whether the returned error was because
  134871. // http.StatusNotModified was returned.
  134872. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  134873. gensupport.SetOptions(c.urlParams_, opts...)
  134874. res, err := c.doRequest("json")
  134875. if res != nil && res.StatusCode == http.StatusNotModified {
  134876. if res.Body != nil {
  134877. res.Body.Close()
  134878. }
  134879. return nil, &googleapi.Error{
  134880. Code: res.StatusCode,
  134881. Header: res.Header,
  134882. }
  134883. }
  134884. if err != nil {
  134885. return nil, err
  134886. }
  134887. defer googleapi.CloseBody(res)
  134888. if err := googleapi.CheckResponse(res); err != nil {
  134889. return nil, err
  134890. }
  134891. ret := &Operation{
  134892. ServerResponse: googleapi.ServerResponse{
  134893. Header: res.Header,
  134894. HTTPStatusCode: res.StatusCode,
  134895. },
  134896. }
  134897. target := &ret
  134898. if err := gensupport.DecodeResponse(target, res); err != nil {
  134899. return nil, err
  134900. }
  134901. return ret, nil
  134902. // {
  134903. // "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.",
  134904. // "httpMethod": "POST",
  134905. // "id": "compute.targetHttpsProxies.setSslPolicy",
  134906. // "parameterOrder": [
  134907. // "project",
  134908. // "targetHttpsProxy"
  134909. // ],
  134910. // "parameters": {
  134911. // "project": {
  134912. // "description": "Project ID for this request.",
  134913. // "location": "path",
  134914. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134915. // "required": true,
  134916. // "type": "string"
  134917. // },
  134918. // "requestId": {
  134919. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  134920. // "location": "query",
  134921. // "type": "string"
  134922. // },
  134923. // "targetHttpsProxy": {
  134924. // "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.",
  134925. // "location": "path",
  134926. // "required": true,
  134927. // "type": "string"
  134928. // }
  134929. // },
  134930. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  134931. // "request": {
  134932. // "$ref": "SslPolicyReference"
  134933. // },
  134934. // "response": {
  134935. // "$ref": "Operation"
  134936. // },
  134937. // "scopes": [
  134938. // "https://www.googleapis.com/auth/cloud-platform",
  134939. // "https://www.googleapis.com/auth/compute"
  134940. // ]
  134941. // }
  134942. }
  134943. // method id "compute.targetHttpsProxies.setUrlMap":
  134944. type TargetHttpsProxiesSetUrlMapCall struct {
  134945. s *Service
  134946. project string
  134947. targetHttpsProxy string
  134948. urlmapreference *UrlMapReference
  134949. urlParams_ gensupport.URLParams
  134950. ctx_ context.Context
  134951. header_ http.Header
  134952. }
  134953. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  134954. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  134955. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134956. c.project = project
  134957. c.targetHttpsProxy = targetHttpsProxy
  134958. c.urlmapreference = urlmapreference
  134959. return c
  134960. }
  134961. // RequestId sets the optional parameter "requestId": An optional
  134962. // request ID to identify requests. Specify a unique request ID so that
  134963. // if you must retry your request, the server will know to ignore the
  134964. // request if it has already been completed.
  134965. //
  134966. // For example, consider a situation where you make an initial request
  134967. // and the request times out. If you make the request again with the
  134968. // same request ID, the server can check if original operation with the
  134969. // same request ID was received, and if so, will ignore the second
  134970. // request. This prevents clients from accidentally creating duplicate
  134971. // commitments.
  134972. //
  134973. // The request ID must be a valid UUID with the exception that zero UUID
  134974. // is not supported (00000000-0000-0000-0000-000000000000).
  134975. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  134976. c.urlParams_.Set("requestId", requestId)
  134977. return c
  134978. }
  134979. // Fields allows partial responses to be retrieved. See
  134980. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134981. // for more information.
  134982. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  134983. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134984. return c
  134985. }
  134986. // Context sets the context to be used in this call's Do method. Any
  134987. // pending HTTP request will be aborted if the provided context is
  134988. // canceled.
  134989. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  134990. c.ctx_ = ctx
  134991. return c
  134992. }
  134993. // Header returns an http.Header that can be modified by the caller to
  134994. // add HTTP headers to the request.
  134995. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  134996. if c.header_ == nil {
  134997. c.header_ = make(http.Header)
  134998. }
  134999. return c.header_
  135000. }
  135001. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  135002. reqHeaders := make(http.Header)
  135003. for k, v := range c.header_ {
  135004. reqHeaders[k] = v
  135005. }
  135006. reqHeaders.Set("User-Agent", c.s.userAgent())
  135007. var body io.Reader = nil
  135008. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  135009. if err != nil {
  135010. return nil, err
  135011. }
  135012. reqHeaders.Set("Content-Type", "application/json")
  135013. c.urlParams_.Set("alt", alt)
  135014. c.urlParams_.Set("prettyPrint", "false")
  135015. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  135016. urls += "?" + c.urlParams_.Encode()
  135017. req, err := http.NewRequest("POST", urls, body)
  135018. if err != nil {
  135019. return nil, err
  135020. }
  135021. req.Header = reqHeaders
  135022. googleapi.Expand(req.URL, map[string]string{
  135023. "project": c.project,
  135024. "targetHttpsProxy": c.targetHttpsProxy,
  135025. })
  135026. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135027. }
  135028. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  135029. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  135030. // status code is an error. Response headers are in either
  135031. // *Operation.ServerResponse.Header or (if a response was returned at
  135032. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  135033. // to check whether the returned error was because
  135034. // http.StatusNotModified was returned.
  135035. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  135036. gensupport.SetOptions(c.urlParams_, opts...)
  135037. res, err := c.doRequest("json")
  135038. if res != nil && res.StatusCode == http.StatusNotModified {
  135039. if res.Body != nil {
  135040. res.Body.Close()
  135041. }
  135042. return nil, &googleapi.Error{
  135043. Code: res.StatusCode,
  135044. Header: res.Header,
  135045. }
  135046. }
  135047. if err != nil {
  135048. return nil, err
  135049. }
  135050. defer googleapi.CloseBody(res)
  135051. if err := googleapi.CheckResponse(res); err != nil {
  135052. return nil, err
  135053. }
  135054. ret := &Operation{
  135055. ServerResponse: googleapi.ServerResponse{
  135056. Header: res.Header,
  135057. HTTPStatusCode: res.StatusCode,
  135058. },
  135059. }
  135060. target := &ret
  135061. if err := gensupport.DecodeResponse(target, res); err != nil {
  135062. return nil, err
  135063. }
  135064. return ret, nil
  135065. // {
  135066. // "description": "Changes the URL map for TargetHttpsProxy.",
  135067. // "httpMethod": "POST",
  135068. // "id": "compute.targetHttpsProxies.setUrlMap",
  135069. // "parameterOrder": [
  135070. // "project",
  135071. // "targetHttpsProxy"
  135072. // ],
  135073. // "parameters": {
  135074. // "project": {
  135075. // "description": "Project ID for this request.",
  135076. // "location": "path",
  135077. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135078. // "required": true,
  135079. // "type": "string"
  135080. // },
  135081. // "requestId": {
  135082. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  135083. // "location": "query",
  135084. // "type": "string"
  135085. // },
  135086. // "targetHttpsProxy": {
  135087. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  135088. // "location": "path",
  135089. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135090. // "required": true,
  135091. // "type": "string"
  135092. // }
  135093. // },
  135094. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  135095. // "request": {
  135096. // "$ref": "UrlMapReference"
  135097. // },
  135098. // "response": {
  135099. // "$ref": "Operation"
  135100. // },
  135101. // "scopes": [
  135102. // "https://www.googleapis.com/auth/cloud-platform",
  135103. // "https://www.googleapis.com/auth/compute"
  135104. // ]
  135105. // }
  135106. }
  135107. // method id "compute.targetHttpsProxies.testIamPermissions":
  135108. type TargetHttpsProxiesTestIamPermissionsCall struct {
  135109. s *Service
  135110. project string
  135111. resource string
  135112. testpermissionsrequest *TestPermissionsRequest
  135113. urlParams_ gensupport.URLParams
  135114. ctx_ context.Context
  135115. header_ http.Header
  135116. }
  135117. // TestIamPermissions: Returns permissions that a caller has on the
  135118. // specified resource.
  135119. func (r *TargetHttpsProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpsProxiesTestIamPermissionsCall {
  135120. c := &TargetHttpsProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135121. c.project = project
  135122. c.resource = resource
  135123. c.testpermissionsrequest = testpermissionsrequest
  135124. return c
  135125. }
  135126. // Fields allows partial responses to be retrieved. See
  135127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135128. // for more information.
  135129. func (c *TargetHttpsProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesTestIamPermissionsCall {
  135130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135131. return c
  135132. }
  135133. // Context sets the context to be used in this call's Do method. Any
  135134. // pending HTTP request will be aborted if the provided context is
  135135. // canceled.
  135136. func (c *TargetHttpsProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpsProxiesTestIamPermissionsCall {
  135137. c.ctx_ = ctx
  135138. return c
  135139. }
  135140. // Header returns an http.Header that can be modified by the caller to
  135141. // add HTTP headers to the request.
  135142. func (c *TargetHttpsProxiesTestIamPermissionsCall) Header() http.Header {
  135143. if c.header_ == nil {
  135144. c.header_ = make(http.Header)
  135145. }
  135146. return c.header_
  135147. }
  135148. func (c *TargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  135149. reqHeaders := make(http.Header)
  135150. for k, v := range c.header_ {
  135151. reqHeaders[k] = v
  135152. }
  135153. reqHeaders.Set("User-Agent", c.s.userAgent())
  135154. var body io.Reader = nil
  135155. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  135156. if err != nil {
  135157. return nil, err
  135158. }
  135159. reqHeaders.Set("Content-Type", "application/json")
  135160. c.urlParams_.Set("alt", alt)
  135161. c.urlParams_.Set("prettyPrint", "false")
  135162. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{resource}/testIamPermissions")
  135163. urls += "?" + c.urlParams_.Encode()
  135164. req, err := http.NewRequest("POST", urls, body)
  135165. if err != nil {
  135166. return nil, err
  135167. }
  135168. req.Header = reqHeaders
  135169. googleapi.Expand(req.URL, map[string]string{
  135170. "project": c.project,
  135171. "resource": c.resource,
  135172. })
  135173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135174. }
  135175. // Do executes the "compute.targetHttpsProxies.testIamPermissions" call.
  135176. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  135177. // non-2xx status code is an error. Response headers are in either
  135178. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  135179. // returned at all) in error.(*googleapi.Error).Header. Use
  135180. // googleapi.IsNotModified to check whether the returned error was
  135181. // because http.StatusNotModified was returned.
  135182. func (c *TargetHttpsProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  135183. gensupport.SetOptions(c.urlParams_, opts...)
  135184. res, err := c.doRequest("json")
  135185. if res != nil && res.StatusCode == http.StatusNotModified {
  135186. if res.Body != nil {
  135187. res.Body.Close()
  135188. }
  135189. return nil, &googleapi.Error{
  135190. Code: res.StatusCode,
  135191. Header: res.Header,
  135192. }
  135193. }
  135194. if err != nil {
  135195. return nil, err
  135196. }
  135197. defer googleapi.CloseBody(res)
  135198. if err := googleapi.CheckResponse(res); err != nil {
  135199. return nil, err
  135200. }
  135201. ret := &TestPermissionsResponse{
  135202. ServerResponse: googleapi.ServerResponse{
  135203. Header: res.Header,
  135204. HTTPStatusCode: res.StatusCode,
  135205. },
  135206. }
  135207. target := &ret
  135208. if err := gensupport.DecodeResponse(target, res); err != nil {
  135209. return nil, err
  135210. }
  135211. return ret, nil
  135212. // {
  135213. // "description": "Returns permissions that a caller has on the specified resource.",
  135214. // "httpMethod": "POST",
  135215. // "id": "compute.targetHttpsProxies.testIamPermissions",
  135216. // "parameterOrder": [
  135217. // "project",
  135218. // "resource"
  135219. // ],
  135220. // "parameters": {
  135221. // "project": {
  135222. // "description": "Project ID for this request.",
  135223. // "location": "path",
  135224. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135225. // "required": true,
  135226. // "type": "string"
  135227. // },
  135228. // "resource": {
  135229. // "description": "Name or id of the resource for this request.",
  135230. // "location": "path",
  135231. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135232. // "required": true,
  135233. // "type": "string"
  135234. // }
  135235. // },
  135236. // "path": "{project}/global/targetHttpsProxies/{resource}/testIamPermissions",
  135237. // "request": {
  135238. // "$ref": "TestPermissionsRequest"
  135239. // },
  135240. // "response": {
  135241. // "$ref": "TestPermissionsResponse"
  135242. // },
  135243. // "scopes": [
  135244. // "https://www.googleapis.com/auth/cloud-platform",
  135245. // "https://www.googleapis.com/auth/compute",
  135246. // "https://www.googleapis.com/auth/compute.readonly"
  135247. // ]
  135248. // }
  135249. }
  135250. // method id "compute.targetInstances.aggregatedList":
  135251. type TargetInstancesAggregatedListCall struct {
  135252. s *Service
  135253. project string
  135254. urlParams_ gensupport.URLParams
  135255. ifNoneMatch_ string
  135256. ctx_ context.Context
  135257. header_ http.Header
  135258. }
  135259. // AggregatedList: Retrieves an aggregated list of target instances.
  135260. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  135261. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  135262. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135263. c.project = project
  135264. return c
  135265. }
  135266. // Filter sets the optional parameter "filter": A filter expression that
  135267. // filters resources listed in the response. The expression must specify
  135268. // the field name, a comparison operator, and the value that you want to
  135269. // use for filtering. The value must be a string, a number, or a
  135270. // boolean. The comparison operator must be either =, !=, >, or <.
  135271. //
  135272. // For example, if you are filtering Compute Engine instances, you can
  135273. // exclude instances named example-instance by specifying name !=
  135274. // example-instance.
  135275. //
  135276. // You can also filter nested fields. For example, you could specify
  135277. // scheduling.automaticRestart = false to include instances only if they
  135278. // are not scheduled for automatic restarts. You can use filtering on
  135279. // nested fields to filter based on resource labels.
  135280. //
  135281. // To filter on multiple expressions, provide each separate expression
  135282. // within parentheses. For example, (scheduling.automaticRestart = true)
  135283. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  135284. // AND expression. However, you can include AND and OR expressions
  135285. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  135286. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  135287. // true).
  135288. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  135289. c.urlParams_.Set("filter", filter)
  135290. return c
  135291. }
  135292. // MaxResults sets the optional parameter "maxResults": The maximum
  135293. // number of results per page that should be returned. If the number of
  135294. // available results is larger than maxResults, Compute Engine returns a
  135295. // nextPageToken that can be used to get the next page of results in
  135296. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  135297. // (Default: 500)
  135298. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  135299. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  135300. return c
  135301. }
  135302. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  135303. // a certain order. By default, results are returned in alphanumerical
  135304. // order based on the resource name.
  135305. //
  135306. // You can also sort results in descending order based on the creation
  135307. // timestamp using orderBy="creationTimestamp desc". This sorts results
  135308. // based on the creationTimestamp field in reverse chronological order
  135309. // (newest result first). Use this to sort resources like operations so
  135310. // that the newest operation is returned first.
  135311. //
  135312. // Currently, only sorting by name or creationTimestamp desc is
  135313. // supported.
  135314. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  135315. c.urlParams_.Set("orderBy", orderBy)
  135316. return c
  135317. }
  135318. // PageToken sets the optional parameter "pageToken": Specifies a page
  135319. // token to use. Set pageToken to the nextPageToken returned by a
  135320. // previous list request to get the next page of results.
  135321. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  135322. c.urlParams_.Set("pageToken", pageToken)
  135323. return c
  135324. }
  135325. // Fields allows partial responses to be retrieved. See
  135326. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135327. // for more information.
  135328. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  135329. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135330. return c
  135331. }
  135332. // IfNoneMatch sets the optional parameter which makes the operation
  135333. // fail if the object's ETag matches the given value. This is useful for
  135334. // getting updates only after the object has changed since the last
  135335. // request. Use googleapi.IsNotModified to check whether the response
  135336. // error from Do is the result of In-None-Match.
  135337. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  135338. c.ifNoneMatch_ = entityTag
  135339. return c
  135340. }
  135341. // Context sets the context to be used in this call's Do method. Any
  135342. // pending HTTP request will be aborted if the provided context is
  135343. // canceled.
  135344. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  135345. c.ctx_ = ctx
  135346. return c
  135347. }
  135348. // Header returns an http.Header that can be modified by the caller to
  135349. // add HTTP headers to the request.
  135350. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  135351. if c.header_ == nil {
  135352. c.header_ = make(http.Header)
  135353. }
  135354. return c.header_
  135355. }
  135356. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  135357. reqHeaders := make(http.Header)
  135358. for k, v := range c.header_ {
  135359. reqHeaders[k] = v
  135360. }
  135361. reqHeaders.Set("User-Agent", c.s.userAgent())
  135362. if c.ifNoneMatch_ != "" {
  135363. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  135364. }
  135365. var body io.Reader = nil
  135366. c.urlParams_.Set("alt", alt)
  135367. c.urlParams_.Set("prettyPrint", "false")
  135368. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  135369. urls += "?" + c.urlParams_.Encode()
  135370. req, err := http.NewRequest("GET", urls, body)
  135371. if err != nil {
  135372. return nil, err
  135373. }
  135374. req.Header = reqHeaders
  135375. googleapi.Expand(req.URL, map[string]string{
  135376. "project": c.project,
  135377. })
  135378. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135379. }
  135380. // Do executes the "compute.targetInstances.aggregatedList" call.
  135381. // Exactly one of *TargetInstanceAggregatedList or error will be
  135382. // non-nil. Any non-2xx status code is an error. Response headers are in
  135383. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  135384. // response was returned at all) in error.(*googleapi.Error).Header. Use
  135385. // googleapi.IsNotModified to check whether the returned error was
  135386. // because http.StatusNotModified was returned.
  135387. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  135388. gensupport.SetOptions(c.urlParams_, opts...)
  135389. res, err := c.doRequest("json")
  135390. if res != nil && res.StatusCode == http.StatusNotModified {
  135391. if res.Body != nil {
  135392. res.Body.Close()
  135393. }
  135394. return nil, &googleapi.Error{
  135395. Code: res.StatusCode,
  135396. Header: res.Header,
  135397. }
  135398. }
  135399. if err != nil {
  135400. return nil, err
  135401. }
  135402. defer googleapi.CloseBody(res)
  135403. if err := googleapi.CheckResponse(res); err != nil {
  135404. return nil, err
  135405. }
  135406. ret := &TargetInstanceAggregatedList{
  135407. ServerResponse: googleapi.ServerResponse{
  135408. Header: res.Header,
  135409. HTTPStatusCode: res.StatusCode,
  135410. },
  135411. }
  135412. target := &ret
  135413. if err := gensupport.DecodeResponse(target, res); err != nil {
  135414. return nil, err
  135415. }
  135416. return ret, nil
  135417. // {
  135418. // "description": "Retrieves an aggregated list of target instances.",
  135419. // "httpMethod": "GET",
  135420. // "id": "compute.targetInstances.aggregatedList",
  135421. // "parameterOrder": [
  135422. // "project"
  135423. // ],
  135424. // "parameters": {
  135425. // "filter": {
  135426. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  135427. // "location": "query",
  135428. // "type": "string"
  135429. // },
  135430. // "maxResults": {
  135431. // "default": "500",
  135432. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  135433. // "format": "uint32",
  135434. // "location": "query",
  135435. // "minimum": "0",
  135436. // "type": "integer"
  135437. // },
  135438. // "orderBy": {
  135439. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  135440. // "location": "query",
  135441. // "type": "string"
  135442. // },
  135443. // "pageToken": {
  135444. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  135445. // "location": "query",
  135446. // "type": "string"
  135447. // },
  135448. // "project": {
  135449. // "description": "Project ID for this request.",
  135450. // "location": "path",
  135451. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135452. // "required": true,
  135453. // "type": "string"
  135454. // }
  135455. // },
  135456. // "path": "{project}/aggregated/targetInstances",
  135457. // "response": {
  135458. // "$ref": "TargetInstanceAggregatedList"
  135459. // },
  135460. // "scopes": [
  135461. // "https://www.googleapis.com/auth/cloud-platform",
  135462. // "https://www.googleapis.com/auth/compute",
  135463. // "https://www.googleapis.com/auth/compute.readonly"
  135464. // ]
  135465. // }
  135466. }
  135467. // Pages invokes f for each page of results.
  135468. // A non-nil error returned from f will halt the iteration.
  135469. // The provided context supersedes any context provided to the Context method.
  135470. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  135471. c.ctx_ = ctx
  135472. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  135473. for {
  135474. x, err := c.Do()
  135475. if err != nil {
  135476. return err
  135477. }
  135478. if err := f(x); err != nil {
  135479. return err
  135480. }
  135481. if x.NextPageToken == "" {
  135482. return nil
  135483. }
  135484. c.PageToken(x.NextPageToken)
  135485. }
  135486. }
  135487. // method id "compute.targetInstances.delete":
  135488. type TargetInstancesDeleteCall struct {
  135489. s *Service
  135490. project string
  135491. zone string
  135492. targetInstance string
  135493. urlParams_ gensupport.URLParams
  135494. ctx_ context.Context
  135495. header_ http.Header
  135496. }
  135497. // Delete: Deletes the specified TargetInstance resource.
  135498. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  135499. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  135500. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135501. c.project = project
  135502. c.zone = zone
  135503. c.targetInstance = targetInstance
  135504. return c
  135505. }
  135506. // RequestId sets the optional parameter "requestId": An optional
  135507. // request ID to identify requests. Specify a unique request ID so that
  135508. // if you must retry your request, the server will know to ignore the
  135509. // request if it has already been completed.
  135510. //
  135511. // For example, consider a situation where you make an initial request
  135512. // and the request times out. If you make the request again with the
  135513. // same request ID, the server can check if original operation with the
  135514. // same request ID was received, and if so, will ignore the second
  135515. // request. This prevents clients from accidentally creating duplicate
  135516. // commitments.
  135517. //
  135518. // The request ID must be a valid UUID with the exception that zero UUID
  135519. // is not supported (00000000-0000-0000-0000-000000000000).
  135520. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  135521. c.urlParams_.Set("requestId", requestId)
  135522. return c
  135523. }
  135524. // Fields allows partial responses to be retrieved. See
  135525. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135526. // for more information.
  135527. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  135528. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135529. return c
  135530. }
  135531. // Context sets the context to be used in this call's Do method. Any
  135532. // pending HTTP request will be aborted if the provided context is
  135533. // canceled.
  135534. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  135535. c.ctx_ = ctx
  135536. return c
  135537. }
  135538. // Header returns an http.Header that can be modified by the caller to
  135539. // add HTTP headers to the request.
  135540. func (c *TargetInstancesDeleteCall) Header() http.Header {
  135541. if c.header_ == nil {
  135542. c.header_ = make(http.Header)
  135543. }
  135544. return c.header_
  135545. }
  135546. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  135547. reqHeaders := make(http.Header)
  135548. for k, v := range c.header_ {
  135549. reqHeaders[k] = v
  135550. }
  135551. reqHeaders.Set("User-Agent", c.s.userAgent())
  135552. var body io.Reader = nil
  135553. c.urlParams_.Set("alt", alt)
  135554. c.urlParams_.Set("prettyPrint", "false")
  135555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  135556. urls += "?" + c.urlParams_.Encode()
  135557. req, err := http.NewRequest("DELETE", urls, body)
  135558. if err != nil {
  135559. return nil, err
  135560. }
  135561. req.Header = reqHeaders
  135562. googleapi.Expand(req.URL, map[string]string{
  135563. "project": c.project,
  135564. "zone": c.zone,
  135565. "targetInstance": c.targetInstance,
  135566. })
  135567. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135568. }
  135569. // Do executes the "compute.targetInstances.delete" call.
  135570. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  135571. // status code is an error. Response headers are in either
  135572. // *Operation.ServerResponse.Header or (if a response was returned at
  135573. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  135574. // to check whether the returned error was because
  135575. // http.StatusNotModified was returned.
  135576. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  135577. gensupport.SetOptions(c.urlParams_, opts...)
  135578. res, err := c.doRequest("json")
  135579. if res != nil && res.StatusCode == http.StatusNotModified {
  135580. if res.Body != nil {
  135581. res.Body.Close()
  135582. }
  135583. return nil, &googleapi.Error{
  135584. Code: res.StatusCode,
  135585. Header: res.Header,
  135586. }
  135587. }
  135588. if err != nil {
  135589. return nil, err
  135590. }
  135591. defer googleapi.CloseBody(res)
  135592. if err := googleapi.CheckResponse(res); err != nil {
  135593. return nil, err
  135594. }
  135595. ret := &Operation{
  135596. ServerResponse: googleapi.ServerResponse{
  135597. Header: res.Header,
  135598. HTTPStatusCode: res.StatusCode,
  135599. },
  135600. }
  135601. target := &ret
  135602. if err := gensupport.DecodeResponse(target, res); err != nil {
  135603. return nil, err
  135604. }
  135605. return ret, nil
  135606. // {
  135607. // "description": "Deletes the specified TargetInstance resource.",
  135608. // "httpMethod": "DELETE",
  135609. // "id": "compute.targetInstances.delete",
  135610. // "parameterOrder": [
  135611. // "project",
  135612. // "zone",
  135613. // "targetInstance"
  135614. // ],
  135615. // "parameters": {
  135616. // "project": {
  135617. // "description": "Project ID for this request.",
  135618. // "location": "path",
  135619. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135620. // "required": true,
  135621. // "type": "string"
  135622. // },
  135623. // "requestId": {
  135624. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  135625. // "location": "query",
  135626. // "type": "string"
  135627. // },
  135628. // "targetInstance": {
  135629. // "description": "Name of the TargetInstance resource to delete.",
  135630. // "location": "path",
  135631. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135632. // "required": true,
  135633. // "type": "string"
  135634. // },
  135635. // "zone": {
  135636. // "description": "Name of the zone scoping this request.",
  135637. // "location": "path",
  135638. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135639. // "required": true,
  135640. // "type": "string"
  135641. // }
  135642. // },
  135643. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  135644. // "response": {
  135645. // "$ref": "Operation"
  135646. // },
  135647. // "scopes": [
  135648. // "https://www.googleapis.com/auth/cloud-platform",
  135649. // "https://www.googleapis.com/auth/compute"
  135650. // ]
  135651. // }
  135652. }
  135653. // method id "compute.targetInstances.get":
  135654. type TargetInstancesGetCall struct {
  135655. s *Service
  135656. project string
  135657. zone string
  135658. targetInstance string
  135659. urlParams_ gensupport.URLParams
  135660. ifNoneMatch_ string
  135661. ctx_ context.Context
  135662. header_ http.Header
  135663. }
  135664. // Get: Returns the specified TargetInstance resource. Gets a list of
  135665. // available target instances by making a list() request.
  135666. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  135667. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  135668. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135669. c.project = project
  135670. c.zone = zone
  135671. c.targetInstance = targetInstance
  135672. return c
  135673. }
  135674. // Fields allows partial responses to be retrieved. See
  135675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135676. // for more information.
  135677. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  135678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135679. return c
  135680. }
  135681. // IfNoneMatch sets the optional parameter which makes the operation
  135682. // fail if the object's ETag matches the given value. This is useful for
  135683. // getting updates only after the object has changed since the last
  135684. // request. Use googleapi.IsNotModified to check whether the response
  135685. // error from Do is the result of In-None-Match.
  135686. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  135687. c.ifNoneMatch_ = entityTag
  135688. return c
  135689. }
  135690. // Context sets the context to be used in this call's Do method. Any
  135691. // pending HTTP request will be aborted if the provided context is
  135692. // canceled.
  135693. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  135694. c.ctx_ = ctx
  135695. return c
  135696. }
  135697. // Header returns an http.Header that can be modified by the caller to
  135698. // add HTTP headers to the request.
  135699. func (c *TargetInstancesGetCall) Header() http.Header {
  135700. if c.header_ == nil {
  135701. c.header_ = make(http.Header)
  135702. }
  135703. return c.header_
  135704. }
  135705. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  135706. reqHeaders := make(http.Header)
  135707. for k, v := range c.header_ {
  135708. reqHeaders[k] = v
  135709. }
  135710. reqHeaders.Set("User-Agent", c.s.userAgent())
  135711. if c.ifNoneMatch_ != "" {
  135712. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  135713. }
  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}/targetInstances/{targetInstance}")
  135718. urls += "?" + c.urlParams_.Encode()
  135719. req, err := http.NewRequest("GET", 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. "targetInstance": c.targetInstance,
  135728. })
  135729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135730. }
  135731. // Do executes the "compute.targetInstances.get" call.
  135732. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  135733. // status code is an error. Response headers are in either
  135734. // *TargetInstance.ServerResponse.Header or (if a response was returned
  135735. // at all) in error.(*googleapi.Error).Header. Use
  135736. // googleapi.IsNotModified to check whether the returned error was
  135737. // because http.StatusNotModified was returned.
  135738. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  135739. gensupport.SetOptions(c.urlParams_, opts...)
  135740. res, err := c.doRequest("json")
  135741. if res != nil && res.StatusCode == http.StatusNotModified {
  135742. if res.Body != nil {
  135743. res.Body.Close()
  135744. }
  135745. return nil, &googleapi.Error{
  135746. Code: res.StatusCode,
  135747. Header: res.Header,
  135748. }
  135749. }
  135750. if err != nil {
  135751. return nil, err
  135752. }
  135753. defer googleapi.CloseBody(res)
  135754. if err := googleapi.CheckResponse(res); err != nil {
  135755. return nil, err
  135756. }
  135757. ret := &TargetInstance{
  135758. ServerResponse: googleapi.ServerResponse{
  135759. Header: res.Header,
  135760. HTTPStatusCode: res.StatusCode,
  135761. },
  135762. }
  135763. target := &ret
  135764. if err := gensupport.DecodeResponse(target, res); err != nil {
  135765. return nil, err
  135766. }
  135767. return ret, nil
  135768. // {
  135769. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  135770. // "httpMethod": "GET",
  135771. // "id": "compute.targetInstances.get",
  135772. // "parameterOrder": [
  135773. // "project",
  135774. // "zone",
  135775. // "targetInstance"
  135776. // ],
  135777. // "parameters": {
  135778. // "project": {
  135779. // "description": "Project ID for this request.",
  135780. // "location": "path",
  135781. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135782. // "required": true,
  135783. // "type": "string"
  135784. // },
  135785. // "targetInstance": {
  135786. // "description": "Name of the TargetInstance resource to return.",
  135787. // "location": "path",
  135788. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135789. // "required": true,
  135790. // "type": "string"
  135791. // },
  135792. // "zone": {
  135793. // "description": "Name of the zone scoping this request.",
  135794. // "location": "path",
  135795. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135796. // "required": true,
  135797. // "type": "string"
  135798. // }
  135799. // },
  135800. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  135801. // "response": {
  135802. // "$ref": "TargetInstance"
  135803. // },
  135804. // "scopes": [
  135805. // "https://www.googleapis.com/auth/cloud-platform",
  135806. // "https://www.googleapis.com/auth/compute",
  135807. // "https://www.googleapis.com/auth/compute.readonly"
  135808. // ]
  135809. // }
  135810. }
  135811. // method id "compute.targetInstances.insert":
  135812. type TargetInstancesInsertCall struct {
  135813. s *Service
  135814. project string
  135815. zone string
  135816. targetinstance *TargetInstance
  135817. urlParams_ gensupport.URLParams
  135818. ctx_ context.Context
  135819. header_ http.Header
  135820. }
  135821. // Insert: Creates a TargetInstance resource in the specified project
  135822. // and zone using the data included in the request.
  135823. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  135824. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  135825. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135826. c.project = project
  135827. c.zone = zone
  135828. c.targetinstance = targetinstance
  135829. return c
  135830. }
  135831. // RequestId sets the optional parameter "requestId": An optional
  135832. // request ID to identify requests. Specify a unique request ID so that
  135833. // if you must retry your request, the server will know to ignore the
  135834. // request if it has already been completed.
  135835. //
  135836. // For example, consider a situation where you make an initial request
  135837. // and the request times out. If you make the request again with the
  135838. // same request ID, the server can check if original operation with the
  135839. // same request ID was received, and if so, will ignore the second
  135840. // request. This prevents clients from accidentally creating duplicate
  135841. // commitments.
  135842. //
  135843. // The request ID must be a valid UUID with the exception that zero UUID
  135844. // is not supported (00000000-0000-0000-0000-000000000000).
  135845. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  135846. c.urlParams_.Set("requestId", requestId)
  135847. return c
  135848. }
  135849. // Fields allows partial responses to be retrieved. See
  135850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135851. // for more information.
  135852. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  135853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135854. return c
  135855. }
  135856. // Context sets the context to be used in this call's Do method. Any
  135857. // pending HTTP request will be aborted if the provided context is
  135858. // canceled.
  135859. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  135860. c.ctx_ = ctx
  135861. return c
  135862. }
  135863. // Header returns an http.Header that can be modified by the caller to
  135864. // add HTTP headers to the request.
  135865. func (c *TargetInstancesInsertCall) Header() http.Header {
  135866. if c.header_ == nil {
  135867. c.header_ = make(http.Header)
  135868. }
  135869. return c.header_
  135870. }
  135871. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  135872. reqHeaders := make(http.Header)
  135873. for k, v := range c.header_ {
  135874. reqHeaders[k] = v
  135875. }
  135876. reqHeaders.Set("User-Agent", c.s.userAgent())
  135877. var body io.Reader = nil
  135878. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  135879. if err != nil {
  135880. return nil, err
  135881. }
  135882. reqHeaders.Set("Content-Type", "application/json")
  135883. c.urlParams_.Set("alt", alt)
  135884. c.urlParams_.Set("prettyPrint", "false")
  135885. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  135886. urls += "?" + c.urlParams_.Encode()
  135887. req, err := http.NewRequest("POST", urls, body)
  135888. if err != nil {
  135889. return nil, err
  135890. }
  135891. req.Header = reqHeaders
  135892. googleapi.Expand(req.URL, map[string]string{
  135893. "project": c.project,
  135894. "zone": c.zone,
  135895. })
  135896. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135897. }
  135898. // Do executes the "compute.targetInstances.insert" call.
  135899. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  135900. // status code is an error. Response headers are in either
  135901. // *Operation.ServerResponse.Header or (if a response was returned at
  135902. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  135903. // to check whether the returned error was because
  135904. // http.StatusNotModified was returned.
  135905. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  135906. gensupport.SetOptions(c.urlParams_, opts...)
  135907. res, err := c.doRequest("json")
  135908. if res != nil && res.StatusCode == http.StatusNotModified {
  135909. if res.Body != nil {
  135910. res.Body.Close()
  135911. }
  135912. return nil, &googleapi.Error{
  135913. Code: res.StatusCode,
  135914. Header: res.Header,
  135915. }
  135916. }
  135917. if err != nil {
  135918. return nil, err
  135919. }
  135920. defer googleapi.CloseBody(res)
  135921. if err := googleapi.CheckResponse(res); err != nil {
  135922. return nil, err
  135923. }
  135924. ret := &Operation{
  135925. ServerResponse: googleapi.ServerResponse{
  135926. Header: res.Header,
  135927. HTTPStatusCode: res.StatusCode,
  135928. },
  135929. }
  135930. target := &ret
  135931. if err := gensupport.DecodeResponse(target, res); err != nil {
  135932. return nil, err
  135933. }
  135934. return ret, nil
  135935. // {
  135936. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  135937. // "httpMethod": "POST",
  135938. // "id": "compute.targetInstances.insert",
  135939. // "parameterOrder": [
  135940. // "project",
  135941. // "zone"
  135942. // ],
  135943. // "parameters": {
  135944. // "project": {
  135945. // "description": "Project ID for this request.",
  135946. // "location": "path",
  135947. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135948. // "required": true,
  135949. // "type": "string"
  135950. // },
  135951. // "requestId": {
  135952. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  135953. // "location": "query",
  135954. // "type": "string"
  135955. // },
  135956. // "zone": {
  135957. // "description": "Name of the zone scoping this request.",
  135958. // "location": "path",
  135959. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135960. // "required": true,
  135961. // "type": "string"
  135962. // }
  135963. // },
  135964. // "path": "{project}/zones/{zone}/targetInstances",
  135965. // "request": {
  135966. // "$ref": "TargetInstance"
  135967. // },
  135968. // "response": {
  135969. // "$ref": "Operation"
  135970. // },
  135971. // "scopes": [
  135972. // "https://www.googleapis.com/auth/cloud-platform",
  135973. // "https://www.googleapis.com/auth/compute"
  135974. // ]
  135975. // }
  135976. }
  135977. // method id "compute.targetInstances.list":
  135978. type TargetInstancesListCall struct {
  135979. s *Service
  135980. project string
  135981. zone string
  135982. urlParams_ gensupport.URLParams
  135983. ifNoneMatch_ string
  135984. ctx_ context.Context
  135985. header_ http.Header
  135986. }
  135987. // List: Retrieves a list of TargetInstance resources available to the
  135988. // specified project and zone.
  135989. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  135990. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  135991. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135992. c.project = project
  135993. c.zone = zone
  135994. return c
  135995. }
  135996. // Filter sets the optional parameter "filter": A filter expression that
  135997. // filters resources listed in the response. The expression must specify
  135998. // the field name, a comparison operator, and the value that you want to
  135999. // use for filtering. The value must be a string, a number, or a
  136000. // boolean. The comparison operator must be either =, !=, >, or <.
  136001. //
  136002. // For example, if you are filtering Compute Engine instances, you can
  136003. // exclude instances named example-instance by specifying name !=
  136004. // example-instance.
  136005. //
  136006. // You can also filter nested fields. For example, you could specify
  136007. // scheduling.automaticRestart = false to include instances only if they
  136008. // are not scheduled for automatic restarts. You can use filtering on
  136009. // nested fields to filter based on resource labels.
  136010. //
  136011. // To filter on multiple expressions, provide each separate expression
  136012. // within parentheses. For example, (scheduling.automaticRestart = true)
  136013. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  136014. // AND expression. However, you can include AND and OR expressions
  136015. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  136016. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  136017. // true).
  136018. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  136019. c.urlParams_.Set("filter", filter)
  136020. return c
  136021. }
  136022. // MaxResults sets the optional parameter "maxResults": The maximum
  136023. // number of results per page that should be returned. If the number of
  136024. // available results is larger than maxResults, Compute Engine returns a
  136025. // nextPageToken that can be used to get the next page of results in
  136026. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  136027. // (Default: 500)
  136028. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  136029. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  136030. return c
  136031. }
  136032. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  136033. // a certain order. By default, results are returned in alphanumerical
  136034. // order based on the resource name.
  136035. //
  136036. // You can also sort results in descending order based on the creation
  136037. // timestamp using orderBy="creationTimestamp desc". This sorts results
  136038. // based on the creationTimestamp field in reverse chronological order
  136039. // (newest result first). Use this to sort resources like operations so
  136040. // that the newest operation is returned first.
  136041. //
  136042. // Currently, only sorting by name or creationTimestamp desc is
  136043. // supported.
  136044. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  136045. c.urlParams_.Set("orderBy", orderBy)
  136046. return c
  136047. }
  136048. // PageToken sets the optional parameter "pageToken": Specifies a page
  136049. // token to use. Set pageToken to the nextPageToken returned by a
  136050. // previous list request to get the next page of results.
  136051. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  136052. c.urlParams_.Set("pageToken", pageToken)
  136053. return c
  136054. }
  136055. // Fields allows partial responses to be retrieved. See
  136056. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136057. // for more information.
  136058. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  136059. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136060. return c
  136061. }
  136062. // IfNoneMatch sets the optional parameter which makes the operation
  136063. // fail if the object's ETag matches the given value. This is useful for
  136064. // getting updates only after the object has changed since the last
  136065. // request. Use googleapi.IsNotModified to check whether the response
  136066. // error from Do is the result of In-None-Match.
  136067. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  136068. c.ifNoneMatch_ = entityTag
  136069. return c
  136070. }
  136071. // Context sets the context to be used in this call's Do method. Any
  136072. // pending HTTP request will be aborted if the provided context is
  136073. // canceled.
  136074. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  136075. c.ctx_ = ctx
  136076. return c
  136077. }
  136078. // Header returns an http.Header that can be modified by the caller to
  136079. // add HTTP headers to the request.
  136080. func (c *TargetInstancesListCall) Header() http.Header {
  136081. if c.header_ == nil {
  136082. c.header_ = make(http.Header)
  136083. }
  136084. return c.header_
  136085. }
  136086. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  136087. reqHeaders := make(http.Header)
  136088. for k, v := range c.header_ {
  136089. reqHeaders[k] = v
  136090. }
  136091. reqHeaders.Set("User-Agent", c.s.userAgent())
  136092. if c.ifNoneMatch_ != "" {
  136093. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  136094. }
  136095. var body io.Reader = nil
  136096. c.urlParams_.Set("alt", alt)
  136097. c.urlParams_.Set("prettyPrint", "false")
  136098. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  136099. urls += "?" + c.urlParams_.Encode()
  136100. req, err := http.NewRequest("GET", urls, body)
  136101. if err != nil {
  136102. return nil, err
  136103. }
  136104. req.Header = reqHeaders
  136105. googleapi.Expand(req.URL, map[string]string{
  136106. "project": c.project,
  136107. "zone": c.zone,
  136108. })
  136109. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136110. }
  136111. // Do executes the "compute.targetInstances.list" call.
  136112. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  136113. // non-2xx status code is an error. Response headers are in either
  136114. // *TargetInstanceList.ServerResponse.Header or (if a response was
  136115. // returned at all) in error.(*googleapi.Error).Header. Use
  136116. // googleapi.IsNotModified to check whether the returned error was
  136117. // because http.StatusNotModified was returned.
  136118. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  136119. gensupport.SetOptions(c.urlParams_, opts...)
  136120. res, err := c.doRequest("json")
  136121. if res != nil && res.StatusCode == http.StatusNotModified {
  136122. if res.Body != nil {
  136123. res.Body.Close()
  136124. }
  136125. return nil, &googleapi.Error{
  136126. Code: res.StatusCode,
  136127. Header: res.Header,
  136128. }
  136129. }
  136130. if err != nil {
  136131. return nil, err
  136132. }
  136133. defer googleapi.CloseBody(res)
  136134. if err := googleapi.CheckResponse(res); err != nil {
  136135. return nil, err
  136136. }
  136137. ret := &TargetInstanceList{
  136138. ServerResponse: googleapi.ServerResponse{
  136139. Header: res.Header,
  136140. HTTPStatusCode: res.StatusCode,
  136141. },
  136142. }
  136143. target := &ret
  136144. if err := gensupport.DecodeResponse(target, res); err != nil {
  136145. return nil, err
  136146. }
  136147. return ret, nil
  136148. // {
  136149. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  136150. // "httpMethod": "GET",
  136151. // "id": "compute.targetInstances.list",
  136152. // "parameterOrder": [
  136153. // "project",
  136154. // "zone"
  136155. // ],
  136156. // "parameters": {
  136157. // "filter": {
  136158. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  136159. // "location": "query",
  136160. // "type": "string"
  136161. // },
  136162. // "maxResults": {
  136163. // "default": "500",
  136164. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  136165. // "format": "uint32",
  136166. // "location": "query",
  136167. // "minimum": "0",
  136168. // "type": "integer"
  136169. // },
  136170. // "orderBy": {
  136171. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  136172. // "location": "query",
  136173. // "type": "string"
  136174. // },
  136175. // "pageToken": {
  136176. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  136177. // "location": "query",
  136178. // "type": "string"
  136179. // },
  136180. // "project": {
  136181. // "description": "Project ID for this request.",
  136182. // "location": "path",
  136183. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136184. // "required": true,
  136185. // "type": "string"
  136186. // },
  136187. // "zone": {
  136188. // "description": "Name of the zone scoping this request.",
  136189. // "location": "path",
  136190. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  136191. // "required": true,
  136192. // "type": "string"
  136193. // }
  136194. // },
  136195. // "path": "{project}/zones/{zone}/targetInstances",
  136196. // "response": {
  136197. // "$ref": "TargetInstanceList"
  136198. // },
  136199. // "scopes": [
  136200. // "https://www.googleapis.com/auth/cloud-platform",
  136201. // "https://www.googleapis.com/auth/compute",
  136202. // "https://www.googleapis.com/auth/compute.readonly"
  136203. // ]
  136204. // }
  136205. }
  136206. // Pages invokes f for each page of results.
  136207. // A non-nil error returned from f will halt the iteration.
  136208. // The provided context supersedes any context provided to the Context method.
  136209. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  136210. c.ctx_ = ctx
  136211. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  136212. for {
  136213. x, err := c.Do()
  136214. if err != nil {
  136215. return err
  136216. }
  136217. if err := f(x); err != nil {
  136218. return err
  136219. }
  136220. if x.NextPageToken == "" {
  136221. return nil
  136222. }
  136223. c.PageToken(x.NextPageToken)
  136224. }
  136225. }
  136226. // method id "compute.targetInstances.testIamPermissions":
  136227. type TargetInstancesTestIamPermissionsCall struct {
  136228. s *Service
  136229. project string
  136230. zone string
  136231. resource string
  136232. testpermissionsrequest *TestPermissionsRequest
  136233. urlParams_ gensupport.URLParams
  136234. ctx_ context.Context
  136235. header_ http.Header
  136236. }
  136237. // TestIamPermissions: Returns permissions that a caller has on the
  136238. // specified resource.
  136239. func (r *TargetInstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetInstancesTestIamPermissionsCall {
  136240. c := &TargetInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136241. c.project = project
  136242. c.zone = zone
  136243. c.resource = resource
  136244. c.testpermissionsrequest = testpermissionsrequest
  136245. return c
  136246. }
  136247. // Fields allows partial responses to be retrieved. See
  136248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136249. // for more information.
  136250. func (c *TargetInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetInstancesTestIamPermissionsCall {
  136251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136252. return c
  136253. }
  136254. // Context sets the context to be used in this call's Do method. Any
  136255. // pending HTTP request will be aborted if the provided context is
  136256. // canceled.
  136257. func (c *TargetInstancesTestIamPermissionsCall) Context(ctx context.Context) *TargetInstancesTestIamPermissionsCall {
  136258. c.ctx_ = ctx
  136259. return c
  136260. }
  136261. // Header returns an http.Header that can be modified by the caller to
  136262. // add HTTP headers to the request.
  136263. func (c *TargetInstancesTestIamPermissionsCall) Header() http.Header {
  136264. if c.header_ == nil {
  136265. c.header_ = make(http.Header)
  136266. }
  136267. return c.header_
  136268. }
  136269. func (c *TargetInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  136270. reqHeaders := make(http.Header)
  136271. for k, v := range c.header_ {
  136272. reqHeaders[k] = v
  136273. }
  136274. reqHeaders.Set("User-Agent", c.s.userAgent())
  136275. var body io.Reader = nil
  136276. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  136277. if err != nil {
  136278. return nil, err
  136279. }
  136280. reqHeaders.Set("Content-Type", "application/json")
  136281. c.urlParams_.Set("alt", alt)
  136282. c.urlParams_.Set("prettyPrint", "false")
  136283. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions")
  136284. urls += "?" + c.urlParams_.Encode()
  136285. req, err := http.NewRequest("POST", urls, body)
  136286. if err != nil {
  136287. return nil, err
  136288. }
  136289. req.Header = reqHeaders
  136290. googleapi.Expand(req.URL, map[string]string{
  136291. "project": c.project,
  136292. "zone": c.zone,
  136293. "resource": c.resource,
  136294. })
  136295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136296. }
  136297. // Do executes the "compute.targetInstances.testIamPermissions" call.
  136298. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  136299. // non-2xx status code is an error. Response headers are in either
  136300. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  136301. // returned at all) in error.(*googleapi.Error).Header. Use
  136302. // googleapi.IsNotModified to check whether the returned error was
  136303. // because http.StatusNotModified was returned.
  136304. func (c *TargetInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  136305. gensupport.SetOptions(c.urlParams_, opts...)
  136306. res, err := c.doRequest("json")
  136307. if res != nil && res.StatusCode == http.StatusNotModified {
  136308. if res.Body != nil {
  136309. res.Body.Close()
  136310. }
  136311. return nil, &googleapi.Error{
  136312. Code: res.StatusCode,
  136313. Header: res.Header,
  136314. }
  136315. }
  136316. if err != nil {
  136317. return nil, err
  136318. }
  136319. defer googleapi.CloseBody(res)
  136320. if err := googleapi.CheckResponse(res); err != nil {
  136321. return nil, err
  136322. }
  136323. ret := &TestPermissionsResponse{
  136324. ServerResponse: googleapi.ServerResponse{
  136325. Header: res.Header,
  136326. HTTPStatusCode: res.StatusCode,
  136327. },
  136328. }
  136329. target := &ret
  136330. if err := gensupport.DecodeResponse(target, res); err != nil {
  136331. return nil, err
  136332. }
  136333. return ret, nil
  136334. // {
  136335. // "description": "Returns permissions that a caller has on the specified resource.",
  136336. // "httpMethod": "POST",
  136337. // "id": "compute.targetInstances.testIamPermissions",
  136338. // "parameterOrder": [
  136339. // "project",
  136340. // "zone",
  136341. // "resource"
  136342. // ],
  136343. // "parameters": {
  136344. // "project": {
  136345. // "description": "Project ID for this request.",
  136346. // "location": "path",
  136347. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136348. // "required": true,
  136349. // "type": "string"
  136350. // },
  136351. // "resource": {
  136352. // "description": "Name or id of the resource for this request.",
  136353. // "location": "path",
  136354. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  136355. // "required": true,
  136356. // "type": "string"
  136357. // },
  136358. // "zone": {
  136359. // "description": "The name of the zone for this request.",
  136360. // "location": "path",
  136361. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  136362. // "required": true,
  136363. // "type": "string"
  136364. // }
  136365. // },
  136366. // "path": "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions",
  136367. // "request": {
  136368. // "$ref": "TestPermissionsRequest"
  136369. // },
  136370. // "response": {
  136371. // "$ref": "TestPermissionsResponse"
  136372. // },
  136373. // "scopes": [
  136374. // "https://www.googleapis.com/auth/cloud-platform",
  136375. // "https://www.googleapis.com/auth/compute",
  136376. // "https://www.googleapis.com/auth/compute.readonly"
  136377. // ]
  136378. // }
  136379. }
  136380. // method id "compute.targetPools.addHealthCheck":
  136381. type TargetPoolsAddHealthCheckCall struct {
  136382. s *Service
  136383. project string
  136384. region string
  136385. targetPool string
  136386. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  136387. urlParams_ gensupport.URLParams
  136388. ctx_ context.Context
  136389. header_ http.Header
  136390. }
  136391. // AddHealthCheck: Adds health check URLs to a target pool.
  136392. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  136393. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  136394. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136395. c.project = project
  136396. c.region = region
  136397. c.targetPool = targetPool
  136398. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  136399. return c
  136400. }
  136401. // RequestId sets the optional parameter "requestId": An optional
  136402. // request ID to identify requests. Specify a unique request ID so that
  136403. // if you must retry your request, the server will know to ignore the
  136404. // request if it has already been completed.
  136405. //
  136406. // For example, consider a situation where you make an initial request
  136407. // and the request times out. If you make the request again with the
  136408. // same request ID, the server can check if original operation with the
  136409. // same request ID was received, and if so, will ignore the second
  136410. // request. This prevents clients from accidentally creating duplicate
  136411. // commitments.
  136412. //
  136413. // The request ID must be a valid UUID with the exception that zero UUID
  136414. // is not supported (00000000-0000-0000-0000-000000000000).
  136415. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  136416. c.urlParams_.Set("requestId", requestId)
  136417. return c
  136418. }
  136419. // Fields allows partial responses to be retrieved. See
  136420. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136421. // for more information.
  136422. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  136423. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136424. return c
  136425. }
  136426. // Context sets the context to be used in this call's Do method. Any
  136427. // pending HTTP request will be aborted if the provided context is
  136428. // canceled.
  136429. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  136430. c.ctx_ = ctx
  136431. return c
  136432. }
  136433. // Header returns an http.Header that can be modified by the caller to
  136434. // add HTTP headers to the request.
  136435. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  136436. if c.header_ == nil {
  136437. c.header_ = make(http.Header)
  136438. }
  136439. return c.header_
  136440. }
  136441. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  136442. reqHeaders := make(http.Header)
  136443. for k, v := range c.header_ {
  136444. reqHeaders[k] = v
  136445. }
  136446. reqHeaders.Set("User-Agent", c.s.userAgent())
  136447. var body io.Reader = nil
  136448. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  136449. if err != nil {
  136450. return nil, err
  136451. }
  136452. reqHeaders.Set("Content-Type", "application/json")
  136453. c.urlParams_.Set("alt", alt)
  136454. c.urlParams_.Set("prettyPrint", "false")
  136455. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  136456. urls += "?" + c.urlParams_.Encode()
  136457. req, err := http.NewRequest("POST", urls, body)
  136458. if err != nil {
  136459. return nil, err
  136460. }
  136461. req.Header = reqHeaders
  136462. googleapi.Expand(req.URL, map[string]string{
  136463. "project": c.project,
  136464. "region": c.region,
  136465. "targetPool": c.targetPool,
  136466. })
  136467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136468. }
  136469. // Do executes the "compute.targetPools.addHealthCheck" call.
  136470. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  136471. // status code is an error. Response headers are in either
  136472. // *Operation.ServerResponse.Header or (if a response was returned at
  136473. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  136474. // to check whether the returned error was because
  136475. // http.StatusNotModified was returned.
  136476. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  136477. gensupport.SetOptions(c.urlParams_, opts...)
  136478. res, err := c.doRequest("json")
  136479. if res != nil && res.StatusCode == http.StatusNotModified {
  136480. if res.Body != nil {
  136481. res.Body.Close()
  136482. }
  136483. return nil, &googleapi.Error{
  136484. Code: res.StatusCode,
  136485. Header: res.Header,
  136486. }
  136487. }
  136488. if err != nil {
  136489. return nil, err
  136490. }
  136491. defer googleapi.CloseBody(res)
  136492. if err := googleapi.CheckResponse(res); err != nil {
  136493. return nil, err
  136494. }
  136495. ret := &Operation{
  136496. ServerResponse: googleapi.ServerResponse{
  136497. Header: res.Header,
  136498. HTTPStatusCode: res.StatusCode,
  136499. },
  136500. }
  136501. target := &ret
  136502. if err := gensupport.DecodeResponse(target, res); err != nil {
  136503. return nil, err
  136504. }
  136505. return ret, nil
  136506. // {
  136507. // "description": "Adds health check URLs to a target pool.",
  136508. // "httpMethod": "POST",
  136509. // "id": "compute.targetPools.addHealthCheck",
  136510. // "parameterOrder": [
  136511. // "project",
  136512. // "region",
  136513. // "targetPool"
  136514. // ],
  136515. // "parameters": {
  136516. // "project": {
  136517. // "description": "Project ID for this request.",
  136518. // "location": "path",
  136519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136520. // "required": true,
  136521. // "type": "string"
  136522. // },
  136523. // "region": {
  136524. // "description": "Name of the region scoping this request.",
  136525. // "location": "path",
  136526. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  136527. // "required": true,
  136528. // "type": "string"
  136529. // },
  136530. // "requestId": {
  136531. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  136532. // "location": "query",
  136533. // "type": "string"
  136534. // },
  136535. // "targetPool": {
  136536. // "description": "Name of the target pool to add a health check to.",
  136537. // "location": "path",
  136538. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  136539. // "required": true,
  136540. // "type": "string"
  136541. // }
  136542. // },
  136543. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  136544. // "request": {
  136545. // "$ref": "TargetPoolsAddHealthCheckRequest"
  136546. // },
  136547. // "response": {
  136548. // "$ref": "Operation"
  136549. // },
  136550. // "scopes": [
  136551. // "https://www.googleapis.com/auth/cloud-platform",
  136552. // "https://www.googleapis.com/auth/compute"
  136553. // ]
  136554. // }
  136555. }
  136556. // method id "compute.targetPools.addInstance":
  136557. type TargetPoolsAddInstanceCall struct {
  136558. s *Service
  136559. project string
  136560. region string
  136561. targetPool string
  136562. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  136563. urlParams_ gensupport.URLParams
  136564. ctx_ context.Context
  136565. header_ http.Header
  136566. }
  136567. // AddInstance: Adds an instance to a target pool.
  136568. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  136569. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  136570. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136571. c.project = project
  136572. c.region = region
  136573. c.targetPool = targetPool
  136574. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  136575. return c
  136576. }
  136577. // RequestId sets the optional parameter "requestId": An optional
  136578. // request ID to identify requests. Specify a unique request ID so that
  136579. // if you must retry your request, the server will know to ignore the
  136580. // request if it has already been completed.
  136581. //
  136582. // For example, consider a situation where you make an initial request
  136583. // and the request times out. If you make the request again with the
  136584. // same request ID, the server can check if original operation with the
  136585. // same request ID was received, and if so, will ignore the second
  136586. // request. This prevents clients from accidentally creating duplicate
  136587. // commitments.
  136588. //
  136589. // The request ID must be a valid UUID with the exception that zero UUID
  136590. // is not supported (00000000-0000-0000-0000-000000000000).
  136591. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  136592. c.urlParams_.Set("requestId", requestId)
  136593. return c
  136594. }
  136595. // Fields allows partial responses to be retrieved. See
  136596. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136597. // for more information.
  136598. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  136599. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136600. return c
  136601. }
  136602. // Context sets the context to be used in this call's Do method. Any
  136603. // pending HTTP request will be aborted if the provided context is
  136604. // canceled.
  136605. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  136606. c.ctx_ = ctx
  136607. return c
  136608. }
  136609. // Header returns an http.Header that can be modified by the caller to
  136610. // add HTTP headers to the request.
  136611. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  136612. if c.header_ == nil {
  136613. c.header_ = make(http.Header)
  136614. }
  136615. return c.header_
  136616. }
  136617. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  136618. reqHeaders := make(http.Header)
  136619. for k, v := range c.header_ {
  136620. reqHeaders[k] = v
  136621. }
  136622. reqHeaders.Set("User-Agent", c.s.userAgent())
  136623. var body io.Reader = nil
  136624. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  136625. if err != nil {
  136626. return nil, err
  136627. }
  136628. reqHeaders.Set("Content-Type", "application/json")
  136629. c.urlParams_.Set("alt", alt)
  136630. c.urlParams_.Set("prettyPrint", "false")
  136631. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  136632. urls += "?" + c.urlParams_.Encode()
  136633. req, err := http.NewRequest("POST", urls, body)
  136634. if err != nil {
  136635. return nil, err
  136636. }
  136637. req.Header = reqHeaders
  136638. googleapi.Expand(req.URL, map[string]string{
  136639. "project": c.project,
  136640. "region": c.region,
  136641. "targetPool": c.targetPool,
  136642. })
  136643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136644. }
  136645. // Do executes the "compute.targetPools.addInstance" call.
  136646. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  136647. // status code is an error. Response headers are in either
  136648. // *Operation.ServerResponse.Header or (if a response was returned at
  136649. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  136650. // to check whether the returned error was because
  136651. // http.StatusNotModified was returned.
  136652. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  136653. gensupport.SetOptions(c.urlParams_, opts...)
  136654. res, err := c.doRequest("json")
  136655. if res != nil && res.StatusCode == http.StatusNotModified {
  136656. if res.Body != nil {
  136657. res.Body.Close()
  136658. }
  136659. return nil, &googleapi.Error{
  136660. Code: res.StatusCode,
  136661. Header: res.Header,
  136662. }
  136663. }
  136664. if err != nil {
  136665. return nil, err
  136666. }
  136667. defer googleapi.CloseBody(res)
  136668. if err := googleapi.CheckResponse(res); err != nil {
  136669. return nil, err
  136670. }
  136671. ret := &Operation{
  136672. ServerResponse: googleapi.ServerResponse{
  136673. Header: res.Header,
  136674. HTTPStatusCode: res.StatusCode,
  136675. },
  136676. }
  136677. target := &ret
  136678. if err := gensupport.DecodeResponse(target, res); err != nil {
  136679. return nil, err
  136680. }
  136681. return ret, nil
  136682. // {
  136683. // "description": "Adds an instance to a target pool.",
  136684. // "httpMethod": "POST",
  136685. // "id": "compute.targetPools.addInstance",
  136686. // "parameterOrder": [
  136687. // "project",
  136688. // "region",
  136689. // "targetPool"
  136690. // ],
  136691. // "parameters": {
  136692. // "project": {
  136693. // "description": "Project ID for this request.",
  136694. // "location": "path",
  136695. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136696. // "required": true,
  136697. // "type": "string"
  136698. // },
  136699. // "region": {
  136700. // "description": "Name of the region scoping this request.",
  136701. // "location": "path",
  136702. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  136703. // "required": true,
  136704. // "type": "string"
  136705. // },
  136706. // "requestId": {
  136707. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  136708. // "location": "query",
  136709. // "type": "string"
  136710. // },
  136711. // "targetPool": {
  136712. // "description": "Name of the TargetPool resource to add instances to.",
  136713. // "location": "path",
  136714. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  136715. // "required": true,
  136716. // "type": "string"
  136717. // }
  136718. // },
  136719. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  136720. // "request": {
  136721. // "$ref": "TargetPoolsAddInstanceRequest"
  136722. // },
  136723. // "response": {
  136724. // "$ref": "Operation"
  136725. // },
  136726. // "scopes": [
  136727. // "https://www.googleapis.com/auth/cloud-platform",
  136728. // "https://www.googleapis.com/auth/compute"
  136729. // ]
  136730. // }
  136731. }
  136732. // method id "compute.targetPools.aggregatedList":
  136733. type TargetPoolsAggregatedListCall struct {
  136734. s *Service
  136735. project string
  136736. urlParams_ gensupport.URLParams
  136737. ifNoneMatch_ string
  136738. ctx_ context.Context
  136739. header_ http.Header
  136740. }
  136741. // AggregatedList: Retrieves an aggregated list of target pools.
  136742. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  136743. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  136744. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136745. c.project = project
  136746. return c
  136747. }
  136748. // Filter sets the optional parameter "filter": A filter expression that
  136749. // filters resources listed in the response. The expression must specify
  136750. // the field name, a comparison operator, and the value that you want to
  136751. // use for filtering. The value must be a string, a number, or a
  136752. // boolean. The comparison operator must be either =, !=, >, or <.
  136753. //
  136754. // For example, if you are filtering Compute Engine instances, you can
  136755. // exclude instances named example-instance by specifying name !=
  136756. // example-instance.
  136757. //
  136758. // You can also filter nested fields. For example, you could specify
  136759. // scheduling.automaticRestart = false to include instances only if they
  136760. // are not scheduled for automatic restarts. You can use filtering on
  136761. // nested fields to filter based on resource labels.
  136762. //
  136763. // To filter on multiple expressions, provide each separate expression
  136764. // within parentheses. For example, (scheduling.automaticRestart = true)
  136765. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  136766. // AND expression. However, you can include AND and OR expressions
  136767. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  136768. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  136769. // true).
  136770. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  136771. c.urlParams_.Set("filter", filter)
  136772. return c
  136773. }
  136774. // MaxResults sets the optional parameter "maxResults": The maximum
  136775. // number of results per page that should be returned. If the number of
  136776. // available results is larger than maxResults, Compute Engine returns a
  136777. // nextPageToken that can be used to get the next page of results in
  136778. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  136779. // (Default: 500)
  136780. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  136781. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  136782. return c
  136783. }
  136784. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  136785. // a certain order. By default, results are returned in alphanumerical
  136786. // order based on the resource name.
  136787. //
  136788. // You can also sort results in descending order based on the creation
  136789. // timestamp using orderBy="creationTimestamp desc". This sorts results
  136790. // based on the creationTimestamp field in reverse chronological order
  136791. // (newest result first). Use this to sort resources like operations so
  136792. // that the newest operation is returned first.
  136793. //
  136794. // Currently, only sorting by name or creationTimestamp desc is
  136795. // supported.
  136796. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  136797. c.urlParams_.Set("orderBy", orderBy)
  136798. return c
  136799. }
  136800. // PageToken sets the optional parameter "pageToken": Specifies a page
  136801. // token to use. Set pageToken to the nextPageToken returned by a
  136802. // previous list request to get the next page of results.
  136803. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  136804. c.urlParams_.Set("pageToken", pageToken)
  136805. return c
  136806. }
  136807. // Fields allows partial responses to be retrieved. See
  136808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136809. // for more information.
  136810. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  136811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136812. return c
  136813. }
  136814. // IfNoneMatch sets the optional parameter which makes the operation
  136815. // fail if the object's ETag matches the given value. This is useful for
  136816. // getting updates only after the object has changed since the last
  136817. // request. Use googleapi.IsNotModified to check whether the response
  136818. // error from Do is the result of In-None-Match.
  136819. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  136820. c.ifNoneMatch_ = entityTag
  136821. return c
  136822. }
  136823. // Context sets the context to be used in this call's Do method. Any
  136824. // pending HTTP request will be aborted if the provided context is
  136825. // canceled.
  136826. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  136827. c.ctx_ = ctx
  136828. return c
  136829. }
  136830. // Header returns an http.Header that can be modified by the caller to
  136831. // add HTTP headers to the request.
  136832. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  136833. if c.header_ == nil {
  136834. c.header_ = make(http.Header)
  136835. }
  136836. return c.header_
  136837. }
  136838. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  136839. reqHeaders := make(http.Header)
  136840. for k, v := range c.header_ {
  136841. reqHeaders[k] = v
  136842. }
  136843. reqHeaders.Set("User-Agent", c.s.userAgent())
  136844. if c.ifNoneMatch_ != "" {
  136845. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  136846. }
  136847. var body io.Reader = nil
  136848. c.urlParams_.Set("alt", alt)
  136849. c.urlParams_.Set("prettyPrint", "false")
  136850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  136851. urls += "?" + c.urlParams_.Encode()
  136852. req, err := http.NewRequest("GET", urls, body)
  136853. if err != nil {
  136854. return nil, err
  136855. }
  136856. req.Header = reqHeaders
  136857. googleapi.Expand(req.URL, map[string]string{
  136858. "project": c.project,
  136859. })
  136860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136861. }
  136862. // Do executes the "compute.targetPools.aggregatedList" call.
  136863. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  136864. // Any non-2xx status code is an error. Response headers are in either
  136865. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  136866. // returned at all) in error.(*googleapi.Error).Header. Use
  136867. // googleapi.IsNotModified to check whether the returned error was
  136868. // because http.StatusNotModified was returned.
  136869. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  136870. gensupport.SetOptions(c.urlParams_, opts...)
  136871. res, err := c.doRequest("json")
  136872. if res != nil && res.StatusCode == http.StatusNotModified {
  136873. if res.Body != nil {
  136874. res.Body.Close()
  136875. }
  136876. return nil, &googleapi.Error{
  136877. Code: res.StatusCode,
  136878. Header: res.Header,
  136879. }
  136880. }
  136881. if err != nil {
  136882. return nil, err
  136883. }
  136884. defer googleapi.CloseBody(res)
  136885. if err := googleapi.CheckResponse(res); err != nil {
  136886. return nil, err
  136887. }
  136888. ret := &TargetPoolAggregatedList{
  136889. ServerResponse: googleapi.ServerResponse{
  136890. Header: res.Header,
  136891. HTTPStatusCode: res.StatusCode,
  136892. },
  136893. }
  136894. target := &ret
  136895. if err := gensupport.DecodeResponse(target, res); err != nil {
  136896. return nil, err
  136897. }
  136898. return ret, nil
  136899. // {
  136900. // "description": "Retrieves an aggregated list of target pools.",
  136901. // "httpMethod": "GET",
  136902. // "id": "compute.targetPools.aggregatedList",
  136903. // "parameterOrder": [
  136904. // "project"
  136905. // ],
  136906. // "parameters": {
  136907. // "filter": {
  136908. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  136909. // "location": "query",
  136910. // "type": "string"
  136911. // },
  136912. // "maxResults": {
  136913. // "default": "500",
  136914. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  136915. // "format": "uint32",
  136916. // "location": "query",
  136917. // "minimum": "0",
  136918. // "type": "integer"
  136919. // },
  136920. // "orderBy": {
  136921. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  136922. // "location": "query",
  136923. // "type": "string"
  136924. // },
  136925. // "pageToken": {
  136926. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  136927. // "location": "query",
  136928. // "type": "string"
  136929. // },
  136930. // "project": {
  136931. // "description": "Project ID for this request.",
  136932. // "location": "path",
  136933. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136934. // "required": true,
  136935. // "type": "string"
  136936. // }
  136937. // },
  136938. // "path": "{project}/aggregated/targetPools",
  136939. // "response": {
  136940. // "$ref": "TargetPoolAggregatedList"
  136941. // },
  136942. // "scopes": [
  136943. // "https://www.googleapis.com/auth/cloud-platform",
  136944. // "https://www.googleapis.com/auth/compute",
  136945. // "https://www.googleapis.com/auth/compute.readonly"
  136946. // ]
  136947. // }
  136948. }
  136949. // Pages invokes f for each page of results.
  136950. // A non-nil error returned from f will halt the iteration.
  136951. // The provided context supersedes any context provided to the Context method.
  136952. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  136953. c.ctx_ = ctx
  136954. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  136955. for {
  136956. x, err := c.Do()
  136957. if err != nil {
  136958. return err
  136959. }
  136960. if err := f(x); err != nil {
  136961. return err
  136962. }
  136963. if x.NextPageToken == "" {
  136964. return nil
  136965. }
  136966. c.PageToken(x.NextPageToken)
  136967. }
  136968. }
  136969. // method id "compute.targetPools.delete":
  136970. type TargetPoolsDeleteCall struct {
  136971. s *Service
  136972. project string
  136973. region string
  136974. targetPool string
  136975. urlParams_ gensupport.URLParams
  136976. ctx_ context.Context
  136977. header_ http.Header
  136978. }
  136979. // Delete: Deletes the specified target pool.
  136980. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  136981. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  136982. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136983. c.project = project
  136984. c.region = region
  136985. c.targetPool = targetPool
  136986. return c
  136987. }
  136988. // RequestId sets the optional parameter "requestId": An optional
  136989. // request ID to identify requests. Specify a unique request ID so that
  136990. // if you must retry your request, the server will know to ignore the
  136991. // request if it has already been completed.
  136992. //
  136993. // For example, consider a situation where you make an initial request
  136994. // and the request times out. If you make the request again with the
  136995. // same request ID, the server can check if original operation with the
  136996. // same request ID was received, and if so, will ignore the second
  136997. // request. This prevents clients from accidentally creating duplicate
  136998. // commitments.
  136999. //
  137000. // The request ID must be a valid UUID with the exception that zero UUID
  137001. // is not supported (00000000-0000-0000-0000-000000000000).
  137002. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  137003. c.urlParams_.Set("requestId", requestId)
  137004. return c
  137005. }
  137006. // Fields allows partial responses to be retrieved. See
  137007. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137008. // for more information.
  137009. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  137010. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137011. return c
  137012. }
  137013. // Context sets the context to be used in this call's Do method. Any
  137014. // pending HTTP request will be aborted if the provided context is
  137015. // canceled.
  137016. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  137017. c.ctx_ = ctx
  137018. return c
  137019. }
  137020. // Header returns an http.Header that can be modified by the caller to
  137021. // add HTTP headers to the request.
  137022. func (c *TargetPoolsDeleteCall) Header() http.Header {
  137023. if c.header_ == nil {
  137024. c.header_ = make(http.Header)
  137025. }
  137026. return c.header_
  137027. }
  137028. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  137029. reqHeaders := make(http.Header)
  137030. for k, v := range c.header_ {
  137031. reqHeaders[k] = v
  137032. }
  137033. reqHeaders.Set("User-Agent", c.s.userAgent())
  137034. var body io.Reader = nil
  137035. c.urlParams_.Set("alt", alt)
  137036. c.urlParams_.Set("prettyPrint", "false")
  137037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  137038. urls += "?" + c.urlParams_.Encode()
  137039. req, err := http.NewRequest("DELETE", urls, body)
  137040. if err != nil {
  137041. return nil, err
  137042. }
  137043. req.Header = reqHeaders
  137044. googleapi.Expand(req.URL, map[string]string{
  137045. "project": c.project,
  137046. "region": c.region,
  137047. "targetPool": c.targetPool,
  137048. })
  137049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137050. }
  137051. // Do executes the "compute.targetPools.delete" call.
  137052. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  137053. // status code is an error. Response headers are in either
  137054. // *Operation.ServerResponse.Header or (if a response was returned at
  137055. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  137056. // to check whether the returned error was because
  137057. // http.StatusNotModified was returned.
  137058. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  137059. gensupport.SetOptions(c.urlParams_, opts...)
  137060. res, err := c.doRequest("json")
  137061. if res != nil && res.StatusCode == http.StatusNotModified {
  137062. if res.Body != nil {
  137063. res.Body.Close()
  137064. }
  137065. return nil, &googleapi.Error{
  137066. Code: res.StatusCode,
  137067. Header: res.Header,
  137068. }
  137069. }
  137070. if err != nil {
  137071. return nil, err
  137072. }
  137073. defer googleapi.CloseBody(res)
  137074. if err := googleapi.CheckResponse(res); err != nil {
  137075. return nil, err
  137076. }
  137077. ret := &Operation{
  137078. ServerResponse: googleapi.ServerResponse{
  137079. Header: res.Header,
  137080. HTTPStatusCode: res.StatusCode,
  137081. },
  137082. }
  137083. target := &ret
  137084. if err := gensupport.DecodeResponse(target, res); err != nil {
  137085. return nil, err
  137086. }
  137087. return ret, nil
  137088. // {
  137089. // "description": "Deletes the specified target pool.",
  137090. // "httpMethod": "DELETE",
  137091. // "id": "compute.targetPools.delete",
  137092. // "parameterOrder": [
  137093. // "project",
  137094. // "region",
  137095. // "targetPool"
  137096. // ],
  137097. // "parameters": {
  137098. // "project": {
  137099. // "description": "Project ID for this request.",
  137100. // "location": "path",
  137101. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137102. // "required": true,
  137103. // "type": "string"
  137104. // },
  137105. // "region": {
  137106. // "description": "Name of the region scoping this request.",
  137107. // "location": "path",
  137108. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  137109. // "required": true,
  137110. // "type": "string"
  137111. // },
  137112. // "requestId": {
  137113. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  137114. // "location": "query",
  137115. // "type": "string"
  137116. // },
  137117. // "targetPool": {
  137118. // "description": "Name of the TargetPool resource to delete.",
  137119. // "location": "path",
  137120. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  137121. // "required": true,
  137122. // "type": "string"
  137123. // }
  137124. // },
  137125. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  137126. // "response": {
  137127. // "$ref": "Operation"
  137128. // },
  137129. // "scopes": [
  137130. // "https://www.googleapis.com/auth/cloud-platform",
  137131. // "https://www.googleapis.com/auth/compute"
  137132. // ]
  137133. // }
  137134. }
  137135. // method id "compute.targetPools.get":
  137136. type TargetPoolsGetCall struct {
  137137. s *Service
  137138. project string
  137139. region string
  137140. targetPool string
  137141. urlParams_ gensupport.URLParams
  137142. ifNoneMatch_ string
  137143. ctx_ context.Context
  137144. header_ http.Header
  137145. }
  137146. // Get: Returns the specified target pool. Gets a list of available
  137147. // target pools by making a list() request.
  137148. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  137149. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  137150. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137151. c.project = project
  137152. c.region = region
  137153. c.targetPool = targetPool
  137154. return c
  137155. }
  137156. // Fields allows partial responses to be retrieved. See
  137157. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137158. // for more information.
  137159. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  137160. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137161. return c
  137162. }
  137163. // IfNoneMatch sets the optional parameter which makes the operation
  137164. // fail if the object's ETag matches the given value. This is useful for
  137165. // getting updates only after the object has changed since the last
  137166. // request. Use googleapi.IsNotModified to check whether the response
  137167. // error from Do is the result of In-None-Match.
  137168. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  137169. c.ifNoneMatch_ = entityTag
  137170. return c
  137171. }
  137172. // Context sets the context to be used in this call's Do method. Any
  137173. // pending HTTP request will be aborted if the provided context is
  137174. // canceled.
  137175. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  137176. c.ctx_ = ctx
  137177. return c
  137178. }
  137179. // Header returns an http.Header that can be modified by the caller to
  137180. // add HTTP headers to the request.
  137181. func (c *TargetPoolsGetCall) Header() http.Header {
  137182. if c.header_ == nil {
  137183. c.header_ = make(http.Header)
  137184. }
  137185. return c.header_
  137186. }
  137187. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  137188. reqHeaders := make(http.Header)
  137189. for k, v := range c.header_ {
  137190. reqHeaders[k] = v
  137191. }
  137192. reqHeaders.Set("User-Agent", c.s.userAgent())
  137193. if c.ifNoneMatch_ != "" {
  137194. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  137195. }
  137196. var body io.Reader = nil
  137197. c.urlParams_.Set("alt", alt)
  137198. c.urlParams_.Set("prettyPrint", "false")
  137199. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  137200. urls += "?" + c.urlParams_.Encode()
  137201. req, err := http.NewRequest("GET", urls, body)
  137202. if err != nil {
  137203. return nil, err
  137204. }
  137205. req.Header = reqHeaders
  137206. googleapi.Expand(req.URL, map[string]string{
  137207. "project": c.project,
  137208. "region": c.region,
  137209. "targetPool": c.targetPool,
  137210. })
  137211. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137212. }
  137213. // Do executes the "compute.targetPools.get" call.
  137214. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  137215. // status code is an error. Response headers are in either
  137216. // *TargetPool.ServerResponse.Header or (if a response was returned at
  137217. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  137218. // to check whether the returned error was because
  137219. // http.StatusNotModified was returned.
  137220. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  137221. gensupport.SetOptions(c.urlParams_, opts...)
  137222. res, err := c.doRequest("json")
  137223. if res != nil && res.StatusCode == http.StatusNotModified {
  137224. if res.Body != nil {
  137225. res.Body.Close()
  137226. }
  137227. return nil, &googleapi.Error{
  137228. Code: res.StatusCode,
  137229. Header: res.Header,
  137230. }
  137231. }
  137232. if err != nil {
  137233. return nil, err
  137234. }
  137235. defer googleapi.CloseBody(res)
  137236. if err := googleapi.CheckResponse(res); err != nil {
  137237. return nil, err
  137238. }
  137239. ret := &TargetPool{
  137240. ServerResponse: googleapi.ServerResponse{
  137241. Header: res.Header,
  137242. HTTPStatusCode: res.StatusCode,
  137243. },
  137244. }
  137245. target := &ret
  137246. if err := gensupport.DecodeResponse(target, res); err != nil {
  137247. return nil, err
  137248. }
  137249. return ret, nil
  137250. // {
  137251. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  137252. // "httpMethod": "GET",
  137253. // "id": "compute.targetPools.get",
  137254. // "parameterOrder": [
  137255. // "project",
  137256. // "region",
  137257. // "targetPool"
  137258. // ],
  137259. // "parameters": {
  137260. // "project": {
  137261. // "description": "Project ID for this request.",
  137262. // "location": "path",
  137263. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137264. // "required": true,
  137265. // "type": "string"
  137266. // },
  137267. // "region": {
  137268. // "description": "Name of the region scoping this request.",
  137269. // "location": "path",
  137270. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  137271. // "required": true,
  137272. // "type": "string"
  137273. // },
  137274. // "targetPool": {
  137275. // "description": "Name of the TargetPool resource to return.",
  137276. // "location": "path",
  137277. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  137278. // "required": true,
  137279. // "type": "string"
  137280. // }
  137281. // },
  137282. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  137283. // "response": {
  137284. // "$ref": "TargetPool"
  137285. // },
  137286. // "scopes": [
  137287. // "https://www.googleapis.com/auth/cloud-platform",
  137288. // "https://www.googleapis.com/auth/compute",
  137289. // "https://www.googleapis.com/auth/compute.readonly"
  137290. // ]
  137291. // }
  137292. }
  137293. // method id "compute.targetPools.getHealth":
  137294. type TargetPoolsGetHealthCall struct {
  137295. s *Service
  137296. project string
  137297. region string
  137298. targetPool string
  137299. instancereference *InstanceReference
  137300. urlParams_ gensupport.URLParams
  137301. ctx_ context.Context
  137302. header_ http.Header
  137303. }
  137304. // GetHealth: Gets the most recent health check results for each IP for
  137305. // the instance that is referenced by the given target pool.
  137306. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  137307. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  137308. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137309. c.project = project
  137310. c.region = region
  137311. c.targetPool = targetPool
  137312. c.instancereference = instancereference
  137313. return c
  137314. }
  137315. // Fields allows partial responses to be retrieved. See
  137316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137317. // for more information.
  137318. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  137319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137320. return c
  137321. }
  137322. // Context sets the context to be used in this call's Do method. Any
  137323. // pending HTTP request will be aborted if the provided context is
  137324. // canceled.
  137325. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  137326. c.ctx_ = ctx
  137327. return c
  137328. }
  137329. // Header returns an http.Header that can be modified by the caller to
  137330. // add HTTP headers to the request.
  137331. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  137332. if c.header_ == nil {
  137333. c.header_ = make(http.Header)
  137334. }
  137335. return c.header_
  137336. }
  137337. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  137338. reqHeaders := make(http.Header)
  137339. for k, v := range c.header_ {
  137340. reqHeaders[k] = v
  137341. }
  137342. reqHeaders.Set("User-Agent", c.s.userAgent())
  137343. var body io.Reader = nil
  137344. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  137345. if err != nil {
  137346. return nil, err
  137347. }
  137348. reqHeaders.Set("Content-Type", "application/json")
  137349. c.urlParams_.Set("alt", alt)
  137350. c.urlParams_.Set("prettyPrint", "false")
  137351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  137352. urls += "?" + c.urlParams_.Encode()
  137353. req, err := http.NewRequest("POST", urls, body)
  137354. if err != nil {
  137355. return nil, err
  137356. }
  137357. req.Header = reqHeaders
  137358. googleapi.Expand(req.URL, map[string]string{
  137359. "project": c.project,
  137360. "region": c.region,
  137361. "targetPool": c.targetPool,
  137362. })
  137363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137364. }
  137365. // Do executes the "compute.targetPools.getHealth" call.
  137366. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  137367. // Any non-2xx status code is an error. Response headers are in either
  137368. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  137369. // returned at all) in error.(*googleapi.Error).Header. Use
  137370. // googleapi.IsNotModified to check whether the returned error was
  137371. // because http.StatusNotModified was returned.
  137372. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  137373. gensupport.SetOptions(c.urlParams_, opts...)
  137374. res, err := c.doRequest("json")
  137375. if res != nil && res.StatusCode == http.StatusNotModified {
  137376. if res.Body != nil {
  137377. res.Body.Close()
  137378. }
  137379. return nil, &googleapi.Error{
  137380. Code: res.StatusCode,
  137381. Header: res.Header,
  137382. }
  137383. }
  137384. if err != nil {
  137385. return nil, err
  137386. }
  137387. defer googleapi.CloseBody(res)
  137388. if err := googleapi.CheckResponse(res); err != nil {
  137389. return nil, err
  137390. }
  137391. ret := &TargetPoolInstanceHealth{
  137392. ServerResponse: googleapi.ServerResponse{
  137393. Header: res.Header,
  137394. HTTPStatusCode: res.StatusCode,
  137395. },
  137396. }
  137397. target := &ret
  137398. if err := gensupport.DecodeResponse(target, res); err != nil {
  137399. return nil, err
  137400. }
  137401. return ret, nil
  137402. // {
  137403. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  137404. // "httpMethod": "POST",
  137405. // "id": "compute.targetPools.getHealth",
  137406. // "parameterOrder": [
  137407. // "project",
  137408. // "region",
  137409. // "targetPool"
  137410. // ],
  137411. // "parameters": {
  137412. // "project": {
  137413. // "description": "Project ID for this request.",
  137414. // "location": "path",
  137415. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137416. // "required": true,
  137417. // "type": "string"
  137418. // },
  137419. // "region": {
  137420. // "description": "Name of the region scoping this request.",
  137421. // "location": "path",
  137422. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  137423. // "required": true,
  137424. // "type": "string"
  137425. // },
  137426. // "targetPool": {
  137427. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  137428. // "location": "path",
  137429. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  137430. // "required": true,
  137431. // "type": "string"
  137432. // }
  137433. // },
  137434. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  137435. // "request": {
  137436. // "$ref": "InstanceReference"
  137437. // },
  137438. // "response": {
  137439. // "$ref": "TargetPoolInstanceHealth"
  137440. // },
  137441. // "scopes": [
  137442. // "https://www.googleapis.com/auth/cloud-platform",
  137443. // "https://www.googleapis.com/auth/compute",
  137444. // "https://www.googleapis.com/auth/compute.readonly"
  137445. // ]
  137446. // }
  137447. }
  137448. // method id "compute.targetPools.insert":
  137449. type TargetPoolsInsertCall struct {
  137450. s *Service
  137451. project string
  137452. region string
  137453. targetpool *TargetPool
  137454. urlParams_ gensupport.URLParams
  137455. ctx_ context.Context
  137456. header_ http.Header
  137457. }
  137458. // Insert: Creates a target pool in the specified project and region
  137459. // using the data included in the request.
  137460. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  137461. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  137462. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137463. c.project = project
  137464. c.region = region
  137465. c.targetpool = targetpool
  137466. return c
  137467. }
  137468. // RequestId sets the optional parameter "requestId": An optional
  137469. // request ID to identify requests. Specify a unique request ID so that
  137470. // if you must retry your request, the server will know to ignore the
  137471. // request if it has already been completed.
  137472. //
  137473. // For example, consider a situation where you make an initial request
  137474. // and the request times out. If you make the request again with the
  137475. // same request ID, the server can check if original operation with the
  137476. // same request ID was received, and if so, will ignore the second
  137477. // request. This prevents clients from accidentally creating duplicate
  137478. // commitments.
  137479. //
  137480. // The request ID must be a valid UUID with the exception that zero UUID
  137481. // is not supported (00000000-0000-0000-0000-000000000000).
  137482. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  137483. c.urlParams_.Set("requestId", requestId)
  137484. return c
  137485. }
  137486. // Fields allows partial responses to be retrieved. See
  137487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137488. // for more information.
  137489. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  137490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137491. return c
  137492. }
  137493. // Context sets the context to be used in this call's Do method. Any
  137494. // pending HTTP request will be aborted if the provided context is
  137495. // canceled.
  137496. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  137497. c.ctx_ = ctx
  137498. return c
  137499. }
  137500. // Header returns an http.Header that can be modified by the caller to
  137501. // add HTTP headers to the request.
  137502. func (c *TargetPoolsInsertCall) Header() http.Header {
  137503. if c.header_ == nil {
  137504. c.header_ = make(http.Header)
  137505. }
  137506. return c.header_
  137507. }
  137508. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  137509. reqHeaders := make(http.Header)
  137510. for k, v := range c.header_ {
  137511. reqHeaders[k] = v
  137512. }
  137513. reqHeaders.Set("User-Agent", c.s.userAgent())
  137514. var body io.Reader = nil
  137515. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  137516. if err != nil {
  137517. return nil, err
  137518. }
  137519. reqHeaders.Set("Content-Type", "application/json")
  137520. c.urlParams_.Set("alt", alt)
  137521. c.urlParams_.Set("prettyPrint", "false")
  137522. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  137523. urls += "?" + c.urlParams_.Encode()
  137524. req, err := http.NewRequest("POST", urls, body)
  137525. if err != nil {
  137526. return nil, err
  137527. }
  137528. req.Header = reqHeaders
  137529. googleapi.Expand(req.URL, map[string]string{
  137530. "project": c.project,
  137531. "region": c.region,
  137532. })
  137533. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137534. }
  137535. // Do executes the "compute.targetPools.insert" call.
  137536. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  137537. // status code is an error. Response headers are in either
  137538. // *Operation.ServerResponse.Header or (if a response was returned at
  137539. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  137540. // to check whether the returned error was because
  137541. // http.StatusNotModified was returned.
  137542. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  137543. gensupport.SetOptions(c.urlParams_, opts...)
  137544. res, err := c.doRequest("json")
  137545. if res != nil && res.StatusCode == http.StatusNotModified {
  137546. if res.Body != nil {
  137547. res.Body.Close()
  137548. }
  137549. return nil, &googleapi.Error{
  137550. Code: res.StatusCode,
  137551. Header: res.Header,
  137552. }
  137553. }
  137554. if err != nil {
  137555. return nil, err
  137556. }
  137557. defer googleapi.CloseBody(res)
  137558. if err := googleapi.CheckResponse(res); err != nil {
  137559. return nil, err
  137560. }
  137561. ret := &Operation{
  137562. ServerResponse: googleapi.ServerResponse{
  137563. Header: res.Header,
  137564. HTTPStatusCode: res.StatusCode,
  137565. },
  137566. }
  137567. target := &ret
  137568. if err := gensupport.DecodeResponse(target, res); err != nil {
  137569. return nil, err
  137570. }
  137571. return ret, nil
  137572. // {
  137573. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  137574. // "httpMethod": "POST",
  137575. // "id": "compute.targetPools.insert",
  137576. // "parameterOrder": [
  137577. // "project",
  137578. // "region"
  137579. // ],
  137580. // "parameters": {
  137581. // "project": {
  137582. // "description": "Project ID for this request.",
  137583. // "location": "path",
  137584. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137585. // "required": true,
  137586. // "type": "string"
  137587. // },
  137588. // "region": {
  137589. // "description": "Name of the region scoping this request.",
  137590. // "location": "path",
  137591. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  137592. // "required": true,
  137593. // "type": "string"
  137594. // },
  137595. // "requestId": {
  137596. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  137597. // "location": "query",
  137598. // "type": "string"
  137599. // }
  137600. // },
  137601. // "path": "{project}/regions/{region}/targetPools",
  137602. // "request": {
  137603. // "$ref": "TargetPool"
  137604. // },
  137605. // "response": {
  137606. // "$ref": "Operation"
  137607. // },
  137608. // "scopes": [
  137609. // "https://www.googleapis.com/auth/cloud-platform",
  137610. // "https://www.googleapis.com/auth/compute"
  137611. // ]
  137612. // }
  137613. }
  137614. // method id "compute.targetPools.list":
  137615. type TargetPoolsListCall struct {
  137616. s *Service
  137617. project string
  137618. region string
  137619. urlParams_ gensupport.URLParams
  137620. ifNoneMatch_ string
  137621. ctx_ context.Context
  137622. header_ http.Header
  137623. }
  137624. // List: Retrieves a list of target pools available to the specified
  137625. // project and region.
  137626. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  137627. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  137628. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137629. c.project = project
  137630. c.region = region
  137631. return c
  137632. }
  137633. // Filter sets the optional parameter "filter": A filter expression that
  137634. // filters resources listed in the response. The expression must specify
  137635. // the field name, a comparison operator, and the value that you want to
  137636. // use for filtering. The value must be a string, a number, or a
  137637. // boolean. The comparison operator must be either =, !=, >, or <.
  137638. //
  137639. // For example, if you are filtering Compute Engine instances, you can
  137640. // exclude instances named example-instance by specifying name !=
  137641. // example-instance.
  137642. //
  137643. // You can also filter nested fields. For example, you could specify
  137644. // scheduling.automaticRestart = false to include instances only if they
  137645. // are not scheduled for automatic restarts. You can use filtering on
  137646. // nested fields to filter based on resource labels.
  137647. //
  137648. // To filter on multiple expressions, provide each separate expression
  137649. // within parentheses. For example, (scheduling.automaticRestart = true)
  137650. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  137651. // AND expression. However, you can include AND and OR expressions
  137652. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  137653. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  137654. // true).
  137655. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  137656. c.urlParams_.Set("filter", filter)
  137657. return c
  137658. }
  137659. // MaxResults sets the optional parameter "maxResults": The maximum
  137660. // number of results per page that should be returned. If the number of
  137661. // available results is larger than maxResults, Compute Engine returns a
  137662. // nextPageToken that can be used to get the next page of results in
  137663. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  137664. // (Default: 500)
  137665. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  137666. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  137667. return c
  137668. }
  137669. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  137670. // a certain order. By default, results are returned in alphanumerical
  137671. // order based on the resource name.
  137672. //
  137673. // You can also sort results in descending order based on the creation
  137674. // timestamp using orderBy="creationTimestamp desc". This sorts results
  137675. // based on the creationTimestamp field in reverse chronological order
  137676. // (newest result first). Use this to sort resources like operations so
  137677. // that the newest operation is returned first.
  137678. //
  137679. // Currently, only sorting by name or creationTimestamp desc is
  137680. // supported.
  137681. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  137682. c.urlParams_.Set("orderBy", orderBy)
  137683. return c
  137684. }
  137685. // PageToken sets the optional parameter "pageToken": Specifies a page
  137686. // token to use. Set pageToken to the nextPageToken returned by a
  137687. // previous list request to get the next page of results.
  137688. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  137689. c.urlParams_.Set("pageToken", pageToken)
  137690. return c
  137691. }
  137692. // Fields allows partial responses to be retrieved. See
  137693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137694. // for more information.
  137695. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  137696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137697. return c
  137698. }
  137699. // IfNoneMatch sets the optional parameter which makes the operation
  137700. // fail if the object's ETag matches the given value. This is useful for
  137701. // getting updates only after the object has changed since the last
  137702. // request. Use googleapi.IsNotModified to check whether the response
  137703. // error from Do is the result of In-None-Match.
  137704. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  137705. c.ifNoneMatch_ = entityTag
  137706. return c
  137707. }
  137708. // Context sets the context to be used in this call's Do method. Any
  137709. // pending HTTP request will be aborted if the provided context is
  137710. // canceled.
  137711. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  137712. c.ctx_ = ctx
  137713. return c
  137714. }
  137715. // Header returns an http.Header that can be modified by the caller to
  137716. // add HTTP headers to the request.
  137717. func (c *TargetPoolsListCall) Header() http.Header {
  137718. if c.header_ == nil {
  137719. c.header_ = make(http.Header)
  137720. }
  137721. return c.header_
  137722. }
  137723. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  137724. reqHeaders := make(http.Header)
  137725. for k, v := range c.header_ {
  137726. reqHeaders[k] = v
  137727. }
  137728. reqHeaders.Set("User-Agent", c.s.userAgent())
  137729. if c.ifNoneMatch_ != "" {
  137730. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  137731. }
  137732. var body io.Reader = nil
  137733. c.urlParams_.Set("alt", alt)
  137734. c.urlParams_.Set("prettyPrint", "false")
  137735. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  137736. urls += "?" + c.urlParams_.Encode()
  137737. req, err := http.NewRequest("GET", urls, body)
  137738. if err != nil {
  137739. return nil, err
  137740. }
  137741. req.Header = reqHeaders
  137742. googleapi.Expand(req.URL, map[string]string{
  137743. "project": c.project,
  137744. "region": c.region,
  137745. })
  137746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137747. }
  137748. // Do executes the "compute.targetPools.list" call.
  137749. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  137750. // status code is an error. Response headers are in either
  137751. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  137752. // at all) in error.(*googleapi.Error).Header. Use
  137753. // googleapi.IsNotModified to check whether the returned error was
  137754. // because http.StatusNotModified was returned.
  137755. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  137756. gensupport.SetOptions(c.urlParams_, opts...)
  137757. res, err := c.doRequest("json")
  137758. if res != nil && res.StatusCode == http.StatusNotModified {
  137759. if res.Body != nil {
  137760. res.Body.Close()
  137761. }
  137762. return nil, &googleapi.Error{
  137763. Code: res.StatusCode,
  137764. Header: res.Header,
  137765. }
  137766. }
  137767. if err != nil {
  137768. return nil, err
  137769. }
  137770. defer googleapi.CloseBody(res)
  137771. if err := googleapi.CheckResponse(res); err != nil {
  137772. return nil, err
  137773. }
  137774. ret := &TargetPoolList{
  137775. ServerResponse: googleapi.ServerResponse{
  137776. Header: res.Header,
  137777. HTTPStatusCode: res.StatusCode,
  137778. },
  137779. }
  137780. target := &ret
  137781. if err := gensupport.DecodeResponse(target, res); err != nil {
  137782. return nil, err
  137783. }
  137784. return ret, nil
  137785. // {
  137786. // "description": "Retrieves a list of target pools available to the specified project and region.",
  137787. // "httpMethod": "GET",
  137788. // "id": "compute.targetPools.list",
  137789. // "parameterOrder": [
  137790. // "project",
  137791. // "region"
  137792. // ],
  137793. // "parameters": {
  137794. // "filter": {
  137795. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  137796. // "location": "query",
  137797. // "type": "string"
  137798. // },
  137799. // "maxResults": {
  137800. // "default": "500",
  137801. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  137802. // "format": "uint32",
  137803. // "location": "query",
  137804. // "minimum": "0",
  137805. // "type": "integer"
  137806. // },
  137807. // "orderBy": {
  137808. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  137809. // "location": "query",
  137810. // "type": "string"
  137811. // },
  137812. // "pageToken": {
  137813. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  137814. // "location": "query",
  137815. // "type": "string"
  137816. // },
  137817. // "project": {
  137818. // "description": "Project ID for this request.",
  137819. // "location": "path",
  137820. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137821. // "required": true,
  137822. // "type": "string"
  137823. // },
  137824. // "region": {
  137825. // "description": "Name of the region scoping this request.",
  137826. // "location": "path",
  137827. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  137828. // "required": true,
  137829. // "type": "string"
  137830. // }
  137831. // },
  137832. // "path": "{project}/regions/{region}/targetPools",
  137833. // "response": {
  137834. // "$ref": "TargetPoolList"
  137835. // },
  137836. // "scopes": [
  137837. // "https://www.googleapis.com/auth/cloud-platform",
  137838. // "https://www.googleapis.com/auth/compute",
  137839. // "https://www.googleapis.com/auth/compute.readonly"
  137840. // ]
  137841. // }
  137842. }
  137843. // Pages invokes f for each page of results.
  137844. // A non-nil error returned from f will halt the iteration.
  137845. // The provided context supersedes any context provided to the Context method.
  137846. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  137847. c.ctx_ = ctx
  137848. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  137849. for {
  137850. x, err := c.Do()
  137851. if err != nil {
  137852. return err
  137853. }
  137854. if err := f(x); err != nil {
  137855. return err
  137856. }
  137857. if x.NextPageToken == "" {
  137858. return nil
  137859. }
  137860. c.PageToken(x.NextPageToken)
  137861. }
  137862. }
  137863. // method id "compute.targetPools.removeHealthCheck":
  137864. type TargetPoolsRemoveHealthCheckCall struct {
  137865. s *Service
  137866. project string
  137867. region string
  137868. targetPool string
  137869. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  137870. urlParams_ gensupport.URLParams
  137871. ctx_ context.Context
  137872. header_ http.Header
  137873. }
  137874. // RemoveHealthCheck: Removes health check URL from a target pool.
  137875. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  137876. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  137877. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137878. c.project = project
  137879. c.region = region
  137880. c.targetPool = targetPool
  137881. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  137882. return c
  137883. }
  137884. // RequestId sets the optional parameter "requestId": An optional
  137885. // request ID to identify requests. Specify a unique request ID so that
  137886. // if you must retry your request, the server will know to ignore the
  137887. // request if it has already been completed.
  137888. //
  137889. // For example, consider a situation where you make an initial request
  137890. // and the request times out. If you make the request again with the
  137891. // same request ID, the server can check if original operation with the
  137892. // same request ID was received, and if so, will ignore the second
  137893. // request. This prevents clients from accidentally creating duplicate
  137894. // commitments.
  137895. //
  137896. // The request ID must be a valid UUID with the exception that zero UUID
  137897. // is not supported (00000000-0000-0000-0000-000000000000).
  137898. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  137899. c.urlParams_.Set("requestId", requestId)
  137900. return c
  137901. }
  137902. // Fields allows partial responses to be retrieved. See
  137903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137904. // for more information.
  137905. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  137906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137907. return c
  137908. }
  137909. // Context sets the context to be used in this call's Do method. Any
  137910. // pending HTTP request will be aborted if the provided context is
  137911. // canceled.
  137912. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  137913. c.ctx_ = ctx
  137914. return c
  137915. }
  137916. // Header returns an http.Header that can be modified by the caller to
  137917. // add HTTP headers to the request.
  137918. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  137919. if c.header_ == nil {
  137920. c.header_ = make(http.Header)
  137921. }
  137922. return c.header_
  137923. }
  137924. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  137925. reqHeaders := make(http.Header)
  137926. for k, v := range c.header_ {
  137927. reqHeaders[k] = v
  137928. }
  137929. reqHeaders.Set("User-Agent", c.s.userAgent())
  137930. var body io.Reader = nil
  137931. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  137932. if err != nil {
  137933. return nil, err
  137934. }
  137935. reqHeaders.Set("Content-Type", "application/json")
  137936. c.urlParams_.Set("alt", alt)
  137937. c.urlParams_.Set("prettyPrint", "false")
  137938. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  137939. urls += "?" + c.urlParams_.Encode()
  137940. req, err := http.NewRequest("POST", urls, body)
  137941. if err != nil {
  137942. return nil, err
  137943. }
  137944. req.Header = reqHeaders
  137945. googleapi.Expand(req.URL, map[string]string{
  137946. "project": c.project,
  137947. "region": c.region,
  137948. "targetPool": c.targetPool,
  137949. })
  137950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137951. }
  137952. // Do executes the "compute.targetPools.removeHealthCheck" call.
  137953. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  137954. // status code is an error. Response headers are in either
  137955. // *Operation.ServerResponse.Header or (if a response was returned at
  137956. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  137957. // to check whether the returned error was because
  137958. // http.StatusNotModified was returned.
  137959. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  137960. gensupport.SetOptions(c.urlParams_, opts...)
  137961. res, err := c.doRequest("json")
  137962. if res != nil && res.StatusCode == http.StatusNotModified {
  137963. if res.Body != nil {
  137964. res.Body.Close()
  137965. }
  137966. return nil, &googleapi.Error{
  137967. Code: res.StatusCode,
  137968. Header: res.Header,
  137969. }
  137970. }
  137971. if err != nil {
  137972. return nil, err
  137973. }
  137974. defer googleapi.CloseBody(res)
  137975. if err := googleapi.CheckResponse(res); err != nil {
  137976. return nil, err
  137977. }
  137978. ret := &Operation{
  137979. ServerResponse: googleapi.ServerResponse{
  137980. Header: res.Header,
  137981. HTTPStatusCode: res.StatusCode,
  137982. },
  137983. }
  137984. target := &ret
  137985. if err := gensupport.DecodeResponse(target, res); err != nil {
  137986. return nil, err
  137987. }
  137988. return ret, nil
  137989. // {
  137990. // "description": "Removes health check URL from a target pool.",
  137991. // "httpMethod": "POST",
  137992. // "id": "compute.targetPools.removeHealthCheck",
  137993. // "parameterOrder": [
  137994. // "project",
  137995. // "region",
  137996. // "targetPool"
  137997. // ],
  137998. // "parameters": {
  137999. // "project": {
  138000. // "description": "Project ID for this request.",
  138001. // "location": "path",
  138002. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138003. // "required": true,
  138004. // "type": "string"
  138005. // },
  138006. // "region": {
  138007. // "description": "Name of the region for this request.",
  138008. // "location": "path",
  138009. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  138010. // "required": true,
  138011. // "type": "string"
  138012. // },
  138013. // "requestId": {
  138014. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  138015. // "location": "query",
  138016. // "type": "string"
  138017. // },
  138018. // "targetPool": {
  138019. // "description": "Name of the target pool to remove health checks from.",
  138020. // "location": "path",
  138021. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  138022. // "required": true,
  138023. // "type": "string"
  138024. // }
  138025. // },
  138026. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  138027. // "request": {
  138028. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  138029. // },
  138030. // "response": {
  138031. // "$ref": "Operation"
  138032. // },
  138033. // "scopes": [
  138034. // "https://www.googleapis.com/auth/cloud-platform",
  138035. // "https://www.googleapis.com/auth/compute"
  138036. // ]
  138037. // }
  138038. }
  138039. // method id "compute.targetPools.removeInstance":
  138040. type TargetPoolsRemoveInstanceCall struct {
  138041. s *Service
  138042. project string
  138043. region string
  138044. targetPool string
  138045. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  138046. urlParams_ gensupport.URLParams
  138047. ctx_ context.Context
  138048. header_ http.Header
  138049. }
  138050. // RemoveInstance: Removes instance URL from a target pool.
  138051. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  138052. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  138053. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138054. c.project = project
  138055. c.region = region
  138056. c.targetPool = targetPool
  138057. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  138058. return c
  138059. }
  138060. // RequestId sets the optional parameter "requestId": An optional
  138061. // request ID to identify requests. Specify a unique request ID so that
  138062. // if you must retry your request, the server will know to ignore the
  138063. // request if it has already been completed.
  138064. //
  138065. // For example, consider a situation where you make an initial request
  138066. // and the request times out. If you make the request again with the
  138067. // same request ID, the server can check if original operation with the
  138068. // same request ID was received, and if so, will ignore the second
  138069. // request. This prevents clients from accidentally creating duplicate
  138070. // commitments.
  138071. //
  138072. // The request ID must be a valid UUID with the exception that zero UUID
  138073. // is not supported (00000000-0000-0000-0000-000000000000).
  138074. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  138075. c.urlParams_.Set("requestId", requestId)
  138076. return c
  138077. }
  138078. // Fields allows partial responses to be retrieved. See
  138079. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138080. // for more information.
  138081. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  138082. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138083. return c
  138084. }
  138085. // Context sets the context to be used in this call's Do method. Any
  138086. // pending HTTP request will be aborted if the provided context is
  138087. // canceled.
  138088. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  138089. c.ctx_ = ctx
  138090. return c
  138091. }
  138092. // Header returns an http.Header that can be modified by the caller to
  138093. // add HTTP headers to the request.
  138094. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  138095. if c.header_ == nil {
  138096. c.header_ = make(http.Header)
  138097. }
  138098. return c.header_
  138099. }
  138100. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  138101. reqHeaders := make(http.Header)
  138102. for k, v := range c.header_ {
  138103. reqHeaders[k] = v
  138104. }
  138105. reqHeaders.Set("User-Agent", c.s.userAgent())
  138106. var body io.Reader = nil
  138107. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  138108. if err != nil {
  138109. return nil, err
  138110. }
  138111. reqHeaders.Set("Content-Type", "application/json")
  138112. c.urlParams_.Set("alt", alt)
  138113. c.urlParams_.Set("prettyPrint", "false")
  138114. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  138115. urls += "?" + c.urlParams_.Encode()
  138116. req, err := http.NewRequest("POST", urls, body)
  138117. if err != nil {
  138118. return nil, err
  138119. }
  138120. req.Header = reqHeaders
  138121. googleapi.Expand(req.URL, map[string]string{
  138122. "project": c.project,
  138123. "region": c.region,
  138124. "targetPool": c.targetPool,
  138125. })
  138126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138127. }
  138128. // Do executes the "compute.targetPools.removeInstance" call.
  138129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  138130. // status code is an error. Response headers are in either
  138131. // *Operation.ServerResponse.Header or (if a response was returned at
  138132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  138133. // to check whether the returned error was because
  138134. // http.StatusNotModified was returned.
  138135. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  138136. gensupport.SetOptions(c.urlParams_, opts...)
  138137. res, err := c.doRequest("json")
  138138. if res != nil && res.StatusCode == http.StatusNotModified {
  138139. if res.Body != nil {
  138140. res.Body.Close()
  138141. }
  138142. return nil, &googleapi.Error{
  138143. Code: res.StatusCode,
  138144. Header: res.Header,
  138145. }
  138146. }
  138147. if err != nil {
  138148. return nil, err
  138149. }
  138150. defer googleapi.CloseBody(res)
  138151. if err := googleapi.CheckResponse(res); err != nil {
  138152. return nil, err
  138153. }
  138154. ret := &Operation{
  138155. ServerResponse: googleapi.ServerResponse{
  138156. Header: res.Header,
  138157. HTTPStatusCode: res.StatusCode,
  138158. },
  138159. }
  138160. target := &ret
  138161. if err := gensupport.DecodeResponse(target, res); err != nil {
  138162. return nil, err
  138163. }
  138164. return ret, nil
  138165. // {
  138166. // "description": "Removes instance URL from a target pool.",
  138167. // "httpMethod": "POST",
  138168. // "id": "compute.targetPools.removeInstance",
  138169. // "parameterOrder": [
  138170. // "project",
  138171. // "region",
  138172. // "targetPool"
  138173. // ],
  138174. // "parameters": {
  138175. // "project": {
  138176. // "description": "Project ID for this request.",
  138177. // "location": "path",
  138178. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138179. // "required": true,
  138180. // "type": "string"
  138181. // },
  138182. // "region": {
  138183. // "description": "Name of the region scoping this request.",
  138184. // "location": "path",
  138185. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  138186. // "required": true,
  138187. // "type": "string"
  138188. // },
  138189. // "requestId": {
  138190. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  138191. // "location": "query",
  138192. // "type": "string"
  138193. // },
  138194. // "targetPool": {
  138195. // "description": "Name of the TargetPool resource to remove instances from.",
  138196. // "location": "path",
  138197. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  138198. // "required": true,
  138199. // "type": "string"
  138200. // }
  138201. // },
  138202. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  138203. // "request": {
  138204. // "$ref": "TargetPoolsRemoveInstanceRequest"
  138205. // },
  138206. // "response": {
  138207. // "$ref": "Operation"
  138208. // },
  138209. // "scopes": [
  138210. // "https://www.googleapis.com/auth/cloud-platform",
  138211. // "https://www.googleapis.com/auth/compute"
  138212. // ]
  138213. // }
  138214. }
  138215. // method id "compute.targetPools.setBackup":
  138216. type TargetPoolsSetBackupCall struct {
  138217. s *Service
  138218. project string
  138219. region string
  138220. targetPool string
  138221. targetreference *TargetReference
  138222. urlParams_ gensupport.URLParams
  138223. ctx_ context.Context
  138224. header_ http.Header
  138225. }
  138226. // SetBackup: Changes a backup target pool's configurations.
  138227. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  138228. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  138229. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138230. c.project = project
  138231. c.region = region
  138232. c.targetPool = targetPool
  138233. c.targetreference = targetreference
  138234. return c
  138235. }
  138236. // FailoverRatio sets the optional parameter "failoverRatio": New
  138237. // failoverRatio value for the target pool.
  138238. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  138239. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  138240. return c
  138241. }
  138242. // RequestId sets the optional parameter "requestId": An optional
  138243. // request ID to identify requests. Specify a unique request ID so that
  138244. // if you must retry your request, the server will know to ignore the
  138245. // request if it has already been completed.
  138246. //
  138247. // For example, consider a situation where you make an initial request
  138248. // and the request times out. If you make the request again with the
  138249. // same request ID, the server can check if original operation with the
  138250. // same request ID was received, and if so, will ignore the second
  138251. // request. This prevents clients from accidentally creating duplicate
  138252. // commitments.
  138253. //
  138254. // The request ID must be a valid UUID with the exception that zero UUID
  138255. // is not supported (00000000-0000-0000-0000-000000000000).
  138256. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  138257. c.urlParams_.Set("requestId", requestId)
  138258. return c
  138259. }
  138260. // Fields allows partial responses to be retrieved. See
  138261. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138262. // for more information.
  138263. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  138264. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138265. return c
  138266. }
  138267. // Context sets the context to be used in this call's Do method. Any
  138268. // pending HTTP request will be aborted if the provided context is
  138269. // canceled.
  138270. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  138271. c.ctx_ = ctx
  138272. return c
  138273. }
  138274. // Header returns an http.Header that can be modified by the caller to
  138275. // add HTTP headers to the request.
  138276. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  138277. if c.header_ == nil {
  138278. c.header_ = make(http.Header)
  138279. }
  138280. return c.header_
  138281. }
  138282. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  138283. reqHeaders := make(http.Header)
  138284. for k, v := range c.header_ {
  138285. reqHeaders[k] = v
  138286. }
  138287. reqHeaders.Set("User-Agent", c.s.userAgent())
  138288. var body io.Reader = nil
  138289. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  138290. if err != nil {
  138291. return nil, err
  138292. }
  138293. reqHeaders.Set("Content-Type", "application/json")
  138294. c.urlParams_.Set("alt", alt)
  138295. c.urlParams_.Set("prettyPrint", "false")
  138296. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  138297. urls += "?" + c.urlParams_.Encode()
  138298. req, err := http.NewRequest("POST", urls, body)
  138299. if err != nil {
  138300. return nil, err
  138301. }
  138302. req.Header = reqHeaders
  138303. googleapi.Expand(req.URL, map[string]string{
  138304. "project": c.project,
  138305. "region": c.region,
  138306. "targetPool": c.targetPool,
  138307. })
  138308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138309. }
  138310. // Do executes the "compute.targetPools.setBackup" call.
  138311. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  138312. // status code is an error. Response headers are in either
  138313. // *Operation.ServerResponse.Header or (if a response was returned at
  138314. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  138315. // to check whether the returned error was because
  138316. // http.StatusNotModified was returned.
  138317. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  138318. gensupport.SetOptions(c.urlParams_, opts...)
  138319. res, err := c.doRequest("json")
  138320. if res != nil && res.StatusCode == http.StatusNotModified {
  138321. if res.Body != nil {
  138322. res.Body.Close()
  138323. }
  138324. return nil, &googleapi.Error{
  138325. Code: res.StatusCode,
  138326. Header: res.Header,
  138327. }
  138328. }
  138329. if err != nil {
  138330. return nil, err
  138331. }
  138332. defer googleapi.CloseBody(res)
  138333. if err := googleapi.CheckResponse(res); err != nil {
  138334. return nil, err
  138335. }
  138336. ret := &Operation{
  138337. ServerResponse: googleapi.ServerResponse{
  138338. Header: res.Header,
  138339. HTTPStatusCode: res.StatusCode,
  138340. },
  138341. }
  138342. target := &ret
  138343. if err := gensupport.DecodeResponse(target, res); err != nil {
  138344. return nil, err
  138345. }
  138346. return ret, nil
  138347. // {
  138348. // "description": "Changes a backup target pool's configurations.",
  138349. // "httpMethod": "POST",
  138350. // "id": "compute.targetPools.setBackup",
  138351. // "parameterOrder": [
  138352. // "project",
  138353. // "region",
  138354. // "targetPool"
  138355. // ],
  138356. // "parameters": {
  138357. // "failoverRatio": {
  138358. // "description": "New failoverRatio value for the target pool.",
  138359. // "format": "float",
  138360. // "location": "query",
  138361. // "type": "number"
  138362. // },
  138363. // "project": {
  138364. // "description": "Project ID for this request.",
  138365. // "location": "path",
  138366. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138367. // "required": true,
  138368. // "type": "string"
  138369. // },
  138370. // "region": {
  138371. // "description": "Name of the region scoping this request.",
  138372. // "location": "path",
  138373. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  138374. // "required": true,
  138375. // "type": "string"
  138376. // },
  138377. // "requestId": {
  138378. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  138379. // "location": "query",
  138380. // "type": "string"
  138381. // },
  138382. // "targetPool": {
  138383. // "description": "Name of the TargetPool resource to set a backup pool for.",
  138384. // "location": "path",
  138385. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  138386. // "required": true,
  138387. // "type": "string"
  138388. // }
  138389. // },
  138390. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  138391. // "request": {
  138392. // "$ref": "TargetReference"
  138393. // },
  138394. // "response": {
  138395. // "$ref": "Operation"
  138396. // },
  138397. // "scopes": [
  138398. // "https://www.googleapis.com/auth/cloud-platform",
  138399. // "https://www.googleapis.com/auth/compute"
  138400. // ]
  138401. // }
  138402. }
  138403. // method id "compute.targetPools.testIamPermissions":
  138404. type TargetPoolsTestIamPermissionsCall struct {
  138405. s *Service
  138406. project string
  138407. region string
  138408. resource string
  138409. testpermissionsrequest *TestPermissionsRequest
  138410. urlParams_ gensupport.URLParams
  138411. ctx_ context.Context
  138412. header_ http.Header
  138413. }
  138414. // TestIamPermissions: Returns permissions that a caller has on the
  138415. // specified resource.
  138416. func (r *TargetPoolsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetPoolsTestIamPermissionsCall {
  138417. c := &TargetPoolsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138418. c.project = project
  138419. c.region = region
  138420. c.resource = resource
  138421. c.testpermissionsrequest = testpermissionsrequest
  138422. return c
  138423. }
  138424. // Fields allows partial responses to be retrieved. See
  138425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138426. // for more information.
  138427. func (c *TargetPoolsTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetPoolsTestIamPermissionsCall {
  138428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138429. return c
  138430. }
  138431. // Context sets the context to be used in this call's Do method. Any
  138432. // pending HTTP request will be aborted if the provided context is
  138433. // canceled.
  138434. func (c *TargetPoolsTestIamPermissionsCall) Context(ctx context.Context) *TargetPoolsTestIamPermissionsCall {
  138435. c.ctx_ = ctx
  138436. return c
  138437. }
  138438. // Header returns an http.Header that can be modified by the caller to
  138439. // add HTTP headers to the request.
  138440. func (c *TargetPoolsTestIamPermissionsCall) Header() http.Header {
  138441. if c.header_ == nil {
  138442. c.header_ = make(http.Header)
  138443. }
  138444. return c.header_
  138445. }
  138446. func (c *TargetPoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  138447. reqHeaders := make(http.Header)
  138448. for k, v := range c.header_ {
  138449. reqHeaders[k] = v
  138450. }
  138451. reqHeaders.Set("User-Agent", c.s.userAgent())
  138452. var body io.Reader = nil
  138453. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  138454. if err != nil {
  138455. return nil, err
  138456. }
  138457. reqHeaders.Set("Content-Type", "application/json")
  138458. c.urlParams_.Set("alt", alt)
  138459. c.urlParams_.Set("prettyPrint", "false")
  138460. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{resource}/testIamPermissions")
  138461. urls += "?" + c.urlParams_.Encode()
  138462. req, err := http.NewRequest("POST", urls, body)
  138463. if err != nil {
  138464. return nil, err
  138465. }
  138466. req.Header = reqHeaders
  138467. googleapi.Expand(req.URL, map[string]string{
  138468. "project": c.project,
  138469. "region": c.region,
  138470. "resource": c.resource,
  138471. })
  138472. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138473. }
  138474. // Do executes the "compute.targetPools.testIamPermissions" call.
  138475. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  138476. // non-2xx status code is an error. Response headers are in either
  138477. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  138478. // returned at all) in error.(*googleapi.Error).Header. Use
  138479. // googleapi.IsNotModified to check whether the returned error was
  138480. // because http.StatusNotModified was returned.
  138481. func (c *TargetPoolsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  138482. gensupport.SetOptions(c.urlParams_, opts...)
  138483. res, err := c.doRequest("json")
  138484. if res != nil && res.StatusCode == http.StatusNotModified {
  138485. if res.Body != nil {
  138486. res.Body.Close()
  138487. }
  138488. return nil, &googleapi.Error{
  138489. Code: res.StatusCode,
  138490. Header: res.Header,
  138491. }
  138492. }
  138493. if err != nil {
  138494. return nil, err
  138495. }
  138496. defer googleapi.CloseBody(res)
  138497. if err := googleapi.CheckResponse(res); err != nil {
  138498. return nil, err
  138499. }
  138500. ret := &TestPermissionsResponse{
  138501. ServerResponse: googleapi.ServerResponse{
  138502. Header: res.Header,
  138503. HTTPStatusCode: res.StatusCode,
  138504. },
  138505. }
  138506. target := &ret
  138507. if err := gensupport.DecodeResponse(target, res); err != nil {
  138508. return nil, err
  138509. }
  138510. return ret, nil
  138511. // {
  138512. // "description": "Returns permissions that a caller has on the specified resource.",
  138513. // "httpMethod": "POST",
  138514. // "id": "compute.targetPools.testIamPermissions",
  138515. // "parameterOrder": [
  138516. // "project",
  138517. // "region",
  138518. // "resource"
  138519. // ],
  138520. // "parameters": {
  138521. // "project": {
  138522. // "description": "Project ID for this request.",
  138523. // "location": "path",
  138524. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138525. // "required": true,
  138526. // "type": "string"
  138527. // },
  138528. // "region": {
  138529. // "description": "The name of the region for this request.",
  138530. // "location": "path",
  138531. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  138532. // "required": true,
  138533. // "type": "string"
  138534. // },
  138535. // "resource": {
  138536. // "description": "Name or id of the resource for this request.",
  138537. // "location": "path",
  138538. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  138539. // "required": true,
  138540. // "type": "string"
  138541. // }
  138542. // },
  138543. // "path": "{project}/regions/{region}/targetPools/{resource}/testIamPermissions",
  138544. // "request": {
  138545. // "$ref": "TestPermissionsRequest"
  138546. // },
  138547. // "response": {
  138548. // "$ref": "TestPermissionsResponse"
  138549. // },
  138550. // "scopes": [
  138551. // "https://www.googleapis.com/auth/cloud-platform",
  138552. // "https://www.googleapis.com/auth/compute",
  138553. // "https://www.googleapis.com/auth/compute.readonly"
  138554. // ]
  138555. // }
  138556. }
  138557. // method id "compute.targetSslProxies.delete":
  138558. type TargetSslProxiesDeleteCall struct {
  138559. s *Service
  138560. project string
  138561. targetSslProxy string
  138562. urlParams_ gensupport.URLParams
  138563. ctx_ context.Context
  138564. header_ http.Header
  138565. }
  138566. // Delete: Deletes the specified TargetSslProxy resource.
  138567. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  138568. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138569. c.project = project
  138570. c.targetSslProxy = targetSslProxy
  138571. return c
  138572. }
  138573. // RequestId sets the optional parameter "requestId": An optional
  138574. // request ID to identify requests. Specify a unique request ID so that
  138575. // if you must retry your request, the server will know to ignore the
  138576. // request if it has already been completed.
  138577. //
  138578. // For example, consider a situation where you make an initial request
  138579. // and the request times out. If you make the request again with the
  138580. // same request ID, the server can check if original operation with the
  138581. // same request ID was received, and if so, will ignore the second
  138582. // request. This prevents clients from accidentally creating duplicate
  138583. // commitments.
  138584. //
  138585. // The request ID must be a valid UUID with the exception that zero UUID
  138586. // is not supported (00000000-0000-0000-0000-000000000000).
  138587. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  138588. c.urlParams_.Set("requestId", requestId)
  138589. return c
  138590. }
  138591. // Fields allows partial responses to be retrieved. See
  138592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138593. // for more information.
  138594. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  138595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138596. return c
  138597. }
  138598. // Context sets the context to be used in this call's Do method. Any
  138599. // pending HTTP request will be aborted if the provided context is
  138600. // canceled.
  138601. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  138602. c.ctx_ = ctx
  138603. return c
  138604. }
  138605. // Header returns an http.Header that can be modified by the caller to
  138606. // add HTTP headers to the request.
  138607. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  138608. if c.header_ == nil {
  138609. c.header_ = make(http.Header)
  138610. }
  138611. return c.header_
  138612. }
  138613. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  138614. reqHeaders := make(http.Header)
  138615. for k, v := range c.header_ {
  138616. reqHeaders[k] = v
  138617. }
  138618. reqHeaders.Set("User-Agent", c.s.userAgent())
  138619. var body io.Reader = nil
  138620. c.urlParams_.Set("alt", alt)
  138621. c.urlParams_.Set("prettyPrint", "false")
  138622. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  138623. urls += "?" + c.urlParams_.Encode()
  138624. req, err := http.NewRequest("DELETE", urls, body)
  138625. if err != nil {
  138626. return nil, err
  138627. }
  138628. req.Header = reqHeaders
  138629. googleapi.Expand(req.URL, map[string]string{
  138630. "project": c.project,
  138631. "targetSslProxy": c.targetSslProxy,
  138632. })
  138633. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138634. }
  138635. // Do executes the "compute.targetSslProxies.delete" call.
  138636. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  138637. // status code is an error. Response headers are in either
  138638. // *Operation.ServerResponse.Header or (if a response was returned at
  138639. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  138640. // to check whether the returned error was because
  138641. // http.StatusNotModified was returned.
  138642. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  138643. gensupport.SetOptions(c.urlParams_, opts...)
  138644. res, err := c.doRequest("json")
  138645. if res != nil && res.StatusCode == http.StatusNotModified {
  138646. if res.Body != nil {
  138647. res.Body.Close()
  138648. }
  138649. return nil, &googleapi.Error{
  138650. Code: res.StatusCode,
  138651. Header: res.Header,
  138652. }
  138653. }
  138654. if err != nil {
  138655. return nil, err
  138656. }
  138657. defer googleapi.CloseBody(res)
  138658. if err := googleapi.CheckResponse(res); err != nil {
  138659. return nil, err
  138660. }
  138661. ret := &Operation{
  138662. ServerResponse: googleapi.ServerResponse{
  138663. Header: res.Header,
  138664. HTTPStatusCode: res.StatusCode,
  138665. },
  138666. }
  138667. target := &ret
  138668. if err := gensupport.DecodeResponse(target, res); err != nil {
  138669. return nil, err
  138670. }
  138671. return ret, nil
  138672. // {
  138673. // "description": "Deletes the specified TargetSslProxy resource.",
  138674. // "httpMethod": "DELETE",
  138675. // "id": "compute.targetSslProxies.delete",
  138676. // "parameterOrder": [
  138677. // "project",
  138678. // "targetSslProxy"
  138679. // ],
  138680. // "parameters": {
  138681. // "project": {
  138682. // "description": "Project ID for this request.",
  138683. // "location": "path",
  138684. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138685. // "required": true,
  138686. // "type": "string"
  138687. // },
  138688. // "requestId": {
  138689. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  138690. // "location": "query",
  138691. // "type": "string"
  138692. // },
  138693. // "targetSslProxy": {
  138694. // "description": "Name of the TargetSslProxy resource to delete.",
  138695. // "location": "path",
  138696. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  138697. // "required": true,
  138698. // "type": "string"
  138699. // }
  138700. // },
  138701. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  138702. // "response": {
  138703. // "$ref": "Operation"
  138704. // },
  138705. // "scopes": [
  138706. // "https://www.googleapis.com/auth/cloud-platform",
  138707. // "https://www.googleapis.com/auth/compute"
  138708. // ]
  138709. // }
  138710. }
  138711. // method id "compute.targetSslProxies.get":
  138712. type TargetSslProxiesGetCall struct {
  138713. s *Service
  138714. project string
  138715. targetSslProxy string
  138716. urlParams_ gensupport.URLParams
  138717. ifNoneMatch_ string
  138718. ctx_ context.Context
  138719. header_ http.Header
  138720. }
  138721. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  138722. // available target SSL proxies by making a list() request.
  138723. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  138724. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138725. c.project = project
  138726. c.targetSslProxy = targetSslProxy
  138727. return c
  138728. }
  138729. // Fields allows partial responses to be retrieved. See
  138730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138731. // for more information.
  138732. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  138733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138734. return c
  138735. }
  138736. // IfNoneMatch sets the optional parameter which makes the operation
  138737. // fail if the object's ETag matches the given value. This is useful for
  138738. // getting updates only after the object has changed since the last
  138739. // request. Use googleapi.IsNotModified to check whether the response
  138740. // error from Do is the result of In-None-Match.
  138741. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  138742. c.ifNoneMatch_ = entityTag
  138743. return c
  138744. }
  138745. // Context sets the context to be used in this call's Do method. Any
  138746. // pending HTTP request will be aborted if the provided context is
  138747. // canceled.
  138748. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  138749. c.ctx_ = ctx
  138750. return c
  138751. }
  138752. // Header returns an http.Header that can be modified by the caller to
  138753. // add HTTP headers to the request.
  138754. func (c *TargetSslProxiesGetCall) Header() http.Header {
  138755. if c.header_ == nil {
  138756. c.header_ = make(http.Header)
  138757. }
  138758. return c.header_
  138759. }
  138760. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  138761. reqHeaders := make(http.Header)
  138762. for k, v := range c.header_ {
  138763. reqHeaders[k] = v
  138764. }
  138765. reqHeaders.Set("User-Agent", c.s.userAgent())
  138766. if c.ifNoneMatch_ != "" {
  138767. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  138768. }
  138769. var body io.Reader = nil
  138770. c.urlParams_.Set("alt", alt)
  138771. c.urlParams_.Set("prettyPrint", "false")
  138772. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  138773. urls += "?" + c.urlParams_.Encode()
  138774. req, err := http.NewRequest("GET", urls, body)
  138775. if err != nil {
  138776. return nil, err
  138777. }
  138778. req.Header = reqHeaders
  138779. googleapi.Expand(req.URL, map[string]string{
  138780. "project": c.project,
  138781. "targetSslProxy": c.targetSslProxy,
  138782. })
  138783. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138784. }
  138785. // Do executes the "compute.targetSslProxies.get" call.
  138786. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  138787. // status code is an error. Response headers are in either
  138788. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  138789. // at all) in error.(*googleapi.Error).Header. Use
  138790. // googleapi.IsNotModified to check whether the returned error was
  138791. // because http.StatusNotModified was returned.
  138792. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  138793. gensupport.SetOptions(c.urlParams_, opts...)
  138794. res, err := c.doRequest("json")
  138795. if res != nil && res.StatusCode == http.StatusNotModified {
  138796. if res.Body != nil {
  138797. res.Body.Close()
  138798. }
  138799. return nil, &googleapi.Error{
  138800. Code: res.StatusCode,
  138801. Header: res.Header,
  138802. }
  138803. }
  138804. if err != nil {
  138805. return nil, err
  138806. }
  138807. defer googleapi.CloseBody(res)
  138808. if err := googleapi.CheckResponse(res); err != nil {
  138809. return nil, err
  138810. }
  138811. ret := &TargetSslProxy{
  138812. ServerResponse: googleapi.ServerResponse{
  138813. Header: res.Header,
  138814. HTTPStatusCode: res.StatusCode,
  138815. },
  138816. }
  138817. target := &ret
  138818. if err := gensupport.DecodeResponse(target, res); err != nil {
  138819. return nil, err
  138820. }
  138821. return ret, nil
  138822. // {
  138823. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  138824. // "httpMethod": "GET",
  138825. // "id": "compute.targetSslProxies.get",
  138826. // "parameterOrder": [
  138827. // "project",
  138828. // "targetSslProxy"
  138829. // ],
  138830. // "parameters": {
  138831. // "project": {
  138832. // "description": "Project ID for this request.",
  138833. // "location": "path",
  138834. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138835. // "required": true,
  138836. // "type": "string"
  138837. // },
  138838. // "targetSslProxy": {
  138839. // "description": "Name of the TargetSslProxy resource to return.",
  138840. // "location": "path",
  138841. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  138842. // "required": true,
  138843. // "type": "string"
  138844. // }
  138845. // },
  138846. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  138847. // "response": {
  138848. // "$ref": "TargetSslProxy"
  138849. // },
  138850. // "scopes": [
  138851. // "https://www.googleapis.com/auth/cloud-platform",
  138852. // "https://www.googleapis.com/auth/compute",
  138853. // "https://www.googleapis.com/auth/compute.readonly"
  138854. // ]
  138855. // }
  138856. }
  138857. // method id "compute.targetSslProxies.insert":
  138858. type TargetSslProxiesInsertCall struct {
  138859. s *Service
  138860. project string
  138861. targetsslproxy *TargetSslProxy
  138862. urlParams_ gensupport.URLParams
  138863. ctx_ context.Context
  138864. header_ http.Header
  138865. }
  138866. // Insert: Creates a TargetSslProxy resource in the specified project
  138867. // using the data included in the request.
  138868. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  138869. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138870. c.project = project
  138871. c.targetsslproxy = targetsslproxy
  138872. return c
  138873. }
  138874. // RequestId sets the optional parameter "requestId": An optional
  138875. // request ID to identify requests. Specify a unique request ID so that
  138876. // if you must retry your request, the server will know to ignore the
  138877. // request if it has already been completed.
  138878. //
  138879. // For example, consider a situation where you make an initial request
  138880. // and the request times out. If you make the request again with the
  138881. // same request ID, the server can check if original operation with the
  138882. // same request ID was received, and if so, will ignore the second
  138883. // request. This prevents clients from accidentally creating duplicate
  138884. // commitments.
  138885. //
  138886. // The request ID must be a valid UUID with the exception that zero UUID
  138887. // is not supported (00000000-0000-0000-0000-000000000000).
  138888. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  138889. c.urlParams_.Set("requestId", requestId)
  138890. return c
  138891. }
  138892. // Fields allows partial responses to be retrieved. See
  138893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138894. // for more information.
  138895. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  138896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138897. return c
  138898. }
  138899. // Context sets the context to be used in this call's Do method. Any
  138900. // pending HTTP request will be aborted if the provided context is
  138901. // canceled.
  138902. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  138903. c.ctx_ = ctx
  138904. return c
  138905. }
  138906. // Header returns an http.Header that can be modified by the caller to
  138907. // add HTTP headers to the request.
  138908. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  138909. if c.header_ == nil {
  138910. c.header_ = make(http.Header)
  138911. }
  138912. return c.header_
  138913. }
  138914. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  138915. reqHeaders := make(http.Header)
  138916. for k, v := range c.header_ {
  138917. reqHeaders[k] = v
  138918. }
  138919. reqHeaders.Set("User-Agent", c.s.userAgent())
  138920. var body io.Reader = nil
  138921. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  138922. if err != nil {
  138923. return nil, err
  138924. }
  138925. reqHeaders.Set("Content-Type", "application/json")
  138926. c.urlParams_.Set("alt", alt)
  138927. c.urlParams_.Set("prettyPrint", "false")
  138928. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  138929. urls += "?" + c.urlParams_.Encode()
  138930. req, err := http.NewRequest("POST", urls, body)
  138931. if err != nil {
  138932. return nil, err
  138933. }
  138934. req.Header = reqHeaders
  138935. googleapi.Expand(req.URL, map[string]string{
  138936. "project": c.project,
  138937. })
  138938. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138939. }
  138940. // Do executes the "compute.targetSslProxies.insert" call.
  138941. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  138942. // status code is an error. Response headers are in either
  138943. // *Operation.ServerResponse.Header or (if a response was returned at
  138944. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  138945. // to check whether the returned error was because
  138946. // http.StatusNotModified was returned.
  138947. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  138948. gensupport.SetOptions(c.urlParams_, opts...)
  138949. res, err := c.doRequest("json")
  138950. if res != nil && res.StatusCode == http.StatusNotModified {
  138951. if res.Body != nil {
  138952. res.Body.Close()
  138953. }
  138954. return nil, &googleapi.Error{
  138955. Code: res.StatusCode,
  138956. Header: res.Header,
  138957. }
  138958. }
  138959. if err != nil {
  138960. return nil, err
  138961. }
  138962. defer googleapi.CloseBody(res)
  138963. if err := googleapi.CheckResponse(res); err != nil {
  138964. return nil, err
  138965. }
  138966. ret := &Operation{
  138967. ServerResponse: googleapi.ServerResponse{
  138968. Header: res.Header,
  138969. HTTPStatusCode: res.StatusCode,
  138970. },
  138971. }
  138972. target := &ret
  138973. if err := gensupport.DecodeResponse(target, res); err != nil {
  138974. return nil, err
  138975. }
  138976. return ret, nil
  138977. // {
  138978. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  138979. // "httpMethod": "POST",
  138980. // "id": "compute.targetSslProxies.insert",
  138981. // "parameterOrder": [
  138982. // "project"
  138983. // ],
  138984. // "parameters": {
  138985. // "project": {
  138986. // "description": "Project ID for this request.",
  138987. // "location": "path",
  138988. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138989. // "required": true,
  138990. // "type": "string"
  138991. // },
  138992. // "requestId": {
  138993. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  138994. // "location": "query",
  138995. // "type": "string"
  138996. // }
  138997. // },
  138998. // "path": "{project}/global/targetSslProxies",
  138999. // "request": {
  139000. // "$ref": "TargetSslProxy"
  139001. // },
  139002. // "response": {
  139003. // "$ref": "Operation"
  139004. // },
  139005. // "scopes": [
  139006. // "https://www.googleapis.com/auth/cloud-platform",
  139007. // "https://www.googleapis.com/auth/compute"
  139008. // ]
  139009. // }
  139010. }
  139011. // method id "compute.targetSslProxies.list":
  139012. type TargetSslProxiesListCall struct {
  139013. s *Service
  139014. project string
  139015. urlParams_ gensupport.URLParams
  139016. ifNoneMatch_ string
  139017. ctx_ context.Context
  139018. header_ http.Header
  139019. }
  139020. // List: Retrieves the list of TargetSslProxy resources available to the
  139021. // specified project.
  139022. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  139023. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139024. c.project = project
  139025. return c
  139026. }
  139027. // Filter sets the optional parameter "filter": A filter expression that
  139028. // filters resources listed in the response. The expression must specify
  139029. // the field name, a comparison operator, and the value that you want to
  139030. // use for filtering. The value must be a string, a number, or a
  139031. // boolean. The comparison operator must be either =, !=, >, or <.
  139032. //
  139033. // For example, if you are filtering Compute Engine instances, you can
  139034. // exclude instances named example-instance by specifying name !=
  139035. // example-instance.
  139036. //
  139037. // You can also filter nested fields. For example, you could specify
  139038. // scheduling.automaticRestart = false to include instances only if they
  139039. // are not scheduled for automatic restarts. You can use filtering on
  139040. // nested fields to filter based on resource labels.
  139041. //
  139042. // To filter on multiple expressions, provide each separate expression
  139043. // within parentheses. For example, (scheduling.automaticRestart = true)
  139044. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  139045. // AND expression. However, you can include AND and OR expressions
  139046. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  139047. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  139048. // true).
  139049. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  139050. c.urlParams_.Set("filter", filter)
  139051. return c
  139052. }
  139053. // MaxResults sets the optional parameter "maxResults": The maximum
  139054. // number of results per page that should be returned. If the number of
  139055. // available results is larger than maxResults, Compute Engine returns a
  139056. // nextPageToken that can be used to get the next page of results in
  139057. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  139058. // (Default: 500)
  139059. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  139060. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  139061. return c
  139062. }
  139063. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  139064. // a certain order. By default, results are returned in alphanumerical
  139065. // order based on the resource name.
  139066. //
  139067. // You can also sort results in descending order based on the creation
  139068. // timestamp using orderBy="creationTimestamp desc". This sorts results
  139069. // based on the creationTimestamp field in reverse chronological order
  139070. // (newest result first). Use this to sort resources like operations so
  139071. // that the newest operation is returned first.
  139072. //
  139073. // Currently, only sorting by name or creationTimestamp desc is
  139074. // supported.
  139075. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  139076. c.urlParams_.Set("orderBy", orderBy)
  139077. return c
  139078. }
  139079. // PageToken sets the optional parameter "pageToken": Specifies a page
  139080. // token to use. Set pageToken to the nextPageToken returned by a
  139081. // previous list request to get the next page of results.
  139082. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  139083. c.urlParams_.Set("pageToken", pageToken)
  139084. return c
  139085. }
  139086. // Fields allows partial responses to be retrieved. See
  139087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139088. // for more information.
  139089. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  139090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139091. return c
  139092. }
  139093. // IfNoneMatch sets the optional parameter which makes the operation
  139094. // fail if the object's ETag matches the given value. This is useful for
  139095. // getting updates only after the object has changed since the last
  139096. // request. Use googleapi.IsNotModified to check whether the response
  139097. // error from Do is the result of In-None-Match.
  139098. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  139099. c.ifNoneMatch_ = entityTag
  139100. return c
  139101. }
  139102. // Context sets the context to be used in this call's Do method. Any
  139103. // pending HTTP request will be aborted if the provided context is
  139104. // canceled.
  139105. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  139106. c.ctx_ = ctx
  139107. return c
  139108. }
  139109. // Header returns an http.Header that can be modified by the caller to
  139110. // add HTTP headers to the request.
  139111. func (c *TargetSslProxiesListCall) Header() http.Header {
  139112. if c.header_ == nil {
  139113. c.header_ = make(http.Header)
  139114. }
  139115. return c.header_
  139116. }
  139117. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  139118. reqHeaders := make(http.Header)
  139119. for k, v := range c.header_ {
  139120. reqHeaders[k] = v
  139121. }
  139122. reqHeaders.Set("User-Agent", c.s.userAgent())
  139123. if c.ifNoneMatch_ != "" {
  139124. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  139125. }
  139126. var body io.Reader = nil
  139127. c.urlParams_.Set("alt", alt)
  139128. c.urlParams_.Set("prettyPrint", "false")
  139129. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  139130. urls += "?" + c.urlParams_.Encode()
  139131. req, err := http.NewRequest("GET", urls, body)
  139132. if err != nil {
  139133. return nil, err
  139134. }
  139135. req.Header = reqHeaders
  139136. googleapi.Expand(req.URL, map[string]string{
  139137. "project": c.project,
  139138. })
  139139. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139140. }
  139141. // Do executes the "compute.targetSslProxies.list" call.
  139142. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  139143. // non-2xx status code is an error. Response headers are in either
  139144. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  139145. // returned at all) in error.(*googleapi.Error).Header. Use
  139146. // googleapi.IsNotModified to check whether the returned error was
  139147. // because http.StatusNotModified was returned.
  139148. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  139149. gensupport.SetOptions(c.urlParams_, opts...)
  139150. res, err := c.doRequest("json")
  139151. if res != nil && res.StatusCode == http.StatusNotModified {
  139152. if res.Body != nil {
  139153. res.Body.Close()
  139154. }
  139155. return nil, &googleapi.Error{
  139156. Code: res.StatusCode,
  139157. Header: res.Header,
  139158. }
  139159. }
  139160. if err != nil {
  139161. return nil, err
  139162. }
  139163. defer googleapi.CloseBody(res)
  139164. if err := googleapi.CheckResponse(res); err != nil {
  139165. return nil, err
  139166. }
  139167. ret := &TargetSslProxyList{
  139168. ServerResponse: googleapi.ServerResponse{
  139169. Header: res.Header,
  139170. HTTPStatusCode: res.StatusCode,
  139171. },
  139172. }
  139173. target := &ret
  139174. if err := gensupport.DecodeResponse(target, res); err != nil {
  139175. return nil, err
  139176. }
  139177. return ret, nil
  139178. // {
  139179. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  139180. // "httpMethod": "GET",
  139181. // "id": "compute.targetSslProxies.list",
  139182. // "parameterOrder": [
  139183. // "project"
  139184. // ],
  139185. // "parameters": {
  139186. // "filter": {
  139187. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  139188. // "location": "query",
  139189. // "type": "string"
  139190. // },
  139191. // "maxResults": {
  139192. // "default": "500",
  139193. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  139194. // "format": "uint32",
  139195. // "location": "query",
  139196. // "minimum": "0",
  139197. // "type": "integer"
  139198. // },
  139199. // "orderBy": {
  139200. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  139201. // "location": "query",
  139202. // "type": "string"
  139203. // },
  139204. // "pageToken": {
  139205. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  139206. // "location": "query",
  139207. // "type": "string"
  139208. // },
  139209. // "project": {
  139210. // "description": "Project ID for this request.",
  139211. // "location": "path",
  139212. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  139213. // "required": true,
  139214. // "type": "string"
  139215. // }
  139216. // },
  139217. // "path": "{project}/global/targetSslProxies",
  139218. // "response": {
  139219. // "$ref": "TargetSslProxyList"
  139220. // },
  139221. // "scopes": [
  139222. // "https://www.googleapis.com/auth/cloud-platform",
  139223. // "https://www.googleapis.com/auth/compute",
  139224. // "https://www.googleapis.com/auth/compute.readonly"
  139225. // ]
  139226. // }
  139227. }
  139228. // Pages invokes f for each page of results.
  139229. // A non-nil error returned from f will halt the iteration.
  139230. // The provided context supersedes any context provided to the Context method.
  139231. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  139232. c.ctx_ = ctx
  139233. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  139234. for {
  139235. x, err := c.Do()
  139236. if err != nil {
  139237. return err
  139238. }
  139239. if err := f(x); err != nil {
  139240. return err
  139241. }
  139242. if x.NextPageToken == "" {
  139243. return nil
  139244. }
  139245. c.PageToken(x.NextPageToken)
  139246. }
  139247. }
  139248. // method id "compute.targetSslProxies.setBackendService":
  139249. type TargetSslProxiesSetBackendServiceCall struct {
  139250. s *Service
  139251. project string
  139252. targetSslProxy string
  139253. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  139254. urlParams_ gensupport.URLParams
  139255. ctx_ context.Context
  139256. header_ http.Header
  139257. }
  139258. // SetBackendService: Changes the BackendService for TargetSslProxy.
  139259. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  139260. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139261. c.project = project
  139262. c.targetSslProxy = targetSslProxy
  139263. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  139264. return c
  139265. }
  139266. // RequestId sets the optional parameter "requestId": An optional
  139267. // request ID to identify requests. Specify a unique request ID so that
  139268. // if you must retry your request, the server will know to ignore the
  139269. // request if it has already been completed.
  139270. //
  139271. // For example, consider a situation where you make an initial request
  139272. // and the request times out. If you make the request again with the
  139273. // same request ID, the server can check if original operation with the
  139274. // same request ID was received, and if so, will ignore the second
  139275. // request. This prevents clients from accidentally creating duplicate
  139276. // commitments.
  139277. //
  139278. // The request ID must be a valid UUID with the exception that zero UUID
  139279. // is not supported (00000000-0000-0000-0000-000000000000).
  139280. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  139281. c.urlParams_.Set("requestId", requestId)
  139282. return c
  139283. }
  139284. // Fields allows partial responses to be retrieved. See
  139285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139286. // for more information.
  139287. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  139288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139289. return c
  139290. }
  139291. // Context sets the context to be used in this call's Do method. Any
  139292. // pending HTTP request will be aborted if the provided context is
  139293. // canceled.
  139294. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  139295. c.ctx_ = ctx
  139296. return c
  139297. }
  139298. // Header returns an http.Header that can be modified by the caller to
  139299. // add HTTP headers to the request.
  139300. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  139301. if c.header_ == nil {
  139302. c.header_ = make(http.Header)
  139303. }
  139304. return c.header_
  139305. }
  139306. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  139307. reqHeaders := make(http.Header)
  139308. for k, v := range c.header_ {
  139309. reqHeaders[k] = v
  139310. }
  139311. reqHeaders.Set("User-Agent", c.s.userAgent())
  139312. var body io.Reader = nil
  139313. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  139314. if err != nil {
  139315. return nil, err
  139316. }
  139317. reqHeaders.Set("Content-Type", "application/json")
  139318. c.urlParams_.Set("alt", alt)
  139319. c.urlParams_.Set("prettyPrint", "false")
  139320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  139321. urls += "?" + c.urlParams_.Encode()
  139322. req, err := http.NewRequest("POST", urls, body)
  139323. if err != nil {
  139324. return nil, err
  139325. }
  139326. req.Header = reqHeaders
  139327. googleapi.Expand(req.URL, map[string]string{
  139328. "project": c.project,
  139329. "targetSslProxy": c.targetSslProxy,
  139330. })
  139331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139332. }
  139333. // Do executes the "compute.targetSslProxies.setBackendService" call.
  139334. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  139335. // status code is an error. Response headers are in either
  139336. // *Operation.ServerResponse.Header or (if a response was returned at
  139337. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  139338. // to check whether the returned error was because
  139339. // http.StatusNotModified was returned.
  139340. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  139341. gensupport.SetOptions(c.urlParams_, opts...)
  139342. res, err := c.doRequest("json")
  139343. if res != nil && res.StatusCode == http.StatusNotModified {
  139344. if res.Body != nil {
  139345. res.Body.Close()
  139346. }
  139347. return nil, &googleapi.Error{
  139348. Code: res.StatusCode,
  139349. Header: res.Header,
  139350. }
  139351. }
  139352. if err != nil {
  139353. return nil, err
  139354. }
  139355. defer googleapi.CloseBody(res)
  139356. if err := googleapi.CheckResponse(res); err != nil {
  139357. return nil, err
  139358. }
  139359. ret := &Operation{
  139360. ServerResponse: googleapi.ServerResponse{
  139361. Header: res.Header,
  139362. HTTPStatusCode: res.StatusCode,
  139363. },
  139364. }
  139365. target := &ret
  139366. if err := gensupport.DecodeResponse(target, res); err != nil {
  139367. return nil, err
  139368. }
  139369. return ret, nil
  139370. // {
  139371. // "description": "Changes the BackendService for TargetSslProxy.",
  139372. // "httpMethod": "POST",
  139373. // "id": "compute.targetSslProxies.setBackendService",
  139374. // "parameterOrder": [
  139375. // "project",
  139376. // "targetSslProxy"
  139377. // ],
  139378. // "parameters": {
  139379. // "project": {
  139380. // "description": "Project ID for this request.",
  139381. // "location": "path",
  139382. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  139383. // "required": true,
  139384. // "type": "string"
  139385. // },
  139386. // "requestId": {
  139387. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  139388. // "location": "query",
  139389. // "type": "string"
  139390. // },
  139391. // "targetSslProxy": {
  139392. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  139393. // "location": "path",
  139394. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  139395. // "required": true,
  139396. // "type": "string"
  139397. // }
  139398. // },
  139399. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  139400. // "request": {
  139401. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  139402. // },
  139403. // "response": {
  139404. // "$ref": "Operation"
  139405. // },
  139406. // "scopes": [
  139407. // "https://www.googleapis.com/auth/cloud-platform",
  139408. // "https://www.googleapis.com/auth/compute"
  139409. // ]
  139410. // }
  139411. }
  139412. // method id "compute.targetSslProxies.setProxyHeader":
  139413. type TargetSslProxiesSetProxyHeaderCall struct {
  139414. s *Service
  139415. project string
  139416. targetSslProxy string
  139417. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  139418. urlParams_ gensupport.URLParams
  139419. ctx_ context.Context
  139420. header_ http.Header
  139421. }
  139422. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  139423. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  139424. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139425. c.project = project
  139426. c.targetSslProxy = targetSslProxy
  139427. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  139428. return c
  139429. }
  139430. // RequestId sets the optional parameter "requestId": An optional
  139431. // request ID to identify requests. Specify a unique request ID so that
  139432. // if you must retry your request, the server will know to ignore the
  139433. // request if it has already been completed.
  139434. //
  139435. // For example, consider a situation where you make an initial request
  139436. // and the request times out. If you make the request again with the
  139437. // same request ID, the server can check if original operation with the
  139438. // same request ID was received, and if so, will ignore the second
  139439. // request. This prevents clients from accidentally creating duplicate
  139440. // commitments.
  139441. //
  139442. // The request ID must be a valid UUID with the exception that zero UUID
  139443. // is not supported (00000000-0000-0000-0000-000000000000).
  139444. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  139445. c.urlParams_.Set("requestId", requestId)
  139446. return c
  139447. }
  139448. // Fields allows partial responses to be retrieved. See
  139449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139450. // for more information.
  139451. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  139452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139453. return c
  139454. }
  139455. // Context sets the context to be used in this call's Do method. Any
  139456. // pending HTTP request will be aborted if the provided context is
  139457. // canceled.
  139458. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  139459. c.ctx_ = ctx
  139460. return c
  139461. }
  139462. // Header returns an http.Header that can be modified by the caller to
  139463. // add HTTP headers to the request.
  139464. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  139465. if c.header_ == nil {
  139466. c.header_ = make(http.Header)
  139467. }
  139468. return c.header_
  139469. }
  139470. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  139471. reqHeaders := make(http.Header)
  139472. for k, v := range c.header_ {
  139473. reqHeaders[k] = v
  139474. }
  139475. reqHeaders.Set("User-Agent", c.s.userAgent())
  139476. var body io.Reader = nil
  139477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  139478. if err != nil {
  139479. return nil, err
  139480. }
  139481. reqHeaders.Set("Content-Type", "application/json")
  139482. c.urlParams_.Set("alt", alt)
  139483. c.urlParams_.Set("prettyPrint", "false")
  139484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  139485. urls += "?" + c.urlParams_.Encode()
  139486. req, err := http.NewRequest("POST", urls, body)
  139487. if err != nil {
  139488. return nil, err
  139489. }
  139490. req.Header = reqHeaders
  139491. googleapi.Expand(req.URL, map[string]string{
  139492. "project": c.project,
  139493. "targetSslProxy": c.targetSslProxy,
  139494. })
  139495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139496. }
  139497. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  139498. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  139499. // status code is an error. Response headers are in either
  139500. // *Operation.ServerResponse.Header or (if a response was returned at
  139501. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  139502. // to check whether the returned error was because
  139503. // http.StatusNotModified was returned.
  139504. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  139505. gensupport.SetOptions(c.urlParams_, opts...)
  139506. res, err := c.doRequest("json")
  139507. if res != nil && res.StatusCode == http.StatusNotModified {
  139508. if res.Body != nil {
  139509. res.Body.Close()
  139510. }
  139511. return nil, &googleapi.Error{
  139512. Code: res.StatusCode,
  139513. Header: res.Header,
  139514. }
  139515. }
  139516. if err != nil {
  139517. return nil, err
  139518. }
  139519. defer googleapi.CloseBody(res)
  139520. if err := googleapi.CheckResponse(res); err != nil {
  139521. return nil, err
  139522. }
  139523. ret := &Operation{
  139524. ServerResponse: googleapi.ServerResponse{
  139525. Header: res.Header,
  139526. HTTPStatusCode: res.StatusCode,
  139527. },
  139528. }
  139529. target := &ret
  139530. if err := gensupport.DecodeResponse(target, res); err != nil {
  139531. return nil, err
  139532. }
  139533. return ret, nil
  139534. // {
  139535. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  139536. // "httpMethod": "POST",
  139537. // "id": "compute.targetSslProxies.setProxyHeader",
  139538. // "parameterOrder": [
  139539. // "project",
  139540. // "targetSslProxy"
  139541. // ],
  139542. // "parameters": {
  139543. // "project": {
  139544. // "description": "Project ID for this request.",
  139545. // "location": "path",
  139546. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  139547. // "required": true,
  139548. // "type": "string"
  139549. // },
  139550. // "requestId": {
  139551. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  139552. // "location": "query",
  139553. // "type": "string"
  139554. // },
  139555. // "targetSslProxy": {
  139556. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  139557. // "location": "path",
  139558. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  139559. // "required": true,
  139560. // "type": "string"
  139561. // }
  139562. // },
  139563. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  139564. // "request": {
  139565. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  139566. // },
  139567. // "response": {
  139568. // "$ref": "Operation"
  139569. // },
  139570. // "scopes": [
  139571. // "https://www.googleapis.com/auth/cloud-platform",
  139572. // "https://www.googleapis.com/auth/compute"
  139573. // ]
  139574. // }
  139575. }
  139576. // method id "compute.targetSslProxies.setSslCertificates":
  139577. type TargetSslProxiesSetSslCertificatesCall struct {
  139578. s *Service
  139579. project string
  139580. targetSslProxy string
  139581. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  139582. urlParams_ gensupport.URLParams
  139583. ctx_ context.Context
  139584. header_ http.Header
  139585. }
  139586. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  139587. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  139588. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139589. c.project = project
  139590. c.targetSslProxy = targetSslProxy
  139591. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  139592. return c
  139593. }
  139594. // RequestId sets the optional parameter "requestId": An optional
  139595. // request ID to identify requests. Specify a unique request ID so that
  139596. // if you must retry your request, the server will know to ignore the
  139597. // request if it has already been completed.
  139598. //
  139599. // For example, consider a situation where you make an initial request
  139600. // and the request times out. If you make the request again with the
  139601. // same request ID, the server can check if original operation with the
  139602. // same request ID was received, and if so, will ignore the second
  139603. // request. This prevents clients from accidentally creating duplicate
  139604. // commitments.
  139605. //
  139606. // The request ID must be a valid UUID with the exception that zero UUID
  139607. // is not supported (00000000-0000-0000-0000-000000000000).
  139608. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  139609. c.urlParams_.Set("requestId", requestId)
  139610. return c
  139611. }
  139612. // Fields allows partial responses to be retrieved. See
  139613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139614. // for more information.
  139615. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  139616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139617. return c
  139618. }
  139619. // Context sets the context to be used in this call's Do method. Any
  139620. // pending HTTP request will be aborted if the provided context is
  139621. // canceled.
  139622. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  139623. c.ctx_ = ctx
  139624. return c
  139625. }
  139626. // Header returns an http.Header that can be modified by the caller to
  139627. // add HTTP headers to the request.
  139628. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  139629. if c.header_ == nil {
  139630. c.header_ = make(http.Header)
  139631. }
  139632. return c.header_
  139633. }
  139634. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  139635. reqHeaders := make(http.Header)
  139636. for k, v := range c.header_ {
  139637. reqHeaders[k] = v
  139638. }
  139639. reqHeaders.Set("User-Agent", c.s.userAgent())
  139640. var body io.Reader = nil
  139641. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  139642. if err != nil {
  139643. return nil, err
  139644. }
  139645. reqHeaders.Set("Content-Type", "application/json")
  139646. c.urlParams_.Set("alt", alt)
  139647. c.urlParams_.Set("prettyPrint", "false")
  139648. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  139649. urls += "?" + c.urlParams_.Encode()
  139650. req, err := http.NewRequest("POST", urls, body)
  139651. if err != nil {
  139652. return nil, err
  139653. }
  139654. req.Header = reqHeaders
  139655. googleapi.Expand(req.URL, map[string]string{
  139656. "project": c.project,
  139657. "targetSslProxy": c.targetSslProxy,
  139658. })
  139659. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139660. }
  139661. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  139662. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  139663. // status code is an error. Response headers are in either
  139664. // *Operation.ServerResponse.Header or (if a response was returned at
  139665. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  139666. // to check whether the returned error was because
  139667. // http.StatusNotModified was returned.
  139668. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  139669. gensupport.SetOptions(c.urlParams_, opts...)
  139670. res, err := c.doRequest("json")
  139671. if res != nil && res.StatusCode == http.StatusNotModified {
  139672. if res.Body != nil {
  139673. res.Body.Close()
  139674. }
  139675. return nil, &googleapi.Error{
  139676. Code: res.StatusCode,
  139677. Header: res.Header,
  139678. }
  139679. }
  139680. if err != nil {
  139681. return nil, err
  139682. }
  139683. defer googleapi.CloseBody(res)
  139684. if err := googleapi.CheckResponse(res); err != nil {
  139685. return nil, err
  139686. }
  139687. ret := &Operation{
  139688. ServerResponse: googleapi.ServerResponse{
  139689. Header: res.Header,
  139690. HTTPStatusCode: res.StatusCode,
  139691. },
  139692. }
  139693. target := &ret
  139694. if err := gensupport.DecodeResponse(target, res); err != nil {
  139695. return nil, err
  139696. }
  139697. return ret, nil
  139698. // {
  139699. // "description": "Changes SslCertificates for TargetSslProxy.",
  139700. // "httpMethod": "POST",
  139701. // "id": "compute.targetSslProxies.setSslCertificates",
  139702. // "parameterOrder": [
  139703. // "project",
  139704. // "targetSslProxy"
  139705. // ],
  139706. // "parameters": {
  139707. // "project": {
  139708. // "description": "Project ID for this request.",
  139709. // "location": "path",
  139710. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  139711. // "required": true,
  139712. // "type": "string"
  139713. // },
  139714. // "requestId": {
  139715. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  139716. // "location": "query",
  139717. // "type": "string"
  139718. // },
  139719. // "targetSslProxy": {
  139720. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  139721. // "location": "path",
  139722. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  139723. // "required": true,
  139724. // "type": "string"
  139725. // }
  139726. // },
  139727. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  139728. // "request": {
  139729. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  139730. // },
  139731. // "response": {
  139732. // "$ref": "Operation"
  139733. // },
  139734. // "scopes": [
  139735. // "https://www.googleapis.com/auth/cloud-platform",
  139736. // "https://www.googleapis.com/auth/compute"
  139737. // ]
  139738. // }
  139739. }
  139740. // method id "compute.targetSslProxies.setSslPolicy":
  139741. type TargetSslProxiesSetSslPolicyCall struct {
  139742. s *Service
  139743. project string
  139744. targetSslProxy string
  139745. sslpolicyreference *SslPolicyReference
  139746. urlParams_ gensupport.URLParams
  139747. ctx_ context.Context
  139748. header_ http.Header
  139749. }
  139750. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  139751. // specifies the server-side support for SSL features. This affects
  139752. // connections between clients and the SSL proxy load balancer. They do
  139753. // not affect the connection between the load balancer and the backends.
  139754. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  139755. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139756. c.project = project
  139757. c.targetSslProxy = targetSslProxy
  139758. c.sslpolicyreference = sslpolicyreference
  139759. return c
  139760. }
  139761. // RequestId sets the optional parameter "requestId": An optional
  139762. // request ID to identify requests. Specify a unique request ID so that
  139763. // if you must retry your request, the server will know to ignore the
  139764. // request if it has already been completed.
  139765. //
  139766. // For example, consider a situation where you make an initial request
  139767. // and the request times out. If you make the request again with the
  139768. // same request ID, the server can check if original operation with the
  139769. // same request ID was received, and if so, will ignore the second
  139770. // request. This prevents clients from accidentally creating duplicate
  139771. // commitments.
  139772. //
  139773. // The request ID must be a valid UUID with the exception that zero UUID
  139774. // is not supported (00000000-0000-0000-0000-000000000000).
  139775. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  139776. c.urlParams_.Set("requestId", requestId)
  139777. return c
  139778. }
  139779. // Fields allows partial responses to be retrieved. See
  139780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139781. // for more information.
  139782. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  139783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139784. return c
  139785. }
  139786. // Context sets the context to be used in this call's Do method. Any
  139787. // pending HTTP request will be aborted if the provided context is
  139788. // canceled.
  139789. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  139790. c.ctx_ = ctx
  139791. return c
  139792. }
  139793. // Header returns an http.Header that can be modified by the caller to
  139794. // add HTTP headers to the request.
  139795. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  139796. if c.header_ == nil {
  139797. c.header_ = make(http.Header)
  139798. }
  139799. return c.header_
  139800. }
  139801. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  139802. reqHeaders := make(http.Header)
  139803. for k, v := range c.header_ {
  139804. reqHeaders[k] = v
  139805. }
  139806. reqHeaders.Set("User-Agent", c.s.userAgent())
  139807. var body io.Reader = nil
  139808. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  139809. if err != nil {
  139810. return nil, err
  139811. }
  139812. reqHeaders.Set("Content-Type", "application/json")
  139813. c.urlParams_.Set("alt", alt)
  139814. c.urlParams_.Set("prettyPrint", "false")
  139815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  139816. urls += "?" + c.urlParams_.Encode()
  139817. req, err := http.NewRequest("POST", urls, body)
  139818. if err != nil {
  139819. return nil, err
  139820. }
  139821. req.Header = reqHeaders
  139822. googleapi.Expand(req.URL, map[string]string{
  139823. "project": c.project,
  139824. "targetSslProxy": c.targetSslProxy,
  139825. })
  139826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139827. }
  139828. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  139829. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  139830. // status code is an error. Response headers are in either
  139831. // *Operation.ServerResponse.Header or (if a response was returned at
  139832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  139833. // to check whether the returned error was because
  139834. // http.StatusNotModified was returned.
  139835. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  139836. gensupport.SetOptions(c.urlParams_, opts...)
  139837. res, err := c.doRequest("json")
  139838. if res != nil && res.StatusCode == http.StatusNotModified {
  139839. if res.Body != nil {
  139840. res.Body.Close()
  139841. }
  139842. return nil, &googleapi.Error{
  139843. Code: res.StatusCode,
  139844. Header: res.Header,
  139845. }
  139846. }
  139847. if err != nil {
  139848. return nil, err
  139849. }
  139850. defer googleapi.CloseBody(res)
  139851. if err := googleapi.CheckResponse(res); err != nil {
  139852. return nil, err
  139853. }
  139854. ret := &Operation{
  139855. ServerResponse: googleapi.ServerResponse{
  139856. Header: res.Header,
  139857. HTTPStatusCode: res.StatusCode,
  139858. },
  139859. }
  139860. target := &ret
  139861. if err := gensupport.DecodeResponse(target, res); err != nil {
  139862. return nil, err
  139863. }
  139864. return ret, nil
  139865. // {
  139866. // "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.",
  139867. // "httpMethod": "POST",
  139868. // "id": "compute.targetSslProxies.setSslPolicy",
  139869. // "parameterOrder": [
  139870. // "project",
  139871. // "targetSslProxy"
  139872. // ],
  139873. // "parameters": {
  139874. // "project": {
  139875. // "description": "Project ID for this request.",
  139876. // "location": "path",
  139877. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  139878. // "required": true,
  139879. // "type": "string"
  139880. // },
  139881. // "requestId": {
  139882. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  139883. // "location": "query",
  139884. // "type": "string"
  139885. // },
  139886. // "targetSslProxy": {
  139887. // "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.",
  139888. // "location": "path",
  139889. // "required": true,
  139890. // "type": "string"
  139891. // }
  139892. // },
  139893. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  139894. // "request": {
  139895. // "$ref": "SslPolicyReference"
  139896. // },
  139897. // "response": {
  139898. // "$ref": "Operation"
  139899. // },
  139900. // "scopes": [
  139901. // "https://www.googleapis.com/auth/cloud-platform",
  139902. // "https://www.googleapis.com/auth/compute"
  139903. // ]
  139904. // }
  139905. }
  139906. // method id "compute.targetSslProxies.testIamPermissions":
  139907. type TargetSslProxiesTestIamPermissionsCall struct {
  139908. s *Service
  139909. project string
  139910. resource string
  139911. testpermissionsrequest *TestPermissionsRequest
  139912. urlParams_ gensupport.URLParams
  139913. ctx_ context.Context
  139914. header_ http.Header
  139915. }
  139916. // TestIamPermissions: Returns permissions that a caller has on the
  139917. // specified resource.
  139918. func (r *TargetSslProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetSslProxiesTestIamPermissionsCall {
  139919. c := &TargetSslProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139920. c.project = project
  139921. c.resource = resource
  139922. c.testpermissionsrequest = testpermissionsrequest
  139923. return c
  139924. }
  139925. // Fields allows partial responses to be retrieved. See
  139926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139927. // for more information.
  139928. func (c *TargetSslProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetSslProxiesTestIamPermissionsCall {
  139929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139930. return c
  139931. }
  139932. // Context sets the context to be used in this call's Do method. Any
  139933. // pending HTTP request will be aborted if the provided context is
  139934. // canceled.
  139935. func (c *TargetSslProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetSslProxiesTestIamPermissionsCall {
  139936. c.ctx_ = ctx
  139937. return c
  139938. }
  139939. // Header returns an http.Header that can be modified by the caller to
  139940. // add HTTP headers to the request.
  139941. func (c *TargetSslProxiesTestIamPermissionsCall) Header() http.Header {
  139942. if c.header_ == nil {
  139943. c.header_ = make(http.Header)
  139944. }
  139945. return c.header_
  139946. }
  139947. func (c *TargetSslProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  139948. reqHeaders := make(http.Header)
  139949. for k, v := range c.header_ {
  139950. reqHeaders[k] = v
  139951. }
  139952. reqHeaders.Set("User-Agent", c.s.userAgent())
  139953. var body io.Reader = nil
  139954. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  139955. if err != nil {
  139956. return nil, err
  139957. }
  139958. reqHeaders.Set("Content-Type", "application/json")
  139959. c.urlParams_.Set("alt", alt)
  139960. c.urlParams_.Set("prettyPrint", "false")
  139961. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{resource}/testIamPermissions")
  139962. urls += "?" + c.urlParams_.Encode()
  139963. req, err := http.NewRequest("POST", urls, body)
  139964. if err != nil {
  139965. return nil, err
  139966. }
  139967. req.Header = reqHeaders
  139968. googleapi.Expand(req.URL, map[string]string{
  139969. "project": c.project,
  139970. "resource": c.resource,
  139971. })
  139972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139973. }
  139974. // Do executes the "compute.targetSslProxies.testIamPermissions" call.
  139975. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  139976. // non-2xx status code is an error. Response headers are in either
  139977. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  139978. // returned at all) in error.(*googleapi.Error).Header. Use
  139979. // googleapi.IsNotModified to check whether the returned error was
  139980. // because http.StatusNotModified was returned.
  139981. func (c *TargetSslProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  139982. gensupport.SetOptions(c.urlParams_, opts...)
  139983. res, err := c.doRequest("json")
  139984. if res != nil && res.StatusCode == http.StatusNotModified {
  139985. if res.Body != nil {
  139986. res.Body.Close()
  139987. }
  139988. return nil, &googleapi.Error{
  139989. Code: res.StatusCode,
  139990. Header: res.Header,
  139991. }
  139992. }
  139993. if err != nil {
  139994. return nil, err
  139995. }
  139996. defer googleapi.CloseBody(res)
  139997. if err := googleapi.CheckResponse(res); err != nil {
  139998. return nil, err
  139999. }
  140000. ret := &TestPermissionsResponse{
  140001. ServerResponse: googleapi.ServerResponse{
  140002. Header: res.Header,
  140003. HTTPStatusCode: res.StatusCode,
  140004. },
  140005. }
  140006. target := &ret
  140007. if err := gensupport.DecodeResponse(target, res); err != nil {
  140008. return nil, err
  140009. }
  140010. return ret, nil
  140011. // {
  140012. // "description": "Returns permissions that a caller has on the specified resource.",
  140013. // "httpMethod": "POST",
  140014. // "id": "compute.targetSslProxies.testIamPermissions",
  140015. // "parameterOrder": [
  140016. // "project",
  140017. // "resource"
  140018. // ],
  140019. // "parameters": {
  140020. // "project": {
  140021. // "description": "Project ID for this request.",
  140022. // "location": "path",
  140023. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140024. // "required": true,
  140025. // "type": "string"
  140026. // },
  140027. // "resource": {
  140028. // "description": "Name or id of the resource for this request.",
  140029. // "location": "path",
  140030. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  140031. // "required": true,
  140032. // "type": "string"
  140033. // }
  140034. // },
  140035. // "path": "{project}/global/targetSslProxies/{resource}/testIamPermissions",
  140036. // "request": {
  140037. // "$ref": "TestPermissionsRequest"
  140038. // },
  140039. // "response": {
  140040. // "$ref": "TestPermissionsResponse"
  140041. // },
  140042. // "scopes": [
  140043. // "https://www.googleapis.com/auth/cloud-platform",
  140044. // "https://www.googleapis.com/auth/compute",
  140045. // "https://www.googleapis.com/auth/compute.readonly"
  140046. // ]
  140047. // }
  140048. }
  140049. // method id "compute.targetTcpProxies.delete":
  140050. type TargetTcpProxiesDeleteCall struct {
  140051. s *Service
  140052. project string
  140053. targetTcpProxy string
  140054. urlParams_ gensupport.URLParams
  140055. ctx_ context.Context
  140056. header_ http.Header
  140057. }
  140058. // Delete: Deletes the specified TargetTcpProxy resource.
  140059. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  140060. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140061. c.project = project
  140062. c.targetTcpProxy = targetTcpProxy
  140063. return c
  140064. }
  140065. // RequestId sets the optional parameter "requestId": An optional
  140066. // request ID to identify requests. Specify a unique request ID so that
  140067. // if you must retry your request, the server will know to ignore the
  140068. // request if it has already been completed.
  140069. //
  140070. // For example, consider a situation where you make an initial request
  140071. // and the request times out. If you make the request again with the
  140072. // same request ID, the server can check if original operation with the
  140073. // same request ID was received, and if so, will ignore the second
  140074. // request. This prevents clients from accidentally creating duplicate
  140075. // commitments.
  140076. //
  140077. // The request ID must be a valid UUID with the exception that zero UUID
  140078. // is not supported (00000000-0000-0000-0000-000000000000).
  140079. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  140080. c.urlParams_.Set("requestId", requestId)
  140081. return c
  140082. }
  140083. // Fields allows partial responses to be retrieved. See
  140084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140085. // for more information.
  140086. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  140087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140088. return c
  140089. }
  140090. // Context sets the context to be used in this call's Do method. Any
  140091. // pending HTTP request will be aborted if the provided context is
  140092. // canceled.
  140093. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  140094. c.ctx_ = ctx
  140095. return c
  140096. }
  140097. // Header returns an http.Header that can be modified by the caller to
  140098. // add HTTP headers to the request.
  140099. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  140100. if c.header_ == nil {
  140101. c.header_ = make(http.Header)
  140102. }
  140103. return c.header_
  140104. }
  140105. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  140106. reqHeaders := make(http.Header)
  140107. for k, v := range c.header_ {
  140108. reqHeaders[k] = v
  140109. }
  140110. reqHeaders.Set("User-Agent", c.s.userAgent())
  140111. var body io.Reader = nil
  140112. c.urlParams_.Set("alt", alt)
  140113. c.urlParams_.Set("prettyPrint", "false")
  140114. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  140115. urls += "?" + c.urlParams_.Encode()
  140116. req, err := http.NewRequest("DELETE", urls, body)
  140117. if err != nil {
  140118. return nil, err
  140119. }
  140120. req.Header = reqHeaders
  140121. googleapi.Expand(req.URL, map[string]string{
  140122. "project": c.project,
  140123. "targetTcpProxy": c.targetTcpProxy,
  140124. })
  140125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140126. }
  140127. // Do executes the "compute.targetTcpProxies.delete" call.
  140128. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  140129. // status code is an error. Response headers are in either
  140130. // *Operation.ServerResponse.Header or (if a response was returned at
  140131. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  140132. // to check whether the returned error was because
  140133. // http.StatusNotModified was returned.
  140134. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  140135. gensupport.SetOptions(c.urlParams_, opts...)
  140136. res, err := c.doRequest("json")
  140137. if res != nil && res.StatusCode == http.StatusNotModified {
  140138. if res.Body != nil {
  140139. res.Body.Close()
  140140. }
  140141. return nil, &googleapi.Error{
  140142. Code: res.StatusCode,
  140143. Header: res.Header,
  140144. }
  140145. }
  140146. if err != nil {
  140147. return nil, err
  140148. }
  140149. defer googleapi.CloseBody(res)
  140150. if err := googleapi.CheckResponse(res); err != nil {
  140151. return nil, err
  140152. }
  140153. ret := &Operation{
  140154. ServerResponse: googleapi.ServerResponse{
  140155. Header: res.Header,
  140156. HTTPStatusCode: res.StatusCode,
  140157. },
  140158. }
  140159. target := &ret
  140160. if err := gensupport.DecodeResponse(target, res); err != nil {
  140161. return nil, err
  140162. }
  140163. return ret, nil
  140164. // {
  140165. // "description": "Deletes the specified TargetTcpProxy resource.",
  140166. // "httpMethod": "DELETE",
  140167. // "id": "compute.targetTcpProxies.delete",
  140168. // "parameterOrder": [
  140169. // "project",
  140170. // "targetTcpProxy"
  140171. // ],
  140172. // "parameters": {
  140173. // "project": {
  140174. // "description": "Project ID for this request.",
  140175. // "location": "path",
  140176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140177. // "required": true,
  140178. // "type": "string"
  140179. // },
  140180. // "requestId": {
  140181. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  140182. // "location": "query",
  140183. // "type": "string"
  140184. // },
  140185. // "targetTcpProxy": {
  140186. // "description": "Name of the TargetTcpProxy resource to delete.",
  140187. // "location": "path",
  140188. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  140189. // "required": true,
  140190. // "type": "string"
  140191. // }
  140192. // },
  140193. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  140194. // "response": {
  140195. // "$ref": "Operation"
  140196. // },
  140197. // "scopes": [
  140198. // "https://www.googleapis.com/auth/cloud-platform",
  140199. // "https://www.googleapis.com/auth/compute"
  140200. // ]
  140201. // }
  140202. }
  140203. // method id "compute.targetTcpProxies.get":
  140204. type TargetTcpProxiesGetCall struct {
  140205. s *Service
  140206. project string
  140207. targetTcpProxy string
  140208. urlParams_ gensupport.URLParams
  140209. ifNoneMatch_ string
  140210. ctx_ context.Context
  140211. header_ http.Header
  140212. }
  140213. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  140214. // available target TCP proxies by making a list() request.
  140215. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  140216. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140217. c.project = project
  140218. c.targetTcpProxy = targetTcpProxy
  140219. return c
  140220. }
  140221. // Fields allows partial responses to be retrieved. See
  140222. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140223. // for more information.
  140224. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  140225. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140226. return c
  140227. }
  140228. // IfNoneMatch sets the optional parameter which makes the operation
  140229. // fail if the object's ETag matches the given value. This is useful for
  140230. // getting updates only after the object has changed since the last
  140231. // request. Use googleapi.IsNotModified to check whether the response
  140232. // error from Do is the result of In-None-Match.
  140233. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  140234. c.ifNoneMatch_ = entityTag
  140235. return c
  140236. }
  140237. // Context sets the context to be used in this call's Do method. Any
  140238. // pending HTTP request will be aborted if the provided context is
  140239. // canceled.
  140240. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  140241. c.ctx_ = ctx
  140242. return c
  140243. }
  140244. // Header returns an http.Header that can be modified by the caller to
  140245. // add HTTP headers to the request.
  140246. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  140247. if c.header_ == nil {
  140248. c.header_ = make(http.Header)
  140249. }
  140250. return c.header_
  140251. }
  140252. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  140253. reqHeaders := make(http.Header)
  140254. for k, v := range c.header_ {
  140255. reqHeaders[k] = v
  140256. }
  140257. reqHeaders.Set("User-Agent", c.s.userAgent())
  140258. if c.ifNoneMatch_ != "" {
  140259. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  140260. }
  140261. var body io.Reader = nil
  140262. c.urlParams_.Set("alt", alt)
  140263. c.urlParams_.Set("prettyPrint", "false")
  140264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  140265. urls += "?" + c.urlParams_.Encode()
  140266. req, err := http.NewRequest("GET", urls, body)
  140267. if err != nil {
  140268. return nil, err
  140269. }
  140270. req.Header = reqHeaders
  140271. googleapi.Expand(req.URL, map[string]string{
  140272. "project": c.project,
  140273. "targetTcpProxy": c.targetTcpProxy,
  140274. })
  140275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140276. }
  140277. // Do executes the "compute.targetTcpProxies.get" call.
  140278. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  140279. // status code is an error. Response headers are in either
  140280. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  140281. // at all) in error.(*googleapi.Error).Header. Use
  140282. // googleapi.IsNotModified to check whether the returned error was
  140283. // because http.StatusNotModified was returned.
  140284. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  140285. gensupport.SetOptions(c.urlParams_, opts...)
  140286. res, err := c.doRequest("json")
  140287. if res != nil && res.StatusCode == http.StatusNotModified {
  140288. if res.Body != nil {
  140289. res.Body.Close()
  140290. }
  140291. return nil, &googleapi.Error{
  140292. Code: res.StatusCode,
  140293. Header: res.Header,
  140294. }
  140295. }
  140296. if err != nil {
  140297. return nil, err
  140298. }
  140299. defer googleapi.CloseBody(res)
  140300. if err := googleapi.CheckResponse(res); err != nil {
  140301. return nil, err
  140302. }
  140303. ret := &TargetTcpProxy{
  140304. ServerResponse: googleapi.ServerResponse{
  140305. Header: res.Header,
  140306. HTTPStatusCode: res.StatusCode,
  140307. },
  140308. }
  140309. target := &ret
  140310. if err := gensupport.DecodeResponse(target, res); err != nil {
  140311. return nil, err
  140312. }
  140313. return ret, nil
  140314. // {
  140315. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  140316. // "httpMethod": "GET",
  140317. // "id": "compute.targetTcpProxies.get",
  140318. // "parameterOrder": [
  140319. // "project",
  140320. // "targetTcpProxy"
  140321. // ],
  140322. // "parameters": {
  140323. // "project": {
  140324. // "description": "Project ID for this request.",
  140325. // "location": "path",
  140326. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140327. // "required": true,
  140328. // "type": "string"
  140329. // },
  140330. // "targetTcpProxy": {
  140331. // "description": "Name of the TargetTcpProxy resource to return.",
  140332. // "location": "path",
  140333. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  140334. // "required": true,
  140335. // "type": "string"
  140336. // }
  140337. // },
  140338. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  140339. // "response": {
  140340. // "$ref": "TargetTcpProxy"
  140341. // },
  140342. // "scopes": [
  140343. // "https://www.googleapis.com/auth/cloud-platform",
  140344. // "https://www.googleapis.com/auth/compute",
  140345. // "https://www.googleapis.com/auth/compute.readonly"
  140346. // ]
  140347. // }
  140348. }
  140349. // method id "compute.targetTcpProxies.insert":
  140350. type TargetTcpProxiesInsertCall struct {
  140351. s *Service
  140352. project string
  140353. targettcpproxy *TargetTcpProxy
  140354. urlParams_ gensupport.URLParams
  140355. ctx_ context.Context
  140356. header_ http.Header
  140357. }
  140358. // Insert: Creates a TargetTcpProxy resource in the specified project
  140359. // using the data included in the request.
  140360. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  140361. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140362. c.project = project
  140363. c.targettcpproxy = targettcpproxy
  140364. return c
  140365. }
  140366. // RequestId sets the optional parameter "requestId": An optional
  140367. // request ID to identify requests. Specify a unique request ID so that
  140368. // if you must retry your request, the server will know to ignore the
  140369. // request if it has already been completed.
  140370. //
  140371. // For example, consider a situation where you make an initial request
  140372. // and the request times out. If you make the request again with the
  140373. // same request ID, the server can check if original operation with the
  140374. // same request ID was received, and if so, will ignore the second
  140375. // request. This prevents clients from accidentally creating duplicate
  140376. // commitments.
  140377. //
  140378. // The request ID must be a valid UUID with the exception that zero UUID
  140379. // is not supported (00000000-0000-0000-0000-000000000000).
  140380. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  140381. c.urlParams_.Set("requestId", requestId)
  140382. return c
  140383. }
  140384. // Fields allows partial responses to be retrieved. See
  140385. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140386. // for more information.
  140387. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  140388. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140389. return c
  140390. }
  140391. // Context sets the context to be used in this call's Do method. Any
  140392. // pending HTTP request will be aborted if the provided context is
  140393. // canceled.
  140394. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  140395. c.ctx_ = ctx
  140396. return c
  140397. }
  140398. // Header returns an http.Header that can be modified by the caller to
  140399. // add HTTP headers to the request.
  140400. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  140401. if c.header_ == nil {
  140402. c.header_ = make(http.Header)
  140403. }
  140404. return c.header_
  140405. }
  140406. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  140407. reqHeaders := make(http.Header)
  140408. for k, v := range c.header_ {
  140409. reqHeaders[k] = v
  140410. }
  140411. reqHeaders.Set("User-Agent", c.s.userAgent())
  140412. var body io.Reader = nil
  140413. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  140414. if err != nil {
  140415. return nil, err
  140416. }
  140417. reqHeaders.Set("Content-Type", "application/json")
  140418. c.urlParams_.Set("alt", alt)
  140419. c.urlParams_.Set("prettyPrint", "false")
  140420. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  140421. urls += "?" + c.urlParams_.Encode()
  140422. req, err := http.NewRequest("POST", urls, body)
  140423. if err != nil {
  140424. return nil, err
  140425. }
  140426. req.Header = reqHeaders
  140427. googleapi.Expand(req.URL, map[string]string{
  140428. "project": c.project,
  140429. })
  140430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140431. }
  140432. // Do executes the "compute.targetTcpProxies.insert" call.
  140433. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  140434. // status code is an error. Response headers are in either
  140435. // *Operation.ServerResponse.Header or (if a response was returned at
  140436. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  140437. // to check whether the returned error was because
  140438. // http.StatusNotModified was returned.
  140439. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  140440. gensupport.SetOptions(c.urlParams_, opts...)
  140441. res, err := c.doRequest("json")
  140442. if res != nil && res.StatusCode == http.StatusNotModified {
  140443. if res.Body != nil {
  140444. res.Body.Close()
  140445. }
  140446. return nil, &googleapi.Error{
  140447. Code: res.StatusCode,
  140448. Header: res.Header,
  140449. }
  140450. }
  140451. if err != nil {
  140452. return nil, err
  140453. }
  140454. defer googleapi.CloseBody(res)
  140455. if err := googleapi.CheckResponse(res); err != nil {
  140456. return nil, err
  140457. }
  140458. ret := &Operation{
  140459. ServerResponse: googleapi.ServerResponse{
  140460. Header: res.Header,
  140461. HTTPStatusCode: res.StatusCode,
  140462. },
  140463. }
  140464. target := &ret
  140465. if err := gensupport.DecodeResponse(target, res); err != nil {
  140466. return nil, err
  140467. }
  140468. return ret, nil
  140469. // {
  140470. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  140471. // "httpMethod": "POST",
  140472. // "id": "compute.targetTcpProxies.insert",
  140473. // "parameterOrder": [
  140474. // "project"
  140475. // ],
  140476. // "parameters": {
  140477. // "project": {
  140478. // "description": "Project ID for this request.",
  140479. // "location": "path",
  140480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140481. // "required": true,
  140482. // "type": "string"
  140483. // },
  140484. // "requestId": {
  140485. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  140486. // "location": "query",
  140487. // "type": "string"
  140488. // }
  140489. // },
  140490. // "path": "{project}/global/targetTcpProxies",
  140491. // "request": {
  140492. // "$ref": "TargetTcpProxy"
  140493. // },
  140494. // "response": {
  140495. // "$ref": "Operation"
  140496. // },
  140497. // "scopes": [
  140498. // "https://www.googleapis.com/auth/cloud-platform",
  140499. // "https://www.googleapis.com/auth/compute"
  140500. // ]
  140501. // }
  140502. }
  140503. // method id "compute.targetTcpProxies.list":
  140504. type TargetTcpProxiesListCall struct {
  140505. s *Service
  140506. project string
  140507. urlParams_ gensupport.URLParams
  140508. ifNoneMatch_ string
  140509. ctx_ context.Context
  140510. header_ http.Header
  140511. }
  140512. // List: Retrieves the list of TargetTcpProxy resources available to the
  140513. // specified project.
  140514. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  140515. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140516. c.project = project
  140517. return c
  140518. }
  140519. // Filter sets the optional parameter "filter": A filter expression that
  140520. // filters resources listed in the response. The expression must specify
  140521. // the field name, a comparison operator, and the value that you want to
  140522. // use for filtering. The value must be a string, a number, or a
  140523. // boolean. The comparison operator must be either =, !=, >, or <.
  140524. //
  140525. // For example, if you are filtering Compute Engine instances, you can
  140526. // exclude instances named example-instance by specifying name !=
  140527. // example-instance.
  140528. //
  140529. // You can also filter nested fields. For example, you could specify
  140530. // scheduling.automaticRestart = false to include instances only if they
  140531. // are not scheduled for automatic restarts. You can use filtering on
  140532. // nested fields to filter based on resource labels.
  140533. //
  140534. // To filter on multiple expressions, provide each separate expression
  140535. // within parentheses. For example, (scheduling.automaticRestart = true)
  140536. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  140537. // AND expression. However, you can include AND and OR expressions
  140538. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  140539. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  140540. // true).
  140541. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  140542. c.urlParams_.Set("filter", filter)
  140543. return c
  140544. }
  140545. // MaxResults sets the optional parameter "maxResults": The maximum
  140546. // number of results per page that should be returned. If the number of
  140547. // available results is larger than maxResults, Compute Engine returns a
  140548. // nextPageToken that can be used to get the next page of results in
  140549. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  140550. // (Default: 500)
  140551. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  140552. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  140553. return c
  140554. }
  140555. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  140556. // a certain order. By default, results are returned in alphanumerical
  140557. // order based on the resource name.
  140558. //
  140559. // You can also sort results in descending order based on the creation
  140560. // timestamp using orderBy="creationTimestamp desc". This sorts results
  140561. // based on the creationTimestamp field in reverse chronological order
  140562. // (newest result first). Use this to sort resources like operations so
  140563. // that the newest operation is returned first.
  140564. //
  140565. // Currently, only sorting by name or creationTimestamp desc is
  140566. // supported.
  140567. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  140568. c.urlParams_.Set("orderBy", orderBy)
  140569. return c
  140570. }
  140571. // PageToken sets the optional parameter "pageToken": Specifies a page
  140572. // token to use. Set pageToken to the nextPageToken returned by a
  140573. // previous list request to get the next page of results.
  140574. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  140575. c.urlParams_.Set("pageToken", pageToken)
  140576. return c
  140577. }
  140578. // Fields allows partial responses to be retrieved. See
  140579. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140580. // for more information.
  140581. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  140582. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140583. return c
  140584. }
  140585. // IfNoneMatch sets the optional parameter which makes the operation
  140586. // fail if the object's ETag matches the given value. This is useful for
  140587. // getting updates only after the object has changed since the last
  140588. // request. Use googleapi.IsNotModified to check whether the response
  140589. // error from Do is the result of In-None-Match.
  140590. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  140591. c.ifNoneMatch_ = entityTag
  140592. return c
  140593. }
  140594. // Context sets the context to be used in this call's Do method. Any
  140595. // pending HTTP request will be aborted if the provided context is
  140596. // canceled.
  140597. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  140598. c.ctx_ = ctx
  140599. return c
  140600. }
  140601. // Header returns an http.Header that can be modified by the caller to
  140602. // add HTTP headers to the request.
  140603. func (c *TargetTcpProxiesListCall) Header() http.Header {
  140604. if c.header_ == nil {
  140605. c.header_ = make(http.Header)
  140606. }
  140607. return c.header_
  140608. }
  140609. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  140610. reqHeaders := make(http.Header)
  140611. for k, v := range c.header_ {
  140612. reqHeaders[k] = v
  140613. }
  140614. reqHeaders.Set("User-Agent", c.s.userAgent())
  140615. if c.ifNoneMatch_ != "" {
  140616. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  140617. }
  140618. var body io.Reader = nil
  140619. c.urlParams_.Set("alt", alt)
  140620. c.urlParams_.Set("prettyPrint", "false")
  140621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  140622. urls += "?" + c.urlParams_.Encode()
  140623. req, err := http.NewRequest("GET", urls, body)
  140624. if err != nil {
  140625. return nil, err
  140626. }
  140627. req.Header = reqHeaders
  140628. googleapi.Expand(req.URL, map[string]string{
  140629. "project": c.project,
  140630. })
  140631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140632. }
  140633. // Do executes the "compute.targetTcpProxies.list" call.
  140634. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  140635. // non-2xx status code is an error. Response headers are in either
  140636. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  140637. // returned at all) in error.(*googleapi.Error).Header. Use
  140638. // googleapi.IsNotModified to check whether the returned error was
  140639. // because http.StatusNotModified was returned.
  140640. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  140641. gensupport.SetOptions(c.urlParams_, opts...)
  140642. res, err := c.doRequest("json")
  140643. if res != nil && res.StatusCode == http.StatusNotModified {
  140644. if res.Body != nil {
  140645. res.Body.Close()
  140646. }
  140647. return nil, &googleapi.Error{
  140648. Code: res.StatusCode,
  140649. Header: res.Header,
  140650. }
  140651. }
  140652. if err != nil {
  140653. return nil, err
  140654. }
  140655. defer googleapi.CloseBody(res)
  140656. if err := googleapi.CheckResponse(res); err != nil {
  140657. return nil, err
  140658. }
  140659. ret := &TargetTcpProxyList{
  140660. ServerResponse: googleapi.ServerResponse{
  140661. Header: res.Header,
  140662. HTTPStatusCode: res.StatusCode,
  140663. },
  140664. }
  140665. target := &ret
  140666. if err := gensupport.DecodeResponse(target, res); err != nil {
  140667. return nil, err
  140668. }
  140669. return ret, nil
  140670. // {
  140671. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  140672. // "httpMethod": "GET",
  140673. // "id": "compute.targetTcpProxies.list",
  140674. // "parameterOrder": [
  140675. // "project"
  140676. // ],
  140677. // "parameters": {
  140678. // "filter": {
  140679. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  140680. // "location": "query",
  140681. // "type": "string"
  140682. // },
  140683. // "maxResults": {
  140684. // "default": "500",
  140685. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  140686. // "format": "uint32",
  140687. // "location": "query",
  140688. // "minimum": "0",
  140689. // "type": "integer"
  140690. // },
  140691. // "orderBy": {
  140692. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  140693. // "location": "query",
  140694. // "type": "string"
  140695. // },
  140696. // "pageToken": {
  140697. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  140698. // "location": "query",
  140699. // "type": "string"
  140700. // },
  140701. // "project": {
  140702. // "description": "Project ID for this request.",
  140703. // "location": "path",
  140704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140705. // "required": true,
  140706. // "type": "string"
  140707. // }
  140708. // },
  140709. // "path": "{project}/global/targetTcpProxies",
  140710. // "response": {
  140711. // "$ref": "TargetTcpProxyList"
  140712. // },
  140713. // "scopes": [
  140714. // "https://www.googleapis.com/auth/cloud-platform",
  140715. // "https://www.googleapis.com/auth/compute",
  140716. // "https://www.googleapis.com/auth/compute.readonly"
  140717. // ]
  140718. // }
  140719. }
  140720. // Pages invokes f for each page of results.
  140721. // A non-nil error returned from f will halt the iteration.
  140722. // The provided context supersedes any context provided to the Context method.
  140723. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  140724. c.ctx_ = ctx
  140725. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  140726. for {
  140727. x, err := c.Do()
  140728. if err != nil {
  140729. return err
  140730. }
  140731. if err := f(x); err != nil {
  140732. return err
  140733. }
  140734. if x.NextPageToken == "" {
  140735. return nil
  140736. }
  140737. c.PageToken(x.NextPageToken)
  140738. }
  140739. }
  140740. // method id "compute.targetTcpProxies.setBackendService":
  140741. type TargetTcpProxiesSetBackendServiceCall struct {
  140742. s *Service
  140743. project string
  140744. targetTcpProxy string
  140745. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  140746. urlParams_ gensupport.URLParams
  140747. ctx_ context.Context
  140748. header_ http.Header
  140749. }
  140750. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  140751. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  140752. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140753. c.project = project
  140754. c.targetTcpProxy = targetTcpProxy
  140755. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  140756. return c
  140757. }
  140758. // RequestId sets the optional parameter "requestId": An optional
  140759. // request ID to identify requests. Specify a unique request ID so that
  140760. // if you must retry your request, the server will know to ignore the
  140761. // request if it has already been completed.
  140762. //
  140763. // For example, consider a situation where you make an initial request
  140764. // and the request times out. If you make the request again with the
  140765. // same request ID, the server can check if original operation with the
  140766. // same request ID was received, and if so, will ignore the second
  140767. // request. This prevents clients from accidentally creating duplicate
  140768. // commitments.
  140769. //
  140770. // The request ID must be a valid UUID with the exception that zero UUID
  140771. // is not supported (00000000-0000-0000-0000-000000000000).
  140772. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  140773. c.urlParams_.Set("requestId", requestId)
  140774. return c
  140775. }
  140776. // Fields allows partial responses to be retrieved. See
  140777. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140778. // for more information.
  140779. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  140780. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140781. return c
  140782. }
  140783. // Context sets the context to be used in this call's Do method. Any
  140784. // pending HTTP request will be aborted if the provided context is
  140785. // canceled.
  140786. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  140787. c.ctx_ = ctx
  140788. return c
  140789. }
  140790. // Header returns an http.Header that can be modified by the caller to
  140791. // add HTTP headers to the request.
  140792. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  140793. if c.header_ == nil {
  140794. c.header_ = make(http.Header)
  140795. }
  140796. return c.header_
  140797. }
  140798. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  140799. reqHeaders := make(http.Header)
  140800. for k, v := range c.header_ {
  140801. reqHeaders[k] = v
  140802. }
  140803. reqHeaders.Set("User-Agent", c.s.userAgent())
  140804. var body io.Reader = nil
  140805. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  140806. if err != nil {
  140807. return nil, err
  140808. }
  140809. reqHeaders.Set("Content-Type", "application/json")
  140810. c.urlParams_.Set("alt", alt)
  140811. c.urlParams_.Set("prettyPrint", "false")
  140812. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  140813. urls += "?" + c.urlParams_.Encode()
  140814. req, err := http.NewRequest("POST", urls, body)
  140815. if err != nil {
  140816. return nil, err
  140817. }
  140818. req.Header = reqHeaders
  140819. googleapi.Expand(req.URL, map[string]string{
  140820. "project": c.project,
  140821. "targetTcpProxy": c.targetTcpProxy,
  140822. })
  140823. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140824. }
  140825. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  140826. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  140827. // status code is an error. Response headers are in either
  140828. // *Operation.ServerResponse.Header or (if a response was returned at
  140829. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  140830. // to check whether the returned error was because
  140831. // http.StatusNotModified was returned.
  140832. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  140833. gensupport.SetOptions(c.urlParams_, opts...)
  140834. res, err := c.doRequest("json")
  140835. if res != nil && res.StatusCode == http.StatusNotModified {
  140836. if res.Body != nil {
  140837. res.Body.Close()
  140838. }
  140839. return nil, &googleapi.Error{
  140840. Code: res.StatusCode,
  140841. Header: res.Header,
  140842. }
  140843. }
  140844. if err != nil {
  140845. return nil, err
  140846. }
  140847. defer googleapi.CloseBody(res)
  140848. if err := googleapi.CheckResponse(res); err != nil {
  140849. return nil, err
  140850. }
  140851. ret := &Operation{
  140852. ServerResponse: googleapi.ServerResponse{
  140853. Header: res.Header,
  140854. HTTPStatusCode: res.StatusCode,
  140855. },
  140856. }
  140857. target := &ret
  140858. if err := gensupport.DecodeResponse(target, res); err != nil {
  140859. return nil, err
  140860. }
  140861. return ret, nil
  140862. // {
  140863. // "description": "Changes the BackendService for TargetTcpProxy.",
  140864. // "httpMethod": "POST",
  140865. // "id": "compute.targetTcpProxies.setBackendService",
  140866. // "parameterOrder": [
  140867. // "project",
  140868. // "targetTcpProxy"
  140869. // ],
  140870. // "parameters": {
  140871. // "project": {
  140872. // "description": "Project ID for this request.",
  140873. // "location": "path",
  140874. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140875. // "required": true,
  140876. // "type": "string"
  140877. // },
  140878. // "requestId": {
  140879. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  140880. // "location": "query",
  140881. // "type": "string"
  140882. // },
  140883. // "targetTcpProxy": {
  140884. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  140885. // "location": "path",
  140886. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  140887. // "required": true,
  140888. // "type": "string"
  140889. // }
  140890. // },
  140891. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  140892. // "request": {
  140893. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  140894. // },
  140895. // "response": {
  140896. // "$ref": "Operation"
  140897. // },
  140898. // "scopes": [
  140899. // "https://www.googleapis.com/auth/cloud-platform",
  140900. // "https://www.googleapis.com/auth/compute"
  140901. // ]
  140902. // }
  140903. }
  140904. // method id "compute.targetTcpProxies.setProxyHeader":
  140905. type TargetTcpProxiesSetProxyHeaderCall struct {
  140906. s *Service
  140907. project string
  140908. targetTcpProxy string
  140909. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  140910. urlParams_ gensupport.URLParams
  140911. ctx_ context.Context
  140912. header_ http.Header
  140913. }
  140914. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  140915. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  140916. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140917. c.project = project
  140918. c.targetTcpProxy = targetTcpProxy
  140919. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  140920. return c
  140921. }
  140922. // RequestId sets the optional parameter "requestId": An optional
  140923. // request ID to identify requests. Specify a unique request ID so that
  140924. // if you must retry your request, the server will know to ignore the
  140925. // request if it has already been completed.
  140926. //
  140927. // For example, consider a situation where you make an initial request
  140928. // and the request times out. If you make the request again with the
  140929. // same request ID, the server can check if original operation with the
  140930. // same request ID was received, and if so, will ignore the second
  140931. // request. This prevents clients from accidentally creating duplicate
  140932. // commitments.
  140933. //
  140934. // The request ID must be a valid UUID with the exception that zero UUID
  140935. // is not supported (00000000-0000-0000-0000-000000000000).
  140936. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  140937. c.urlParams_.Set("requestId", requestId)
  140938. return c
  140939. }
  140940. // Fields allows partial responses to be retrieved. See
  140941. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140942. // for more information.
  140943. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  140944. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140945. return c
  140946. }
  140947. // Context sets the context to be used in this call's Do method. Any
  140948. // pending HTTP request will be aborted if the provided context is
  140949. // canceled.
  140950. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  140951. c.ctx_ = ctx
  140952. return c
  140953. }
  140954. // Header returns an http.Header that can be modified by the caller to
  140955. // add HTTP headers to the request.
  140956. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  140957. if c.header_ == nil {
  140958. c.header_ = make(http.Header)
  140959. }
  140960. return c.header_
  140961. }
  140962. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  140963. reqHeaders := make(http.Header)
  140964. for k, v := range c.header_ {
  140965. reqHeaders[k] = v
  140966. }
  140967. reqHeaders.Set("User-Agent", c.s.userAgent())
  140968. var body io.Reader = nil
  140969. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  140970. if err != nil {
  140971. return nil, err
  140972. }
  140973. reqHeaders.Set("Content-Type", "application/json")
  140974. c.urlParams_.Set("alt", alt)
  140975. c.urlParams_.Set("prettyPrint", "false")
  140976. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  140977. urls += "?" + c.urlParams_.Encode()
  140978. req, err := http.NewRequest("POST", urls, body)
  140979. if err != nil {
  140980. return nil, err
  140981. }
  140982. req.Header = reqHeaders
  140983. googleapi.Expand(req.URL, map[string]string{
  140984. "project": c.project,
  140985. "targetTcpProxy": c.targetTcpProxy,
  140986. })
  140987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140988. }
  140989. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  140990. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  140991. // status code is an error. Response headers are in either
  140992. // *Operation.ServerResponse.Header or (if a response was returned at
  140993. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  140994. // to check whether the returned error was because
  140995. // http.StatusNotModified was returned.
  140996. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  140997. gensupport.SetOptions(c.urlParams_, opts...)
  140998. res, err := c.doRequest("json")
  140999. if res != nil && res.StatusCode == http.StatusNotModified {
  141000. if res.Body != nil {
  141001. res.Body.Close()
  141002. }
  141003. return nil, &googleapi.Error{
  141004. Code: res.StatusCode,
  141005. Header: res.Header,
  141006. }
  141007. }
  141008. if err != nil {
  141009. return nil, err
  141010. }
  141011. defer googleapi.CloseBody(res)
  141012. if err := googleapi.CheckResponse(res); err != nil {
  141013. return nil, err
  141014. }
  141015. ret := &Operation{
  141016. ServerResponse: googleapi.ServerResponse{
  141017. Header: res.Header,
  141018. HTTPStatusCode: res.StatusCode,
  141019. },
  141020. }
  141021. target := &ret
  141022. if err := gensupport.DecodeResponse(target, res); err != nil {
  141023. return nil, err
  141024. }
  141025. return ret, nil
  141026. // {
  141027. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  141028. // "httpMethod": "POST",
  141029. // "id": "compute.targetTcpProxies.setProxyHeader",
  141030. // "parameterOrder": [
  141031. // "project",
  141032. // "targetTcpProxy"
  141033. // ],
  141034. // "parameters": {
  141035. // "project": {
  141036. // "description": "Project ID for this request.",
  141037. // "location": "path",
  141038. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141039. // "required": true,
  141040. // "type": "string"
  141041. // },
  141042. // "requestId": {
  141043. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  141044. // "location": "query",
  141045. // "type": "string"
  141046. // },
  141047. // "targetTcpProxy": {
  141048. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  141049. // "location": "path",
  141050. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  141051. // "required": true,
  141052. // "type": "string"
  141053. // }
  141054. // },
  141055. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  141056. // "request": {
  141057. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  141058. // },
  141059. // "response": {
  141060. // "$ref": "Operation"
  141061. // },
  141062. // "scopes": [
  141063. // "https://www.googleapis.com/auth/cloud-platform",
  141064. // "https://www.googleapis.com/auth/compute"
  141065. // ]
  141066. // }
  141067. }
  141068. // method id "compute.targetTcpProxies.testIamPermissions":
  141069. type TargetTcpProxiesTestIamPermissionsCall struct {
  141070. s *Service
  141071. project string
  141072. resource string
  141073. testpermissionsrequest *TestPermissionsRequest
  141074. urlParams_ gensupport.URLParams
  141075. ctx_ context.Context
  141076. header_ http.Header
  141077. }
  141078. // TestIamPermissions: Returns permissions that a caller has on the
  141079. // specified resource.
  141080. func (r *TargetTcpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetTcpProxiesTestIamPermissionsCall {
  141081. c := &TargetTcpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141082. c.project = project
  141083. c.resource = resource
  141084. c.testpermissionsrequest = testpermissionsrequest
  141085. return c
  141086. }
  141087. // Fields allows partial responses to be retrieved. See
  141088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  141089. // for more information.
  141090. func (c *TargetTcpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetTcpProxiesTestIamPermissionsCall {
  141091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  141092. return c
  141093. }
  141094. // Context sets the context to be used in this call's Do method. Any
  141095. // pending HTTP request will be aborted if the provided context is
  141096. // canceled.
  141097. func (c *TargetTcpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetTcpProxiesTestIamPermissionsCall {
  141098. c.ctx_ = ctx
  141099. return c
  141100. }
  141101. // Header returns an http.Header that can be modified by the caller to
  141102. // add HTTP headers to the request.
  141103. func (c *TargetTcpProxiesTestIamPermissionsCall) Header() http.Header {
  141104. if c.header_ == nil {
  141105. c.header_ = make(http.Header)
  141106. }
  141107. return c.header_
  141108. }
  141109. func (c *TargetTcpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  141110. reqHeaders := make(http.Header)
  141111. for k, v := range c.header_ {
  141112. reqHeaders[k] = v
  141113. }
  141114. reqHeaders.Set("User-Agent", c.s.userAgent())
  141115. var body io.Reader = nil
  141116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  141117. if err != nil {
  141118. return nil, err
  141119. }
  141120. reqHeaders.Set("Content-Type", "application/json")
  141121. c.urlParams_.Set("alt", alt)
  141122. c.urlParams_.Set("prettyPrint", "false")
  141123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{resource}/testIamPermissions")
  141124. urls += "?" + c.urlParams_.Encode()
  141125. req, err := http.NewRequest("POST", urls, body)
  141126. if err != nil {
  141127. return nil, err
  141128. }
  141129. req.Header = reqHeaders
  141130. googleapi.Expand(req.URL, map[string]string{
  141131. "project": c.project,
  141132. "resource": c.resource,
  141133. })
  141134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141135. }
  141136. // Do executes the "compute.targetTcpProxies.testIamPermissions" call.
  141137. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  141138. // non-2xx status code is an error. Response headers are in either
  141139. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  141140. // returned at all) in error.(*googleapi.Error).Header. Use
  141141. // googleapi.IsNotModified to check whether the returned error was
  141142. // because http.StatusNotModified was returned.
  141143. func (c *TargetTcpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  141144. gensupport.SetOptions(c.urlParams_, opts...)
  141145. res, err := c.doRequest("json")
  141146. if res != nil && res.StatusCode == http.StatusNotModified {
  141147. if res.Body != nil {
  141148. res.Body.Close()
  141149. }
  141150. return nil, &googleapi.Error{
  141151. Code: res.StatusCode,
  141152. Header: res.Header,
  141153. }
  141154. }
  141155. if err != nil {
  141156. return nil, err
  141157. }
  141158. defer googleapi.CloseBody(res)
  141159. if err := googleapi.CheckResponse(res); err != nil {
  141160. return nil, err
  141161. }
  141162. ret := &TestPermissionsResponse{
  141163. ServerResponse: googleapi.ServerResponse{
  141164. Header: res.Header,
  141165. HTTPStatusCode: res.StatusCode,
  141166. },
  141167. }
  141168. target := &ret
  141169. if err := gensupport.DecodeResponse(target, res); err != nil {
  141170. return nil, err
  141171. }
  141172. return ret, nil
  141173. // {
  141174. // "description": "Returns permissions that a caller has on the specified resource.",
  141175. // "httpMethod": "POST",
  141176. // "id": "compute.targetTcpProxies.testIamPermissions",
  141177. // "parameterOrder": [
  141178. // "project",
  141179. // "resource"
  141180. // ],
  141181. // "parameters": {
  141182. // "project": {
  141183. // "description": "Project ID for this request.",
  141184. // "location": "path",
  141185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141186. // "required": true,
  141187. // "type": "string"
  141188. // },
  141189. // "resource": {
  141190. // "description": "Name or id of the resource for this request.",
  141191. // "location": "path",
  141192. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  141193. // "required": true,
  141194. // "type": "string"
  141195. // }
  141196. // },
  141197. // "path": "{project}/global/targetTcpProxies/{resource}/testIamPermissions",
  141198. // "request": {
  141199. // "$ref": "TestPermissionsRequest"
  141200. // },
  141201. // "response": {
  141202. // "$ref": "TestPermissionsResponse"
  141203. // },
  141204. // "scopes": [
  141205. // "https://www.googleapis.com/auth/cloud-platform",
  141206. // "https://www.googleapis.com/auth/compute",
  141207. // "https://www.googleapis.com/auth/compute.readonly"
  141208. // ]
  141209. // }
  141210. }
  141211. // method id "compute.targetVpnGateways.aggregatedList":
  141212. type TargetVpnGatewaysAggregatedListCall struct {
  141213. s *Service
  141214. project string
  141215. urlParams_ gensupport.URLParams
  141216. ifNoneMatch_ string
  141217. ctx_ context.Context
  141218. header_ http.Header
  141219. }
  141220. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  141221. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  141222. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141223. c.project = project
  141224. return c
  141225. }
  141226. // Filter sets the optional parameter "filter": A filter expression that
  141227. // filters resources listed in the response. The expression must specify
  141228. // the field name, a comparison operator, and the value that you want to
  141229. // use for filtering. The value must be a string, a number, or a
  141230. // boolean. The comparison operator must be either =, !=, >, or <.
  141231. //
  141232. // For example, if you are filtering Compute Engine instances, you can
  141233. // exclude instances named example-instance by specifying name !=
  141234. // example-instance.
  141235. //
  141236. // You can also filter nested fields. For example, you could specify
  141237. // scheduling.automaticRestart = false to include instances only if they
  141238. // are not scheduled for automatic restarts. You can use filtering on
  141239. // nested fields to filter based on resource labels.
  141240. //
  141241. // To filter on multiple expressions, provide each separate expression
  141242. // within parentheses. For example, (scheduling.automaticRestart = true)
  141243. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  141244. // AND expression. However, you can include AND and OR expressions
  141245. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  141246. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  141247. // true).
  141248. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  141249. c.urlParams_.Set("filter", filter)
  141250. return c
  141251. }
  141252. // MaxResults sets the optional parameter "maxResults": The maximum
  141253. // number of results per page that should be returned. If the number of
  141254. // available results is larger than maxResults, Compute Engine returns a
  141255. // nextPageToken that can be used to get the next page of results in
  141256. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  141257. // (Default: 500)
  141258. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  141259. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  141260. return c
  141261. }
  141262. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  141263. // a certain order. By default, results are returned in alphanumerical
  141264. // order based on the resource name.
  141265. //
  141266. // You can also sort results in descending order based on the creation
  141267. // timestamp using orderBy="creationTimestamp desc". This sorts results
  141268. // based on the creationTimestamp field in reverse chronological order
  141269. // (newest result first). Use this to sort resources like operations so
  141270. // that the newest operation is returned first.
  141271. //
  141272. // Currently, only sorting by name or creationTimestamp desc is
  141273. // supported.
  141274. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  141275. c.urlParams_.Set("orderBy", orderBy)
  141276. return c
  141277. }
  141278. // PageToken sets the optional parameter "pageToken": Specifies a page
  141279. // token to use. Set pageToken to the nextPageToken returned by a
  141280. // previous list request to get the next page of results.
  141281. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  141282. c.urlParams_.Set("pageToken", pageToken)
  141283. return c
  141284. }
  141285. // Fields allows partial responses to be retrieved. See
  141286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  141287. // for more information.
  141288. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  141289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  141290. return c
  141291. }
  141292. // IfNoneMatch sets the optional parameter which makes the operation
  141293. // fail if the object's ETag matches the given value. This is useful for
  141294. // getting updates only after the object has changed since the last
  141295. // request. Use googleapi.IsNotModified to check whether the response
  141296. // error from Do is the result of In-None-Match.
  141297. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  141298. c.ifNoneMatch_ = entityTag
  141299. return c
  141300. }
  141301. // Context sets the context to be used in this call's Do method. Any
  141302. // pending HTTP request will be aborted if the provided context is
  141303. // canceled.
  141304. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  141305. c.ctx_ = ctx
  141306. return c
  141307. }
  141308. // Header returns an http.Header that can be modified by the caller to
  141309. // add HTTP headers to the request.
  141310. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  141311. if c.header_ == nil {
  141312. c.header_ = make(http.Header)
  141313. }
  141314. return c.header_
  141315. }
  141316. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  141317. reqHeaders := make(http.Header)
  141318. for k, v := range c.header_ {
  141319. reqHeaders[k] = v
  141320. }
  141321. reqHeaders.Set("User-Agent", c.s.userAgent())
  141322. if c.ifNoneMatch_ != "" {
  141323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  141324. }
  141325. var body io.Reader = nil
  141326. c.urlParams_.Set("alt", alt)
  141327. c.urlParams_.Set("prettyPrint", "false")
  141328. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  141329. urls += "?" + c.urlParams_.Encode()
  141330. req, err := http.NewRequest("GET", urls, body)
  141331. if err != nil {
  141332. return nil, err
  141333. }
  141334. req.Header = reqHeaders
  141335. googleapi.Expand(req.URL, map[string]string{
  141336. "project": c.project,
  141337. })
  141338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141339. }
  141340. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  141341. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  141342. // non-nil. Any non-2xx status code is an error. Response headers are in
  141343. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  141344. // response was returned at all) in error.(*googleapi.Error).Header. Use
  141345. // googleapi.IsNotModified to check whether the returned error was
  141346. // because http.StatusNotModified was returned.
  141347. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  141348. gensupport.SetOptions(c.urlParams_, opts...)
  141349. res, err := c.doRequest("json")
  141350. if res != nil && res.StatusCode == http.StatusNotModified {
  141351. if res.Body != nil {
  141352. res.Body.Close()
  141353. }
  141354. return nil, &googleapi.Error{
  141355. Code: res.StatusCode,
  141356. Header: res.Header,
  141357. }
  141358. }
  141359. if err != nil {
  141360. return nil, err
  141361. }
  141362. defer googleapi.CloseBody(res)
  141363. if err := googleapi.CheckResponse(res); err != nil {
  141364. return nil, err
  141365. }
  141366. ret := &TargetVpnGatewayAggregatedList{
  141367. ServerResponse: googleapi.ServerResponse{
  141368. Header: res.Header,
  141369. HTTPStatusCode: res.StatusCode,
  141370. },
  141371. }
  141372. target := &ret
  141373. if err := gensupport.DecodeResponse(target, res); err != nil {
  141374. return nil, err
  141375. }
  141376. return ret, nil
  141377. // {
  141378. // "description": "Retrieves an aggregated list of target VPN gateways.",
  141379. // "httpMethod": "GET",
  141380. // "id": "compute.targetVpnGateways.aggregatedList",
  141381. // "parameterOrder": [
  141382. // "project"
  141383. // ],
  141384. // "parameters": {
  141385. // "filter": {
  141386. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  141387. // "location": "query",
  141388. // "type": "string"
  141389. // },
  141390. // "maxResults": {
  141391. // "default": "500",
  141392. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  141393. // "format": "uint32",
  141394. // "location": "query",
  141395. // "minimum": "0",
  141396. // "type": "integer"
  141397. // },
  141398. // "orderBy": {
  141399. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  141400. // "location": "query",
  141401. // "type": "string"
  141402. // },
  141403. // "pageToken": {
  141404. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  141405. // "location": "query",
  141406. // "type": "string"
  141407. // },
  141408. // "project": {
  141409. // "description": "Project ID for this request.",
  141410. // "location": "path",
  141411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141412. // "required": true,
  141413. // "type": "string"
  141414. // }
  141415. // },
  141416. // "path": "{project}/aggregated/targetVpnGateways",
  141417. // "response": {
  141418. // "$ref": "TargetVpnGatewayAggregatedList"
  141419. // },
  141420. // "scopes": [
  141421. // "https://www.googleapis.com/auth/cloud-platform",
  141422. // "https://www.googleapis.com/auth/compute",
  141423. // "https://www.googleapis.com/auth/compute.readonly"
  141424. // ]
  141425. // }
  141426. }
  141427. // Pages invokes f for each page of results.
  141428. // A non-nil error returned from f will halt the iteration.
  141429. // The provided context supersedes any context provided to the Context method.
  141430. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  141431. c.ctx_ = ctx
  141432. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  141433. for {
  141434. x, err := c.Do()
  141435. if err != nil {
  141436. return err
  141437. }
  141438. if err := f(x); err != nil {
  141439. return err
  141440. }
  141441. if x.NextPageToken == "" {
  141442. return nil
  141443. }
  141444. c.PageToken(x.NextPageToken)
  141445. }
  141446. }
  141447. // method id "compute.targetVpnGateways.delete":
  141448. type TargetVpnGatewaysDeleteCall struct {
  141449. s *Service
  141450. project string
  141451. region string
  141452. targetVpnGateway string
  141453. urlParams_ gensupport.URLParams
  141454. ctx_ context.Context
  141455. header_ http.Header
  141456. }
  141457. // Delete: Deletes the specified target VPN gateway.
  141458. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  141459. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141460. c.project = project
  141461. c.region = region
  141462. c.targetVpnGateway = targetVpnGateway
  141463. return c
  141464. }
  141465. // RequestId sets the optional parameter "requestId": An optional
  141466. // request ID to identify requests. Specify a unique request ID so that
  141467. // if you must retry your request, the server will know to ignore the
  141468. // request if it has already been completed.
  141469. //
  141470. // For example, consider a situation where you make an initial request
  141471. // and the request times out. If you make the request again with the
  141472. // same request ID, the server can check if original operation with the
  141473. // same request ID was received, and if so, will ignore the second
  141474. // request. This prevents clients from accidentally creating duplicate
  141475. // commitments.
  141476. //
  141477. // The request ID must be a valid UUID with the exception that zero UUID
  141478. // is not supported (00000000-0000-0000-0000-000000000000).
  141479. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  141480. c.urlParams_.Set("requestId", requestId)
  141481. return c
  141482. }
  141483. // Fields allows partial responses to be retrieved. See
  141484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  141485. // for more information.
  141486. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  141487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  141488. return c
  141489. }
  141490. // Context sets the context to be used in this call's Do method. Any
  141491. // pending HTTP request will be aborted if the provided context is
  141492. // canceled.
  141493. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  141494. c.ctx_ = ctx
  141495. return c
  141496. }
  141497. // Header returns an http.Header that can be modified by the caller to
  141498. // add HTTP headers to the request.
  141499. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  141500. if c.header_ == nil {
  141501. c.header_ = make(http.Header)
  141502. }
  141503. return c.header_
  141504. }
  141505. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  141506. reqHeaders := make(http.Header)
  141507. for k, v := range c.header_ {
  141508. reqHeaders[k] = v
  141509. }
  141510. reqHeaders.Set("User-Agent", c.s.userAgent())
  141511. var body io.Reader = nil
  141512. c.urlParams_.Set("alt", alt)
  141513. c.urlParams_.Set("prettyPrint", "false")
  141514. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  141515. urls += "?" + c.urlParams_.Encode()
  141516. req, err := http.NewRequest("DELETE", urls, body)
  141517. if err != nil {
  141518. return nil, err
  141519. }
  141520. req.Header = reqHeaders
  141521. googleapi.Expand(req.URL, map[string]string{
  141522. "project": c.project,
  141523. "region": c.region,
  141524. "targetVpnGateway": c.targetVpnGateway,
  141525. })
  141526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141527. }
  141528. // Do executes the "compute.targetVpnGateways.delete" call.
  141529. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  141530. // status code is an error. Response headers are in either
  141531. // *Operation.ServerResponse.Header or (if a response was returned at
  141532. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  141533. // to check whether the returned error was because
  141534. // http.StatusNotModified was returned.
  141535. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  141536. gensupport.SetOptions(c.urlParams_, opts...)
  141537. res, err := c.doRequest("json")
  141538. if res != nil && res.StatusCode == http.StatusNotModified {
  141539. if res.Body != nil {
  141540. res.Body.Close()
  141541. }
  141542. return nil, &googleapi.Error{
  141543. Code: res.StatusCode,
  141544. Header: res.Header,
  141545. }
  141546. }
  141547. if err != nil {
  141548. return nil, err
  141549. }
  141550. defer googleapi.CloseBody(res)
  141551. if err := googleapi.CheckResponse(res); err != nil {
  141552. return nil, err
  141553. }
  141554. ret := &Operation{
  141555. ServerResponse: googleapi.ServerResponse{
  141556. Header: res.Header,
  141557. HTTPStatusCode: res.StatusCode,
  141558. },
  141559. }
  141560. target := &ret
  141561. if err := gensupport.DecodeResponse(target, res); err != nil {
  141562. return nil, err
  141563. }
  141564. return ret, nil
  141565. // {
  141566. // "description": "Deletes the specified target VPN gateway.",
  141567. // "httpMethod": "DELETE",
  141568. // "id": "compute.targetVpnGateways.delete",
  141569. // "parameterOrder": [
  141570. // "project",
  141571. // "region",
  141572. // "targetVpnGateway"
  141573. // ],
  141574. // "parameters": {
  141575. // "project": {
  141576. // "description": "Project ID for this request.",
  141577. // "location": "path",
  141578. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141579. // "required": true,
  141580. // "type": "string"
  141581. // },
  141582. // "region": {
  141583. // "description": "Name of the region for this request.",
  141584. // "location": "path",
  141585. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  141586. // "required": true,
  141587. // "type": "string"
  141588. // },
  141589. // "requestId": {
  141590. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  141591. // "location": "query",
  141592. // "type": "string"
  141593. // },
  141594. // "targetVpnGateway": {
  141595. // "description": "Name of the target VPN gateway to delete.",
  141596. // "location": "path",
  141597. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  141598. // "required": true,
  141599. // "type": "string"
  141600. // }
  141601. // },
  141602. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  141603. // "response": {
  141604. // "$ref": "Operation"
  141605. // },
  141606. // "scopes": [
  141607. // "https://www.googleapis.com/auth/cloud-platform",
  141608. // "https://www.googleapis.com/auth/compute"
  141609. // ]
  141610. // }
  141611. }
  141612. // method id "compute.targetVpnGateways.get":
  141613. type TargetVpnGatewaysGetCall struct {
  141614. s *Service
  141615. project string
  141616. region string
  141617. targetVpnGateway string
  141618. urlParams_ gensupport.URLParams
  141619. ifNoneMatch_ string
  141620. ctx_ context.Context
  141621. header_ http.Header
  141622. }
  141623. // Get: Returns the specified target VPN gateway. Gets a list of
  141624. // available target VPN gateways by making a list() request.
  141625. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  141626. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141627. c.project = project
  141628. c.region = region
  141629. c.targetVpnGateway = targetVpnGateway
  141630. return c
  141631. }
  141632. // Fields allows partial responses to be retrieved. See
  141633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  141634. // for more information.
  141635. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  141636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  141637. return c
  141638. }
  141639. // IfNoneMatch sets the optional parameter which makes the operation
  141640. // fail if the object's ETag matches the given value. This is useful for
  141641. // getting updates only after the object has changed since the last
  141642. // request. Use googleapi.IsNotModified to check whether the response
  141643. // error from Do is the result of In-None-Match.
  141644. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  141645. c.ifNoneMatch_ = entityTag
  141646. return c
  141647. }
  141648. // Context sets the context to be used in this call's Do method. Any
  141649. // pending HTTP request will be aborted if the provided context is
  141650. // canceled.
  141651. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  141652. c.ctx_ = ctx
  141653. return c
  141654. }
  141655. // Header returns an http.Header that can be modified by the caller to
  141656. // add HTTP headers to the request.
  141657. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  141658. if c.header_ == nil {
  141659. c.header_ = make(http.Header)
  141660. }
  141661. return c.header_
  141662. }
  141663. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  141664. reqHeaders := make(http.Header)
  141665. for k, v := range c.header_ {
  141666. reqHeaders[k] = v
  141667. }
  141668. reqHeaders.Set("User-Agent", c.s.userAgent())
  141669. if c.ifNoneMatch_ != "" {
  141670. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  141671. }
  141672. var body io.Reader = nil
  141673. c.urlParams_.Set("alt", alt)
  141674. c.urlParams_.Set("prettyPrint", "false")
  141675. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  141676. urls += "?" + c.urlParams_.Encode()
  141677. req, err := http.NewRequest("GET", urls, body)
  141678. if err != nil {
  141679. return nil, err
  141680. }
  141681. req.Header = reqHeaders
  141682. googleapi.Expand(req.URL, map[string]string{
  141683. "project": c.project,
  141684. "region": c.region,
  141685. "targetVpnGateway": c.targetVpnGateway,
  141686. })
  141687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141688. }
  141689. // Do executes the "compute.targetVpnGateways.get" call.
  141690. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  141691. // non-2xx status code is an error. Response headers are in either
  141692. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  141693. // returned at all) in error.(*googleapi.Error).Header. Use
  141694. // googleapi.IsNotModified to check whether the returned error was
  141695. // because http.StatusNotModified was returned.
  141696. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  141697. gensupport.SetOptions(c.urlParams_, opts...)
  141698. res, err := c.doRequest("json")
  141699. if res != nil && res.StatusCode == http.StatusNotModified {
  141700. if res.Body != nil {
  141701. res.Body.Close()
  141702. }
  141703. return nil, &googleapi.Error{
  141704. Code: res.StatusCode,
  141705. Header: res.Header,
  141706. }
  141707. }
  141708. if err != nil {
  141709. return nil, err
  141710. }
  141711. defer googleapi.CloseBody(res)
  141712. if err := googleapi.CheckResponse(res); err != nil {
  141713. return nil, err
  141714. }
  141715. ret := &TargetVpnGateway{
  141716. ServerResponse: googleapi.ServerResponse{
  141717. Header: res.Header,
  141718. HTTPStatusCode: res.StatusCode,
  141719. },
  141720. }
  141721. target := &ret
  141722. if err := gensupport.DecodeResponse(target, res); err != nil {
  141723. return nil, err
  141724. }
  141725. return ret, nil
  141726. // {
  141727. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  141728. // "httpMethod": "GET",
  141729. // "id": "compute.targetVpnGateways.get",
  141730. // "parameterOrder": [
  141731. // "project",
  141732. // "region",
  141733. // "targetVpnGateway"
  141734. // ],
  141735. // "parameters": {
  141736. // "project": {
  141737. // "description": "Project ID for this request.",
  141738. // "location": "path",
  141739. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141740. // "required": true,
  141741. // "type": "string"
  141742. // },
  141743. // "region": {
  141744. // "description": "Name of the region for this request.",
  141745. // "location": "path",
  141746. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  141747. // "required": true,
  141748. // "type": "string"
  141749. // },
  141750. // "targetVpnGateway": {
  141751. // "description": "Name of the target VPN gateway to return.",
  141752. // "location": "path",
  141753. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  141754. // "required": true,
  141755. // "type": "string"
  141756. // }
  141757. // },
  141758. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  141759. // "response": {
  141760. // "$ref": "TargetVpnGateway"
  141761. // },
  141762. // "scopes": [
  141763. // "https://www.googleapis.com/auth/cloud-platform",
  141764. // "https://www.googleapis.com/auth/compute",
  141765. // "https://www.googleapis.com/auth/compute.readonly"
  141766. // ]
  141767. // }
  141768. }
  141769. // method id "compute.targetVpnGateways.insert":
  141770. type TargetVpnGatewaysInsertCall struct {
  141771. s *Service
  141772. project string
  141773. region string
  141774. targetvpngateway *TargetVpnGateway
  141775. urlParams_ gensupport.URLParams
  141776. ctx_ context.Context
  141777. header_ http.Header
  141778. }
  141779. // Insert: Creates a target VPN gateway in the specified project and
  141780. // region using the data included in the request.
  141781. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  141782. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141783. c.project = project
  141784. c.region = region
  141785. c.targetvpngateway = targetvpngateway
  141786. return c
  141787. }
  141788. // RequestId sets the optional parameter "requestId": An optional
  141789. // request ID to identify requests. Specify a unique request ID so that
  141790. // if you must retry your request, the server will know to ignore the
  141791. // request if it has already been completed.
  141792. //
  141793. // For example, consider a situation where you make an initial request
  141794. // and the request times out. If you make the request again with the
  141795. // same request ID, the server can check if original operation with the
  141796. // same request ID was received, and if so, will ignore the second
  141797. // request. This prevents clients from accidentally creating duplicate
  141798. // commitments.
  141799. //
  141800. // The request ID must be a valid UUID with the exception that zero UUID
  141801. // is not supported (00000000-0000-0000-0000-000000000000).
  141802. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  141803. c.urlParams_.Set("requestId", requestId)
  141804. return c
  141805. }
  141806. // Fields allows partial responses to be retrieved. See
  141807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  141808. // for more information.
  141809. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  141810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  141811. return c
  141812. }
  141813. // Context sets the context to be used in this call's Do method. Any
  141814. // pending HTTP request will be aborted if the provided context is
  141815. // canceled.
  141816. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  141817. c.ctx_ = ctx
  141818. return c
  141819. }
  141820. // Header returns an http.Header that can be modified by the caller to
  141821. // add HTTP headers to the request.
  141822. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  141823. if c.header_ == nil {
  141824. c.header_ = make(http.Header)
  141825. }
  141826. return c.header_
  141827. }
  141828. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  141829. reqHeaders := make(http.Header)
  141830. for k, v := range c.header_ {
  141831. reqHeaders[k] = v
  141832. }
  141833. reqHeaders.Set("User-Agent", c.s.userAgent())
  141834. var body io.Reader = nil
  141835. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  141836. if err != nil {
  141837. return nil, err
  141838. }
  141839. reqHeaders.Set("Content-Type", "application/json")
  141840. c.urlParams_.Set("alt", alt)
  141841. c.urlParams_.Set("prettyPrint", "false")
  141842. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  141843. urls += "?" + c.urlParams_.Encode()
  141844. req, err := http.NewRequest("POST", urls, body)
  141845. if err != nil {
  141846. return nil, err
  141847. }
  141848. req.Header = reqHeaders
  141849. googleapi.Expand(req.URL, map[string]string{
  141850. "project": c.project,
  141851. "region": c.region,
  141852. })
  141853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141854. }
  141855. // Do executes the "compute.targetVpnGateways.insert" call.
  141856. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  141857. // status code is an error. Response headers are in either
  141858. // *Operation.ServerResponse.Header or (if a response was returned at
  141859. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  141860. // to check whether the returned error was because
  141861. // http.StatusNotModified was returned.
  141862. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  141863. gensupport.SetOptions(c.urlParams_, opts...)
  141864. res, err := c.doRequest("json")
  141865. if res != nil && res.StatusCode == http.StatusNotModified {
  141866. if res.Body != nil {
  141867. res.Body.Close()
  141868. }
  141869. return nil, &googleapi.Error{
  141870. Code: res.StatusCode,
  141871. Header: res.Header,
  141872. }
  141873. }
  141874. if err != nil {
  141875. return nil, err
  141876. }
  141877. defer googleapi.CloseBody(res)
  141878. if err := googleapi.CheckResponse(res); err != nil {
  141879. return nil, err
  141880. }
  141881. ret := &Operation{
  141882. ServerResponse: googleapi.ServerResponse{
  141883. Header: res.Header,
  141884. HTTPStatusCode: res.StatusCode,
  141885. },
  141886. }
  141887. target := &ret
  141888. if err := gensupport.DecodeResponse(target, res); err != nil {
  141889. return nil, err
  141890. }
  141891. return ret, nil
  141892. // {
  141893. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  141894. // "httpMethod": "POST",
  141895. // "id": "compute.targetVpnGateways.insert",
  141896. // "parameterOrder": [
  141897. // "project",
  141898. // "region"
  141899. // ],
  141900. // "parameters": {
  141901. // "project": {
  141902. // "description": "Project ID for this request.",
  141903. // "location": "path",
  141904. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141905. // "required": true,
  141906. // "type": "string"
  141907. // },
  141908. // "region": {
  141909. // "description": "Name of the region for this request.",
  141910. // "location": "path",
  141911. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  141912. // "required": true,
  141913. // "type": "string"
  141914. // },
  141915. // "requestId": {
  141916. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  141917. // "location": "query",
  141918. // "type": "string"
  141919. // }
  141920. // },
  141921. // "path": "{project}/regions/{region}/targetVpnGateways",
  141922. // "request": {
  141923. // "$ref": "TargetVpnGateway"
  141924. // },
  141925. // "response": {
  141926. // "$ref": "Operation"
  141927. // },
  141928. // "scopes": [
  141929. // "https://www.googleapis.com/auth/cloud-platform",
  141930. // "https://www.googleapis.com/auth/compute"
  141931. // ]
  141932. // }
  141933. }
  141934. // method id "compute.targetVpnGateways.list":
  141935. type TargetVpnGatewaysListCall struct {
  141936. s *Service
  141937. project string
  141938. region string
  141939. urlParams_ gensupport.URLParams
  141940. ifNoneMatch_ string
  141941. ctx_ context.Context
  141942. header_ http.Header
  141943. }
  141944. // List: Retrieves a list of target VPN gateways available to the
  141945. // specified project and region.
  141946. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  141947. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141948. c.project = project
  141949. c.region = region
  141950. return c
  141951. }
  141952. // Filter sets the optional parameter "filter": A filter expression that
  141953. // filters resources listed in the response. The expression must specify
  141954. // the field name, a comparison operator, and the value that you want to
  141955. // use for filtering. The value must be a string, a number, or a
  141956. // boolean. The comparison operator must be either =, !=, >, or <.
  141957. //
  141958. // For example, if you are filtering Compute Engine instances, you can
  141959. // exclude instances named example-instance by specifying name !=
  141960. // example-instance.
  141961. //
  141962. // You can also filter nested fields. For example, you could specify
  141963. // scheduling.automaticRestart = false to include instances only if they
  141964. // are not scheduled for automatic restarts. You can use filtering on
  141965. // nested fields to filter based on resource labels.
  141966. //
  141967. // To filter on multiple expressions, provide each separate expression
  141968. // within parentheses. For example, (scheduling.automaticRestart = true)
  141969. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  141970. // AND expression. However, you can include AND and OR expressions
  141971. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  141972. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  141973. // true).
  141974. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  141975. c.urlParams_.Set("filter", filter)
  141976. return c
  141977. }
  141978. // MaxResults sets the optional parameter "maxResults": The maximum
  141979. // number of results per page that should be returned. If the number of
  141980. // available results is larger than maxResults, Compute Engine returns a
  141981. // nextPageToken that can be used to get the next page of results in
  141982. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  141983. // (Default: 500)
  141984. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  141985. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  141986. return c
  141987. }
  141988. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  141989. // a certain order. By default, results are returned in alphanumerical
  141990. // order based on the resource name.
  141991. //
  141992. // You can also sort results in descending order based on the creation
  141993. // timestamp using orderBy="creationTimestamp desc". This sorts results
  141994. // based on the creationTimestamp field in reverse chronological order
  141995. // (newest result first). Use this to sort resources like operations so
  141996. // that the newest operation is returned first.
  141997. //
  141998. // Currently, only sorting by name or creationTimestamp desc is
  141999. // supported.
  142000. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  142001. c.urlParams_.Set("orderBy", orderBy)
  142002. return c
  142003. }
  142004. // PageToken sets the optional parameter "pageToken": Specifies a page
  142005. // token to use. Set pageToken to the nextPageToken returned by a
  142006. // previous list request to get the next page of results.
  142007. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  142008. c.urlParams_.Set("pageToken", pageToken)
  142009. return c
  142010. }
  142011. // Fields allows partial responses to be retrieved. See
  142012. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142013. // for more information.
  142014. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  142015. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142016. return c
  142017. }
  142018. // IfNoneMatch sets the optional parameter which makes the operation
  142019. // fail if the object's ETag matches the given value. This is useful for
  142020. // getting updates only after the object has changed since the last
  142021. // request. Use googleapi.IsNotModified to check whether the response
  142022. // error from Do is the result of In-None-Match.
  142023. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  142024. c.ifNoneMatch_ = entityTag
  142025. return c
  142026. }
  142027. // Context sets the context to be used in this call's Do method. Any
  142028. // pending HTTP request will be aborted if the provided context is
  142029. // canceled.
  142030. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  142031. c.ctx_ = ctx
  142032. return c
  142033. }
  142034. // Header returns an http.Header that can be modified by the caller to
  142035. // add HTTP headers to the request.
  142036. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  142037. if c.header_ == nil {
  142038. c.header_ = make(http.Header)
  142039. }
  142040. return c.header_
  142041. }
  142042. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  142043. reqHeaders := make(http.Header)
  142044. for k, v := range c.header_ {
  142045. reqHeaders[k] = v
  142046. }
  142047. reqHeaders.Set("User-Agent", c.s.userAgent())
  142048. if c.ifNoneMatch_ != "" {
  142049. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  142050. }
  142051. var body io.Reader = nil
  142052. c.urlParams_.Set("alt", alt)
  142053. c.urlParams_.Set("prettyPrint", "false")
  142054. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  142055. urls += "?" + c.urlParams_.Encode()
  142056. req, err := http.NewRequest("GET", urls, body)
  142057. if err != nil {
  142058. return nil, err
  142059. }
  142060. req.Header = reqHeaders
  142061. googleapi.Expand(req.URL, map[string]string{
  142062. "project": c.project,
  142063. "region": c.region,
  142064. })
  142065. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142066. }
  142067. // Do executes the "compute.targetVpnGateways.list" call.
  142068. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  142069. // non-2xx status code is an error. Response headers are in either
  142070. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  142071. // returned at all) in error.(*googleapi.Error).Header. Use
  142072. // googleapi.IsNotModified to check whether the returned error was
  142073. // because http.StatusNotModified was returned.
  142074. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  142075. gensupport.SetOptions(c.urlParams_, opts...)
  142076. res, err := c.doRequest("json")
  142077. if res != nil && res.StatusCode == http.StatusNotModified {
  142078. if res.Body != nil {
  142079. res.Body.Close()
  142080. }
  142081. return nil, &googleapi.Error{
  142082. Code: res.StatusCode,
  142083. Header: res.Header,
  142084. }
  142085. }
  142086. if err != nil {
  142087. return nil, err
  142088. }
  142089. defer googleapi.CloseBody(res)
  142090. if err := googleapi.CheckResponse(res); err != nil {
  142091. return nil, err
  142092. }
  142093. ret := &TargetVpnGatewayList{
  142094. ServerResponse: googleapi.ServerResponse{
  142095. Header: res.Header,
  142096. HTTPStatusCode: res.StatusCode,
  142097. },
  142098. }
  142099. target := &ret
  142100. if err := gensupport.DecodeResponse(target, res); err != nil {
  142101. return nil, err
  142102. }
  142103. return ret, nil
  142104. // {
  142105. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  142106. // "httpMethod": "GET",
  142107. // "id": "compute.targetVpnGateways.list",
  142108. // "parameterOrder": [
  142109. // "project",
  142110. // "region"
  142111. // ],
  142112. // "parameters": {
  142113. // "filter": {
  142114. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  142115. // "location": "query",
  142116. // "type": "string"
  142117. // },
  142118. // "maxResults": {
  142119. // "default": "500",
  142120. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  142121. // "format": "uint32",
  142122. // "location": "query",
  142123. // "minimum": "0",
  142124. // "type": "integer"
  142125. // },
  142126. // "orderBy": {
  142127. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  142128. // "location": "query",
  142129. // "type": "string"
  142130. // },
  142131. // "pageToken": {
  142132. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  142133. // "location": "query",
  142134. // "type": "string"
  142135. // },
  142136. // "project": {
  142137. // "description": "Project ID for this request.",
  142138. // "location": "path",
  142139. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  142140. // "required": true,
  142141. // "type": "string"
  142142. // },
  142143. // "region": {
  142144. // "description": "Name of the region for this request.",
  142145. // "location": "path",
  142146. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  142147. // "required": true,
  142148. // "type": "string"
  142149. // }
  142150. // },
  142151. // "path": "{project}/regions/{region}/targetVpnGateways",
  142152. // "response": {
  142153. // "$ref": "TargetVpnGatewayList"
  142154. // },
  142155. // "scopes": [
  142156. // "https://www.googleapis.com/auth/cloud-platform",
  142157. // "https://www.googleapis.com/auth/compute",
  142158. // "https://www.googleapis.com/auth/compute.readonly"
  142159. // ]
  142160. // }
  142161. }
  142162. // Pages invokes f for each page of results.
  142163. // A non-nil error returned from f will halt the iteration.
  142164. // The provided context supersedes any context provided to the Context method.
  142165. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  142166. c.ctx_ = ctx
  142167. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  142168. for {
  142169. x, err := c.Do()
  142170. if err != nil {
  142171. return err
  142172. }
  142173. if err := f(x); err != nil {
  142174. return err
  142175. }
  142176. if x.NextPageToken == "" {
  142177. return nil
  142178. }
  142179. c.PageToken(x.NextPageToken)
  142180. }
  142181. }
  142182. // method id "compute.targetVpnGateways.setLabels":
  142183. type TargetVpnGatewaysSetLabelsCall struct {
  142184. s *Service
  142185. project string
  142186. region string
  142187. resource string
  142188. regionsetlabelsrequest *RegionSetLabelsRequest
  142189. urlParams_ gensupport.URLParams
  142190. ctx_ context.Context
  142191. header_ http.Header
  142192. }
  142193. // SetLabels: Sets the labels on a TargetVpnGateway. To learn more about
  142194. // labels, read the Labeling Resources documentation.
  142195. func (r *TargetVpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *TargetVpnGatewaysSetLabelsCall {
  142196. c := &TargetVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  142197. c.project = project
  142198. c.region = region
  142199. c.resource = resource
  142200. c.regionsetlabelsrequest = regionsetlabelsrequest
  142201. return c
  142202. }
  142203. // RequestId sets the optional parameter "requestId": An optional
  142204. // request ID to identify requests. Specify a unique request ID so that
  142205. // if you must retry your request, the server will know to ignore the
  142206. // request if it has already been completed.
  142207. //
  142208. // For example, consider a situation where you make an initial request
  142209. // and the request times out. If you make the request again with the
  142210. // same request ID, the server can check if original operation with the
  142211. // same request ID was received, and if so, will ignore the second
  142212. // request. This prevents clients from accidentally creating duplicate
  142213. // commitments.
  142214. //
  142215. // The request ID must be a valid UUID with the exception that zero UUID
  142216. // is not supported (00000000-0000-0000-0000-000000000000).
  142217. func (c *TargetVpnGatewaysSetLabelsCall) RequestId(requestId string) *TargetVpnGatewaysSetLabelsCall {
  142218. c.urlParams_.Set("requestId", requestId)
  142219. return c
  142220. }
  142221. // Fields allows partial responses to be retrieved. See
  142222. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142223. // for more information.
  142224. func (c *TargetVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysSetLabelsCall {
  142225. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142226. return c
  142227. }
  142228. // Context sets the context to be used in this call's Do method. Any
  142229. // pending HTTP request will be aborted if the provided context is
  142230. // canceled.
  142231. func (c *TargetVpnGatewaysSetLabelsCall) Context(ctx context.Context) *TargetVpnGatewaysSetLabelsCall {
  142232. c.ctx_ = ctx
  142233. return c
  142234. }
  142235. // Header returns an http.Header that can be modified by the caller to
  142236. // add HTTP headers to the request.
  142237. func (c *TargetVpnGatewaysSetLabelsCall) Header() http.Header {
  142238. if c.header_ == nil {
  142239. c.header_ = make(http.Header)
  142240. }
  142241. return c.header_
  142242. }
  142243. func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  142244. reqHeaders := make(http.Header)
  142245. for k, v := range c.header_ {
  142246. reqHeaders[k] = v
  142247. }
  142248. reqHeaders.Set("User-Agent", c.s.userAgent())
  142249. var body io.Reader = nil
  142250. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  142251. if err != nil {
  142252. return nil, err
  142253. }
  142254. reqHeaders.Set("Content-Type", "application/json")
  142255. c.urlParams_.Set("alt", alt)
  142256. c.urlParams_.Set("prettyPrint", "false")
  142257. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels")
  142258. urls += "?" + c.urlParams_.Encode()
  142259. req, err := http.NewRequest("POST", urls, body)
  142260. if err != nil {
  142261. return nil, err
  142262. }
  142263. req.Header = reqHeaders
  142264. googleapi.Expand(req.URL, map[string]string{
  142265. "project": c.project,
  142266. "region": c.region,
  142267. "resource": c.resource,
  142268. })
  142269. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142270. }
  142271. // Do executes the "compute.targetVpnGateways.setLabels" call.
  142272. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  142273. // status code is an error. Response headers are in either
  142274. // *Operation.ServerResponse.Header or (if a response was returned at
  142275. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  142276. // to check whether the returned error was because
  142277. // http.StatusNotModified was returned.
  142278. func (c *TargetVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  142279. gensupport.SetOptions(c.urlParams_, opts...)
  142280. res, err := c.doRequest("json")
  142281. if res != nil && res.StatusCode == http.StatusNotModified {
  142282. if res.Body != nil {
  142283. res.Body.Close()
  142284. }
  142285. return nil, &googleapi.Error{
  142286. Code: res.StatusCode,
  142287. Header: res.Header,
  142288. }
  142289. }
  142290. if err != nil {
  142291. return nil, err
  142292. }
  142293. defer googleapi.CloseBody(res)
  142294. if err := googleapi.CheckResponse(res); err != nil {
  142295. return nil, err
  142296. }
  142297. ret := &Operation{
  142298. ServerResponse: googleapi.ServerResponse{
  142299. Header: res.Header,
  142300. HTTPStatusCode: res.StatusCode,
  142301. },
  142302. }
  142303. target := &ret
  142304. if err := gensupport.DecodeResponse(target, res); err != nil {
  142305. return nil, err
  142306. }
  142307. return ret, nil
  142308. // {
  142309. // "description": "Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  142310. // "httpMethod": "POST",
  142311. // "id": "compute.targetVpnGateways.setLabels",
  142312. // "parameterOrder": [
  142313. // "project",
  142314. // "region",
  142315. // "resource"
  142316. // ],
  142317. // "parameters": {
  142318. // "project": {
  142319. // "description": "Project ID for this request.",
  142320. // "location": "path",
  142321. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  142322. // "required": true,
  142323. // "type": "string"
  142324. // },
  142325. // "region": {
  142326. // "description": "The region for this request.",
  142327. // "location": "path",
  142328. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  142329. // "required": true,
  142330. // "type": "string"
  142331. // },
  142332. // "requestId": {
  142333. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  142334. // "location": "query",
  142335. // "type": "string"
  142336. // },
  142337. // "resource": {
  142338. // "description": "Name or id of the resource for this request.",
  142339. // "location": "path",
  142340. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  142341. // "required": true,
  142342. // "type": "string"
  142343. // }
  142344. // },
  142345. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels",
  142346. // "request": {
  142347. // "$ref": "RegionSetLabelsRequest"
  142348. // },
  142349. // "response": {
  142350. // "$ref": "Operation"
  142351. // },
  142352. // "scopes": [
  142353. // "https://www.googleapis.com/auth/cloud-platform",
  142354. // "https://www.googleapis.com/auth/compute"
  142355. // ]
  142356. // }
  142357. }
  142358. // method id "compute.targetVpnGateways.testIamPermissions":
  142359. type TargetVpnGatewaysTestIamPermissionsCall struct {
  142360. s *Service
  142361. project string
  142362. region string
  142363. resource string
  142364. testpermissionsrequest *TestPermissionsRequest
  142365. urlParams_ gensupport.URLParams
  142366. ctx_ context.Context
  142367. header_ http.Header
  142368. }
  142369. // TestIamPermissions: Returns permissions that a caller has on the
  142370. // specified resource.
  142371. func (r *TargetVpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetVpnGatewaysTestIamPermissionsCall {
  142372. c := &TargetVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  142373. c.project = project
  142374. c.region = region
  142375. c.resource = resource
  142376. c.testpermissionsrequest = testpermissionsrequest
  142377. return c
  142378. }
  142379. // Fields allows partial responses to be retrieved. See
  142380. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142381. // for more information.
  142382. func (c *TargetVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysTestIamPermissionsCall {
  142383. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142384. return c
  142385. }
  142386. // Context sets the context to be used in this call's Do method. Any
  142387. // pending HTTP request will be aborted if the provided context is
  142388. // canceled.
  142389. func (c *TargetVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *TargetVpnGatewaysTestIamPermissionsCall {
  142390. c.ctx_ = ctx
  142391. return c
  142392. }
  142393. // Header returns an http.Header that can be modified by the caller to
  142394. // add HTTP headers to the request.
  142395. func (c *TargetVpnGatewaysTestIamPermissionsCall) Header() http.Header {
  142396. if c.header_ == nil {
  142397. c.header_ = make(http.Header)
  142398. }
  142399. return c.header_
  142400. }
  142401. func (c *TargetVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  142402. reqHeaders := make(http.Header)
  142403. for k, v := range c.header_ {
  142404. reqHeaders[k] = v
  142405. }
  142406. reqHeaders.Set("User-Agent", c.s.userAgent())
  142407. var body io.Reader = nil
  142408. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  142409. if err != nil {
  142410. return nil, err
  142411. }
  142412. reqHeaders.Set("Content-Type", "application/json")
  142413. c.urlParams_.Set("alt", alt)
  142414. c.urlParams_.Set("prettyPrint", "false")
  142415. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions")
  142416. urls += "?" + c.urlParams_.Encode()
  142417. req, err := http.NewRequest("POST", urls, body)
  142418. if err != nil {
  142419. return nil, err
  142420. }
  142421. req.Header = reqHeaders
  142422. googleapi.Expand(req.URL, map[string]string{
  142423. "project": c.project,
  142424. "region": c.region,
  142425. "resource": c.resource,
  142426. })
  142427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142428. }
  142429. // Do executes the "compute.targetVpnGateways.testIamPermissions" call.
  142430. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  142431. // non-2xx status code is an error. Response headers are in either
  142432. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  142433. // returned at all) in error.(*googleapi.Error).Header. Use
  142434. // googleapi.IsNotModified to check whether the returned error was
  142435. // because http.StatusNotModified was returned.
  142436. func (c *TargetVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  142437. gensupport.SetOptions(c.urlParams_, opts...)
  142438. res, err := c.doRequest("json")
  142439. if res != nil && res.StatusCode == http.StatusNotModified {
  142440. if res.Body != nil {
  142441. res.Body.Close()
  142442. }
  142443. return nil, &googleapi.Error{
  142444. Code: res.StatusCode,
  142445. Header: res.Header,
  142446. }
  142447. }
  142448. if err != nil {
  142449. return nil, err
  142450. }
  142451. defer googleapi.CloseBody(res)
  142452. if err := googleapi.CheckResponse(res); err != nil {
  142453. return nil, err
  142454. }
  142455. ret := &TestPermissionsResponse{
  142456. ServerResponse: googleapi.ServerResponse{
  142457. Header: res.Header,
  142458. HTTPStatusCode: res.StatusCode,
  142459. },
  142460. }
  142461. target := &ret
  142462. if err := gensupport.DecodeResponse(target, res); err != nil {
  142463. return nil, err
  142464. }
  142465. return ret, nil
  142466. // {
  142467. // "description": "Returns permissions that a caller has on the specified resource.",
  142468. // "httpMethod": "POST",
  142469. // "id": "compute.targetVpnGateways.testIamPermissions",
  142470. // "parameterOrder": [
  142471. // "project",
  142472. // "region",
  142473. // "resource"
  142474. // ],
  142475. // "parameters": {
  142476. // "project": {
  142477. // "description": "Project ID for this request.",
  142478. // "location": "path",
  142479. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  142480. // "required": true,
  142481. // "type": "string"
  142482. // },
  142483. // "region": {
  142484. // "description": "The name of the region for this request.",
  142485. // "location": "path",
  142486. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  142487. // "required": true,
  142488. // "type": "string"
  142489. // },
  142490. // "resource": {
  142491. // "description": "Name or id of the resource for this request.",
  142492. // "location": "path",
  142493. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  142494. // "required": true,
  142495. // "type": "string"
  142496. // }
  142497. // },
  142498. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions",
  142499. // "request": {
  142500. // "$ref": "TestPermissionsRequest"
  142501. // },
  142502. // "response": {
  142503. // "$ref": "TestPermissionsResponse"
  142504. // },
  142505. // "scopes": [
  142506. // "https://www.googleapis.com/auth/cloud-platform",
  142507. // "https://www.googleapis.com/auth/compute",
  142508. // "https://www.googleapis.com/auth/compute.readonly"
  142509. // ]
  142510. // }
  142511. }
  142512. // method id "compute.urlMaps.aggregatedList":
  142513. type UrlMapsAggregatedListCall struct {
  142514. s *Service
  142515. project string
  142516. urlParams_ gensupport.URLParams
  142517. ifNoneMatch_ string
  142518. ctx_ context.Context
  142519. header_ http.Header
  142520. }
  142521. // AggregatedList: Retrieves the list of all UrlMap resources, regional
  142522. // and global, available to the specified project.
  142523. func (r *UrlMapsService) AggregatedList(project string) *UrlMapsAggregatedListCall {
  142524. c := &UrlMapsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  142525. c.project = project
  142526. return c
  142527. }
  142528. // Filter sets the optional parameter "filter": A filter expression that
  142529. // filters resources listed in the response. The expression must specify
  142530. // the field name, a comparison operator, and the value that you want to
  142531. // use for filtering. The value must be a string, a number, or a
  142532. // boolean. The comparison operator must be either =, !=, >, or <.
  142533. //
  142534. // For example, if you are filtering Compute Engine instances, you can
  142535. // exclude instances named example-instance by specifying name !=
  142536. // example-instance.
  142537. //
  142538. // You can also filter nested fields. For example, you could specify
  142539. // scheduling.automaticRestart = false to include instances only if they
  142540. // are not scheduled for automatic restarts. You can use filtering on
  142541. // nested fields to filter based on resource labels.
  142542. //
  142543. // To filter on multiple expressions, provide each separate expression
  142544. // within parentheses. For example, (scheduling.automaticRestart = true)
  142545. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  142546. // AND expression. However, you can include AND and OR expressions
  142547. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  142548. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  142549. // true).
  142550. func (c *UrlMapsAggregatedListCall) Filter(filter string) *UrlMapsAggregatedListCall {
  142551. c.urlParams_.Set("filter", filter)
  142552. return c
  142553. }
  142554. // MaxResults sets the optional parameter "maxResults": The maximum
  142555. // number of results per page that should be returned. If the number of
  142556. // available results is larger than maxResults, Compute Engine returns a
  142557. // nextPageToken that can be used to get the next page of results in
  142558. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  142559. // (Default: 500)
  142560. func (c *UrlMapsAggregatedListCall) MaxResults(maxResults int64) *UrlMapsAggregatedListCall {
  142561. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  142562. return c
  142563. }
  142564. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  142565. // a certain order. By default, results are returned in alphanumerical
  142566. // order based on the resource name.
  142567. //
  142568. // You can also sort results in descending order based on the creation
  142569. // timestamp using orderBy="creationTimestamp desc". This sorts results
  142570. // based on the creationTimestamp field in reverse chronological order
  142571. // (newest result first). Use this to sort resources like operations so
  142572. // that the newest operation is returned first.
  142573. //
  142574. // Currently, only sorting by name or creationTimestamp desc is
  142575. // supported.
  142576. func (c *UrlMapsAggregatedListCall) OrderBy(orderBy string) *UrlMapsAggregatedListCall {
  142577. c.urlParams_.Set("orderBy", orderBy)
  142578. return c
  142579. }
  142580. // PageToken sets the optional parameter "pageToken": Specifies a page
  142581. // token to use. Set pageToken to the nextPageToken returned by a
  142582. // previous list request to get the next page of results.
  142583. func (c *UrlMapsAggregatedListCall) PageToken(pageToken string) *UrlMapsAggregatedListCall {
  142584. c.urlParams_.Set("pageToken", pageToken)
  142585. return c
  142586. }
  142587. // Fields allows partial responses to be retrieved. See
  142588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142589. // for more information.
  142590. func (c *UrlMapsAggregatedListCall) Fields(s ...googleapi.Field) *UrlMapsAggregatedListCall {
  142591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142592. return c
  142593. }
  142594. // IfNoneMatch sets the optional parameter which makes the operation
  142595. // fail if the object's ETag matches the given value. This is useful for
  142596. // getting updates only after the object has changed since the last
  142597. // request. Use googleapi.IsNotModified to check whether the response
  142598. // error from Do is the result of In-None-Match.
  142599. func (c *UrlMapsAggregatedListCall) IfNoneMatch(entityTag string) *UrlMapsAggregatedListCall {
  142600. c.ifNoneMatch_ = entityTag
  142601. return c
  142602. }
  142603. // Context sets the context to be used in this call's Do method. Any
  142604. // pending HTTP request will be aborted if the provided context is
  142605. // canceled.
  142606. func (c *UrlMapsAggregatedListCall) Context(ctx context.Context) *UrlMapsAggregatedListCall {
  142607. c.ctx_ = ctx
  142608. return c
  142609. }
  142610. // Header returns an http.Header that can be modified by the caller to
  142611. // add HTTP headers to the request.
  142612. func (c *UrlMapsAggregatedListCall) Header() http.Header {
  142613. if c.header_ == nil {
  142614. c.header_ = make(http.Header)
  142615. }
  142616. return c.header_
  142617. }
  142618. func (c *UrlMapsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  142619. reqHeaders := make(http.Header)
  142620. for k, v := range c.header_ {
  142621. reqHeaders[k] = v
  142622. }
  142623. reqHeaders.Set("User-Agent", c.s.userAgent())
  142624. if c.ifNoneMatch_ != "" {
  142625. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  142626. }
  142627. var body io.Reader = nil
  142628. c.urlParams_.Set("alt", alt)
  142629. c.urlParams_.Set("prettyPrint", "false")
  142630. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/urlMaps")
  142631. urls += "?" + c.urlParams_.Encode()
  142632. req, err := http.NewRequest("GET", urls, body)
  142633. if err != nil {
  142634. return nil, err
  142635. }
  142636. req.Header = reqHeaders
  142637. googleapi.Expand(req.URL, map[string]string{
  142638. "project": c.project,
  142639. })
  142640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142641. }
  142642. // Do executes the "compute.urlMaps.aggregatedList" call.
  142643. // Exactly one of *UrlMapsAggregatedList or error will be non-nil. Any
  142644. // non-2xx status code is an error. Response headers are in either
  142645. // *UrlMapsAggregatedList.ServerResponse.Header or (if a response was
  142646. // returned at all) in error.(*googleapi.Error).Header. Use
  142647. // googleapi.IsNotModified to check whether the returned error was
  142648. // because http.StatusNotModified was returned.
  142649. func (c *UrlMapsAggregatedListCall) Do(opts ...googleapi.CallOption) (*UrlMapsAggregatedList, error) {
  142650. gensupport.SetOptions(c.urlParams_, opts...)
  142651. res, err := c.doRequest("json")
  142652. if res != nil && res.StatusCode == http.StatusNotModified {
  142653. if res.Body != nil {
  142654. res.Body.Close()
  142655. }
  142656. return nil, &googleapi.Error{
  142657. Code: res.StatusCode,
  142658. Header: res.Header,
  142659. }
  142660. }
  142661. if err != nil {
  142662. return nil, err
  142663. }
  142664. defer googleapi.CloseBody(res)
  142665. if err := googleapi.CheckResponse(res); err != nil {
  142666. return nil, err
  142667. }
  142668. ret := &UrlMapsAggregatedList{
  142669. ServerResponse: googleapi.ServerResponse{
  142670. Header: res.Header,
  142671. HTTPStatusCode: res.StatusCode,
  142672. },
  142673. }
  142674. target := &ret
  142675. if err := gensupport.DecodeResponse(target, res); err != nil {
  142676. return nil, err
  142677. }
  142678. return ret, nil
  142679. // {
  142680. // "description": "Retrieves the list of all UrlMap resources, regional and global, available to the specified project.",
  142681. // "httpMethod": "GET",
  142682. // "id": "compute.urlMaps.aggregatedList",
  142683. // "parameterOrder": [
  142684. // "project"
  142685. // ],
  142686. // "parameters": {
  142687. // "filter": {
  142688. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  142689. // "location": "query",
  142690. // "type": "string"
  142691. // },
  142692. // "maxResults": {
  142693. // "default": "500",
  142694. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  142695. // "format": "uint32",
  142696. // "location": "query",
  142697. // "minimum": "0",
  142698. // "type": "integer"
  142699. // },
  142700. // "orderBy": {
  142701. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  142702. // "location": "query",
  142703. // "type": "string"
  142704. // },
  142705. // "pageToken": {
  142706. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  142707. // "location": "query",
  142708. // "type": "string"
  142709. // },
  142710. // "project": {
  142711. // "description": "Name of the project scoping this request.",
  142712. // "location": "path",
  142713. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  142714. // "required": true,
  142715. // "type": "string"
  142716. // }
  142717. // },
  142718. // "path": "{project}/aggregated/urlMaps",
  142719. // "response": {
  142720. // "$ref": "UrlMapsAggregatedList"
  142721. // },
  142722. // "scopes": [
  142723. // "https://www.googleapis.com/auth/cloud-platform",
  142724. // "https://www.googleapis.com/auth/compute",
  142725. // "https://www.googleapis.com/auth/compute.readonly"
  142726. // ]
  142727. // }
  142728. }
  142729. // Pages invokes f for each page of results.
  142730. // A non-nil error returned from f will halt the iteration.
  142731. // The provided context supersedes any context provided to the Context method.
  142732. func (c *UrlMapsAggregatedListCall) Pages(ctx context.Context, f func(*UrlMapsAggregatedList) error) error {
  142733. c.ctx_ = ctx
  142734. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  142735. for {
  142736. x, err := c.Do()
  142737. if err != nil {
  142738. return err
  142739. }
  142740. if err := f(x); err != nil {
  142741. return err
  142742. }
  142743. if x.NextPageToken == "" {
  142744. return nil
  142745. }
  142746. c.PageToken(x.NextPageToken)
  142747. }
  142748. }
  142749. // method id "compute.urlMaps.delete":
  142750. type UrlMapsDeleteCall struct {
  142751. s *Service
  142752. project string
  142753. urlMap string
  142754. urlParams_ gensupport.URLParams
  142755. ctx_ context.Context
  142756. header_ http.Header
  142757. }
  142758. // Delete: Deletes the specified UrlMap resource.
  142759. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  142760. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  142761. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  142762. c.project = project
  142763. c.urlMap = urlMap
  142764. return c
  142765. }
  142766. // RequestId sets the optional parameter "requestId": An optional
  142767. // request ID to identify requests. Specify a unique request ID so that
  142768. // if you must retry your request, the server will know to ignore the
  142769. // request if it has already been completed.
  142770. //
  142771. // For example, consider a situation where you make an initial request
  142772. // and the request times out. If you make the request again with the
  142773. // same request ID, the server can check if original operation with the
  142774. // same request ID was received, and if so, will ignore the second
  142775. // request. This prevents clients from accidentally creating duplicate
  142776. // commitments.
  142777. //
  142778. // The request ID must be a valid UUID with the exception that zero UUID
  142779. // is not supported (00000000-0000-0000-0000-000000000000).
  142780. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  142781. c.urlParams_.Set("requestId", requestId)
  142782. return c
  142783. }
  142784. // Fields allows partial responses to be retrieved. See
  142785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142786. // for more information.
  142787. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  142788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142789. return c
  142790. }
  142791. // Context sets the context to be used in this call's Do method. Any
  142792. // pending HTTP request will be aborted if the provided context is
  142793. // canceled.
  142794. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  142795. c.ctx_ = ctx
  142796. return c
  142797. }
  142798. // Header returns an http.Header that can be modified by the caller to
  142799. // add HTTP headers to the request.
  142800. func (c *UrlMapsDeleteCall) Header() http.Header {
  142801. if c.header_ == nil {
  142802. c.header_ = make(http.Header)
  142803. }
  142804. return c.header_
  142805. }
  142806. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  142807. reqHeaders := make(http.Header)
  142808. for k, v := range c.header_ {
  142809. reqHeaders[k] = v
  142810. }
  142811. reqHeaders.Set("User-Agent", c.s.userAgent())
  142812. var body io.Reader = nil
  142813. c.urlParams_.Set("alt", alt)
  142814. c.urlParams_.Set("prettyPrint", "false")
  142815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  142816. urls += "?" + c.urlParams_.Encode()
  142817. req, err := http.NewRequest("DELETE", urls, body)
  142818. if err != nil {
  142819. return nil, err
  142820. }
  142821. req.Header = reqHeaders
  142822. googleapi.Expand(req.URL, map[string]string{
  142823. "project": c.project,
  142824. "urlMap": c.urlMap,
  142825. })
  142826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142827. }
  142828. // Do executes the "compute.urlMaps.delete" call.
  142829. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  142830. // status code is an error. Response headers are in either
  142831. // *Operation.ServerResponse.Header or (if a response was returned at
  142832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  142833. // to check whether the returned error was because
  142834. // http.StatusNotModified was returned.
  142835. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  142836. gensupport.SetOptions(c.urlParams_, opts...)
  142837. res, err := c.doRequest("json")
  142838. if res != nil && res.StatusCode == http.StatusNotModified {
  142839. if res.Body != nil {
  142840. res.Body.Close()
  142841. }
  142842. return nil, &googleapi.Error{
  142843. Code: res.StatusCode,
  142844. Header: res.Header,
  142845. }
  142846. }
  142847. if err != nil {
  142848. return nil, err
  142849. }
  142850. defer googleapi.CloseBody(res)
  142851. if err := googleapi.CheckResponse(res); err != nil {
  142852. return nil, err
  142853. }
  142854. ret := &Operation{
  142855. ServerResponse: googleapi.ServerResponse{
  142856. Header: res.Header,
  142857. HTTPStatusCode: res.StatusCode,
  142858. },
  142859. }
  142860. target := &ret
  142861. if err := gensupport.DecodeResponse(target, res); err != nil {
  142862. return nil, err
  142863. }
  142864. return ret, nil
  142865. // {
  142866. // "description": "Deletes the specified UrlMap resource.",
  142867. // "httpMethod": "DELETE",
  142868. // "id": "compute.urlMaps.delete",
  142869. // "parameterOrder": [
  142870. // "project",
  142871. // "urlMap"
  142872. // ],
  142873. // "parameters": {
  142874. // "project": {
  142875. // "description": "Project ID for this request.",
  142876. // "location": "path",
  142877. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  142878. // "required": true,
  142879. // "type": "string"
  142880. // },
  142881. // "requestId": {
  142882. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  142883. // "location": "query",
  142884. // "type": "string"
  142885. // },
  142886. // "urlMap": {
  142887. // "description": "Name of the UrlMap resource to delete.",
  142888. // "location": "path",
  142889. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  142890. // "required": true,
  142891. // "type": "string"
  142892. // }
  142893. // },
  142894. // "path": "{project}/global/urlMaps/{urlMap}",
  142895. // "response": {
  142896. // "$ref": "Operation"
  142897. // },
  142898. // "scopes": [
  142899. // "https://www.googleapis.com/auth/cloud-platform",
  142900. // "https://www.googleapis.com/auth/compute"
  142901. // ]
  142902. // }
  142903. }
  142904. // method id "compute.urlMaps.get":
  142905. type UrlMapsGetCall struct {
  142906. s *Service
  142907. project string
  142908. urlMap string
  142909. urlParams_ gensupport.URLParams
  142910. ifNoneMatch_ string
  142911. ctx_ context.Context
  142912. header_ http.Header
  142913. }
  142914. // Get: Returns the specified UrlMap resource. Gets a list of available
  142915. // URL maps by making a list() request.
  142916. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  142917. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  142918. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  142919. c.project = project
  142920. c.urlMap = urlMap
  142921. return c
  142922. }
  142923. // Fields allows partial responses to be retrieved. See
  142924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142925. // for more information.
  142926. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  142927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142928. return c
  142929. }
  142930. // IfNoneMatch sets the optional parameter which makes the operation
  142931. // fail if the object's ETag matches the given value. This is useful for
  142932. // getting updates only after the object has changed since the last
  142933. // request. Use googleapi.IsNotModified to check whether the response
  142934. // error from Do is the result of In-None-Match.
  142935. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  142936. c.ifNoneMatch_ = entityTag
  142937. return c
  142938. }
  142939. // Context sets the context to be used in this call's Do method. Any
  142940. // pending HTTP request will be aborted if the provided context is
  142941. // canceled.
  142942. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  142943. c.ctx_ = ctx
  142944. return c
  142945. }
  142946. // Header returns an http.Header that can be modified by the caller to
  142947. // add HTTP headers to the request.
  142948. func (c *UrlMapsGetCall) Header() http.Header {
  142949. if c.header_ == nil {
  142950. c.header_ = make(http.Header)
  142951. }
  142952. return c.header_
  142953. }
  142954. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  142955. reqHeaders := make(http.Header)
  142956. for k, v := range c.header_ {
  142957. reqHeaders[k] = v
  142958. }
  142959. reqHeaders.Set("User-Agent", c.s.userAgent())
  142960. if c.ifNoneMatch_ != "" {
  142961. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  142962. }
  142963. var body io.Reader = nil
  142964. c.urlParams_.Set("alt", alt)
  142965. c.urlParams_.Set("prettyPrint", "false")
  142966. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  142967. urls += "?" + c.urlParams_.Encode()
  142968. req, err := http.NewRequest("GET", urls, body)
  142969. if err != nil {
  142970. return nil, err
  142971. }
  142972. req.Header = reqHeaders
  142973. googleapi.Expand(req.URL, map[string]string{
  142974. "project": c.project,
  142975. "urlMap": c.urlMap,
  142976. })
  142977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142978. }
  142979. // Do executes the "compute.urlMaps.get" call.
  142980. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  142981. // code is an error. Response headers are in either
  142982. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  142983. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  142984. // check whether the returned error was because http.StatusNotModified
  142985. // was returned.
  142986. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  142987. gensupport.SetOptions(c.urlParams_, opts...)
  142988. res, err := c.doRequest("json")
  142989. if res != nil && res.StatusCode == http.StatusNotModified {
  142990. if res.Body != nil {
  142991. res.Body.Close()
  142992. }
  142993. return nil, &googleapi.Error{
  142994. Code: res.StatusCode,
  142995. Header: res.Header,
  142996. }
  142997. }
  142998. if err != nil {
  142999. return nil, err
  143000. }
  143001. defer googleapi.CloseBody(res)
  143002. if err := googleapi.CheckResponse(res); err != nil {
  143003. return nil, err
  143004. }
  143005. ret := &UrlMap{
  143006. ServerResponse: googleapi.ServerResponse{
  143007. Header: res.Header,
  143008. HTTPStatusCode: res.StatusCode,
  143009. },
  143010. }
  143011. target := &ret
  143012. if err := gensupport.DecodeResponse(target, res); err != nil {
  143013. return nil, err
  143014. }
  143015. return ret, nil
  143016. // {
  143017. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  143018. // "httpMethod": "GET",
  143019. // "id": "compute.urlMaps.get",
  143020. // "parameterOrder": [
  143021. // "project",
  143022. // "urlMap"
  143023. // ],
  143024. // "parameters": {
  143025. // "project": {
  143026. // "description": "Project ID for this request.",
  143027. // "location": "path",
  143028. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143029. // "required": true,
  143030. // "type": "string"
  143031. // },
  143032. // "urlMap": {
  143033. // "description": "Name of the UrlMap resource to return.",
  143034. // "location": "path",
  143035. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  143036. // "required": true,
  143037. // "type": "string"
  143038. // }
  143039. // },
  143040. // "path": "{project}/global/urlMaps/{urlMap}",
  143041. // "response": {
  143042. // "$ref": "UrlMap"
  143043. // },
  143044. // "scopes": [
  143045. // "https://www.googleapis.com/auth/cloud-platform",
  143046. // "https://www.googleapis.com/auth/compute",
  143047. // "https://www.googleapis.com/auth/compute.readonly"
  143048. // ]
  143049. // }
  143050. }
  143051. // method id "compute.urlMaps.insert":
  143052. type UrlMapsInsertCall struct {
  143053. s *Service
  143054. project string
  143055. urlmap *UrlMap
  143056. urlParams_ gensupport.URLParams
  143057. ctx_ context.Context
  143058. header_ http.Header
  143059. }
  143060. // Insert: Creates a UrlMap resource in the specified project using the
  143061. // data included in the request.
  143062. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  143063. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  143064. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143065. c.project = project
  143066. c.urlmap = urlmap
  143067. return c
  143068. }
  143069. // RequestId sets the optional parameter "requestId": An optional
  143070. // request ID to identify requests. Specify a unique request ID so that
  143071. // if you must retry your request, the server will know to ignore the
  143072. // request if it has already been completed.
  143073. //
  143074. // For example, consider a situation where you make an initial request
  143075. // and the request times out. If you make the request again with the
  143076. // same request ID, the server can check if original operation with the
  143077. // same request ID was received, and if so, will ignore the second
  143078. // request. This prevents clients from accidentally creating duplicate
  143079. // commitments.
  143080. //
  143081. // The request ID must be a valid UUID with the exception that zero UUID
  143082. // is not supported (00000000-0000-0000-0000-000000000000).
  143083. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  143084. c.urlParams_.Set("requestId", requestId)
  143085. return c
  143086. }
  143087. // Fields allows partial responses to be retrieved. See
  143088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143089. // for more information.
  143090. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  143091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143092. return c
  143093. }
  143094. // Context sets the context to be used in this call's Do method. Any
  143095. // pending HTTP request will be aborted if the provided context is
  143096. // canceled.
  143097. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  143098. c.ctx_ = ctx
  143099. return c
  143100. }
  143101. // Header returns an http.Header that can be modified by the caller to
  143102. // add HTTP headers to the request.
  143103. func (c *UrlMapsInsertCall) Header() http.Header {
  143104. if c.header_ == nil {
  143105. c.header_ = make(http.Header)
  143106. }
  143107. return c.header_
  143108. }
  143109. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  143110. reqHeaders := make(http.Header)
  143111. for k, v := range c.header_ {
  143112. reqHeaders[k] = v
  143113. }
  143114. reqHeaders.Set("User-Agent", c.s.userAgent())
  143115. var body io.Reader = nil
  143116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  143117. if err != nil {
  143118. return nil, err
  143119. }
  143120. reqHeaders.Set("Content-Type", "application/json")
  143121. c.urlParams_.Set("alt", alt)
  143122. c.urlParams_.Set("prettyPrint", "false")
  143123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  143124. urls += "?" + c.urlParams_.Encode()
  143125. req, err := http.NewRequest("POST", urls, body)
  143126. if err != nil {
  143127. return nil, err
  143128. }
  143129. req.Header = reqHeaders
  143130. googleapi.Expand(req.URL, map[string]string{
  143131. "project": c.project,
  143132. })
  143133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143134. }
  143135. // Do executes the "compute.urlMaps.insert" call.
  143136. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  143137. // status code is an error. Response headers are in either
  143138. // *Operation.ServerResponse.Header or (if a response was returned at
  143139. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  143140. // to check whether the returned error was because
  143141. // http.StatusNotModified was returned.
  143142. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  143143. gensupport.SetOptions(c.urlParams_, opts...)
  143144. res, err := c.doRequest("json")
  143145. if res != nil && res.StatusCode == http.StatusNotModified {
  143146. if res.Body != nil {
  143147. res.Body.Close()
  143148. }
  143149. return nil, &googleapi.Error{
  143150. Code: res.StatusCode,
  143151. Header: res.Header,
  143152. }
  143153. }
  143154. if err != nil {
  143155. return nil, err
  143156. }
  143157. defer googleapi.CloseBody(res)
  143158. if err := googleapi.CheckResponse(res); err != nil {
  143159. return nil, err
  143160. }
  143161. ret := &Operation{
  143162. ServerResponse: googleapi.ServerResponse{
  143163. Header: res.Header,
  143164. HTTPStatusCode: res.StatusCode,
  143165. },
  143166. }
  143167. target := &ret
  143168. if err := gensupport.DecodeResponse(target, res); err != nil {
  143169. return nil, err
  143170. }
  143171. return ret, nil
  143172. // {
  143173. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  143174. // "httpMethod": "POST",
  143175. // "id": "compute.urlMaps.insert",
  143176. // "parameterOrder": [
  143177. // "project"
  143178. // ],
  143179. // "parameters": {
  143180. // "project": {
  143181. // "description": "Project ID for this request.",
  143182. // "location": "path",
  143183. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143184. // "required": true,
  143185. // "type": "string"
  143186. // },
  143187. // "requestId": {
  143188. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  143189. // "location": "query",
  143190. // "type": "string"
  143191. // }
  143192. // },
  143193. // "path": "{project}/global/urlMaps",
  143194. // "request": {
  143195. // "$ref": "UrlMap"
  143196. // },
  143197. // "response": {
  143198. // "$ref": "Operation"
  143199. // },
  143200. // "scopes": [
  143201. // "https://www.googleapis.com/auth/cloud-platform",
  143202. // "https://www.googleapis.com/auth/compute"
  143203. // ]
  143204. // }
  143205. }
  143206. // method id "compute.urlMaps.invalidateCache":
  143207. type UrlMapsInvalidateCacheCall struct {
  143208. s *Service
  143209. project string
  143210. urlMap string
  143211. cacheinvalidationrule *CacheInvalidationRule
  143212. urlParams_ gensupport.URLParams
  143213. ctx_ context.Context
  143214. header_ http.Header
  143215. }
  143216. // InvalidateCache: Initiates a cache invalidation operation,
  143217. // invalidating the specified path, scoped to the specified UrlMap.
  143218. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  143219. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143220. c.project = project
  143221. c.urlMap = urlMap
  143222. c.cacheinvalidationrule = cacheinvalidationrule
  143223. return c
  143224. }
  143225. // RequestId sets the optional parameter "requestId": An optional
  143226. // request ID to identify requests. Specify a unique request ID so that
  143227. // if you must retry your request, the server will know to ignore the
  143228. // request if it has already been completed.
  143229. //
  143230. // For example, consider a situation where you make an initial request
  143231. // and the request times out. If you make the request again with the
  143232. // same request ID, the server can check if original operation with the
  143233. // same request ID was received, and if so, will ignore the second
  143234. // request. This prevents clients from accidentally creating duplicate
  143235. // commitments.
  143236. //
  143237. // The request ID must be a valid UUID with the exception that zero UUID
  143238. // is not supported (00000000-0000-0000-0000-000000000000).
  143239. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  143240. c.urlParams_.Set("requestId", requestId)
  143241. return c
  143242. }
  143243. // Fields allows partial responses to be retrieved. See
  143244. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143245. // for more information.
  143246. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  143247. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143248. return c
  143249. }
  143250. // Context sets the context to be used in this call's Do method. Any
  143251. // pending HTTP request will be aborted if the provided context is
  143252. // canceled.
  143253. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  143254. c.ctx_ = ctx
  143255. return c
  143256. }
  143257. // Header returns an http.Header that can be modified by the caller to
  143258. // add HTTP headers to the request.
  143259. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  143260. if c.header_ == nil {
  143261. c.header_ = make(http.Header)
  143262. }
  143263. return c.header_
  143264. }
  143265. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  143266. reqHeaders := make(http.Header)
  143267. for k, v := range c.header_ {
  143268. reqHeaders[k] = v
  143269. }
  143270. reqHeaders.Set("User-Agent", c.s.userAgent())
  143271. var body io.Reader = nil
  143272. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  143273. if err != nil {
  143274. return nil, err
  143275. }
  143276. reqHeaders.Set("Content-Type", "application/json")
  143277. c.urlParams_.Set("alt", alt)
  143278. c.urlParams_.Set("prettyPrint", "false")
  143279. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  143280. urls += "?" + c.urlParams_.Encode()
  143281. req, err := http.NewRequest("POST", urls, body)
  143282. if err != nil {
  143283. return nil, err
  143284. }
  143285. req.Header = reqHeaders
  143286. googleapi.Expand(req.URL, map[string]string{
  143287. "project": c.project,
  143288. "urlMap": c.urlMap,
  143289. })
  143290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143291. }
  143292. // Do executes the "compute.urlMaps.invalidateCache" call.
  143293. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  143294. // status code is an error. Response headers are in either
  143295. // *Operation.ServerResponse.Header or (if a response was returned at
  143296. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  143297. // to check whether the returned error was because
  143298. // http.StatusNotModified was returned.
  143299. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  143300. gensupport.SetOptions(c.urlParams_, opts...)
  143301. res, err := c.doRequest("json")
  143302. if res != nil && res.StatusCode == http.StatusNotModified {
  143303. if res.Body != nil {
  143304. res.Body.Close()
  143305. }
  143306. return nil, &googleapi.Error{
  143307. Code: res.StatusCode,
  143308. Header: res.Header,
  143309. }
  143310. }
  143311. if err != nil {
  143312. return nil, err
  143313. }
  143314. defer googleapi.CloseBody(res)
  143315. if err := googleapi.CheckResponse(res); err != nil {
  143316. return nil, err
  143317. }
  143318. ret := &Operation{
  143319. ServerResponse: googleapi.ServerResponse{
  143320. Header: res.Header,
  143321. HTTPStatusCode: res.StatusCode,
  143322. },
  143323. }
  143324. target := &ret
  143325. if err := gensupport.DecodeResponse(target, res); err != nil {
  143326. return nil, err
  143327. }
  143328. return ret, nil
  143329. // {
  143330. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  143331. // "httpMethod": "POST",
  143332. // "id": "compute.urlMaps.invalidateCache",
  143333. // "parameterOrder": [
  143334. // "project",
  143335. // "urlMap"
  143336. // ],
  143337. // "parameters": {
  143338. // "project": {
  143339. // "description": "Project ID for this request.",
  143340. // "location": "path",
  143341. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143342. // "required": true,
  143343. // "type": "string"
  143344. // },
  143345. // "requestId": {
  143346. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  143347. // "location": "query",
  143348. // "type": "string"
  143349. // },
  143350. // "urlMap": {
  143351. // "description": "Name of the UrlMap scoping this request.",
  143352. // "location": "path",
  143353. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  143354. // "required": true,
  143355. // "type": "string"
  143356. // }
  143357. // },
  143358. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  143359. // "request": {
  143360. // "$ref": "CacheInvalidationRule"
  143361. // },
  143362. // "response": {
  143363. // "$ref": "Operation"
  143364. // },
  143365. // "scopes": [
  143366. // "https://www.googleapis.com/auth/cloud-platform",
  143367. // "https://www.googleapis.com/auth/compute"
  143368. // ]
  143369. // }
  143370. }
  143371. // method id "compute.urlMaps.list":
  143372. type UrlMapsListCall struct {
  143373. s *Service
  143374. project string
  143375. urlParams_ gensupport.URLParams
  143376. ifNoneMatch_ string
  143377. ctx_ context.Context
  143378. header_ http.Header
  143379. }
  143380. // List: Retrieves the list of UrlMap resources available to the
  143381. // specified project.
  143382. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  143383. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  143384. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143385. c.project = project
  143386. return c
  143387. }
  143388. // Filter sets the optional parameter "filter": A filter expression that
  143389. // filters resources listed in the response. The expression must specify
  143390. // the field name, a comparison operator, and the value that you want to
  143391. // use for filtering. The value must be a string, a number, or a
  143392. // boolean. The comparison operator must be either =, !=, >, or <.
  143393. //
  143394. // For example, if you are filtering Compute Engine instances, you can
  143395. // exclude instances named example-instance by specifying name !=
  143396. // example-instance.
  143397. //
  143398. // You can also filter nested fields. For example, you could specify
  143399. // scheduling.automaticRestart = false to include instances only if they
  143400. // are not scheduled for automatic restarts. You can use filtering on
  143401. // nested fields to filter based on resource labels.
  143402. //
  143403. // To filter on multiple expressions, provide each separate expression
  143404. // within parentheses. For example, (scheduling.automaticRestart = true)
  143405. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  143406. // AND expression. However, you can include AND and OR expressions
  143407. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  143408. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  143409. // true).
  143410. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  143411. c.urlParams_.Set("filter", filter)
  143412. return c
  143413. }
  143414. // MaxResults sets the optional parameter "maxResults": The maximum
  143415. // number of results per page that should be returned. If the number of
  143416. // available results is larger than maxResults, Compute Engine returns a
  143417. // nextPageToken that can be used to get the next page of results in
  143418. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  143419. // (Default: 500)
  143420. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  143421. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  143422. return c
  143423. }
  143424. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  143425. // a certain order. By default, results are returned in alphanumerical
  143426. // order based on the resource name.
  143427. //
  143428. // You can also sort results in descending order based on the creation
  143429. // timestamp using orderBy="creationTimestamp desc". This sorts results
  143430. // based on the creationTimestamp field in reverse chronological order
  143431. // (newest result first). Use this to sort resources like operations so
  143432. // that the newest operation is returned first.
  143433. //
  143434. // Currently, only sorting by name or creationTimestamp desc is
  143435. // supported.
  143436. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  143437. c.urlParams_.Set("orderBy", orderBy)
  143438. return c
  143439. }
  143440. // PageToken sets the optional parameter "pageToken": Specifies a page
  143441. // token to use. Set pageToken to the nextPageToken returned by a
  143442. // previous list request to get the next page of results.
  143443. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  143444. c.urlParams_.Set("pageToken", pageToken)
  143445. return c
  143446. }
  143447. // Fields allows partial responses to be retrieved. See
  143448. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143449. // for more information.
  143450. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  143451. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143452. return c
  143453. }
  143454. // IfNoneMatch sets the optional parameter which makes the operation
  143455. // fail if the object's ETag matches the given value. This is useful for
  143456. // getting updates only after the object has changed since the last
  143457. // request. Use googleapi.IsNotModified to check whether the response
  143458. // error from Do is the result of In-None-Match.
  143459. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  143460. c.ifNoneMatch_ = entityTag
  143461. return c
  143462. }
  143463. // Context sets the context to be used in this call's Do method. Any
  143464. // pending HTTP request will be aborted if the provided context is
  143465. // canceled.
  143466. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  143467. c.ctx_ = ctx
  143468. return c
  143469. }
  143470. // Header returns an http.Header that can be modified by the caller to
  143471. // add HTTP headers to the request.
  143472. func (c *UrlMapsListCall) Header() http.Header {
  143473. if c.header_ == nil {
  143474. c.header_ = make(http.Header)
  143475. }
  143476. return c.header_
  143477. }
  143478. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  143479. reqHeaders := make(http.Header)
  143480. for k, v := range c.header_ {
  143481. reqHeaders[k] = v
  143482. }
  143483. reqHeaders.Set("User-Agent", c.s.userAgent())
  143484. if c.ifNoneMatch_ != "" {
  143485. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  143486. }
  143487. var body io.Reader = nil
  143488. c.urlParams_.Set("alt", alt)
  143489. c.urlParams_.Set("prettyPrint", "false")
  143490. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  143491. urls += "?" + c.urlParams_.Encode()
  143492. req, err := http.NewRequest("GET", urls, body)
  143493. if err != nil {
  143494. return nil, err
  143495. }
  143496. req.Header = reqHeaders
  143497. googleapi.Expand(req.URL, map[string]string{
  143498. "project": c.project,
  143499. })
  143500. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143501. }
  143502. // Do executes the "compute.urlMaps.list" call.
  143503. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  143504. // status code is an error. Response headers are in either
  143505. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  143506. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  143507. // to check whether the returned error was because
  143508. // http.StatusNotModified was returned.
  143509. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  143510. gensupport.SetOptions(c.urlParams_, opts...)
  143511. res, err := c.doRequest("json")
  143512. if res != nil && res.StatusCode == http.StatusNotModified {
  143513. if res.Body != nil {
  143514. res.Body.Close()
  143515. }
  143516. return nil, &googleapi.Error{
  143517. Code: res.StatusCode,
  143518. Header: res.Header,
  143519. }
  143520. }
  143521. if err != nil {
  143522. return nil, err
  143523. }
  143524. defer googleapi.CloseBody(res)
  143525. if err := googleapi.CheckResponse(res); err != nil {
  143526. return nil, err
  143527. }
  143528. ret := &UrlMapList{
  143529. ServerResponse: googleapi.ServerResponse{
  143530. Header: res.Header,
  143531. HTTPStatusCode: res.StatusCode,
  143532. },
  143533. }
  143534. target := &ret
  143535. if err := gensupport.DecodeResponse(target, res); err != nil {
  143536. return nil, err
  143537. }
  143538. return ret, nil
  143539. // {
  143540. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  143541. // "httpMethod": "GET",
  143542. // "id": "compute.urlMaps.list",
  143543. // "parameterOrder": [
  143544. // "project"
  143545. // ],
  143546. // "parameters": {
  143547. // "filter": {
  143548. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  143549. // "location": "query",
  143550. // "type": "string"
  143551. // },
  143552. // "maxResults": {
  143553. // "default": "500",
  143554. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  143555. // "format": "uint32",
  143556. // "location": "query",
  143557. // "minimum": "0",
  143558. // "type": "integer"
  143559. // },
  143560. // "orderBy": {
  143561. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  143562. // "location": "query",
  143563. // "type": "string"
  143564. // },
  143565. // "pageToken": {
  143566. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  143567. // "location": "query",
  143568. // "type": "string"
  143569. // },
  143570. // "project": {
  143571. // "description": "Project ID for this request.",
  143572. // "location": "path",
  143573. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143574. // "required": true,
  143575. // "type": "string"
  143576. // }
  143577. // },
  143578. // "path": "{project}/global/urlMaps",
  143579. // "response": {
  143580. // "$ref": "UrlMapList"
  143581. // },
  143582. // "scopes": [
  143583. // "https://www.googleapis.com/auth/cloud-platform",
  143584. // "https://www.googleapis.com/auth/compute",
  143585. // "https://www.googleapis.com/auth/compute.readonly"
  143586. // ]
  143587. // }
  143588. }
  143589. // Pages invokes f for each page of results.
  143590. // A non-nil error returned from f will halt the iteration.
  143591. // The provided context supersedes any context provided to the Context method.
  143592. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  143593. c.ctx_ = ctx
  143594. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  143595. for {
  143596. x, err := c.Do()
  143597. if err != nil {
  143598. return err
  143599. }
  143600. if err := f(x); err != nil {
  143601. return err
  143602. }
  143603. if x.NextPageToken == "" {
  143604. return nil
  143605. }
  143606. c.PageToken(x.NextPageToken)
  143607. }
  143608. }
  143609. // method id "compute.urlMaps.patch":
  143610. type UrlMapsPatchCall struct {
  143611. s *Service
  143612. project string
  143613. urlMap string
  143614. urlmap *UrlMap
  143615. urlParams_ gensupport.URLParams
  143616. ctx_ context.Context
  143617. header_ http.Header
  143618. }
  143619. // Patch: Patches the specified UrlMap resource with the data included
  143620. // in the request. This method supports PATCH semantics and uses the
  143621. // JSON merge patch format and processing rules.
  143622. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  143623. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  143624. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143625. c.project = project
  143626. c.urlMap = urlMap
  143627. c.urlmap = urlmap
  143628. return c
  143629. }
  143630. // RequestId sets the optional parameter "requestId": An optional
  143631. // request ID to identify requests. Specify a unique request ID so that
  143632. // if you must retry your request, the server will know to ignore the
  143633. // request if it has already been completed.
  143634. //
  143635. // For example, consider a situation where you make an initial request
  143636. // and the request times out. If you make the request again with the
  143637. // same request ID, the server can check if original operation with the
  143638. // same request ID was received, and if so, will ignore the second
  143639. // request. This prevents clients from accidentally creating duplicate
  143640. // commitments.
  143641. //
  143642. // The request ID must be a valid UUID with the exception that zero UUID
  143643. // is not supported (00000000-0000-0000-0000-000000000000).
  143644. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  143645. c.urlParams_.Set("requestId", requestId)
  143646. return c
  143647. }
  143648. // Fields allows partial responses to be retrieved. See
  143649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143650. // for more information.
  143651. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  143652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143653. return c
  143654. }
  143655. // Context sets the context to be used in this call's Do method. Any
  143656. // pending HTTP request will be aborted if the provided context is
  143657. // canceled.
  143658. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  143659. c.ctx_ = ctx
  143660. return c
  143661. }
  143662. // Header returns an http.Header that can be modified by the caller to
  143663. // add HTTP headers to the request.
  143664. func (c *UrlMapsPatchCall) Header() http.Header {
  143665. if c.header_ == nil {
  143666. c.header_ = make(http.Header)
  143667. }
  143668. return c.header_
  143669. }
  143670. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  143671. reqHeaders := make(http.Header)
  143672. for k, v := range c.header_ {
  143673. reqHeaders[k] = v
  143674. }
  143675. reqHeaders.Set("User-Agent", c.s.userAgent())
  143676. var body io.Reader = nil
  143677. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  143678. if err != nil {
  143679. return nil, err
  143680. }
  143681. reqHeaders.Set("Content-Type", "application/json")
  143682. c.urlParams_.Set("alt", alt)
  143683. c.urlParams_.Set("prettyPrint", "false")
  143684. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  143685. urls += "?" + c.urlParams_.Encode()
  143686. req, err := http.NewRequest("PATCH", urls, body)
  143687. if err != nil {
  143688. return nil, err
  143689. }
  143690. req.Header = reqHeaders
  143691. googleapi.Expand(req.URL, map[string]string{
  143692. "project": c.project,
  143693. "urlMap": c.urlMap,
  143694. })
  143695. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143696. }
  143697. // Do executes the "compute.urlMaps.patch" call.
  143698. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  143699. // status code is an error. Response headers are in either
  143700. // *Operation.ServerResponse.Header or (if a response was returned at
  143701. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  143702. // to check whether the returned error was because
  143703. // http.StatusNotModified was returned.
  143704. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  143705. gensupport.SetOptions(c.urlParams_, opts...)
  143706. res, err := c.doRequest("json")
  143707. if res != nil && res.StatusCode == http.StatusNotModified {
  143708. if res.Body != nil {
  143709. res.Body.Close()
  143710. }
  143711. return nil, &googleapi.Error{
  143712. Code: res.StatusCode,
  143713. Header: res.Header,
  143714. }
  143715. }
  143716. if err != nil {
  143717. return nil, err
  143718. }
  143719. defer googleapi.CloseBody(res)
  143720. if err := googleapi.CheckResponse(res); err != nil {
  143721. return nil, err
  143722. }
  143723. ret := &Operation{
  143724. ServerResponse: googleapi.ServerResponse{
  143725. Header: res.Header,
  143726. HTTPStatusCode: res.StatusCode,
  143727. },
  143728. }
  143729. target := &ret
  143730. if err := gensupport.DecodeResponse(target, res); err != nil {
  143731. return nil, err
  143732. }
  143733. return ret, nil
  143734. // {
  143735. // "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.",
  143736. // "httpMethod": "PATCH",
  143737. // "id": "compute.urlMaps.patch",
  143738. // "parameterOrder": [
  143739. // "project",
  143740. // "urlMap"
  143741. // ],
  143742. // "parameters": {
  143743. // "project": {
  143744. // "description": "Project ID for this request.",
  143745. // "location": "path",
  143746. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143747. // "required": true,
  143748. // "type": "string"
  143749. // },
  143750. // "requestId": {
  143751. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  143752. // "location": "query",
  143753. // "type": "string"
  143754. // },
  143755. // "urlMap": {
  143756. // "description": "Name of the UrlMap resource to patch.",
  143757. // "location": "path",
  143758. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  143759. // "required": true,
  143760. // "type": "string"
  143761. // }
  143762. // },
  143763. // "path": "{project}/global/urlMaps/{urlMap}",
  143764. // "request": {
  143765. // "$ref": "UrlMap"
  143766. // },
  143767. // "response": {
  143768. // "$ref": "Operation"
  143769. // },
  143770. // "scopes": [
  143771. // "https://www.googleapis.com/auth/cloud-platform",
  143772. // "https://www.googleapis.com/auth/compute"
  143773. // ]
  143774. // }
  143775. }
  143776. // method id "compute.urlMaps.testIamPermissions":
  143777. type UrlMapsTestIamPermissionsCall struct {
  143778. s *Service
  143779. project string
  143780. resource string
  143781. testpermissionsrequest *TestPermissionsRequest
  143782. urlParams_ gensupport.URLParams
  143783. ctx_ context.Context
  143784. header_ http.Header
  143785. }
  143786. // TestIamPermissions: Returns permissions that a caller has on the
  143787. // specified resource.
  143788. func (r *UrlMapsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *UrlMapsTestIamPermissionsCall {
  143789. c := &UrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143790. c.project = project
  143791. c.resource = resource
  143792. c.testpermissionsrequest = testpermissionsrequest
  143793. return c
  143794. }
  143795. // Fields allows partial responses to be retrieved. See
  143796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143797. // for more information.
  143798. func (c *UrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *UrlMapsTestIamPermissionsCall {
  143799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143800. return c
  143801. }
  143802. // Context sets the context to be used in this call's Do method. Any
  143803. // pending HTTP request will be aborted if the provided context is
  143804. // canceled.
  143805. func (c *UrlMapsTestIamPermissionsCall) Context(ctx context.Context) *UrlMapsTestIamPermissionsCall {
  143806. c.ctx_ = ctx
  143807. return c
  143808. }
  143809. // Header returns an http.Header that can be modified by the caller to
  143810. // add HTTP headers to the request.
  143811. func (c *UrlMapsTestIamPermissionsCall) Header() http.Header {
  143812. if c.header_ == nil {
  143813. c.header_ = make(http.Header)
  143814. }
  143815. return c.header_
  143816. }
  143817. func (c *UrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  143818. reqHeaders := make(http.Header)
  143819. for k, v := range c.header_ {
  143820. reqHeaders[k] = v
  143821. }
  143822. reqHeaders.Set("User-Agent", c.s.userAgent())
  143823. var body io.Reader = nil
  143824. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  143825. if err != nil {
  143826. return nil, err
  143827. }
  143828. reqHeaders.Set("Content-Type", "application/json")
  143829. c.urlParams_.Set("alt", alt)
  143830. c.urlParams_.Set("prettyPrint", "false")
  143831. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{resource}/testIamPermissions")
  143832. urls += "?" + c.urlParams_.Encode()
  143833. req, err := http.NewRequest("POST", urls, body)
  143834. if err != nil {
  143835. return nil, err
  143836. }
  143837. req.Header = reqHeaders
  143838. googleapi.Expand(req.URL, map[string]string{
  143839. "project": c.project,
  143840. "resource": c.resource,
  143841. })
  143842. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143843. }
  143844. // Do executes the "compute.urlMaps.testIamPermissions" call.
  143845. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  143846. // non-2xx status code is an error. Response headers are in either
  143847. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  143848. // returned at all) in error.(*googleapi.Error).Header. Use
  143849. // googleapi.IsNotModified to check whether the returned error was
  143850. // because http.StatusNotModified was returned.
  143851. func (c *UrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  143852. gensupport.SetOptions(c.urlParams_, opts...)
  143853. res, err := c.doRequest("json")
  143854. if res != nil && res.StatusCode == http.StatusNotModified {
  143855. if res.Body != nil {
  143856. res.Body.Close()
  143857. }
  143858. return nil, &googleapi.Error{
  143859. Code: res.StatusCode,
  143860. Header: res.Header,
  143861. }
  143862. }
  143863. if err != nil {
  143864. return nil, err
  143865. }
  143866. defer googleapi.CloseBody(res)
  143867. if err := googleapi.CheckResponse(res); err != nil {
  143868. return nil, err
  143869. }
  143870. ret := &TestPermissionsResponse{
  143871. ServerResponse: googleapi.ServerResponse{
  143872. Header: res.Header,
  143873. HTTPStatusCode: res.StatusCode,
  143874. },
  143875. }
  143876. target := &ret
  143877. if err := gensupport.DecodeResponse(target, res); err != nil {
  143878. return nil, err
  143879. }
  143880. return ret, nil
  143881. // {
  143882. // "description": "Returns permissions that a caller has on the specified resource.",
  143883. // "httpMethod": "POST",
  143884. // "id": "compute.urlMaps.testIamPermissions",
  143885. // "parameterOrder": [
  143886. // "project",
  143887. // "resource"
  143888. // ],
  143889. // "parameters": {
  143890. // "project": {
  143891. // "description": "Project ID for this request.",
  143892. // "location": "path",
  143893. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143894. // "required": true,
  143895. // "type": "string"
  143896. // },
  143897. // "resource": {
  143898. // "description": "Name or id of the resource for this request.",
  143899. // "location": "path",
  143900. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  143901. // "required": true,
  143902. // "type": "string"
  143903. // }
  143904. // },
  143905. // "path": "{project}/global/urlMaps/{resource}/testIamPermissions",
  143906. // "request": {
  143907. // "$ref": "TestPermissionsRequest"
  143908. // },
  143909. // "response": {
  143910. // "$ref": "TestPermissionsResponse"
  143911. // },
  143912. // "scopes": [
  143913. // "https://www.googleapis.com/auth/cloud-platform",
  143914. // "https://www.googleapis.com/auth/compute",
  143915. // "https://www.googleapis.com/auth/compute.readonly"
  143916. // ]
  143917. // }
  143918. }
  143919. // method id "compute.urlMaps.update":
  143920. type UrlMapsUpdateCall struct {
  143921. s *Service
  143922. project string
  143923. urlMap string
  143924. urlmap *UrlMap
  143925. urlParams_ gensupport.URLParams
  143926. ctx_ context.Context
  143927. header_ http.Header
  143928. }
  143929. // Update: Updates the specified UrlMap resource with the data included
  143930. // in the request.
  143931. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  143932. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  143933. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143934. c.project = project
  143935. c.urlMap = urlMap
  143936. c.urlmap = urlmap
  143937. return c
  143938. }
  143939. // RequestId sets the optional parameter "requestId": An optional
  143940. // request ID to identify requests. Specify a unique request ID so that
  143941. // if you must retry your request, the server will know to ignore the
  143942. // request if it has already been completed.
  143943. //
  143944. // For example, consider a situation where you make an initial request
  143945. // and the request times out. If you make the request again with the
  143946. // same request ID, the server can check if original operation with the
  143947. // same request ID was received, and if so, will ignore the second
  143948. // request. This prevents clients from accidentally creating duplicate
  143949. // commitments.
  143950. //
  143951. // The request ID must be a valid UUID with the exception that zero UUID
  143952. // is not supported (00000000-0000-0000-0000-000000000000).
  143953. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  143954. c.urlParams_.Set("requestId", requestId)
  143955. return c
  143956. }
  143957. // Fields allows partial responses to be retrieved. See
  143958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143959. // for more information.
  143960. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  143961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143962. return c
  143963. }
  143964. // Context sets the context to be used in this call's Do method. Any
  143965. // pending HTTP request will be aborted if the provided context is
  143966. // canceled.
  143967. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  143968. c.ctx_ = ctx
  143969. return c
  143970. }
  143971. // Header returns an http.Header that can be modified by the caller to
  143972. // add HTTP headers to the request.
  143973. func (c *UrlMapsUpdateCall) Header() http.Header {
  143974. if c.header_ == nil {
  143975. c.header_ = make(http.Header)
  143976. }
  143977. return c.header_
  143978. }
  143979. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  143980. reqHeaders := make(http.Header)
  143981. for k, v := range c.header_ {
  143982. reqHeaders[k] = v
  143983. }
  143984. reqHeaders.Set("User-Agent", c.s.userAgent())
  143985. var body io.Reader = nil
  143986. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  143987. if err != nil {
  143988. return nil, err
  143989. }
  143990. reqHeaders.Set("Content-Type", "application/json")
  143991. c.urlParams_.Set("alt", alt)
  143992. c.urlParams_.Set("prettyPrint", "false")
  143993. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  143994. urls += "?" + c.urlParams_.Encode()
  143995. req, err := http.NewRequest("PUT", urls, body)
  143996. if err != nil {
  143997. return nil, err
  143998. }
  143999. req.Header = reqHeaders
  144000. googleapi.Expand(req.URL, map[string]string{
  144001. "project": c.project,
  144002. "urlMap": c.urlMap,
  144003. })
  144004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144005. }
  144006. // Do executes the "compute.urlMaps.update" call.
  144007. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  144008. // status code is an error. Response headers are in either
  144009. // *Operation.ServerResponse.Header or (if a response was returned at
  144010. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  144011. // to check whether the returned error was because
  144012. // http.StatusNotModified was returned.
  144013. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  144014. gensupport.SetOptions(c.urlParams_, opts...)
  144015. res, err := c.doRequest("json")
  144016. if res != nil && res.StatusCode == http.StatusNotModified {
  144017. if res.Body != nil {
  144018. res.Body.Close()
  144019. }
  144020. return nil, &googleapi.Error{
  144021. Code: res.StatusCode,
  144022. Header: res.Header,
  144023. }
  144024. }
  144025. if err != nil {
  144026. return nil, err
  144027. }
  144028. defer googleapi.CloseBody(res)
  144029. if err := googleapi.CheckResponse(res); err != nil {
  144030. return nil, err
  144031. }
  144032. ret := &Operation{
  144033. ServerResponse: googleapi.ServerResponse{
  144034. Header: res.Header,
  144035. HTTPStatusCode: res.StatusCode,
  144036. },
  144037. }
  144038. target := &ret
  144039. if err := gensupport.DecodeResponse(target, res); err != nil {
  144040. return nil, err
  144041. }
  144042. return ret, nil
  144043. // {
  144044. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  144045. // "httpMethod": "PUT",
  144046. // "id": "compute.urlMaps.update",
  144047. // "parameterOrder": [
  144048. // "project",
  144049. // "urlMap"
  144050. // ],
  144051. // "parameters": {
  144052. // "project": {
  144053. // "description": "Project ID for this request.",
  144054. // "location": "path",
  144055. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144056. // "required": true,
  144057. // "type": "string"
  144058. // },
  144059. // "requestId": {
  144060. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  144061. // "location": "query",
  144062. // "type": "string"
  144063. // },
  144064. // "urlMap": {
  144065. // "description": "Name of the UrlMap resource to update.",
  144066. // "location": "path",
  144067. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  144068. // "required": true,
  144069. // "type": "string"
  144070. // }
  144071. // },
  144072. // "path": "{project}/global/urlMaps/{urlMap}",
  144073. // "request": {
  144074. // "$ref": "UrlMap"
  144075. // },
  144076. // "response": {
  144077. // "$ref": "Operation"
  144078. // },
  144079. // "scopes": [
  144080. // "https://www.googleapis.com/auth/cloud-platform",
  144081. // "https://www.googleapis.com/auth/compute"
  144082. // ]
  144083. // }
  144084. }
  144085. // method id "compute.urlMaps.validate":
  144086. type UrlMapsValidateCall struct {
  144087. s *Service
  144088. project string
  144089. urlMap string
  144090. urlmapsvalidaterequest *UrlMapsValidateRequest
  144091. urlParams_ gensupport.URLParams
  144092. ctx_ context.Context
  144093. header_ http.Header
  144094. }
  144095. // Validate: Runs static validation for the UrlMap. In particular, the
  144096. // tests of the provided UrlMap will be run. Calling this method does
  144097. // NOT create the UrlMap.
  144098. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  144099. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  144100. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  144101. c.project = project
  144102. c.urlMap = urlMap
  144103. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  144104. return c
  144105. }
  144106. // Fields allows partial responses to be retrieved. See
  144107. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  144108. // for more information.
  144109. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  144110. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  144111. return c
  144112. }
  144113. // Context sets the context to be used in this call's Do method. Any
  144114. // pending HTTP request will be aborted if the provided context is
  144115. // canceled.
  144116. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  144117. c.ctx_ = ctx
  144118. return c
  144119. }
  144120. // Header returns an http.Header that can be modified by the caller to
  144121. // add HTTP headers to the request.
  144122. func (c *UrlMapsValidateCall) Header() http.Header {
  144123. if c.header_ == nil {
  144124. c.header_ = make(http.Header)
  144125. }
  144126. return c.header_
  144127. }
  144128. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  144129. reqHeaders := make(http.Header)
  144130. for k, v := range c.header_ {
  144131. reqHeaders[k] = v
  144132. }
  144133. reqHeaders.Set("User-Agent", c.s.userAgent())
  144134. var body io.Reader = nil
  144135. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  144136. if err != nil {
  144137. return nil, err
  144138. }
  144139. reqHeaders.Set("Content-Type", "application/json")
  144140. c.urlParams_.Set("alt", alt)
  144141. c.urlParams_.Set("prettyPrint", "false")
  144142. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  144143. urls += "?" + c.urlParams_.Encode()
  144144. req, err := http.NewRequest("POST", urls, body)
  144145. if err != nil {
  144146. return nil, err
  144147. }
  144148. req.Header = reqHeaders
  144149. googleapi.Expand(req.URL, map[string]string{
  144150. "project": c.project,
  144151. "urlMap": c.urlMap,
  144152. })
  144153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144154. }
  144155. // Do executes the "compute.urlMaps.validate" call.
  144156. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  144157. // non-2xx status code is an error. Response headers are in either
  144158. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  144159. // returned at all) in error.(*googleapi.Error).Header. Use
  144160. // googleapi.IsNotModified to check whether the returned error was
  144161. // because http.StatusNotModified was returned.
  144162. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  144163. gensupport.SetOptions(c.urlParams_, opts...)
  144164. res, err := c.doRequest("json")
  144165. if res != nil && res.StatusCode == http.StatusNotModified {
  144166. if res.Body != nil {
  144167. res.Body.Close()
  144168. }
  144169. return nil, &googleapi.Error{
  144170. Code: res.StatusCode,
  144171. Header: res.Header,
  144172. }
  144173. }
  144174. if err != nil {
  144175. return nil, err
  144176. }
  144177. defer googleapi.CloseBody(res)
  144178. if err := googleapi.CheckResponse(res); err != nil {
  144179. return nil, err
  144180. }
  144181. ret := &UrlMapsValidateResponse{
  144182. ServerResponse: googleapi.ServerResponse{
  144183. Header: res.Header,
  144184. HTTPStatusCode: res.StatusCode,
  144185. },
  144186. }
  144187. target := &ret
  144188. if err := gensupport.DecodeResponse(target, res); err != nil {
  144189. return nil, err
  144190. }
  144191. return ret, nil
  144192. // {
  144193. // "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.",
  144194. // "httpMethod": "POST",
  144195. // "id": "compute.urlMaps.validate",
  144196. // "parameterOrder": [
  144197. // "project",
  144198. // "urlMap"
  144199. // ],
  144200. // "parameters": {
  144201. // "project": {
  144202. // "description": "Project ID for this request.",
  144203. // "location": "path",
  144204. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144205. // "required": true,
  144206. // "type": "string"
  144207. // },
  144208. // "urlMap": {
  144209. // "description": "Name of the UrlMap resource to be validated as.",
  144210. // "location": "path",
  144211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  144212. // "required": true,
  144213. // "type": "string"
  144214. // }
  144215. // },
  144216. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  144217. // "request": {
  144218. // "$ref": "UrlMapsValidateRequest"
  144219. // },
  144220. // "response": {
  144221. // "$ref": "UrlMapsValidateResponse"
  144222. // },
  144223. // "scopes": [
  144224. // "https://www.googleapis.com/auth/cloud-platform",
  144225. // "https://www.googleapis.com/auth/compute"
  144226. // ]
  144227. // }
  144228. }
  144229. // method id "compute.vpnGateways.aggregatedList":
  144230. type VpnGatewaysAggregatedListCall struct {
  144231. s *Service
  144232. project string
  144233. urlParams_ gensupport.URLParams
  144234. ifNoneMatch_ string
  144235. ctx_ context.Context
  144236. header_ http.Header
  144237. }
  144238. // AggregatedList: Retrieves an aggregated list of VPN gateways.
  144239. func (r *VpnGatewaysService) AggregatedList(project string) *VpnGatewaysAggregatedListCall {
  144240. c := &VpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  144241. c.project = project
  144242. return c
  144243. }
  144244. // Filter sets the optional parameter "filter": A filter expression that
  144245. // filters resources listed in the response. The expression must specify
  144246. // the field name, a comparison operator, and the value that you want to
  144247. // use for filtering. The value must be a string, a number, or a
  144248. // boolean. The comparison operator must be either =, !=, >, or <.
  144249. //
  144250. // For example, if you are filtering Compute Engine instances, you can
  144251. // exclude instances named example-instance by specifying name !=
  144252. // example-instance.
  144253. //
  144254. // You can also filter nested fields. For example, you could specify
  144255. // scheduling.automaticRestart = false to include instances only if they
  144256. // are not scheduled for automatic restarts. You can use filtering on
  144257. // nested fields to filter based on resource labels.
  144258. //
  144259. // To filter on multiple expressions, provide each separate expression
  144260. // within parentheses. For example, (scheduling.automaticRestart = true)
  144261. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  144262. // AND expression. However, you can include AND and OR expressions
  144263. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  144264. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  144265. // true).
  144266. func (c *VpnGatewaysAggregatedListCall) Filter(filter string) *VpnGatewaysAggregatedListCall {
  144267. c.urlParams_.Set("filter", filter)
  144268. return c
  144269. }
  144270. // MaxResults sets the optional parameter "maxResults": The maximum
  144271. // number of results per page that should be returned. If the number of
  144272. // available results is larger than maxResults, Compute Engine returns a
  144273. // nextPageToken that can be used to get the next page of results in
  144274. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  144275. // (Default: 500)
  144276. func (c *VpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *VpnGatewaysAggregatedListCall {
  144277. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  144278. return c
  144279. }
  144280. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  144281. // a certain order. By default, results are returned in alphanumerical
  144282. // order based on the resource name.
  144283. //
  144284. // You can also sort results in descending order based on the creation
  144285. // timestamp using orderBy="creationTimestamp desc". This sorts results
  144286. // based on the creationTimestamp field in reverse chronological order
  144287. // (newest result first). Use this to sort resources like operations so
  144288. // that the newest operation is returned first.
  144289. //
  144290. // Currently, only sorting by name or creationTimestamp desc is
  144291. // supported.
  144292. func (c *VpnGatewaysAggregatedListCall) OrderBy(orderBy string) *VpnGatewaysAggregatedListCall {
  144293. c.urlParams_.Set("orderBy", orderBy)
  144294. return c
  144295. }
  144296. // PageToken sets the optional parameter "pageToken": Specifies a page
  144297. // token to use. Set pageToken to the nextPageToken returned by a
  144298. // previous list request to get the next page of results.
  144299. func (c *VpnGatewaysAggregatedListCall) PageToken(pageToken string) *VpnGatewaysAggregatedListCall {
  144300. c.urlParams_.Set("pageToken", pageToken)
  144301. return c
  144302. }
  144303. // Fields allows partial responses to be retrieved. See
  144304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  144305. // for more information.
  144306. func (c *VpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *VpnGatewaysAggregatedListCall {
  144307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  144308. return c
  144309. }
  144310. // IfNoneMatch sets the optional parameter which makes the operation
  144311. // fail if the object's ETag matches the given value. This is useful for
  144312. // getting updates only after the object has changed since the last
  144313. // request. Use googleapi.IsNotModified to check whether the response
  144314. // error from Do is the result of In-None-Match.
  144315. func (c *VpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *VpnGatewaysAggregatedListCall {
  144316. c.ifNoneMatch_ = entityTag
  144317. return c
  144318. }
  144319. // Context sets the context to be used in this call's Do method. Any
  144320. // pending HTTP request will be aborted if the provided context is
  144321. // canceled.
  144322. func (c *VpnGatewaysAggregatedListCall) Context(ctx context.Context) *VpnGatewaysAggregatedListCall {
  144323. c.ctx_ = ctx
  144324. return c
  144325. }
  144326. // Header returns an http.Header that can be modified by the caller to
  144327. // add HTTP headers to the request.
  144328. func (c *VpnGatewaysAggregatedListCall) Header() http.Header {
  144329. if c.header_ == nil {
  144330. c.header_ = make(http.Header)
  144331. }
  144332. return c.header_
  144333. }
  144334. func (c *VpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  144335. reqHeaders := make(http.Header)
  144336. for k, v := range c.header_ {
  144337. reqHeaders[k] = v
  144338. }
  144339. reqHeaders.Set("User-Agent", c.s.userAgent())
  144340. if c.ifNoneMatch_ != "" {
  144341. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  144342. }
  144343. var body io.Reader = nil
  144344. c.urlParams_.Set("alt", alt)
  144345. c.urlParams_.Set("prettyPrint", "false")
  144346. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnGateways")
  144347. urls += "?" + c.urlParams_.Encode()
  144348. req, err := http.NewRequest("GET", urls, body)
  144349. if err != nil {
  144350. return nil, err
  144351. }
  144352. req.Header = reqHeaders
  144353. googleapi.Expand(req.URL, map[string]string{
  144354. "project": c.project,
  144355. })
  144356. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144357. }
  144358. // Do executes the "compute.vpnGateways.aggregatedList" call.
  144359. // Exactly one of *VpnGatewayAggregatedList or error will be non-nil.
  144360. // Any non-2xx status code is an error. Response headers are in either
  144361. // *VpnGatewayAggregatedList.ServerResponse.Header or (if a response was
  144362. // returned at all) in error.(*googleapi.Error).Header. Use
  144363. // googleapi.IsNotModified to check whether the returned error was
  144364. // because http.StatusNotModified was returned.
  144365. func (c *VpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayAggregatedList, error) {
  144366. gensupport.SetOptions(c.urlParams_, opts...)
  144367. res, err := c.doRequest("json")
  144368. if res != nil && res.StatusCode == http.StatusNotModified {
  144369. if res.Body != nil {
  144370. res.Body.Close()
  144371. }
  144372. return nil, &googleapi.Error{
  144373. Code: res.StatusCode,
  144374. Header: res.Header,
  144375. }
  144376. }
  144377. if err != nil {
  144378. return nil, err
  144379. }
  144380. defer googleapi.CloseBody(res)
  144381. if err := googleapi.CheckResponse(res); err != nil {
  144382. return nil, err
  144383. }
  144384. ret := &VpnGatewayAggregatedList{
  144385. ServerResponse: googleapi.ServerResponse{
  144386. Header: res.Header,
  144387. HTTPStatusCode: res.StatusCode,
  144388. },
  144389. }
  144390. target := &ret
  144391. if err := gensupport.DecodeResponse(target, res); err != nil {
  144392. return nil, err
  144393. }
  144394. return ret, nil
  144395. // {
  144396. // "description": "Retrieves an aggregated list of VPN gateways.",
  144397. // "httpMethod": "GET",
  144398. // "id": "compute.vpnGateways.aggregatedList",
  144399. // "parameterOrder": [
  144400. // "project"
  144401. // ],
  144402. // "parameters": {
  144403. // "filter": {
  144404. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  144405. // "location": "query",
  144406. // "type": "string"
  144407. // },
  144408. // "maxResults": {
  144409. // "default": "500",
  144410. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  144411. // "format": "uint32",
  144412. // "location": "query",
  144413. // "minimum": "0",
  144414. // "type": "integer"
  144415. // },
  144416. // "orderBy": {
  144417. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  144418. // "location": "query",
  144419. // "type": "string"
  144420. // },
  144421. // "pageToken": {
  144422. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  144423. // "location": "query",
  144424. // "type": "string"
  144425. // },
  144426. // "project": {
  144427. // "description": "Project ID for this request.",
  144428. // "location": "path",
  144429. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144430. // "required": true,
  144431. // "type": "string"
  144432. // }
  144433. // },
  144434. // "path": "{project}/aggregated/vpnGateways",
  144435. // "response": {
  144436. // "$ref": "VpnGatewayAggregatedList"
  144437. // },
  144438. // "scopes": [
  144439. // "https://www.googleapis.com/auth/cloud-platform",
  144440. // "https://www.googleapis.com/auth/compute",
  144441. // "https://www.googleapis.com/auth/compute.readonly"
  144442. // ]
  144443. // }
  144444. }
  144445. // Pages invokes f for each page of results.
  144446. // A non-nil error returned from f will halt the iteration.
  144447. // The provided context supersedes any context provided to the Context method.
  144448. func (c *VpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*VpnGatewayAggregatedList) error) error {
  144449. c.ctx_ = ctx
  144450. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  144451. for {
  144452. x, err := c.Do()
  144453. if err != nil {
  144454. return err
  144455. }
  144456. if err := f(x); err != nil {
  144457. return err
  144458. }
  144459. if x.NextPageToken == "" {
  144460. return nil
  144461. }
  144462. c.PageToken(x.NextPageToken)
  144463. }
  144464. }
  144465. // method id "compute.vpnGateways.delete":
  144466. type VpnGatewaysDeleteCall struct {
  144467. s *Service
  144468. project string
  144469. region string
  144470. vpnGateway string
  144471. urlParams_ gensupport.URLParams
  144472. ctx_ context.Context
  144473. header_ http.Header
  144474. }
  144475. // Delete: Deletes the specified VPN gateway.
  144476. func (r *VpnGatewaysService) Delete(project string, region string, vpnGateway string) *VpnGatewaysDeleteCall {
  144477. c := &VpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  144478. c.project = project
  144479. c.region = region
  144480. c.vpnGateway = vpnGateway
  144481. return c
  144482. }
  144483. // RequestId sets the optional parameter "requestId": An optional
  144484. // request ID to identify requests. Specify a unique request ID so that
  144485. // if you must retry your request, the server will know to ignore the
  144486. // request if it has already been completed.
  144487. //
  144488. // For example, consider a situation where you make an initial request
  144489. // and the request times out. If you make the request again with the
  144490. // same request ID, the server can check if original operation with the
  144491. // same request ID was received, and if so, will ignore the second
  144492. // request. This prevents clients from accidentally creating duplicate
  144493. // commitments.
  144494. //
  144495. // The request ID must be a valid UUID with the exception that zero UUID
  144496. // is not supported (00000000-0000-0000-0000-000000000000).
  144497. func (c *VpnGatewaysDeleteCall) RequestId(requestId string) *VpnGatewaysDeleteCall {
  144498. c.urlParams_.Set("requestId", requestId)
  144499. return c
  144500. }
  144501. // Fields allows partial responses to be retrieved. See
  144502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  144503. // for more information.
  144504. func (c *VpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *VpnGatewaysDeleteCall {
  144505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  144506. return c
  144507. }
  144508. // Context sets the context to be used in this call's Do method. Any
  144509. // pending HTTP request will be aborted if the provided context is
  144510. // canceled.
  144511. func (c *VpnGatewaysDeleteCall) Context(ctx context.Context) *VpnGatewaysDeleteCall {
  144512. c.ctx_ = ctx
  144513. return c
  144514. }
  144515. // Header returns an http.Header that can be modified by the caller to
  144516. // add HTTP headers to the request.
  144517. func (c *VpnGatewaysDeleteCall) Header() http.Header {
  144518. if c.header_ == nil {
  144519. c.header_ = make(http.Header)
  144520. }
  144521. return c.header_
  144522. }
  144523. func (c *VpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  144524. reqHeaders := make(http.Header)
  144525. for k, v := range c.header_ {
  144526. reqHeaders[k] = v
  144527. }
  144528. reqHeaders.Set("User-Agent", c.s.userAgent())
  144529. var body io.Reader = nil
  144530. c.urlParams_.Set("alt", alt)
  144531. c.urlParams_.Set("prettyPrint", "false")
  144532. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}")
  144533. urls += "?" + c.urlParams_.Encode()
  144534. req, err := http.NewRequest("DELETE", urls, body)
  144535. if err != nil {
  144536. return nil, err
  144537. }
  144538. req.Header = reqHeaders
  144539. googleapi.Expand(req.URL, map[string]string{
  144540. "project": c.project,
  144541. "region": c.region,
  144542. "vpnGateway": c.vpnGateway,
  144543. })
  144544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144545. }
  144546. // Do executes the "compute.vpnGateways.delete" call.
  144547. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  144548. // status code is an error. Response headers are in either
  144549. // *Operation.ServerResponse.Header or (if a response was returned at
  144550. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  144551. // to check whether the returned error was because
  144552. // http.StatusNotModified was returned.
  144553. func (c *VpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  144554. gensupport.SetOptions(c.urlParams_, opts...)
  144555. res, err := c.doRequest("json")
  144556. if res != nil && res.StatusCode == http.StatusNotModified {
  144557. if res.Body != nil {
  144558. res.Body.Close()
  144559. }
  144560. return nil, &googleapi.Error{
  144561. Code: res.StatusCode,
  144562. Header: res.Header,
  144563. }
  144564. }
  144565. if err != nil {
  144566. return nil, err
  144567. }
  144568. defer googleapi.CloseBody(res)
  144569. if err := googleapi.CheckResponse(res); err != nil {
  144570. return nil, err
  144571. }
  144572. ret := &Operation{
  144573. ServerResponse: googleapi.ServerResponse{
  144574. Header: res.Header,
  144575. HTTPStatusCode: res.StatusCode,
  144576. },
  144577. }
  144578. target := &ret
  144579. if err := gensupport.DecodeResponse(target, res); err != nil {
  144580. return nil, err
  144581. }
  144582. return ret, nil
  144583. // {
  144584. // "description": "Deletes the specified VPN gateway.",
  144585. // "httpMethod": "DELETE",
  144586. // "id": "compute.vpnGateways.delete",
  144587. // "parameterOrder": [
  144588. // "project",
  144589. // "region",
  144590. // "vpnGateway"
  144591. // ],
  144592. // "parameters": {
  144593. // "project": {
  144594. // "description": "Project ID for this request.",
  144595. // "location": "path",
  144596. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144597. // "required": true,
  144598. // "type": "string"
  144599. // },
  144600. // "region": {
  144601. // "description": "Name of the region for this request.",
  144602. // "location": "path",
  144603. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  144604. // "required": true,
  144605. // "type": "string"
  144606. // },
  144607. // "requestId": {
  144608. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  144609. // "location": "query",
  144610. // "type": "string"
  144611. // },
  144612. // "vpnGateway": {
  144613. // "description": "Name of the VPN gateway to delete.",
  144614. // "location": "path",
  144615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  144616. // "required": true,
  144617. // "type": "string"
  144618. // }
  144619. // },
  144620. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}",
  144621. // "response": {
  144622. // "$ref": "Operation"
  144623. // },
  144624. // "scopes": [
  144625. // "https://www.googleapis.com/auth/cloud-platform",
  144626. // "https://www.googleapis.com/auth/compute"
  144627. // ]
  144628. // }
  144629. }
  144630. // method id "compute.vpnGateways.get":
  144631. type VpnGatewaysGetCall struct {
  144632. s *Service
  144633. project string
  144634. region string
  144635. vpnGateway string
  144636. urlParams_ gensupport.URLParams
  144637. ifNoneMatch_ string
  144638. ctx_ context.Context
  144639. header_ http.Header
  144640. }
  144641. // Get: Returns the specified VPN gateway. Gets a list of available VPN
  144642. // gateways by making a list() request.
  144643. func (r *VpnGatewaysService) Get(project string, region string, vpnGateway string) *VpnGatewaysGetCall {
  144644. c := &VpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  144645. c.project = project
  144646. c.region = region
  144647. c.vpnGateway = vpnGateway
  144648. return c
  144649. }
  144650. // Fields allows partial responses to be retrieved. See
  144651. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  144652. // for more information.
  144653. func (c *VpnGatewaysGetCall) Fields(s ...googleapi.Field) *VpnGatewaysGetCall {
  144654. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  144655. return c
  144656. }
  144657. // IfNoneMatch sets the optional parameter which makes the operation
  144658. // fail if the object's ETag matches the given value. This is useful for
  144659. // getting updates only after the object has changed since the last
  144660. // request. Use googleapi.IsNotModified to check whether the response
  144661. // error from Do is the result of In-None-Match.
  144662. func (c *VpnGatewaysGetCall) IfNoneMatch(entityTag string) *VpnGatewaysGetCall {
  144663. c.ifNoneMatch_ = entityTag
  144664. return c
  144665. }
  144666. // Context sets the context to be used in this call's Do method. Any
  144667. // pending HTTP request will be aborted if the provided context is
  144668. // canceled.
  144669. func (c *VpnGatewaysGetCall) Context(ctx context.Context) *VpnGatewaysGetCall {
  144670. c.ctx_ = ctx
  144671. return c
  144672. }
  144673. // Header returns an http.Header that can be modified by the caller to
  144674. // add HTTP headers to the request.
  144675. func (c *VpnGatewaysGetCall) Header() http.Header {
  144676. if c.header_ == nil {
  144677. c.header_ = make(http.Header)
  144678. }
  144679. return c.header_
  144680. }
  144681. func (c *VpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  144682. reqHeaders := make(http.Header)
  144683. for k, v := range c.header_ {
  144684. reqHeaders[k] = v
  144685. }
  144686. reqHeaders.Set("User-Agent", c.s.userAgent())
  144687. if c.ifNoneMatch_ != "" {
  144688. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  144689. }
  144690. var body io.Reader = nil
  144691. c.urlParams_.Set("alt", alt)
  144692. c.urlParams_.Set("prettyPrint", "false")
  144693. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}")
  144694. urls += "?" + c.urlParams_.Encode()
  144695. req, err := http.NewRequest("GET", urls, body)
  144696. if err != nil {
  144697. return nil, err
  144698. }
  144699. req.Header = reqHeaders
  144700. googleapi.Expand(req.URL, map[string]string{
  144701. "project": c.project,
  144702. "region": c.region,
  144703. "vpnGateway": c.vpnGateway,
  144704. })
  144705. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144706. }
  144707. // Do executes the "compute.vpnGateways.get" call.
  144708. // Exactly one of *VpnGateway or error will be non-nil. Any non-2xx
  144709. // status code is an error. Response headers are in either
  144710. // *VpnGateway.ServerResponse.Header or (if a response was returned at
  144711. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  144712. // to check whether the returned error was because
  144713. // http.StatusNotModified was returned.
  144714. func (c *VpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*VpnGateway, error) {
  144715. gensupport.SetOptions(c.urlParams_, opts...)
  144716. res, err := c.doRequest("json")
  144717. if res != nil && res.StatusCode == http.StatusNotModified {
  144718. if res.Body != nil {
  144719. res.Body.Close()
  144720. }
  144721. return nil, &googleapi.Error{
  144722. Code: res.StatusCode,
  144723. Header: res.Header,
  144724. }
  144725. }
  144726. if err != nil {
  144727. return nil, err
  144728. }
  144729. defer googleapi.CloseBody(res)
  144730. if err := googleapi.CheckResponse(res); err != nil {
  144731. return nil, err
  144732. }
  144733. ret := &VpnGateway{
  144734. ServerResponse: googleapi.ServerResponse{
  144735. Header: res.Header,
  144736. HTTPStatusCode: res.StatusCode,
  144737. },
  144738. }
  144739. target := &ret
  144740. if err := gensupport.DecodeResponse(target, res); err != nil {
  144741. return nil, err
  144742. }
  144743. return ret, nil
  144744. // {
  144745. // "description": "Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request.",
  144746. // "httpMethod": "GET",
  144747. // "id": "compute.vpnGateways.get",
  144748. // "parameterOrder": [
  144749. // "project",
  144750. // "region",
  144751. // "vpnGateway"
  144752. // ],
  144753. // "parameters": {
  144754. // "project": {
  144755. // "description": "Project ID for this request.",
  144756. // "location": "path",
  144757. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144758. // "required": true,
  144759. // "type": "string"
  144760. // },
  144761. // "region": {
  144762. // "description": "Name of the region for this request.",
  144763. // "location": "path",
  144764. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  144765. // "required": true,
  144766. // "type": "string"
  144767. // },
  144768. // "vpnGateway": {
  144769. // "description": "Name of the VPN gateway to return.",
  144770. // "location": "path",
  144771. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  144772. // "required": true,
  144773. // "type": "string"
  144774. // }
  144775. // },
  144776. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}",
  144777. // "response": {
  144778. // "$ref": "VpnGateway"
  144779. // },
  144780. // "scopes": [
  144781. // "https://www.googleapis.com/auth/cloud-platform",
  144782. // "https://www.googleapis.com/auth/compute",
  144783. // "https://www.googleapis.com/auth/compute.readonly"
  144784. // ]
  144785. // }
  144786. }
  144787. // method id "compute.vpnGateways.getStatus":
  144788. type VpnGatewaysGetStatusCall struct {
  144789. s *Service
  144790. project string
  144791. region string
  144792. vpnGateway string
  144793. urlParams_ gensupport.URLParams
  144794. ifNoneMatch_ string
  144795. ctx_ context.Context
  144796. header_ http.Header
  144797. }
  144798. // GetStatus: Returns the status for the specified VPN gateway.
  144799. func (r *VpnGatewaysService) GetStatus(project string, region string, vpnGateway string) *VpnGatewaysGetStatusCall {
  144800. c := &VpnGatewaysGetStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  144801. c.project = project
  144802. c.region = region
  144803. c.vpnGateway = vpnGateway
  144804. return c
  144805. }
  144806. // Fields allows partial responses to be retrieved. See
  144807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  144808. // for more information.
  144809. func (c *VpnGatewaysGetStatusCall) Fields(s ...googleapi.Field) *VpnGatewaysGetStatusCall {
  144810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  144811. return c
  144812. }
  144813. // IfNoneMatch sets the optional parameter which makes the operation
  144814. // fail if the object's ETag matches the given value. This is useful for
  144815. // getting updates only after the object has changed since the last
  144816. // request. Use googleapi.IsNotModified to check whether the response
  144817. // error from Do is the result of In-None-Match.
  144818. func (c *VpnGatewaysGetStatusCall) IfNoneMatch(entityTag string) *VpnGatewaysGetStatusCall {
  144819. c.ifNoneMatch_ = entityTag
  144820. return c
  144821. }
  144822. // Context sets the context to be used in this call's Do method. Any
  144823. // pending HTTP request will be aborted if the provided context is
  144824. // canceled.
  144825. func (c *VpnGatewaysGetStatusCall) Context(ctx context.Context) *VpnGatewaysGetStatusCall {
  144826. c.ctx_ = ctx
  144827. return c
  144828. }
  144829. // Header returns an http.Header that can be modified by the caller to
  144830. // add HTTP headers to the request.
  144831. func (c *VpnGatewaysGetStatusCall) Header() http.Header {
  144832. if c.header_ == nil {
  144833. c.header_ = make(http.Header)
  144834. }
  144835. return c.header_
  144836. }
  144837. func (c *VpnGatewaysGetStatusCall) doRequest(alt string) (*http.Response, error) {
  144838. reqHeaders := make(http.Header)
  144839. for k, v := range c.header_ {
  144840. reqHeaders[k] = v
  144841. }
  144842. reqHeaders.Set("User-Agent", c.s.userAgent())
  144843. if c.ifNoneMatch_ != "" {
  144844. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  144845. }
  144846. var body io.Reader = nil
  144847. c.urlParams_.Set("alt", alt)
  144848. c.urlParams_.Set("prettyPrint", "false")
  144849. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}/getStatus")
  144850. urls += "?" + c.urlParams_.Encode()
  144851. req, err := http.NewRequest("GET", urls, body)
  144852. if err != nil {
  144853. return nil, err
  144854. }
  144855. req.Header = reqHeaders
  144856. googleapi.Expand(req.URL, map[string]string{
  144857. "project": c.project,
  144858. "region": c.region,
  144859. "vpnGateway": c.vpnGateway,
  144860. })
  144861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144862. }
  144863. // Do executes the "compute.vpnGateways.getStatus" call.
  144864. // Exactly one of *VpnGatewaysGetStatusResponse or error will be
  144865. // non-nil. Any non-2xx status code is an error. Response headers are in
  144866. // either *VpnGatewaysGetStatusResponse.ServerResponse.Header or (if a
  144867. // response was returned at all) in error.(*googleapi.Error).Header. Use
  144868. // googleapi.IsNotModified to check whether the returned error was
  144869. // because http.StatusNotModified was returned.
  144870. func (c *VpnGatewaysGetStatusCall) Do(opts ...googleapi.CallOption) (*VpnGatewaysGetStatusResponse, error) {
  144871. gensupport.SetOptions(c.urlParams_, opts...)
  144872. res, err := c.doRequest("json")
  144873. if res != nil && res.StatusCode == http.StatusNotModified {
  144874. if res.Body != nil {
  144875. res.Body.Close()
  144876. }
  144877. return nil, &googleapi.Error{
  144878. Code: res.StatusCode,
  144879. Header: res.Header,
  144880. }
  144881. }
  144882. if err != nil {
  144883. return nil, err
  144884. }
  144885. defer googleapi.CloseBody(res)
  144886. if err := googleapi.CheckResponse(res); err != nil {
  144887. return nil, err
  144888. }
  144889. ret := &VpnGatewaysGetStatusResponse{
  144890. ServerResponse: googleapi.ServerResponse{
  144891. Header: res.Header,
  144892. HTTPStatusCode: res.StatusCode,
  144893. },
  144894. }
  144895. target := &ret
  144896. if err := gensupport.DecodeResponse(target, res); err != nil {
  144897. return nil, err
  144898. }
  144899. return ret, nil
  144900. // {
  144901. // "description": "Returns the status for the specified VPN gateway.",
  144902. // "httpMethod": "GET",
  144903. // "id": "compute.vpnGateways.getStatus",
  144904. // "parameterOrder": [
  144905. // "project",
  144906. // "region",
  144907. // "vpnGateway"
  144908. // ],
  144909. // "parameters": {
  144910. // "project": {
  144911. // "description": "Project ID for this request.",
  144912. // "location": "path",
  144913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144914. // "required": true,
  144915. // "type": "string"
  144916. // },
  144917. // "region": {
  144918. // "description": "Name of the region for this request.",
  144919. // "location": "path",
  144920. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  144921. // "required": true,
  144922. // "type": "string"
  144923. // },
  144924. // "vpnGateway": {
  144925. // "description": "Name of the VPN gateway to return.",
  144926. // "location": "path",
  144927. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  144928. // "required": true,
  144929. // "type": "string"
  144930. // }
  144931. // },
  144932. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}/getStatus",
  144933. // "response": {
  144934. // "$ref": "VpnGatewaysGetStatusResponse"
  144935. // },
  144936. // "scopes": [
  144937. // "https://www.googleapis.com/auth/cloud-platform",
  144938. // "https://www.googleapis.com/auth/compute",
  144939. // "https://www.googleapis.com/auth/compute.readonly"
  144940. // ]
  144941. // }
  144942. }
  144943. // method id "compute.vpnGateways.insert":
  144944. type VpnGatewaysInsertCall struct {
  144945. s *Service
  144946. project string
  144947. region string
  144948. vpngateway *VpnGateway
  144949. urlParams_ gensupport.URLParams
  144950. ctx_ context.Context
  144951. header_ http.Header
  144952. }
  144953. // Insert: Creates a VPN gateway in the specified project and region
  144954. // using the data included in the request.
  144955. func (r *VpnGatewaysService) Insert(project string, region string, vpngateway *VpnGateway) *VpnGatewaysInsertCall {
  144956. c := &VpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  144957. c.project = project
  144958. c.region = region
  144959. c.vpngateway = vpngateway
  144960. return c
  144961. }
  144962. // RequestId sets the optional parameter "requestId": An optional
  144963. // request ID to identify requests. Specify a unique request ID so that
  144964. // if you must retry your request, the server will know to ignore the
  144965. // request if it has already been completed.
  144966. //
  144967. // For example, consider a situation where you make an initial request
  144968. // and the request times out. If you make the request again with the
  144969. // same request ID, the server can check if original operation with the
  144970. // same request ID was received, and if so, will ignore the second
  144971. // request. This prevents clients from accidentally creating duplicate
  144972. // commitments.
  144973. //
  144974. // The request ID must be a valid UUID with the exception that zero UUID
  144975. // is not supported (00000000-0000-0000-0000-000000000000).
  144976. func (c *VpnGatewaysInsertCall) RequestId(requestId string) *VpnGatewaysInsertCall {
  144977. c.urlParams_.Set("requestId", requestId)
  144978. return c
  144979. }
  144980. // Fields allows partial responses to be retrieved. See
  144981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  144982. // for more information.
  144983. func (c *VpnGatewaysInsertCall) Fields(s ...googleapi.Field) *VpnGatewaysInsertCall {
  144984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  144985. return c
  144986. }
  144987. // Context sets the context to be used in this call's Do method. Any
  144988. // pending HTTP request will be aborted if the provided context is
  144989. // canceled.
  144990. func (c *VpnGatewaysInsertCall) Context(ctx context.Context) *VpnGatewaysInsertCall {
  144991. c.ctx_ = ctx
  144992. return c
  144993. }
  144994. // Header returns an http.Header that can be modified by the caller to
  144995. // add HTTP headers to the request.
  144996. func (c *VpnGatewaysInsertCall) Header() http.Header {
  144997. if c.header_ == nil {
  144998. c.header_ = make(http.Header)
  144999. }
  145000. return c.header_
  145001. }
  145002. func (c *VpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  145003. reqHeaders := make(http.Header)
  145004. for k, v := range c.header_ {
  145005. reqHeaders[k] = v
  145006. }
  145007. reqHeaders.Set("User-Agent", c.s.userAgent())
  145008. var body io.Reader = nil
  145009. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpngateway)
  145010. if err != nil {
  145011. return nil, err
  145012. }
  145013. reqHeaders.Set("Content-Type", "application/json")
  145014. c.urlParams_.Set("alt", alt)
  145015. c.urlParams_.Set("prettyPrint", "false")
  145016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways")
  145017. urls += "?" + c.urlParams_.Encode()
  145018. req, err := http.NewRequest("POST", urls, body)
  145019. if err != nil {
  145020. return nil, err
  145021. }
  145022. req.Header = reqHeaders
  145023. googleapi.Expand(req.URL, map[string]string{
  145024. "project": c.project,
  145025. "region": c.region,
  145026. })
  145027. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  145028. }
  145029. // Do executes the "compute.vpnGateways.insert" call.
  145030. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  145031. // status code is an error. Response headers are in either
  145032. // *Operation.ServerResponse.Header or (if a response was returned at
  145033. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  145034. // to check whether the returned error was because
  145035. // http.StatusNotModified was returned.
  145036. func (c *VpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  145037. gensupport.SetOptions(c.urlParams_, opts...)
  145038. res, err := c.doRequest("json")
  145039. if res != nil && res.StatusCode == http.StatusNotModified {
  145040. if res.Body != nil {
  145041. res.Body.Close()
  145042. }
  145043. return nil, &googleapi.Error{
  145044. Code: res.StatusCode,
  145045. Header: res.Header,
  145046. }
  145047. }
  145048. if err != nil {
  145049. return nil, err
  145050. }
  145051. defer googleapi.CloseBody(res)
  145052. if err := googleapi.CheckResponse(res); err != nil {
  145053. return nil, err
  145054. }
  145055. ret := &Operation{
  145056. ServerResponse: googleapi.ServerResponse{
  145057. Header: res.Header,
  145058. HTTPStatusCode: res.StatusCode,
  145059. },
  145060. }
  145061. target := &ret
  145062. if err := gensupport.DecodeResponse(target, res); err != nil {
  145063. return nil, err
  145064. }
  145065. return ret, nil
  145066. // {
  145067. // "description": "Creates a VPN gateway in the specified project and region using the data included in the request.",
  145068. // "httpMethod": "POST",
  145069. // "id": "compute.vpnGateways.insert",
  145070. // "parameterOrder": [
  145071. // "project",
  145072. // "region"
  145073. // ],
  145074. // "parameters": {
  145075. // "project": {
  145076. // "description": "Project ID for this request.",
  145077. // "location": "path",
  145078. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  145079. // "required": true,
  145080. // "type": "string"
  145081. // },
  145082. // "region": {
  145083. // "description": "Name of the region for this request.",
  145084. // "location": "path",
  145085. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  145086. // "required": true,
  145087. // "type": "string"
  145088. // },
  145089. // "requestId": {
  145090. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  145091. // "location": "query",
  145092. // "type": "string"
  145093. // }
  145094. // },
  145095. // "path": "{project}/regions/{region}/vpnGateways",
  145096. // "request": {
  145097. // "$ref": "VpnGateway"
  145098. // },
  145099. // "response": {
  145100. // "$ref": "Operation"
  145101. // },
  145102. // "scopes": [
  145103. // "https://www.googleapis.com/auth/cloud-platform",
  145104. // "https://www.googleapis.com/auth/compute"
  145105. // ]
  145106. // }
  145107. }
  145108. // method id "compute.vpnGateways.list":
  145109. type VpnGatewaysListCall struct {
  145110. s *Service
  145111. project string
  145112. region string
  145113. urlParams_ gensupport.URLParams
  145114. ifNoneMatch_ string
  145115. ctx_ context.Context
  145116. header_ http.Header
  145117. }
  145118. // List: Retrieves a list of VPN gateways available to the specified
  145119. // project and region.
  145120. func (r *VpnGatewaysService) List(project string, region string) *VpnGatewaysListCall {
  145121. c := &VpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  145122. c.project = project
  145123. c.region = region
  145124. return c
  145125. }
  145126. // Filter sets the optional parameter "filter": A filter expression that
  145127. // filters resources listed in the response. The expression must specify
  145128. // the field name, a comparison operator, and the value that you want to
  145129. // use for filtering. The value must be a string, a number, or a
  145130. // boolean. The comparison operator must be either =, !=, >, or <.
  145131. //
  145132. // For example, if you are filtering Compute Engine instances, you can
  145133. // exclude instances named example-instance by specifying name !=
  145134. // example-instance.
  145135. //
  145136. // You can also filter nested fields. For example, you could specify
  145137. // scheduling.automaticRestart = false to include instances only if they
  145138. // are not scheduled for automatic restarts. You can use filtering on
  145139. // nested fields to filter based on resource labels.
  145140. //
  145141. // To filter on multiple expressions, provide each separate expression
  145142. // within parentheses. For example, (scheduling.automaticRestart = true)
  145143. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  145144. // AND expression. However, you can include AND and OR expressions
  145145. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  145146. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  145147. // true).
  145148. func (c *VpnGatewaysListCall) Filter(filter string) *VpnGatewaysListCall {
  145149. c.urlParams_.Set("filter", filter)
  145150. return c
  145151. }
  145152. // MaxResults sets the optional parameter "maxResults": The maximum
  145153. // number of results per page that should be returned. If the number of
  145154. // available results is larger than maxResults, Compute Engine returns a
  145155. // nextPageToken that can be used to get the next page of results in
  145156. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  145157. // (Default: 500)
  145158. func (c *VpnGatewaysListCall) MaxResults(maxResults int64) *VpnGatewaysListCall {
  145159. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  145160. return c
  145161. }
  145162. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  145163. // a certain order. By default, results are returned in alphanumerical
  145164. // order based on the resource name.
  145165. //
  145166. // You can also sort results in descending order based on the creation
  145167. // timestamp using orderBy="creationTimestamp desc". This sorts results
  145168. // based on the creationTimestamp field in reverse chronological order
  145169. // (newest result first). Use this to sort resources like operations so
  145170. // that the newest operation is returned first.
  145171. //
  145172. // Currently, only sorting by name or creationTimestamp desc is
  145173. // supported.
  145174. func (c *VpnGatewaysListCall) OrderBy(orderBy string) *VpnGatewaysListCall {
  145175. c.urlParams_.Set("orderBy", orderBy)
  145176. return c
  145177. }
  145178. // PageToken sets the optional parameter "pageToken": Specifies a page
  145179. // token to use. Set pageToken to the nextPageToken returned by a
  145180. // previous list request to get the next page of results.
  145181. func (c *VpnGatewaysListCall) PageToken(pageToken string) *VpnGatewaysListCall {
  145182. c.urlParams_.Set("pageToken", pageToken)
  145183. return c
  145184. }
  145185. // Fields allows partial responses to be retrieved. See
  145186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  145187. // for more information.
  145188. func (c *VpnGatewaysListCall) Fields(s ...googleapi.Field) *VpnGatewaysListCall {
  145189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  145190. return c
  145191. }
  145192. // IfNoneMatch sets the optional parameter which makes the operation
  145193. // fail if the object's ETag matches the given value. This is useful for
  145194. // getting updates only after the object has changed since the last
  145195. // request. Use googleapi.IsNotModified to check whether the response
  145196. // error from Do is the result of In-None-Match.
  145197. func (c *VpnGatewaysListCall) IfNoneMatch(entityTag string) *VpnGatewaysListCall {
  145198. c.ifNoneMatch_ = entityTag
  145199. return c
  145200. }
  145201. // Context sets the context to be used in this call's Do method. Any
  145202. // pending HTTP request will be aborted if the provided context is
  145203. // canceled.
  145204. func (c *VpnGatewaysListCall) Context(ctx context.Context) *VpnGatewaysListCall {
  145205. c.ctx_ = ctx
  145206. return c
  145207. }
  145208. // Header returns an http.Header that can be modified by the caller to
  145209. // add HTTP headers to the request.
  145210. func (c *VpnGatewaysListCall) Header() http.Header {
  145211. if c.header_ == nil {
  145212. c.header_ = make(http.Header)
  145213. }
  145214. return c.header_
  145215. }
  145216. func (c *VpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  145217. reqHeaders := make(http.Header)
  145218. for k, v := range c.header_ {
  145219. reqHeaders[k] = v
  145220. }
  145221. reqHeaders.Set("User-Agent", c.s.userAgent())
  145222. if c.ifNoneMatch_ != "" {
  145223. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  145224. }
  145225. var body io.Reader = nil
  145226. c.urlParams_.Set("alt", alt)
  145227. c.urlParams_.Set("prettyPrint", "false")
  145228. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways")
  145229. urls += "?" + c.urlParams_.Encode()
  145230. req, err := http.NewRequest("GET", urls, body)
  145231. if err != nil {
  145232. return nil, err
  145233. }
  145234. req.Header = reqHeaders
  145235. googleapi.Expand(req.URL, map[string]string{
  145236. "project": c.project,
  145237. "region": c.region,
  145238. })
  145239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  145240. }
  145241. // Do executes the "compute.vpnGateways.list" call.
  145242. // Exactly one of *VpnGatewayList or error will be non-nil. Any non-2xx
  145243. // status code is an error. Response headers are in either
  145244. // *VpnGatewayList.ServerResponse.Header or (if a response was returned
  145245. // at all) in error.(*googleapi.Error).Header. Use
  145246. // googleapi.IsNotModified to check whether the returned error was
  145247. // because http.StatusNotModified was returned.
  145248. func (c *VpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayList, error) {
  145249. gensupport.SetOptions(c.urlParams_, opts...)
  145250. res, err := c.doRequest("json")
  145251. if res != nil && res.StatusCode == http.StatusNotModified {
  145252. if res.Body != nil {
  145253. res.Body.Close()
  145254. }
  145255. return nil, &googleapi.Error{
  145256. Code: res.StatusCode,
  145257. Header: res.Header,
  145258. }
  145259. }
  145260. if err != nil {
  145261. return nil, err
  145262. }
  145263. defer googleapi.CloseBody(res)
  145264. if err := googleapi.CheckResponse(res); err != nil {
  145265. return nil, err
  145266. }
  145267. ret := &VpnGatewayList{
  145268. ServerResponse: googleapi.ServerResponse{
  145269. Header: res.Header,
  145270. HTTPStatusCode: res.StatusCode,
  145271. },
  145272. }
  145273. target := &ret
  145274. if err := gensupport.DecodeResponse(target, res); err != nil {
  145275. return nil, err
  145276. }
  145277. return ret, nil
  145278. // {
  145279. // "description": "Retrieves a list of VPN gateways available to the specified project and region.",
  145280. // "httpMethod": "GET",
  145281. // "id": "compute.vpnGateways.list",
  145282. // "parameterOrder": [
  145283. // "project",
  145284. // "region"
  145285. // ],
  145286. // "parameters": {
  145287. // "filter": {
  145288. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  145289. // "location": "query",
  145290. // "type": "string"
  145291. // },
  145292. // "maxResults": {
  145293. // "default": "500",
  145294. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  145295. // "format": "uint32",
  145296. // "location": "query",
  145297. // "minimum": "0",
  145298. // "type": "integer"
  145299. // },
  145300. // "orderBy": {
  145301. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  145302. // "location": "query",
  145303. // "type": "string"
  145304. // },
  145305. // "pageToken": {
  145306. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  145307. // "location": "query",
  145308. // "type": "string"
  145309. // },
  145310. // "project": {
  145311. // "description": "Project ID for this request.",
  145312. // "location": "path",
  145313. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  145314. // "required": true,
  145315. // "type": "string"
  145316. // },
  145317. // "region": {
  145318. // "description": "Name of the region for this request.",
  145319. // "location": "path",
  145320. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  145321. // "required": true,
  145322. // "type": "string"
  145323. // }
  145324. // },
  145325. // "path": "{project}/regions/{region}/vpnGateways",
  145326. // "response": {
  145327. // "$ref": "VpnGatewayList"
  145328. // },
  145329. // "scopes": [
  145330. // "https://www.googleapis.com/auth/cloud-platform",
  145331. // "https://www.googleapis.com/auth/compute",
  145332. // "https://www.googleapis.com/auth/compute.readonly"
  145333. // ]
  145334. // }
  145335. }
  145336. // Pages invokes f for each page of results.
  145337. // A non-nil error returned from f will halt the iteration.
  145338. // The provided context supersedes any context provided to the Context method.
  145339. func (c *VpnGatewaysListCall) Pages(ctx context.Context, f func(*VpnGatewayList) error) error {
  145340. c.ctx_ = ctx
  145341. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  145342. for {
  145343. x, err := c.Do()
  145344. if err != nil {
  145345. return err
  145346. }
  145347. if err := f(x); err != nil {
  145348. return err
  145349. }
  145350. if x.NextPageToken == "" {
  145351. return nil
  145352. }
  145353. c.PageToken(x.NextPageToken)
  145354. }
  145355. }
  145356. // method id "compute.vpnGateways.setLabels":
  145357. type VpnGatewaysSetLabelsCall struct {
  145358. s *Service
  145359. project string
  145360. region string
  145361. resource string
  145362. regionsetlabelsrequest *RegionSetLabelsRequest
  145363. urlParams_ gensupport.URLParams
  145364. ctx_ context.Context
  145365. header_ http.Header
  145366. }
  145367. // SetLabels: Sets the labels on a VpnGateway. To learn more about
  145368. // labels, read the Labeling Resources documentation.
  145369. func (r *VpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnGatewaysSetLabelsCall {
  145370. c := &VpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  145371. c.project = project
  145372. c.region = region
  145373. c.resource = resource
  145374. c.regionsetlabelsrequest = regionsetlabelsrequest
  145375. return c
  145376. }
  145377. // RequestId sets the optional parameter "requestId": An optional
  145378. // request ID to identify requests. Specify a unique request ID so that
  145379. // if you must retry your request, the server will know to ignore the
  145380. // request if it has already been completed.
  145381. //
  145382. // For example, consider a situation where you make an initial request
  145383. // and the request times out. If you make the request again with the
  145384. // same request ID, the server can check if original operation with the
  145385. // same request ID was received, and if so, will ignore the second
  145386. // request. This prevents clients from accidentally creating duplicate
  145387. // commitments.
  145388. //
  145389. // The request ID must be a valid UUID with the exception that zero UUID
  145390. // is not supported (00000000-0000-0000-0000-000000000000).
  145391. func (c *VpnGatewaysSetLabelsCall) RequestId(requestId string) *VpnGatewaysSetLabelsCall {
  145392. c.urlParams_.Set("requestId", requestId)
  145393. return c
  145394. }
  145395. // Fields allows partial responses to be retrieved. See
  145396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  145397. // for more information.
  145398. func (c *VpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *VpnGatewaysSetLabelsCall {
  145399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  145400. return c
  145401. }
  145402. // Context sets the context to be used in this call's Do method. Any
  145403. // pending HTTP request will be aborted if the provided context is
  145404. // canceled.
  145405. func (c *VpnGatewaysSetLabelsCall) Context(ctx context.Context) *VpnGatewaysSetLabelsCall {
  145406. c.ctx_ = ctx
  145407. return c
  145408. }
  145409. // Header returns an http.Header that can be modified by the caller to
  145410. // add HTTP headers to the request.
  145411. func (c *VpnGatewaysSetLabelsCall) Header() http.Header {
  145412. if c.header_ == nil {
  145413. c.header_ = make(http.Header)
  145414. }
  145415. return c.header_
  145416. }
  145417. func (c *VpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  145418. reqHeaders := make(http.Header)
  145419. for k, v := range c.header_ {
  145420. reqHeaders[k] = v
  145421. }
  145422. reqHeaders.Set("User-Agent", c.s.userAgent())
  145423. var body io.Reader = nil
  145424. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  145425. if err != nil {
  145426. return nil, err
  145427. }
  145428. reqHeaders.Set("Content-Type", "application/json")
  145429. c.urlParams_.Set("alt", alt)
  145430. c.urlParams_.Set("prettyPrint", "false")
  145431. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{resource}/setLabels")
  145432. urls += "?" + c.urlParams_.Encode()
  145433. req, err := http.NewRequest("POST", urls, body)
  145434. if err != nil {
  145435. return nil, err
  145436. }
  145437. req.Header = reqHeaders
  145438. googleapi.Expand(req.URL, map[string]string{
  145439. "project": c.project,
  145440. "region": c.region,
  145441. "resource": c.resource,
  145442. })
  145443. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  145444. }
  145445. // Do executes the "compute.vpnGateways.setLabels" call.
  145446. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  145447. // status code is an error. Response headers are in either
  145448. // *Operation.ServerResponse.Header or (if a response was returned at
  145449. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  145450. // to check whether the returned error was because
  145451. // http.StatusNotModified was returned.
  145452. func (c *VpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  145453. gensupport.SetOptions(c.urlParams_, opts...)
  145454. res, err := c.doRequest("json")
  145455. if res != nil && res.StatusCode == http.StatusNotModified {
  145456. if res.Body != nil {
  145457. res.Body.Close()
  145458. }
  145459. return nil, &googleapi.Error{
  145460. Code: res.StatusCode,
  145461. Header: res.Header,
  145462. }
  145463. }
  145464. if err != nil {
  145465. return nil, err
  145466. }
  145467. defer googleapi.CloseBody(res)
  145468. if err := googleapi.CheckResponse(res); err != nil {
  145469. return nil, err
  145470. }
  145471. ret := &Operation{
  145472. ServerResponse: googleapi.ServerResponse{
  145473. Header: res.Header,
  145474. HTTPStatusCode: res.StatusCode,
  145475. },
  145476. }
  145477. target := &ret
  145478. if err := gensupport.DecodeResponse(target, res); err != nil {
  145479. return nil, err
  145480. }
  145481. return ret, nil
  145482. // {
  145483. // "description": "Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  145484. // "httpMethod": "POST",
  145485. // "id": "compute.vpnGateways.setLabels",
  145486. // "parameterOrder": [
  145487. // "project",
  145488. // "region",
  145489. // "resource"
  145490. // ],
  145491. // "parameters": {
  145492. // "project": {
  145493. // "description": "Project ID for this request.",
  145494. // "location": "path",
  145495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  145496. // "required": true,
  145497. // "type": "string"
  145498. // },
  145499. // "region": {
  145500. // "description": "The region for this request.",
  145501. // "location": "path",
  145502. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  145503. // "required": true,
  145504. // "type": "string"
  145505. // },
  145506. // "requestId": {
  145507. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  145508. // "location": "query",
  145509. // "type": "string"
  145510. // },
  145511. // "resource": {
  145512. // "description": "Name or id of the resource for this request.",
  145513. // "location": "path",
  145514. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  145515. // "required": true,
  145516. // "type": "string"
  145517. // }
  145518. // },
  145519. // "path": "{project}/regions/{region}/vpnGateways/{resource}/setLabels",
  145520. // "request": {
  145521. // "$ref": "RegionSetLabelsRequest"
  145522. // },
  145523. // "response": {
  145524. // "$ref": "Operation"
  145525. // },
  145526. // "scopes": [
  145527. // "https://www.googleapis.com/auth/cloud-platform",
  145528. // "https://www.googleapis.com/auth/compute"
  145529. // ]
  145530. // }
  145531. }
  145532. // method id "compute.vpnGateways.testIamPermissions":
  145533. type VpnGatewaysTestIamPermissionsCall struct {
  145534. s *Service
  145535. project string
  145536. region string
  145537. resource string
  145538. testpermissionsrequest *TestPermissionsRequest
  145539. urlParams_ gensupport.URLParams
  145540. ctx_ context.Context
  145541. header_ http.Header
  145542. }
  145543. // TestIamPermissions: Returns permissions that a caller has on the
  145544. // specified resource.
  145545. func (r *VpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnGatewaysTestIamPermissionsCall {
  145546. c := &VpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  145547. c.project = project
  145548. c.region = region
  145549. c.resource = resource
  145550. c.testpermissionsrequest = testpermissionsrequest
  145551. return c
  145552. }
  145553. // Fields allows partial responses to be retrieved. See
  145554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  145555. // for more information.
  145556. func (c *VpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnGatewaysTestIamPermissionsCall {
  145557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  145558. return c
  145559. }
  145560. // Context sets the context to be used in this call's Do method. Any
  145561. // pending HTTP request will be aborted if the provided context is
  145562. // canceled.
  145563. func (c *VpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *VpnGatewaysTestIamPermissionsCall {
  145564. c.ctx_ = ctx
  145565. return c
  145566. }
  145567. // Header returns an http.Header that can be modified by the caller to
  145568. // add HTTP headers to the request.
  145569. func (c *VpnGatewaysTestIamPermissionsCall) Header() http.Header {
  145570. if c.header_ == nil {
  145571. c.header_ = make(http.Header)
  145572. }
  145573. return c.header_
  145574. }
  145575. func (c *VpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  145576. reqHeaders := make(http.Header)
  145577. for k, v := range c.header_ {
  145578. reqHeaders[k] = v
  145579. }
  145580. reqHeaders.Set("User-Agent", c.s.userAgent())
  145581. var body io.Reader = nil
  145582. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  145583. if err != nil {
  145584. return nil, err
  145585. }
  145586. reqHeaders.Set("Content-Type", "application/json")
  145587. c.urlParams_.Set("alt", alt)
  145588. c.urlParams_.Set("prettyPrint", "false")
  145589. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions")
  145590. urls += "?" + c.urlParams_.Encode()
  145591. req, err := http.NewRequest("POST", urls, body)
  145592. if err != nil {
  145593. return nil, err
  145594. }
  145595. req.Header = reqHeaders
  145596. googleapi.Expand(req.URL, map[string]string{
  145597. "project": c.project,
  145598. "region": c.region,
  145599. "resource": c.resource,
  145600. })
  145601. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  145602. }
  145603. // Do executes the "compute.vpnGateways.testIamPermissions" call.
  145604. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  145605. // non-2xx status code is an error. Response headers are in either
  145606. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  145607. // returned at all) in error.(*googleapi.Error).Header. Use
  145608. // googleapi.IsNotModified to check whether the returned error was
  145609. // because http.StatusNotModified was returned.
  145610. func (c *VpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  145611. gensupport.SetOptions(c.urlParams_, opts...)
  145612. res, err := c.doRequest("json")
  145613. if res != nil && res.StatusCode == http.StatusNotModified {
  145614. if res.Body != nil {
  145615. res.Body.Close()
  145616. }
  145617. return nil, &googleapi.Error{
  145618. Code: res.StatusCode,
  145619. Header: res.Header,
  145620. }
  145621. }
  145622. if err != nil {
  145623. return nil, err
  145624. }
  145625. defer googleapi.CloseBody(res)
  145626. if err := googleapi.CheckResponse(res); err != nil {
  145627. return nil, err
  145628. }
  145629. ret := &TestPermissionsResponse{
  145630. ServerResponse: googleapi.ServerResponse{
  145631. Header: res.Header,
  145632. HTTPStatusCode: res.StatusCode,
  145633. },
  145634. }
  145635. target := &ret
  145636. if err := gensupport.DecodeResponse(target, res); err != nil {
  145637. return nil, err
  145638. }
  145639. return ret, nil
  145640. // {
  145641. // "description": "Returns permissions that a caller has on the specified resource.",
  145642. // "httpMethod": "POST",
  145643. // "id": "compute.vpnGateways.testIamPermissions",
  145644. // "parameterOrder": [
  145645. // "project",
  145646. // "region",
  145647. // "resource"
  145648. // ],
  145649. // "parameters": {
  145650. // "project": {
  145651. // "description": "Project ID for this request.",
  145652. // "location": "path",
  145653. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  145654. // "required": true,
  145655. // "type": "string"
  145656. // },
  145657. // "region": {
  145658. // "description": "The name of the region for this request.",
  145659. // "location": "path",
  145660. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  145661. // "required": true,
  145662. // "type": "string"
  145663. // },
  145664. // "resource": {
  145665. // "description": "Name or id of the resource for this request.",
  145666. // "location": "path",
  145667. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  145668. // "required": true,
  145669. // "type": "string"
  145670. // }
  145671. // },
  145672. // "path": "{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions",
  145673. // "request": {
  145674. // "$ref": "TestPermissionsRequest"
  145675. // },
  145676. // "response": {
  145677. // "$ref": "TestPermissionsResponse"
  145678. // },
  145679. // "scopes": [
  145680. // "https://www.googleapis.com/auth/cloud-platform",
  145681. // "https://www.googleapis.com/auth/compute",
  145682. // "https://www.googleapis.com/auth/compute.readonly"
  145683. // ]
  145684. // }
  145685. }
  145686. // method id "compute.vpnTunnels.aggregatedList":
  145687. type VpnTunnelsAggregatedListCall struct {
  145688. s *Service
  145689. project string
  145690. urlParams_ gensupport.URLParams
  145691. ifNoneMatch_ string
  145692. ctx_ context.Context
  145693. header_ http.Header
  145694. }
  145695. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  145696. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  145697. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  145698. c.project = project
  145699. return c
  145700. }
  145701. // Filter sets the optional parameter "filter": A filter expression that
  145702. // filters resources listed in the response. The expression must specify
  145703. // the field name, a comparison operator, and the value that you want to
  145704. // use for filtering. The value must be a string, a number, or a
  145705. // boolean. The comparison operator must be either =, !=, >, or <.
  145706. //
  145707. // For example, if you are filtering Compute Engine instances, you can
  145708. // exclude instances named example-instance by specifying name !=
  145709. // example-instance.
  145710. //
  145711. // You can also filter nested fields. For example, you could specify
  145712. // scheduling.automaticRestart = false to include instances only if they
  145713. // are not scheduled for automatic restarts. You can use filtering on
  145714. // nested fields to filter based on resource labels.
  145715. //
  145716. // To filter on multiple expressions, provide each separate expression
  145717. // within parentheses. For example, (scheduling.automaticRestart = true)
  145718. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  145719. // AND expression. However, you can include AND and OR expressions
  145720. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  145721. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  145722. // true).
  145723. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  145724. c.urlParams_.Set("filter", filter)
  145725. return c
  145726. }
  145727. // MaxResults sets the optional parameter "maxResults": The maximum
  145728. // number of results per page that should be returned. If the number of
  145729. // available results is larger than maxResults, Compute Engine returns a
  145730. // nextPageToken that can be used to get the next page of results in
  145731. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  145732. // (Default: 500)
  145733. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  145734. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  145735. return c
  145736. }
  145737. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  145738. // a certain order. By default, results are returned in alphanumerical
  145739. // order based on the resource name.
  145740. //
  145741. // You can also sort results in descending order based on the creation
  145742. // timestamp using orderBy="creationTimestamp desc". This sorts results
  145743. // based on the creationTimestamp field in reverse chronological order
  145744. // (newest result first). Use this to sort resources like operations so
  145745. // that the newest operation is returned first.
  145746. //
  145747. // Currently, only sorting by name or creationTimestamp desc is
  145748. // supported.
  145749. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  145750. c.urlParams_.Set("orderBy", orderBy)
  145751. return c
  145752. }
  145753. // PageToken sets the optional parameter "pageToken": Specifies a page
  145754. // token to use. Set pageToken to the nextPageToken returned by a
  145755. // previous list request to get the next page of results.
  145756. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  145757. c.urlParams_.Set("pageToken", pageToken)
  145758. return c
  145759. }
  145760. // Fields allows partial responses to be retrieved. See
  145761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  145762. // for more information.
  145763. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  145764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  145765. return c
  145766. }
  145767. // IfNoneMatch sets the optional parameter which makes the operation
  145768. // fail if the object's ETag matches the given value. This is useful for
  145769. // getting updates only after the object has changed since the last
  145770. // request. Use googleapi.IsNotModified to check whether the response
  145771. // error from Do is the result of In-None-Match.
  145772. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  145773. c.ifNoneMatch_ = entityTag
  145774. return c
  145775. }
  145776. // Context sets the context to be used in this call's Do method. Any
  145777. // pending HTTP request will be aborted if the provided context is
  145778. // canceled.
  145779. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  145780. c.ctx_ = ctx
  145781. return c
  145782. }
  145783. // Header returns an http.Header that can be modified by the caller to
  145784. // add HTTP headers to the request.
  145785. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  145786. if c.header_ == nil {
  145787. c.header_ = make(http.Header)
  145788. }
  145789. return c.header_
  145790. }
  145791. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  145792. reqHeaders := make(http.Header)
  145793. for k, v := range c.header_ {
  145794. reqHeaders[k] = v
  145795. }
  145796. reqHeaders.Set("User-Agent", c.s.userAgent())
  145797. if c.ifNoneMatch_ != "" {
  145798. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  145799. }
  145800. var body io.Reader = nil
  145801. c.urlParams_.Set("alt", alt)
  145802. c.urlParams_.Set("prettyPrint", "false")
  145803. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  145804. urls += "?" + c.urlParams_.Encode()
  145805. req, err := http.NewRequest("GET", urls, body)
  145806. if err != nil {
  145807. return nil, err
  145808. }
  145809. req.Header = reqHeaders
  145810. googleapi.Expand(req.URL, map[string]string{
  145811. "project": c.project,
  145812. })
  145813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  145814. }
  145815. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  145816. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  145817. // non-2xx status code is an error. Response headers are in either
  145818. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  145819. // returned at all) in error.(*googleapi.Error).Header. Use
  145820. // googleapi.IsNotModified to check whether the returned error was
  145821. // because http.StatusNotModified was returned.
  145822. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  145823. gensupport.SetOptions(c.urlParams_, opts...)
  145824. res, err := c.doRequest("json")
  145825. if res != nil && res.StatusCode == http.StatusNotModified {
  145826. if res.Body != nil {
  145827. res.Body.Close()
  145828. }
  145829. return nil, &googleapi.Error{
  145830. Code: res.StatusCode,
  145831. Header: res.Header,
  145832. }
  145833. }
  145834. if err != nil {
  145835. return nil, err
  145836. }
  145837. defer googleapi.CloseBody(res)
  145838. if err := googleapi.CheckResponse(res); err != nil {
  145839. return nil, err
  145840. }
  145841. ret := &VpnTunnelAggregatedList{
  145842. ServerResponse: googleapi.ServerResponse{
  145843. Header: res.Header,
  145844. HTTPStatusCode: res.StatusCode,
  145845. },
  145846. }
  145847. target := &ret
  145848. if err := gensupport.DecodeResponse(target, res); err != nil {
  145849. return nil, err
  145850. }
  145851. return ret, nil
  145852. // {
  145853. // "description": "Retrieves an aggregated list of VPN tunnels.",
  145854. // "httpMethod": "GET",
  145855. // "id": "compute.vpnTunnels.aggregatedList",
  145856. // "parameterOrder": [
  145857. // "project"
  145858. // ],
  145859. // "parameters": {
  145860. // "filter": {
  145861. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  145862. // "location": "query",
  145863. // "type": "string"
  145864. // },
  145865. // "maxResults": {
  145866. // "default": "500",
  145867. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  145868. // "format": "uint32",
  145869. // "location": "query",
  145870. // "minimum": "0",
  145871. // "type": "integer"
  145872. // },
  145873. // "orderBy": {
  145874. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  145875. // "location": "query",
  145876. // "type": "string"
  145877. // },
  145878. // "pageToken": {
  145879. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  145880. // "location": "query",
  145881. // "type": "string"
  145882. // },
  145883. // "project": {
  145884. // "description": "Project ID for this request.",
  145885. // "location": "path",
  145886. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  145887. // "required": true,
  145888. // "type": "string"
  145889. // }
  145890. // },
  145891. // "path": "{project}/aggregated/vpnTunnels",
  145892. // "response": {
  145893. // "$ref": "VpnTunnelAggregatedList"
  145894. // },
  145895. // "scopes": [
  145896. // "https://www.googleapis.com/auth/cloud-platform",
  145897. // "https://www.googleapis.com/auth/compute",
  145898. // "https://www.googleapis.com/auth/compute.readonly"
  145899. // ]
  145900. // }
  145901. }
  145902. // Pages invokes f for each page of results.
  145903. // A non-nil error returned from f will halt the iteration.
  145904. // The provided context supersedes any context provided to the Context method.
  145905. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  145906. c.ctx_ = ctx
  145907. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  145908. for {
  145909. x, err := c.Do()
  145910. if err != nil {
  145911. return err
  145912. }
  145913. if err := f(x); err != nil {
  145914. return err
  145915. }
  145916. if x.NextPageToken == "" {
  145917. return nil
  145918. }
  145919. c.PageToken(x.NextPageToken)
  145920. }
  145921. }
  145922. // method id "compute.vpnTunnels.delete":
  145923. type VpnTunnelsDeleteCall struct {
  145924. s *Service
  145925. project string
  145926. region string
  145927. vpnTunnel string
  145928. urlParams_ gensupport.URLParams
  145929. ctx_ context.Context
  145930. header_ http.Header
  145931. }
  145932. // Delete: Deletes the specified VpnTunnel resource.
  145933. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  145934. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  145935. c.project = project
  145936. c.region = region
  145937. c.vpnTunnel = vpnTunnel
  145938. return c
  145939. }
  145940. // RequestId sets the optional parameter "requestId": An optional
  145941. // request ID to identify requests. Specify a unique request ID so that
  145942. // if you must retry your request, the server will know to ignore the
  145943. // request if it has already been completed.
  145944. //
  145945. // For example, consider a situation where you make an initial request
  145946. // and the request times out. If you make the request again with the
  145947. // same request ID, the server can check if original operation with the
  145948. // same request ID was received, and if so, will ignore the second
  145949. // request. This prevents clients from accidentally creating duplicate
  145950. // commitments.
  145951. //
  145952. // The request ID must be a valid UUID with the exception that zero UUID
  145953. // is not supported (00000000-0000-0000-0000-000000000000).
  145954. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  145955. c.urlParams_.Set("requestId", requestId)
  145956. return c
  145957. }
  145958. // Fields allows partial responses to be retrieved. See
  145959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  145960. // for more information.
  145961. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  145962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  145963. return c
  145964. }
  145965. // Context sets the context to be used in this call's Do method. Any
  145966. // pending HTTP request will be aborted if the provided context is
  145967. // canceled.
  145968. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  145969. c.ctx_ = ctx
  145970. return c
  145971. }
  145972. // Header returns an http.Header that can be modified by the caller to
  145973. // add HTTP headers to the request.
  145974. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  145975. if c.header_ == nil {
  145976. c.header_ = make(http.Header)
  145977. }
  145978. return c.header_
  145979. }
  145980. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  145981. reqHeaders := make(http.Header)
  145982. for k, v := range c.header_ {
  145983. reqHeaders[k] = v
  145984. }
  145985. reqHeaders.Set("User-Agent", c.s.userAgent())
  145986. var body io.Reader = nil
  145987. c.urlParams_.Set("alt", alt)
  145988. c.urlParams_.Set("prettyPrint", "false")
  145989. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  145990. urls += "?" + c.urlParams_.Encode()
  145991. req, err := http.NewRequest("DELETE", urls, body)
  145992. if err != nil {
  145993. return nil, err
  145994. }
  145995. req.Header = reqHeaders
  145996. googleapi.Expand(req.URL, map[string]string{
  145997. "project": c.project,
  145998. "region": c.region,
  145999. "vpnTunnel": c.vpnTunnel,
  146000. })
  146001. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  146002. }
  146003. // Do executes the "compute.vpnTunnels.delete" call.
  146004. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  146005. // status code is an error. Response headers are in either
  146006. // *Operation.ServerResponse.Header or (if a response was returned at
  146007. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  146008. // to check whether the returned error was because
  146009. // http.StatusNotModified was returned.
  146010. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  146011. gensupport.SetOptions(c.urlParams_, opts...)
  146012. res, err := c.doRequest("json")
  146013. if res != nil && res.StatusCode == http.StatusNotModified {
  146014. if res.Body != nil {
  146015. res.Body.Close()
  146016. }
  146017. return nil, &googleapi.Error{
  146018. Code: res.StatusCode,
  146019. Header: res.Header,
  146020. }
  146021. }
  146022. if err != nil {
  146023. return nil, err
  146024. }
  146025. defer googleapi.CloseBody(res)
  146026. if err := googleapi.CheckResponse(res); err != nil {
  146027. return nil, err
  146028. }
  146029. ret := &Operation{
  146030. ServerResponse: googleapi.ServerResponse{
  146031. Header: res.Header,
  146032. HTTPStatusCode: res.StatusCode,
  146033. },
  146034. }
  146035. target := &ret
  146036. if err := gensupport.DecodeResponse(target, res); err != nil {
  146037. return nil, err
  146038. }
  146039. return ret, nil
  146040. // {
  146041. // "description": "Deletes the specified VpnTunnel resource.",
  146042. // "httpMethod": "DELETE",
  146043. // "id": "compute.vpnTunnels.delete",
  146044. // "parameterOrder": [
  146045. // "project",
  146046. // "region",
  146047. // "vpnTunnel"
  146048. // ],
  146049. // "parameters": {
  146050. // "project": {
  146051. // "description": "Project ID for this request.",
  146052. // "location": "path",
  146053. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  146054. // "required": true,
  146055. // "type": "string"
  146056. // },
  146057. // "region": {
  146058. // "description": "Name of the region for this request.",
  146059. // "location": "path",
  146060. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  146061. // "required": true,
  146062. // "type": "string"
  146063. // },
  146064. // "requestId": {
  146065. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  146066. // "location": "query",
  146067. // "type": "string"
  146068. // },
  146069. // "vpnTunnel": {
  146070. // "description": "Name of the VpnTunnel resource to delete.",
  146071. // "location": "path",
  146072. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  146073. // "required": true,
  146074. // "type": "string"
  146075. // }
  146076. // },
  146077. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  146078. // "response": {
  146079. // "$ref": "Operation"
  146080. // },
  146081. // "scopes": [
  146082. // "https://www.googleapis.com/auth/cloud-platform",
  146083. // "https://www.googleapis.com/auth/compute"
  146084. // ]
  146085. // }
  146086. }
  146087. // method id "compute.vpnTunnels.get":
  146088. type VpnTunnelsGetCall struct {
  146089. s *Service
  146090. project string
  146091. region string
  146092. vpnTunnel string
  146093. urlParams_ gensupport.URLParams
  146094. ifNoneMatch_ string
  146095. ctx_ context.Context
  146096. header_ http.Header
  146097. }
  146098. // Get: Returns the specified VpnTunnel resource. Gets a list of
  146099. // available VPN tunnels by making a list() request.
  146100. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  146101. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  146102. c.project = project
  146103. c.region = region
  146104. c.vpnTunnel = vpnTunnel
  146105. return c
  146106. }
  146107. // Fields allows partial responses to be retrieved. See
  146108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  146109. // for more information.
  146110. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  146111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  146112. return c
  146113. }
  146114. // IfNoneMatch sets the optional parameter which makes the operation
  146115. // fail if the object's ETag matches the given value. This is useful for
  146116. // getting updates only after the object has changed since the last
  146117. // request. Use googleapi.IsNotModified to check whether the response
  146118. // error from Do is the result of In-None-Match.
  146119. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  146120. c.ifNoneMatch_ = entityTag
  146121. return c
  146122. }
  146123. // Context sets the context to be used in this call's Do method. Any
  146124. // pending HTTP request will be aborted if the provided context is
  146125. // canceled.
  146126. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  146127. c.ctx_ = ctx
  146128. return c
  146129. }
  146130. // Header returns an http.Header that can be modified by the caller to
  146131. // add HTTP headers to the request.
  146132. func (c *VpnTunnelsGetCall) Header() http.Header {
  146133. if c.header_ == nil {
  146134. c.header_ = make(http.Header)
  146135. }
  146136. return c.header_
  146137. }
  146138. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  146139. reqHeaders := make(http.Header)
  146140. for k, v := range c.header_ {
  146141. reqHeaders[k] = v
  146142. }
  146143. reqHeaders.Set("User-Agent", c.s.userAgent())
  146144. if c.ifNoneMatch_ != "" {
  146145. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  146146. }
  146147. var body io.Reader = nil
  146148. c.urlParams_.Set("alt", alt)
  146149. c.urlParams_.Set("prettyPrint", "false")
  146150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  146151. urls += "?" + c.urlParams_.Encode()
  146152. req, err := http.NewRequest("GET", urls, body)
  146153. if err != nil {
  146154. return nil, err
  146155. }
  146156. req.Header = reqHeaders
  146157. googleapi.Expand(req.URL, map[string]string{
  146158. "project": c.project,
  146159. "region": c.region,
  146160. "vpnTunnel": c.vpnTunnel,
  146161. })
  146162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  146163. }
  146164. // Do executes the "compute.vpnTunnels.get" call.
  146165. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  146166. // status code is an error. Response headers are in either
  146167. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  146168. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  146169. // to check whether the returned error was because
  146170. // http.StatusNotModified was returned.
  146171. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  146172. gensupport.SetOptions(c.urlParams_, opts...)
  146173. res, err := c.doRequest("json")
  146174. if res != nil && res.StatusCode == http.StatusNotModified {
  146175. if res.Body != nil {
  146176. res.Body.Close()
  146177. }
  146178. return nil, &googleapi.Error{
  146179. Code: res.StatusCode,
  146180. Header: res.Header,
  146181. }
  146182. }
  146183. if err != nil {
  146184. return nil, err
  146185. }
  146186. defer googleapi.CloseBody(res)
  146187. if err := googleapi.CheckResponse(res); err != nil {
  146188. return nil, err
  146189. }
  146190. ret := &VpnTunnel{
  146191. ServerResponse: googleapi.ServerResponse{
  146192. Header: res.Header,
  146193. HTTPStatusCode: res.StatusCode,
  146194. },
  146195. }
  146196. target := &ret
  146197. if err := gensupport.DecodeResponse(target, res); err != nil {
  146198. return nil, err
  146199. }
  146200. return ret, nil
  146201. // {
  146202. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  146203. // "httpMethod": "GET",
  146204. // "id": "compute.vpnTunnels.get",
  146205. // "parameterOrder": [
  146206. // "project",
  146207. // "region",
  146208. // "vpnTunnel"
  146209. // ],
  146210. // "parameters": {
  146211. // "project": {
  146212. // "description": "Project ID for this request.",
  146213. // "location": "path",
  146214. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  146215. // "required": true,
  146216. // "type": "string"
  146217. // },
  146218. // "region": {
  146219. // "description": "Name of the region for this request.",
  146220. // "location": "path",
  146221. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  146222. // "required": true,
  146223. // "type": "string"
  146224. // },
  146225. // "vpnTunnel": {
  146226. // "description": "Name of the VpnTunnel resource to return.",
  146227. // "location": "path",
  146228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  146229. // "required": true,
  146230. // "type": "string"
  146231. // }
  146232. // },
  146233. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  146234. // "response": {
  146235. // "$ref": "VpnTunnel"
  146236. // },
  146237. // "scopes": [
  146238. // "https://www.googleapis.com/auth/cloud-platform",
  146239. // "https://www.googleapis.com/auth/compute",
  146240. // "https://www.googleapis.com/auth/compute.readonly"
  146241. // ]
  146242. // }
  146243. }
  146244. // method id "compute.vpnTunnels.insert":
  146245. type VpnTunnelsInsertCall struct {
  146246. s *Service
  146247. project string
  146248. region string
  146249. vpntunnel *VpnTunnel
  146250. urlParams_ gensupport.URLParams
  146251. ctx_ context.Context
  146252. header_ http.Header
  146253. }
  146254. // Insert: Creates a VpnTunnel resource in the specified project and
  146255. // region using the data included in the request.
  146256. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  146257. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  146258. c.project = project
  146259. c.region = region
  146260. c.vpntunnel = vpntunnel
  146261. return c
  146262. }
  146263. // RequestId sets the optional parameter "requestId": An optional
  146264. // request ID to identify requests. Specify a unique request ID so that
  146265. // if you must retry your request, the server will know to ignore the
  146266. // request if it has already been completed.
  146267. //
  146268. // For example, consider a situation where you make an initial request
  146269. // and the request times out. If you make the request again with the
  146270. // same request ID, the server can check if original operation with the
  146271. // same request ID was received, and if so, will ignore the second
  146272. // request. This prevents clients from accidentally creating duplicate
  146273. // commitments.
  146274. //
  146275. // The request ID must be a valid UUID with the exception that zero UUID
  146276. // is not supported (00000000-0000-0000-0000-000000000000).
  146277. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  146278. c.urlParams_.Set("requestId", requestId)
  146279. return c
  146280. }
  146281. // Fields allows partial responses to be retrieved. See
  146282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  146283. // for more information.
  146284. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  146285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  146286. return c
  146287. }
  146288. // Context sets the context to be used in this call's Do method. Any
  146289. // pending HTTP request will be aborted if the provided context is
  146290. // canceled.
  146291. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  146292. c.ctx_ = ctx
  146293. return c
  146294. }
  146295. // Header returns an http.Header that can be modified by the caller to
  146296. // add HTTP headers to the request.
  146297. func (c *VpnTunnelsInsertCall) Header() http.Header {
  146298. if c.header_ == nil {
  146299. c.header_ = make(http.Header)
  146300. }
  146301. return c.header_
  146302. }
  146303. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  146304. reqHeaders := make(http.Header)
  146305. for k, v := range c.header_ {
  146306. reqHeaders[k] = v
  146307. }
  146308. reqHeaders.Set("User-Agent", c.s.userAgent())
  146309. var body io.Reader = nil
  146310. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  146311. if err != nil {
  146312. return nil, err
  146313. }
  146314. reqHeaders.Set("Content-Type", "application/json")
  146315. c.urlParams_.Set("alt", alt)
  146316. c.urlParams_.Set("prettyPrint", "false")
  146317. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  146318. urls += "?" + c.urlParams_.Encode()
  146319. req, err := http.NewRequest("POST", urls, body)
  146320. if err != nil {
  146321. return nil, err
  146322. }
  146323. req.Header = reqHeaders
  146324. googleapi.Expand(req.URL, map[string]string{
  146325. "project": c.project,
  146326. "region": c.region,
  146327. })
  146328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  146329. }
  146330. // Do executes the "compute.vpnTunnels.insert" call.
  146331. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  146332. // status code is an error. Response headers are in either
  146333. // *Operation.ServerResponse.Header or (if a response was returned at
  146334. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  146335. // to check whether the returned error was because
  146336. // http.StatusNotModified was returned.
  146337. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  146338. gensupport.SetOptions(c.urlParams_, opts...)
  146339. res, err := c.doRequest("json")
  146340. if res != nil && res.StatusCode == http.StatusNotModified {
  146341. if res.Body != nil {
  146342. res.Body.Close()
  146343. }
  146344. return nil, &googleapi.Error{
  146345. Code: res.StatusCode,
  146346. Header: res.Header,
  146347. }
  146348. }
  146349. if err != nil {
  146350. return nil, err
  146351. }
  146352. defer googleapi.CloseBody(res)
  146353. if err := googleapi.CheckResponse(res); err != nil {
  146354. return nil, err
  146355. }
  146356. ret := &Operation{
  146357. ServerResponse: googleapi.ServerResponse{
  146358. Header: res.Header,
  146359. HTTPStatusCode: res.StatusCode,
  146360. },
  146361. }
  146362. target := &ret
  146363. if err := gensupport.DecodeResponse(target, res); err != nil {
  146364. return nil, err
  146365. }
  146366. return ret, nil
  146367. // {
  146368. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  146369. // "httpMethod": "POST",
  146370. // "id": "compute.vpnTunnels.insert",
  146371. // "parameterOrder": [
  146372. // "project",
  146373. // "region"
  146374. // ],
  146375. // "parameters": {
  146376. // "project": {
  146377. // "description": "Project ID for this request.",
  146378. // "location": "path",
  146379. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  146380. // "required": true,
  146381. // "type": "string"
  146382. // },
  146383. // "region": {
  146384. // "description": "Name of the region for this request.",
  146385. // "location": "path",
  146386. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  146387. // "required": true,
  146388. // "type": "string"
  146389. // },
  146390. // "requestId": {
  146391. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  146392. // "location": "query",
  146393. // "type": "string"
  146394. // }
  146395. // },
  146396. // "path": "{project}/regions/{region}/vpnTunnels",
  146397. // "request": {
  146398. // "$ref": "VpnTunnel"
  146399. // },
  146400. // "response": {
  146401. // "$ref": "Operation"
  146402. // },
  146403. // "scopes": [
  146404. // "https://www.googleapis.com/auth/cloud-platform",
  146405. // "https://www.googleapis.com/auth/compute"
  146406. // ]
  146407. // }
  146408. }
  146409. // method id "compute.vpnTunnels.list":
  146410. type VpnTunnelsListCall struct {
  146411. s *Service
  146412. project string
  146413. region string
  146414. urlParams_ gensupport.URLParams
  146415. ifNoneMatch_ string
  146416. ctx_ context.Context
  146417. header_ http.Header
  146418. }
  146419. // List: Retrieves a list of VpnTunnel resources contained in the
  146420. // specified project and region.
  146421. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  146422. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  146423. c.project = project
  146424. c.region = region
  146425. return c
  146426. }
  146427. // Filter sets the optional parameter "filter": A filter expression that
  146428. // filters resources listed in the response. The expression must specify
  146429. // the field name, a comparison operator, and the value that you want to
  146430. // use for filtering. The value must be a string, a number, or a
  146431. // boolean. The comparison operator must be either =, !=, >, or <.
  146432. //
  146433. // For example, if you are filtering Compute Engine instances, you can
  146434. // exclude instances named example-instance by specifying name !=
  146435. // example-instance.
  146436. //
  146437. // You can also filter nested fields. For example, you could specify
  146438. // scheduling.automaticRestart = false to include instances only if they
  146439. // are not scheduled for automatic restarts. You can use filtering on
  146440. // nested fields to filter based on resource labels.
  146441. //
  146442. // To filter on multiple expressions, provide each separate expression
  146443. // within parentheses. For example, (scheduling.automaticRestart = true)
  146444. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  146445. // AND expression. However, you can include AND and OR expressions
  146446. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  146447. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  146448. // true).
  146449. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  146450. c.urlParams_.Set("filter", filter)
  146451. return c
  146452. }
  146453. // MaxResults sets the optional parameter "maxResults": The maximum
  146454. // number of results per page that should be returned. If the number of
  146455. // available results is larger than maxResults, Compute Engine returns a
  146456. // nextPageToken that can be used to get the next page of results in
  146457. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  146458. // (Default: 500)
  146459. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  146460. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  146461. return c
  146462. }
  146463. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  146464. // a certain order. By default, results are returned in alphanumerical
  146465. // order based on the resource name.
  146466. //
  146467. // You can also sort results in descending order based on the creation
  146468. // timestamp using orderBy="creationTimestamp desc". This sorts results
  146469. // based on the creationTimestamp field in reverse chronological order
  146470. // (newest result first). Use this to sort resources like operations so
  146471. // that the newest operation is returned first.
  146472. //
  146473. // Currently, only sorting by name or creationTimestamp desc is
  146474. // supported.
  146475. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  146476. c.urlParams_.Set("orderBy", orderBy)
  146477. return c
  146478. }
  146479. // PageToken sets the optional parameter "pageToken": Specifies a page
  146480. // token to use. Set pageToken to the nextPageToken returned by a
  146481. // previous list request to get the next page of results.
  146482. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  146483. c.urlParams_.Set("pageToken", pageToken)
  146484. return c
  146485. }
  146486. // Fields allows partial responses to be retrieved. See
  146487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  146488. // for more information.
  146489. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  146490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  146491. return c
  146492. }
  146493. // IfNoneMatch sets the optional parameter which makes the operation
  146494. // fail if the object's ETag matches the given value. This is useful for
  146495. // getting updates only after the object has changed since the last
  146496. // request. Use googleapi.IsNotModified to check whether the response
  146497. // error from Do is the result of In-None-Match.
  146498. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  146499. c.ifNoneMatch_ = entityTag
  146500. return c
  146501. }
  146502. // Context sets the context to be used in this call's Do method. Any
  146503. // pending HTTP request will be aborted if the provided context is
  146504. // canceled.
  146505. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  146506. c.ctx_ = ctx
  146507. return c
  146508. }
  146509. // Header returns an http.Header that can be modified by the caller to
  146510. // add HTTP headers to the request.
  146511. func (c *VpnTunnelsListCall) Header() http.Header {
  146512. if c.header_ == nil {
  146513. c.header_ = make(http.Header)
  146514. }
  146515. return c.header_
  146516. }
  146517. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  146518. reqHeaders := make(http.Header)
  146519. for k, v := range c.header_ {
  146520. reqHeaders[k] = v
  146521. }
  146522. reqHeaders.Set("User-Agent", c.s.userAgent())
  146523. if c.ifNoneMatch_ != "" {
  146524. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  146525. }
  146526. var body io.Reader = nil
  146527. c.urlParams_.Set("alt", alt)
  146528. c.urlParams_.Set("prettyPrint", "false")
  146529. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  146530. urls += "?" + c.urlParams_.Encode()
  146531. req, err := http.NewRequest("GET", urls, body)
  146532. if err != nil {
  146533. return nil, err
  146534. }
  146535. req.Header = reqHeaders
  146536. googleapi.Expand(req.URL, map[string]string{
  146537. "project": c.project,
  146538. "region": c.region,
  146539. })
  146540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  146541. }
  146542. // Do executes the "compute.vpnTunnels.list" call.
  146543. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  146544. // status code is an error. Response headers are in either
  146545. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  146546. // at all) in error.(*googleapi.Error).Header. Use
  146547. // googleapi.IsNotModified to check whether the returned error was
  146548. // because http.StatusNotModified was returned.
  146549. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  146550. gensupport.SetOptions(c.urlParams_, opts...)
  146551. res, err := c.doRequest("json")
  146552. if res != nil && res.StatusCode == http.StatusNotModified {
  146553. if res.Body != nil {
  146554. res.Body.Close()
  146555. }
  146556. return nil, &googleapi.Error{
  146557. Code: res.StatusCode,
  146558. Header: res.Header,
  146559. }
  146560. }
  146561. if err != nil {
  146562. return nil, err
  146563. }
  146564. defer googleapi.CloseBody(res)
  146565. if err := googleapi.CheckResponse(res); err != nil {
  146566. return nil, err
  146567. }
  146568. ret := &VpnTunnelList{
  146569. ServerResponse: googleapi.ServerResponse{
  146570. Header: res.Header,
  146571. HTTPStatusCode: res.StatusCode,
  146572. },
  146573. }
  146574. target := &ret
  146575. if err := gensupport.DecodeResponse(target, res); err != nil {
  146576. return nil, err
  146577. }
  146578. return ret, nil
  146579. // {
  146580. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  146581. // "httpMethod": "GET",
  146582. // "id": "compute.vpnTunnels.list",
  146583. // "parameterOrder": [
  146584. // "project",
  146585. // "region"
  146586. // ],
  146587. // "parameters": {
  146588. // "filter": {
  146589. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  146590. // "location": "query",
  146591. // "type": "string"
  146592. // },
  146593. // "maxResults": {
  146594. // "default": "500",
  146595. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  146596. // "format": "uint32",
  146597. // "location": "query",
  146598. // "minimum": "0",
  146599. // "type": "integer"
  146600. // },
  146601. // "orderBy": {
  146602. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  146603. // "location": "query",
  146604. // "type": "string"
  146605. // },
  146606. // "pageToken": {
  146607. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  146608. // "location": "query",
  146609. // "type": "string"
  146610. // },
  146611. // "project": {
  146612. // "description": "Project ID for this request.",
  146613. // "location": "path",
  146614. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  146615. // "required": true,
  146616. // "type": "string"
  146617. // },
  146618. // "region": {
  146619. // "description": "Name of the region for this request.",
  146620. // "location": "path",
  146621. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  146622. // "required": true,
  146623. // "type": "string"
  146624. // }
  146625. // },
  146626. // "path": "{project}/regions/{region}/vpnTunnels",
  146627. // "response": {
  146628. // "$ref": "VpnTunnelList"
  146629. // },
  146630. // "scopes": [
  146631. // "https://www.googleapis.com/auth/cloud-platform",
  146632. // "https://www.googleapis.com/auth/compute",
  146633. // "https://www.googleapis.com/auth/compute.readonly"
  146634. // ]
  146635. // }
  146636. }
  146637. // Pages invokes f for each page of results.
  146638. // A non-nil error returned from f will halt the iteration.
  146639. // The provided context supersedes any context provided to the Context method.
  146640. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  146641. c.ctx_ = ctx
  146642. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  146643. for {
  146644. x, err := c.Do()
  146645. if err != nil {
  146646. return err
  146647. }
  146648. if err := f(x); err != nil {
  146649. return err
  146650. }
  146651. if x.NextPageToken == "" {
  146652. return nil
  146653. }
  146654. c.PageToken(x.NextPageToken)
  146655. }
  146656. }
  146657. // method id "compute.vpnTunnels.setLabels":
  146658. type VpnTunnelsSetLabelsCall struct {
  146659. s *Service
  146660. project string
  146661. region string
  146662. resource string
  146663. regionsetlabelsrequest *RegionSetLabelsRequest
  146664. urlParams_ gensupport.URLParams
  146665. ctx_ context.Context
  146666. header_ http.Header
  146667. }
  146668. // SetLabels: Sets the labels on a VpnTunnel. To learn more about
  146669. // labels, read the Labeling Resources documentation.
  146670. func (r *VpnTunnelsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnTunnelsSetLabelsCall {
  146671. c := &VpnTunnelsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  146672. c.project = project
  146673. c.region = region
  146674. c.resource = resource
  146675. c.regionsetlabelsrequest = regionsetlabelsrequest
  146676. return c
  146677. }
  146678. // RequestId sets the optional parameter "requestId": An optional
  146679. // request ID to identify requests. Specify a unique request ID so that
  146680. // if you must retry your request, the server will know to ignore the
  146681. // request if it has already been completed.
  146682. //
  146683. // For example, consider a situation where you make an initial request
  146684. // and the request times out. If you make the request again with the
  146685. // same request ID, the server can check if original operation with the
  146686. // same request ID was received, and if so, will ignore the second
  146687. // request. This prevents clients from accidentally creating duplicate
  146688. // commitments.
  146689. //
  146690. // The request ID must be a valid UUID with the exception that zero UUID
  146691. // is not supported (00000000-0000-0000-0000-000000000000).
  146692. func (c *VpnTunnelsSetLabelsCall) RequestId(requestId string) *VpnTunnelsSetLabelsCall {
  146693. c.urlParams_.Set("requestId", requestId)
  146694. return c
  146695. }
  146696. // Fields allows partial responses to be retrieved. See
  146697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  146698. // for more information.
  146699. func (c *VpnTunnelsSetLabelsCall) Fields(s ...googleapi.Field) *VpnTunnelsSetLabelsCall {
  146700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  146701. return c
  146702. }
  146703. // Context sets the context to be used in this call's Do method. Any
  146704. // pending HTTP request will be aborted if the provided context is
  146705. // canceled.
  146706. func (c *VpnTunnelsSetLabelsCall) Context(ctx context.Context) *VpnTunnelsSetLabelsCall {
  146707. c.ctx_ = ctx
  146708. return c
  146709. }
  146710. // Header returns an http.Header that can be modified by the caller to
  146711. // add HTTP headers to the request.
  146712. func (c *VpnTunnelsSetLabelsCall) Header() http.Header {
  146713. if c.header_ == nil {
  146714. c.header_ = make(http.Header)
  146715. }
  146716. return c.header_
  146717. }
  146718. func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  146719. reqHeaders := make(http.Header)
  146720. for k, v := range c.header_ {
  146721. reqHeaders[k] = v
  146722. }
  146723. reqHeaders.Set("User-Agent", c.s.userAgent())
  146724. var body io.Reader = nil
  146725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  146726. if err != nil {
  146727. return nil, err
  146728. }
  146729. reqHeaders.Set("Content-Type", "application/json")
  146730. c.urlParams_.Set("alt", alt)
  146731. c.urlParams_.Set("prettyPrint", "false")
  146732. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/setLabels")
  146733. urls += "?" + c.urlParams_.Encode()
  146734. req, err := http.NewRequest("POST", urls, body)
  146735. if err != nil {
  146736. return nil, err
  146737. }
  146738. req.Header = reqHeaders
  146739. googleapi.Expand(req.URL, map[string]string{
  146740. "project": c.project,
  146741. "region": c.region,
  146742. "resource": c.resource,
  146743. })
  146744. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  146745. }
  146746. // Do executes the "compute.vpnTunnels.setLabels" call.
  146747. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  146748. // status code is an error. Response headers are in either
  146749. // *Operation.ServerResponse.Header or (if a response was returned at
  146750. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  146751. // to check whether the returned error was because
  146752. // http.StatusNotModified was returned.
  146753. func (c *VpnTunnelsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  146754. gensupport.SetOptions(c.urlParams_, opts...)
  146755. res, err := c.doRequest("json")
  146756. if res != nil && res.StatusCode == http.StatusNotModified {
  146757. if res.Body != nil {
  146758. res.Body.Close()
  146759. }
  146760. return nil, &googleapi.Error{
  146761. Code: res.StatusCode,
  146762. Header: res.Header,
  146763. }
  146764. }
  146765. if err != nil {
  146766. return nil, err
  146767. }
  146768. defer googleapi.CloseBody(res)
  146769. if err := googleapi.CheckResponse(res); err != nil {
  146770. return nil, err
  146771. }
  146772. ret := &Operation{
  146773. ServerResponse: googleapi.ServerResponse{
  146774. Header: res.Header,
  146775. HTTPStatusCode: res.StatusCode,
  146776. },
  146777. }
  146778. target := &ret
  146779. if err := gensupport.DecodeResponse(target, res); err != nil {
  146780. return nil, err
  146781. }
  146782. return ret, nil
  146783. // {
  146784. // "description": "Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.",
  146785. // "httpMethod": "POST",
  146786. // "id": "compute.vpnTunnels.setLabels",
  146787. // "parameterOrder": [
  146788. // "project",
  146789. // "region",
  146790. // "resource"
  146791. // ],
  146792. // "parameters": {
  146793. // "project": {
  146794. // "description": "Project ID for this request.",
  146795. // "location": "path",
  146796. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  146797. // "required": true,
  146798. // "type": "string"
  146799. // },
  146800. // "region": {
  146801. // "description": "The region for this request.",
  146802. // "location": "path",
  146803. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  146804. // "required": true,
  146805. // "type": "string"
  146806. // },
  146807. // "requestId": {
  146808. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  146809. // "location": "query",
  146810. // "type": "string"
  146811. // },
  146812. // "resource": {
  146813. // "description": "Name or id of the resource for this request.",
  146814. // "location": "path",
  146815. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  146816. // "required": true,
  146817. // "type": "string"
  146818. // }
  146819. // },
  146820. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/setLabels",
  146821. // "request": {
  146822. // "$ref": "RegionSetLabelsRequest"
  146823. // },
  146824. // "response": {
  146825. // "$ref": "Operation"
  146826. // },
  146827. // "scopes": [
  146828. // "https://www.googleapis.com/auth/cloud-platform",
  146829. // "https://www.googleapis.com/auth/compute"
  146830. // ]
  146831. // }
  146832. }
  146833. // method id "compute.vpnTunnels.testIamPermissions":
  146834. type VpnTunnelsTestIamPermissionsCall struct {
  146835. s *Service
  146836. project string
  146837. region string
  146838. resource string
  146839. testpermissionsrequest *TestPermissionsRequest
  146840. urlParams_ gensupport.URLParams
  146841. ctx_ context.Context
  146842. header_ http.Header
  146843. }
  146844. // TestIamPermissions: Returns permissions that a caller has on the
  146845. // specified resource.
  146846. func (r *VpnTunnelsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnTunnelsTestIamPermissionsCall {
  146847. c := &VpnTunnelsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  146848. c.project = project
  146849. c.region = region
  146850. c.resource = resource
  146851. c.testpermissionsrequest = testpermissionsrequest
  146852. return c
  146853. }
  146854. // Fields allows partial responses to be retrieved. See
  146855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  146856. // for more information.
  146857. func (c *VpnTunnelsTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnTunnelsTestIamPermissionsCall {
  146858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  146859. return c
  146860. }
  146861. // Context sets the context to be used in this call's Do method. Any
  146862. // pending HTTP request will be aborted if the provided context is
  146863. // canceled.
  146864. func (c *VpnTunnelsTestIamPermissionsCall) Context(ctx context.Context) *VpnTunnelsTestIamPermissionsCall {
  146865. c.ctx_ = ctx
  146866. return c
  146867. }
  146868. // Header returns an http.Header that can be modified by the caller to
  146869. // add HTTP headers to the request.
  146870. func (c *VpnTunnelsTestIamPermissionsCall) Header() http.Header {
  146871. if c.header_ == nil {
  146872. c.header_ = make(http.Header)
  146873. }
  146874. return c.header_
  146875. }
  146876. func (c *VpnTunnelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  146877. reqHeaders := make(http.Header)
  146878. for k, v := range c.header_ {
  146879. reqHeaders[k] = v
  146880. }
  146881. reqHeaders.Set("User-Agent", c.s.userAgent())
  146882. var body io.Reader = nil
  146883. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  146884. if err != nil {
  146885. return nil, err
  146886. }
  146887. reqHeaders.Set("Content-Type", "application/json")
  146888. c.urlParams_.Set("alt", alt)
  146889. c.urlParams_.Set("prettyPrint", "false")
  146890. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions")
  146891. urls += "?" + c.urlParams_.Encode()
  146892. req, err := http.NewRequest("POST", urls, body)
  146893. if err != nil {
  146894. return nil, err
  146895. }
  146896. req.Header = reqHeaders
  146897. googleapi.Expand(req.URL, map[string]string{
  146898. "project": c.project,
  146899. "region": c.region,
  146900. "resource": c.resource,
  146901. })
  146902. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  146903. }
  146904. // Do executes the "compute.vpnTunnels.testIamPermissions" call.
  146905. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  146906. // non-2xx status code is an error. Response headers are in either
  146907. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  146908. // returned at all) in error.(*googleapi.Error).Header. Use
  146909. // googleapi.IsNotModified to check whether the returned error was
  146910. // because http.StatusNotModified was returned.
  146911. func (c *VpnTunnelsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  146912. gensupport.SetOptions(c.urlParams_, opts...)
  146913. res, err := c.doRequest("json")
  146914. if res != nil && res.StatusCode == http.StatusNotModified {
  146915. if res.Body != nil {
  146916. res.Body.Close()
  146917. }
  146918. return nil, &googleapi.Error{
  146919. Code: res.StatusCode,
  146920. Header: res.Header,
  146921. }
  146922. }
  146923. if err != nil {
  146924. return nil, err
  146925. }
  146926. defer googleapi.CloseBody(res)
  146927. if err := googleapi.CheckResponse(res); err != nil {
  146928. return nil, err
  146929. }
  146930. ret := &TestPermissionsResponse{
  146931. ServerResponse: googleapi.ServerResponse{
  146932. Header: res.Header,
  146933. HTTPStatusCode: res.StatusCode,
  146934. },
  146935. }
  146936. target := &ret
  146937. if err := gensupport.DecodeResponse(target, res); err != nil {
  146938. return nil, err
  146939. }
  146940. return ret, nil
  146941. // {
  146942. // "description": "Returns permissions that a caller has on the specified resource.",
  146943. // "httpMethod": "POST",
  146944. // "id": "compute.vpnTunnels.testIamPermissions",
  146945. // "parameterOrder": [
  146946. // "project",
  146947. // "region",
  146948. // "resource"
  146949. // ],
  146950. // "parameters": {
  146951. // "project": {
  146952. // "description": "Project ID for this request.",
  146953. // "location": "path",
  146954. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  146955. // "required": true,
  146956. // "type": "string"
  146957. // },
  146958. // "region": {
  146959. // "description": "The name of the region for this request.",
  146960. // "location": "path",
  146961. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  146962. // "required": true,
  146963. // "type": "string"
  146964. // },
  146965. // "resource": {
  146966. // "description": "Name or id of the resource for this request.",
  146967. // "location": "path",
  146968. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  146969. // "required": true,
  146970. // "type": "string"
  146971. // }
  146972. // },
  146973. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions",
  146974. // "request": {
  146975. // "$ref": "TestPermissionsRequest"
  146976. // },
  146977. // "response": {
  146978. // "$ref": "TestPermissionsResponse"
  146979. // },
  146980. // "scopes": [
  146981. // "https://www.googleapis.com/auth/cloud-platform",
  146982. // "https://www.googleapis.com/auth/compute",
  146983. // "https://www.googleapis.com/auth/compute.readonly"
  146984. // ]
  146985. // }
  146986. }
  146987. // method id "compute.zoneOperations.delete":
  146988. type ZoneOperationsDeleteCall struct {
  146989. s *Service
  146990. project string
  146991. zone string
  146992. operation string
  146993. urlParams_ gensupport.URLParams
  146994. ctx_ context.Context
  146995. header_ http.Header
  146996. }
  146997. // Delete: Deletes the specified zone-specific Operations resource.
  146998. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  146999. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  147000. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  147001. c.project = project
  147002. c.zone = zone
  147003. c.operation = operation
  147004. return c
  147005. }
  147006. // Fields allows partial responses to be retrieved. See
  147007. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  147008. // for more information.
  147009. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  147010. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  147011. return c
  147012. }
  147013. // Context sets the context to be used in this call's Do method. Any
  147014. // pending HTTP request will be aborted if the provided context is
  147015. // canceled.
  147016. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  147017. c.ctx_ = ctx
  147018. return c
  147019. }
  147020. // Header returns an http.Header that can be modified by the caller to
  147021. // add HTTP headers to the request.
  147022. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  147023. if c.header_ == nil {
  147024. c.header_ = make(http.Header)
  147025. }
  147026. return c.header_
  147027. }
  147028. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  147029. reqHeaders := make(http.Header)
  147030. for k, v := range c.header_ {
  147031. reqHeaders[k] = v
  147032. }
  147033. reqHeaders.Set("User-Agent", c.s.userAgent())
  147034. var body io.Reader = nil
  147035. c.urlParams_.Set("alt", alt)
  147036. c.urlParams_.Set("prettyPrint", "false")
  147037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  147038. urls += "?" + c.urlParams_.Encode()
  147039. req, err := http.NewRequest("DELETE", urls, body)
  147040. if err != nil {
  147041. return nil, err
  147042. }
  147043. req.Header = reqHeaders
  147044. googleapi.Expand(req.URL, map[string]string{
  147045. "project": c.project,
  147046. "zone": c.zone,
  147047. "operation": c.operation,
  147048. })
  147049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  147050. }
  147051. // Do executes the "compute.zoneOperations.delete" call.
  147052. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  147053. gensupport.SetOptions(c.urlParams_, opts...)
  147054. res, err := c.doRequest("json")
  147055. if err != nil {
  147056. return err
  147057. }
  147058. defer googleapi.CloseBody(res)
  147059. if err := googleapi.CheckResponse(res); err != nil {
  147060. return err
  147061. }
  147062. return nil
  147063. // {
  147064. // "description": "Deletes the specified zone-specific Operations resource.",
  147065. // "httpMethod": "DELETE",
  147066. // "id": "compute.zoneOperations.delete",
  147067. // "parameterOrder": [
  147068. // "project",
  147069. // "zone",
  147070. // "operation"
  147071. // ],
  147072. // "parameters": {
  147073. // "operation": {
  147074. // "description": "Name of the Operations resource to delete.",
  147075. // "location": "path",
  147076. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  147077. // "required": true,
  147078. // "type": "string"
  147079. // },
  147080. // "project": {
  147081. // "description": "Project ID for this request.",
  147082. // "location": "path",
  147083. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  147084. // "required": true,
  147085. // "type": "string"
  147086. // },
  147087. // "zone": {
  147088. // "description": "Name of the zone for this request.",
  147089. // "location": "path",
  147090. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  147091. // "required": true,
  147092. // "type": "string"
  147093. // }
  147094. // },
  147095. // "path": "{project}/zones/{zone}/operations/{operation}",
  147096. // "scopes": [
  147097. // "https://www.googleapis.com/auth/cloud-platform",
  147098. // "https://www.googleapis.com/auth/compute"
  147099. // ]
  147100. // }
  147101. }
  147102. // method id "compute.zoneOperations.get":
  147103. type ZoneOperationsGetCall struct {
  147104. s *Service
  147105. project string
  147106. zone string
  147107. operation string
  147108. urlParams_ gensupport.URLParams
  147109. ifNoneMatch_ string
  147110. ctx_ context.Context
  147111. header_ http.Header
  147112. }
  147113. // Get: Retrieves the specified zone-specific Operations resource.
  147114. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  147115. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  147116. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  147117. c.project = project
  147118. c.zone = zone
  147119. c.operation = operation
  147120. return c
  147121. }
  147122. // Fields allows partial responses to be retrieved. See
  147123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  147124. // for more information.
  147125. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  147126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  147127. return c
  147128. }
  147129. // IfNoneMatch sets the optional parameter which makes the operation
  147130. // fail if the object's ETag matches the given value. This is useful for
  147131. // getting updates only after the object has changed since the last
  147132. // request. Use googleapi.IsNotModified to check whether the response
  147133. // error from Do is the result of In-None-Match.
  147134. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  147135. c.ifNoneMatch_ = entityTag
  147136. return c
  147137. }
  147138. // Context sets the context to be used in this call's Do method. Any
  147139. // pending HTTP request will be aborted if the provided context is
  147140. // canceled.
  147141. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  147142. c.ctx_ = ctx
  147143. return c
  147144. }
  147145. // Header returns an http.Header that can be modified by the caller to
  147146. // add HTTP headers to the request.
  147147. func (c *ZoneOperationsGetCall) Header() http.Header {
  147148. if c.header_ == nil {
  147149. c.header_ = make(http.Header)
  147150. }
  147151. return c.header_
  147152. }
  147153. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  147154. reqHeaders := make(http.Header)
  147155. for k, v := range c.header_ {
  147156. reqHeaders[k] = v
  147157. }
  147158. reqHeaders.Set("User-Agent", c.s.userAgent())
  147159. if c.ifNoneMatch_ != "" {
  147160. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  147161. }
  147162. var body io.Reader = nil
  147163. c.urlParams_.Set("alt", alt)
  147164. c.urlParams_.Set("prettyPrint", "false")
  147165. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  147166. urls += "?" + c.urlParams_.Encode()
  147167. req, err := http.NewRequest("GET", urls, body)
  147168. if err != nil {
  147169. return nil, err
  147170. }
  147171. req.Header = reqHeaders
  147172. googleapi.Expand(req.URL, map[string]string{
  147173. "project": c.project,
  147174. "zone": c.zone,
  147175. "operation": c.operation,
  147176. })
  147177. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  147178. }
  147179. // Do executes the "compute.zoneOperations.get" call.
  147180. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  147181. // status code is an error. Response headers are in either
  147182. // *Operation.ServerResponse.Header or (if a response was returned at
  147183. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  147184. // to check whether the returned error was because
  147185. // http.StatusNotModified was returned.
  147186. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  147187. gensupport.SetOptions(c.urlParams_, opts...)
  147188. res, err := c.doRequest("json")
  147189. if res != nil && res.StatusCode == http.StatusNotModified {
  147190. if res.Body != nil {
  147191. res.Body.Close()
  147192. }
  147193. return nil, &googleapi.Error{
  147194. Code: res.StatusCode,
  147195. Header: res.Header,
  147196. }
  147197. }
  147198. if err != nil {
  147199. return nil, err
  147200. }
  147201. defer googleapi.CloseBody(res)
  147202. if err := googleapi.CheckResponse(res); err != nil {
  147203. return nil, err
  147204. }
  147205. ret := &Operation{
  147206. ServerResponse: googleapi.ServerResponse{
  147207. Header: res.Header,
  147208. HTTPStatusCode: res.StatusCode,
  147209. },
  147210. }
  147211. target := &ret
  147212. if err := gensupport.DecodeResponse(target, res); err != nil {
  147213. return nil, err
  147214. }
  147215. return ret, nil
  147216. // {
  147217. // "description": "Retrieves the specified zone-specific Operations resource.",
  147218. // "httpMethod": "GET",
  147219. // "id": "compute.zoneOperations.get",
  147220. // "parameterOrder": [
  147221. // "project",
  147222. // "zone",
  147223. // "operation"
  147224. // ],
  147225. // "parameters": {
  147226. // "operation": {
  147227. // "description": "Name of the Operations resource to return.",
  147228. // "location": "path",
  147229. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  147230. // "required": true,
  147231. // "type": "string"
  147232. // },
  147233. // "project": {
  147234. // "description": "Project ID for this request.",
  147235. // "location": "path",
  147236. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  147237. // "required": true,
  147238. // "type": "string"
  147239. // },
  147240. // "zone": {
  147241. // "description": "Name of the zone for this request.",
  147242. // "location": "path",
  147243. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  147244. // "required": true,
  147245. // "type": "string"
  147246. // }
  147247. // },
  147248. // "path": "{project}/zones/{zone}/operations/{operation}",
  147249. // "response": {
  147250. // "$ref": "Operation"
  147251. // },
  147252. // "scopes": [
  147253. // "https://www.googleapis.com/auth/cloud-platform",
  147254. // "https://www.googleapis.com/auth/compute",
  147255. // "https://www.googleapis.com/auth/compute.readonly"
  147256. // ]
  147257. // }
  147258. }
  147259. // method id "compute.zoneOperations.list":
  147260. type ZoneOperationsListCall struct {
  147261. s *Service
  147262. project string
  147263. zone string
  147264. urlParams_ gensupport.URLParams
  147265. ifNoneMatch_ string
  147266. ctx_ context.Context
  147267. header_ http.Header
  147268. }
  147269. // List: Retrieves a list of Operation resources contained within the
  147270. // specified zone.
  147271. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  147272. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  147273. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  147274. c.project = project
  147275. c.zone = zone
  147276. return c
  147277. }
  147278. // Filter sets the optional parameter "filter": A filter expression that
  147279. // filters resources listed in the response. The expression must specify
  147280. // the field name, a comparison operator, and the value that you want to
  147281. // use for filtering. The value must be a string, a number, or a
  147282. // boolean. The comparison operator must be either =, !=, >, or <.
  147283. //
  147284. // For example, if you are filtering Compute Engine instances, you can
  147285. // exclude instances named example-instance by specifying name !=
  147286. // example-instance.
  147287. //
  147288. // You can also filter nested fields. For example, you could specify
  147289. // scheduling.automaticRestart = false to include instances only if they
  147290. // are not scheduled for automatic restarts. You can use filtering on
  147291. // nested fields to filter based on resource labels.
  147292. //
  147293. // To filter on multiple expressions, provide each separate expression
  147294. // within parentheses. For example, (scheduling.automaticRestart = true)
  147295. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  147296. // AND expression. However, you can include AND and OR expressions
  147297. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  147298. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  147299. // true).
  147300. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  147301. c.urlParams_.Set("filter", filter)
  147302. return c
  147303. }
  147304. // MaxResults sets the optional parameter "maxResults": The maximum
  147305. // number of results per page that should be returned. If the number of
  147306. // available results is larger than maxResults, Compute Engine returns a
  147307. // nextPageToken that can be used to get the next page of results in
  147308. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  147309. // (Default: 500)
  147310. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  147311. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  147312. return c
  147313. }
  147314. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  147315. // a certain order. By default, results are returned in alphanumerical
  147316. // order based on the resource name.
  147317. //
  147318. // You can also sort results in descending order based on the creation
  147319. // timestamp using orderBy="creationTimestamp desc". This sorts results
  147320. // based on the creationTimestamp field in reverse chronological order
  147321. // (newest result first). Use this to sort resources like operations so
  147322. // that the newest operation is returned first.
  147323. //
  147324. // Currently, only sorting by name or creationTimestamp desc is
  147325. // supported.
  147326. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  147327. c.urlParams_.Set("orderBy", orderBy)
  147328. return c
  147329. }
  147330. // PageToken sets the optional parameter "pageToken": Specifies a page
  147331. // token to use. Set pageToken to the nextPageToken returned by a
  147332. // previous list request to get the next page of results.
  147333. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  147334. c.urlParams_.Set("pageToken", pageToken)
  147335. return c
  147336. }
  147337. // Fields allows partial responses to be retrieved. See
  147338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  147339. // for more information.
  147340. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  147341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  147342. return c
  147343. }
  147344. // IfNoneMatch sets the optional parameter which makes the operation
  147345. // fail if the object's ETag matches the given value. This is useful for
  147346. // getting updates only after the object has changed since the last
  147347. // request. Use googleapi.IsNotModified to check whether the response
  147348. // error from Do is the result of In-None-Match.
  147349. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  147350. c.ifNoneMatch_ = entityTag
  147351. return c
  147352. }
  147353. // Context sets the context to be used in this call's Do method. Any
  147354. // pending HTTP request will be aborted if the provided context is
  147355. // canceled.
  147356. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  147357. c.ctx_ = ctx
  147358. return c
  147359. }
  147360. // Header returns an http.Header that can be modified by the caller to
  147361. // add HTTP headers to the request.
  147362. func (c *ZoneOperationsListCall) Header() http.Header {
  147363. if c.header_ == nil {
  147364. c.header_ = make(http.Header)
  147365. }
  147366. return c.header_
  147367. }
  147368. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  147369. reqHeaders := make(http.Header)
  147370. for k, v := range c.header_ {
  147371. reqHeaders[k] = v
  147372. }
  147373. reqHeaders.Set("User-Agent", c.s.userAgent())
  147374. if c.ifNoneMatch_ != "" {
  147375. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  147376. }
  147377. var body io.Reader = nil
  147378. c.urlParams_.Set("alt", alt)
  147379. c.urlParams_.Set("prettyPrint", "false")
  147380. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  147381. urls += "?" + c.urlParams_.Encode()
  147382. req, err := http.NewRequest("GET", urls, body)
  147383. if err != nil {
  147384. return nil, err
  147385. }
  147386. req.Header = reqHeaders
  147387. googleapi.Expand(req.URL, map[string]string{
  147388. "project": c.project,
  147389. "zone": c.zone,
  147390. })
  147391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  147392. }
  147393. // Do executes the "compute.zoneOperations.list" call.
  147394. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  147395. // status code is an error. Response headers are in either
  147396. // *OperationList.ServerResponse.Header or (if a response was returned
  147397. // at all) in error.(*googleapi.Error).Header. Use
  147398. // googleapi.IsNotModified to check whether the returned error was
  147399. // because http.StatusNotModified was returned.
  147400. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  147401. gensupport.SetOptions(c.urlParams_, opts...)
  147402. res, err := c.doRequest("json")
  147403. if res != nil && res.StatusCode == http.StatusNotModified {
  147404. if res.Body != nil {
  147405. res.Body.Close()
  147406. }
  147407. return nil, &googleapi.Error{
  147408. Code: res.StatusCode,
  147409. Header: res.Header,
  147410. }
  147411. }
  147412. if err != nil {
  147413. return nil, err
  147414. }
  147415. defer googleapi.CloseBody(res)
  147416. if err := googleapi.CheckResponse(res); err != nil {
  147417. return nil, err
  147418. }
  147419. ret := &OperationList{
  147420. ServerResponse: googleapi.ServerResponse{
  147421. Header: res.Header,
  147422. HTTPStatusCode: res.StatusCode,
  147423. },
  147424. }
  147425. target := &ret
  147426. if err := gensupport.DecodeResponse(target, res); err != nil {
  147427. return nil, err
  147428. }
  147429. return ret, nil
  147430. // {
  147431. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  147432. // "httpMethod": "GET",
  147433. // "id": "compute.zoneOperations.list",
  147434. // "parameterOrder": [
  147435. // "project",
  147436. // "zone"
  147437. // ],
  147438. // "parameters": {
  147439. // "filter": {
  147440. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  147441. // "location": "query",
  147442. // "type": "string"
  147443. // },
  147444. // "maxResults": {
  147445. // "default": "500",
  147446. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  147447. // "format": "uint32",
  147448. // "location": "query",
  147449. // "minimum": "0",
  147450. // "type": "integer"
  147451. // },
  147452. // "orderBy": {
  147453. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  147454. // "location": "query",
  147455. // "type": "string"
  147456. // },
  147457. // "pageToken": {
  147458. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  147459. // "location": "query",
  147460. // "type": "string"
  147461. // },
  147462. // "project": {
  147463. // "description": "Project ID for this request.",
  147464. // "location": "path",
  147465. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  147466. // "required": true,
  147467. // "type": "string"
  147468. // },
  147469. // "zone": {
  147470. // "description": "Name of the zone for request.",
  147471. // "location": "path",
  147472. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  147473. // "required": true,
  147474. // "type": "string"
  147475. // }
  147476. // },
  147477. // "path": "{project}/zones/{zone}/operations",
  147478. // "response": {
  147479. // "$ref": "OperationList"
  147480. // },
  147481. // "scopes": [
  147482. // "https://www.googleapis.com/auth/cloud-platform",
  147483. // "https://www.googleapis.com/auth/compute",
  147484. // "https://www.googleapis.com/auth/compute.readonly"
  147485. // ]
  147486. // }
  147487. }
  147488. // Pages invokes f for each page of results.
  147489. // A non-nil error returned from f will halt the iteration.
  147490. // The provided context supersedes any context provided to the Context method.
  147491. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  147492. c.ctx_ = ctx
  147493. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  147494. for {
  147495. x, err := c.Do()
  147496. if err != nil {
  147497. return err
  147498. }
  147499. if err := f(x); err != nil {
  147500. return err
  147501. }
  147502. if x.NextPageToken == "" {
  147503. return nil
  147504. }
  147505. c.PageToken(x.NextPageToken)
  147506. }
  147507. }
  147508. // method id "compute.zoneOperations.wait":
  147509. type ZoneOperationsWaitCall struct {
  147510. s *Service
  147511. project string
  147512. zone string
  147513. operation string
  147514. urlParams_ gensupport.URLParams
  147515. ctx_ context.Context
  147516. header_ http.Header
  147517. }
  147518. // Wait: Waits for the specified zone-specific Operations resource until
  147519. // it is done or timeout, and retrieves the specified Operations
  147520. // resource. 1. Immediately returns when the operation is already done.
  147521. // 2. Waits for no more than the default deadline (2 minutes, subject to
  147522. // change) and then returns the current state of the operation, which
  147523. // may be DONE or still in progress. 3. Is best-effort: a. The server
  147524. // can wait less than the default deadline or zero seconds, in overload
  147525. // situations. b. There is no guarantee that the operation is actually
  147526. // done when returns. 4. User should be prepared to retry if the
  147527. // operation is not DONE.
  147528. func (r *ZoneOperationsService) Wait(project string, zone string, operation string) *ZoneOperationsWaitCall {
  147529. c := &ZoneOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  147530. c.project = project
  147531. c.zone = zone
  147532. c.operation = operation
  147533. return c
  147534. }
  147535. // Fields allows partial responses to be retrieved. See
  147536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  147537. // for more information.
  147538. func (c *ZoneOperationsWaitCall) Fields(s ...googleapi.Field) *ZoneOperationsWaitCall {
  147539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  147540. return c
  147541. }
  147542. // Context sets the context to be used in this call's Do method. Any
  147543. // pending HTTP request will be aborted if the provided context is
  147544. // canceled.
  147545. func (c *ZoneOperationsWaitCall) Context(ctx context.Context) *ZoneOperationsWaitCall {
  147546. c.ctx_ = ctx
  147547. return c
  147548. }
  147549. // Header returns an http.Header that can be modified by the caller to
  147550. // add HTTP headers to the request.
  147551. func (c *ZoneOperationsWaitCall) Header() http.Header {
  147552. if c.header_ == nil {
  147553. c.header_ = make(http.Header)
  147554. }
  147555. return c.header_
  147556. }
  147557. func (c *ZoneOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  147558. reqHeaders := make(http.Header)
  147559. for k, v := range c.header_ {
  147560. reqHeaders[k] = v
  147561. }
  147562. reqHeaders.Set("User-Agent", c.s.userAgent())
  147563. var body io.Reader = nil
  147564. c.urlParams_.Set("alt", alt)
  147565. c.urlParams_.Set("prettyPrint", "false")
  147566. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}/wait")
  147567. urls += "?" + c.urlParams_.Encode()
  147568. req, err := http.NewRequest("POST", urls, body)
  147569. if err != nil {
  147570. return nil, err
  147571. }
  147572. req.Header = reqHeaders
  147573. googleapi.Expand(req.URL, map[string]string{
  147574. "project": c.project,
  147575. "zone": c.zone,
  147576. "operation": c.operation,
  147577. })
  147578. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  147579. }
  147580. // Do executes the "compute.zoneOperations.wait" call.
  147581. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  147582. // status code is an error. Response headers are in either
  147583. // *Operation.ServerResponse.Header or (if a response was returned at
  147584. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  147585. // to check whether the returned error was because
  147586. // http.StatusNotModified was returned.
  147587. func (c *ZoneOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  147588. gensupport.SetOptions(c.urlParams_, opts...)
  147589. res, err := c.doRequest("json")
  147590. if res != nil && res.StatusCode == http.StatusNotModified {
  147591. if res.Body != nil {
  147592. res.Body.Close()
  147593. }
  147594. return nil, &googleapi.Error{
  147595. Code: res.StatusCode,
  147596. Header: res.Header,
  147597. }
  147598. }
  147599. if err != nil {
  147600. return nil, err
  147601. }
  147602. defer googleapi.CloseBody(res)
  147603. if err := googleapi.CheckResponse(res); err != nil {
  147604. return nil, err
  147605. }
  147606. ret := &Operation{
  147607. ServerResponse: googleapi.ServerResponse{
  147608. Header: res.Header,
  147609. HTTPStatusCode: res.StatusCode,
  147610. },
  147611. }
  147612. target := &ret
  147613. if err := gensupport.DecodeResponse(target, res); err != nil {
  147614. return nil, err
  147615. }
  147616. return ret, nil
  147617. // {
  147618. // "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.",
  147619. // "httpMethod": "POST",
  147620. // "id": "compute.zoneOperations.wait",
  147621. // "parameterOrder": [
  147622. // "project",
  147623. // "zone",
  147624. // "operation"
  147625. // ],
  147626. // "parameters": {
  147627. // "operation": {
  147628. // "description": "Name of the Operations resource to return.",
  147629. // "location": "path",
  147630. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  147631. // "required": true,
  147632. // "type": "string"
  147633. // },
  147634. // "project": {
  147635. // "description": "Project ID for this request.",
  147636. // "location": "path",
  147637. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  147638. // "required": true,
  147639. // "type": "string"
  147640. // },
  147641. // "zone": {
  147642. // "description": "Name of the zone for this request.",
  147643. // "location": "path",
  147644. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  147645. // "required": true,
  147646. // "type": "string"
  147647. // }
  147648. // },
  147649. // "path": "{project}/zones/{zone}/operations/{operation}/wait",
  147650. // "response": {
  147651. // "$ref": "Operation"
  147652. // },
  147653. // "scopes": [
  147654. // "https://www.googleapis.com/auth/cloud-platform",
  147655. // "https://www.googleapis.com/auth/compute",
  147656. // "https://www.googleapis.com/auth/compute.readonly"
  147657. // ]
  147658. // }
  147659. }
  147660. // method id "compute.zones.get":
  147661. type ZonesGetCall struct {
  147662. s *Service
  147663. project string
  147664. zone string
  147665. urlParams_ gensupport.URLParams
  147666. ifNoneMatch_ string
  147667. ctx_ context.Context
  147668. header_ http.Header
  147669. }
  147670. // Get: Returns the specified Zone resource. Gets a list of available
  147671. // zones by making a list() request.
  147672. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  147673. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  147674. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  147675. c.project = project
  147676. c.zone = zone
  147677. return c
  147678. }
  147679. // Fields allows partial responses to be retrieved. See
  147680. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  147681. // for more information.
  147682. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  147683. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  147684. return c
  147685. }
  147686. // IfNoneMatch sets the optional parameter which makes the operation
  147687. // fail if the object's ETag matches the given value. This is useful for
  147688. // getting updates only after the object has changed since the last
  147689. // request. Use googleapi.IsNotModified to check whether the response
  147690. // error from Do is the result of In-None-Match.
  147691. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  147692. c.ifNoneMatch_ = entityTag
  147693. return c
  147694. }
  147695. // Context sets the context to be used in this call's Do method. Any
  147696. // pending HTTP request will be aborted if the provided context is
  147697. // canceled.
  147698. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  147699. c.ctx_ = ctx
  147700. return c
  147701. }
  147702. // Header returns an http.Header that can be modified by the caller to
  147703. // add HTTP headers to the request.
  147704. func (c *ZonesGetCall) Header() http.Header {
  147705. if c.header_ == nil {
  147706. c.header_ = make(http.Header)
  147707. }
  147708. return c.header_
  147709. }
  147710. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  147711. reqHeaders := make(http.Header)
  147712. for k, v := range c.header_ {
  147713. reqHeaders[k] = v
  147714. }
  147715. reqHeaders.Set("User-Agent", c.s.userAgent())
  147716. if c.ifNoneMatch_ != "" {
  147717. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  147718. }
  147719. var body io.Reader = nil
  147720. c.urlParams_.Set("alt", alt)
  147721. c.urlParams_.Set("prettyPrint", "false")
  147722. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  147723. urls += "?" + c.urlParams_.Encode()
  147724. req, err := http.NewRequest("GET", urls, body)
  147725. if err != nil {
  147726. return nil, err
  147727. }
  147728. req.Header = reqHeaders
  147729. googleapi.Expand(req.URL, map[string]string{
  147730. "project": c.project,
  147731. "zone": c.zone,
  147732. })
  147733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  147734. }
  147735. // Do executes the "compute.zones.get" call.
  147736. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  147737. // code is an error. Response headers are in either
  147738. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  147739. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  147740. // whether the returned error was because http.StatusNotModified was
  147741. // returned.
  147742. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  147743. gensupport.SetOptions(c.urlParams_, opts...)
  147744. res, err := c.doRequest("json")
  147745. if res != nil && res.StatusCode == http.StatusNotModified {
  147746. if res.Body != nil {
  147747. res.Body.Close()
  147748. }
  147749. return nil, &googleapi.Error{
  147750. Code: res.StatusCode,
  147751. Header: res.Header,
  147752. }
  147753. }
  147754. if err != nil {
  147755. return nil, err
  147756. }
  147757. defer googleapi.CloseBody(res)
  147758. if err := googleapi.CheckResponse(res); err != nil {
  147759. return nil, err
  147760. }
  147761. ret := &Zone{
  147762. ServerResponse: googleapi.ServerResponse{
  147763. Header: res.Header,
  147764. HTTPStatusCode: res.StatusCode,
  147765. },
  147766. }
  147767. target := &ret
  147768. if err := gensupport.DecodeResponse(target, res); err != nil {
  147769. return nil, err
  147770. }
  147771. return ret, nil
  147772. // {
  147773. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  147774. // "httpMethod": "GET",
  147775. // "id": "compute.zones.get",
  147776. // "parameterOrder": [
  147777. // "project",
  147778. // "zone"
  147779. // ],
  147780. // "parameters": {
  147781. // "project": {
  147782. // "description": "Project ID for this request.",
  147783. // "location": "path",
  147784. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  147785. // "required": true,
  147786. // "type": "string"
  147787. // },
  147788. // "zone": {
  147789. // "description": "Name of the zone resource to return.",
  147790. // "location": "path",
  147791. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  147792. // "required": true,
  147793. // "type": "string"
  147794. // }
  147795. // },
  147796. // "path": "{project}/zones/{zone}",
  147797. // "response": {
  147798. // "$ref": "Zone"
  147799. // },
  147800. // "scopes": [
  147801. // "https://www.googleapis.com/auth/cloud-platform",
  147802. // "https://www.googleapis.com/auth/compute",
  147803. // "https://www.googleapis.com/auth/compute.readonly"
  147804. // ]
  147805. // }
  147806. }
  147807. // method id "compute.zones.list":
  147808. type ZonesListCall struct {
  147809. s *Service
  147810. project string
  147811. urlParams_ gensupport.URLParams
  147812. ifNoneMatch_ string
  147813. ctx_ context.Context
  147814. header_ http.Header
  147815. }
  147816. // List: Retrieves the list of Zone resources available to the specified
  147817. // project.
  147818. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  147819. func (r *ZonesService) List(project string) *ZonesListCall {
  147820. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  147821. c.project = project
  147822. return c
  147823. }
  147824. // Filter sets the optional parameter "filter": A filter expression that
  147825. // filters resources listed in the response. The expression must specify
  147826. // the field name, a comparison operator, and the value that you want to
  147827. // use for filtering. The value must be a string, a number, or a
  147828. // boolean. The comparison operator must be either =, !=, >, or <.
  147829. //
  147830. // For example, if you are filtering Compute Engine instances, you can
  147831. // exclude instances named example-instance by specifying name !=
  147832. // example-instance.
  147833. //
  147834. // You can also filter nested fields. For example, you could specify
  147835. // scheduling.automaticRestart = false to include instances only if they
  147836. // are not scheduled for automatic restarts. You can use filtering on
  147837. // nested fields to filter based on resource labels.
  147838. //
  147839. // To filter on multiple expressions, provide each separate expression
  147840. // within parentheses. For example, (scheduling.automaticRestart = true)
  147841. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  147842. // AND expression. However, you can include AND and OR expressions
  147843. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  147844. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  147845. // true).
  147846. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  147847. c.urlParams_.Set("filter", filter)
  147848. return c
  147849. }
  147850. // MaxResults sets the optional parameter "maxResults": The maximum
  147851. // number of results per page that should be returned. If the number of
  147852. // available results is larger than maxResults, Compute Engine returns a
  147853. // nextPageToken that can be used to get the next page of results in
  147854. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  147855. // (Default: 500)
  147856. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  147857. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  147858. return c
  147859. }
  147860. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  147861. // a certain order. By default, results are returned in alphanumerical
  147862. // order based on the resource name.
  147863. //
  147864. // You can also sort results in descending order based on the creation
  147865. // timestamp using orderBy="creationTimestamp desc". This sorts results
  147866. // based on the creationTimestamp field in reverse chronological order
  147867. // (newest result first). Use this to sort resources like operations so
  147868. // that the newest operation is returned first.
  147869. //
  147870. // Currently, only sorting by name or creationTimestamp desc is
  147871. // supported.
  147872. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  147873. c.urlParams_.Set("orderBy", orderBy)
  147874. return c
  147875. }
  147876. // PageToken sets the optional parameter "pageToken": Specifies a page
  147877. // token to use. Set pageToken to the nextPageToken returned by a
  147878. // previous list request to get the next page of results.
  147879. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  147880. c.urlParams_.Set("pageToken", pageToken)
  147881. return c
  147882. }
  147883. // Fields allows partial responses to be retrieved. See
  147884. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  147885. // for more information.
  147886. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  147887. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  147888. return c
  147889. }
  147890. // IfNoneMatch sets the optional parameter which makes the operation
  147891. // fail if the object's ETag matches the given value. This is useful for
  147892. // getting updates only after the object has changed since the last
  147893. // request. Use googleapi.IsNotModified to check whether the response
  147894. // error from Do is the result of In-None-Match.
  147895. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  147896. c.ifNoneMatch_ = entityTag
  147897. return c
  147898. }
  147899. // Context sets the context to be used in this call's Do method. Any
  147900. // pending HTTP request will be aborted if the provided context is
  147901. // canceled.
  147902. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  147903. c.ctx_ = ctx
  147904. return c
  147905. }
  147906. // Header returns an http.Header that can be modified by the caller to
  147907. // add HTTP headers to the request.
  147908. func (c *ZonesListCall) Header() http.Header {
  147909. if c.header_ == nil {
  147910. c.header_ = make(http.Header)
  147911. }
  147912. return c.header_
  147913. }
  147914. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  147915. reqHeaders := make(http.Header)
  147916. for k, v := range c.header_ {
  147917. reqHeaders[k] = v
  147918. }
  147919. reqHeaders.Set("User-Agent", c.s.userAgent())
  147920. if c.ifNoneMatch_ != "" {
  147921. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  147922. }
  147923. var body io.Reader = nil
  147924. c.urlParams_.Set("alt", alt)
  147925. c.urlParams_.Set("prettyPrint", "false")
  147926. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  147927. urls += "?" + c.urlParams_.Encode()
  147928. req, err := http.NewRequest("GET", urls, body)
  147929. if err != nil {
  147930. return nil, err
  147931. }
  147932. req.Header = reqHeaders
  147933. googleapi.Expand(req.URL, map[string]string{
  147934. "project": c.project,
  147935. })
  147936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  147937. }
  147938. // Do executes the "compute.zones.list" call.
  147939. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  147940. // code is an error. Response headers are in either
  147941. // *ZoneList.ServerResponse.Header or (if a response was returned at
  147942. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  147943. // to check whether the returned error was because
  147944. // http.StatusNotModified was returned.
  147945. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  147946. gensupport.SetOptions(c.urlParams_, opts...)
  147947. res, err := c.doRequest("json")
  147948. if res != nil && res.StatusCode == http.StatusNotModified {
  147949. if res.Body != nil {
  147950. res.Body.Close()
  147951. }
  147952. return nil, &googleapi.Error{
  147953. Code: res.StatusCode,
  147954. Header: res.Header,
  147955. }
  147956. }
  147957. if err != nil {
  147958. return nil, err
  147959. }
  147960. defer googleapi.CloseBody(res)
  147961. if err := googleapi.CheckResponse(res); err != nil {
  147962. return nil, err
  147963. }
  147964. ret := &ZoneList{
  147965. ServerResponse: googleapi.ServerResponse{
  147966. Header: res.Header,
  147967. HTTPStatusCode: res.StatusCode,
  147968. },
  147969. }
  147970. target := &ret
  147971. if err := gensupport.DecodeResponse(target, res); err != nil {
  147972. return nil, err
  147973. }
  147974. return ret, nil
  147975. // {
  147976. // "description": "Retrieves the list of Zone resources available to the specified project.",
  147977. // "httpMethod": "GET",
  147978. // "id": "compute.zones.list",
  147979. // "parameterOrder": [
  147980. // "project"
  147981. // ],
  147982. // "parameters": {
  147983. // "filter": {
  147984. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  147985. // "location": "query",
  147986. // "type": "string"
  147987. // },
  147988. // "maxResults": {
  147989. // "default": "500",
  147990. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  147991. // "format": "uint32",
  147992. // "location": "query",
  147993. // "minimum": "0",
  147994. // "type": "integer"
  147995. // },
  147996. // "orderBy": {
  147997. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  147998. // "location": "query",
  147999. // "type": "string"
  148000. // },
  148001. // "pageToken": {
  148002. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  148003. // "location": "query",
  148004. // "type": "string"
  148005. // },
  148006. // "project": {
  148007. // "description": "Project ID for this request.",
  148008. // "location": "path",
  148009. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  148010. // "required": true,
  148011. // "type": "string"
  148012. // }
  148013. // },
  148014. // "path": "{project}/zones",
  148015. // "response": {
  148016. // "$ref": "ZoneList"
  148017. // },
  148018. // "scopes": [
  148019. // "https://www.googleapis.com/auth/cloud-platform",
  148020. // "https://www.googleapis.com/auth/compute",
  148021. // "https://www.googleapis.com/auth/compute.readonly"
  148022. // ]
  148023. // }
  148024. }
  148025. // Pages invokes f for each page of results.
  148026. // A non-nil error returned from f will halt the iteration.
  148027. // The provided context supersedes any context provided to the Context method.
  148028. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  148029. c.ctx_ = ctx
  148030. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  148031. for {
  148032. x, err := c.Do()
  148033. if err != nil {
  148034. return err
  148035. }
  148036. if err := f(x); err != nil {
  148037. return err
  148038. }
  148039. if x.NextPageToken == "" {
  148040. return nil
  148041. }
  148042. c.PageToken(x.NextPageToken)
  148043. }
  148044. }